diff --git a/lib/config/shared_pref_kay.dart b/lib/config/shared_pref_kay.dart index 8a90edf6..36dbdaf1 100644 --- a/lib/config/shared_pref_kay.dart +++ b/lib/config/shared_pref_kay.dart @@ -1,4 +1,5 @@ final TOKEN = 'token'; -final PROJECT_ID="projectID"; -final SLECTED_PATIENT_TYPE="slectedPatientType"; -final APP_Language = "language"; \ No newline at end of file +final PROJECT_ID='projectID'; +final SLECTED_PATIENT_TYPE='slectedPatientType'; +final APP_Language = 'language'; +final DOCTOR_PROFILE = 'doctorProfile'; \ No newline at end of file diff --git a/lib/models/doctor_profile_model.dart b/lib/models/doctor_profile_model.dart new file mode 100644 index 00000000..17625968 --- /dev/null +++ b/lib/models/doctor_profile_model.dart @@ -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 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 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(); + 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 toJson() { + final Map data = new Map(); + 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; + } +} diff --git a/lib/models/patient/prescription_res_model.dart b/lib/models/patient/prescription_res_model.dart index 7bb545ee..9c7e296d 100644 --- a/lib/models/patient/prescription_res_model.dart +++ b/lib/models/patient/prescription_res_model.dart @@ -38,7 +38,7 @@ class PrescriptionResModel { String nationalityFlagURL; int noOfPatientsRate; String qR; - List speciality; + List speciality; PrescriptionResModel( {this.setupID, @@ -108,7 +108,7 @@ class PrescriptionResModel { nationalityFlagURL = json['NationalityFlagURL']; noOfPatientsRate = json['NoOfPatientsRate']; qR = json['QR']; - speciality = json['Speciality'].cast(); + speciality = json['Speciality']; } Map toJson() { diff --git a/lib/providers/patients_provider.dart b/lib/providers/patients_provider.dart index afe24758..9e6ef767 100644 --- a/lib/providers/patients_provider.dart +++ b/lib/providers/patients_provider.dart @@ -5,6 +5,7 @@ import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/prescription_req_model.dart'; import 'package:doctor_app_flutter/models/patient/prescription_res_model.dart'; import 'package:doctor_app_flutter/models/patient/radiology_res_model.dart'; +import 'package:doctor_app_flutter/widgets/auth/login_form.dart'; import 'package:flutter/cupertino.dart'; import 'package:http/http.dart'; import 'package:http_interceptor/http_client_with_interceptor.dart'; @@ -23,6 +24,7 @@ const GET_PATIENT_LAB_OREDERS = const GET_PRESCRIPTION = BASE_URL + 'Patients.svc/REST/GetPrescriptionApptList'; const GET_RADIOLOGY = BASE_URL + 'DoctorApplication.svc/REST/GetPatientRadResult'; +Helpers helpers = Helpers(); class PatientsProvider with ChangeNotifier { bool isLoading = false; @@ -77,8 +79,8 @@ class PatientsProvider with ChangeNotifier { //*********************** return Future.value(json.decode(response.body)); - } catch (error) { - throw error; + } catch (err) { + throw err; } } @@ -129,8 +131,8 @@ class PatientsProvider with ChangeNotifier { error = 'Please Check The Internet Connection'; } notifyListeners(); - } catch (error) { - throw error; + } catch (err) { + handelCatchErrorCase(err); } } @@ -169,7 +171,6 @@ class PatientsProvider with ChangeNotifier { print('$res'); if (res['MessageStatus'] == 1) { patientLabResultOrdersList = []; - print("res['List_GetLabOreders']"); res['List_GetLabOreders'].forEach((v) { patientLabResultOrdersList.add(new LabOrdersResModel.fromJson(v)); }); @@ -184,8 +185,8 @@ class PatientsProvider with ChangeNotifier { error = 'Please Check The Internet Connection'; } notifyListeners(); - } catch (error) { - throw error; + } catch (err) { + handelCatchErrorCase(err); } } @@ -215,7 +216,6 @@ class PatientsProvider with ChangeNotifier { print('$res'); if (res['MessageStatus'] == 1) { patientPrescriptionsList = []; - print("res['PatientPrescriptionList']"); res['PatientPrescriptionList'].forEach((v) { patientPrescriptionsList .add(new PrescriptionResModel.fromJson(v)); @@ -231,11 +231,25 @@ class PatientsProvider with ChangeNotifier { error = 'Please Check The Internet Connection'; } notifyListeners(); - } catch (error) { - throw error; + } catch (err) { + handelCatchErrorCase(err); } } + /*@author: Elham Rababah + *@Date:12/5/2020 + *@param: patient + *@return: + *@desc: getPatientRadiology + */ + handelCatchErrorCase(err) { + isLoading = false; + isError = true; + error = helpers.generateContactAdminMsg(err); + notifyListeners(); + throw err; + } + /*@author: Elham Rababah *@Date:3/5/2020 *@param: patient @@ -261,7 +275,6 @@ class PatientsProvider with ChangeNotifier { print('$res'); if (res['MessageStatus'] == 1) { patientRadiologyList = []; - print("res['List_GetRadOreders']"); res['List_GetRadOreders'].forEach((v) { patientRadiologyList.add(new RadiologyResModel.fromJson(v)); }); @@ -276,8 +289,8 @@ class PatientsProvider with ChangeNotifier { error = 'Please Check The Internet Connection'; } notifyListeners(); - } catch (error) { - throw error; + } catch (err) { + handelCatchErrorCase(err); } } } diff --git a/lib/providers/project_provider.dart b/lib/providers/project_provider.dart index abf53ea3..27dced84 100644 --- a/lib/providers/project_provider.dart +++ b/lib/providers/project_provider.dart @@ -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; diff --git a/lib/screens/patients/patient_search_screen.dart b/lib/screens/patients/patient_search_screen.dart index 4704b564..de2572f8 100644 --- a/lib/screens/patients/patient_search_screen.dart +++ b/lib/screens/patients/patient_search_screen.dart @@ -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,26 +61,22 @@ class _PatientSearchScreenState extends State { void _validateInputs() async { print("####IBRAHIM TEST#####" + _patientSearchFormValues.From); // _patientSearchFormValues.TokenID = - + List 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**** - if (_patientSearchFormValues.getFirstName == null || - _patientSearchFormValues.getMiddleName == null || - _patientSearchFormValues.getLastName == null || - _patientSearchFormValues.getPatientMobileNumber == null) { - _patientSearchFormValues.setFirstName = "0"; - _patientSearchFormValues.setLastName = "0"; - _patientSearchFormValues.setMiddleName = "0"; - _patientSearchFormValues.setPatientMobileNumber = "0"; - _patientSearchFormValues.setPatientID = 0; - _patientSearchFormValues.From = "0"; - _patientSearchFormValues.To = "0"; - - //_formKey.currentState.save(); - } else { + + _patientSearchFormValues.setFrom = "0"; + _patientSearchFormValues.setTo = "0"; + print("***************Check validate1*************"); + + print(_patientSearchFormValues.getFirstName.trim().length); + print("***************Check validate2*************"); _formKey.currentState.save(); - } - // _formKey.currentState.save(); + _patientSearchFormValues.setFrom = "0"; + _patientSearchFormValues.setTo = "0"; + //*********************************** */ sharedPref.setString(TOKEN, '@dm!n'); sharedPref.setString(SLECTED_PATIENT_TYPE, _selectedType); @@ -191,7 +188,18 @@ class _PatientSearchScreenState extends State { hintText: 'First Name', onSaved: (value) { // _patientSearchFormValues.FirstName = value; - _patientSearchFormValues.setFirstName = value; + value == null + ? _patientSearchFormValues.setFirstName = + "0" + : _patientSearchFormValues.setFirstName = + value; + print("**********Value********"); + print(value.toString().trim().isEmpty); + print("**********Value********"); + if (value.toString().trim().isEmpty) { + + _patientSearchFormValues.setFirstName = "0"; + } }, // validator: (value) { // return TextValidator().validateName(value); @@ -203,7 +211,19 @@ class _PatientSearchScreenState extends State { AppTextFormField( hintText: 'Middle Name', onSaved: (value) { - _patientSearchFormValues.MiddleName = value; + //_patientSearchFormValues.MiddleName = value; + + value == null + ? _patientSearchFormValues.setMiddleName = + "0" + : _patientSearchFormValues.setMiddleName = + value; + + // value.toString().trim().isEmpty + // ? _patientSearchFormValues.setMiddleName = + // "0" + // : _patientSearchFormValues.setMiddleName = + // value; }, // validator: (value) { // return TextValidator().validateName(value); @@ -215,7 +235,16 @@ class _PatientSearchScreenState extends State { AppTextFormField( hintText: 'Last Name', onSaved: (value) { - _patientSearchFormValues.LastName = value; + // _patientSearchFormValues.LastName = value; + value == null + ? _patientSearchFormValues.setLastName = "0" + : _patientSearchFormValues.setLastName = + value; + + // value.toString().trim().isEmpty + // ? _patientSearchFormValues.setLastName = "0" + // : _patientSearchFormValues.setLastName = + // value; }, // validator: (value) { // return TextValidator().validateName(value); @@ -232,8 +261,13 @@ class _PatientSearchScreenState extends State { // }, inputFormatter: ONLY_NUMBERS, onSaved: (value) { - _patientSearchFormValues.PatientMobileNumber = - value; + value == null + ? _patientSearchFormValues + .setPatientMobileNumber = "0" + : _patientSearchFormValues + .setPatientMobileNumber = value; + // _patientSearchFormValues.PatientMobileNumber = + // value; }, ), SizedBox( @@ -245,7 +279,12 @@ class _PatientSearchScreenState extends State { // inputFormatter: ONLY_NUMBERS, onSaved: (value) { - _patientSearchFormValues.PatientID = 89000; + // _patientSearchFormValues.PatientID = 89000; + + value == null + ? _patientSearchFormValues.setPatientID = 0 + : _patientSearchFormValues.setPatientID = + int.parse(value); }), SizedBox( height: 10, diff --git a/lib/screens/patients/patients_screen.dart b/lib/screens/patients/patients_screen.dart index 676f9589..c8d70165 100644 --- a/lib/screens/patients/patients_screen.dart +++ b/lib/screens/patients/patients_screen.dart @@ -236,18 +236,25 @@ class _PatientsScreenState extends State { String date; DateTime checkedTime = DateTime.parse(dateString); DateTime currentTime = DateTime.now(); - + // print("currentTime.day="+currentTime.day.toString()); + // print("checkedTime.day="+checkedTime.day.toString()); + // print("currentTime.month="+currentTime.month.toString()); + // print("checkedTime.month="+checkedTime.month.toString()); + // print("currentTime.year="+currentTime.year.toString()); + // print("checkedTime.year="+checkedTime.year.toString()); if ((currentTime.year == checkedTime.year) && (currentTime.month == checkedTime.month) && (currentTime.day == checkedTime.day)) { - return "TODAY"; + + return "Today"; } else if ((currentTime.year == checkedTime.year) && (currentTime.month == checkedTime.month)) { if ((currentTime.day - checkedTime.day) == 1) { return "YESTERDAY"; } else if ((currentTime.day - checkedTime.day) == -1) { - return "TOMORROW"; + return "Tomorrow"; } + if ((currentTime.day - checkedTime.day) <= -2) { return "Next Week"; } else { diff --git a/lib/screens/patients/profile/lab_result/lab_orders_screen.dart b/lib/screens/patients/profile/lab_result/lab_orders_screen.dart index d26ab4c7..ae2bc1d8 100644 --- a/lib/screens/patients/profile/lab_result/lab_orders_screen.dart +++ b/lib/screens/patients/profile/lab_result/lab_orders_screen.dart @@ -1,3 +1,4 @@ +import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; @@ -78,19 +79,9 @@ class _LabOrdersScreenState extends State { body: patientsProv.isLoading ? DrAppCircularProgressIndeicator() : patientsProv.isError - ? Center( - child: Text( - patientsProv.error, - style: TextStyle(color: Theme.of(context).errorColor), - ), - ) + ? DrAppEmbeddedError(error: patientsProv.error) : patientsProv.patientLabResultOrdersList.length == 0 - ? Center( - child: Text( - 'You don\'t have any Orders', - style: TextStyle(color: Theme.of(context).errorColor), - ), - ) + ? DrAppEmbeddedError(error: 'You don\'t have any Orders') : Container( margin: EdgeInsets.fromLTRB( SizeConfig.realScreenWidth * 0.05, diff --git a/lib/screens/patients/profile/prescriptions/prescriptions_screen.dart b/lib/screens/patients/profile/prescriptions/prescriptions_screen.dart index 47fff706..3bded248 100644 --- a/lib/screens/patients/profile/prescriptions/prescriptions_screen.dart +++ b/lib/screens/patients/profile/prescriptions/prescriptions_screen.dart @@ -12,6 +12,7 @@ import '../../../../widgets/shared/app_texts_widget.dart'; import '../../../../widgets/shared/card_with_bg_widget.dart'; import '../../../../widgets/shared/dr_app_circular_progress_Indeicator.dart'; import '../../../../widgets/shared/profile_image_widget.dart'; +import '../../../../widgets/shared/errors/dr_app_embedded_error.dart'; DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); @@ -78,19 +79,10 @@ class _PrescriptionScreenState extends State { body: patientsProv.isLoading ? DrAppCircularProgressIndeicator() : patientsProv.isError - ? Center( - child: Text( - patientsProv.error, - style: TextStyle(color: Theme.of(context).errorColor), - ), - ) + ? DrAppEmbeddedError(error: patientsProv.error) : patientsProv.patientPrescriptionsList.length == 0 - ? Center( - child: Text( - 'You don\'t have any Prescriptions', - style: TextStyle(color: Theme.of(context).errorColor), - ), - ) + ? DrAppEmbeddedError( + error: 'You don\'t have any Prescriptions') : Container( margin: EdgeInsets.fromLTRB( SizeConfig.realScreenWidth * 0.05, diff --git a/lib/screens/patients/profile/radiology/radiology_screen.dart b/lib/screens/patients/profile/radiology/radiology_screen.dart index 8b48e88c..e5dd68f7 100644 --- a/lib/screens/patients/profile/radiology/radiology_screen.dart +++ b/lib/screens/patients/profile/radiology/radiology_screen.dart @@ -1,3 +1,4 @@ +import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; @@ -78,19 +79,9 @@ class _RadiologyScreenState extends State { body: patientsProv.isLoading ? DrAppCircularProgressIndeicator() : patientsProv.isError - ? Center( - child: Text( - patientsProv.error, - style: TextStyle(color: Theme.of(context).errorColor), - ), - ) + ? DrAppEmbeddedError(error: patientsProv.error) : patientsProv.patientRadiologyList.length == 0 - ? Center( - child: Text( - 'You don\'t have any Vital Sign', - style: TextStyle(color: Theme.of(context).errorColor), - ), - ) + ? DrAppEmbeddedError(error: 'You don\'t have any Vital Sign') : Container( margin: EdgeInsets.fromLTRB( SizeConfig.realScreenWidth * 0.05, @@ -120,11 +111,12 @@ class _RadiologyScreenState extends State { CrossAxisAlignment.start, children: [ AppText( - '${patientsProv.patientRadiologyList[index].doctorName}', - fontSize: 2.5 * - SizeConfig.textMultiplier, - fontWeight: FontWeight.bold - ), + '${patientsProv.patientRadiologyList[index].doctorName}', + fontSize: 2.5 * + SizeConfig + .textMultiplier, + fontWeight: + FontWeight.bold), SizedBox( height: 8, ), @@ -132,7 +124,6 @@ class _RadiologyScreenState extends State { 'Invoice No:${patientsProv.patientRadiologyList[index].invoiceNo}', fontSize: 2 * SizeConfig.textMultiplier, - ), SizedBox( height: 8, diff --git a/lib/screens/patients/profile/vital_sign/vital_sign_screen.dart b/lib/screens/patients/profile/vital_sign/vital_sign_screen.dart index 570a5aa1..8b08f8ac 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sign_screen.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sign_screen.dart @@ -1,4 +1,5 @@ import 'package:doctor_app_flutter/routes.dart'; +import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; @@ -81,19 +82,9 @@ class _VitalSignScreenState extends State { body: patientsProv.isLoading ? DrAppCircularProgressIndeicator() : patientsProv.isError - ? Center( - child: Text( - patientsProv.error, - style: TextStyle(color: Theme.of(context).errorColor), - ), - ) + ? DrAppEmbeddedError(error: patientsProv.error) : patientsProv.patientVitalSignList.length == 0 - ? Center( - child: Text( - 'You don\'t have any Vital Sign', - style: TextStyle(color: Theme.of(context).errorColor), - ), - ) + ? DrAppEmbeddedError(error: 'You don\'t have any Vital Sign') : Container( margin: EdgeInsets.fromLTRB( SizeConfig.realScreenWidth * 0.05, @@ -151,7 +142,11 @@ class _VitalSignScreenState extends State { ), ), onTap: () { - Navigator.of(context).pushNamed(VITAL_SIGN_DETAILS,arguments: {'vitalSing':patientsProv.patientVitalSignList[index]}); + Navigator.of(context) + .pushNamed(VITAL_SIGN_DETAILS, arguments: { + 'vitalSing': + patientsProv.patientVitalSignList[index] + }); }, ); }), diff --git a/lib/util/helpers.dart b/lib/util/helpers.dart index a0a54c72..2065ea57 100644 --- a/lib/util/helpers.dart +++ b/lib/util/helpers.dart @@ -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(), @@ -70,7 +70,7 @@ class Helpers { *@desc: showErrorToast */ showErrorToast([msg = null]) { - String localMsg = 'Something wrong happened, please contact the admin'; + String localMsg = generateContactAdminMsg(); if (msg != null) { localMsg = msg.toString(); @@ -96,4 +96,22 @@ class Helpers { return false; } } +/* + *@author: Elham Rababah + *@Date:12/5/2020 + *@param: + *@return: String + *@desc: generate Contact Admin Msg + */ +generateContactAdminMsg([err = null]) { + String localMsg = 'Something wrong happened, please contact the admin'; + if (err != null) { + localMsg = localMsg +'\n \n'+ err.toString(); + } + return localMsg; + } + +} + + diff --git a/lib/widgets/auth/verfiy_account.dart b/lib/widgets/auth/verfiy_account.dart index 0cdbd931..df134102 100644 --- a/lib/widgets/auth/verfiy_account.dart +++ b/lib/widgets/auth/verfiy_account.dart @@ -288,6 +288,7 @@ class _VerifyAccountState extends State { 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']); diff --git a/lib/widgets/shared/errors/dr_app_embedded_error.dart b/lib/widgets/shared/errors/dr_app_embedded_error.dart new file mode 100644 index 00000000..6bac4a2c --- /dev/null +++ b/lib/widgets/shared/errors/dr_app_embedded_error.dart @@ -0,0 +1,28 @@ +import 'package:flutter/material.dart'; + +/* + *@author: Elham Rababah + *@Date:12/5/2020 + *@param: error + *@return: StatelessWidget + *@desc: DrAppEmbeddedError class + */ +class DrAppEmbeddedError extends StatelessWidget { + const DrAppEmbeddedError({ + Key key, + @required this.error, + }) : super(key: key); + + final String error; + + @override + Widget build(BuildContext context) { + return Center( + child: Text( + error, + style: TextStyle(color: Theme.of(context).errorColor), + textAlign: TextAlign.center, + ), + ); + } +} \ No newline at end of file