From 01ca8b8f8475d6cdd87d0a1338a5b1a7a7c31594 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Thu, 7 Oct 2021 17:13:27 +0300 Subject: [PATCH] updates & fixes --- .../contactus/get_patientI_cprojects.dart | 4 + lib/core/service/client/base_app_client.dart | 2 +- .../viewModels/notifications_view_model.dart | 37 +++-- .../Appointments/toDoCountProviderModel.dart | 6 +- lib/pages/BookAppointment/BookConfirm.dart | 4 +- .../LiveChat/hospitalsLivechat_page.dart | 2 +- .../LiveChat/pharmaciesLivechat_page.dart | 16 +- .../Covid-DriveThru/Covid-TimeSlots.dart | 4 +- lib/pages/DrawerPages/family/my-family.dart | 4 +- .../notification_details_page.dart | 3 +- .../notifications/notifications_page.dart | 8 +- lib/pages/ErService/ErOptions.dart | 2 +- .../MyAppointments/AppointmentDetails.dart | 4 +- lib/pages/feedback/send_feedback_page.dart | 142 ++++++------------ lib/pages/feedback/status_feedback_page.dart | 19 ++- lib/pages/landing/landing_page.dart | 10 +- lib/pages/livecare/livecare_type_select.dart | 4 +- lib/pages/login/confirm-login.dart | 12 +- lib/pages/login/login.dart | 4 +- .../prescriptions_history_details_page.dart | 4 +- .../prescriptions_history_page.dart | 4 +- .../rate_appointment_clinic.dart | 4 +- .../appointment_services/GetDoctorsList.dart | 3 +- lib/uitl/date_uitl.dart | 2 +- lib/widgets/drawer/app_drawer_widget.dart | 11 +- 25 files changed, 144 insertions(+), 171 deletions(-) diff --git a/lib/core/model/contactus/get_patientI_cprojects.dart b/lib/core/model/contactus/get_patientI_cprojects.dart index e9a6b712..556affd2 100644 --- a/lib/core/model/contactus/get_patientI_cprojects.dart +++ b/lib/core/model/contactus/get_patientI_cprojects.dart @@ -11,6 +11,7 @@ class GetPatientICProjectsModel { dynamic editedOn; dynamic editedBy; bool isActive; + dynamic distanceInKilometers; GetPatientICProjectsModel( {this.id, @@ -22,6 +23,7 @@ class GetPatientICProjectsModel { this.createdBy, this.editedOn, this.editedBy, + this.distanceInKilometers, this.isActive}); GetPatientICProjectsModel.fromJson(Map json) { @@ -35,6 +37,7 @@ class GetPatientICProjectsModel { editedOn = json['EditedOn']; editedBy = json['EditedBy']; isActive = json['IsActive']; + distanceInKilometers = json['DistanceInKilometers']; } Map toJson() { @@ -49,6 +52,7 @@ class GetPatientICProjectsModel { data['EditedOn'] = this.editedOn; data['EditedBy'] = this.editedBy; data['IsActive'] = this.isActive; + data['DistanceInKilometers'] = this.distanceInKilometers; return data; } } \ No newline at end of file diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index cf75eca9..175310f8 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -569,7 +569,7 @@ class BaseAppClient { var model = Provider.of(AppGlobal.context, listen: false); _vitalSignService.weightKg = ""; _vitalSignService.heightCm = ""; - model.setState(0, false); + model.setState(0, false, 0); Navigator.of(AppGlobal.context).pushReplacementNamed(HOME); } diff --git a/lib/core/viewModels/notifications_view_model.dart b/lib/core/viewModels/notifications_view_model.dart index 685b4a7f..d5fbc598 100644 --- a/lib/core/viewModels/notifications_view_model.dart +++ b/lib/core/viewModels/notifications_view_model.dart @@ -1,39 +1,48 @@ +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/model/notifications/get_notifications_request_model.dart'; import 'package:diplomaticquarterapp/core/model/notifications/get_notifications_response_model.dart'; import 'package:diplomaticquarterapp/core/model/notifications/mark_message_as_read_request_model.dart'; import 'package:diplomaticquarterapp/core/service/notifications_service.dart'; +import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart'; +import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; import '../../locator.dart'; import 'base_view_model.dart'; class NotificationViewModel extends BaseViewModel { NotificationService _notificationService = locator(); + ToDoCountProviderModel model = Provider.of(AppGlobal.context); - List get notifications => - _notificationService.notificationsList; + List get notifications => _notificationService.notificationsList; - Future getNotifications( - GetNotificationsRequestModel getNotificationsRequestModel, BuildContext context) async { - if(getNotificationsRequestModel.currentPage == 0) - setState(ViewState.Busy); + Future getNotifications(GetNotificationsRequestModel getNotificationsRequestModel, BuildContext context) async { + if (getNotificationsRequestModel.currentPage == 0) setState(ViewState.Busy); - await _notificationService - .getAllNotifications(getNotificationsRequestModel); + await _notificationService.getAllNotifications(getNotificationsRequestModel); if (_notificationService.hasError) { error = _notificationService.error; - setState(ViewState.Error); + setState(ViewState.Error); } else { - setState(ViewState.Idle); + setState(ViewState.Idle); } } Future markAsRead(id) async { // setState(ViewState.Busy); - MarkMessageAsReadRequestModel markMessageAsReadRequestModel = - new MarkMessageAsReadRequestModel(notificationPoolID: id); + MarkMessageAsReadRequestModel markMessageAsReadRequestModel = new MarkMessageAsReadRequestModel(notificationPoolID: id); + final authService = new AuthProvider(); await _notificationService.markAsRead(markMessageAsReadRequestModel); - setState(ViewState.Idle); + await authService.getDashboard().then((value) { + var notificationCount = ''; + notificationCount = value['List_PatientDashboard'][0]['UnreadPatientNotificationCount'] > 99 ? '99+' : value['List_PatientDashboard'][0]['UnreadPatientNotificationCount'].toString(); + model.setState(model.count, true, num.tryParse(notificationCount)); + sharedPref.setString(NOTIFICATION_COUNT, notificationCount); + + }); + setState(ViewState.Idle); } -} \ No newline at end of file +} diff --git a/lib/models/Appointments/toDoCountProviderModel.dart b/lib/models/Appointments/toDoCountProviderModel.dart index e44a0ebb..ff02c1b2 100644 --- a/lib/models/Appointments/toDoCountProviderModel.dart +++ b/lib/models/Appointments/toDoCountProviderModel.dart @@ -2,15 +2,19 @@ import 'package:flutter/cupertino.dart'; class ToDoCountProviderModel with ChangeNotifier { int _count; + int _notificationsCount; bool _isShowBadge = false; int get count => _count == null ? 0 : _count; + int get notificationsCount => _notificationsCount == null ? 0 : _notificationsCount; + bool get isShowBadge => _isShowBadge; - void setState(int count, bool isShowBadge) { + void setState(int count, bool isShowBadge, int notifCount) { _count = count; _isShowBadge = isShowBadge; + _notificationsCount = notifCount; notifyListeners(); } } diff --git a/lib/pages/BookAppointment/BookConfirm.dart b/lib/pages/BookAppointment/BookConfirm.dart index 4a47dee1..2b49043e 100644 --- a/lib/pages/BookAppointment/BookConfirm.dart +++ b/lib/pages/BookAppointment/BookConfirm.dart @@ -346,12 +346,12 @@ class _BookConfirmState extends State { } getToDoCount() { - toDoProvider.setState(0, true); + toDoProvider.setState(0, true, toDoProvider.notificationsCount); ClinicListService service = new ClinicListService(); service.getActiveAppointmentNo(context).then((res) { print(res['AppointmentActiveNumber']); if (res['MessageStatus'] == 1) { - toDoProvider.setState(res['AppointmentActiveNumber'], true); + toDoProvider.setState(res['AppointmentActiveNumber'], true, toDoProvider.notificationsCount); } else {} }).catchError((err) { print(err); diff --git a/lib/pages/ContactUs/LiveChat/hospitalsLivechat_page.dart b/lib/pages/ContactUs/LiveChat/hospitalsLivechat_page.dart index 17f9b5db..4abf3d9c 100644 --- a/lib/pages/ContactUs/LiveChat/hospitalsLivechat_page.dart +++ b/lib/pages/ContactUs/LiveChat/hospitalsLivechat_page.dart @@ -86,7 +86,7 @@ class _HospitalsLiveChatPageState extends State { children: [ Expanded( child: Text( - model.LiveChatModelList[index]?.projectName ?? "", + model.LiveChatModelList[index].projectName.toString() + "\n" + model.LiveChatModelList[index].distanceInKilometers.toString() + " " + TranslationBase.of(context).km_ ?? "", style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: tappedIndex == index ? Colors.white : Color(0xff2B353E), letterSpacing: -0.64, height: 23 / 16), ), ), diff --git a/lib/pages/ContactUs/LiveChat/pharmaciesLivechat_page.dart b/lib/pages/ContactUs/LiveChat/pharmaciesLivechat_page.dart index f8926eed..2d99054e 100644 --- a/lib/pages/ContactUs/LiveChat/pharmaciesLivechat_page.dart +++ b/lib/pages/ContactUs/LiveChat/pharmaciesLivechat_page.dart @@ -32,7 +32,6 @@ class PharmaciesLiveChatPage extends StatelessWidget { SizedBox(height: 20), Text( TranslationBase.of(context).instructions, - textAlign: TextAlign.center, style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.64, height: 23 / 16), ), ], @@ -44,14 +43,13 @@ class PharmaciesLiveChatPage extends StatelessWidget { padding: EdgeInsets.only(top: 16, bottom: 16, right: 21, left: 21), child: DefaultButton( TranslationBase.of(context).start, - () { - String chat; - chat = - "http://chat.dshmg.com:7788/EPharmacyChat/EIndex.aspx?CustomerID=undefined&Name=${model.user.firstName}&MobileNo=${model.user.mobileNumber}&Language=${projectViewModel.isArabic ? 1 : 2}"; - launch(chat); - }, - color: Color(0xffD02127), - textColor: Colors.white, + null, + // () { + // String chat; + // chat = + // "http://chat.dshmg.com:7788/EPharmacyChat/EIndex.aspx?CustomerID=undefined&Name=${model.user.firstName}&MobileNo=${model.user.mobileNumber}&Language=${projectViewModel.isArabic ? 1 : 2}"; + // launch(chat); + // }, disabledColor: Color(0xffEAEAEA), ), ), diff --git a/lib/pages/Covid-DriveThru/Covid-TimeSlots.dart b/lib/pages/Covid-DriveThru/Covid-TimeSlots.dart index 5cdfd9d9..b49a18c6 100644 --- a/lib/pages/Covid-DriveThru/Covid-TimeSlots.dart +++ b/lib/pages/Covid-DriveThru/Covid-TimeSlots.dart @@ -485,12 +485,12 @@ class _CovidTimeSlotsState extends State with TickerProviderStat } getToDoCount() { - toDoProvider.setState(0, true); + toDoProvider.setState(0, true, toDoProvider.notificationsCount); ClinicListService service = new ClinicListService(); service.getActiveAppointmentNo(context).then((res) { print(res['AppointmentActiveNumber']); if (res['MessageStatus'] == 1) { - toDoProvider.setState(res['AppointmentActiveNumber'], true); + toDoProvider.setState(res['AppointmentActiveNumber'], true, toDoProvider.notificationsCount); } else {} }).catchError((err) { print(err); diff --git a/lib/pages/DrawerPages/family/my-family.dart b/lib/pages/DrawerPages/family/my-family.dart index a3f67a03..9657c641 100644 --- a/lib/pages/DrawerPages/family/my-family.dart +++ b/lib/pages/DrawerPages/family/my-family.dart @@ -615,12 +615,12 @@ class _MyFamily extends State with TickerProviderStateMixin { } getToDoCount() { - toDoProvider.setState(0, true); + toDoProvider.setState(0, true, toDoProvider.notificationsCount); ClinicListService service = new ClinicListService(); service.getActiveAppointmentNo(context).then((res) { print(res['AppointmentActiveNumber']); if (res['MessageStatus'] == 1 && res['AppointmentActiveNumber'] != null) { - toDoProvider.setState(res['AppointmentActiveNumber'], true); + toDoProvider.setState(res['AppointmentActiveNumber'], true, toDoProvider.notificationsCount); } else {} }).catchError((err) { print(err); diff --git a/lib/pages/DrawerPages/notifications/notification_details_page.dart b/lib/pages/DrawerPages/notifications/notification_details_page.dart index 12ed0bc4..ee1398be 100644 --- a/lib/pages/DrawerPages/notifications/notification_details_page.dart +++ b/lib/pages/DrawerPages/notifications/notification_details_page.dart @@ -50,13 +50,12 @@ class NotificationsDetailsPage extends StatelessWidget { height: 25, ), Container( - // margin: EdgeInsets.only(left: 30), width: double.infinity, color: Colors.grey[400], child: Padding( padding: const EdgeInsets.all(8.0), child: Texts( - getDateForm(notification.createdOn), + DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(notification.createdOn)) + " " + DateUtil.formatDateToTimeLang(DateUtil.convertStringToDate(notification.createdOn), false), fontSize: 16, ), ), diff --git a/lib/pages/DrawerPages/notifications/notifications_page.dart b/lib/pages/DrawerPages/notifications/notifications_page.dart index 6f19c8af..aba2fb13 100644 --- a/lib/pages/DrawerPages/notifications/notifications_page.dart +++ b/lib/pages/DrawerPages/notifications/notifications_page.dart @@ -2,6 +2,7 @@ import 'package:diplomaticquarterapp/core/model/notifications/get_notifications_ import 'package:diplomaticquarterapp/core/viewModels/notifications_view_model.dart'; import 'package:diplomaticquarterapp/pages/DrawerPages/notifications/notification_details_page.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; @@ -60,8 +61,9 @@ class NotificationsPage extends StatelessWidget { .map( (notification) => InkWell( onTap: () async { - if (!notification.isRead) + if (!notification.isRead) { model.markAsRead(notification.id); + } Navigator.push( context, FadePage( @@ -82,7 +84,7 @@ class NotificationsPage extends StatelessWidget { border: Border.all( color: notification.isRead ? Colors.grey[200] - : Theme.of(context).primaryColor, + : CustomColors.accentColor, width: 0.5), ), child: Row( @@ -93,7 +95,7 @@ class NotificationsPage extends StatelessWidget { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Texts(getDateForm(notification.createdOn)), + Texts(DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(notification.createdOn)) + " " + DateUtil.formatDateToTimeLang(DateUtil.convertStringToDate(notification.createdOn), false)), SizedBox( height: 5, ), diff --git a/lib/pages/ErService/ErOptions.dart b/lib/pages/ErService/ErOptions.dart index 1fbda90c..095ad884 100644 --- a/lib/pages/ErService/ErOptions.dart +++ b/lib/pages/ErService/ErOptions.dart @@ -87,7 +87,7 @@ class _ErOptionsState extends State { ), InkWell( onTap: () { - Navigator.push(context, FadePage(page: RRTMainScreen())); + if(rrtLocked) Navigator.push(context, FadePage(page: RRTMainScreen())); }, child: MedicalProfileItem( title: TranslationBase.of(context).rrtService, diff --git a/lib/pages/MyAppointments/AppointmentDetails.dart b/lib/pages/MyAppointments/AppointmentDetails.dart index 7ba821f8..be44855d 100644 --- a/lib/pages/MyAppointments/AppointmentDetails.dart +++ b/lib/pages/MyAppointments/AppointmentDetails.dart @@ -582,11 +582,11 @@ class _AppointmentDetailsState extends State with SingleTick } getToDoCount() { - toDoProvider.setState(0, true); + toDoProvider.setState(0, true, toDoProvider.notificationsCount); ClinicListService service = new ClinicListService(); service.getActiveAppointmentNo(context).then((res) { if (res['MessageStatus'] == 1) { - toDoProvider.setState(res['AppointmentActiveNumber'], true); + toDoProvider.setState(res['AppointmentActiveNumber'], true, toDoProvider.notificationsCount); } else {} }).catchError((err) { print(err); diff --git a/lib/pages/feedback/send_feedback_page.dart b/lib/pages/feedback/send_feedback_page.dart index daf5795c..a95fb425 100644 --- a/lib/pages/feedback/send_feedback_page.dart +++ b/lib/pages/feedback/send_feedback_page.dart @@ -5,7 +5,9 @@ import 'package:diplomaticquarterapp/core/viewModels/feedback/feedback_view_mode import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart'; +import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; @@ -50,6 +52,8 @@ class _SendFeedbackPageState extends State { var reconizedWord; var event = RobotProvider(); + List appoList = []; + String getSelected(BuildContext context) { switch (messageType) { case MessageType.ComplaintOnAnAppointment: @@ -174,105 +178,36 @@ class _SendFeedbackPageState extends State { ), ), SizedBox(height: 12), - if (messageType == MessageType.ComplaintOnAnAppointment && model.appointHistoryList.length != 0 && isShowListAppointHistory) + if (messageType == MessageType.ComplaintOnAnAppointment && appoList.length != 0 && isShowListAppointHistory) Container( - height: model.appointHistoryList.length > 2 ? MediaQuery.of(context).size.height * 0.35 : MediaQuery.of(context).size.height * 0.17, + margin: EdgeInsets.only(bottom: 10.0), + height: appoList.length > 2 ? MediaQuery.of(context).size.height * 0.35 : MediaQuery.of(context).size.height * 0.17, child: ListView.builder( - itemCount: model.appointHistoryList.length, + itemCount: appoList.length, itemBuilder: (context, index) => InkWell( onTap: () { setState(() { - appointHistory = model.appointHistoryList[index]; + appointHistory = appoList[index]; isShowListAppointHistory = false; }); }, child: DoctorCard( onTap: null, - isInOutPatient: model.appointHistoryList[index].isInOutPatient, - name: model.appointHistoryList[index].doctorTitle + " " + model.appointHistoryList[index].doctorNameObj, - profileUrl: model.appointHistoryList[index].doctorImageURL, - subName: model.appointHistoryList[index].projectName, - isLiveCareAppointment: model.appointHistoryList[index].isLiveCareAppointment, - date: DateUtil.convertStringToDate(model.appointHistoryList[index].appointmentDate), - rating: model.appointHistoryList[index].actualDoctorRate + 0.0, - appointmentTime: model.appointHistoryList[index].startTime.substring(0, 5), + isInOutPatient: appoList[index].isInOutPatient, + name: appoList[index].doctorTitle + " " + appoList[index].doctorNameObj, + profileUrl: appoList[index].doctorImageURL, + subName: appoList[index].projectName, + isLiveCareAppointment: appoList[index].isLiveCareAppointment, + date: DateUtil.convertStringToDate(appoList[index].appointmentDate), + rating: appoList[index].actualDoctorRate + 0.0, + appointmentTime: appoList[index].startTime.substring(0, 5), ), - // Container( - // margin: EdgeInsets.only(left: 8, right: 8), - // color: Colors.white, - // child: Column( - // children: [ - // Row( - // children: [ - // Expanded( - // flex: 4, - // child: Column( - // crossAxisAlignment: CrossAxisAlignment.start, - // children: [ - // Padding( - // padding: const EdgeInsets.all(10.0), - // child: Row( - // children: [ - // Expanded( - // flex: 1, - // child: LargeAvatar( - // name: model.appointHistoryList[index].doctorNameObj, - // url: model.appointHistoryList[index].doctorImageURL, - // ), - // ), - // Expanded( - // flex: 4, - // child: Container( - // margin: EdgeInsets.all(10), - // child: Column( - // crossAxisAlignment: CrossAxisAlignment.start, - // children: [ - // Texts( - // model.appointHistoryList[index].doctorNameObj, - // bold: true, - // ), - // Texts( - // DateUtil.getMonthDayYearDateFormatted(DateUtil.convertStringToDate(model.appointHistoryList[index].appointmentDate)), - // variant: 'caption3', - // ), - // StarRating(totalAverage: model.appointHistoryList[index].doctorRate.toDouble(), forceStars: true), - // ], - // ), - // ), - // ), - // ], - // ), - // ), - // ], - // ), - // ), - // Expanded( - // flex: 1, - // child: Center( - // child: Icon( - // Icons.arrow_forward_ios, - // size: 15, - // ), - // ), - // ) - // ], - // ), - // SizedBox( - // height: 5, - // ), - // Divider( - // height: 0.5, - // color: Colors.grey[400], - // ) - // ], - // ), - // ), ), ), ), - inputWidget(TranslationBase.of(context).subject, "xxxxxxxx", titleController), + inputWidget(TranslationBase.of(context).subject, "", titleController), SizedBox(height: 12), - inputWidget(TranslationBase.of(context).message, "xxxxxxxx", messageController, lines: 11, suffixTap: () { + inputWidget(TranslationBase.of(context).message, "", messageController, lines: 11, suffixTap: () { openSpeechReco(); }), SizedBox(height: 12), @@ -428,7 +363,7 @@ class _SendFeedbackPageState extends State { TextField( enabled: isEnable, scrollPadding: EdgeInsets.zero, - keyboardType: TextInputType.number, + keyboardType: TextInputType.text, controller: _controller, maxLines: lines, onChanged: (value) => {setState(() {})}, @@ -493,19 +428,36 @@ class _SendFeedbackPageState extends State { // Show Dialog function void confirmBox(FeedbackViewModel model) { + DoctorsListService service = new DoctorsListService(); showDialog( context: context, child: FeedbackTypeDialog( messageTypeDialog: messageType, onValueSelected: (MessageType value) { if (value == MessageType.ComplaintOnAnAppointment) { + appoList.clear(); GifLoaderDialogUtils.showMyDialog(context); - model.getPatentAppointmentHistory().then((value) { + service.getPatientAppointmentHistory(false, context, isForCOC: true).then((res) { GifLoaderDialogUtils.hideDialog(context); setState(() { - appointHistory = null; - isShowListAppointHistory = true; + if (res['MessageStatus'] == 1) { + if (res['AppoimentAllHistoryResultList'].length != 0) { + res['AppoimentAllHistoryResultList'].forEach((v) { + appoList.add(new AppoitmentAllHistoryResultList.fromJson(v)); + }); + setState(() { + appointHistory = null; + isShowListAppointHistory = true; + }); + } else {} + } else { + } }); + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + // print(err); + // AppToast.showErrorToast(message: err); + // Navigator.of(context).pop(); }); } else { isShowListAppointHistory = false; @@ -620,7 +572,7 @@ class FeedbackTypeDialogState extends State { leading: Radio( value: MessageType.NON, groupValue: messageTypeDialog, - activeColor: Theme.of(context).primaryColor, + activeColor: CustomColors.accentColor, onChanged: (MessageType value) => setMessageDialogType(value), ), ), @@ -642,7 +594,7 @@ class FeedbackTypeDialogState extends State { leading: Radio( value: MessageType.ComplaintOnAnAppointment, groupValue: messageTypeDialog, - activeColor: Theme.of(context).primaryColor, + activeColor: CustomColors.accentColor, onChanged: (MessageType value) => setMessageDialogType(value), ), ), @@ -664,7 +616,7 @@ class FeedbackTypeDialogState extends State { leading: Radio( value: MessageType.ComplaintWithoutAppointment, groupValue: messageTypeDialog, - activeColor: Theme.of(context).primaryColor, + activeColor: CustomColors.accentColor, onChanged: (MessageType value) => setMessageDialogType(value), ), ), @@ -686,7 +638,7 @@ class FeedbackTypeDialogState extends State { leading: Radio( value: MessageType.Question, groupValue: messageTypeDialog, - activeColor: Theme.of(context).primaryColor, + activeColor: CustomColors.accentColor, onChanged: (MessageType value) => setMessageDialogType(value), ), ), @@ -708,7 +660,7 @@ class FeedbackTypeDialogState extends State { leading: Radio( value: MessageType.Compliment, groupValue: messageTypeDialog, - activeColor: Theme.of(context).primaryColor, + activeColor: CustomColors.accentColor, onChanged: (MessageType value) => setMessageDialogType(value), ), ), @@ -730,7 +682,7 @@ class FeedbackTypeDialogState extends State { leading: Radio( value: MessageType.Suggestion, groupValue: messageTypeDialog, - activeColor: Theme.of(context).primaryColor, + activeColor: CustomColors.accentColor, onChanged: (MessageType value) => setMessageDialogType(value), ), ), @@ -763,7 +715,7 @@ class FeedbackTypeDialogState extends State { child: Center( child: Texts( TranslationBase.of(context).cancel, - color: Theme.of(context).primaryColor, + color: CustomColors.accentColor, ), ), ), diff --git a/lib/pages/feedback/status_feedback_page.dart b/lib/pages/feedback/status_feedback_page.dart index ae13d81b..2e87f875 100644 --- a/lib/pages/feedback/status_feedback_page.dart +++ b/lib/pages/feedback/status_feedback_page.dart @@ -36,7 +36,6 @@ class _StatusFeedbackPageState extends State { itemCount: model.cOCItemList.length, itemBuilder: (context, index) => InkWell( onTap: () { - // gotodetails(model.cOCItemList[index]); }, child: Card( shape: cardRadius(12), @@ -124,17 +123,17 @@ class _StatusFeedbackPageState extends State { ), ), ), - Container( - color: Colors.white, - padding: EdgeInsets.only(top: 16, bottom: 16, right: 21, left: 21), - child: DefaultButton( - TranslationBase.of(context).search, - projectViewModel.isLogin ? null : () => {}, - disabledColor: Colors.grey, - ), - ), ], ), + bottomSheet: Container( + color: Colors.white, + padding: EdgeInsets.only(top: 16, bottom: 16, right: 21, left: 21), + child: DefaultButton( + TranslationBase.of(context).search, + projectViewModel.isLogin ? null : () => {}, + disabledColor: Colors.grey, + ), + ), ), ); } diff --git a/lib/pages/landing/landing_page.dart b/lib/pages/landing/landing_page.dart index 7dc3b334..dd34a072 100644 --- a/lib/pages/landing/landing_page.dart +++ b/lib/pages/landing/landing_page.dart @@ -77,6 +77,8 @@ class _LandingPageState extends State with WidgetsBindingObserver { SignalRUtil signalRUtil; + ToDoCountProviderModel toDoProvider; + bool _showBottomNavigationBar = true; ///inject the user data @@ -505,6 +507,7 @@ class _LandingPageState extends State with WidgetsBindingObserver { setState(() { notificationCount = value['List_PatientDashboard'][0]['UnreadPatientNotificationCount'] > 99 ? '99+' : value['List_PatientDashboard'][0]['UnreadPatientNotificationCount'].toString(); + model.setState(model.count, true, num.tryParse(notificationCount)); sharedPref.setString(NOTIFICATION_COUNT, notificationCount); }) } @@ -555,14 +558,14 @@ class _LandingPageState extends State with WidgetsBindingObserver { pageController.jumpToPage(0); }, ), - projectViewModel.isLogin && notificationCount != '' + projectViewModel.isLogin && model.notificationsCount != 0 ? new Positioned( right: projectViewModel.isArabic ? 35 : 0, top: 5, child: new Container( padding: EdgeInsets.all(4), decoration: new BoxDecoration( - color: Colors.red, + color: CustomColors.accentColor, borderRadius: BorderRadius.circular(20), ), constraints: BoxConstraints( @@ -570,7 +573,7 @@ class _LandingPageState extends State with WidgetsBindingObserver { minHeight: 20, ), child: new Text( - notificationCount, + model.notificationsCount.toString(), style: new TextStyle( color: Colors.white, fontSize: projectViewModel.isArabic ? 8 : 9, @@ -677,6 +680,7 @@ class _LandingPageState extends State with WidgetsBindingObserver { setState(() { if (value != null) { notificationCount = value['List_PatientDashboard'][0]['UnreadPatientNotificationCount'] > 99 ? '99+' : value['List_PatientDashboard'][0]['UnreadPatientNotificationCount'].toString(); + model.setState(model.count, true, num.tryParse(notificationCount)); sharedPref.setString(NOTIFICATION_COUNT, notificationCount); } }), diff --git a/lib/pages/livecare/livecare_type_select.dart b/lib/pages/livecare/livecare_type_select.dart index 2e22288d..765d6383 100644 --- a/lib/pages/livecare/livecare_type_select.dart +++ b/lib/pages/livecare/livecare_type_select.dart @@ -170,11 +170,11 @@ class _LiveCareTypeSelectState extends State { ), InkWell( onTap: (){ - Navigator.pop(context, "schedule"); + // Navigator.pop(context, "schedule"); }, child: Container( decoration: BoxDecoration( - color: Colors.grey[700], + color: Colors.grey[400], borderRadius: BorderRadius.all(Radius.circular(10.0))), height: 100.0, margin: EdgeInsets.only(top: 20.0), diff --git a/lib/pages/login/confirm-login.dart b/lib/pages/login/confirm-login.dart index b4336910..67425907 100644 --- a/lib/pages/login/confirm-login.dart +++ b/lib/pages/login/confirm-login.dart @@ -160,9 +160,9 @@ class _ConfirmLogin extends State { ), Text( user.editedOn != null - ? DateUtil.formatDateToDate(DateUtil.convertStringToDate(user.editedOn), projectViewModel.isArabic) + ? DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(user.editedOn)) : user.createdOn != null - ? DateUtil.formatDateToDate(DateUtil.convertStringToDate(user.createdOn), projectViewModel.isArabic) + ? DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(user.createdOn)) : '--', style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48), ), @@ -191,9 +191,9 @@ class _ConfirmLogin extends State { Expanded(child: SizedBox()), Text( user.editedOn != null - ? DateUtil.formatDateToTime(DateUtil.convertStringToDate(user.editedOn)) + ? DateUtil.formatDateToTimeLang(DateUtil.convertStringToDate(user.editedOn), false) : user.createdOn != null - ? DateUtil.formatDateToTime(DateUtil.convertStringToDate(user.createdOn)) + ? DateUtil.formatDateToTimeLang(DateUtil.convertStringToDate(user.createdOn), false) : '--', style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.48), ), @@ -582,11 +582,11 @@ class _ConfirmLogin extends State { } getToDoCount() { - toDoProvider.setState(0, true); + toDoProvider.setState(0, true, 0); ClinicListService service = new ClinicListService(); service.getActiveAppointmentNo(context).then((res) { if (res['MessageStatus'] == 1) { - toDoProvider.setState(res['AppointmentActiveNumber'], true); + toDoProvider.setState(res['AppointmentActiveNumber'], true, 0); } else {} }).catchError((err) { print(err); diff --git a/lib/pages/login/login.dart b/lib/pages/login/login.dart index ceccf75f..b448e1a4 100644 --- a/lib/pages/login/login.dart +++ b/lib/pages/login/login.dart @@ -359,12 +359,12 @@ class _Login extends State { } getToDoCount() { - toDoProvider.setState(0, true); + toDoProvider.setState(0, true, toDoProvider.notificationsCount); ClinicListService service = new ClinicListService(); service.getActiveAppointmentNo(context).then((res) { print(res['AppointmentActiveNumber']); if (res['MessageStatus'] == 1) { - toDoProvider.setState(res['AppointmentActiveNumber'], true); + toDoProvider.setState(res['AppointmentActiveNumber'], true, toDoProvider.notificationsCount); } else {} }).catchError((err) { print(err); diff --git a/lib/pages/medical/prescriptions/prescriptions_history_details_page.dart b/lib/pages/medical/prescriptions/prescriptions_history_details_page.dart index 8df6191e..c024b575 100644 --- a/lib/pages/medical/prescriptions/prescriptions_history_details_page.dart +++ b/lib/pages/medical/prescriptions/prescriptions_history_details_page.dart @@ -109,11 +109,11 @@ class PrescriptionsHistoryDetailsPage extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.end, children: [ Text( - DateUtil.formatDateToDate(prescriptionsOrder.createdOn, projectViewModel.isArabic), + DateUtil.getDayMonthYearDateFormatted(prescriptionsOrder.createdOn), style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.4, height: 16 / 10), ), Text( - DateUtil.formatDateToTime(prescriptionsOrder.createdOn), + DateUtil.formatDateToTimeLang(prescriptionsOrder.createdOn, false), style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.4, height: 16 / 10), ), ], diff --git a/lib/pages/medical/prescriptions/prescriptions_history_page.dart b/lib/pages/medical/prescriptions/prescriptions_history_page.dart index 43904857..ae774c02 100644 --- a/lib/pages/medical/prescriptions/prescriptions_history_page.dart +++ b/lib/pages/medical/prescriptions/prescriptions_history_page.dart @@ -119,11 +119,11 @@ class PrescriptionsHistoryPage extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.end, children: [ Text( - DateUtil.formatDateToDate(prescriptionsViewModel.prescriptionsHistory[index].createdOn, projectViewModel.isArabic), + DateUtil.getDayMonthYearDateFormatted(prescriptionsViewModel.prescriptionsHistory[index].createdOn), style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.4, height: 16 / 10), ), Text( - DateUtil.formatDateToTime(prescriptionsViewModel.prescriptionsHistory[index].createdOn), + DateUtil.formatDateToTimeLang(prescriptionsViewModel.prescriptionsHistory[index].createdOn, false), style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.4, height: 16 / 10), ), ], diff --git a/lib/pages/rateAppointment/rate_appointment_clinic.dart b/lib/pages/rateAppointment/rate_appointment_clinic.dart index c6ab88ab..8eafe6cb 100644 --- a/lib/pages/rateAppointment/rate_appointment_clinic.dart +++ b/lib/pages/rateAppointment/rate_appointment_clinic.dart @@ -96,7 +96,7 @@ class _RateAppointmentClinicState extends State { height: 25 / 16), ), Text( - model.appointmentDetails.startTime, + model.appointmentDetails.startTime.toString().substring(0, 5), style: TextStyle( fontSize: 14, fontWeight: FontWeight.w600, @@ -131,7 +131,7 @@ class _RateAppointmentClinicState extends State { projectViewModel.isArabic), myRichText( TranslationBase.of(context).date + ":", - DateUtil.getMonthDayYearDateFormatted( + DateUtil.getDayMonthYearDateFormatted( DateUtil.convertStringToDate(model .appointmentDetails .appointmentDate)), diff --git a/lib/services/appointment_services/GetDoctorsList.dart b/lib/services/appointment_services/GetDoctorsList.dart index 1c11e26b..3986c8e4 100644 --- a/lib/services/appointment_services/GetDoctorsList.dart +++ b/lib/services/appointment_services/GetDoctorsList.dart @@ -496,7 +496,7 @@ class DoctorsListService extends BaseService { return Future.value(localRes); } - Future getPatientAppointmentHistory(bool isActiveAppointment, BuildContext context) async { + Future getPatientAppointmentHistory(bool isActiveAppointment, BuildContext context, {bool isForCOC = false}) async { Map request; if (await this.sharedPref.getObject(USER_PROFILE) != null) { @@ -520,6 +520,7 @@ class DoctorsListService extends BaseService { "DeviceTypeID": req.DeviceTypeID, "PatientID": authUser.patientID, "PatientTypeID": authUser.patientType, + "IsComingFromCOC": isForCOC, "PatientType": authUser.patientType }; diff --git a/lib/uitl/date_uitl.dart b/lib/uitl/date_uitl.dart index 2d9c912e..34585002 100644 --- a/lib/uitl/date_uitl.dart +++ b/lib/uitl/date_uitl.dart @@ -406,7 +406,7 @@ class DateUtil { /// get data formatted like 10:30 according to lang static String formatDateToTimeLang(DateTime date, bool isArabic) { - return DateFormat('hh:mm a', isArabic ? "ar_SA" : "en_US").format(date); + return DateFormat('HH:mm', isArabic ? "ar_SA" : "en_US").format(date); } /// get data formatted like 26/4/2020 10:30 diff --git a/lib/widgets/drawer/app_drawer_widget.dart b/lib/widgets/drawer/app_drawer_widget.dart index c3a508a8..302b1ba1 100644 --- a/lib/widgets/drawer/app_drawer_widget.dart +++ b/lib/widgets/drawer/app_drawer_widget.dart @@ -20,6 +20,7 @@ import 'package:diplomaticquarterapp/pages/webRTC/call_page.dart'; import 'package:diplomaticquarterapp/routes.dart'; import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; import 'package:diplomaticquarterapp/services/family_files/family_files_provider.dart'; +import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/theme/theme_notifier.dart'; import 'package:diplomaticquarterapp/theme/theme_value.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; @@ -328,12 +329,12 @@ class _AppDrawerState extends State { letterSpacing: -0.84, fontSize: 14, projectProvider: projectProvider, - count: notificationCount != null + count: toDoProvider.notificationsCount != 0 ? new Container( padding: EdgeInsets.all(4), margin: EdgeInsets.all(2), decoration: new BoxDecoration( - color: Colors.red, + color: CustomColors.accentColor, borderRadius: BorderRadius.circular(20), ), constraints: BoxConstraints( @@ -341,7 +342,7 @@ class _AppDrawerState extends State { minHeight: 20, ), child: new Text( - notificationCount, + toDoProvider.notificationsCount.toString(), style: new TextStyle( color: Colors.white, fontSize: projectProvider.isArabic ? 8 : 9, @@ -605,12 +606,12 @@ class _AppDrawerState extends State { } getToDoCount() { - toDoProvider.setState(0, true); + toDoProvider.setState(0, true, toDoProvider.notificationsCount); ClinicListService service = new ClinicListService(); service.getActiveAppointmentNo(context).then((res) { print(res['AppointmentActiveNumber']); if (res['MessageStatus'] == 1 && res['AppointmentActiveNumber'] != null) { - toDoProvider.setState(res['AppointmentActiveNumber'], true); + toDoProvider.setState(res['AppointmentActiveNumber'], true, toDoProvider.notificationsCount); } else {} }).catchError((err) { print(err);