diff --git a/lib/config/config.dart b/lib/config/config.dart index e14a544a..c2c1ef77 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -117,6 +117,8 @@ const GET_BLOOD_REQUEST = const REPORTS = 'Services/Doctors.svc/REST/GetPatientMedicalReportStatusInfo'; const INSERT_REQUEST_FOR_MEDICAL_REPORT = 'Services/Doctors.svc/REST/InsertRequestForMedicalReport'; +const SEND_MEDICAL_REPORT_EMAIL = + 'Services/Notifications.svc/REST/SendMedicalReportEmail'; ///Rate const IS_LAST_APPOITMENT_RATED = diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index dfd13cca..059b03ab 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -1154,4 +1154,12 @@ const Map localizedValues = { "en": "This service allows you to chat with customer service directly without the need to call.", "ar": "المحادثة المباشرة: هذه الخدمة تمكنك التحدث كتابياً مع خدمة العملاء مباشرة دون الحاجة الى الاتصال هاتفياً." }, + "last-appointment": { + "en": "How was your appointment?", + "ar": "كيف كان موعدك الطبي ؟" + }, + "rate-clinic": { + "en": "Please rate the clinic", + "ar": "يرجى تقييم العيادة" + }, }; diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index d58054c4..88b05610 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -4,6 +4,7 @@ import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/core/service/medical/vital_sign_service.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:flutter/cupertino.dart'; @@ -165,8 +166,10 @@ class BaseAppClient { await authenticatedUserObject.getUser(); Provider.of(AppGlobal.context, listen: false).isLogin = false; + var model = Provider.of(AppGlobal.context); _vitalSignService.weightKg = ""; _vitalSignService.heightCm = ""; + model.setState(0, false); Navigator.of(AppGlobal.context).pushReplacementNamed(HOME); } diff --git a/lib/core/service/medical/PatientSickLeaveService.dart b/lib/core/service/medical/PatientSickLeaveService.dart index b2bb16ef..bb60ee3b 100644 --- a/lib/core/service/medical/PatientSickLeaveService.dart +++ b/lib/core/service/medical/PatientSickLeaveService.dart @@ -21,7 +21,11 @@ class PatientSickLeaveService extends BaseService { } sendSickLeaveEmail( - {int requestNo, String projectName, String doctorName, int projectID,String setupID}) async { + {int requestNo, + String projectName, + String doctorName, + int projectID, + String setupID}) async { hasError = false; super.error = ""; Map body = Map(); @@ -33,8 +37,8 @@ class PatientSickLeaveService extends BaseService { body['PatientName'] = user.firstName + " " + user.firstName; body['ProjectName'] = projectName; body['DoctorName'] = doctorName; - body['ProjectID'] = 12; - body['SetupID'] = 12; + body['ProjectID'] = projectID; + body['SetupID'] = setupID; await baseAppClient .post(SendSickLeaveEmail, onSuccess: (response, statusCode) async {}, onFailure: (String error, int statusCode) { diff --git a/lib/core/service/medical/reports_service.dart b/lib/core/service/medical/reports_service.dart index 19f86e2e..7acb92ea 100644 --- a/lib/core/service/medical/reports_service.dart +++ b/lib/core/service/medical/reports_service.dart @@ -9,11 +9,11 @@ class ReportsService extends BaseService { List appointHistoryList = List(); String userAgreementContent = ""; RequestReports _requestReports = RequestReports( - isReport: true, - encounterType: 1, - requestType: 1, - patientOutSA: 0, - ); + isReport: true, + encounterType: 1, + requestType: 1, + patientOutSA: 0, + ); Future getReports() async { hasError = false; @@ -56,22 +56,18 @@ class ReportsService extends BaseService { }, body: Map()); } - Future updatePatientHealthSummaryReport({bool isSummary}) async { Map body = Map(); body['RSummaryReport'] = isSummary; hasError = false; await baseAppClient.post(UPDATE_HEALTH_TERMS, - onSuccess: (dynamic response, int statusCode) { - - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, body: body); + onSuccess: (dynamic response, int statusCode) {}, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); } - - Future insertRequestForMedicalReport( AppointmentHistory appointmentHistory) async { Map body = new Map(); @@ -96,4 +92,41 @@ class ReportsService extends BaseService { super.error = error; }, body: body); } + + Future sendEmailForMedicalReport( + String projectName, + String clinicName, + String doctorName, + String requestDate, + String invoiceNo, + int projectID, + String printID, + String procedureID, + String stamp, + String setupID) async { + Map body = new Map(); + body['SetupID'] = setupID; + body['PrintDate'] = requestDate; + body['ProcedureID'] = "05005009"; + body['Reporttype'] = "MEDICAL REPORT"; + body['stamp'] = stamp; + body['To'] = user.emailAddress; + body['DateofBirth'] = user.dateofBirth; + body['PatientIditificationNum'] = user.patientIdentificationNo; + body['PatientMobileNumber'] = user.mobileNumber; + body['PatientName'] = user.firstName + " " + user.firstName; + body['ProjectName'] = projectName; + body['ClinicName'] = clinicName; + body['ProjectID'] = projectID; + body['InvoiceNo'] = invoiceNo; + body['PrintedByName'] = user.firstName + " " + user.firstName; + + hasError = false; + await baseAppClient.post(SEND_MEDICAL_REPORT_EMAIL, + onSuccess: (dynamic response, int statusCode) {}, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } } diff --git a/lib/models/Appointments/toDoCountProviderModel.dart b/lib/models/Appointments/toDoCountProviderModel.dart index 0fd83491..e44a0ebb 100644 --- a/lib/models/Appointments/toDoCountProviderModel.dart +++ b/lib/models/Appointments/toDoCountProviderModel.dart @@ -2,11 +2,15 @@ import 'package:flutter/cupertino.dart'; class ToDoCountProviderModel with ChangeNotifier { int _count; + bool _isShowBadge = false; int get count => _count == null ? 0 : _count; - void setState(int count) { + bool get isShowBadge => _isShowBadge; + + void setState(int count, bool isShowBadge) { _count = count; + _isShowBadge = isShowBadge; notifyListeners(); } } diff --git a/lib/pages/BookAppointment/BookConfirm.dart b/lib/pages/BookAppointment/BookConfirm.dart index f7cbd4f3..1d8a9d2f 100644 --- a/lib/pages/BookAppointment/BookConfirm.dart +++ b/lib/pages/BookAppointment/BookConfirm.dart @@ -513,12 +513,12 @@ class _BookConfirmState extends State { } getToDoCount() { - toDoProvider.setState(0); + toDoProvider.setState(0, true); ClinicListService service = new ClinicListService(); service.getActiveAppointmentNo(context).then((res) { print(res['AppointmentActiveNumber']); if (res['MessageStatus'] == 1) { - toDoProvider.setState(res['AppointmentActiveNumber']); + toDoProvider.setState(res['AppointmentActiveNumber'], true); } else {} }).catchError((err) { print(err); diff --git a/lib/pages/MyAppointments/widgets/AppointmentActions.dart b/lib/pages/MyAppointments/widgets/AppointmentActions.dart index 3000def5..7d985233 100644 --- a/lib/pages/MyAppointments/widgets/AppointmentActions.dart +++ b/lib/pages/MyAppointments/widgets/AppointmentActions.dart @@ -397,12 +397,12 @@ class _AppointmentActionsState extends State { } getToDoCount() { - toDoProvider.setState(0); + toDoProvider.setState(0, true); ClinicListService service = new ClinicListService(); service.getActiveAppointmentNo(context).then((res) { print(res['AppointmentActiveNumber']); if (res['MessageStatus'] == 1) { - toDoProvider.setState(res['AppointmentActiveNumber']); + toDoProvider.setState(res['AppointmentActiveNumber'], true); } else {} }).catchError((err) { print(err); diff --git a/lib/pages/ToDoList/ToDo.dart b/lib/pages/ToDoList/ToDo.dart index 2e0a3047..129f5ce9 100644 --- a/lib/pages/ToDoList/ToDo.dart +++ b/lib/pages/ToDoList/ToDo.dart @@ -4,12 +4,14 @@ import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart'; import 'package:diplomaticquarterapp/locator.dart'; import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart'; +import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/QRCode.dart'; import 'package:diplomaticquarterapp/pages/MyAppointments/AppointmentDetails.dart'; import 'package:diplomaticquarterapp/pages/ToDoList/payment_method_select.dart'; import 'package:diplomaticquarterapp/pages/ToDoList/widgets/paymentDialog.dart'; import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; +import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; @@ -22,6 +24,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_countdown_timer/current_remaining_time.dart'; import 'package:flutter_countdown_timer/flutter_countdown_timer.dart'; import 'package:flutter_svg/flutter_svg.dart'; +import 'package:provider/provider.dart'; import 'package:rating_bar/rating_bar.dart'; class ToDo extends StatefulWidget { @@ -47,8 +50,11 @@ class _ToDoState extends State { List imagesInfo = List(); + ToDoCountProviderModel toDoProvider; + @override void initState() { + toDoProvider = Provider.of(context); widget.patientShareResponse = new PatientShareResponse(); WidgetsBinding.instance.addPostFrameCallback((_) { if (authenticatedUserObject.isLogin) getPatientData(); @@ -514,6 +520,19 @@ class _ToDoState extends State { }); } + getToDoCount() { + toDoProvider.setState(0, true); + ClinicListService service = new ClinicListService(); + service.getActiveAppointmentNo(context).then((res) { + print(res['AppointmentActiveNumber']); + if (res['MessageStatus'] == 1) { + toDoProvider.setState(res['AppointmentActiveNumber'], true); + } else {} + }).catchError((err) { + print(err); + }); + } + getPatientAppointmentHistory() { GifLoaderDialogUtils.showMyDialog(context); DoctorsListService service = new DoctorsListService(); @@ -529,11 +548,7 @@ class _ToDoState extends State { }); } else {} }); - widget.appoList.forEach((element) { - print(element.isLiveCareAppointment); - print(element.nextAction); - print(element.remaniningHoursTocanPay); - }); + getToDoCount(); } else { AppToast.showErrorToast(message: res['ErrorEndUserMessage']); } diff --git a/lib/pages/landing/home_page.dart b/lib/pages/landing/home_page.dart index 1706ce8a..f1be466c 100644 --- a/lib/pages/landing/home_page.dart +++ b/lib/pages/landing/home_page.dart @@ -751,23 +751,6 @@ class _HomePageState extends State { Navigator.push(context, MaterialPageRoute(builder: (context) => CovidDrivethruLocation())); } - - getToDoCount() { - toDoProvider.setState(0); - ClinicListService service = new ClinicListService(); - service.getActiveAppointmentNo(context).then((res) { - print(res['AppointmentActiveNumber']); - if (res['MessageStatus'] == 1) { - setState(() { - toDoProvider.setState(res['AppointmentActiveNumber']); - }); - } else { - AppToast.showErrorToast(message: res['ErrorEndUserMessage']); - } - }).catchError((err) { - print(err); - }); - } } class DashboardItem extends StatelessWidget { diff --git a/lib/pages/login/confirm-login.dart b/lib/pages/login/confirm-login.dart index 50cada42..cdd9c09b 100644 --- a/lib/pages/login/confirm-login.dart +++ b/lib/pages/login/confirm-login.dart @@ -4,12 +4,14 @@ import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart'; import 'package:diplomaticquarterapp/core/viewModels/appointment_rate_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/locator.dart'; +import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart'; import 'package:diplomaticquarterapp/models/Authentication/check_activation_code_response.dart'; import 'package:diplomaticquarterapp/models/Authentication/check_paitent_authentication_req.dart'; import 'package:diplomaticquarterapp/models/Authentication/select_device_imei_res.dart'; import 'package:diplomaticquarterapp/models/Authentication/send_activation_request.dart'; import 'package:diplomaticquarterapp/routes.dart'; import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; +import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; @@ -74,6 +76,8 @@ class _ConfirmLogin extends State { locator(); ProjectViewModel projectViewModel; + ToDoCountProviderModel toDoProvider; + @override void initState() { _getAvailableBiometrics(); @@ -84,6 +88,7 @@ class _ConfirmLogin extends State { @override Widget build(BuildContext context) { projectViewModel = Provider.of(context); + toDoProvider = Provider.of(context); return AppScaffold( appBarTitle: TranslationBase.of(context).confirm, isShowAppBar: true, @@ -568,10 +573,24 @@ class _ConfirmLogin extends State { }); } + getToDoCount() { + toDoProvider.setState(0, true); + ClinicListService service = new ClinicListService(); + service.getActiveAppointmentNo(context).then((res) { + print(res['AppointmentActiveNumber']); + if (res['MessageStatus'] == 1) { + toDoProvider.setState(res['AppointmentActiveNumber'], true); + } else {} + }).catchError((err) { + print(err); + }); + } + goToHome() { authenticatedUserObject.isLogin = true; appointmentRateViewModel.isLogin = true; projectViewModel.isLogin = true; + getToDoCount(); Navigator.of(context).pushNamed(HOME); } diff --git a/lib/pages/login/login.dart b/lib/pages/login/login.dart index 8cbaab5a..366a49d9 100644 --- a/lib/pages/login/login.dart +++ b/lib/pages/login/login.dart @@ -4,6 +4,7 @@ import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart'; import 'package:diplomaticquarterapp/core/viewModels/appointment_rate_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/locator.dart'; +import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart'; import 'package:diplomaticquarterapp/models/Authentication/check_activation_code_response.dart'; import 'package:diplomaticquarterapp/models/Authentication/check_paitent_authentication_req.dart'; import 'package:diplomaticquarterapp/pages/landing/landing_page.dart'; @@ -11,6 +12,7 @@ import 'package:diplomaticquarterapp/pages/login/login-type.dart'; import 'package:diplomaticquarterapp/pages/rateAppointment/rate_appointment_doctor.dart'; import 'package:diplomaticquarterapp/routes.dart'; import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; +import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; @@ -48,6 +50,7 @@ class _Login extends State { locator(); ProjectViewModel projectViewModel; + ToDoCountProviderModel toDoProvider; @override void initState() { @@ -64,6 +67,7 @@ class _Login extends State { @override Widget build(BuildContext context) { projectViewModel = Provider.of(context); + toDoProvider = Provider.of(context); return AppScaffold( appBarTitle: TranslationBase.of(context).login, isShowAppBar: true, @@ -264,6 +268,7 @@ class _Login extends State { } else { + getToDoCount(), Navigator.pushAndRemoveUntil( context, FadePage( @@ -280,6 +285,19 @@ class _Login extends State { }); } + getToDoCount() { + toDoProvider.setState(0, true); + ClinicListService service = new ClinicListService(); + service.getActiveAppointmentNo(context).then((res) { + print(res['AppointmentActiveNumber']); + if (res['MessageStatus'] == 1) { + toDoProvider.setState(res['AppointmentActiveNumber'], true); + } else {} + }).catchError((err) { + print(err); + }); + } + // showLoader(bool isTrue) { // setState(() { // isLoading = isTrue; diff --git a/lib/pages/medical/reports/report_list_widget.dart b/lib/pages/medical/reports/report_list_widget.dart index 6408074a..4002b1ba 100644 --- a/lib/pages/medical/reports/report_list_widget.dart +++ b/lib/pages/medical/reports/report_list_widget.dart @@ -1,4 +1,8 @@ import 'package:diplomaticquarterapp/core/model/reports/Reports.dart'; +import 'package:diplomaticquarterapp/core/service/medical/reports_service.dart'; +import 'package:diplomaticquarterapp/locator.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:flutter/cupertino.dart'; @@ -16,7 +20,8 @@ class ReportListWidget extends StatelessWidget { itemBuilder: (context, index) => Padding( padding: const EdgeInsets.all(8.0), child: Container( - width: double.infinity,margin: EdgeInsets.only(left: 8,right: 8,top: 3), + width: double.infinity, + margin: EdgeInsets.only(left: 8, right: 8, top: 3), decoration: BoxDecoration( color: Colors.white, border: Border.all(color: Colors.white, width: 2), @@ -40,15 +45,33 @@ class ReportListWidget extends StatelessWidget { flex: 4, child: Padding( padding: const EdgeInsets.all(8.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox(height: 12,), - Texts(reportList[index].projectName), - Texts(reportList[index].clinicDescription), - Texts('invoice No: ${reportList[index].invoiceNo}'), - SizedBox(height: 12,), - + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + reportList[index].status == 2 + ? Container( + child: InkWell( + onTap: sendReportEmail(), + child: Icon( + Icons.email, + color: Colors.red, + ), + ), + ) + : Container(), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 12, + ), + Texts(reportList[index].projectName), + Texts(reportList[index].clinicDescription), + Texts(TranslationBase.of(context).invoiceNo + + ': ${reportList[index].invoiceNo}'), + SizedBox(height: 12), + ], + ), ], ), ), @@ -61,4 +84,23 @@ class ReportListWidget extends StatelessWidget { ), ); } + + sendReportEmail(Reports report) { + ReportsService _reportsService = locator(); + + _reportsService + .sendEmailForMedicalReport( + report.projectName, + report.clinicDescription, + report.doctorName, + DateUtil.convertDateToString(report.requestDate), + report.invoiceNo.toString(), + report.projectID, + report.printID, + procedureID, + stamp, + setupID) + .then((value) {}) + .catchError(() {}); + } } diff --git a/lib/pages/rateAppointment/rate_appointment_clinic.dart b/lib/pages/rateAppointment/rate_appointment_clinic.dart index 38fdd008..5ce1316f 100644 --- a/lib/pages/rateAppointment/rate_appointment_clinic.dart +++ b/lib/pages/rateAppointment/rate_appointment_clinic.dart @@ -5,6 +5,7 @@ import 'package:diplomaticquarterapp/core/viewModels/appointment_rate_view_model import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/landing/landing_page.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.dart'; import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; @@ -72,7 +73,7 @@ class _RateAppointmentClinicState extends State { height: 25, ), Texts( - 'How would you rate your last visit to the Clinic', + TranslationBase.of(context).lastAppointment, bold: true, color: Colors.black, ), @@ -122,7 +123,7 @@ class _RateAppointmentClinicState extends State { ), Center( child: Texts( - 'Please rate the Clinic', + TranslationBase.of(context).rateClinic, textAlign: TextAlign.center, )), SizedBox( @@ -206,7 +207,7 @@ class _RateAppointmentClinicState extends State { message: 'please rate the clinic'); } }, - label: "Rate", + label: TranslationBase.of(context).submit, disabled: model.state == ViewState.BusyLocal, loading: model.state == ViewState.BusyLocal, textColor: Theme.of(context).backgroundColor), @@ -224,7 +225,7 @@ class _RateAppointmentClinicState extends State { ); }, child: Texts( - 'Later', + TranslationBase.of(context).later, decoration: TextDecoration.underline, color: HexColor('#151DFE'), fontSize: 18, diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index 80fb0cfe..fece63a2 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -1015,6 +1015,11 @@ class TranslationBase { String get lastVisit => localizedValues['last-visit'][locale.languageCode]; String get tapTitle => localizedValues['tap-title'][locale.languageCode]; String get later => localizedValues['later'][locale.languageCode]; + + String get lastAppointment => localizedValues['last-appointment'][locale.languageCode]; + String get rateClinic => localizedValues['rate-clinic'][locale.languageCode]; + + } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/widgets/bottom_navigation/bottom_navigation_item.dart b/lib/widgets/bottom_navigation/bottom_navigation_item.dart index ba35f3c6..8443f26d 100644 --- a/lib/widgets/bottom_navigation/bottom_navigation_item.dart +++ b/lib/widgets/bottom_navigation/bottom_navigation_item.dart @@ -69,7 +69,7 @@ class BottomNavigationItem extends StatelessWidget { ), ], ) - : authenticatedUserObject.isLogin + : (authenticatedUserObject.isLogin && model.isShowBadge) ? Stack( alignment: AlignmentDirectional.center, children: [ diff --git a/lib/widgets/data_display/medical/doctor_card.dart b/lib/widgets/data_display/medical/doctor_card.dart index 2e70f2ab..089f4cbf 100644 --- a/lib/widgets/data_display/medical/doctor_card.dart +++ b/lib/widgets/data_display/medical/doctor_card.dart @@ -142,7 +142,7 @@ class DoctorCard extends StatelessWidget { Icons.email, color: Colors.red, ), - ) + ), ], ), ), diff --git a/lib/widgets/drawer/app_drawer_widget.dart b/lib/widgets/drawer/app_drawer_widget.dart index b30a3922..6c3e9d80 100644 --- a/lib/widgets/drawer/app_drawer_widget.dart +++ b/lib/widgets/drawer/app_drawer_widget.dart @@ -3,6 +3,7 @@ import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart'; import 'package:diplomaticquarterapp/core/service/medical/vital_sign_service.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/models/Authentication/check_activation_code_response.dart'; import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart'; @@ -44,8 +45,11 @@ class _AppDrawerState extends State { locator(); VitalSignService _vitalSignService = locator(); + ToDoCountProviderModel toDoProvider; + @override Widget build(BuildContext context) { + toDoProvider = Provider.of(context); projectProvider = Provider.of(context); return SizedBox( width: MediaQuery.of(context).size.width * 0.75, @@ -458,9 +462,12 @@ class _AppDrawerState extends State { _vitalSignService.weightKg = ""; await sharedPref.clear(); this.user = null; + toDoProvider.setState(0, false); Navigator.of(context).pushNamed(HOME); } + + login() async { var data = await sharedPref.getObject(IMEI_USER_DATA); sharedPref.remove(REGISTER_DATA_FOR_LOGIIN);