add doctor profile to shaerd pref

merge-requests/56/head
Elham Rababah 6 years ago
parent 17ba899b8e
commit bc395c3fcc

@ -1,4 +1,5 @@
final TOKEN = 'token';
final PROJECT_ID="projectID";
final SLECTED_PATIENT_TYPE="slectedPatientType";
final APP_Language = "language";
final APP_Language = "language";
final DOCTOR_PROFILE = 'doctorProfile';

@ -0,0 +1,176 @@
class DoctorProfileModel {
int doctorID;
String doctorName;
Null doctorNameN;
int clinicID;
String clinicDescription;
Null clinicDescriptionN;
Null licenseExpiry;
int employmentType;
Null setupID;
int projectID;
String projectName;
String nationalityID;
String nationalityName;
Null nationalityNameN;
int gender;
String genderDescription;
Null genderDescriptionN;
Null doctorTitle;
Null projectNameN;
bool isAllowWaitList;
String titleDescription;
Null titleDescriptionN;
Null isRegistered;
Null isDoctorDummy;
bool isActive;
Null isDoctorAppointmentDisplayed;
bool doctorClinicActive;
Null isbookingAllowed;
String doctorCases;
Null doctorPicture;
String doctorProfileInfo;
List<String> specialty;
int actualDoctorRate;
String doctorImageURL;
int doctorRate;
String doctorTitleForProfile;
bool isAppointmentAllowed;
String nationalityFlagURL;
int noOfPatientsRate;
String qR;
int serviceID;
DoctorProfileModel(
{this.doctorID,
this.doctorName,
this.doctorNameN,
this.clinicID,
this.clinicDescription,
this.clinicDescriptionN,
this.licenseExpiry,
this.employmentType,
this.setupID,
this.projectID,
this.projectName,
this.nationalityID,
this.nationalityName,
this.nationalityNameN,
this.gender,
this.genderDescription,
this.genderDescriptionN,
this.doctorTitle,
this.projectNameN,
this.isAllowWaitList,
this.titleDescription,
this.titleDescriptionN,
this.isRegistered,
this.isDoctorDummy,
this.isActive,
this.isDoctorAppointmentDisplayed,
this.doctorClinicActive,
this.isbookingAllowed,
this.doctorCases,
this.doctorPicture,
this.doctorProfileInfo,
this.specialty,
this.actualDoctorRate,
this.doctorImageURL,
this.doctorRate,
this.doctorTitleForProfile,
this.isAppointmentAllowed,
this.nationalityFlagURL,
this.noOfPatientsRate,
this.qR,
this.serviceID});
DoctorProfileModel.fromJson(Map<String, dynamic> json) {
doctorID = json['DoctorID'];
doctorName = json['DoctorName'];
doctorNameN = json['DoctorNameN'];
clinicID = json['ClinicID'];
clinicDescription = json['ClinicDescription'];
clinicDescriptionN = json['ClinicDescriptionN'];
licenseExpiry = json['LicenseExpiry'];
employmentType = json['EmploymentType'];
setupID = json['SetupID'];
projectID = json['ProjectID'];
projectName = json['ProjectName'];
nationalityID = json['NationalityID'];
nationalityName = json['NationalityName'];
nationalityNameN = json['NationalityNameN'];
gender = json['Gender'];
genderDescription = json['Gender_Description'];
genderDescriptionN = json['Gender_DescriptionN'];
doctorTitle = json['DoctorTitle'];
projectNameN = json['ProjectNameN'];
isAllowWaitList = json['IsAllowWaitList'];
titleDescription = json['Title_Description'];
titleDescriptionN = json['Title_DescriptionN'];
isRegistered = json['IsRegistered'];
isDoctorDummy = json['IsDoctorDummy'];
isActive = json['IsActive'];
isDoctorAppointmentDisplayed = json['IsDoctorAppointmentDisplayed'];
doctorClinicActive = json['DoctorClinicActive'];
isbookingAllowed = json['IsbookingAllowed'];
doctorCases = json['DoctorCases'];
doctorPicture = json['DoctorPicture'];
doctorProfileInfo = json['DoctorProfileInfo'];
specialty = json['Specialty'].cast<String>();
actualDoctorRate = json['ActualDoctorRate'];
doctorImageURL = json['DoctorImageURL'];
doctorRate = json['DoctorRate'];
doctorTitleForProfile = json['DoctorTitleForProfile'];
isAppointmentAllowed = json['IsAppointmentAllowed'];
nationalityFlagURL = json['NationalityFlagURL'];
noOfPatientsRate = json['NoOfPatientsRate'];
qR = json['QR'];
serviceID = json['ServiceID'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['DoctorID'] = this.doctorID;
data['DoctorName'] = this.doctorName;
data['DoctorNameN'] = this.doctorNameN;
data['ClinicID'] = this.clinicID;
data['ClinicDescription'] = this.clinicDescription;
data['ClinicDescriptionN'] = this.clinicDescriptionN;
data['LicenseExpiry'] = this.licenseExpiry;
data['EmploymentType'] = this.employmentType;
data['SetupID'] = this.setupID;
data['ProjectID'] = this.projectID;
data['ProjectName'] = this.projectName;
data['NationalityID'] = this.nationalityID;
data['NationalityName'] = this.nationalityName;
data['NationalityNameN'] = this.nationalityNameN;
data['Gender'] = this.gender;
data['Gender_Description'] = this.genderDescription;
data['Gender_DescriptionN'] = this.genderDescriptionN;
data['DoctorTitle'] = this.doctorTitle;
data['ProjectNameN'] = this.projectNameN;
data['IsAllowWaitList'] = this.isAllowWaitList;
data['Title_Description'] = this.titleDescription;
data['Title_DescriptionN'] = this.titleDescriptionN;
data['IsRegistered'] = this.isRegistered;
data['IsDoctorDummy'] = this.isDoctorDummy;
data['IsActive'] = this.isActive;
data['IsDoctorAppointmentDisplayed'] = this.isDoctorAppointmentDisplayed;
data['DoctorClinicActive'] = this.doctorClinicActive;
data['IsbookingAllowed'] = this.isbookingAllowed;
data['DoctorCases'] = this.doctorCases;
data['DoctorPicture'] = this.doctorPicture;
data['DoctorProfileInfo'] = this.doctorProfileInfo;
data['Specialty'] = this.specialty;
data['ActualDoctorRate'] = this.actualDoctorRate;
data['DoctorImageURL'] = this.doctorImageURL;
data['DoctorRate'] = this.doctorRate;
data['DoctorTitleForProfile'] = this.doctorTitleForProfile;
data['IsAppointmentAllowed'] = this.isAppointmentAllowed;
data['NationalityFlagURL'] = this.nationalityFlagURL;
data['NoOfPatientsRate'] = this.noOfPatientsRate;
data['QR'] = this.qR;
data['ServiceID'] = this.serviceID;
return data;
}
}

@ -18,7 +18,7 @@ class ProjectProvider with ChangeNotifier{
}
void loadSharedPrefLanguage() async {
currentLanguage = await sharedPref.getString(APP_Language);
_appLocale = Locale(currentLanguage ?? 'ar');
_appLocale = Locale(currentLanguage ?? 'en');
_isArabic = currentLanguage != null
? currentLanguage == 'ar' ? true : false
: false;

@ -16,6 +16,7 @@ import 'package:flutter/rendering.dart';
import '../../lookups/patient_lookup.dart';
import '../../widgets/patients/dynamic_elements.dart';
import '../../config/config.dart';
import '../../models/doctor_profile_model.dart';
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
@ -60,7 +61,9 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
void _validateInputs() async {
print("####IBRAHIM TEST#####" + _patientSearchFormValues.From);
// _patientSearchFormValues.TokenID =
List <dynamic> doctorProfiles = await sharedPref.getObj(DOCTOR_PROFILE);
DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(doctorProfiles[0]);
print(doctorProfile.doctorName);
if (_formKey.currentState.validate()) {
// If all data are correct then save data to out variables
// _formKey.currentState.save();

@ -48,7 +48,7 @@ class Helpers {
children: items.map((item) {
return Text(
'${item["$decKey"]}',
style: TextStyle(fontSize: 20),
style: TextStyle(fontSize: SizeConfig.textMultiplier *3),
);
}).toList(),

@ -288,6 +288,7 @@ class _VerifyAccountState extends State<VerifyAccount> {
changeLoadingStata(false);
if (res['MessageStatus'] == 1) {
sharedPref.setString(TOKEN, res['AuthenticationTokenID']);
sharedPref.setObj(DOCTOR_PROFILE, res['List_DoctorProfile']);
Navigator.of(context).pushNamed(HOME);
} else {
helpers.showErrorToast(res['ErrorEndUserMessage']);

Loading…
Cancel
Save