From 9c0337aa01229459c4cab0e45d7c7b09655ff137 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Thu, 9 Dec 2021 15:14:27 +0300 Subject: [PATCH] updates & fixes --- .../pharmacies/PointsAmountPerMonth.dart | 6 ++--- lib/pages/BookAppointment/BookConfirm.dart | 7 +++--- .../widgets/AppointmentActions.dart | 22 ++++++++++++++++--- .../screens/lakum-points-year-page.dart | 2 +- .../product-details/availability_info.dart | 12 +++++----- lib/pages/settings/profile_setting.dart | 2 +- .../medical/LabResult/LabResultWidget.dart | 4 ++-- 7 files changed, 34 insertions(+), 21 deletions(-) diff --git a/lib/core/model/pharmacies/PointsAmountPerMonth.dart b/lib/core/model/pharmacies/PointsAmountPerMonth.dart index 71cf3498..c5b96bd8 100644 --- a/lib/core/model/pharmacies/PointsAmountPerMonth.dart +++ b/lib/core/model/pharmacies/PointsAmountPerMonth.dart @@ -1,11 +1,11 @@ import 'PointsAmountPerday.dart'; class PointsAmountPerMonth { - double amountPerMonth; - String month; + dynamic amountPerMonth; + dynamic month; int monthNumber; List pointsAmountPerday; - double pointsPerMonth; + dynamic pointsPerMonth; PointsAmountPerMonth( {this.amountPerMonth, diff --git a/lib/pages/BookAppointment/BookConfirm.dart b/lib/pages/BookAppointment/BookConfirm.dart index eb14805c..63e711e5 100644 --- a/lib/pages/BookAppointment/BookConfirm.dart +++ b/lib/pages/BookAppointment/BookConfirm.dart @@ -201,9 +201,9 @@ class _BookConfirmState extends State { disabledColor: new Color(0xFFbcc2c4), onPressed: () async { if (await this.sharedPref.getBool(IS_LIVECARE_APPOINTMENT) != null && !await this.sharedPref.getBool(IS_LIVECARE_APPOINTMENT)) { - insertAppointment(context, widget.doctor); - } else { insertLiveCareScheduledAppointment(context, widget.doctor); + } else { + insertAppointment(context, widget.doctor); } }, child: Text(TranslationBase.of(context).bookAppo, style: TextStyle(fontSize: 16.0, letterSpacing: -0.48)), @@ -249,7 +249,7 @@ class _BookConfirmState extends State { GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { Future.delayed(new Duration(milliseconds: 1500), () async { - if (!await this.sharedPref.getBool(IS_LIVECARE_APPOINTMENT)) { + if (await this.sharedPref.getBool(IS_LIVECARE_APPOINTMENT) != null && !await this.sharedPref.getBool(IS_LIVECARE_APPOINTMENT)) { insertAppointment(context, widget.doctor); } else { insertLiveCareScheduledAppointment(context, widget.doctor); @@ -376,7 +376,6 @@ class _BookConfirmState extends State { getLiveCareAppointmentPatientShare(context, String appointmentNo, int clinicID, int projectID, DoctorList docObject) { widget.service.getLiveCareAppointmentPatientShare(appointmentNo, clinicID, projectID, context).then((res) { - print(res); widget.patientShareResponse = new PatientShareResponse.fromJson(res); GifLoaderDialogUtils.hideDialog(context); navigateToBookSuccess(context, docObject, widget.patientShareResponse); diff --git a/lib/pages/MyAppointments/widgets/AppointmentActions.dart b/lib/pages/MyAppointments/widgets/AppointmentActions.dart index acfe444f..fcf1b6f0 100644 --- a/lib/pages/MyAppointments/widgets/AppointmentActions.dart +++ b/lib/pages/MyAppointments/widgets/AppointmentActions.dart @@ -5,6 +5,7 @@ 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/models/Appointments/appoDetailsButtons.dart'; +import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/reminder_dialog.dart'; import 'package:diplomaticquarterapp/pages/MyAppointments/models/AppointmentType.dart'; import 'package:diplomaticquarterapp/pages/MyAppointments/models/ArrivedButtons.dart'; @@ -14,6 +15,7 @@ import 'package:diplomaticquarterapp/pages/MyAppointments/models/BookedButtonsAl import 'package:diplomaticquarterapp/pages/MyAppointments/models/ConfirmedButtons.dart'; import 'package:diplomaticquarterapp/pages/MyAppointments/models/ConfirmedButtonsAllowCheckIn.dart'; import 'package:diplomaticquarterapp/pages/MyAppointments/widgets/askDocDialog.dart'; +import 'package:diplomaticquarterapp/pages/ToDoList/ToDo.dart'; import 'package:diplomaticquarterapp/pages/feedback/feedback_home_page.dart'; import 'package:diplomaticquarterapp/pages/insurance/insurance_approval_screen.dart'; import 'package:diplomaticquarterapp/pages/medical/labs/laboratory_result_page.dart'; @@ -57,6 +59,7 @@ class _AppointmentActionsState extends State { @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); + ToDoCountProviderModel model = Provider.of(context); var size = MediaQuery.of(context).size; final double itemHeight = projectViewModel.isArabic ? ((size.height - kToolbarHeight - 24) * 0.5) / 2 : ((size.height - kToolbarHeight - 24) * 0.45) / 2; final double itemWidth = size.width / 2; @@ -72,7 +75,7 @@ class _AppointmentActionsState extends State { onTap: shouldEnable ? null : () { - _handleButtonClicks(appoButtonsList[index]); + _handleButtonClicks(appoButtonsList[index], model); }, child: MedicalProfileItem( title: appoButtonsList[index].title, @@ -88,7 +91,7 @@ class _AppointmentActionsState extends State { ); } - _handleButtonClicks(AppoDetailsButton) { + _handleButtonClicks(AppoDetailsButton, ToDoCountProviderModel model) { switch (AppoDetailsButton.caller) { case "openReschedule": widget.tabController.animateTo((widget.tabController.index + 1) % 2); @@ -113,7 +116,8 @@ class _AppointmentActionsState extends State { ); break; case "goToTodoList": - Navigator.of(context).pop(); + // Navigator.of(context).pop(); + navigateToToDoPage(context, model); break; case "askDoc": askYourDoc(); @@ -556,6 +560,18 @@ class _AppointmentActionsState extends State { ))); } + navigateToToDoPage(BuildContext context, ToDoCountProviderModel model) { + if (widget.projectViewModel.isLogin) { + if (model.count != 0) { + Navigator.push(context, FadePage(page: ToDo(isShowAppBar: true))); + } else { + AppToast.showErrorToast(message: TranslationBase.of(context).upcomingEmpty); + } + } else { + Navigator.push(context, FadePage(page: ToDo(isShowAppBar: true))); + } + } + rateAppointment() { widget.browser = new MyInAppBrowser(); var url = 'http://hmg.com/SitePages/pso.aspx?p=' + widget.appo.projectID.toString() + '.' + widget.appo.appointmentNo.toString() + '&c=1'; diff --git a/lib/pages/pharmacies/screens/lakum-points-year-page.dart b/lib/pages/pharmacies/screens/lakum-points-year-page.dart index df333cdf..ba6e4537 100644 --- a/lib/pages/pharmacies/screens/lakum-points-year-page.dart +++ b/lib/pages/pharmacies/screens/lakum-points-year-page.dart @@ -66,7 +66,7 @@ class _LakumPointsYearPageState extends State { (index) => LakumPointTableRowWidget( false, widget.pointsAmountPerYear[widget.selectedIndexYear] - .pointsAmountPerMonth[index].month, + .pointsAmountPerMonth[index].month.toString(), widget.pointsAmountPerYear[widget.selectedIndexYear] .pointsAmountPerMonth[index].pointsPerMonth, widget.pointsAmountPerYear[widget.selectedIndexYear] diff --git a/lib/pages/pharmacies/screens/product-details/availability_info.dart b/lib/pages/pharmacies/screens/product-details/availability_info.dart index 9264cac6..209a97bf 100644 --- a/lib/pages/pharmacies/screens/product-details/availability_info.dart +++ b/lib/pages/pharmacies/screens/product-details/availability_info.dart @@ -57,13 +57,11 @@ class AvailabilityInfo extends StatelessWidget { icon: Icon(Icons.location_on), color: Colors.red, onPressed: () async { - // if (await MapLauncher.isMapAvailable(MapType.apple)) { - await MapLauncher.showMarker( - mapType: MapType.google, - coords: Coords(double.parse(previousModel.productLocationService[index].latitude), double.parse(previousModel.productLocationService[index].longitude)), - title: previousModel.productLocationService[index].locationDescription, - ); - // } + await MapLauncher.showMarker( + mapType: MapType.google, + coords: Coords(double.parse(previousModel.productLocationService[index].latitude), double.parse(previousModel.productLocationService[index].longitude)), + title: previousModel.productLocationService[index].locationDescription, + ); }, ), ), diff --git a/lib/pages/settings/profile_setting.dart b/lib/pages/settings/profile_setting.dart index 7f1f6a93..efb4ecae 100644 --- a/lib/pages/settings/profile_setting.dart +++ b/lib/pages/settings/profile_setting.dart @@ -280,7 +280,7 @@ class _ProfileSettings extends State with TickerProviderStateMi TextField( enabled: isEnable, scrollPadding: EdgeInsets.zero, - keyboardType: TextInputType.number, + keyboardType: TextInputType.emailAddress, controller: _controller, // onChanged: (value) => {validateForm()}, style: TextStyle( diff --git a/lib/widgets/data_display/medical/LabResult/LabResultWidget.dart b/lib/widgets/data_display/medical/LabResult/LabResultWidget.dart index f4081c21..1d8972cc 100644 --- a/lib/widgets/data_display/medical/LabResult/LabResultWidget.dart +++ b/lib/widgets/data_display/medical/LabResult/LabResultWidget.dart @@ -187,7 +187,7 @@ class LabResultWidget extends StatelessWidget { ), Utils.tableColumnValue(labResultList[i].resultValue + " " + labResultList[i].uOM, isLast: true), Utils.tableColumnValue(labResultList[i].referanceRange, isLast: true, isCapitable: false), - InkWell( + !checkIfCovidLab(patientLabResultList) ? InkWell( onTap: () { Navigator.push( context, @@ -203,7 +203,7 @@ class LabResultWidget extends StatelessWidget { padding: EdgeInsets.only(left: !projectViewModel.isArabic ? 0 : 12, right: !projectViewModel.isArabic ? 12 : 0), child: Utils.tableColumnValueWithUnderLine(TranslationBase.of(context).viewFlowChart, isLast: true, isCapitable: false), ), - ), + ) : Container(), ], ), );