From ff0d66ccdbb9c6df99504dbd05c1b7cb446ca6e2 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Thu, 3 Dec 2020 14:04:11 +0300 Subject: [PATCH 01/42] Covid test translations --- lib/config/localized_values.dart | 8 +++ .../Covid-DriveThru/Covid-TimeSlots.dart | 60 ++++++++++--------- .../covid-drivethru-location.dart | 52 ++++++++-------- lib/pages/landing/home_page.dart | 10 ++-- lib/uitl/translations_delegate_base.dart | 3 +- 5 files changed, 75 insertions(+), 58 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index d51376c3..23e55ea4 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -1178,5 +1178,13 @@ const Map localizedValues = { "referralNumber": { "en": "Referral Number", "ar": "رقم الإحالة" + }, + "covidTest": { + "en": "COVID-19 TEST", + "ar": "فحص كورونا" + }, + "driveThru": { + "en": "Drive-Thru", + "ar": "من السيارة" } }; diff --git a/lib/pages/Covid-DriveThru/Covid-TimeSlots.dart b/lib/pages/Covid-DriveThru/Covid-TimeSlots.dart index 3e58b657..6481a479 100644 --- a/lib/pages/Covid-DriveThru/Covid-TimeSlots.dart +++ b/lib/pages/Covid-DriveThru/Covid-TimeSlots.dart @@ -9,13 +9,13 @@ import 'package:diplomaticquarterapp/services/covid-drivethru/covid-drivethru.da import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.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'; import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:intl/intl.dart'; -import 'package:smart_progress_bar/smart_progress_bar.dart'; import 'package:table_calendar/table_calendar.dart'; class CovidTimeSlots extends StatefulWidget { @@ -469,9 +469,7 @@ class _CovidTimeSlotsState extends State } bookCovidTestAppointment() { -// Navigator.push(context, -// MaterialPageRoute(builder: (context) => CovidPaymentAlert())); - + GifLoaderDialogUtils.showMyDialog(context); DoctorList docObject = new DoctorList(); docObject.doctorID = widget.selectedDoctorID; docObject.clinicID = widget.selectedClinicID; @@ -494,11 +492,12 @@ class _CovidTimeSlotsState extends State print(res); if (res['MessageStatus'] == 1) { AppToast.showSuccessToast(message: "Appointment Booked Successfully"); - Future.delayed(new Duration(milliseconds: 1800), () { - getPatientShare(context, res['AppointmentNo'], docObject.clinicID, - docObject.projectID, docObject); - }); + // Future.delayed(new Duration(milliseconds: 1800), () { + getPatientShare(context, res['AppointmentNo'], docObject.clinicID, + docObject.projectID, docObject); + // }); } else { + GifLoaderDialogUtils.hideDialog(context); appo = new AppoitmentAllHistoryResultList(); appo.appointmentNo = res['SameClinicApptList'][0]['AppointmentNo']; appo.clinicID = res['SameClinicApptList'][0]['DoctorID']; @@ -521,28 +520,32 @@ class _CovidTimeSlotsState extends State dialog.showAlertDialog(context); } }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); AppToast.showErrorToast(message: err); print(err); - }).showProgressBar( - text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + }); } cancelAppointment(DoctorList docObject, AppoitmentAllHistoryResultList appo, BuildContext context) { + GifLoaderDialogUtils.showMyDialog(context); ConfirmDialog.closeAlertDialog(context); DoctorsListService service = new DoctorsListService(); service.cancelAppointment(appo, context).then((res) { + GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { - Future.delayed(new Duration(milliseconds: 1500), () { - insertAppointmentCovidTest(context, docObject); - }); + // Future.delayed(new Duration(milliseconds: 1500), () { + insertAppointmentCovidTest(context, docObject); + // }); } else { + GifLoaderDialogUtils.hideDialog(context); AppToast.showErrorToast(message: res['ErrorEndUserMessage']); } }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + AppToast.showErrorToast(message: err); print(err); - }).showProgressBar( - text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + }); } getPatientShare(context, String appointmentNo, int clinicID, int projectID, @@ -551,17 +554,14 @@ class _CovidTimeSlotsState extends State service .getPatientShare(appointmentNo, clinicID, projectID, context) .then((res) { - print(res); - widget.patientShareResponse = new PatientShareResponse.fromJson(res); - }) - .catchError((err) { - print(err); - }) - .showProgressBar( - text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)) - .then((value) { - navigateToPaymentAlert(); - }); + GifLoaderDialogUtils.hideDialog(context); + widget.patientShareResponse = new PatientShareResponse.fromJson(res); + navigateToPaymentAlert(); + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + AppToast.showErrorToast(message: err); + print(err); + }); } navigateToPaymentAlert() { @@ -573,8 +573,10 @@ class _CovidTimeSlotsState extends State } getCovidFreeSlots(BuildContext context, int projectID) { + GifLoaderDialogUtils.showMyDialog(context); CovidDriveThruService service = new CovidDriveThruService(); service.getCovidFreeSlots(context, projectID).then((res) { + GifLoaderDialogUtils.hideDialog(context); print(res['COVID19_FreeTimeSlots']); if (res['MessageStatus'] == 1) { if (res['COVID19_FreeTimeSlots'].length != 0) { @@ -592,11 +594,13 @@ class _CovidTimeSlotsState extends State }); } else {} } else { + GifLoaderDialogUtils.hideDialog(context); AppToast.showErrorToast(message: res['ErrorEndUserMessage']); } }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + AppToast.showErrorToast(message: err); print(err); - }).showProgressBar( - text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + }); } } diff --git a/lib/pages/Covid-DriveThru/covid-drivethru-location.dart b/lib/pages/Covid-DriveThru/covid-drivethru-location.dart index 0563c4bd..b4c02d50 100644 --- a/lib/pages/Covid-DriveThru/covid-drivethru-location.dart +++ b/lib/pages/Covid-DriveThru/covid-drivethru-location.dart @@ -3,11 +3,12 @@ import 'package:diplomaticquarterapp/models/CovidDriveThru/DriveThroughTestingCe import 'package:diplomaticquarterapp/pages/Covid-DriveThru/covid-payment-details.dart'; import 'package:diplomaticquarterapp/routes.dart'; import 'package:diplomaticquarterapp/services/covid-drivethru/covid-drivethru.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/material.dart'; import 'package:maps_launcher/maps_launcher.dart'; -import 'package:smart_progress_bar/smart_progress_bar.dart'; class CovidDrivethruLocation extends StatefulWidget { @override @@ -253,6 +254,8 @@ class _CovidDrivethruLocationState extends State { } getPaymentInfo(BuildContext context, String projectID) { + GifLoaderDialogUtils.showMyDialog(context); + CovidDriveThruService service = new CovidDriveThruService(); CovidPaymentInfoResponse covidPaymentInfoResponse = @@ -261,33 +264,33 @@ class _CovidDrivethruLocationState extends State { service .getCovidPaymentInformation(context, int.parse(projectID)) .then((res) { - if (res['MessageStatus'] == 1) { - setState(() { - covidPaymentInfoResponse = CovidPaymentInfoResponse.fromJson( - res['COVID19_PatientShare']); - print(covidPaymentInfoResponse.procedureNameField); - }); - } else {} - }) - .catchError((err) { - print(err); - }) - .showProgressBar( - text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)) - .then((value) { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => CovidPaymentDetails( - covidPaymentInfoResponse: covidPaymentInfoResponse, - projectID: int.parse(projectID), - ))); + GifLoaderDialogUtils.hideDialog(context); + if (res['MessageStatus'] == 1) { + setState(() { + covidPaymentInfoResponse = + CovidPaymentInfoResponse.fromJson(res['COVID19_PatientShare']); + print(covidPaymentInfoResponse.procedureNameField); }); + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => CovidPaymentDetails( + covidPaymentInfoResponse: covidPaymentInfoResponse, + projectID: int.parse(projectID), + ))); + } else {} + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + AppToast.showErrorToast(message: err); + print(err); + }); } getProjectsList(BuildContext context) { + GifLoaderDialogUtils.showMyDialog(context); CovidDriveThruService service = new CovidDriveThruService(); service.getCovidProjectsList(context).then((res) { + GifLoaderDialogUtils.hideDialog(context); print(res); if (res['MessageStatus'] == 1) { print(res); @@ -298,8 +301,9 @@ class _CovidDrivethruLocationState extends State { }); } else {} }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + AppToast.showErrorToast(message: err); print(err); - }).showProgressBar( - text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + }); } } diff --git a/lib/pages/landing/home_page.dart b/lib/pages/landing/home_page.dart index fb2cc108..eb7cedb7 100644 --- a/lib/pages/landing/home_page.dart +++ b/lib/pages/landing/home_page.dart @@ -85,10 +85,10 @@ class _HomePageState extends State { borderRadius: BorderRadius.all( Radius.circular(5))), child: Container( - margin: EdgeInsets.only(top: 10.0), + margin: EdgeInsets.only(top: 5.0), child: Column( children: [ - Text("COVID-19 TEST", + Text(TranslationBase.of(context).covidTest, style: TextStyle( color: Colors.white, fontWeight: @@ -107,10 +107,10 @@ class _HomePageState extends State { Container( margin: EdgeInsets.only( left: 10.0, - top: 10.0), + top: 5.0), child: Column( children: [ - Text("Drive-Thru", + Text(TranslationBase.of(context).driveThru, style: TextStyle( color: Colors .white, @@ -147,7 +147,7 @@ class _HomePageState extends State { navigateToCovidDriveThru(); }, child: Text( - "BOOK NOW", + TranslationBase.of(context).bookNow, style: TextStyle( fontSize: 12.0)), diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index aa05456c..e970bdb3 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -898,11 +898,12 @@ String get fileno => localizedValues['fileno'][locale.languageCode]; String get addedChild => localizedValues['added-child'][locale.languageCode]; String get appUpdate => localizedValues['appUpdate'][locale.languageCode]; String get ereferralSaveSuccess => localizedValues['ereferralSaveSuccess'][locale.languageCode]; - String get referralStatus => localizedValues['referralStatus'][locale.languageCode]; String get referralDate => localizedValues['referralDate'][locale.languageCode]; String get patientName => localizedValues['patientName'][locale.languageCode]; String get referralNumber => localizedValues['referralNumber'][locale.languageCode]; + String get covidTest => localizedValues['covidTest'][locale.languageCode]; + String get driveThru => localizedValues['driveThru'][locale.languageCode]; } From e495d3e5ad16c2b68c84c313e1ae60b15b10ca76 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Wed, 9 Dec 2020 10:18:56 +0300 Subject: [PATCH 02/42] Health Data integration implementing --- android/app/src/main/AndroidManifest.xml | 1 + lib/config/config.dart | 3 + lib/config/localized_values.dart | 12 ++ .../health_data_list.dart | 70 +++++++-- .../smart_watch_health_data/stepsTracker.dart | 91 +++++++++++ .../appointment_services/GetDoctorsList.dart | 144 +++++++++++++----- lib/uitl/translations_delegate_base.dart | 3 + pubspec.yaml | 2 +- 8 files changed, 270 insertions(+), 56 deletions(-) create mode 100644 lib/pages/medical/smart_watch_health_data/stepsTracker.dart diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 12ced804..0ef45c2b 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -9,6 +9,7 @@ + diff --git a/lib/config/config.dart b/lib/config/config.dart index 81c5f2e4..730cb049 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -243,6 +243,9 @@ const GET_USER_TERMS = '/Services/Patients.svc/REST/GetUserTermsAndConditions'; const UPDATE_HEALTH_TERMS = '/services/Patients.svc/REST/UpdatePateintHealthSummaryReport'; +const GET_PATIENT_HEALTH_STATS = 'Services/Patients.svc/REST/Med_GetTransactionsSts'; + + //URL to get medicine and pharmacies list const CHANNEL = 3; const GENERAL_ID = 'Cs2020@2016\$2958'; diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 7d067ab7..d81c6693 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -1337,4 +1337,16 @@ const Map localizedValues = { "cancelOrderMsg": {"en": "Are you sure!! want to cancel this order", "ar": "هل أنت واثق!! تريد إلغاء هذا الطلب"}, "processDoneSuccessfully": {"en": "Process Done Successfully", "ar": "تمت العملية بنجاح"}, "selectHomeHealthCareServices": {"en": "Select Home Health Care Services", "ar": " حدد خدمات الرعاية الصحية المنزلية"}, + "weekly": { + "en": "Weekly", + "ar": "أسبوعي" + }, + "monthly": { + "en": "Monthly", + "ar": "شهري" + }, + "yearly": { + "en": "Yearly", + "ar": "سنوي" + }, }; diff --git a/lib/pages/medical/smart_watch_health_data/health_data_list.dart b/lib/pages/medical/smart_watch_health_data/health_data_list.dart index f7a7d437..3d6f5295 100644 --- a/lib/pages/medical/smart_watch_health_data/health_data_list.dart +++ b/lib/pages/medical/smart_watch_health_data/health_data_list.dart @@ -1,8 +1,10 @@ import 'package:diplomaticquarterapp/models/SmartWatch/HealthData.dart'; +import 'package:diplomaticquarterapp/pages/medical/smart_watch_health_data/stepsTracker.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:fit_kit/fit_kit.dart'; import 'package:flutter/material.dart'; @@ -85,21 +87,26 @@ class _HealthDataListState extends State { Divider( color: Colors.grey[500], ), - Row( - children: [ - Container( - child: Image.asset( - "assets/images/SmartWatches/heartrate_icon.png", - width: 60.0, - height: 60.0), - ), - Container( - margin: EdgeInsets.fromLTRB(20.0, 0.0, 20.0, 0.0), - child: Text("Steps", - style: TextStyle( - fontSize: 20.0, fontWeight: FontWeight.bold)), - ), - ], + InkWell( + onTap: () { + navigateToStepsTracker(StepsTracker()); + }, + child: Row( + children: [ + Container( + child: Image.asset( + "assets/images/SmartWatches/heartrate_icon.png", + width: 60.0, + height: 60.0), + ), + Container( + margin: EdgeInsets.fromLTRB(20.0, 0.0, 20.0, 0.0), + child: Text("Steps", + style: TextStyle( + fontSize: 20.0, fontWeight: FontWeight.bold)), + ), + ], + ), ), Divider( color: Colors.grey[500], @@ -170,6 +177,10 @@ class _HealthDataListState extends State { )); } + navigateToStepsTracker(Widget page) { + Navigator.push(context, FadePage(page: page)); + } + void readLast() async { final result = await FitKit.readLast(DataType.DISTANCE); print(result); @@ -241,6 +252,35 @@ class _HealthDataListState extends State { } }); GifLoaderDialogUtils.hideDialog(context); + readSleepDataAndroid(); + } + } + + void readSleepDataAndroid() async { + GifLoaderDialogUtils.showMyDialog(context); + sleepListAndroid.clear(); + if (await FitKit.requestPermissions(dataTypes)) { + print("Sleep Data"); + final results = await FitKit.read( + DataType.SLEEP, + dateFrom: DateTime.now().subtract(Duration(days: 10)), + dateTo: DateTime.now(), + limit: 20, + ); + print(results); + sleepListAndroid = results; + sleepListAndroid.forEach((element) { + if (element.value != 0) { + addDataToHealthDataArray( + 6, + 0, + DateUtil.convertDateToString(element.dateFrom), + element.value.toString(), + transactionsListID); + transactionsListID++; + } + }); + GifLoaderDialogUtils.hideDialog(context); readEnergyAndroid(); } } diff --git a/lib/pages/medical/smart_watch_health_data/stepsTracker.dart b/lib/pages/medical/smart_watch_health_data/stepsTracker.dart new file mode 100644 index 00000000..eec41a35 --- /dev/null +++ b/lib/pages/medical/smart_watch_health_data/stepsTracker.dart @@ -0,0 +1,91 @@ +import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/material.dart'; + +class StepsTracker extends StatefulWidget { + @override + _StepsTrackerState createState() => _StepsTrackerState(); +} + +class _StepsTrackerState extends State + with SingleTickerProviderStateMixin { + TabController _tabController; + + @override + void initState() { + _tabController = new TabController(length: 3, vsync: this); + WidgetsBinding.instance.addPostFrameCallback((_) { + getYearlyStepsData(); + }); + super.initState(); + } + + @override + Widget build(BuildContext context) { + return AppScaffold( + isShowAppBar: true, + appBarTitle: "Steps", + isShowDecPage: false, + body: Container( + child: Column( + mainAxisSize: MainAxisSize.max, + children: [ + TabBar( + tabs: [ + Tab(text: TranslationBase.of(context).weekly), + Tab(text: TranslationBase.of(context).monthly), + Tab(text: TranslationBase.of(context).yearly), + ], + controller: _tabController, + ), + Expanded( + child: new TabBarView( + physics: NeverScrollableScrollPhysics(), + children: [ + getWeeklyStepsDetails(), + getMonthlyStepsDetails(), + getYearlyStepsDetails() + ], + controller: _tabController, + ), + ), + ], + ), + ), + ); + } + + getYearlyStepsData() { + DoctorsListService service = new DoctorsListService(); + GifLoaderDialogUtils.showMyDialog(context); + service.getPatientHealthDataStats(6, 3, context).then((res) { + GifLoaderDialogUtils.hideDialog(context); + print(res['Med_GetYearStepsTransactionsStsList']); + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + AppToast.showErrorToast(message: err); + print(err); + }); + } + + getWeeklyStepsDetails() { + return Container( + child: Text("Weekly"), + ); + } + + getMonthlyStepsDetails() { + return Container( + child: Text("Monthly"), + ); + } + + getYearlyStepsDetails() { + return Container( + child: Text("Yearly"), + ); + } +} diff --git a/lib/services/appointment_services/GetDoctorsList.dart b/lib/services/appointment_services/GetDoctorsList.dart index a320cf6b..702a524e 100644 --- a/lib/services/appointment_services/GetDoctorsList.dart +++ b/lib/services/appointment_services/GetDoctorsList.dart @@ -41,7 +41,8 @@ class DoctorsListService extends BaseService { long = await this.sharedPref.getDouble(USER_LONG); } - var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + var languageID = + await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); Request req = appGlobal.getPublicRequest(); request = { "LanguageID": languageID == 'ar' ? 1 : 2, @@ -105,7 +106,8 @@ class DoctorsListService extends BaseService { long = await this.sharedPref.getDouble(USER_LONG); } - var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + var languageID = + await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); Request req = appGlobal.getPublicRequest(); request = { "LanguageID": languageID == 'ar' ? 1 : 2, @@ -145,7 +147,8 @@ class DoctorsListService extends BaseService { Future getDoctorsProfile( int docID, int clinicID, int projectID, context) async { Map request; - var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + var languageID = + await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); Request req = appGlobal.getPublicRequest(); request = { "LanguageID": languageID == 'ar' ? 1 : 2, @@ -177,10 +180,10 @@ class DoctorsListService extends BaseService { return Future.value(localRes); } - Future getDoctorsRating( - int docID, context) async { + Future getDoctorsRating(int docID, context) async { Map request; - var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + var languageID = + await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); Request req = appGlobal.getPublicRequest(); request = { "LanguageID": languageID == 'ar' ? 1 : 2, @@ -203,17 +206,17 @@ class DoctorsListService extends BaseService { await baseAppClient.post(GET_DOCTOR_RATING_NOTES, onSuccess: (response, statusCode) async { - localRes = response; - }, onFailure: (String error, int statusCode) { - throw error; - }, body: request); + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: request); return Future.value(localRes); } - Future getDoctorsRatingDetails( - int docID, context) async { + Future getDoctorsRatingDetails(int docID, context) async { Map request; - var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + var languageID = + await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); Request req = appGlobal.getPublicRequest(); request = { "LanguageID": languageID == 'ar' ? 1 : 2, @@ -236,17 +239,18 @@ class DoctorsListService extends BaseService { await baseAppClient.post(GET_DOCTOR_RATING_DETAILS, onSuccess: (response, statusCode) async { - localRes = response; - }, onFailure: (String error, int statusCode) { - throw error; - }, body: request); + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: request); return Future.value(localRes); } Future getDoctorFreeSlots( int docID, int clinicID, int projectID, BuildContext context) async { Map request; - var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + var languageID = + await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); Request req = appGlobal.getPublicRequest(); request = { "DoctorID": docID, @@ -281,7 +285,8 @@ class DoctorsListService extends BaseService { Future getDoctorScheduledFreeSlots(int docID, int clinicID, int projectID, int serviceID, BuildContext context) async { Map request; - var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + var languageID = + await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); Request req = appGlobal.getPublicRequest(); request = { "DoctorID": docID, @@ -324,7 +329,8 @@ class DoctorsListService extends BaseService { authUser = data; } - var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + var languageID = + await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); Request req = appGlobal.getPublicRequest(); request = { "IsForLiveCare": false, @@ -383,7 +389,8 @@ class DoctorsListService extends BaseService { authUser = data; } - var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + var languageID = + await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); Request req = appGlobal.getPublicRequest(); request = { "IsForLiveCare": true, @@ -437,7 +444,8 @@ class DoctorsListService extends BaseService { authUser = data; } - var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + var languageID = + await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); Request req = appGlobal.getPublicRequest(); request = { @@ -481,7 +489,8 @@ class DoctorsListService extends BaseService { authUser = data; } - var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + var languageID = + await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); Request req = appGlobal.getPublicRequest(); request = { @@ -526,7 +535,8 @@ class DoctorsListService extends BaseService { authUser = data; } - var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + var languageID = + await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); Request req = appGlobal.getPublicRequest(); request = { @@ -560,7 +570,8 @@ class DoctorsListService extends BaseService { Future getPatientAppointmentCurfewHistory( bool isActiveAppointment) async { Map request; - var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + var languageID = + await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); Request req = appGlobal.getPublicRequest(); request = { @@ -601,7 +612,8 @@ class DoctorsListService extends BaseService { authUser = data; } - var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + var languageID = + await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); Request req = appGlobal.getPublicRequest(); request = { @@ -654,7 +666,8 @@ class DoctorsListService extends BaseService { long = await this.sharedPref.getDouble(USER_LONG); } - var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + var languageID = + await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); Request req = appGlobal.getPublicRequest(); request = { @@ -701,7 +714,8 @@ class DoctorsListService extends BaseService { authUser = data; } - var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + var languageID = + await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); Request req = appGlobal.getPublicRequest(); request = { @@ -751,7 +765,8 @@ class DoctorsListService extends BaseService { authUser = data; } - var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + var languageID = + await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); Request req = appGlobal.getPublicRequest(); request = { @@ -802,7 +817,8 @@ class DoctorsListService extends BaseService { authUser = data; } - var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + var languageID = + await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); Request req = appGlobal.getPublicRequest(); request = { @@ -847,7 +863,8 @@ class DoctorsListService extends BaseService { await this.sharedPref.getObject(USER_PROFILE)); authUser = data; } - var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + var languageID = + await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); Request req = appGlobal.getPublicRequest(); request = { "ClientRequestID": transactionID, @@ -886,7 +903,8 @@ class DoctorsListService extends BaseService { await this.sharedPref.getObject(USER_PROFILE)); authUser = data; } - var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + var languageID = + await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); Request req = appGlobal.getPublicRequest(); request = { "AdvanceNumber": advanceNumber, @@ -923,7 +941,8 @@ class DoctorsListService extends BaseService { await this.sharedPref.getObject(USER_PROFILE)); authUser = data; } - var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + var languageID = + await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); Request req = appGlobal.getPublicRequest(); request = { "IsForAskYourDoctor": true, @@ -963,7 +982,8 @@ class DoctorsListService extends BaseService { await this.sharedPref.getObject(USER_PROFILE)); authUser = data; } - var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + var languageID = + await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); Request req = appGlobal.getPublicRequest(); request = { "VersionID": req.VersionID, @@ -999,7 +1019,8 @@ class DoctorsListService extends BaseService { await this.sharedPref.getObject(USER_PROFILE)); authUser = data; } - var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + var languageID = + await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); Request req = appGlobal.getPublicRequest(); request = { @@ -1058,7 +1079,8 @@ class DoctorsListService extends BaseService { await this.sharedPref.getObject(USER_PROFILE)); authUser = data; } - var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + var languageID = + await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); Request req = appGlobal.getPublicRequest(); request = { "AppointmentNo": appoNo, @@ -1095,7 +1117,8 @@ class DoctorsListService extends BaseService { await this.sharedPref.getObject(USER_PROFILE)); authUser = data; } - var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + var languageID = + await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); Request req = appGlobal.getPublicRequest(); request = { "AppointmentNo": appo.appointmentNo, @@ -1136,7 +1159,8 @@ class DoctorsListService extends BaseService { await this.sharedPref.getObject(USER_PROFILE)); authUser = data; } - var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + var languageID = + await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); Request req = appGlobal.getPublicRequest(); request = { "AppointmentDate": appoDate, @@ -1185,7 +1209,8 @@ class DoctorsListService extends BaseService { await this.sharedPref.getObject(USER_PROFILE)); authUser = data; } - var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + var languageID = + await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); Request req = appGlobal.getPublicRequest(); request = { "ProjectID": projectID, @@ -1244,7 +1269,8 @@ class DoctorsListService extends BaseService { await this.sharedPref.getObject(USER_PROFILE)); authUser = data; } - var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + var languageID = + await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); Request req = appGlobal.getPublicRequest(); request = { @@ -1282,4 +1308,42 @@ class DoctorsListService extends BaseService { }, body: request); return Future.value(localRes); } + + Future getPatientHealthDataStats( + int medCategoryId, int medCategoryStsId, BuildContext context) async { + Map request; + if (await this.sharedPref.getObject(USER_PROFILE) != null) { + var data = AuthenticatedUser.fromJson( + await this.sharedPref.getObject(USER_PROFILE)); + authUser = data; + } + var languageID = + await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + Request req = appGlobal.getPublicRequest(); + request = { + "MedCategoryID": medCategoryId, + "MedGetStsID": medCategoryStsId, + "VersionID": req.VersionID, + "Channel": req.Channel, + "LanguageID": languageID == 'ar' ? 1 : 2, + "IPAdress": req.IPAdress, + "generalid": req.generalid, + "PatientOutSA": authUser.outSA, + "SessionID": "YckwoXhUmWBsnHKEKig", + "isDentalAllowedBackend": false, + "DeviceTypeID": req.DeviceTypeID, + "PatientID": authUser.patientID, + "TokenID": "@dm!n", + "PatientTypeID": authUser.patientType, + "PatientType": authUser.patientType + }; + dynamic localRes; + await baseAppClient.post(GET_PATIENT_HEALTH_STATS, + onSuccess: (response, statusCode) async { + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: request); + return Future.value(localRes); + } } diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index b607c9ac..074b7aed 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -996,6 +996,9 @@ String get fileno => localizedValues['fileno'][locale.languageCode]; String get cancelOrderMsg => localizedValues['cancelOrderMsg'][locale.languageCode]; String get processDoneSuccessfully => localizedValues['processDoneSuccessfully'][locale.languageCode]; String get selectHomeHealthCareServices => localizedValues['selectHomeHealthCareServices'][locale.languageCode]; + + String get weekly => localizedValues['weekly'][locale.languageCode]; + String get yearly => localizedValues['yearly'][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/pubspec.yaml b/pubspec.yaml index e74a0939..0ecf3333 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -150,7 +150,7 @@ dependencies: # recase: ^3.0.0 wakelock: ^0.1.4 after_layout: ^1.0.7 - twilio_programmable_video: ^0.6.3+1 + twilio_programmable_video: 0.6.3+1 flutter_tts: any vibration: ^1.7.2 speech_to_text: From b55681a05658c0a41190e50251230400ec6ca106 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Wed, 9 Dec 2020 17:01:56 +0300 Subject: [PATCH 03/42] Working on steps tracking --- assets/images/new-design/view_more.png | Bin 0 -> 6069 bytes .../SmartWatch/YearlyStepsResModel.dart | 36 ++++ .../smart_watch_health_data/stepsTracker.dart | 171 +++++++++++++++++- 3 files changed, 200 insertions(+), 7 deletions(-) create mode 100644 assets/images/new-design/view_more.png create mode 100644 lib/models/SmartWatch/YearlyStepsResModel.dart diff --git a/assets/images/new-design/view_more.png b/assets/images/new-design/view_more.png new file mode 100644 index 0000000000000000000000000000000000000000..8b52a7e71c8b9693382313dcf4f14489bf57367a GIT binary patch literal 6069 zcmY*dbyyV6+FhkPRtf1vLSmN^X+#>9Zjf&2Ws#6Z>24&H)}^GoS-QJH*aZY6r9nRZ z-TU3|e)Bx<%sXe!oHOtIF@H>ix~e=8{u6uv06?UuAfx$bRQ?;d*nfHSPT! zXY_J%baof<5(oXm5c!k;g&`oue<*MVage@>I-|4;%$o5zSOClelE7zVWE6v0*@$S$ z$o+f!pP4ww4i0w}fj~SxJ;9#*U>BGzgjZNt7{bE`;p5}}!{B!Jc7~gKaXY&+|4Zb5 zb!4pFEn)VqaC;YL#=pAe7A_ueaS-UQ(SO>%&Iz}-`9CLT_kWl5r$ETx6$mew2l5~7 zKU>BAq9STAd+R^WfAuAJ#r|RbKkVN=VvxV)|8t1;61espt{b3l*8X#V7eiGa&Uh&LgEp+Jh19sY2th~EZ(is_EI zFxN@RP0{-UBmOhe9YA-1{p4`G&Bw%ffdaw#7BWj9<)Q`K+g7TZw3 zMw!-5tNYYPhgkvsWxxnyyPMxin7Y~46R+1UHd9?xmj!`}2Eyq9UO&*=b}M6*V=ej~WC0quM@l0~@%Xw`{6DW+D^nY363+m6_8PB<^@c zRw?sR=^*ZogVz$)FyW&h*VB|S!AG>8H~qJR6-m%{Ioncaekbk_CMRkrOV0hROTZEm z#ba+PGC4|RK=?Z^HI+*gX0?(wXGFH=GEfh$2yZ|e2<2G7TrVj=T{!#_Frg00Z59Uu zieMFVBP~8LP|srN%ife3_}%m=EORnrI!>?UYO7fjZ_`XD*g(*ruOJC)jtA@%5B9WM zX=<{oL4gBXSr3{7_PxXDB?%;*c)DC(N=Ki_pLV@~l7|2j$d8DeWxH0WZ;e#(`uE0c zZaQw5Gk&k)?5+8~3p9NK$L_6GWQkgH-ug;^*IML~xVLO{(4>Q5fSImFPqn_9!lv+g z4z9o_Qql9V;UQh)cZp1CJ&$6h#p~962}n{~Zh7q)+D5EKG-E=Mc8E2GYwG8@;H>T_ zLjOczImS1;*>HBuS}L)-0V!_fI;KbWloevmU-TMJrM9Il!JVp$3}UkcmWMbWmisx) zWiP+Fe1Lro9ERc>(4JHD7T@j7K_b&q?+_g1cMqGe)%m5uS&u8m2U@+9W-g8MxgwQHJ^HTyfODqK;gDyU3rv;W=XWYy)Y*V8Iro}__} zlyEA_J|uG+ijKf{riLm^ww%C20>Y8Z8RA&=a`c7Chs_4R3`YlB+cmwpwhPJZB&m7( zgjzhyX`OUYIns{VL>XJ1!ide z3~!s&xPmUbfjX*7s<$sw9Ej<~Vl`XzStS@Uk4|!_iCj9MzMLA=;n($%3h;&aZR_Kv z?RrrrEUQshP%tB!Pv1~_vn#g z7e>$lS%#W`Lqs*Z71wt|^yQH$uld%Q@?Jg??I|9PgiEMpfx34T25WeH%Z$=F8mAdb zUIRs%Ue91)Qvw$pWd(fD?;Pd=C`V9+G&E#qKvAl#1`__y46VOTN{W$r_d)gatf@Au zJzLtIxSsjJ2h7L@yXT`+8jQmPG6HWp(rg}LF!z@NaYbaBnR}X|+(`wVpksjP7QgNyiU&=P6m=%`x2K;a4&?qSi?3 z`_f`ZNEhDAILle<#Fj9!FaFl-UT-!_h_^$1K5oNK({S@JR7FM1HjmnUdrhA#3aq;A z3zv+>$#o`=7G*L}FK^C<)4eS%$z;#yf{TH64AkO;`@6DvM<>o7uot{QWO1=Yq)1x} z)cM%lMeb!3M8M^zIe**rGDh%w9t9Jm>Zn$%{+xe{6^sw&*A!FpR=qZlNzenmHV_Xn z5YOXia^|*PS{iUzQk%_MKox5OdcMgm38OQ~YXxve(Wisj#6!%YXzxS6OSis70%C>( zn@RvBTFbQev4Ng|pprI{)8;izoE)c^NtZs=_QH!;oC0zpE;EB2dv_CA!eCMjl&7yk zO8qL-cEuZK#0SL`X|gQSco7?~W5}vg=sZt6XG3%Sh@}o9GRfnB8j^;MZq)Fj-lgM! zGsGRvpT|dwHbt@$sCAmGEPh;AniuMe5Yjs>1$Iy~*#5$E7paKE^k+=sGkKLCX{@O< zv1o{juR!GO9xkg+6cG$a`Xqm;kwJM|MEjwiQ-0)ARmuFI|ElK$Ph~8PTg8IRBNs;} zoAum z5Js1nC(LeG>1!64SxmLXb<6X}3s)`}jf4D%Eu<-}z0Q*wbH4E*xnbLXH(&#A;_O%s zUZhsMd$^+Fe8-n}pf=9p@!mdD%CC-_Z$?*Nf@7?V(qcHJfmpCt2^>aNGd0p1DG~{a zl0JL(e!oOHZM2HcHfEoQ{~^K5bJE^X;&7q(XSQ7;Qo_Kx-PccA(9HsuzXa2}d}!V` z^4n^j`Q0m=2V>1^OGxQ*v9?gr6iF0M7THI+z)e`l6+ehXlRb7HuQlH8lI*CyuOtq( znCFP(BA&5%?>I8)J}Ntw`AN4z`~zh_TrTACOOR!waDoOpNNc?NZDcD9i)a~6K-79< zk@Kz5{p>r-bm)_U8Edt$R6 zm?y{**!N;w49%n2$Qil1C<+Z5jFU*hzsu_5rVU_lRqgiVv@>|@|3FVn8m2$pM^GT8 zHI!n|=zWTXIvv|t-)Q;3Xhzu;4tgT>lqxKA_yca3xJtDHrPdk|jlI_xy)0E8xC#Dj zs0Qv&z3N{|sj6gJvluW}RbEEO0eXa}TgV>& zo`C&KFK5#UX<{nQ0La85r7gU(eA@j83W@0-!P5IDYaQ5EeQ~bB7LVsY=kroM)NUqJ z-UNoj590e^D_5RJ?WVbmTZ+1xReS?nfT^RaN1 z;g-Kp@QzK`LwRPFI0@p^|9Ip{h!U8Jk-vZmM^>WoW51sxv1Xk2{G zFZNI_$u?Ie8f9}~*i%r2vww!dP|-0UT_zDA-T3AGOPmv5W2sPMYo~fr z2m;+9P3l8pwar(~I=4lK+H%XXd4lfsHx0*lR**{79!zaXcelM*%2zA9e4 zO?J@8yolOx%W&9~r}}xDLcJ&S+v^Emlvn`JhHE%~kex^u=&fKJWyK#Cv3tN;Y%Z*` z@|JT!ADU^oer&3~Ve0?t?VYff_72Z-p-1!WiEVe)iAaQB9Z+uI0udVH5=l++>BX9@ zfvKLJhH+(je_r{4v*6Y*qF?k1R@JTGYY?u+1oEY{8t)p5e)KDMJ`R-1oY_O`gykve z(FNtNyXQ;&owP&yaAJw8r!4gT$ywLc16}El=O+YFCehz=d3h8Ja$oPx3#N*sACdbl zuO0t>uIy1I6+>SDsSMcYh8Mlf;o8#T_r* zw5YGCP(n8;~KHR2t^(;G*)_^Lm#BZvl-@zm0EKJgus3|u>N>wAAl z2yK7_y_R&2Q>C%VI^vm5O+8y%u?Qhp8u$=7qDqgiFL zx)>i%=+lRFhFTN*c)a1nujZd{(63Ja^BkKIc1OZx9RY-nG*HVV?Dm)qY=BljUjh3@ zI+TKwt;-sUTXFNHKCZ|(fUc2XYv@V*MRllWo09a%MZ9r6ri{5`&nXG5E$o#O^%52u zq0yh@~&NHFbE{MK9&=jb>BUH~s zq21`uC?}8KXyRHWQ%gd(pV*Wh`I^gG`|NX);du~b1zlW&=8$(PBNg_o&ZTTFf^SBWq znl$56%2PF@UbuuWx71KX!%ctNIoj&b;ChB}J!6jCS;21y{%beeOBP5z1MY8giy?SP~Hou;% zVa|v@gSYGMU^q%((~_K(>&UvWbUJX?-nmy;*CJ-LZ=`+`J9e-sL}m15u6($z>3L;X zj<1C>D8si3MA20~?(Zgd(WV*kyyKqXa?GGo)V>2Sj5dHB;5Ptu@!CiGFY}i57Q6!kB-Ue` zj51dQ=2J71JxGD5Z)-o0o64z#xh3!?``kxxP`mJsZpxy)ZG-v$eEOdP8q}p%uugKw);R z;uQsNzp}CD8%#-P4!F9E^Lh7FWSATS{p zrXvN{7G#v28(QiJ{M23AyJbDHzTPpi=5xMay4l%ukSpEYbQ9xH%4apewY(h7)=Ds_ z|Na`{k#bc+p)2G6dpFj&B$XRd!Nn=cAT6kt;zgL$|9q6dZMi>uC*gz_rDPSJ)U4sb z5~v~&Vb3{atOi2VU-V|?tX?PW(L7ns@w*A-vAzI*G}HbuE1YrpKy!cObi3~xhE7v$ zes|LuqNIYe0@1{_)g;(kwa$RufR%HBsXs$R01fha9>X-JboG@ME)~m~J&$Fb>7FGB#{zozZ9i2TC64tJ3s;1}Y za~o#d7kfA0%He@Kh3~I?5@g0dl}ok~#_d+{p^5(22SVn#7Y*p9QpB$-Y;T)UX&wXp zVBx#&?q*5f`w+<{Vwn|F(?eAXjfY8)B)8AXBGQ*OEv4qh3(`)_E$yWS-^`Hcv{i~I zWO=W?T>1}YKHuLYxc)DXbQ!`E%>crR+Fw88aeP^Sl#336Q1ZL)suhwC|?_t z+=AZBmlrfS+dpUfxHU4A!|&-_2fzQ_W0X!{0{>_nXP(Y{|2_uwOS6R9-#FZj%UBE8 zeORWHBjPn~6cNC6Ir%uC!R9)eT2C&oGRmpXq=)|v{e4(9^?t9JRC*joEcN>2aS?hx zr0V$Q!ByDEQ$ftBjNu8W$la^42w?l~1^1|N_sr~XwmY1DOeVI%!_s#n9ikUr4FOswT6QSK)t z8M1yy( z6Qay3Ujlz!Pad@j+t2X6q&Yf{OS?3?lDbz9n5*2*x!K{%vz+TbkQL(m7TIx#H@V{E zM5{Imly^) zLyRVi=csI<=9gV8@iV&GLZ_4h>fm>v(}{8Qy1IPkrPwNdmBiysex@OT-h!16?pUK4 zLc$x1$L#{gR+C^A json) { + valueSum = json['ValueSum']; + medCategoryID = json['MedCategoryID']; + month = json['Month']; + monthName = json['MonthName']; + patientID = json['PatientID']; + year = json['Year']; + } + + Map toJson() { + final Map data = new Map(); + data['ValueSum'] = this.valueSum; + data['MedCategoryID'] = this.medCategoryID; + data['Month'] = this.month; + data['MonthName'] = this.monthName; + data['PatientID'] = this.patientID; + data['Year'] = this.year; + return data; + } +} diff --git a/lib/pages/medical/smart_watch_health_data/stepsTracker.dart b/lib/pages/medical/smart_watch_health_data/stepsTracker.dart index eec41a35..467242e8 100644 --- a/lib/pages/medical/smart_watch_health_data/stepsTracker.dart +++ b/lib/pages/medical/smart_watch_health_data/stepsTracker.dart @@ -1,7 +1,9 @@ +import 'package:charts_flutter/flutter.dart' as charts; +import 'package:diplomaticquarterapp/models/SmartWatch/YearlyStepsResModel.dart'; import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; -import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/charts/app_time_series_chart.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/material.dart'; @@ -14,6 +16,19 @@ class _StepsTrackerState extends State with SingleTickerProviderStateMixin { TabController _tabController; + int weeklyStatsAvgValue = 0; + int monthlyStatsAvgValue = 0; + int yearlyStatsAvgValue = 0; + + int avgStepsValue = 0; + int dataLength = 0; + + List yearlyStepsList = List(); + + List yearlyTimeSeriesData = []; + + bool isDataLoaded = false; + @override void initState() { _tabController = new TabController(length: 3, vsync: this); @@ -31,7 +46,7 @@ class _StepsTrackerState extends State isShowDecPage: false, body: Container( child: Column( - mainAxisSize: MainAxisSize.max, + mainAxisSize: MainAxisSize.min, children: [ TabBar( tabs: [ @@ -45,9 +60,9 @@ class _StepsTrackerState extends State child: new TabBarView( physics: NeverScrollableScrollPhysics(), children: [ - getWeeklyStepsDetails(), - getMonthlyStepsDetails(), - getYearlyStepsDetails() + isDataLoaded ? getWeeklyStepsDetails() : Container(), + isDataLoaded ? getMonthlyStepsDetails() : Container(), + isDataLoaded ? getYearlyStepsDetails() : Container() ], controller: _tabController, ), @@ -59,18 +74,66 @@ class _StepsTrackerState extends State } getYearlyStepsData() { + avgStepsValue = 0; + dataLength = 0; + DoctorsListService service = new DoctorsListService(); GifLoaderDialogUtils.showMyDialog(context); service.getPatientHealthDataStats(6, 3, context).then((res) { GifLoaderDialogUtils.hideDialog(context); print(res['Med_GetYearStepsTransactionsStsList']); + yearlyStepsList.clear(); + res['Med_GetYearStepsTransactionsStsList'].forEach((element) { + yearlyStepsList.add(new YearlyStepsResModel.fromJson(element)); + if (element['ValueSum'] != null) { + double value = element['ValueSum']; + avgStepsValue += value.toInt(); + dataLength++; + } + }); + + print(avgStepsValue); + print(dataLength); + setState(() { + yearlyStatsAvgValue = avgStepsValue ~/ dataLength; + isDataLoaded = true; + }); }).catchError((err) { GifLoaderDialogUtils.hideDialog(context); - AppToast.showErrorToast(message: err); + // AppToast.showErrorToast(message: err); print(err); }); } + generateData() { + if (yearlyStepsList.length > 0) { + yearlyTimeSeriesData.clear(); + yearlyStepsList.forEach( + (element) { + yearlyTimeSeriesData.add( + TimeSeriesSales( + new DateTime(element.year, element.month, 1), + element.valueSum != null ? element.valueSum.toInt() : 0, + ), + ); + }, + ); + yearlyTimeSeriesData.forEach((element) { + print(element.sales); + print(element.time); + }); + } + return [ + new charts.Series( + id: 'Sales', + colorFn: (_, __) => charts.MaterialPalette.red.shadeDefault, + domainFn: (TimeSeriesSales sales, _) => sales.time, + measureFn: (TimeSeriesSales sales, _) => sales.sales, + data: yearlyTimeSeriesData, + ) + ]; + } + getWeeklyStepsDetails() { return Container( child: Text("Weekly"), @@ -85,7 +148,101 @@ class _StepsTrackerState extends State getYearlyStepsDetails() { return Container( - child: Text("Yearly"), + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Container( + child: AppTimeSeriesChart( + seriesList: generateData(), + chartName: "Steps", + startDate: DateTime( + yearlyStepsList[0].year, yearlyStepsList[0].month, 1), + endDate: DateTime( + yearlyStepsList[yearlyStepsList.length - 1].year, + yearlyStepsList[yearlyStepsList.length - 1].month, + 1), + ), + ), + Container( + margin: EdgeInsets.only(top: 5.0), + child: Card( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10), + side: BorderSide(color: Colors.grey[400], width: 0.6)), + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Container( + padding: EdgeInsets.fromLTRB(30.0, 15.0, 30.0, 15.0), + child: + Text("Average Steps", style: TextStyle(fontSize: 18.0)), + ), + Container( + margin: EdgeInsets.only(bottom: 10.0), + child: Text(yearlyStatsAvgValue.toString() + " Steps", + style: TextStyle( + fontSize: 20.0, fontWeight: FontWeight.bold)), + ), + ], + ), + ), + ), + Container( + margin: EdgeInsets.all(10.0), + child: Divider( + color: Colors.grey[500], + ), + ), + Container( + transform: Matrix4.translationValues(0.0, -10.0, 0.0), + margin: EdgeInsets.fromLTRB(20.0, 0.0, 20.0, 5.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text("History", style: TextStyle(fontSize: 14.0)), + Row( + children: [ + Text("view more", style: TextStyle(fontSize: 14.0)), + Container( + margin: EdgeInsets.only(left: 3.0, right: 3.0), + transform: Matrix4.translationValues(0.0, 1.5, 0.0), + width: 30.0, + height: 30.0, + child: Image.asset( + "assets/images/new-design/view_more.png", + fit: BoxFit.contain), + ), + ], + ), + ], + ), + ), + Container( + margin: EdgeInsets.fromLTRB(20.0, 0.0, 20.0, 5.0), + child: Card( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10), + side: BorderSide(color: Colors.grey[400], width: 0.6)), + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Container( + padding: EdgeInsets.fromLTRB(30.0, 15.0, 30.0, 15.0), + child: Text("Date", + style: TextStyle( + fontSize: 18.0, fontWeight: FontWeight.bold)), + ), + Container( + padding: EdgeInsets.fromLTRB(30.0, 0.0, 30.0, 0.0), + child: Text("Steps", style: TextStyle(fontSize: 18.0)), + ), + ], + ), + ), + ), + ], + ), ); } } From d8bd7d145da84659bc011097b15ac5b8300dadbc Mon Sep 17 00:00:00 2001 From: Zohaib Kambrani Date: Thu, 17 Dec 2020 18:30:04 +0300 Subject: [PATCH 04/42] no message --- ios/GoogleService-Info.plist | 20 +++++++------- ios/Podfile.lock | 10 +++---- ios/Runner.xcodeproj/project.pbxproj | 10 ++++--- ios/Runner/Helper/HMG_Geofence.swift | 2 +- ios/gpx.gpx | 2 +- lib/pages/landing/landing_page.dart | 30 ++++++++++----------- lib/pages/medical/medical_profile_page.dart | 2 +- lib/widgets/drawer/app_drawer_widget.dart | 2 +- 8 files changed, 41 insertions(+), 37 deletions(-) diff --git a/ios/GoogleService-Info.plist b/ios/GoogleService-Info.plist index 0c093a2a..633037cb 100644 --- a/ios/GoogleService-Info.plist +++ b/ios/GoogleService-Info.plist @@ -3,21 +3,23 @@ CLIENT_ID - 864393916058-ekeb4s8tgfo58dutv0l54399t7ivr06r.apps.googleusercontent.com + 815750722565-da8p56le8bd6apsbm9eft0jjl1rtpgkt.apps.googleusercontent.com REVERSED_CLIENT_ID - com.googleusercontent.apps.864393916058-ekeb4s8tgfo58dutv0l54399t7ivr06r + com.googleusercontent.apps.815750722565-da8p56le8bd6apsbm9eft0jjl1rtpgkt + ANDROID_CLIENT_ID + 815750722565-m14h8mkosm7cnq6uh6rhqr54dn02d705.apps.googleusercontent.com API_KEY - AIzaSyA_6ayGCk4fly7o7eTVBrj9kuHBYHMAOfs + AIzaSyDiXnCO00li4V7Ioa2YZ_M4ECxRsu_P9tA GCM_SENDER_ID - 864393916058 + 815750722565 PLIST_VERSION 1 BUNDLE_ID - com.cloud.diplomaticquarterapp + com.HMG.HMG-Smartphone PROJECT_ID - diplomaticquarter-d2385 + api-project-815750722565 STORAGE_BUCKET - diplomaticquarter-d2385.appspot.com + api-project-815750722565.appspot.com IS_ADS_ENABLED IS_ANALYTICS_ENABLED @@ -29,8 +31,8 @@ IS_SIGNIN_ENABLED GOOGLE_APP_ID - 1:864393916058:ios:13f787bbfe6051f8b97923 + 1:815750722565:ios:328ec247a81a2ca23c186c DATABASE_URL - https://diplomaticquarter-d2385.firebaseio.com + https://api-project-815750722565.firebaseio.com \ No newline at end of file diff --git a/ios/Podfile.lock b/ios/Podfile.lock index d65de659..668711ce 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -20,7 +20,7 @@ PODS: - Firebase/Messaging (6.33.0): - Firebase/CoreOnly - FirebaseMessaging (~> 4.7.0) - - firebase_core (0.5.3): + - firebase_core (0.5.2): - Firebase/CoreOnly (~> 6.33.0) - Flutter - firebase_core_web (0.1.0): @@ -70,7 +70,7 @@ PODS: - Flutter - flutter_tts (0.0.1): - Flutter - - geolocator (6.1.9): + - "geolocator (6.0.0+4)": - Flutter - google_maps_flutter (0.0.1): - Flutter @@ -375,7 +375,7 @@ SPEC CHECKSUMS: device_calendar: 23b28a5f1ab3bf77e34542fb1167e1b8b29a98f5 device_info: d7d233b645a32c40dfdc212de5cf646ca482f175 Firebase: 8db6f2d1b2c5e2984efba4949a145875a8f65fe5 - firebase_core: 5d6a02f3d85acd5f8321c2d6d62877626a670659 + firebase_core: 350ba329d1641211bc6183a3236893cafdacfea7 firebase_core_web: d501d8b946b60c8af265428ce483b0fff5ad52d1 firebase_messaging: 0aea2cd5885b65e19ede58ee3507f485c992cc75 FirebaseCore: d889d9e12535b7f36ac8bfbf1713a0836a3012cd @@ -390,7 +390,7 @@ SPEC CHECKSUMS: flutter_local_notifications: 9e4738ce2471c5af910d961a6b7eadcf57c50186 flutter_plugin_android_lifecycle: dc0b544e129eebb77a6bfb1239d4d1c673a60a35 flutter_tts: 0f492aab6accf87059b72354fcb4ba934304771d - geolocator: 057a0c63a43e9c5296d8ad845a3ac8e6df23d899 + geolocator: 1ae40084cc6c1586ce5ad12cfc3fd38c64d05f2f google_maps_flutter: c7f9c73576de1fbe152a227bfd6e6c4ae8088619 GoogleDataTransport: f56af7caa4ed338dc8e138a5d7c5973e66440833 GoogleMaps: 4b5346bddfe6911bb89155d43c903020170523ac @@ -440,4 +440,4 @@ SPEC CHECKSUMS: PODFILE CHECKSUM: 5a17be3f8af73a757fa4439c77cf6ab2db29a6e7 -COCOAPODS: 1.8.4 +COCOAPODS: 1.10.0 diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 009006ed..77d42044 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -28,6 +28,7 @@ E923EFD62587443800E3E751 /* HMGPlatformBridge.swift in Sources */ = {isa = PBXBuildFile; fileRef = E923EFD52587443800E3E751 /* HMGPlatformBridge.swift */; }; E923EFD82588D17700E3E751 /* gpx.gpx in Resources */ = {isa = PBXBuildFile; fileRef = E923EFD72588D17700E3E751 /* gpx.gpx */; }; E9620805255C2ED100D3A35D /* NetworkExtension.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E9620804255C2ED100D3A35D /* NetworkExtension.framework */; }; + E9A35329258B8E8F00CBA688 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = E9A35328258B8E8F00CBA688 /* GoogleService-Info.plist */; }; E9C8C136256BACDA00EFFB62 /* HMG_Guest.swift in Sources */ = {isa = PBXBuildFile; fileRef = E9C8C135256BACDA00EFFB62 /* HMG_Guest.swift */; }; E9E27168256E3A4000F49B69 /* LocalizedFromFlutter.swift in Sources */ = {isa = PBXBuildFile; fileRef = E9E27167256E3A4000F49B69 /* LocalizedFromFlutter.swift */; }; /* End PBXBuildFile section */ @@ -78,6 +79,7 @@ E923EFD72588D17700E3E751 /* gpx.gpx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = gpx.gpx; sourceTree = ""; }; E9620803255C2ED100D3A35D /* Runner.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Runner.entitlements; sourceTree = ""; }; E9620804255C2ED100D3A35D /* NetworkExtension.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = NetworkExtension.framework; path = System/Library/Frameworks/NetworkExtension.framework; sourceTree = SDKROOT; }; + E9A35328258B8E8F00CBA688 /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = ""; }; E9C8C135256BACDA00EFFB62 /* HMG_Guest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HMG_Guest.swift; sourceTree = ""; }; E9E27167256E3A4000F49B69 /* LocalizedFromFlutter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LocalizedFromFlutter.swift; sourceTree = ""; }; /* End PBXFileReference section */ @@ -128,6 +130,7 @@ 97C146E51CF9000F007C117D = { isa = PBXGroup; children = ( + E9A35328258B8E8F00CBA688 /* GoogleService-Info.plist */, E923EFD72588D17700E3E751 /* gpx.gpx */, 9740EEB11CF90186004384FC /* Flutter */, 97C146F01CF9000F007C117D /* Runner */, @@ -265,6 +268,7 @@ files = ( E91B53A0256AAC1400E96549 /* GuestPOC_Certificate.cer in Resources */, 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, + E9A35329258B8E8F00CBA688 /* GoogleService-Info.plist in Resources */, 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, E923EFD82588D17700E3E751 /* gpx.gpx in Resources */, E91B539F256AAC1400E96549 /* GuestPOC_Certificate.p12 in Resources */, @@ -472,7 +476,7 @@ CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - DEVELOPMENT_TEAM = ""; + DEVELOPMENT_TEAM = 3A359E86ZF; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", @@ -611,7 +615,7 @@ CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - DEVELOPMENT_TEAM = ""; + DEVELOPMENT_TEAM = 3A359E86ZF; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", @@ -644,7 +648,7 @@ CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - DEVELOPMENT_TEAM = ""; + DEVELOPMENT_TEAM = 3A359E86ZF; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", diff --git a/ios/Runner/Helper/HMG_Geofence.swift b/ios/Runner/Helper/HMG_Geofence.swift index fb469165..0c39fe5a 100644 --- a/ios/Runner/Helper/HMG_Geofence.swift +++ b/ios/Runner/Helper/HMG_Geofence.swift @@ -156,7 +156,7 @@ extension HMG_Geofence{ func notifyServer(forRegion:CLRegion, transition:Transition, location:CLLocation?){ df.dateFormat = "MMM/dd/yyyy hh:mm:ss" - if let userProfileJson = UserDefaults.standard.string(forKey: "flutter.user-profile"), + if let userProfileJson = UserDefaults.standard.string(forKey: "flutter.imei-user-data"), let userProfile = dictionary(from: userProfileJson), let patientId = userProfile["PatientID"] as? Int{ if let idString = forRegion.identifier.split(separator: "_").first, let idInt = Int(idString){ diff --git a/ios/gpx.gpx b/ios/gpx.gpx index 9cc26956..6121e536 100644 --- a/ios/gpx.gpx +++ b/ios/gpx.gpx @@ -1 +1 @@ - Sverrir Sigmundarson Office Office Mahmoud Home Mahmoud Home Panorama Mall Panorama Mall Saudi Architects Crossing Saudi Architects Crossing Office Office \ No newline at end of file + Sverrir Sigmundarson 617.71 620.95 643.70 677.84 \ No newline at end of file diff --git a/lib/pages/landing/landing_page.dart b/lib/pages/landing/landing_page.dart index acbf8d78..a45f24eb 100644 --- a/lib/pages/landing/landing_page.dart +++ b/lib/pages/landing/landing_page.dart @@ -146,7 +146,6 @@ class _LandingPageState extends State with WidgetsBindingObserver { _firebaseMessaging.requestNotificationPermissions(); } - // Flip Permission Checks [Zohaib Kambrani] requestPermissions().then((results) { if (results[Permission.notification].isGranted) _firebaseMessaging.getToken().then((String token) { @@ -436,7 +435,7 @@ class _LandingPageState extends State with WidgetsBindingObserver { void checkUserStatus(token) async { var result = await authService.selectDeviceImei(token); - setUserValues(result); + await setUserValues(result); registerGeofences(); if (await sharedPref.getObject(USER_PROFILE) != null) { @@ -472,7 +471,7 @@ class _LandingPageState extends State with WidgetsBindingObserver { } Future getUserInformation() async { - var userInfoJson = sharedPref.getObject(IMEI_USER_DATA); + var userInfoJson = await sharedPref.getObject(IMEI_USER_DATA); return userInfoJson; } @@ -484,23 +483,22 @@ class _LandingPageState extends State with WidgetsBindingObserver { registerGeofences() async { await locator().getAllGeoZones(GeoZonesRequestModel()); + var userInfo = await getUserInformation(); void doIt() { - getUserInformation().then((value) { - if (value != null) projectViewModel.platformBridge().registerHmgGeofences(); - }); + projectViewModel.platformBridge().registerHmgGeofences(); } - if (await Permission.location.isGranted) { - doIt(); - } else { - [Permission.location].request().then((value) async { - if (await Permission.location.isGranted) { - doIt(); - } - }); + if (userInfo != null) { + if (await Permission.location.isGranted) { + doIt(); + } else { + [Permission.location].request().then((value) async { + if (await Permission.location.isGranted) { + doIt(); + } + }); + } } - - requestPermissions().then((results) {}); } } diff --git a/lib/pages/medical/medical_profile_page.dart b/lib/pages/medical/medical_profile_page.dart index 6dabf9d3..3260303c 100644 --- a/lib/pages/medical/medical_profile_page.dart +++ b/lib/pages/medical/medical_profile_page.dart @@ -430,7 +430,7 @@ class _MedicalProfilePageState extends State { child: InkWell( //TODO onTap: () { - if (authProvider.isLogin) { + if (projectViewModel.isLogin) { String patientID = authProvider.getAuthenticatedUser().patientID.toString(); GifLoaderDialogUtils.showMyDialog(context); projectViewModel.platformBridge().connectHMGInternetWifi(patientID).then((value) => {GifLoaderDialogUtils.hideDialog(context)}); diff --git a/lib/widgets/drawer/app_drawer_widget.dart b/lib/widgets/drawer/app_drawer_widget.dart index 9c6375e4..05ae92e3 100644 --- a/lib/widgets/drawer/app_drawer_widget.dart +++ b/lib/widgets/drawer/app_drawer_widget.dart @@ -331,7 +331,7 @@ class _AppDrawerState extends State { await sharedPref.clear(); this.user = null; Navigator.of(context).pushNamed(HOME); - projectProvider.platformBridge().unRegisterHmgGeofences(); + // projectProvider.platformBridge().unRegisterHmgGeofences(); } login() async { From 508bc191bea7ec1d6749fe9748fcb24bbc0e48b8 Mon Sep 17 00:00:00 2001 From: Zohaib Kambrani <> Date: Sun, 20 Dec 2020 13:44:29 +0300 Subject: [PATCH 05/42] geofencing login check fix --- android/app/src/main/AndroidManifest.xml | 2 +- .../geofence/GeoZoneModel.kt | 2 + .../geofence/GeofenceBroadcastReceiver.kt | 17 +++++++- .../GeofenceBroadcastReceiverWithService.kt | 13 ++++++ .../GeofenceTransitionsJobIntentService.kt | 37 +++-------------- .../GeofencingRebootBroadcastReceiver.kt | 3 +- .../geofence/HMG_Geofence.kt | 41 ++++++++++++++++++- .../diplomaticquarterapp/utils/HMGUtils.kt | 35 ++++++++++++++-- ios/Runner/AppDelegate.swift | 22 ---------- ios/Runner/Helper/Extensions.swift | 10 +++++ ios/Runner/Helper/GlobalHelper.swift | 30 +++++++++++++- ios/Runner/Helper/HMG_Geofence.swift | 14 ++++--- lib/pages/landing/landing_page.dart | 30 ++++++-------- 13 files changed, 169 insertions(+), 87 deletions(-) create mode 100644 android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/GeofenceBroadcastReceiverWithService.kt diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 1032b29b..c114b44d 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -80,7 +80,7 @@ - + diff --git a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/GeoZoneModel.kt b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/GeoZoneModel.kt index 7eba1ead..328014e6 100644 --- a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/GeoZoneModel.kt +++ b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/GeoZoneModel.kt @@ -37,6 +37,7 @@ class GeoZoneModel { val rad = Radius.toFloat() if(lat != null && long != null){ + val loiteringDelayMinutes:Int = 5 // in Minutes return Geofence.Builder() .setRequestId(identifier()) .setCircularRegion( @@ -46,6 +47,7 @@ class GeoZoneModel { ) .setTransitionTypes(GeofenceTransition.ENTER_EXIT.value) // .setNotificationResponsiveness(0) +// .setLoiteringDelay(loiteringDelayMinutes * 60 * 1000) .setExpirationDuration(Geofence.NEVER_EXPIRE) .build() } diff --git a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/GeofenceBroadcastReceiver.kt b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/GeofenceBroadcastReceiver.kt index 8fc1faae..f8a861bb 100644 --- a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/GeofenceBroadcastReceiver.kt +++ b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/GeofenceBroadcastReceiver.kt @@ -5,9 +5,24 @@ package com.cloud.diplomaticquarterapp.geofence import android.content.BroadcastReceiver import android.content.Context import android.content.Intent +import android.util.Log +import com.cloud.diplomaticquarterapp.utils.saveLog +import com.google.android.gms.location.GeofencingEvent class GeofenceBroadcastReceiver : BroadcastReceiver() { + private val LOG_TAG = "GeofenceBroadcastReceiver" override fun onReceive(context: Context, intent: Intent) { - GeofenceTransitionsJobIntentService.enqueueWork(context, intent) + + val geofencingEvent = GeofencingEvent.fromIntent(intent) + if (geofencingEvent.hasError()) { + val errorMessage = GeofenceErrorMessages.getErrorString(context, geofencingEvent.errorCode) + Log.e(LOG_TAG, errorMessage) + saveLog(context,LOG_TAG,errorMessage) + return + } + + HMG_Geofence.shared(context).handleEvent(geofencingEvent.triggeringGeofences,geofencingEvent.triggeringLocation, GeofenceTransition.fromInt(geofencingEvent.geofenceTransition)); + } + } \ No newline at end of file diff --git a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/GeofenceBroadcastReceiverWithService.kt b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/GeofenceBroadcastReceiverWithService.kt new file mode 100644 index 00000000..0332f745 --- /dev/null +++ b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/GeofenceBroadcastReceiverWithService.kt @@ -0,0 +1,13 @@ + + +package com.cloud.diplomaticquarterapp.geofence + +import android.content.BroadcastReceiver +import android.content.Context +import android.content.Intent + +class GeofenceBroadcastReceiverWithService : BroadcastReceiver() { + override fun onReceive(context: Context, intent: Intent) { + GeofenceTransitionsJobIntentService.enqueueWork(context, intent) + } +} \ No newline at end of file diff --git a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/GeofenceTransitionsJobIntentService.kt b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/GeofenceTransitionsJobIntentService.kt index f28e1720..18ee92d9 100755 --- a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/GeofenceTransitionsJobIntentService.kt +++ b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/GeofenceTransitionsJobIntentService.kt @@ -52,8 +52,9 @@ class GeofenceTransitionsJobIntentService : JobIntentService() { private const val LOG_TAG = "GeoTrIntentService" private const val JOB_ID = 573 - + var context_: Context? = null fun enqueueWork(context: Context, intent: Intent) { + context_ = context enqueueWork( context, GeofenceTransitionsJobIntentService::class.java, JOB_ID, @@ -70,37 +71,9 @@ class GeofenceTransitionsJobIntentService : JobIntentService() { } if (geofencingEvent.geofenceTransition == Geofence.GEOFENCE_TRANSITION_ENTER || geofencingEvent.geofenceTransition == Geofence.GEOFENCE_TRANSITION_EXIT) { - handleEvent(geofencingEvent.triggeringGeofences,geofencingEvent.triggeringLocation, GeofenceTransition.fromInt(geofencingEvent.geofenceTransition)); - } - } - - private fun handleEvent(triggerGeofences: List, location:Location, transition:GeofenceTransition) { - val hmg = HMG_Geofence.shared(this) - hmg.getPatientID()?.let { patientId -> - - hmg.getActiveGeofences({ activeGeofences -> - - triggerGeofences.forEach { geofence -> - // Extract PointID from 'geofence.requestId' and find from active geofences - val pointID = activeGeofences.firstOrNull {it == geofence.requestId}?.split('_')?.first() - if(!pointID.isNullOrEmpty() && pointID.toIntOrNull() != null){ - - val body = mapOf( - "PointsID" to pointID.toIntOrNull(), - "GeoType" to transition.value, - "PatientID" to patientId - ) - - httpPost>(API.LOG_GEOFENCE, body, { response -> - sendNotification(this, transition.named(), geofence.requestId, "Notified to server.😎") - },{ exception -> - sendNotification(this, transition.named(), geofence.requestId, "Failed to notify server.😔") - }) - - } - } - - },null) + context_?.let { + HMG_Geofence.shared(it).handleEvent(geofencingEvent.triggeringGeofences,geofencingEvent.triggeringLocation, GeofenceTransition.fromInt(geofencingEvent.geofenceTransition)); + } } } } \ No newline at end of file diff --git a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/GeofencingRebootBroadcastReceiver.kt b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/GeofencingRebootBroadcastReceiver.kt index 08a0c93f..4534b08f 100644 --- a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/GeofencingRebootBroadcastReceiver.kt +++ b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/GeofencingRebootBroadcastReceiver.kt @@ -13,7 +13,8 @@ import com.cloud.diplomaticquarterapp.utils.HMGUtils class GeofencingRebootBroadcastReceiver : BroadcastReceiver(){ override fun onReceive(context: Context, intent: Intent) { - if (Intent.ACTION_BOOT_COMPLETED.equals(intent.action)) { +// if (Intent.ACTION_BOOT_COMPLETED.equals(intent.action)) { + if (intent.action.equals("android.intent.action.BOOT_COMPLETE")) { val pref = context.getSharedPreferences(PREFS_STORAGE, Context.MODE_PRIVATE) pref.edit().putString("REBOOT_DETECTED","YES").apply() diff --git a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/HMG_Geofence.kt b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/HMG_Geofence.kt index 4d2c48b3..24639c6c 100644 --- a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/HMG_Geofence.kt +++ b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/HMG_Geofence.kt @@ -6,7 +6,9 @@ import android.content.Context import android.content.Intent import android.content.SharedPreferences import android.content.pm.PackageManager +import android.location.Location import androidx.core.content.ContextCompat +import com.cloud.diplomaticquarterapp.utils.* import com.google.android.gms.location.Geofence import com.google.android.gms.location.GeofencingClient import com.google.android.gms.location.GeofencingRequest @@ -37,6 +39,7 @@ const val PREFS_STORAGE = "FlutterSharedPreferences" const val PREF_KEY_SUCCESS = "HMG_GEOFENCE_SUCCESS" const val PREF_KEY_FAILED = "HMG_GEOFENCE_FAILED" const val PREF_KEY_HMG_ZONES = "flutter.hmg-geo-fences" +const val PREF_KEY_LANGUAGE = "flutter.language" class HMG_Geofence { // https://developer.android.com/training/location/geofencing#java @@ -99,6 +102,7 @@ class HMG_Geofence { } .addOnFailureListener { print(it.localizedMessage) + saveLog(context,"error:ADD_GEOFENCES", it.localizedMessage) } } },null) @@ -107,7 +111,6 @@ class HMG_Geofence { fun unRegisterAll(completion: (status: Boolean, exception:Exception?) -> Unit){ getActiveGeofences({ success -> val mList = success.toMutableList() - mList.add("12345") geofencingClient .removeGeofences(success) .addOnSuccessListener { @@ -115,6 +118,7 @@ class HMG_Geofence { } .addOnFailureListener { completion(false, it) + saveLog(context,"error:REMOVE_GEOFENCES", it.localizedMessage) } removeActiveGeofences() }, { failed -> @@ -154,7 +158,10 @@ class HMG_Geofence { } fun getPatientID():Int?{ - val profileJson = preferences.getString("flutter.imei-user-data", "{}") + var profileJson = preferences.getString("flutter.imei-user-data", null) + if (profileJson == null) + profileJson = preferences.getString("flutter.user-profile", null) + val type = object : TypeToken?>() {}.type return gson.fromJson?>(profileJson,type) ?.get("PatientID") @@ -162,4 +169,34 @@ class HMG_Geofence { .toDoubleOrNull() ?.toInt() } + + + fun handleEvent(triggerGeofences: List, location: Location, transition:GeofenceTransition) { + getPatientID()?.let { patientId -> + getActiveGeofences({ activeGeofences -> + + triggerGeofences.forEach { geofence -> + // Extract PointID from 'geofence.requestId' and find from active geofences + val pointID = activeGeofences.firstOrNull {it == geofence.requestId}?.split('_')?.first() + if(!pointID.isNullOrEmpty() && pointID.toIntOrNull() != null){ + + val body = mutableMapOf( + "PointsID" to pointID.toIntOrNull(), + "GeoType" to transition.value, + "PatientID" to patientId + ) + body.putAll(HMGUtils.defaultHTTPParams(context)) + + httpPost>(API.LOG_GEOFENCE, body, { response -> + sendNotification(context, transition.named(), geofence.requestId, "Notified to server.😎") + },{ exception -> + sendNotification(context, transition.named(), geofence.requestId, "Failed to notify server.😔") + }) + + } + } + + },null) + } + } } \ No newline at end of file diff --git a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/utils/HMGUtils.kt b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/utils/HMGUtils.kt index bebd0101..413e8c09 100644 --- a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/utils/HMGUtils.kt +++ b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/utils/HMGUtils.kt @@ -16,6 +16,7 @@ import com.cloud.diplomaticquarterapp.R import com.cloud.diplomaticquarterapp.geofence.GeoZoneModel import com.cloud.diplomaticquarterapp.geofence.PREFS_STORAGE import com.cloud.diplomaticquarterapp.geofence.PREF_KEY_HMG_ZONES +import com.cloud.diplomaticquarterapp.geofence.PREF_KEY_LANGUAGE import com.github.kittinunf.fuel.core.extensions.jsonBody import com.github.kittinunf.fuel.httpPost import com.google.android.gms.location.Geofence @@ -76,6 +77,26 @@ class HMGUtils { return geoZones } + fun getLanguageCode(context: Context) : Int{ + val pref = context.getSharedPreferences(PREFS_STORAGE, Context.MODE_PRIVATE) + val lang = pref.getString(PREF_KEY_LANGUAGE,"ar") + return if(lang == "ar") 2 else 1 + } + + fun defaultHTTPParams(context: Context) : Map{ + return mapOf( + "ZipCode" to "966", + "VersionID" to 5.6, + "Channel" to 3, + "LanguageID" to getLanguageCode(context), + "IPAdress" to "10.20.10.20", + "generalid" to "Cs2020@2016$2958", + "PatientOutSA" to 0, + "SessionID" to null, + "isDentalAllowedBackend" to false, + "DeviceTypeID" to 2) + } + } } @@ -117,7 +138,9 @@ fun sendNotification(context: Context, title:String, @Nullable subtitle:String?, notificationManager.notify(getUniqueId(), notification.build()) } - +//------------------------- +// Open Helper Methods +//------------------------- private fun getUniqueId() = ((System.currentTimeMillis() % 10000).toInt()) fun isJSONValid(jsonString: String?): Boolean { @@ -129,11 +152,18 @@ fun isJSONValid(jsonString: String?): Boolean { return true } +fun saveLog(context:Context, tag:String, message:String){ + val pref = context.getSharedPreferences(PREFS_STORAGE, Context.MODE_PRIVATE) + var logs = pref.getString("GEO_LOGS","") + logs += "$tag -> $message \n" + pref.edit().putString("PLATFORM_LOGS", logs).apply(); +} + class HTTPResponse(data: T){ final var data:T = data } -fun httpPost(url: String, body: Map, onSuccess: (response: HTTPResponse) -> Unit, onError: (error: Exception) -> Unit){ +fun httpPost(url: String, body: Map, onSuccess: (response: HTTPResponse) -> Unit, onError: (error: Exception) -> Unit){ val gson = Gson() val type = object : TypeToken() {}.type val jsonBody = gson.toJson(body) @@ -153,7 +183,6 @@ fun httpPost(url: String, body: Map, onSuccess: (response: HTTP } }, { onError(it) - it.localizedMessage }) } diff --git a/ios/Runner/AppDelegate.swift b/ios/Runner/AppDelegate.swift index e686619c..a9252ee5 100644 --- a/ios/Runner/AppDelegate.swift +++ b/ios/Runner/AppDelegate.swift @@ -8,7 +8,6 @@ import GoogleMaps let locationManager = CLLocationManager() override func application( _ application: UIApplication,didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { -// initLocationManager() GMSServices.provideAPIKey("AIzaSyCiiJiHkocPbcziHt9O8rGWavDrxHRQys8") GeneratedPluginRegistrant.register(with: self) @@ -24,24 +23,3 @@ import GoogleMaps return super.application(application, didFinishLaunchingWithOptions: launchOptions) } } - -extension AppDelegate: CLLocationManagerDelegate { - - func initLocationManager(){ - locationManager.allowsBackgroundLocationUpdates = true - locationManager.desiredAccuracy = kCLLocationAccuracyNearestTenMeters - locationManager.activityType = .other - locationManager.delegate = self - locationManager.requestAlwaysAuthorization() - } - - func locationManager(_ manager: CLLocationManager, didEnterRegion region: CLRegion) { - if region is CLCircularRegion { - } - } - - func locationManager(_ manager: CLLocationManager, didExitRegion region: CLRegion) { - if region is CLCircularRegion { - } - } -} diff --git a/ios/Runner/Helper/Extensions.swift b/ios/Runner/Helper/Extensions.swift index a8793617..5c1de7c3 100644 --- a/ios/Runner/Helper/Extensions.swift +++ b/ios/Runner/Helper/Extensions.swift @@ -18,6 +18,16 @@ extension String{ } } +extension Dictionary{ + func merge(dict:[String:Any?]) -> [String:Any?]{ + var self_ = self as! [String:Any?] + dict.forEach { (kv) in + self_.updateValue(kv.value, forKey: kv.key) + } + return self_ + } +} + extension Bundle { func certificate(named name: String) -> SecCertificate { diff --git a/ios/Runner/Helper/GlobalHelper.swift b/ios/Runner/Helper/GlobalHelper.swift index c5eb7295..35f89991 100644 --- a/ios/Runner/Helper/GlobalHelper.swift +++ b/ios/Runner/Helper/GlobalHelper.swift @@ -49,9 +49,35 @@ func showNotification(identifier:String? = nil, title:String?, subtitle:String?, } } +func appLanguageCode() -> Int{ + let lang = UserDefaults.standard.string(forKey: "language") ?? "ar" + return lang == "ar" ? 2 : 1 +} + +func userProfile() -> [String:Any?]?{ + var userProf = UserDefaults.standard.string(forKey: "flutter.imei-user-data") + if(userProf == nil){ + userProf = UserDefaults.standard.string(forKey: "flutter.user-profile") + } + return dictionary(from: userProf ?? "{}") +} + +fileprivate let defaultHTTPParams:[String : Any?] = [ + "ZipCode" : "966", + "VersionID" : 5.6, + "Channel" : 3, + "LanguageID" : appLanguageCode(), + "IPAdress" : "10.20.10.20", + "generalid" : "Cs2020@2016$2958", + "PatientOutSA" : 0, + "SessionID" : nil, + "isDentalAllowedBackend" : false, + "DeviceTypeID" : 2 +] -func httpPostRequest(urlString:String, jsonBody:[String:Any], completion:((Bool,[String:Any]?)->Void)?){ - let json: [String: Any] = jsonBody +func httpPostRequest(urlString:String, jsonBody:[String:Any?], completion:((Bool,[String:Any]?)->Void)?){ + var json: [String: Any?] = jsonBody + json = json.merge(dict: defaultHTTPParams) let jsonData = try? JSONSerialization.data(withJSONObject: json) // create post request diff --git a/ios/Runner/Helper/HMG_Geofence.swift b/ios/Runner/Helper/HMG_Geofence.swift index 0c39fe5a..3299fa1a 100644 --- a/ios/Runner/Helper/HMG_Geofence.swift +++ b/ios/Runner/Helper/HMG_Geofence.swift @@ -156,8 +156,13 @@ extension HMG_Geofence{ func notifyServer(forRegion:CLRegion, transition:Transition, location:CLLocation?){ df.dateFormat = "MMM/dd/yyyy hh:mm:ss" - if let userProfileJson = UserDefaults.standard.string(forKey: "flutter.imei-user-data"), - let userProfile = dictionary(from: userProfileJson), let patientId = userProfile["PatientID"] as? Int{ + var userInfo = UserDefaults.standard.string(forKey: "flutter.imei-user-data") + if(userInfo == nil){ + userInfo = UserDefaults.standard.string(forKey: "flutter.user-profile") + } + + if let userProfile = userProfile(), + let patientId = userProfile["PatientID"] as? Int{ if let idString = forRegion.identifier.split(separator: "_").first, let idInt = Int(idString){ let body:[String:Any] = [ @@ -172,15 +177,14 @@ extension HMG_Geofence{ showNotification(title: transition.name(), subtitle: forRegion.identifier, message: status_) - var logs = UserDefaults.init(suiteName: "GeoFenceLog")?.dictionary(forKey: "LOGS") ?? [:] + var logs = UserDefaults.init(suiteName: "GeoFenceLog")?.dictionary(forKey: "GEOFENCE_LOGS") ?? [:] if var geo = logs[forRegion.identifier] as? [String]{ geo.append("\(status_) at \(df.string(from: Date()))") }else{ logs.updateValue(["\(status_) at \(df.string(from: Date()))"], forKey: forRegion.identifier) } - UserDefaults.init(suiteName: "GeoFenceLog")?.set(logs, forKey: "LOGS") - + UserDefaults.init(suiteName: "GeoFenceLog")?.set(logs, forKey: "GEOFENCE_LOGS") } } } diff --git a/lib/pages/landing/landing_page.dart b/lib/pages/landing/landing_page.dart index a45f24eb..7625bcf6 100644 --- a/lib/pages/landing/landing_page.dart +++ b/lib/pages/landing/landing_page.dart @@ -142,11 +142,14 @@ class _LandingPageState extends State with WidgetsBindingObserver { PlatformBridge().connectHMGGuestWifi().then((value) => {GifLoaderDialogUtils.hideDialog(context)}); }).checkAndConnectIfNoInternet(); + if (Platform.isIOS) { _firebaseMessaging.requestNotificationPermissions(); } requestPermissions().then((results) { + registerGeofences(); + if (results[Permission.notification].isGranted) _firebaseMessaging.getToken().then((String token) { sharedPref.setString(PUSH_TOKEN, token); @@ -156,7 +159,7 @@ class _LandingPageState extends State with WidgetsBindingObserver { } }); - if (results[Permission.location].isGranted) ; + if (results[Permission.locationAlways].isGranted) ; if (results[Permission.storage].isGranted) ; if (results[Permission.camera].isGranted) ; if (results[Permission.photos].isGranted) ; @@ -436,7 +439,6 @@ class _LandingPageState extends State with WidgetsBindingObserver { void checkUserStatus(token) async { var result = await authService.selectDeviceImei(token); await setUserValues(result); - registerGeofences(); if (await sharedPref.getObject(USER_PROFILE) != null) { var data = AuthenticatedUser.fromJson(await sharedPref.getObject(USER_PROFILE)); @@ -483,22 +485,14 @@ class _LandingPageState extends State with WidgetsBindingObserver { registerGeofences() async { await locator().getAllGeoZones(GeoZonesRequestModel()); - var userInfo = await getUserInformation(); - - void doIt() { - projectViewModel.platformBridge().registerHmgGeofences(); - } - - if (userInfo != null) { - if (await Permission.location.isGranted) { - doIt(); - } else { - [Permission.location].request().then((value) async { - if (await Permission.location.isGranted) { - doIt(); - } - }); - } + if (await Permission.location.isGranted) { + PlatformBridge().registerHmgGeofences(); + } else { + [Permission.location].request().then((results) async { + if (results[Permission.locationAlways].isGranted){ + PlatformBridge().registerHmgGeofences(); + } + }); } } } From 7b4a2b9e64a91e6951e537aaa49b5a76351c52de Mon Sep 17 00:00:00 2001 From: Zohaib Kambrani Date: Sun, 20 Dec 2020 14:18:03 +0300 Subject: [PATCH 06/42] no message --- .../src/main/kotlin/com/cloud/diplomaticquarterapp/utils/API.kt | 2 +- ios/gpx.gpx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/utils/API.kt b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/utils/API.kt index 30f57dde..924bda91 100644 --- a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/utils/API.kt +++ b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/utils/API.kt @@ -2,7 +2,7 @@ package com.cloud.diplomaticquarterapp.utils class API { companion object{ - private val BASE = "https://uat.hmgwebservices.com" + private val BASE = "https://hmgwebservices.com" private val SERVICE = "Services/Patients.svc/REST" val WIFI_CREDENTIALS = "$BASE/$SERVICE/Hmg_SMS_Get_By_ProjectID_And_PatientID" diff --git a/ios/gpx.gpx b/ios/gpx.gpx index 6121e536..ed8e9be6 100644 --- a/ios/gpx.gpx +++ b/ios/gpx.gpx @@ -1 +1 @@ - Sverrir Sigmundarson 617.71 620.95 643.70 677.84 \ No newline at end of file + Sverrir Sigmundarson 608.26 620.97 617.77 643.86 \ No newline at end of file From a11d93332d6a77fabc5eff95327b6d0e7d9b4492 Mon Sep 17 00:00:00 2001 From: Zohaib Kambrani Date: Mon, 21 Dec 2020 17:19:40 +0300 Subject: [PATCH 07/42] Wifi check network available - android tweaking at geofence code --- android/app/src/main/AndroidManifest.xml | 9 +++-- .../geofence/HMG_Geofence.kt | 1 + .../GeofenceBroadcastReceiver.kt | 4 +- ...eofenceBroadcastReceiverWithJobService.kt} | 4 +- .../GeofenceErrorMessages.kt | 2 +- .../GeofenceJobIntentService.kt | 29 ++++++++++++++ .../GeofenceTransitionsJobIntentService.kt | 12 ++---- .../GeofencingRebootBroadcastReceiver.kt | 9 ++--- .../diplomaticquarterapp/utils/HMGUtils.kt | 6 +-- ios/Flutter/.last_build_id | 2 +- ios/Runner/AppDelegate.swift | 14 +++++++ ios/Runner/Helper/Extensions.swift | 8 ++++ ios/Runner/Helper/GlobalHelper.swift | 36 ++++++++++------- ios/Runner/Helper/HMG_Geofence.swift | 40 +++++++------------ lib/uitl/HMGNetworkConnectivity.dart | 34 ++++++++++------ 15 files changed, 133 insertions(+), 77 deletions(-) rename android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/{ => intent_receivers}/GeofenceBroadcastReceiver.kt (82%) rename android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/{GeofenceBroadcastReceiverWithService.kt => intent_receivers/GeofenceBroadcastReceiverWithJobService.kt} (63%) rename android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/{ => intent_receivers}/GeofenceErrorMessages.kt (94%) create mode 100644 android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/intent_receivers/GeofenceJobIntentService.kt rename android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/{ => intent_receivers}/GeofenceTransitionsJobIntentService.kt (87%) rename android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/{ => intent_receivers}/GeofencingRebootBroadcastReceiver.kt (73%) diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index c114b44d..68975071 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -76,11 +76,12 @@ - - - + + + - + + diff --git a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/HMG_Geofence.kt b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/HMG_Geofence.kt index 24639c6c..919d478f 100644 --- a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/HMG_Geofence.kt +++ b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/HMG_Geofence.kt @@ -8,6 +8,7 @@ import android.content.SharedPreferences import android.content.pm.PackageManager import android.location.Location import androidx.core.content.ContextCompat +import com.cloud.diplomaticquarterapp.geofence.intent_receivers.GeofenceBroadcastReceiver import com.cloud.diplomaticquarterapp.utils.* import com.google.android.gms.location.Geofence import com.google.android.gms.location.GeofencingClient diff --git a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/GeofenceBroadcastReceiver.kt b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/intent_receivers/GeofenceBroadcastReceiver.kt similarity index 82% rename from android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/GeofenceBroadcastReceiver.kt rename to android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/intent_receivers/GeofenceBroadcastReceiver.kt index f8a861bb..11fc4850 100644 --- a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/GeofenceBroadcastReceiver.kt +++ b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/intent_receivers/GeofenceBroadcastReceiver.kt @@ -1,11 +1,13 @@ -package com.cloud.diplomaticquarterapp.geofence +package com.cloud.diplomaticquarterapp.geofence.intent_receivers import android.content.BroadcastReceiver import android.content.Context import android.content.Intent import android.util.Log +import com.cloud.diplomaticquarterapp.geofence.GeofenceTransition +import com.cloud.diplomaticquarterapp.geofence.HMG_Geofence import com.cloud.diplomaticquarterapp.utils.saveLog import com.google.android.gms.location.GeofencingEvent diff --git a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/GeofenceBroadcastReceiverWithService.kt b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/intent_receivers/GeofenceBroadcastReceiverWithJobService.kt similarity index 63% rename from android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/GeofenceBroadcastReceiverWithService.kt rename to android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/intent_receivers/GeofenceBroadcastReceiverWithJobService.kt index 0332f745..250040f6 100644 --- a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/GeofenceBroadcastReceiverWithService.kt +++ b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/intent_receivers/GeofenceBroadcastReceiverWithJobService.kt @@ -1,12 +1,12 @@ -package com.cloud.diplomaticquarterapp.geofence +package com.cloud.diplomaticquarterapp.geofence.intent_receivers import android.content.BroadcastReceiver import android.content.Context import android.content.Intent -class GeofenceBroadcastReceiverWithService : BroadcastReceiver() { +class GeofenceBroadcastReceiverWithJobService : BroadcastReceiver() { override fun onReceive(context: Context, intent: Intent) { GeofenceTransitionsJobIntentService.enqueueWork(context, intent) } diff --git a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/GeofenceErrorMessages.kt b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/intent_receivers/GeofenceErrorMessages.kt similarity index 94% rename from android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/GeofenceErrorMessages.kt rename to android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/intent_receivers/GeofenceErrorMessages.kt index 4890f7cb..74a88f87 100755 --- a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/GeofenceErrorMessages.kt +++ b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/intent_receivers/GeofenceErrorMessages.kt @@ -1,6 +1,6 @@ -package com.cloud.diplomaticquarterapp.geofence +package com.cloud.diplomaticquarterapp.geofence.intent_receivers import android.content.Context import com.cloud.diplomaticquarterapp.R diff --git a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/intent_receivers/GeofenceJobIntentService.kt b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/intent_receivers/GeofenceJobIntentService.kt new file mode 100644 index 00000000..84d3f230 --- /dev/null +++ b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/intent_receivers/GeofenceJobIntentService.kt @@ -0,0 +1,29 @@ + + +package com.cloud.diplomaticquarterapp.geofence.intent_receivers + +import android.content.Intent +import android.util.Log +import androidx.core.app.JobIntentService +import com.cloud.diplomaticquarterapp.geofence.GeofenceTransition +import com.cloud.diplomaticquarterapp.geofence.HMG_Geofence +import com.cloud.diplomaticquarterapp.utils.saveLog +import com.google.android.gms.location.GeofencingEvent + +class GeofenceJobIntentService : JobIntentService(){ + + private val LOG_TAG = "GeofenceBroadcastReceiver" + override fun onHandleWork(intent: Intent) { + + val geofencingEvent = GeofencingEvent.fromIntent(intent) + if (geofencingEvent.hasError()) { + val errorMessage = GeofenceErrorMessages.getErrorString(this, geofencingEvent.errorCode) + Log.e(LOG_TAG, errorMessage) + saveLog(this, LOG_TAG,errorMessage) + return + } + + HMG_Geofence.shared(this).handleEvent(geofencingEvent.triggeringGeofences,geofencingEvent.triggeringLocation, GeofenceTransition.fromInt(geofencingEvent.geofenceTransition)) + } + +} \ No newline at end of file diff --git a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/GeofenceTransitionsJobIntentService.kt b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/intent_receivers/GeofenceTransitionsJobIntentService.kt similarity index 87% rename from android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/GeofenceTransitionsJobIntentService.kt rename to android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/intent_receivers/GeofenceTransitionsJobIntentService.kt index 18ee92d9..2be216a1 100755 --- a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/GeofenceTransitionsJobIntentService.kt +++ b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/intent_receivers/GeofenceTransitionsJobIntentService.kt @@ -29,22 +29,16 @@ */ -package com.cloud.diplomaticquarterapp.geofence +package com.cloud.diplomaticquarterapp.geofence.intent_receivers import android.content.Context import android.content.Intent -import android.location.Location import android.util.Log import androidx.core.app.JobIntentService -import com.cloud.diplomaticquarterapp.utils.API -import com.cloud.diplomaticquarterapp.utils.httpPost -import com.cloud.diplomaticquarterapp.utils.sendNotification -import com.github.kittinunf.fuel.core.extensions.jsonBody -import com.github.kittinunf.fuel.core.isSuccessful -import com.github.kittinunf.fuel.httpPost +import com.cloud.diplomaticquarterapp.geofence.GeofenceTransition +import com.cloud.diplomaticquarterapp.geofence.HMG_Geofence import com.google.android.gms.location.Geofence import com.google.android.gms.location.GeofencingEvent -import com.google.gson.Gson class GeofenceTransitionsJobIntentService : JobIntentService() { diff --git a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/GeofencingRebootBroadcastReceiver.kt b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/intent_receivers/GeofencingRebootBroadcastReceiver.kt similarity index 73% rename from android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/GeofencingRebootBroadcastReceiver.kt rename to android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/intent_receivers/GeofencingRebootBroadcastReceiver.kt index 4534b08f..e1eda3b9 100644 --- a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/GeofencingRebootBroadcastReceiver.kt +++ b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/intent_receivers/GeofencingRebootBroadcastReceiver.kt @@ -1,20 +1,19 @@ -package com.cloud.diplomaticquarterapp.geofence +package com.cloud.diplomaticquarterapp.geofence.intent_receivers import android.content.BroadcastReceiver import android.content.Context import android.content.Intent -import android.os.Handler -import android.os.Message import com.cloud.diplomaticquarterapp.geofence.HMG_Geofence +import com.cloud.diplomaticquarterapp.geofence.PREFS_STORAGE import com.cloud.diplomaticquarterapp.utils.HMGUtils class GeofencingRebootBroadcastReceiver : BroadcastReceiver(){ override fun onReceive(context: Context, intent: Intent) { -// if (Intent.ACTION_BOOT_COMPLETED.equals(intent.action)) { - if (intent.action.equals("android.intent.action.BOOT_COMPLETE")) { + if (Intent.ACTION_BOOT_COMPLETED.equals(intent.action)) { +// if (intent.action.equals("android.intent.action.BOOT_COMPLETE")) { val pref = context.getSharedPreferences(PREFS_STORAGE, Context.MODE_PRIVATE) pref.edit().putString("REBOOT_DETECTED","YES").apply() diff --git a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/utils/HMGUtils.kt b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/utils/HMGUtils.kt index 413e8c09..0dc0234c 100644 --- a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/utils/HMGUtils.kt +++ b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/utils/HMGUtils.kt @@ -126,7 +126,7 @@ fun sendNotification(context: Context, title:String, @Nullable subtitle:String?, .addNextIntent(intent) val notificationPendingIntent = stackBuilder.getPendingIntent(getUniqueId(), PendingIntent.FLAG_UPDATE_CURRENT) - val notification = NotificationCompat.Builder(context, NOTIFICATION_CHANNEL_ID) + val notification = NotificationCompat.Builder(context, NOTIFICATION_CHANNEL_ID + ".geofence") .setSmallIcon(R.mipmap.ic_launcher) .setContentIntent(notificationPendingIntent) .setAutoCancel(true) @@ -154,9 +154,9 @@ fun isJSONValid(jsonString: String?): Boolean { fun saveLog(context:Context, tag:String, message:String){ val pref = context.getSharedPreferences(PREFS_STORAGE, Context.MODE_PRIVATE) - var logs = pref.getString("GEO_LOGS","") + var logs = pref.getString("GEOFENCE_LOGS","") logs += "$tag -> $message \n" - pref.edit().putString("PLATFORM_LOGS", logs).apply(); + pref.edit().putString("GEOFENCE_LOGS", logs).apply(); } class HTTPResponse(data: T){ diff --git a/ios/Flutter/.last_build_id b/ios/Flutter/.last_build_id index 3aa2cd1e..a7923797 100644 --- a/ios/Flutter/.last_build_id +++ b/ios/Flutter/.last_build_id @@ -1 +1 @@ -3f3d14a0ae775b56806906c2cb14a1f0 \ No newline at end of file +d9d141e787a8aa802f90b776d75f04fc \ No newline at end of file diff --git a/ios/Runner/AppDelegate.swift b/ios/Runner/AppDelegate.swift index a9252ee5..d8f4c0c7 100644 --- a/ios/Runner/AppDelegate.swift +++ b/ios/Runner/AppDelegate.swift @@ -2,6 +2,7 @@ import UIKit import Flutter import GoogleMaps +var userNotificationCenterDelegate:UNUserNotificationCenterDelegate? = nil @UIApplicationMain @objc class AppDelegate: FlutterAppDelegate { @@ -12,6 +13,7 @@ import GoogleMaps GMSServices.provideAPIKey("AIzaSyCiiJiHkocPbcziHt9O8rGWavDrxHRQys8") GeneratedPluginRegistrant.register(with: self) + if let mainViewController = window.rootViewController as? MainFlutterVC{ HMGPlatformBridge.initialize(flutterViewController: mainViewController) } @@ -20,6 +22,18 @@ import GoogleMaps HMG_Geofence.initGeofencing() } + UNUserNotificationCenter.current().delegate = self + return super.application(application, didFinishLaunchingWithOptions: launchOptions) } } + +extension AppDelegate{ + override func userNotificationCenter(_ center: UNUserNotificationCenter, willPresent notification: UNNotification, withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -> Void) { + if (notification.request.content.categoryIdentifier == HmgLocalNotificationCategoryIdentifier){ + completionHandler([.alert,.sound]) + }else{ + super.userNotificationCenter(center, willPresent: notification, withCompletionHandler: completionHandler) + } + } +} diff --git a/ios/Runner/Helper/Extensions.swift b/ios/Runner/Helper/Extensions.swift index 5c1de7c3..de67f9b9 100644 --- a/ios/Runner/Helper/Extensions.swift +++ b/ios/Runner/Helper/Extensions.swift @@ -18,6 +18,14 @@ extension String{ } } +extension Date{ + func toString(format:String) -> String{ + let df = DateFormatter() + df.dateFormat = format + return df.string(from: self) + } +} + extension Dictionary{ func merge(dict:[String:Any?]) -> [String:Any?]{ var self_ = self as! [String:Any?] diff --git a/ios/Runner/Helper/GlobalHelper.swift b/ios/Runner/Helper/GlobalHelper.swift index 35f89991..2e323a2a 100644 --- a/ios/Runner/Helper/GlobalHelper.swift +++ b/ios/Runner/Helper/GlobalHelper.swift @@ -31,20 +31,26 @@ func dictionary(from:String) -> [String:Any]?{ } -func showNotification(identifier:String? = nil, title:String?, subtitle:String?, message:String?, sound:UNNotificationSound = UNNotificationSound.default){ - let notificationContent = UNMutableNotificationContent() - - if identifier != nil { notificationContent.categoryIdentifier = identifier! } - if title != nil { notificationContent.title = title! } - if subtitle != nil { notificationContent.body = message! } - if message != nil { notificationContent.subtitle = subtitle! } - - notificationContent.sound = UNNotificationSound.default - let trigger = UNTimeIntervalNotificationTrigger(timeInterval: 1, repeats: false) - let request = UNNotificationRequest(identifier: "\(Date().timeIntervalSinceNow)", content: notificationContent, trigger: trigger) - UNUserNotificationCenter.current().add(request) { error in - if let error = error { - print("Error: \(error)") +let HmgLocalNotificationCategoryIdentifier = "hmg.local.notification" +func showNotification(identifier:String? = nil, title:String?, subtitle:String?, message:String?, sound:UNNotificationSound = UNNotificationSound.default, categoryIdentifier:String = HmgLocalNotificationCategoryIdentifier){ + DispatchQueue.main.async { + let notificationContent = UNMutableNotificationContent() + notificationContent.categoryIdentifier = categoryIdentifier + + if identifier != nil { notificationContent.categoryIdentifier = identifier! } + if title != nil { notificationContent.title = title! } + if subtitle != nil { notificationContent.body = message! } + if message != nil { notificationContent.subtitle = subtitle! } + + notificationContent.sound = UNNotificationSound.default + let trigger = UNTimeIntervalNotificationTrigger(timeInterval: 1, repeats: false) + let request = UNNotificationRequest(identifier: "\(Date().timeIntervalSinceNow)", content: notificationContent, trigger: trigger) + + + UNUserNotificationCenter.current().add(request) { error in + if let error = error { + print("Error: \(error)") + } } } } @@ -103,6 +109,8 @@ func httpPostRequest(urlString:String, jsonBody:[String:Any?], completion:((Bool completion?(false,responseJSON) } + }else{ + completion?(false,nil) } } diff --git a/ios/Runner/Helper/HMG_Geofence.swift b/ios/Runner/Helper/HMG_Geofence.swift index 3299fa1a..47454d3e 100644 --- a/ios/Runner/Helper/HMG_Geofence.swift +++ b/ios/Runner/Helper/HMG_Geofence.swift @@ -129,8 +129,10 @@ extension HMG_Geofence : CLLocationManagerDelegate{ extension HMG_Geofence{ func handleEvent(for region: CLRegion!, transition:Transition, location:CLLocation?) { - notifyUser(forRegion: region, transition: transition, location: locationManager.location) - notifyServer(forRegion: region, transition: transition, location: locationManager.location) + if let userProfile = userProfile(){ + notifyUser(forRegion: region, transition: transition, location: locationManager.location, userProfile: userProfile) + notifyServer(forRegion: region, transition: transition, location: locationManager.location, userProfile: userProfile) + } } func geoZone(by id: String) -> GeoZoneModel? { @@ -144,25 +146,14 @@ extension HMG_Geofence{ } - func notifyUser(forRegion:CLRegion, transition:Transition, location:CLLocation?){ - if let zone = geoZone(by: forRegion.identifier){ - if UIApplication.shared.applicationState == .active { - mainViewController.showAlert(withTitle: transition.name(), message: zone.message()) - }else{ - - } + func notifyUser(forRegion:CLRegion, transition:Transition, location:CLLocation?, userProfile:[String:Any?]){ + if let patientId = userProfile["PatientID"] as? Int{ + } } - func notifyServer(forRegion:CLRegion, transition:Transition, location:CLLocation?){ - df.dateFormat = "MMM/dd/yyyy hh:mm:ss" - var userInfo = UserDefaults.standard.string(forKey: "flutter.imei-user-data") - if(userInfo == nil){ - userInfo = UserDefaults.standard.string(forKey: "flutter.user-profile") - } - - if let userProfile = userProfile(), - let patientId = userProfile["PatientID"] as? Int{ + func notifyServer(forRegion:CLRegion, transition:Transition, location:CLLocation?, userProfile:[String:Any?]){ + if let patientId = userProfile["PatientID"] as? Int{ if let idString = forRegion.identifier.split(separator: "_").first, let idInt = Int(idString){ let body:[String:Any] = [ @@ -170,19 +161,18 @@ extension HMG_Geofence{ "GeoType":transition.rawValue, "PatientID":patientId ] + + var logs = UserDefaults.init(suiteName: "GeoFenceLog")?.dictionary(forKey: "GEOFENCE_LOGS") ?? [:] + var geo = (logs[forRegion.identifier] as? [String]) ?? [] let url = "https://hmgwebservices.com/Services/Patients.svc/REST/GeoF_InsertPatientFileInfo" httpPostRequest(urlString: url, jsonBody: body){ (status,json) in - let status_ = status ? "Notified" : "Not notified" + let status_ = status ? "Notified successfully:" : "Failed to notify:" showNotification(title: transition.name(), subtitle: forRegion.identifier, message: status_) - var logs = UserDefaults.init(suiteName: "GeoFenceLog")?.dictionary(forKey: "GEOFENCE_LOGS") ?? [:] - if var geo = logs[forRegion.identifier] as? [String]{ - geo.append("\(status_) at \(df.string(from: Date()))") - }else{ - logs.updateValue(["\(status_) at \(df.string(from: Date()))"], forKey: forRegion.identifier) - } + geo.append("\(status_) \(transition.name()) at \(Date().toString(format: "dd/MMM/yyy hh:mm:ss"))") + logs.updateValue( geo, forKey: forRegion.identifier) UserDefaults.init(suiteName: "GeoFenceLog")?.set(logs, forKey: "GEOFENCE_LOGS") } diff --git a/lib/uitl/HMGNetworkConnectivity.dart b/lib/uitl/HMGNetworkConnectivity.dart index 228edf93..c4044573 100644 --- a/lib/uitl/HMGNetworkConnectivity.dart +++ b/lib/uitl/HMGNetworkConnectivity.dart @@ -47,18 +47,28 @@ class HMGNetworkConnectivity { void confirmFromUser() { TranslationBase translator = TranslationBase.of(context); - ConfirmDialog( - context: context, - confirmMessage: translator.wantToConnectWithHmgNetwork, - okText: translator.yes, - okFunction: () { - ConfirmDialog.closeAlertDialog(context); - callBack(); - }, - cancelText: translator.no, - cancelFunction: () { - ConfirmDialog.closeAlertDialog(context); - }).showAlertDialog(context); + + void doIt() { + ConfirmDialog( + context: context, + confirmMessage: translator.wantToConnectWithHmgNetwork, + okText: translator.yes, + okFunction: () { + ConfirmDialog.closeAlertDialog(context); + callBack(); + }, + cancelText: translator.no, + cancelFunction: () { + ConfirmDialog.closeAlertDialog(context); + }).showAlertDialog(context); + } + + if (Platform.isAndroid) + Wifi.list(SSID).then((value) { + if (!value.indexWhere((element) => element.ssid == SSID).isNegative) doIt(); + }); + else + doIt(); } void showFailDailog(String message) { From 187d2bcd8b6e61a6febf185fc3d7fe46a66c8a9a Mon Sep 17 00:00:00 2001 From: Zohaib Kambrani Date: Mon, 21 Dec 2020 18:01:13 +0300 Subject: [PATCH 08/42] Geofence error logging in shared_preferences --- .../intent_receivers/GeofenceErrorMessages.kt | 13 ++++++++++++- android/app/src/main/res/values/strings.xml | 6 ++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/intent_receivers/GeofenceErrorMessages.kt b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/intent_receivers/GeofenceErrorMessages.kt index 74a88f87..08d5ba62 100755 --- a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/intent_receivers/GeofenceErrorMessages.kt +++ b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/intent_receivers/GeofenceErrorMessages.kt @@ -4,6 +4,7 @@ package com.cloud.diplomaticquarterapp.geofence.intent_receivers import android.content.Context import com.cloud.diplomaticquarterapp.R +import com.cloud.diplomaticquarterapp.utils.saveLog import com.google.android.gms.common.api.ApiException import com.google.android.gms.location.GeofenceStatusCodes @@ -18,7 +19,7 @@ object GeofenceErrorMessages { fun getErrorString(context: Context, errorCode: Int): String { val resources = context.resources - return when (errorCode) { + val errorMessage = when (errorCode) { GeofenceStatusCodes.GEOFENCE_NOT_AVAILABLE -> resources.getString(R.string.geofence_not_available) @@ -28,7 +29,17 @@ object GeofenceErrorMessages { GeofenceStatusCodes.GEOFENCE_TOO_MANY_PENDING_INTENTS -> resources.getString(R.string.geofence_too_many_pending_intents) + GeofenceStatusCodes.GEOFENCE_INSUFFICIENT_LOCATION_PERMISSION -> + resources.getString(R.string.GEOFENCE_INSUFFICIENT_LOCATION_PERMISSION) + + GeofenceStatusCodes.GEOFENCE_REQUEST_TOO_FREQUENT -> + resources.getString(R.string.GEOFENCE_REQUEST_TOO_FREQUENT) + else -> resources.getString(R.string.geofence_unknown_error) } + + saveLog(context,"GeofenceErrorMessages","$errorCode | $errorMessage") + + return errorMessage } } \ No newline at end of file diff --git a/android/app/src/main/res/values/strings.xml b/android/app/src/main/res/values/strings.xml index 8acc0c12..4e107030 100755 --- a/android/app/src/main/res/values/strings.xml +++ b/android/app/src/main/res/values/strings.xml @@ -13,4 +13,10 @@ You have provided too many PendingIntents to the addGeofences() call. + + App do not have permission to access location service. + + + Geofence requests happened too frequently. + From 3392a2431b8e9d5deb12e82ccd4a64af92aa68e0 Mon Sep 17 00:00:00 2001 From: Zohaib Kambrani Date: Mon, 21 Dec 2020 18:42:50 +0300 Subject: [PATCH 09/42] Added Location Provider Changed Receiver to Reregister the geofences --- android/app/src/main/AndroidManifest.xml | 6 +++- .../LocationProviderChangeReceiver.kt | 32 +++++++++++++++++++ 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/intent_receivers/LocationProviderChangeReceiver.kt diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 68975071..649af435 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -81,7 +81,11 @@ - + + + + + diff --git a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/intent_receivers/LocationProviderChangeReceiver.kt b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/intent_receivers/LocationProviderChangeReceiver.kt new file mode 100644 index 00000000..9de0cd6f --- /dev/null +++ b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/intent_receivers/LocationProviderChangeReceiver.kt @@ -0,0 +1,32 @@ + + +package com.cloud.diplomaticquarterapp.geofence.intent_receivers + +import android.content.BroadcastReceiver +import android.content.Context +import android.content.Intent +import android.location.LocationManager +import android.util.Log +import com.cloud.diplomaticquarterapp.geofence.GeofenceTransition +import com.cloud.diplomaticquarterapp.geofence.HMG_Geofence +import com.cloud.diplomaticquarterapp.geofence.PREFS_STORAGE +import com.cloud.diplomaticquarterapp.utils.HMGUtils +import com.cloud.diplomaticquarterapp.utils.saveLog +import com.google.android.gms.location.GeofencingEvent + +class LocationProviderChangeReceiver : BroadcastReceiver() { + private val LOG_TAG = "LocationProviderChangeReceiver" + override fun onReceive(context: Context, intent: Intent) { + + if (LocationManager.PROVIDERS_CHANGED_ACTION.equals(intent.action)) { + val pref = context.getSharedPreferences(PREFS_STORAGE, Context.MODE_PRIVATE) + pref.edit().putString("LOCATION_PROVIDER_CHANGE","YES").apply() + + HMG_Geofence.shared(context).unRegisterAll { status, exception -> + val geoZones = HMGUtils.getGeoZonesFromPreference(context) + HMG_Geofence.shared(context).register(geoZones) + } + } + } + +} \ No newline at end of file From 57925e3b02c9bb2f565150c94e5a39ddf8511783 Mon Sep 17 00:00:00 2001 From: Zohaib Kambrani Date: Thu, 24 Dec 2020 18:01:32 +0300 Subject: [PATCH 10/42] Geofence fixes by JobScheduler --- android/app/src/main/AndroidManifest.xml | 3 + .../diplomaticquarterapp/MainActivity.kt | 13 +- .../geofence/GeoZoneModel.kt | 6 +- .../geofence/HMG_Geofence.kt | 74 ++++++--- .../GeofenceBroadcastReceiver.kt | 22 ++- ...GeofenceBroadcastReceiverWithJobService.kt | 3 + .../intent_receivers/GeofenceErrorMessages.kt | 4 +- .../GeofenceJobIntentService.kt | 29 ---- .../GeofenceTransitionsJobIntentService.kt | 32 +++- .../GeofencingRebootBroadcastReceiver.kt | 6 +- .../ReregisterGeofenceJobService.kt | 23 +++ .../diplomaticquarterapp/utils/HMGUtils.kt | 84 +++++++--- .../cloud/diplomaticquarterapp/utils/Logs.kt | 146 ++++++++++++++++++ ios/Flutter/.last_build_id | 2 +- ios/Runner.xcodeproj/project.pbxproj | 4 + ios/Runner/AppDelegate.swift | 39 ++++- ios/Runner/Helper/API.swift | 7 +- ios/Runner/Helper/FlutterConstants.swift | 36 +++++ ios/Runner/Helper/GlobalHelper.swift | 2 +- ios/Runner/Helper/HMGPlatformBridge.swift | 3 + lib/config/config.dart | 6 +- 21 files changed, 442 insertions(+), 102 deletions(-) delete mode 100644 android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/intent_receivers/GeofenceJobIntentService.kt create mode 100644 android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/intent_receivers/ReregisterGeofenceJobService.kt create mode 100644 android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/utils/Logs.kt create mode 100644 ios/Runner/Helper/FlutterConstants.swift diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 649af435..79bc3dc4 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -81,6 +81,7 @@ + @@ -88,6 +89,8 @@ + + diff --git a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/MainActivity.kt b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/MainActivity.kt index 8b73b0c7..e67f646f 100644 --- a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/MainActivity.kt +++ b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/MainActivity.kt @@ -2,8 +2,7 @@ package com.cloud.diplomaticquarterapp import android.os.Bundle import android.util.Log import androidx.annotation.NonNull; -import com.cloud.diplomaticquarterapp.utils.FlutterText -import com.cloud.diplomaticquarterapp.utils.PlatformBridge +import com.cloud.diplomaticquarterapp.utils.* import io.flutter.embedding.android.FlutterFragmentActivity import io.flutter.embedding.engine.FlutterEngine import io.flutter.plugin.common.MethodChannel @@ -15,6 +14,16 @@ class MainActivity: FlutterFragmentActivity() { // Create Flutter Platform Bridge PlatformBridge(flutterEngine.dartExecutor.binaryMessenger, this).create() + val time = timeToMillis("04:00:00", "HH:mm:ss") + print(time) + +// val d1 = Logs.list(this) +// val d2 = Logs.raw(this) +// val d3 = Logs.RegisterGeofence.list(this) +// val d4 = Logs.RegisterGeofence.raw(this) +// val d5 = Logs.GeofenceEvent.list(this) +// val d6 = Logs.GeofenceEvent.raw(this) + print("") } override fun onResume() { diff --git a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/GeoZoneModel.kt b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/GeoZoneModel.kt index 328014e6..b3fb4f56 100644 --- a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/GeoZoneModel.kt +++ b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/GeoZoneModel.kt @@ -37,7 +37,7 @@ class GeoZoneModel { val rad = Radius.toFloat() if(lat != null && long != null){ - val loiteringDelayMinutes:Int = 5 // in Minutes + val loiteringDelayMinutes:Int = 2 // in Minutes return Geofence.Builder() .setRequestId(identifier()) .setCircularRegion( @@ -46,8 +46,8 @@ class GeoZoneModel { rad ) .setTransitionTypes(GeofenceTransition.ENTER_EXIT.value) -// .setNotificationResponsiveness(0) -// .setLoiteringDelay(loiteringDelayMinutes * 60 * 1000) + .setNotificationResponsiveness(0) + .setLoiteringDelay(loiteringDelayMinutes * 60 * 1000) .setExpirationDuration(Geofence.NEVER_EXPIRE) .build() } diff --git a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/HMG_Geofence.kt b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/HMG_Geofence.kt index 919d478f..ba6691f7 100644 --- a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/HMG_Geofence.kt +++ b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/HMG_Geofence.kt @@ -9,6 +9,7 @@ import android.content.pm.PackageManager import android.location.Location import androidx.core.content.ContextCompat import com.cloud.diplomaticquarterapp.geofence.intent_receivers.GeofenceBroadcastReceiver +import com.cloud.diplomaticquarterapp.geofence.intent_receivers.ReregisterGeofenceJobService import com.cloud.diplomaticquarterapp.utils.* import com.google.android.gms.location.Geofence import com.google.android.gms.location.GeofencingClient @@ -20,8 +21,10 @@ import com.google.gson.reflect.TypeToken enum class GeofenceTransition(val value: Int) { ENTER(1), EXIT(2), + DWELL(4), + ENTER_EXIT((ENTER.value or EXIT.value)), - DWELL(4); + DWELL_EXIT((DWELL.value or EXIT.value)); companion object { fun fromInt(value: Int) = GeofenceTransition.values().first { it.value == value } @@ -30,8 +33,9 @@ enum class GeofenceTransition(val value: Int) { fun named():String{ if (value == 1)return "Enter" if (value == 2)return "Exit" - if (value == (ENTER.value or EXIT.value))return "Enter or Exit" if (value == 4)return "dWell" + if (value == (ENTER.value or EXIT.value))return "Enter or Exit" + if (value == (DWELL.value or EXIT.value))return "DWell or Exit" return "unknown" } } @@ -73,13 +77,22 @@ class HMG_Geofence { } } + fun limitize(zones: List):List{ + var geoZones_ = zones + if(zones.size > 100) + geoZones_ = zones.subList(0, 99) + return geoZones_ + } + fun register(geoZones: List){ if (geoZones.isEmpty()) return + var geoZones_ = limitize(geoZones) + fun buildGeofencingRequest(geofences: List): GeofencingRequest { return GeofencingRequest.Builder() - .setInitialTrigger(0) + .setInitialTrigger(GeofencingRequest.INITIAL_TRIGGER_DWELL) .addGeofences(geofences) .build() } @@ -87,9 +100,9 @@ class HMG_Geofence { getActiveGeofences({ active -> val geofences = mutableListOf() - geoZones.forEach { - it.toGeofence()?.let { geof -> - if(!active.contains(geof.requestId)){ // if not already registered then register + geoZones_.forEach { + it.toGeofence()?.let { geof -> + if (!active.contains(geof.requestId)) { // if not already registered then register geofences.add(geof) } } @@ -99,19 +112,25 @@ class HMG_Geofence { geofencingClient .addGeofences(buildGeofencingRequest(geofences), geofencePendingIntent) .addOnSuccessListener { + Logs.RegisterGeofence.save(context,"SUCCESS", "Successfuly registered the geofences", Logs.STATUS.SUCCESS) saveActiveGeofence(geofences.map { it.requestId }, listOf()) } .addOnFailureListener { - print(it.localizedMessage) - saveLog(context,"error:ADD_GEOFENCES", it.localizedMessage) + Logs.RegisterGeofence.save(context,"FAILED_TO_REGISTER", "Failed to register geofence",Logs.STATUS.ERROR) } + + // Schedule the job to register after specified duration (due to: events not calling after long period.. days or days [Needs to register fences again]) + HMGUtils.scheduleJob(context, ReregisterGeofenceJobService::class.java,ReregisterGeofenceJobService.JobID, ReregisterGeofenceJobService.TriggerIntervalMillis) } - },null) + + }, null) + } - fun unRegisterAll(completion: (status: Boolean, exception:Exception?) -> Unit){ + fun unRegisterAll(completion: (status: Boolean, exception: Exception?) -> Unit){ getActiveGeofences({ success -> val mList = success.toMutableList() + removeActiveGeofences() geofencingClient .removeGeofences(success) .addOnSuccessListener { @@ -119,14 +138,20 @@ class HMG_Geofence { } .addOnFailureListener { completion(false, it) - saveLog(context,"error:REMOVE_GEOFENCES", it.localizedMessage) + saveLog(context, "error:REMOVE_GEOFENCES", it.localizedMessage) } - removeActiveGeofences() }, { failed -> // Nothing to do with failed geofences. }) } + fun reRegister(){ + unRegisterAll { status, exception -> + val geoZones = HMGUtils.getGeoZonesFromPreference(context) + register(geoZones) + } + } + fun saveActiveGeofence(success: List, failed: List){ val jsonSuccess = gson.toJson(success) val jsonFailure = gson.toJson(failed) @@ -135,8 +160,8 @@ class HMG_Geofence { } fun removeActiveGeofences(){ - preferences.edit().putString(PREF_KEY_SUCCESS,"[]").apply() - preferences.edit().putString(PREF_KEY_FAILED,"[]").apply() + preferences.edit().putString(PREF_KEY_SUCCESS, "[]").apply() + preferences.edit().putString(PREF_KEY_FAILED, "[]").apply() } fun getActiveGeofences(success: (success: List) -> Unit, failure: ((failed: List) -> Unit)?){ @@ -164,7 +189,7 @@ class HMG_Geofence { profileJson = preferences.getString("flutter.user-profile", null) val type = object : TypeToken?>() {}.type - return gson.fromJson?>(profileJson,type) + return gson.fromJson?>(profileJson, type) ?.get("PatientID") .toString() .toDoubleOrNull() @@ -172,32 +197,35 @@ class HMG_Geofence { } - fun handleEvent(triggerGeofences: List, location: Location, transition:GeofenceTransition) { + fun handleEvent(triggerGeofences: List, location: Location, transition: GeofenceTransition) { getPatientID()?.let { patientId -> getActiveGeofences({ activeGeofences -> triggerGeofences.forEach { geofence -> // Extract PointID from 'geofence.requestId' and find from active geofences - val pointID = activeGeofences.firstOrNull {it == geofence.requestId}?.split('_')?.first() - if(!pointID.isNullOrEmpty() && pointID.toIntOrNull() != null){ + val pointID = activeGeofences.firstOrNull { it == geofence.requestId }?.split('_')?.first() + if (!pointID.isNullOrEmpty() && pointID.toIntOrNull() != null) { - val body = mutableMapOf( + val body = mutableMapOf( "PointsID" to pointID.toIntOrNull(), "GeoType" to transition.value, "PatientID" to patientId ) body.putAll(HMGUtils.defaultHTTPParams(context)) - httpPost>(API.LOG_GEOFENCE, body, { response -> + httpPost>(API.LOG_GEOFENCE, body, { response -> + saveLog(context, "HMG_GEOFENCE_NOTIFY", "Success: Notified to server\uD83D\uDE0E.") sendNotification(context, transition.named(), geofence.requestId, "Notified to server.😎") - },{ exception -> - sendNotification(context, transition.named(), geofence.requestId, "Failed to notify server.😔") + }, { exception -> + val errorMessage = "${transition.named()}, ${geofence.requestId}" + saveLog(context, "HMG_GEOFENCE_NOTIFY", "failed: $errorMessage | error: ${exception.localizedMessage}") + sendNotification(context, transition.named(), geofence.requestId, "Failed to notify server😔 -> ${exception.localizedMessage}") }) } } - },null) + }, null) } } } \ No newline at end of file diff --git a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/intent_receivers/GeofenceBroadcastReceiver.kt b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/intent_receivers/GeofenceBroadcastReceiver.kt index 11fc4850..80ef2c96 100644 --- a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/intent_receivers/GeofenceBroadcastReceiver.kt +++ b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/intent_receivers/GeofenceBroadcastReceiver.kt @@ -8,7 +8,9 @@ import android.content.Intent import android.util.Log import com.cloud.diplomaticquarterapp.geofence.GeofenceTransition import com.cloud.diplomaticquarterapp.geofence.HMG_Geofence +import com.cloud.diplomaticquarterapp.utils.Logs import com.cloud.diplomaticquarterapp.utils.saveLog +import com.google.android.gms.location.GeofenceStatusCodes import com.google.android.gms.location.GeofencingEvent class GeofenceBroadcastReceiver : BroadcastReceiver() { @@ -19,12 +21,28 @@ class GeofenceBroadcastReceiver : BroadcastReceiver() { if (geofencingEvent.hasError()) { val errorMessage = GeofenceErrorMessages.getErrorString(context, geofencingEvent.errorCode) Log.e(LOG_TAG, errorMessage) - saveLog(context,LOG_TAG,errorMessage) + + Logs.GeofenceEvent.save(context,LOG_TAG,"Error while triggering geofence event",Logs.STATUS.ERROR) + doReRegisterIfRequired(context,geofencingEvent.errorCode) + return } - + + Logs.GeofenceEvent.save(context,LOG_TAG,"Geofence event triggered: ${GeofenceTransition.fromInt(geofencingEvent.geofenceTransition).value} for ${geofencingEvent.triggeringGeofences.map {it.requestId}}",Logs.STATUS.SUCCESS) HMG_Geofence.shared(context).handleEvent(geofencingEvent.triggeringGeofences,geofencingEvent.triggeringLocation, GeofenceTransition.fromInt(geofencingEvent.geofenceTransition)); } + fun doReRegisterIfRequired(context: Context, errorCode: Int){ + val errorRequiredReregister = listOf( + GeofenceStatusCodes.GEOFENCE_NOT_AVAILABLE, + GeofenceStatusCodes.GEOFENCE_TOO_MANY_GEOFENCES, + GeofenceStatusCodes.GEOFENCE_TOO_MANY_PENDING_INTENTS, + GeofenceStatusCodes.GEOFENCE_REQUEST_TOO_FREQUENT + ) + + if(errorRequiredReregister.contains(errorCode)) + HMG_Geofence.shared(context).reRegister() + + } } \ No newline at end of file diff --git a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/intent_receivers/GeofenceBroadcastReceiverWithJobService.kt b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/intent_receivers/GeofenceBroadcastReceiverWithJobService.kt index 250040f6..a9924ca1 100644 --- a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/intent_receivers/GeofenceBroadcastReceiverWithJobService.kt +++ b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/intent_receivers/GeofenceBroadcastReceiverWithJobService.kt @@ -5,9 +5,12 @@ package com.cloud.diplomaticquarterapp.geofence.intent_receivers import android.content.BroadcastReceiver import android.content.Context import android.content.Intent +import com.cloud.diplomaticquarterapp.geofence.HMG_Geofence +import com.google.android.gms.location.GeofenceStatusCodes class GeofenceBroadcastReceiverWithJobService : BroadcastReceiver() { override fun onReceive(context: Context, intent: Intent) { GeofenceTransitionsJobIntentService.enqueueWork(context, intent) } + } \ No newline at end of file diff --git a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/intent_receivers/GeofenceErrorMessages.kt b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/intent_receivers/GeofenceErrorMessages.kt index 08d5ba62..01377d49 100755 --- a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/intent_receivers/GeofenceErrorMessages.kt +++ b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/intent_receivers/GeofenceErrorMessages.kt @@ -4,7 +4,7 @@ package com.cloud.diplomaticquarterapp.geofence.intent_receivers import android.content.Context import com.cloud.diplomaticquarterapp.R -import com.cloud.diplomaticquarterapp.utils.saveLog +import com.cloud.diplomaticquarterapp.geofence.HMG_Geofence import com.google.android.gms.common.api.ApiException import com.google.android.gms.location.GeofenceStatusCodes @@ -38,8 +38,6 @@ object GeofenceErrorMessages { else -> resources.getString(R.string.geofence_unknown_error) } - saveLog(context,"GeofenceErrorMessages","$errorCode | $errorMessage") - return errorMessage } } \ No newline at end of file diff --git a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/intent_receivers/GeofenceJobIntentService.kt b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/intent_receivers/GeofenceJobIntentService.kt deleted file mode 100644 index 84d3f230..00000000 --- a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/intent_receivers/GeofenceJobIntentService.kt +++ /dev/null @@ -1,29 +0,0 @@ - - -package com.cloud.diplomaticquarterapp.geofence.intent_receivers - -import android.content.Intent -import android.util.Log -import androidx.core.app.JobIntentService -import com.cloud.diplomaticquarterapp.geofence.GeofenceTransition -import com.cloud.diplomaticquarterapp.geofence.HMG_Geofence -import com.cloud.diplomaticquarterapp.utils.saveLog -import com.google.android.gms.location.GeofencingEvent - -class GeofenceJobIntentService : JobIntentService(){ - - private val LOG_TAG = "GeofenceBroadcastReceiver" - override fun onHandleWork(intent: Intent) { - - val geofencingEvent = GeofencingEvent.fromIntent(intent) - if (geofencingEvent.hasError()) { - val errorMessage = GeofenceErrorMessages.getErrorString(this, geofencingEvent.errorCode) - Log.e(LOG_TAG, errorMessage) - saveLog(this, LOG_TAG,errorMessage) - return - } - - HMG_Geofence.shared(this).handleEvent(geofencingEvent.triggeringGeofences,geofencingEvent.triggeringLocation, GeofenceTransition.fromInt(geofencingEvent.geofenceTransition)) - } - -} \ No newline at end of file diff --git a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/intent_receivers/GeofenceTransitionsJobIntentService.kt b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/intent_receivers/GeofenceTransitionsJobIntentService.kt index 2be216a1..c008c0a5 100755 --- a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/intent_receivers/GeofenceTransitionsJobIntentService.kt +++ b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/intent_receivers/GeofenceTransitionsJobIntentService.kt @@ -37,7 +37,9 @@ import android.util.Log import androidx.core.app.JobIntentService import com.cloud.diplomaticquarterapp.geofence.GeofenceTransition import com.cloud.diplomaticquarterapp.geofence.HMG_Geofence +import com.cloud.diplomaticquarterapp.utils.saveLog import com.google.android.gms.location.Geofence +import com.google.android.gms.location.GeofenceStatusCodes import com.google.android.gms.location.GeofencingEvent class GeofenceTransitionsJobIntentService : JobIntentService() { @@ -45,7 +47,7 @@ class GeofenceTransitionsJobIntentService : JobIntentService() { companion object { private const val LOG_TAG = "GeoTrIntentService" - private const val JOB_ID = 573 + private const val JOB_ID = 95902 var context_: Context? = null fun enqueueWork(context: Context, intent: Intent) { context_ = context @@ -59,15 +61,31 @@ class GeofenceTransitionsJobIntentService : JobIntentService() { override fun onHandleWork(intent: Intent) { val geofencingEvent = GeofencingEvent.fromIntent(intent) if (geofencingEvent.hasError()) { - val errorMessage = GeofenceErrorMessages.getErrorString(this, geofencingEvent.errorCode) + val errorMessage = GeofenceErrorMessages.getErrorString(context_!!, geofencingEvent.errorCode) Log.e(LOG_TAG, errorMessage) + + + saveLog(context_!!,LOG_TAG,errorMessage) + doReRegisterIfRequired(context_!!, geofencingEvent.errorCode) + return } - if (geofencingEvent.geofenceTransition == Geofence.GEOFENCE_TRANSITION_ENTER || geofencingEvent.geofenceTransition == Geofence.GEOFENCE_TRANSITION_EXIT) { - context_?.let { - HMG_Geofence.shared(it).handleEvent(geofencingEvent.triggeringGeofences,geofencingEvent.triggeringLocation, GeofenceTransition.fromInt(geofencingEvent.geofenceTransition)); - } - } + HMG_Geofence.shared(context_!!).handleEvent(geofencingEvent.triggeringGeofences,geofencingEvent.triggeringLocation, GeofenceTransition.fromInt(geofencingEvent.geofenceTransition)); + + } + + + fun doReRegisterIfRequired(context: Context, errorCode: Int){ + val errorRequiredReregister = listOf( + GeofenceStatusCodes.GEOFENCE_NOT_AVAILABLE, + GeofenceStatusCodes.GEOFENCE_TOO_MANY_GEOFENCES, + GeofenceStatusCodes.GEOFENCE_TOO_MANY_PENDING_INTENTS, + GeofenceStatusCodes.GEOFENCE_REQUEST_TOO_FREQUENT + ) + + if(errorRequiredReregister.contains(errorCode)) + HMG_Geofence.shared(context).reRegister() + } } \ No newline at end of file diff --git a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/intent_receivers/GeofencingRebootBroadcastReceiver.kt b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/intent_receivers/GeofencingRebootBroadcastReceiver.kt index e1eda3b9..0663db3b 100644 --- a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/intent_receivers/GeofencingRebootBroadcastReceiver.kt +++ b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/intent_receivers/GeofencingRebootBroadcastReceiver.kt @@ -7,7 +7,6 @@ import android.content.Context import android.content.Intent import com.cloud.diplomaticquarterapp.geofence.HMG_Geofence import com.cloud.diplomaticquarterapp.geofence.PREFS_STORAGE -import com.cloud.diplomaticquarterapp.utils.HMGUtils class GeofencingRebootBroadcastReceiver : BroadcastReceiver(){ override fun onReceive(context: Context, intent: Intent) { @@ -17,10 +16,7 @@ class GeofencingRebootBroadcastReceiver : BroadcastReceiver(){ val pref = context.getSharedPreferences(PREFS_STORAGE, Context.MODE_PRIVATE) pref.edit().putString("REBOOT_DETECTED","YES").apply() - HMG_Geofence.shared(context).unRegisterAll { status, exception -> - val geoZones = HMGUtils.getGeoZonesFromPreference(context) - HMG_Geofence.shared(context).register(geoZones) - } + HMG_Geofence.shared(context).reRegister() } } diff --git a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/intent_receivers/ReregisterGeofenceJobService.kt b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/intent_receivers/ReregisterGeofenceJobService.kt new file mode 100644 index 00000000..043c5c96 --- /dev/null +++ b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/intent_receivers/ReregisterGeofenceJobService.kt @@ -0,0 +1,23 @@ +package com.cloud.diplomaticquarterapp.geofence.intent_receivers + +import android.app.job.JobParameters +import android.app.job.JobService +import com.cloud.diplomaticquarterapp.geofence.HMG_Geofence +import com.cloud.diplomaticquarterapp.utils.Logs +import com.cloud.diplomaticquarterapp.utils.timeToMillis + +class ReregisterGeofenceJobService : JobService(){ + companion object{ + val TriggerIntervalMillis:String = "24:00:00" + val JobID = 918273 + } + override fun onStartJob(params: JobParameters?): Boolean { + HMG_Geofence.shared(applicationContext).reRegister() + Logs.save(applicationContext,"ReregisterGeofenceJobService.onStartJob", "triggered to re-register the geofences after $TriggerIntervalMillis >> [HH:mm:ss]") + return true + } + + override fun onStopJob(params: JobParameters?): Boolean { + return true + } +} \ No newline at end of file diff --git a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/utils/HMGUtils.kt b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/utils/HMGUtils.kt index 0dc0234c..7880a7ef 100644 --- a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/utils/HMGUtils.kt +++ b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/utils/HMGUtils.kt @@ -3,11 +3,15 @@ package com.cloud.diplomaticquarterapp.utils import android.app.NotificationChannel import android.app.NotificationManager import android.app.PendingIntent +import android.app.job.JobInfo +import android.app.job.JobScheduler +import android.content.ComponentName import android.content.Context import android.content.Intent import android.os.Build import android.widget.Toast import androidx.annotation.Nullable +import androidx.annotation.RequiresApi import androidx.core.app.NotificationCompat import androidx.core.app.TaskStackBuilder import com.cloud.diplomaticquarterapp.BuildConfig @@ -17,15 +21,17 @@ import com.cloud.diplomaticquarterapp.geofence.GeoZoneModel import com.cloud.diplomaticquarterapp.geofence.PREFS_STORAGE import com.cloud.diplomaticquarterapp.geofence.PREF_KEY_HMG_ZONES import com.cloud.diplomaticquarterapp.geofence.PREF_KEY_LANGUAGE +import com.cloud.diplomaticquarterapp.geofence.intent_receivers.ReregisterGeofenceJobService import com.github.kittinunf.fuel.core.extensions.jsonBody import com.github.kittinunf.fuel.httpPost -import com.google.android.gms.location.Geofence import com.google.gson.Gson import com.google.gson.reflect.TypeToken import io.flutter.plugin.common.MethodChannel +import org.jetbrains.anko.doAsyncResult import org.json.JSONArray import org.json.JSONException import org.json.JSONObject +import java.text.SimpleDateFormat import java.util.* import kotlin.concurrent.timerTask @@ -71,7 +77,7 @@ class HMGUtils { fun getGeoZonesFromPreference(context: Context):List{ val pref = context.getSharedPreferences(PREFS_STORAGE, Context.MODE_PRIVATE) - val json = pref.getString(PREF_KEY_HMG_ZONES,"[]") + val json = pref.getString(PREF_KEY_HMG_ZONES, "[]") val geoZones = GeoZoneModel().listFrom(json) return geoZones @@ -79,14 +85,14 @@ class HMGUtils { fun getLanguageCode(context: Context) : Int{ val pref = context.getSharedPreferences(PREFS_STORAGE, Context.MODE_PRIVATE) - val lang = pref.getString(PREF_KEY_LANGUAGE,"ar") + val lang = pref.getString(PREF_KEY_LANGUAGE, "ar") return if(lang == "ar") 2 else 1 } - fun defaultHTTPParams(context: Context) : Map{ + fun defaultHTTPParams(context: Context) : Map{ return mapOf( "ZipCode" to "966", - "VersionID" to 5.6, + "VersionID" to 5.8, "Channel" to 3, "LanguageID" to getLanguageCode(context), "IPAdress" to "10.20.10.20", @@ -97,16 +103,44 @@ class HMGUtils { "DeviceTypeID" to 2) } + + fun scheduleJob(context: Context, pendingIntentClassType:Class, jobId:Int, intervalDuration:String, deadlineMillis:Long = (30 * 1000)) { // default deadline: 30 Seconds + if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.M) { + val jobScheduler: JobScheduler = context.getSystemService(JobScheduler::class.java) + + val serviceComponent = ComponentName(context, pendingIntentClassType) + val builder = JobInfo.Builder(jobId, serviceComponent) + builder.setPersisted(true) + + val intervalMillis = timeToMillis(intervalDuration,"HH:mm:ss") + builder.setMinimumLatency(intervalMillis) // wait at least + builder.setOverrideDeadline((intervalMillis + deadlineMillis)) // maximum delay + if (jobScheduler.schedule(builder.build()) == JobScheduler.RESULT_SUCCESS){ + Logs.save(context,"ScheduleJob", "${pendingIntentClassType.simpleName}: Job scheduled to trigger after duration $intervalDuration >> HH:mm:ss --('MinimumLatency:$intervalMillis Deadline:${(intervalMillis + deadlineMillis)}')--",Logs.STATUS.SUCCESS) + }else{ + Logs.save(context,"ScheduleJob", "${pendingIntentClassType.simpleName}: Failed to scheduled Job",Logs.STATUS.ERROR) + } + + } else { + Logs.save(context,"ScheduleJob", "${pendingIntentClassType.simpleName}: Failed to scheduled Job on VERSION.SDK_INT < ${android.os.Build.VERSION_CODES.M}",Logs.STATUS.ERROR) + } + } + } } -private fun Timer.schedule(timerTask: TimerTask) { -} private const val NOTIFICATION_CHANNEL_ID = BuildConfig.APPLICATION_ID + ".channel" -fun sendNotification(context: Context, title:String, @Nullable subtitle:String?, message:String?) { + +fun timeToMillis(time:String, format:String):Long{ + val sdf = SimpleDateFormat(format, Locale.US) + val millis = sdf.parse(time).time + TimeZone.getDefault().rawOffset + return millis +} + +fun sendNotification(context: Context, title: String, @Nullable subtitle: String?, message: String?) { val notificationManager = context.getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O @@ -126,7 +160,7 @@ fun sendNotification(context: Context, title:String, @Nullable subtitle:String?, .addNextIntent(intent) val notificationPendingIntent = stackBuilder.getPendingIntent(getUniqueId(), PendingIntent.FLAG_UPDATE_CURRENT) - val notification = NotificationCompat.Builder(context, NOTIFICATION_CHANNEL_ID + ".geofence") + val notification = NotificationCompat.Builder(context, NOTIFICATION_CHANNEL_ID) .setSmallIcon(R.mipmap.ic_launcher) .setContentIntent(notificationPendingIntent) .setAutoCancel(true) @@ -141,7 +175,15 @@ fun sendNotification(context: Context, title:String, @Nullable subtitle:String?, //------------------------- // Open Helper Methods //------------------------- -private fun getUniqueId() = ((System.currentTimeMillis() % 10000).toInt()) +fun getUniqueId() = ((System.currentTimeMillis() % 10000).toInt()) + +object DateUtils { + @JvmStatic + fun dateTimeNow() : String { + val format = SimpleDateFormat("dd-MMM-yyy hh:mm:ss") + return format.format(Date()) + } +} fun isJSONValid(jsonString: String?): Boolean { try { JSONObject(jsonString) } catch (ex: JSONException) { @@ -152,11 +194,16 @@ fun isJSONValid(jsonString: String?): Boolean { return true } -fun saveLog(context:Context, tag:String, message:String){ +fun saveLog(context: Context, tag: String, message: String){ val pref = context.getSharedPreferences(PREFS_STORAGE, Context.MODE_PRIVATE) - var logs = pref.getString("GEOFENCE_LOGS","") + var logs = pref.getString("LOGS", "") logs += "$tag -> $message \n" - pref.edit().putString("GEOFENCE_LOGS", logs).apply(); + pref.edit().putString("LOGS", logs).apply(); +} + +fun getLogs(context: Context) : String?{ + val pref = context.getSharedPreferences(PREFS_STORAGE, Context.MODE_PRIVATE) + return pref.getString("LOGS", "") } class HTTPResponse(data: T){ @@ -170,15 +217,16 @@ fun httpPost(url: String, body: Map, onSuccess: (response: HTTP url.httpPost() .jsonBody(jsonBody, Charsets.UTF_8) .timeout(10000) - .header("Content-Type","application/json") - .header("Allow","*/*") + .header("Content-Type", "application/json") + .header("Allow", "*/*") .response { request, response, result -> + result.doAsyncResult { } result.fold({ data -> val dataString = String(data) - if(isJSONValid(dataString)){ - val responseData = gson.fromJson(dataString,type) + if (isJSONValid(dataString)) { + val responseData = gson.fromJson(dataString, type) onSuccess(HTTPResponse(responseData)) - }else{ + } else { onError(Exception("Invalid response from server (Not a valid JSON)")) } }, { diff --git a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/utils/Logs.kt b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/utils/Logs.kt new file mode 100644 index 00000000..5c11943e --- /dev/null +++ b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/utils/Logs.kt @@ -0,0 +1,146 @@ +package com.cloud.diplomaticquarterapp.utils + +import android.content.Context +import android.content.SharedPreferences +import android.os.Build +import com.cloud.diplomaticquarterapp.BuildConfig +import com.cloud.diplomaticquarterapp.geofence.PREFS_STORAGE +import com.google.gson.Gson + +class Logs { + + enum class STATUS{ + SUCCESS, + ERROR; + } + class GeofenceEvent{ + companion object{ + fun save(context: Context, tag:String, message:String, status:Logs.STATUS = STATUS.SUCCESS){ + Logs.Common.save(context,"GeofenceEvent", tag, message, status) + } + + fun list(context: Context, tag:String? = null, status:Logs.STATUS? = null):List{ + return Logs.Common.list(context,"GeofenceEvent", tag, status) + } + + fun raw(context: Context):String{ + return Logs.Common.raw(context,"GeofenceEvent") + } + } + } + + class RegisterGeofence{ + companion object{ + fun save(context: Context, tag:String, message:String, status:Logs.STATUS = STATUS.SUCCESS){ + Logs.Common.save(context,"RegisterGeofence", tag, message, status) + } + + fun list(context: Context, tag:String? = null, status:Logs.STATUS? = null):List{ + return Logs.Common.list(context,"RegisterGeofence", tag, status) + } + + fun raw(context: Context):String{ + return Logs.Common.raw(context,"RegisterGeofence"); + } + } + } + + + companion object{ + private var pref:SharedPreferences? = null + fun save(context: Context, tag:String, message:String, status:Logs.STATUS = STATUS.SUCCESS){ + Logs.Common.save(context,"Logs", tag, message, status) + } + + fun list(context: Context, tag:String? = null, status:Logs.STATUS? = null):List{ + return Logs.Common.list(context,"Logs", tag, status) + } + + fun raw(context: Context):String{ + return Logs.Common.raw(context,"Logs"); + } + + private fun storage(context: Context):SharedPreferences{ + if(pref == null) { + pref = context.getSharedPreferences(PREFS_STORAGE, Context.MODE_PRIVATE) + } + return pref!! + } + } + + private class Common{ + companion object{ + private val gson = Gson() + + fun save(context: Context, key:String, tag:String, message:String, status:Logs.STATUS = STATUS.SUCCESS){ + if(!BuildConfig.DEBUG) + return + + val pref = Logs.storage(context) + + val string = pref.getString(key,"{}") + val json = gson.fromJson(string,LogsContainerModel::class.java) + json.add( + LogModel().apply { + this.TAG = tag + this.MESSAGE = message + this.STATUS = status.name + this.DATE = DateUtils.dateTimeNow() + } + ) + + pref.edit().putString(key,gson.toJson(json)).apply() + } + + fun list(context: Context, key:String, tag:String? = null, status:Logs.STATUS? = null):List{ + val pref = Logs.storage(context) + val string = pref.getString(key,"{}") + val json = gson.fromJson(string,LogsContainerModel::class.java) + if(tag == null && status == null) { + return json.LOGS + }else if(tag != null && status != null){ + return json.LOGS.filter { (it.TAG == tag && it.STATUS == status.name) } + }else if(tag != null){ + return json.LOGS.filter { (it.TAG == tag) } + }else if(status != null){ + return json.LOGS.filter { (it.STATUS == status.name) } + } + return listOf() + } + + fun raw(context: Context, key:String):String{ + val pref = Logs.storage(context) + val string = pref.getString(key,"{}") + return string!! + } + + } + } + + class LogModel{ + lateinit var TAG:String + lateinit var MESSAGE:String + lateinit var STATUS:String + lateinit var DATE:String + + companion object{ + fun with(tag:String, message:String, status:String):LogModel{ + return LogModel().apply { + this.TAG = tag + this.MESSAGE = message + this.STATUS = status + this.DATE = DateUtils.dateTimeNow() + } + } + } + } + + class LogsContainerModel{ + var LOGS = mutableListOf() + fun add(log:LogModel){ + LOGS.add(log) + } + } + + +} \ No newline at end of file diff --git a/ios/Flutter/.last_build_id b/ios/Flutter/.last_build_id index a7923797..4e1980a7 100644 --- a/ios/Flutter/.last_build_id +++ b/ios/Flutter/.last_build_id @@ -1 +1 @@ -d9d141e787a8aa802f90b776d75f04fc \ No newline at end of file +e7c24319209ad9049a87d4c83aeeb7de \ No newline at end of file diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 77d42044..8ef5d511 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -31,6 +31,7 @@ E9A35329258B8E8F00CBA688 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = E9A35328258B8E8F00CBA688 /* GoogleService-Info.plist */; }; E9C8C136256BACDA00EFFB62 /* HMG_Guest.swift in Sources */ = {isa = PBXBuildFile; fileRef = E9C8C135256BACDA00EFFB62 /* HMG_Guest.swift */; }; E9E27168256E3A4000F49B69 /* LocalizedFromFlutter.swift in Sources */ = {isa = PBXBuildFile; fileRef = E9E27167256E3A4000F49B69 /* LocalizedFromFlutter.swift */; }; + E9F7623B25922BCE00FB5CCF /* FlutterConstants.swift in Sources */ = {isa = PBXBuildFile; fileRef = E9F7623A25922BCE00FB5CCF /* FlutterConstants.swift */; }; /* End PBXBuildFile section */ /* Begin PBXCopyFilesBuildPhase section */ @@ -82,6 +83,7 @@ E9A35328258B8E8F00CBA688 /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = ""; }; E9C8C135256BACDA00EFFB62 /* HMG_Guest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HMG_Guest.swift; sourceTree = ""; }; E9E27167256E3A4000F49B69 /* LocalizedFromFlutter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LocalizedFromFlutter.swift; sourceTree = ""; }; + E9F7623A25922BCE00FB5CCF /* FlutterConstants.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FlutterConstants.swift; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -180,6 +182,7 @@ E923EFD125863FDF00E3E751 /* GeoZoneModel.swift */, E923EFD3258645C100E3E751 /* HMG_Geofence.swift */, E923EFD52587443800E3E751 /* HMGPlatformBridge.swift */, + E9F7623A25922BCE00FB5CCF /* FlutterConstants.swift */, ); path = Helper; sourceTree = ""; @@ -378,6 +381,7 @@ E91B5396256AAA6500E96549 /* GlobalHelper.swift in Sources */, E923EFD4258645C100E3E751 /* HMG_Geofence.swift in Sources */, E923EFD62587443800E3E751 /* HMGPlatformBridge.swift in Sources */, + E9F7623B25922BCE00FB5CCF /* FlutterConstants.swift in Sources */, 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, E9E27168256E3A4000F49B69 /* LocalizedFromFlutter.swift in Sources */, 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, diff --git a/ios/Runner/AppDelegate.swift b/ios/Runner/AppDelegate.swift index d8f4c0c7..2dc828d1 100644 --- a/ios/Runner/AppDelegate.swift +++ b/ios/Runner/AppDelegate.swift @@ -7,25 +7,39 @@ var userNotificationCenterDelegate:UNUserNotificationCenterDelegate? = nil @UIApplicationMain @objc class AppDelegate: FlutterAppDelegate { let locationManager = CLLocationManager() + var flutterViewController:MainFlutterVC! override func application( _ application: UIApplication,didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { GMSServices.provideAPIKey("AIzaSyCiiJiHkocPbcziHt9O8rGWavDrxHRQys8") GeneratedPluginRegistrant.register(with: self) - - if let mainViewController = window.rootViewController as? MainFlutterVC{ - HMGPlatformBridge.initialize(flutterViewController: mainViewController) - } + initializePlatformChannel() if let _ = launchOptions?[.location] { HMG_Geofence.initGeofencing() } UNUserNotificationCenter.current().delegate = self - return super.application(application, didFinishLaunchingWithOptions: launchOptions) } + + + func initializePlatformChannel(){ + if let mainViewController = window.rootViewController as? MainFlutterVC{ // platform initialization suppose to be in foreground + flutterViewController = mainViewController + HMGPlatformBridge.initialize(flutterViewController: flutterViewController) + + }else if let mainViewController = initialViewController(){ // platform initialization suppose to be in background + flutterViewController = mainViewController + HMGPlatformBridge.initialize(flutterViewController: flutterViewController) + } + } + + + func initialViewController() -> MainFlutterVC?{ + return nil //UIStoryboard(name: "Main", bundle: .main).instantiateInitialViewController() as? MainFlutterVC + } } extension AppDelegate{ @@ -37,3 +51,18 @@ extension AppDelegate{ } } } + + +/* + let dart = FlutterDartProject(precompiledDartBundle: .main) + let engine = FlutterEngine(name: "com.hmg.cs", project: dart, allowHeadlessExecution: true) + if engine.run(){ + flutterMethodChannel = FlutterMethodChannel(name: "HMG-Platform-Bridge", binaryMessenger: engine.binaryMessenger) + + Timer.scheduledTimer(withTimeInterval: 0.5, repeats: false) { (timer) in + FlutterText.with(key: "alreadyConnectedHmgNetwork"){ localized in + print(localized) + } + } + } + */ diff --git a/ios/Runner/Helper/API.swift b/ios/Runner/Helper/API.swift index 763147c8..b487f033 100644 --- a/ios/Runner/Helper/API.swift +++ b/ios/Runner/Helper/API.swift @@ -13,5 +13,10 @@ fileprivate let BASE_URL = "\(DOMAIN)/\(SERVICE)" struct API { static let WIFI_CREDENTIALS = "\(BASE_URL)/Hmg_SMS_Get_By_ProjectID_And_PatientID" - } + + +//struct API { +// static let WIFI_CREDENTIALS = FlutterConstants.WIFI_CREDENTIALS_URL +// static let LOG_GEOFENCE = FlutterConstants.LOG_GEOFENCE_URL +//} diff --git a/ios/Runner/Helper/FlutterConstants.swift b/ios/Runner/Helper/FlutterConstants.swift new file mode 100644 index 00000000..f1b3f098 --- /dev/null +++ b/ios/Runner/Helper/FlutterConstants.swift @@ -0,0 +1,36 @@ +// +// FlutterConstants.swift +// Runner +// +// Created by ZiKambrani on 22/12/2020. +// + +import UIKit + +class FlutterConstants{ + static var LOG_GEOFENCE_URL:String? + static var WIFI_CREDENTIALS_URL:String? + static var DEFAULT_HTTP_PARAMS:[String:Any?]? + + class func set(){ + + // (FiX) Take a start with FlutterMethodChannel (kikstart) + /* First call to flutter method is not returning the correct value (Always returning 'NSObject') then after it wroking fine and returning correct value*/ + FlutterText.with(key: "test") { (test) in + + flutterMethodChannel?.invokeMethod("getDefaultHttpParameters", arguments: nil){ (response) in + if let defaultHTTPParams = response as? [String:Any?]{ + DEFAULT_HTTP_PARAMS = defaultHTTPParams + } + + } + + flutterMethodChannel?.invokeMethod("getLogGeofenceFullUrl", arguments:nil){ (response) in + if let url = response as? String{ + LOG_GEOFENCE_URL = url + } + } + + } + } +} diff --git a/ios/Runner/Helper/GlobalHelper.swift b/ios/Runner/Helper/GlobalHelper.swift index 2e323a2a..37687806 100644 --- a/ios/Runner/Helper/GlobalHelper.swift +++ b/ios/Runner/Helper/GlobalHelper.swift @@ -70,7 +70,7 @@ func userProfile() -> [String:Any?]?{ fileprivate let defaultHTTPParams:[String : Any?] = [ "ZipCode" : "966", - "VersionID" : 5.6, + "VersionID" : 5.8, "Channel" : 3, "LanguageID" : appLanguageCode(), "IPAdress" : "10.20.10.20", diff --git a/ios/Runner/Helper/HMGPlatformBridge.swift b/ios/Runner/Helper/HMGPlatformBridge.swift index f897188c..f94f9b34 100644 --- a/ios/Runner/Helper/HMGPlatformBridge.swift +++ b/ios/Runner/Helper/HMGPlatformBridge.swift @@ -49,6 +49,9 @@ class HMGPlatformBridge{ print("") } + Timer.scheduledTimer(withTimeInterval: 0.1, repeats: false) { (timer) in + FlutterConstants.set() + } } diff --git a/lib/config/config.dart b/lib/config/config.dart index 4a420ec8..10ec0b73 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -22,6 +22,9 @@ const GET_PROJECT = 'Services/Lists.svc/REST/GetProject'; const GET_GEO_ZONES = 'Services/Patients.svc/REST/GeoF_GetAllPoints'; const LOG_GEO_ZONES = 'Services/Patients.svc/REST/GeoF_InsertPatientFileInfo'; +// Wifi Credentials +const WIFI_CREDENTIALS = "Services/Patients.svc/Hmg_SMS_Get_By_ProjectID_And_PatientID"; + ///Doctor const GET_MY_DOCTOR = 'Services/Doctors.svc/REST/GetPatientDoctorAppointmentResult'; const GET_DOCTOR_PROFILE = 'Services/Doctors.svc/REST/GetDocProfiles'; @@ -199,7 +202,7 @@ const UPDATE_HEALTH_TERMS = '/services/Patients.svc/REST/UpdatePateintHealthSumm const CHANNEL = 3; const GENERAL_ID = 'Cs2020@2016\$2958'; const IP_ADDRESS = '10.20.10.20'; -const VERSION_ID = 5.6; +const VERSION_ID = 5.8; const SETUP_ID = '91877'; const LANGUAGE = 2; const PATIENT_OUT_SA = 0; @@ -306,7 +309,6 @@ class AppGlobal { Request getPublicRequest() { Request request = new Request(); - request.VersionID = 5.6; //3.6; request.Channel = 3; request.IPAdress = "10.20.10.20"; request.generalid = 'Cs2020@2016\$2958'; From f03adb37ce46c6b704689a8968d021eec3dd68cc Mon Sep 17 00:00:00 2001 From: Zohaib Kambrani Date: Sun, 27 Dec 2020 14:27:54 +0300 Subject: [PATCH 11/42] no message --- .../geofence/HMG_Geofence.kt | 76 +++++++++++-------- .../GeofenceBroadcastReceiver.kt | 5 +- .../GeofenceTransitionsJobIntentService.kt | 3 +- .../GeofencingRebootBroadcastReceiver.kt | 4 +- .../LocationProviderChangeReceiver.kt | 11 +-- .../ReregisterGeofenceJobService.kt | 9 ++- .../diplomaticquarterapp/utils/Constants.kt | 8 ++ .../diplomaticquarterapp/utils/HMGUtils.kt | 15 +--- .../cloud/diplomaticquarterapp/utils/Logs.kt | 1 - .../utils/PlatformBridge.kt | 2 +- 10 files changed, 66 insertions(+), 68 deletions(-) create mode 100644 android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/utils/Constants.kt diff --git a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/HMG_Geofence.kt b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/HMG_Geofence.kt index ba6691f7..d2fb404a 100644 --- a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/HMG_Geofence.kt +++ b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/HMG_Geofence.kt @@ -40,12 +40,6 @@ enum class GeofenceTransition(val value: Int) { } } -const val PREFS_STORAGE = "FlutterSharedPreferences" -const val PREF_KEY_SUCCESS = "HMG_GEOFENCE_SUCCESS" -const val PREF_KEY_FAILED = "HMG_GEOFENCE_FAILED" -const val PREF_KEY_HMG_ZONES = "flutter.hmg-geo-fences" -const val PREF_KEY_LANGUAGE = "flutter.language" - class HMG_Geofence { // https://developer.android.com/training/location/geofencing#java @@ -84,11 +78,42 @@ class HMG_Geofence { return geoZones_ } - fun register(geoZones: List){ + + fun register(completion:((Boolean, java.lang.Exception?)->Unit)){ + unRegisterAll { status, exception -> + val geoZones = getGeoZonesFromPreference(context) + doRegister(geoZones){ status_, error -> + completion.let { it(status_, error) } + } + } + } + + fun unRegisterAll(completion: (status: Boolean, exception: Exception?) -> Unit){ + getActiveGeofences({ success -> + removeActiveGeofences() + if(success.isNotEmpty()) + geofencingClient + .removeGeofences(success) + .addOnSuccessListener { + completion(true, null) + } + .addOnFailureListener { + completion(false, it) + saveLog(context, "error:REMOVE_GEOFENCES", it.localizedMessage) + } + else + completion(true, null) + + }, { failed -> + // Nothing to do with failed geofences. + }) + } + + private fun doRegister(geoZones: List, completion:((Boolean, java.lang.Exception?)->Unit)? = null){ if (geoZones.isEmpty()) return - var geoZones_ = limitize(geoZones) + val geoZones_ = limitize(geoZones) fun buildGeofencingRequest(geofences: List): GeofencingRequest { return GeofencingRequest.Builder() @@ -114,42 +139,27 @@ class HMG_Geofence { .addOnSuccessListener { Logs.RegisterGeofence.save(context,"SUCCESS", "Successfuly registered the geofences", Logs.STATUS.SUCCESS) saveActiveGeofence(geofences.map { it.requestId }, listOf()) + completion?.let { it(true,null) } } - .addOnFailureListener { + .addOnFailureListener { exc -> Logs.RegisterGeofence.save(context,"FAILED_TO_REGISTER", "Failed to register geofence",Logs.STATUS.ERROR) + completion?.let { it(false,exc) } } // Schedule the job to register after specified duration (due to: events not calling after long period.. days or days [Needs to register fences again]) - HMGUtils.scheduleJob(context, ReregisterGeofenceJobService::class.java,ReregisterGeofenceJobService.JobID, ReregisterGeofenceJobService.TriggerIntervalMillis) + HMGUtils.scheduleJob(context, ReregisterGeofenceJobService::class.java,ReregisterGeofenceJobService.JobID, ReregisterGeofenceJobService.TriggerIntervalDuration) } - + }, null) } - fun unRegisterAll(completion: (status: Boolean, exception: Exception?) -> Unit){ - getActiveGeofences({ success -> - val mList = success.toMutableList() - removeActiveGeofences() - geofencingClient - .removeGeofences(success) - .addOnSuccessListener { - completion(true, null) - } - .addOnFailureListener { - completion(false, it) - saveLog(context, "error:REMOVE_GEOFENCES", it.localizedMessage) - } - }, { failed -> - // Nothing to do with failed geofences. - }) - } + fun getGeoZonesFromPreference(context: Context):List{ + val pref = context.getSharedPreferences(PREFS_STORAGE, Context.MODE_PRIVATE) + val json = pref.getString(PREF_KEY_HMG_ZONES, "[]") - fun reRegister(){ - unRegisterAll { status, exception -> - val geoZones = HMGUtils.getGeoZonesFromPreference(context) - register(geoZones) - } + val geoZones = GeoZoneModel().listFrom(json) + return geoZones } fun saveActiveGeofence(success: List, failed: List){ diff --git a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/intent_receivers/GeofenceBroadcastReceiver.kt b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/intent_receivers/GeofenceBroadcastReceiver.kt index 80ef2c96..77df1572 100644 --- a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/intent_receivers/GeofenceBroadcastReceiver.kt +++ b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/intent_receivers/GeofenceBroadcastReceiver.kt @@ -9,7 +9,6 @@ import android.util.Log import com.cloud.diplomaticquarterapp.geofence.GeofenceTransition import com.cloud.diplomaticquarterapp.geofence.HMG_Geofence import com.cloud.diplomaticquarterapp.utils.Logs -import com.cloud.diplomaticquarterapp.utils.saveLog import com.google.android.gms.location.GeofenceStatusCodes import com.google.android.gms.location.GeofencingEvent @@ -42,7 +41,9 @@ class GeofenceBroadcastReceiver : BroadcastReceiver() { ) if(errorRequiredReregister.contains(errorCode)) - HMG_Geofence.shared(context).reRegister() + HMG_Geofence.shared(context).register(){ status, error -> + + } } } \ No newline at end of file diff --git a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/intent_receivers/GeofenceTransitionsJobIntentService.kt b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/intent_receivers/GeofenceTransitionsJobIntentService.kt index c008c0a5..214957cf 100755 --- a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/intent_receivers/GeofenceTransitionsJobIntentService.kt +++ b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/intent_receivers/GeofenceTransitionsJobIntentService.kt @@ -38,7 +38,6 @@ import androidx.core.app.JobIntentService import com.cloud.diplomaticquarterapp.geofence.GeofenceTransition import com.cloud.diplomaticquarterapp.geofence.HMG_Geofence import com.cloud.diplomaticquarterapp.utils.saveLog -import com.google.android.gms.location.Geofence import com.google.android.gms.location.GeofenceStatusCodes import com.google.android.gms.location.GeofencingEvent @@ -85,7 +84,7 @@ class GeofenceTransitionsJobIntentService : JobIntentService() { ) if(errorRequiredReregister.contains(errorCode)) - HMG_Geofence.shared(context).reRegister() + HMG_Geofence.shared(context).register(){ status, exc -> } } } \ No newline at end of file diff --git a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/intent_receivers/GeofencingRebootBroadcastReceiver.kt b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/intent_receivers/GeofencingRebootBroadcastReceiver.kt index 0663db3b..6421b327 100644 --- a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/intent_receivers/GeofencingRebootBroadcastReceiver.kt +++ b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/intent_receivers/GeofencingRebootBroadcastReceiver.kt @@ -6,7 +6,7 @@ import android.content.BroadcastReceiver import android.content.Context import android.content.Intent import com.cloud.diplomaticquarterapp.geofence.HMG_Geofence -import com.cloud.diplomaticquarterapp.geofence.PREFS_STORAGE +import com.cloud.diplomaticquarterapp.utils.PREFS_STORAGE class GeofencingRebootBroadcastReceiver : BroadcastReceiver(){ override fun onReceive(context: Context, intent: Intent) { @@ -16,7 +16,7 @@ class GeofencingRebootBroadcastReceiver : BroadcastReceiver(){ val pref = context.getSharedPreferences(PREFS_STORAGE, Context.MODE_PRIVATE) pref.edit().putString("REBOOT_DETECTED","YES").apply() - HMG_Geofence.shared(context).reRegister() + HMG_Geofence.shared(context).register(){ status, error -> } } } diff --git a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/intent_receivers/LocationProviderChangeReceiver.kt b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/intent_receivers/LocationProviderChangeReceiver.kt index 9de0cd6f..273ca8f5 100644 --- a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/intent_receivers/LocationProviderChangeReceiver.kt +++ b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/intent_receivers/LocationProviderChangeReceiver.kt @@ -6,13 +6,9 @@ import android.content.BroadcastReceiver import android.content.Context import android.content.Intent import android.location.LocationManager -import android.util.Log -import com.cloud.diplomaticquarterapp.geofence.GeofenceTransition import com.cloud.diplomaticquarterapp.geofence.HMG_Geofence -import com.cloud.diplomaticquarterapp.geofence.PREFS_STORAGE import com.cloud.diplomaticquarterapp.utils.HMGUtils -import com.cloud.diplomaticquarterapp.utils.saveLog -import com.google.android.gms.location.GeofencingEvent +import com.cloud.diplomaticquarterapp.utils.PREFS_STORAGE class LocationProviderChangeReceiver : BroadcastReceiver() { private val LOG_TAG = "LocationProviderChangeReceiver" @@ -22,10 +18,7 @@ class LocationProviderChangeReceiver : BroadcastReceiver() { val pref = context.getSharedPreferences(PREFS_STORAGE, Context.MODE_PRIVATE) pref.edit().putString("LOCATION_PROVIDER_CHANGE","YES").apply() - HMG_Geofence.shared(context).unRegisterAll { status, exception -> - val geoZones = HMGUtils.getGeoZonesFromPreference(context) - HMG_Geofence.shared(context).register(geoZones) - } + HMG_Geofence.shared(context).register(){ s, e -> } } } diff --git a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/intent_receivers/ReregisterGeofenceJobService.kt b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/intent_receivers/ReregisterGeofenceJobService.kt index 043c5c96..0bc496bc 100644 --- a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/intent_receivers/ReregisterGeofenceJobService.kt +++ b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/intent_receivers/ReregisterGeofenceJobService.kt @@ -4,16 +4,17 @@ import android.app.job.JobParameters import android.app.job.JobService import com.cloud.diplomaticquarterapp.geofence.HMG_Geofence import com.cloud.diplomaticquarterapp.utils.Logs -import com.cloud.diplomaticquarterapp.utils.timeToMillis class ReregisterGeofenceJobService : JobService(){ companion object{ - val TriggerIntervalMillis:String = "24:00:00" + val TriggerIntervalDuration:String = "06:00:00" val JobID = 918273 } override fun onStartJob(params: JobParameters?): Boolean { - HMG_Geofence.shared(applicationContext).reRegister() - Logs.save(applicationContext,"ReregisterGeofenceJobService.onStartJob", "triggered to re-register the geofences after $TriggerIntervalMillis >> [HH:mm:ss]") + Logs.save(applicationContext,"ReregisterGeofenceJobService.onStartJob", "triggered to re-register the geofences after $TriggerIntervalDuration >> [HH:mm:ss]") + HMG_Geofence.shared(applicationContext).register(){ status, error -> + jobFinished(params, true) + } return true } diff --git a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/utils/Constants.kt b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/utils/Constants.kt new file mode 100644 index 00000000..aa0f8ec2 --- /dev/null +++ b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/utils/Constants.kt @@ -0,0 +1,8 @@ +package com.cloud.diplomaticquarterapp.utils + + +const val PREFS_STORAGE = "FlutterSharedPreferences" +const val PREF_KEY_SUCCESS = "HMG_GEOFENCE_SUCCESS" +const val PREF_KEY_FAILED = "HMG_GEOFENCE_FAILED" +const val PREF_KEY_HMG_ZONES = "flutter.hmg-geo-fences" +const val PREF_KEY_LANGUAGE = "flutter.language" \ No newline at end of file diff --git a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/utils/HMGUtils.kt b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/utils/HMGUtils.kt index 7880a7ef..1c661c19 100644 --- a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/utils/HMGUtils.kt +++ b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/utils/HMGUtils.kt @@ -11,17 +11,11 @@ import android.content.Intent import android.os.Build import android.widget.Toast import androidx.annotation.Nullable -import androidx.annotation.RequiresApi import androidx.core.app.NotificationCompat import androidx.core.app.TaskStackBuilder import com.cloud.diplomaticquarterapp.BuildConfig import com.cloud.diplomaticquarterapp.MainActivity import com.cloud.diplomaticquarterapp.R -import com.cloud.diplomaticquarterapp.geofence.GeoZoneModel -import com.cloud.diplomaticquarterapp.geofence.PREFS_STORAGE -import com.cloud.diplomaticquarterapp.geofence.PREF_KEY_HMG_ZONES -import com.cloud.diplomaticquarterapp.geofence.PREF_KEY_LANGUAGE -import com.cloud.diplomaticquarterapp.geofence.intent_receivers.ReregisterGeofenceJobService import com.github.kittinunf.fuel.core.extensions.jsonBody import com.github.kittinunf.fuel.httpPost import com.google.gson.Gson @@ -75,14 +69,6 @@ class HMGUtils { } } - fun getGeoZonesFromPreference(context: Context):List{ - val pref = context.getSharedPreferences(PREFS_STORAGE, Context.MODE_PRIVATE) - val json = pref.getString(PREF_KEY_HMG_ZONES, "[]") - - val geoZones = GeoZoneModel().listFrom(json) - return geoZones - } - fun getLanguageCode(context: Context) : Int{ val pref = context.getSharedPreferences(PREFS_STORAGE, Context.MODE_PRIVATE) val lang = pref.getString(PREF_KEY_LANGUAGE, "ar") @@ -111,6 +97,7 @@ class HMGUtils { val serviceComponent = ComponentName(context, pendingIntentClassType) val builder = JobInfo.Builder(jobId, serviceComponent) builder.setPersisted(true) + builder.setBackoffCriteria(30000, JobInfo.BACKOFF_POLICY_LINEAR) val intervalMillis = timeToMillis(intervalDuration,"HH:mm:ss") builder.setMinimumLatency(intervalMillis) // wait at least diff --git a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/utils/Logs.kt b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/utils/Logs.kt index 5c11943e..e74f463e 100644 --- a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/utils/Logs.kt +++ b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/utils/Logs.kt @@ -4,7 +4,6 @@ import android.content.Context import android.content.SharedPreferences import android.os.Build import com.cloud.diplomaticquarterapp.BuildConfig -import com.cloud.diplomaticquarterapp.geofence.PREFS_STORAGE import com.google.gson.Gson class Logs { diff --git a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/utils/PlatformBridge.kt b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/utils/PlatformBridge.kt index ed1a62c8..eb2fff08 100644 --- a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/utils/PlatformBridge.kt +++ b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/utils/PlatformBridge.kt @@ -105,7 +105,7 @@ class PlatformBridge(binaryMessenger: BinaryMessenger, flutterMainActivity: Main override fun success(result: Any?) { if(result is String) { val geoZones = GeoZoneModel().listFrom(result) - HMG_Geofence.shared(mainActivity).register(geoZones) + HMG_Geofence.shared(mainActivity).register(){ s, e -> } } } From 52fa0f6f8966e7e1d80c3d77a3012da4c625d195 Mon Sep 17 00:00:00 2001 From: Fatimah Alshammari Date: Tue, 12 Jan 2021 14:47:06 +0300 Subject: [PATCH 12/42] fixed orders --- lib/config/config.dart | 1 + lib/config/localized_values.dart | 1 + lib/core/model/pharmacies/Prescriptions.dart | 157 ++++++++ lib/core/model/pharmacies/order_model.dart | 3 + lib/core/model/pharmacies/orders_model.dart | 68 ++++ .../parmacyModule/parmacy_module_service.dart | 5 + .../parmacyModule/prescription_service.dart | 53 +++ .../order_model_view_model.dart | 3 +- .../pharmacy_module_view_model.dart | 35 ++ lib/locator.dart | 5 + .../screens/pharmacy_module_page.dart | 339 +++++++++++++++--- lib/pages/pharmacy/order/Order.dart | 86 ++--- lib/pages/pharmacy/order/OrderDetails.dart | 1 + lib/pages/pharmacy/profile/profile.dart | 10 +- .../orderDetails_service.dart | 1 + .../pharmacy_services/order_service.dart | 52 +-- lib/uitl/translations_delegate_base.dart | 1 + 17 files changed, 698 insertions(+), 123 deletions(-) create mode 100644 lib/core/model/pharmacies/Prescriptions.dart create mode 100644 lib/core/model/pharmacies/orders_model.dart create mode 100644 lib/core/service/parmacyModule/prescription_service.dart diff --git a/lib/config/config.dart b/lib/config/config.dart index abd1cee2..caf0bd5b 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -390,6 +390,7 @@ const TRANSFER_YAHALA_LOYALITY_POINTS = "Services/Patients.svc/REST/TransferYaHalaLoyaltyPoints"; const LAKUM_GET_USER_TERMS_AND_CONDITIONS = "Services/ERP.svc/REST/GetUserTermsAndConditionsForEPharmcy"; +const PRESCRIPTION = 'Services/Patients.svc/REST/GetPrescriptionApptList'; // Home Health Care const HHC_GET_ALL_SERVICES = diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index b60a0f45..95711339 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -660,6 +660,7 @@ const Map localizedValues = { "cancelledOrder": {"en": " CANCELLED", "ar": "ملغي"}, "compare": {"en": " Compare", "ar": "مقارنه"}, "medicationsRefill": {"en": " Medication Refill", "ar": "طلب أعادة صرف"}, + "recommended": {"en": " Recommended For You", "ar": "موصى لك"}, "myPrescription": {"en": " My Prescriptions", "ar": "وصفاتي"}, "quantity": {"en": " QTY ", "ar": "الكمية"}, "backMyAccount": { diff --git a/lib/core/model/pharmacies/Prescriptions.dart b/lib/core/model/pharmacies/Prescriptions.dart new file mode 100644 index 00000000..80caff0a --- /dev/null +++ b/lib/core/model/pharmacies/Prescriptions.dart @@ -0,0 +1,157 @@ + + +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; + +class Prescriptions { + String setupID; + int projectID; + int patientID; + int appointmentNo; + String appointmentDate; + String doctorName; + String clinicDescription; + String name; + int episodeID; + int actualDoctorRate; + int admission; + int clinicID; + String companyName; + String despensedStatus; + DateTime dischargeDate; + int dischargeNo; + int doctorID; + String doctorImageURL; + int doctorRate; + String doctorTitle; + int gender; + String genderDescription; + bool isActiveDoctorProfile; + bool isDoctorAllowVedioCall; + bool isExecludeDoctor; + bool isInOutPatient; + String isInOutPatientDescription; + String isInOutPatientDescriptionN; + bool isInsurancePatient; + String nationalityFlagURL; + int noOfPatientsRate; + String qR; + List speciality; + + Prescriptions( + {this.setupID, + this.projectID, + this.patientID, + this.appointmentNo, + this.appointmentDate, + this.doctorName, + this.clinicDescription, + this.name, + this.episodeID, + this.actualDoctorRate, + this.admission, + this.clinicID, + this.companyName, + this.despensedStatus, + this.dischargeDate, + this.dischargeNo, + this.doctorID, + this.doctorImageURL, + this.doctorRate, + this.doctorTitle, + this.gender, + this.genderDescription, + this.isActiveDoctorProfile, + this.isDoctorAllowVedioCall, + this.isExecludeDoctor, + this.isInOutPatient, + this.isInOutPatientDescription, + this.isInOutPatientDescriptionN, + this.isInsurancePatient, + this.nationalityFlagURL, + this.noOfPatientsRate, + this.qR, + this.speciality}); + + Prescriptions.fromJson(Map json) { + setupID = json['SetupID']; + projectID = json['ProjectID']; + patientID = json['PatientID']; + appointmentNo = json['AppointmentNo']; + appointmentDate = json['AppointmentDate']; + doctorName = json['DoctorName']; + clinicDescription = json['ClinicDescription']; + name = json['Name']; + episodeID = json['EpisodeID']; + actualDoctorRate = json['ActualDoctorRate']; + admission = json['Admission']; + clinicID = json['ClinicID']; + companyName = json['CompanyName']; + despensedStatus = json['Despensed_Status']; + dischargeDate = DateUtil.convertStringToDate(json['DischargeDate']); + dischargeNo = json['DischargeNo']; + doctorID = json['DoctorID']; + doctorImageURL = json['DoctorImageURL']; + doctorRate = json['DoctorRate']; + doctorTitle = json['DoctorTitle']; + gender = json['Gender']; + genderDescription = json['GenderDescription']; + isActiveDoctorProfile = json['IsActiveDoctorProfile']; + isDoctorAllowVedioCall = json['IsDoctorAllowVedioCall']; + isExecludeDoctor = json['IsExecludeDoctor']; + isInOutPatient = json['IsInOutPatient']; + isInOutPatientDescription = json['IsInOutPatientDescription']; + isInOutPatientDescriptionN = json['IsInOutPatientDescriptionN']; + isInsurancePatient = json['IsInsurancePatient']; + nationalityFlagURL = json['NationalityFlagURL']; + noOfPatientsRate = json['NoOfPatientsRate']; + qR = json['QR']; + // speciality = json['Speciality'].cast(); + } + + Map toJson() { + final Map data = new Map(); + data['SetupID'] = this.setupID; + data['ProjectID'] = this.projectID; + data['PatientID'] = this.patientID; + data['AppointmentNo'] = this.appointmentNo; + data['AppointmentDate'] = this.appointmentDate; + data['DoctorName'] = this.doctorName; + data['ClinicDescription'] = this.clinicDescription; + data['Name'] = this.name; + data['EpisodeID'] = this.episodeID; + data['ActualDoctorRate'] = this.actualDoctorRate; + data['Admission'] = this.admission; + data['ClinicID'] = this.clinicID; + data['CompanyName'] = this.companyName; + data['Despensed_Status'] = this.despensedStatus; + data['DischargeDate'] = this.dischargeDate; + data['DischargeNo'] = this.dischargeNo; + data['DoctorID'] = this.doctorID; + data['DoctorImageURL'] = this.doctorImageURL; + data['DoctorRate'] = this.doctorRate; + data['DoctorTitle'] = this.doctorTitle; + data['Gender'] = this.gender; + data['GenderDescription'] = this.genderDescription; + data['IsActiveDoctorProfile'] = this.isActiveDoctorProfile; + data['IsDoctorAllowVedioCall'] = this.isDoctorAllowVedioCall; + data['IsExecludeDoctor'] = this.isExecludeDoctor; + data['IsInOutPatient'] = this.isInOutPatient; + data['IsInOutPatientDescription'] = this.isInOutPatientDescription; + data['IsInOutPatientDescriptionN'] = this.isInOutPatientDescriptionN; + data['IsInsurancePatient'] = this.isInsurancePatient; + data['NationalityFlagURL'] = this.nationalityFlagURL; + data['NoOfPatientsRate'] = this.noOfPatientsRate; + data['QR'] = this.qR; + data['Speciality'] = this.speciality; + return data; + } +} + +//class PrescriptionsList { +// String filterName = ""; +// List prescriptionsList = List(); +// +// PrescriptionsList({this.filterName, Prescriptions prescriptions}) { +// prescriptionsList.add(prescriptions); +// } +//} diff --git a/lib/core/model/pharmacies/order_model.dart b/lib/core/model/pharmacies/order_model.dart index 027d1f81..5b958e43 100644 --- a/lib/core/model/pharmacies/order_model.dart +++ b/lib/core/model/pharmacies/order_model.dart @@ -31,6 +31,7 @@ class OrderModel { this.taxRates, this.orderTax, this.orderDiscount, + this.productCount, this.orderTotal, this.refundedAmount, this.rewardPointsWereAdded, @@ -95,6 +96,7 @@ class OrderModel { String taxRates; double orderTax; dynamic orderDiscount; + dynamic productCount; double orderTotal; dynamic refundedAmount; dynamic rewardPointsWereAdded; @@ -159,6 +161,7 @@ class OrderModel { taxRates: json["tax_rates"], orderTax: json["order_tax"].toDouble(), orderDiscount: json["order_discount"], + productCount: json["product_count"], orderTotal: json["order_total"].toDouble(), refundedAmount: json["refunded_amount"], rewardPointsWereAdded: json["reward_points_were_added"], diff --git a/lib/core/model/pharmacies/orders_model.dart b/lib/core/model/pharmacies/orders_model.dart new file mode 100644 index 00000000..aaddf6f4 --- /dev/null +++ b/lib/core/model/pharmacies/orders_model.dart @@ -0,0 +1,68 @@ +class OrdersModel { + List orders; + + OrdersModel({this.orders}); + + OrdersModel.fromJson(Map json) { + if (json['orders'] != null) { + orders = new List(); + json['orders'].forEach((v) { + orders.add(new Orders.fromJson(v)); + }); + } + } + + Map toJson() { + final Map data = new Map(); + if (this.orders != null) { + data['orders'] = this.orders.map((v) => v.toJson()).toList(); + } + return data; + } +} + +class Orders { + String id; + int productCount; + double orderTotal; + String createdOnUtc; + int orderStatusId; + String orderStatus; + String orderStatusn; + + Orders( + {this.id, + this.productCount, + this.orderTotal, + this.createdOnUtc, + this.orderStatusId, + this.orderStatus, + this.orderStatusn}); + + Orders.fromJson(Map json) { + try { + id = json['id']; + productCount = json['product_count']; + orderTotal = json['order_total']; + createdOnUtc = json['created_on_utc']; + orderStatusId = json['order_status_id']; + orderStatus = json['order_status']; + orderStatusn = json['order_statusn']; + }catch(e){ + print(e); + } + + } + + Map toJson() { + final Map data = new Map(); + data['id'] = this.id; + data['product_count'] = this.productCount; + data['order_total'] = this.orderTotal; + data['created_on_utc'] = this.createdOnUtc; + data['order_status_id'] = this.orderStatusId; + data['order_status'] = this.orderStatus; + data['order_statusn'] = this.orderStatusn; + return data; + } +} diff --git a/lib/core/service/parmacyModule/parmacy_module_service.dart b/lib/core/service/parmacyModule/parmacy_module_service.dart index c3bce324..7f0a1050 100644 --- a/lib/core/service/parmacyModule/parmacy_module_service.dart +++ b/lib/core/service/parmacyModule/parmacy_module_service.dart @@ -6,17 +6,21 @@ import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyProduct.dart' import 'package:diplomaticquarterapp/core/service/base_service.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; + class PharmacyModuleService extends BaseService { final AppSharedPreferences sharedPref = AppSharedPreferences(); bool isFinished = true; bool hasError = false; String errorMsg = ''; + String url =""; List bannerItems = List(); List manufacturerList = List(); List bestSellerProducts = List(); List lastVisitedProducts = List(); + + Future makeVerifyCustomer(dynamic data) async { Map queryParams = {'FileNumber': data['PatientID'].toString()}; hasError = false; @@ -148,4 +152,5 @@ class PharmacyModuleService extends BaseService { } } } + } diff --git a/lib/core/service/parmacyModule/prescription_service.dart b/lib/core/service/parmacyModule/prescription_service.dart new file mode 100644 index 00000000..d03111a0 --- /dev/null +++ b/lib/core/service/parmacyModule/prescription_service.dart @@ -0,0 +1,53 @@ + +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/core/service/base_service.dart'; +import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; +import 'package:diplomaticquarterapp/core/model/pharmacies/Prescriptions.dart'; + + +class PrescriptionService extends BaseService { + final AppSharedPreferences sharedPref = AppSharedPreferences(); + bool isFinished = true; + bool hasError = false; + String errorMsg = ''; + String url = ""; + + List _prescriptionsList = List(); + List get prescriptionsList => _prescriptionsList; + + + Future getPrescription() async { + hasError = false; + url = PRESCRIPTION; + print("Print PRESCRIPTION url" + url); + await baseAppClient.getPharmacy(url, + onSuccess: (dynamic response, int statusCode) { + _prescriptionsList.clear(); + response['PatientPrescriptionList'].forEach((item) { + _prescriptionsList.add(Prescriptions.fromJson(item)); + }); + print(_prescriptionsList.length); + print(response); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }); + } +// Future getPrescription() async { +// hasError = false; +// Map body = Map(); +// body['isDentalAllowedBackend'] = false; +// await baseAppClient.post(PRESCRIPTION, +// onSuccess: (dynamic response, int statusCode) { +// prescriptionsList.clear(); +// response['PatientPrescriptionList'].forEach((prescriptions) { +// prescriptionsList.add(Prescriptions.fromJson(prescriptions)); +// }); +// }, onFailure: (String error, int statusCode) { +// hasError = true; +// super.error = error; +// }, body: body); +// } + +} \ No newline at end of file diff --git a/lib/core/viewModels/pharmacyModule/order_model_view_model.dart b/lib/core/viewModels/pharmacyModule/order_model_view_model.dart index b7ddb528..5f36e9f6 100644 --- a/lib/core/viewModels/pharmacyModule/order_model_view_model.dart +++ b/lib/core/viewModels/pharmacyModule/order_model_view_model.dart @@ -10,6 +10,7 @@ import 'package:diplomaticquarterapp/services/pharmacy_services/cancelOrder_serv import 'package:diplomaticquarterapp/services/pharmacy_services/orderDetails_service.dart'; import 'package:diplomaticquarterapp/services/pharmacy_services/order_service.dart'; import 'package:diplomaticquarterapp/core/model/pharmacies/order_model.dart'; +import 'package:diplomaticquarterapp/core/model/pharmacies/orders_model.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:flutter/material.dart'; import '../../../locator.dart'; @@ -18,7 +19,7 @@ import '../base_view_model.dart'; class OrderModelViewModel extends BaseViewModel { OrderService _orderService = locator(); - List get order => _orderService.orderList; + List get orders => _orderService.orderList; OrderDetailsService _orderDetailsService = locator(); diff --git a/lib/core/viewModels/pharmacyModule/pharmacy_module_view_model.dart b/lib/core/viewModels/pharmacyModule/pharmacy_module_view_model.dart index 4dfc6a26..bee7f654 100644 --- a/lib/core/viewModels/pharmacyModule/pharmacy_module_view_model.dart +++ b/lib/core/viewModels/pharmacyModule/pharmacy_module_view_model.dart @@ -3,7 +3,11 @@ import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/model/pharmacies/Manufacturer.dart'; import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyImageObject.dart'; import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyProduct.dart'; +import 'package:diplomaticquarterapp/core/model/pharmacies/Prescriptions.dart'; +//import 'package:diplomaticquarterapp/core/model/prescriptions/perscription_pharmacy.dart'; +//import 'package:diplomaticquarterapp/core/service/medical/prescriptions_service.dart'; import 'package:diplomaticquarterapp/core/service/parmacyModule/parmacy_module_service.dart'; +import 'package:diplomaticquarterapp/core/service/parmacyModule/prescription_service.dart'; import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; import '../../../locator.dart'; @@ -11,6 +15,8 @@ import '../../../locator.dart'; class PharmacyModuleViewModel extends BaseViewModel { PharmacyModuleService _pharmacyService = locator(); + PrescriptionService _prescriptionService = locator(); + List get bannerList => _pharmacyService.bannerItems; List get manufacturerList => _pharmacyService.manufacturerList; @@ -21,6 +27,11 @@ class PharmacyModuleViewModel extends BaseViewModel { List get lastVisitedProducts => _pharmacyService.lastVisitedProducts; + List get prescriptionsList => + _prescriptionService.prescriptionsList; + +// List get pharmacyPrescriptionsList => PharmacyProduct.pharmacyPrescriptionsList ; + Future getPharmacyHomeData() async { setState(ViewState.Busy); var data = await sharedPref.getObject(USER_PROFILE); @@ -92,6 +103,17 @@ class PharmacyModuleViewModel extends BaseViewModel { } } + /////////////RecommendedProducts +// _getRecommendedProducts() async { +// await _pharmacyService.getRecommendedProducts(); +// if (_pharmacyService.hasError) { +// error = _pharmacyService.error; +// setState(ViewState.Error); +// } else { +// setState(ViewState.Idle); +// } +// } + Future checkUserIsActivated() async { if (authenticatedUserObject.isLogin) { var customerId = await sharedPref.getString(PHARMACY_CUSTOMER_ID); @@ -105,4 +127,17 @@ class PharmacyModuleViewModel extends BaseViewModel { return false; } } + + getPrescription() async { + print("Print PRESCRIPTION url"); + setState(ViewState.Busy); + await _prescriptionService.getPrescription(); + if (_prescriptionService.hasError) { + error = _prescriptionService.error; + setState(ViewState.Error); + } else { + setState(ViewState.Idle); + } + } + } diff --git a/lib/locator.dart b/lib/locator.dart index c6ef1b32..12510f8a 100644 --- a/lib/locator.dart +++ b/lib/locator.dart @@ -1,4 +1,5 @@ import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/H2O_service.dart'; +import 'package:diplomaticquarterapp/core/service/parmacyModule/prescription_service.dart'; import 'package:diplomaticquarterapp/core/service/qr_service.dart'; import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/H2O_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/child_vaccines/user_information_view_model.dart'; @@ -192,6 +193,10 @@ void setupLocator() { locator.registerLazySingleton(() => CustomerAddressesService()); locator.registerLazySingleton(() => TermsConditionService()); locator.registerLazySingleton(() => CancelOrderService()); + locator.registerLazySingleton(() => PrescriptionService()); + + + /// View Model locator.registerFactory(() => HospitalViewModel()); diff --git a/lib/pages/pharmacies/screens/pharmacy_module_page.dart b/lib/pages/pharmacies/screens/pharmacy_module_page.dart index 32a610f8..eb368cfa 100644 --- a/lib/pages/pharmacies/screens/pharmacy_module_page.dart +++ b/lib/pages/pharmacies/screens/pharmacy_module_page.dart @@ -2,6 +2,7 @@ import 'package:diplomaticquarterapp/config/size_config.dart'; import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/pharmacy_module_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/landing/home_page.dart'; +import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescriptions_home_page.dart'; import 'package:diplomaticquarterapp/pages/offers_categorise_page.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/screens/cart-order-page.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/screens/lakum-main-page.dart'; @@ -14,10 +15,21 @@ import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; - +import 'package:flutter_svg/svg.dart'; +import 'package:rating_bar/rating_bar.dart'; import 'lacum-activitaion-vida-page.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/medical/doctor_card.dart'; +import 'package:diplomaticquarterapp/core/viewModels/medical/prescriptions_view_model.dart'; class PharmacyPage extends StatelessWidget { + + @override + void initState() { +// print("model prescription " + model.prescriptionsList.length); + +// cancelOrderDetail(order) + } + @override Widget build(BuildContext context) { return BaseView( @@ -37,6 +49,219 @@ class PharmacyPage extends StatelessWidget { children: [ BannerPager(model), GridViewButtons(model), + Container( + margin: EdgeInsets.fromLTRB(10, 10, 10, 10), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Texts( + TranslationBase.of(context).myPrescription, + bold: true, + ), + BorderedButton( + TranslationBase.of(context).viewAll, + hasBorder: true, + borderColor: Colors.green, + textColor: Colors.green, + vPadding: 6, + hPadding: 4, + handler: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => HomePrescriptionsPage())); + }, + ), + ], + ), + ), +// model.getPrescription(), + Container( + padding: EdgeInsets.symmetric(horizontal: 16.0, vertical: 24.0), + height: MediaQuery.of(context).size.height * 0.30, +// width: 200.0, +// height: MediaQuery.of(context).size.height / 4 + 20, + margin: EdgeInsets.only(left: 10), +// model.getPrescription(); + child: ListView.builder( + scrollDirection: Axis.horizontal, + shrinkWrap: true, + physics: ScrollPhysics(), +// physics: NeverScrollableScrollPhysics(), +// itemCount: 4, + itemCount: model.prescriptionsList.length, + itemBuilder: (context, index){ + return + Container( +// width: 160.0, + height: MediaQuery.of(context).size.height * 0.6, + padding: EdgeInsets.only(bottom: 5.0, left: 5.0), + margin: EdgeInsets.only(right: 10.0), + decoration: BoxDecoration( + border: Border.all( + color: Colors.grey, + style: BorderStyle.solid, + width: 1.0, + ), + color: Colors.white, + borderRadius: BorderRadius.circular(10.0) + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + Column( + children: [ + Container( + padding:EdgeInsets.only(top:10.0, left:10.0, right:3.0, bottom:15.0,), + child: Image.network( + model.prescriptionsList[index].doctorImageURL, + width: 60, + height: 60, + ), + ),] + ), + Column( +// crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Container( + margin: EdgeInsets.only(left: 1), + padding: EdgeInsets.only(left: 15.0, right: 15.0), + decoration: BoxDecoration( + border: Border.all( + color: Colors.green, + style: BorderStyle.solid, + width: 4.0, + ), + color: Colors.green, + borderRadius: BorderRadius.circular(30.0) + ), + + child:Text(model.prescriptionsList[index].isInOutPatientDescription.toString(), + style: TextStyle( + color: Colors.white, + fontSize: 15.0, +// fontWeight: FontWeight.bold, + ), + ) + ), + Row( + children: [ + Image.asset( + 'assets/images/Icon-awesome-calendar.png', + width: 30, + height: 30, + ), + Text(model.prescriptionsList[index].appointmentDate.toString(), + style: TextStyle( + color: Colors.black, + fontSize: 15.0, +// fontWeight: FontWeight.bold, + ), + ) + ] + ), + ], + ), + ], + ), + Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + margin: EdgeInsets.only(left: 5), + child: Row( + children: [ + Text(model.prescriptionsList[index].doctorTitle.toString(), + style: TextStyle( + color: Colors.black, + fontSize: 15.0, + fontWeight: FontWeight.bold, + ),), + Text(model.prescriptionsList[index].doctorName.toString(), + style: TextStyle( + color: Colors.black, + fontSize: 15.0, + fontWeight: FontWeight.bold, + ),), + ] ), + ), + ], + ), + Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + margin: EdgeInsets.only(left: 5), + child: Text(model.prescriptionsList[index].clinicDescription.toString(), + style: TextStyle( + color: Colors.green, + fontSize: 15.0, +// fontWeight: FontWeight.bold, + ),), + ), + ], + ), + Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + margin: EdgeInsets.only(left: 5), + child: Align( + alignment: Alignment.topLeft, + child: RatingBar.readOnly( +// initialRating: productRate, + size: 15.0, + filledColor: Colors.yellow[700], + emptyColor: Colors.grey[500], + isHalfAllowed: true, + halfFilledIcon: Icons.star_half, + filledIcon: Icons.star, + emptyIcon: Icons.star, + ), + ), + ) + ] + ), + ] + ), + ); + } + ), + ), + + Container( + margin: EdgeInsets.fromLTRB(10, 10, 10, 10), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Texts( + TranslationBase.of(context).recommended, + bold: true, + ), + BorderedButton( + TranslationBase.of(context).viewAll, + hasBorder: true, + borderColor: Colors.green, + textColor: Colors.green, + vPadding: 6, + hPadding: 4, + handler: () {}, + ), + ], + ), + ), + Container( + height: MediaQuery.of(context).size.height / 4 + 20, + child: ListView.builder( + itemBuilder: (ctx, i) => + ProductTileItem(model.bestSellerProduct[i]), + scrollDirection: Axis.horizontal, + itemCount: model.bestSellerProduct.length, + ), + ), + Container( margin: EdgeInsets.fromLTRB(10, 0, 10, 0), child: Row( @@ -147,62 +372,62 @@ class GridViewButtons extends StatelessWidget { Widget build(BuildContext context) { final gridHeight = (MediaQuery.of(context).size.width * 0.3) * 1.8; return Container( - child: SizedBox( - height: gridHeight, - child: GridView.count( - childAspectRatio: 2.2, - crossAxisSpacing: 10, - mainAxisSpacing: 10, - controller: new ScrollController(keepScrollOffset: false), - shrinkWrap: true, - padding: const EdgeInsets.all(4.0), - crossAxisCount: 2, - children: [ - DashboardItem( - imageName: 'pharmacy_module/bg_1.png', - hasColorFilter: false, - opacity: 0.8, - child: GridViewCard( - TranslationBase.of(context).offersAndPromotions, - 'assets/images/pharmacy_module/offer_icon.png', () { - Navigator.push(context, FadePage(page: OffersCategorisePage())); - }), - ), - DashboardItem( - imageName: 'pharmacy_module/bg_2.png', - opacity: 0, - hasColorFilter: false, - child: GridViewCard(TranslationBase.of(context).medicationRefill, - 'assets/images/pharmacy_module/medication_icon.png', () { - model.checkUserIsActivated().then((isActivated) { - if (isActivated) { - Navigator.push(context, FadePage(page: LakumMainPage())); - } else { - Navigator.push( - context, FadePage(page: LakumActivationVidaPage())); - } - }); - }), - ), - DashboardItem( - imageName: 'pharmacy_module/bg_3.png', - opacity: 0, - hasColorFilter: false, - child: GridViewCard(TranslationBase.of(context).myPrescriptions, - 'assets/images/pharmacy_module/prescription_icon.png', () {}), - ), - DashboardItem( - imageName: 'pharmacy_module/bg_4.png', - opacity: 0, - hasColorFilter: false, - child: GridViewCard( - TranslationBase.of(context).searchAndScanMedication, - 'assets/images/pharmacy_module/search_scan_icon.png', - () {}), - ), - ], - ), - ), +// child: SizedBox( +// height: gridHeight, +// child: GridView.count( +// childAspectRatio: 2.2, +// crossAxisSpacing: 10, +// mainAxisSpacing: 10, +// controller: new ScrollController(keepScrollOffset: false), +// shrinkWrap: true, +// padding: const EdgeInsets.all(4.0), +// crossAxisCount: 2, +// children: [ +// DashboardItem( +// imageName: 'pharmacy_module/bg_1.png', +// hasColorFilter: false, +// opacity: 0.8, +// child: GridViewCard( +// TranslationBase.of(context).offersAndPromotions, +// 'assets/images/pharmacy_module/offer_icon.png', () { +// Navigator.push(context, FadePage(page: OffersCategorisePage())); +// }), +// ), +// DashboardItem( +// imageName: 'pharmacy_module/bg_2.png', +// opacity: 0, +// hasColorFilter: false, +// child: GridViewCard(TranslationBase.of(context).medicationRefill, +// 'assets/images/pharmacy_module/medication_icon.png', () { +// model.checkUserIsActivated().then((isActivated) { +// if (isActivated) { +// Navigator.push(context, FadePage(page: LakumMainPage())); +// } else { +// Navigator.push( +// context, FadePage(page: LakumActivationVidaPage())); +// } +// }); +// }), +// ), +// DashboardItem( +// imageName: 'pharmacy_module/bg_3.png', +// opacity: 0, +// hasColorFilter: false, +// child: GridViewCard(TranslationBase.of(context).myPrescriptions, +// 'assets/images/pharmacy_module/prescription_icon.png', () {}), +// ), +// DashboardItem( +// imageName: 'pharmacy_module/bg_4.png', +// opacity: 0, +// hasColorFilter: false, +// child: GridViewCard( +// TranslationBase.of(context).searchAndScanMedication, +// 'assets/images/pharmacy_module/search_scan_icon.png', +// () {}), +// ), +// ], +// ), +// ), ); } } diff --git a/lib/pages/pharmacy/order/Order.dart b/lib/pages/pharmacy/order/Order.dart index 576bf2a0..e472aa18 100644 --- a/lib/pages/pharmacy/order/Order.dart +++ b/lib/pages/pharmacy/order/Order.dart @@ -9,6 +9,7 @@ import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/services/pharmacy_services/order_service.dart'; import 'package:diplomaticquarterapp/pages/pharmacy/order/OrderDetails.dart'; import 'package:diplomaticquarterapp/core/model/pharmacies/order_model.dart'; +import 'package:diplomaticquarterapp/core/model/pharmacies/orders_model.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; @@ -31,11 +32,11 @@ class _OrderPageState extends State with SingleTickerProviderStateMix String customerId = ""; String order =""; - List orderList = [] ; - List deliveredOrderList = [] ; - List processingOrderList = []; - List cancelledOrderList = []; - List pendingOrderList = []; + List orderList = [] ; + List deliveredOrderList = [] ; + List processingOrderList = []; + List cancelledOrderList = []; + List pendingOrderList = []; TabController _tabController; // AppSharedPreferences sharedPref = AppSharedPreferences(); @@ -66,6 +67,8 @@ class _OrderPageState extends State with SingleTickerProviderStateMix child: Column( children: [ TabBar( + labelPadding: + EdgeInsets.only(left: 3.0, right: 3.0), tabs: [ Tab(text: TranslationBase.of(context).delivered), Tab(text: TranslationBase.of(context).processing), @@ -103,16 +106,16 @@ class _OrderPageState extends State with SingleTickerProviderStateMix Widget getDeliveredOrder(OrderModelViewModel model){ - for(int i=0 ; i< model.order.length; i++){ - if( model.order[i].orderStatusId == 30 || model.order[i].orderStatusId == 997 - || model.order[i].orderStatusId == 994 + for(int i=0 ; i< model.orders.length; i++){ + if( model.orders[i].orderStatusId == 30 || model.orders[i].orderStatusId == 997 + || model.orders[i].orderStatusId == 994 ){ - deliveredOrderList.add(model.order[i]); + deliveredOrderList.add(model.orders[i]); } } return Container( width: MediaQuery.of(context).size.width, - child: model.order.length != 0 + child: model.orders.length != 0 ? SingleChildScrollView( child: Column( children: [ @@ -175,10 +178,10 @@ class _OrderPageState extends State with SingleTickerProviderStateMix Container( margin: EdgeInsets.all(8.0), child: InkWell( - onTap: () { - Navigator.push(context, - MaterialPageRoute(builder: (context) => OrderDetailsPage(orderModel:deliveredOrderList[index]))); - }, +// onTap: () { +// Navigator.push(context, +// MaterialPageRoute(builder: (context) => OrderDetailsPage(orderModel: deliveredOrderList[index]),)); +// }, child: SvgPicture.asset( languageID == "ar" ? 'assets/images/pharmacy/arrow_left.svg' @@ -260,7 +263,7 @@ class _OrderPageState extends State with SingleTickerProviderStateMix Row( children: [ Container( - child: Text(deliveredOrderList[index].orderItems.length.toString(), + child: Text(deliveredOrderList[index].productCount.toString(), style: TextStyle(fontSize: 14.0, ), ), @@ -317,15 +320,15 @@ class _OrderPageState extends State with SingleTickerProviderStateMix } Widget getProcessingOrder(OrderModelViewModel model){ - for(int i=0 ; i< model.order.length; i++){ - if( model.order[i].orderStatusId == 20 || model.order[i].orderStatusId == 995 || - model.order[i].orderStatusId == 998 || model.order[i].orderStatusId == 999){ - processingOrderList.add(model.order[i]); + for(int i=0 ; i< model.orders.length; i++){ + if( model.orders[i].orderStatusId == 20 || model.orders[i].orderStatusId == 995 || + model.orders[i].orderStatusId == 998 || model.orders[i].orderStatusId == 999){ + processingOrderList.add(model.orders[i]); } } return Container( width: MediaQuery.of(context).size.width, - child: model.order.length != 0 + child: model.orders.length != 0 ? SingleChildScrollView( child: Column( children: [ @@ -389,9 +392,10 @@ class _OrderPageState extends State with SingleTickerProviderStateMix margin: EdgeInsets.all(8.0), child: InkWell( onTap: () { - Navigator.push(context, - MaterialPageRoute(builder: (context) => OrderDetailsPage(orderModel:processingOrderList[index]))); - }, +// Navigator.push(context, +// MaterialPageRoute(builder: (context) => OrderDetailsPage(Orders:processingOrderList[index]))); +// + }, child: SvgPicture.asset( languageID == "ar" ? 'assets/images/pharmacy/arrow_left.svg' @@ -473,7 +477,7 @@ class _OrderPageState extends State with SingleTickerProviderStateMix Row( children: [ Container( - child: Text(processingOrderList[index].orderItems.length.toString(), + child: Text(processingOrderList[index].productCount.toString(), style: TextStyle(fontSize: 14.0, ), ), @@ -709,13 +713,13 @@ class _OrderPageState extends State with SingleTickerProviderStateMix } Widget getPendingOrder(OrderModelViewModel model){ - for(int i=0 ; i< model.order.length; i++){ - if( model.order[i].orderStatusId == 10){ - pendingOrderList.add(model.order[i]); + for(int i=0 ; i< model.orders.length; i++){ + if( model.orders[i].orderStatusId == 10){ + pendingOrderList.add(model.orders[i]); } } return Container( - child: model.order.length != 0 + child: model.orders.length != 0 ? SingleChildScrollView( child: Column( children: [ @@ -780,9 +784,10 @@ class _OrderPageState extends State with SingleTickerProviderStateMix margin: EdgeInsets.all( 8.0), child: InkWell( onTap: () { - Navigator.push(context, - MaterialPageRoute(builder: (context) => OrderDetailsPage(orderModel:pendingOrderList[index]))); - }, +// Navigator.push(context, +// MaterialPageRoute(builder: (context) => OrderDetailsPage(Orders:pendingOrderList[index]))); +// + }, child: SvgPicture.asset( languageID == "ar" ? 'assets/images/pharmacy/arrow_left.svg' @@ -864,7 +869,7 @@ class _OrderPageState extends State with SingleTickerProviderStateMix Row( children: [ Container( - child: Text(pendingOrderList[index].orderItems.length.toString(), + child: Text(pendingOrderList[index].productCount.toString(), style: TextStyle(fontSize: 14.0, ), ), @@ -924,14 +929,14 @@ class _OrderPageState extends State with SingleTickerProviderStateMix } Widget getCancelledOrder(OrderModelViewModel model){ - for(int i=0 ; i< model.order.length; i++){ - if( model.order[i].orderStatusId == 40 || model.order[i].orderStatusId == 996 - || model.order[i].orderStatusId == 200){ - cancelledOrderList.add(model.order[i]); + for(int i=0 ; i< model.orders.length; i++){ + if( model.orders[i].orderStatusId == 40 || model.orders[i].orderStatus == 996 + || model.orders[i].orderStatusId == 200){ + cancelledOrderList.add(model.orders[i]); } } return Container( - child: model.order.length != 0 + child: model.orders.length != 0 ? SingleChildScrollView( child: Column( children: [ @@ -996,8 +1001,9 @@ class _OrderPageState extends State with SingleTickerProviderStateMix margin: EdgeInsets.all(8.0), child: InkWell( onTap: () { - Navigator.push(context, - MaterialPageRoute(builder: (context) => OrderDetailsPage(orderModel:cancelledOrderList[index]))); +// Navigator.push(context, +// MaterialPageRoute(builder: (context) => OrderDetailsPage(orderModel: cancelledOrderList[index]))); +// }, child: SvgPicture.asset( languageID == "ar" @@ -1080,7 +1086,7 @@ class _OrderPageState extends State with SingleTickerProviderStateMix Row( children: [ Container( - child: Text(cancelledOrderList[index].orderItems.length.toString(), + child: Text(cancelledOrderList[index].productCount.toString(), style: TextStyle(fontSize: 14.0, ), ), diff --git a/lib/pages/pharmacy/order/OrderDetails.dart b/lib/pages/pharmacy/order/OrderDetails.dart index 1e4c5bb3..5438663d 100644 --- a/lib/pages/pharmacy/order/OrderDetails.dart +++ b/lib/pages/pharmacy/order/OrderDetails.dart @@ -328,6 +328,7 @@ class _OrderDetailsPageState extends State { totalPrice: "${(widget.orderModel.orderItems[index].product.price * widget.orderModel.orderItems[index].quantity).toStringAsFixed(2)}", qyt: widget.orderModel.orderItems[index].quantity.toString(), + isOrderDetails:true, imgs: widget.orderModel.orderItems[index].product.images != null && widget.orderModel.orderItems[index].product.images.length != 0 ? widget.orderModel.orderItems[index].product.images [0].src.toString() diff --git a/lib/pages/pharmacy/profile/profile.dart b/lib/pages/pharmacy/profile/profile.dart index d6fe35be..3a27a98d 100644 --- a/lib/pages/pharmacy/profile/profile.dart +++ b/lib/pages/pharmacy/profile/profile.dart @@ -5,6 +5,8 @@ import 'package:diplomaticquarterapp/pages/ContactUs/findus/findus_page.dart'; import 'package:diplomaticquarterapp/pages/DrawerPages/family/my-family.dart'; import 'package:diplomaticquarterapp/pages/login/welcome.dart'; import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescriptions_home_page.dart'; +import 'package:diplomaticquarterapp/pages/pharmacies/compare.dart'; +import 'package:diplomaticquarterapp/pages/pharmacies/my_reviews.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/screens/lakum-main-page.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/screens/lakum-terms-conditions-page.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/screens/pharmacy-terms-conditions-page.dart'; @@ -237,6 +239,12 @@ class _ProfilePageState extends State { ), Expanded( child: InkWell( + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => MyReviewsPage())); + }, child: Column( children: [ SvgPicture.asset( @@ -328,7 +336,7 @@ class _ProfilePageState extends State { Navigator.push( context, MaterialPageRoute( - builder: (context) => MyFamily())); + builder: (context) => ComparePage())); }, child: Row( children: [ diff --git a/lib/services/pharmacy_services/orderDetails_service.dart b/lib/services/pharmacy_services/orderDetails_service.dart index a3bb9976..1e9306d4 100644 --- a/lib/services/pharmacy_services/orderDetails_service.dart +++ b/lib/services/pharmacy_services/orderDetails_service.dart @@ -24,6 +24,7 @@ class OrderDetailsService extends BaseService{ Future getOrderDetails(orderId) async { print("step 2" + orderId); + print("this is what i need"+GET_ORDER_DETAILS + orderId); hasError = false; await baseAppClient.getPharmacy(GET_ORDER_DETAILS+orderId, onSuccess: (dynamic response, int statusCode) { diff --git a/lib/services/pharmacy_services/order_service.dart b/lib/services/pharmacy_services/order_service.dart index e426b801..abdeda20 100644 --- a/lib/services/pharmacy_services/order_service.dart +++ b/lib/services/pharmacy_services/order_service.dart @@ -5,7 +5,7 @@ import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.da import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:flutter/material.dart'; -import 'package:diplomaticquarterapp/core/model/pharmacies/order_model.dart'; +import 'package:diplomaticquarterapp/core/model/pharmacies/orders_model.dart'; class OrderService extends BaseService{ @@ -14,21 +14,23 @@ class OrderService extends BaseService{ AuthenticatedUser authUser = new AuthenticatedUser(); AuthProvider authProvider = new AuthProvider(); - List _orderList = List(); - List get orderList => _orderList; + List _orderList = List(); + List get orderList => _orderList; String url =""; Future getOrder(customerId, pageId) async { hasError = false; // url =GET_ORDER+"customer=1,fields=id,order_total,order_status,order_statusn,order_status_id,created_on_utc&page=1&limit=200&customer_id=1367368"; - url =GET_ORDER+"customer=1,fields=id,order_total,order_status,order_statusn,order_status_id,created_on_utc&page=$pageId&limit=200&customer_id=$customerId"; + // url =GET_ORDER+"customer=1,fields=id,order_total,order_status,order_statusn,order_status_id,created_on_utc&page=$pageId&limit=200&customer_id=$customerId"; + url =GET_ORDER+"customer=1&fields=id,order_total,order_status,order_statusn,order_status_id,created_on_utc,product_count&page=$pageId&limit=200&customer_id=$customerId"; print(url); await baseAppClient.getPharmacy(url, onSuccess: (dynamic response, int statusCode) { _orderList.clear(); + response['orders'].forEach((item) { - _orderList.add(OrderModel.fromJson(item)); + _orderList.add(Orders.fromJson(item)); }); print(_orderList.length); print(response); @@ -39,25 +41,27 @@ class OrderService extends BaseService{ } - Future getProductReview(orderId) async { - print("step 1"); - hasError = false; - url =GET_ORDER+"customer=1,fields=id,order_total,order_status,order_statusn,order_status_id,created_on_utc&page=1&limit=200&customer_id=1367368"; -// url =GET_ORDER+"customer=1,fields=id,order_total,order_status,order_statusn,order_status_id,created_on_utc&page=$page_id&limit=200&customer_id=$custmerId"; - print(url); - await baseAppClient.getPharmacy(url, - onSuccess: (dynamic response, int statusCode) { - _orderList.clear(); - response['orders'].forEach((item) { - _orderList.add(OrderModel.fromJson(item)); - }); - print(_orderList.length); - print(response); - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }); - } +// Future getProductReview(orderId) async { +// print("step 1"); +// hasError = false; +// url =GET_ORDER+"customer=1,fields=id,order_total,order_status,order_statusn,order_status_id,created_on_utc&page=1&limit=200&customer_id=1367368"; +//// url =GET_ORDER+"customer=1,fields=id,order_total,order_status,order_statusn,order_status_id,created_on_utc&page=$page_id&limit=200&customer_id=$custmerId"; +// print(url); +// await baseAppClient.getPharmacy(url, +// onSuccess: (dynamic response, int statusCode) { +// _orderList.clear(); +// response['orders'].forEach((item) { +// _orderList.add(OrderModel.fromJson(item)); +// }); +// print(_orderList.length); +// print(response); +// }, onFailure: (String error, int statusCode) { +// hasError = true; +// super.error = error; +// }); +// } + + // Future getOrder(BuildContext context ) async { // // if (await this.sharedPref.getObject(USER_PROFILE) != null) { diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index f60d010f..d67a2e98 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -792,6 +792,7 @@ class TranslationBase { String get recentlyViewed => localizedValues['recentlyViewed'][locale.languageCode]; String get bestSellers => localizedValues['bestSellers'][locale.languageCode]; + String get recommended => localizedValues['recommended'][locale.languageCode]; String get deleteAllItems => localizedValues['deleteAllItems'][locale.languageCode]; String get selectAddress => From a1b2709ac8aa3b473bfb495bdd1771db07f55e83 Mon Sep 17 00:00:00 2001 From: Fatimah Alshammari Date: Wed, 13 Jan 2021 09:42:51 +0300 Subject: [PATCH 13/42] fixed orders --- lib/pages/pharmacy/order/Order.dart | 26 +-- lib/pages/pharmacy/order/OrderDetails.dart | 202 +++++++++++---------- 2 files changed, 116 insertions(+), 112 deletions(-) diff --git a/lib/pages/pharmacy/order/Order.dart b/lib/pages/pharmacy/order/Order.dart index e472aa18..33599516 100644 --- a/lib/pages/pharmacy/order/Order.dart +++ b/lib/pages/pharmacy/order/Order.dart @@ -178,10 +178,10 @@ class _OrderPageState extends State with SingleTickerProviderStateMix Container( margin: EdgeInsets.all(8.0), child: InkWell( -// onTap: () { -// Navigator.push(context, -// MaterialPageRoute(builder: (context) => OrderDetailsPage(orderModel: deliveredOrderList[index]),)); -// }, + onTap: () { + Navigator.push(context, + MaterialPageRoute(builder: (context) => OrderDetailsPage(orderModel: deliveredOrderList[index]),)); + }, child: SvgPicture.asset( languageID == "ar" ? 'assets/images/pharmacy/arrow_left.svg' @@ -392,9 +392,9 @@ class _OrderPageState extends State with SingleTickerProviderStateMix margin: EdgeInsets.all(8.0), child: InkWell( onTap: () { -// Navigator.push(context, -// MaterialPageRoute(builder: (context) => OrderDetailsPage(Orders:processingOrderList[index]))); -// + Navigator.push(context, + MaterialPageRoute(builder: (context) => OrderDetailsPage(orderModel :processingOrderList[index]))); + }, child: SvgPicture.asset( languageID == "ar" @@ -784,9 +784,9 @@ class _OrderPageState extends State with SingleTickerProviderStateMix margin: EdgeInsets.all( 8.0), child: InkWell( onTap: () { -// Navigator.push(context, -// MaterialPageRoute(builder: (context) => OrderDetailsPage(Orders:pendingOrderList[index]))); -// + Navigator.push(context, + MaterialPageRoute(builder: (context) => OrderDetailsPage(orderModel:pendingOrderList[index]))); + }, child: SvgPicture.asset( languageID == "ar" @@ -1001,9 +1001,9 @@ class _OrderPageState extends State with SingleTickerProviderStateMix margin: EdgeInsets.all(8.0), child: InkWell( onTap: () { -// Navigator.push(context, -// MaterialPageRoute(builder: (context) => OrderDetailsPage(orderModel: cancelledOrderList[index]))); -// + Navigator.push(context, + MaterialPageRoute(builder: (context) => OrderDetailsPage(orderModel: cancelledOrderList[index]))); + }, child: SvgPicture.asset( languageID == "ar" diff --git a/lib/pages/pharmacy/order/OrderDetails.dart b/lib/pages/pharmacy/order/OrderDetails.dart index 5438663d..6effb47b 100644 --- a/lib/pages/pharmacy/order/OrderDetails.dart +++ b/lib/pages/pharmacy/order/OrderDetails.dart @@ -1,3 +1,4 @@ +import 'package:diplomaticquarterapp/core/model/pharmacies/orders_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/order_model_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/pharmacy/order/Order.dart'; @@ -22,9 +23,11 @@ import 'package:provider/provider.dart'; dynamic languageID; class OrderDetailsPage extends StatefulWidget { - OrderModel orderModel; + Orders orderModel; + OrderModel orderDetails; + + OrderDetailsPage({@required this.orderModel, this.orderDetails}); - OrderDetailsPage({@required this.orderModel}); @override _OrderDetailsPageState createState() => _OrderDetailsPageState(); @@ -51,9 +54,10 @@ class _OrderDetailsPageState extends State { @override void initState() { + getLanguageID(); super.initState(); - print(widget.orderModel.orderItems.length); +// print(widget.orderModel.orderItems.length); getCancelOrder(widget.orderModel.id); // cancelOrderDetail(order) } @@ -105,9 +109,9 @@ class _OrderDetailsPageState extends State { color: getStatusBackgroundColor(), borderRadius: BorderRadius.circular(30.0)), child: Text( - languageID == "ar" - ? widget.orderModel.orderStatusn.toString(): - widget.orderModel.orderStatus.toString().substring(12) , + languageID == "ar" + ? widget.orderModel.orderStatusn.toString(): + widget.orderModel.orderStatus.toString().substring(12) , // TranslationBase.of(context).delivered, style: TextStyle( color: Colors.white, @@ -124,11 +128,11 @@ class _OrderDetailsPageState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( - widget.orderModel.shippingAddress.firstName - .toString() - .substring(10) + + widget.orderDetails.shippingAddress.firstName + .toString() + .substring(10) + ' ' + - widget.orderModel.shippingAddress.lastName + widget.orderDetails.shippingAddress.lastName .toString() .substring(9), style: TextStyle( @@ -141,18 +145,18 @@ class _OrderDetailsPageState extends State { Container( margin: EdgeInsets.fromLTRB(10.0, 5.0, 1.0, 5.0), child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - widget.orderModel.shippingAddress.address1 - .toString() - .substring(9), - style: TextStyle( - fontSize: 10.0, - fontWeight: FontWeight.bold, - color: Colors.grey, - ), - ),] + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + widget.orderDetails.shippingAddress.address1 + .toString() + .substring(9), + style: TextStyle( + fontSize: 10.0, + fontWeight: FontWeight.bold, + color: Colors.grey, + ), + ),] ), ), Container( @@ -161,14 +165,14 @@ class _OrderDetailsPageState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( - widget.orderModel.shippingAddress.address2 - .toString() - .substring(9) + + widget.orderDetails.shippingAddress.address2 + .toString() + .substring(9) + ' ' + - widget.orderModel.shippingAddress.country + widget.orderDetails.shippingAddress.country .toString() + ' ' + - widget.orderModel.shippingAddress.zipPostalCode + widget.orderDetails.shippingAddress.zipPostalCode .toString(), style: TextStyle( fontSize: 10.0, @@ -191,7 +195,7 @@ class _OrderDetailsPageState extends State { Container( margin: EdgeInsets.only(top: 5.0, bottom: 5.0), child: Text( - widget.orderModel.shippingAddress.phoneNumber + widget.orderDetails.shippingAddress.phoneNumber .toString(), style: TextStyle( fontSize: 15.0, @@ -230,8 +234,8 @@ class _OrderDetailsPageState extends State { ), Container( child: flutterImage.Image.asset( - widget.orderModel.shippingRateComputationMethodSystemName != - "Shipping.Aramex" + widget.orderDetails.shippingRateComputationMethodSystemName != + "Shipping.Aramex" ? "assets/images/pharmacy_module/payment/LogoParmacyGreen.png" : "assets/images/pharmacy_module/payment/aramex_shipping_logo.png", fit: BoxFit.contain, @@ -282,7 +286,7 @@ class _OrderDetailsPageState extends State { Container( margin: EdgeInsets.only(bottom: 10.0, top: 10.0), child: Text( - widget.orderModel.paymentName.toString().substring(12), + widget.orderDetails.paymentName.toString().substring(12), style: TextStyle( fontSize: 13.0, fontWeight: FontWeight.bold, @@ -318,23 +322,23 @@ class _OrderDetailsPageState extends State { scrollDirection: Axis.vertical, shrinkWrap: true, physics: ScrollPhysics(), - itemCount:widget.orderModel.orderItems.length, + itemCount:widget.orderDetails.orderItems.length, itemBuilder: (context, index){ - return Container( - child: productTile(productName: widget.orderModel.orderItems[index].product.name.toString(), - productPrice: widget.orderModel.orderItems[index].product.price.toString(), - productRate: widget.orderModel.orderItems[index].product.approvedRatingSum.toDouble(), - productReviews:widget.orderModel.orderItems[index].product.approvedTotalReviews, - totalPrice: "${(widget.orderModel.orderItems[index].product.price - * widget.orderModel.orderItems[index].quantity).toStringAsFixed(2)}", - qyt: widget.orderModel.orderItems[index].quantity.toString(), - isOrderDetails:true, - imgs: widget.orderModel.orderItems[index].product.images != null && - widget.orderModel.orderItems[index].product.images.length != 0 - ? widget.orderModel.orderItems[index].product.images [0].src.toString() - : null, - status: widget.orderModel.orderStatusId, - product: widget.orderModel.orderItems[index].product, + return Container( + child: productTile(productName: widget.orderDetails.orderItems[index].product.name.toString(), + productPrice: widget.orderDetails.orderItems[index].product.price.toString(), + productRate: widget.orderDetails.orderItems[index].product.approvedRatingSum.toDouble(), + productReviews:widget.orderDetails.orderItems[index].product.approvedTotalReviews, + totalPrice: "${(widget.orderDetails.orderItems[index].product.price + * widget.orderDetails.orderItems[index].quantity).toStringAsFixed(2)}", + qyt: widget.orderDetails.orderItems[index].quantity.toString(), + isOrderDetails:true, + imgs: widget.orderDetails.orderItems[index].product.images != null && + widget.orderDetails.orderItems[index].product.images.length != 0 + ? widget.orderDetails.orderItems[index].product.images [0].src.toString() + : null, + status: widget.orderDetails.orderStatusId, + product: widget.orderDetails.orderItems[index].product, ), ); }), @@ -383,7 +387,7 @@ class _OrderDetailsPageState extends State { ), ), Text( - widget.orderModel.orderSubtotalExclTax.toString(), + widget.orderDetails.orderSubtotalExclTax.toString(), style: TextStyle( fontSize: 13.0, ), @@ -421,7 +425,7 @@ class _OrderDetailsPageState extends State { ), ), Text( - widget.orderModel.orderShippingExclTax.toString(), + widget.orderDetails.orderShippingExclTax.toString(), style: TextStyle( fontSize: 13.0, ), @@ -459,7 +463,7 @@ class _OrderDetailsPageState extends State { ), ), Text( - widget.orderModel.orderTax.toString(), + widget.orderDetails.orderTax.toString(), style: TextStyle( fontSize: 13.0, ), @@ -510,58 +514,58 @@ class _OrderDetailsPageState extends State { ), widget.orderModel.orderStatusId == 10 ? InkWell( - onTap: () { - model.makeOrder(); - }, - child: Container( + onTap: () { + model.makeOrder(); + }, + child: Container( // margin: EdgeInsets.only(top: 20.0), - height: 50.0, - color: Colors.transparent, - child: Container( - padding: EdgeInsets.only(left: 130.0, right: 130.0), - decoration: BoxDecoration( - border: Border.all( - color: Colors.green, - style: BorderStyle.solid, - width: 4.0), - color: Colors.green, - borderRadius: BorderRadius.circular(5.0)), - child: Center( - child: Text( - TranslationBase.of(context).payOnline, - style: TextStyle( - color: Colors.white, - fontWeight: FontWeight.bold, - ), - ), - ), + height: 50.0, + color: Colors.transparent, + child: Container( + padding: EdgeInsets.only(left: 130.0, right: 130.0), + decoration: BoxDecoration( + border: Border.all( + color: Colors.green, + style: BorderStyle.solid, + width: 4.0), + color: Colors.green, + borderRadius: BorderRadius.circular(5.0)), + child: Center( + child: Text( + TranslationBase.of(context).payOnline, + style: TextStyle( + color: Colors.white, + fontWeight: FontWeight.bold, ), ), - ) + ), + ), + ), + ) : Container(), // getCancelOrder(canCancel, canRefund), isCancel ? InkWell( - onTap: () { - presentConfirmDialog(model, - widget.orderModel.id); //(widget.orderModel.id)); + onTap: () { + presentConfirmDialog(model, + widget.orderModel.id); //(widget.orderModel.id)); // - }, - child: Container( + }, + child: Container( // padding: EdgeInsets.only(left: 13.0, right: 13.0, top: 5.0), - height: 50.0, - color: Colors.transparent, - child: Center( - child: Text( - TranslationBase.of(context).cancelOrder, - style: TextStyle( - color: Colors.red[900], - fontWeight: FontWeight.bold, - decoration: TextDecoration.underline), - ), - ), - ), - ) + height: 50.0, + color: Colors.transparent, + child: Center( + child: Text( + TranslationBase.of(context).cancelOrder, + style: TextStyle( + color: Colors.red[900], + fontWeight: FontWeight.bold, + decoration: TextDecoration.underline), + ), + ), + ), + ) : Container(), ], ), @@ -591,17 +595,17 @@ class _OrderDetailsPageState extends State { } getCancelOrder(dataIsCancel) { - if (widget.orderModel.canCancel && widget.orderModel.canRefund) { + if (widget.orderDetails.canCancel && widget.orderDetails.canRefund) { setState(() { isCancel = true; isRefund = false; }); - } else if (widget.orderModel.canCancel) { + } else if (widget.orderDetails.canCancel) { setState(() { isCancel = true; isRefund = false; }); - } else if (widget.orderModel.canRefund) { + } else if (widget.orderDetails.canRefund) { setState(() { isCancel = false; isRefund = true; @@ -630,7 +634,7 @@ class _OrderDetailsPageState extends State { context, MaterialPageRoute( builder: (context) => OrderPage( - customerID: widget.orderModel.customerId.toString())), + customerID: widget.orderDetails.customerId.toString())), ); }), cancelFunction: () => {}); @@ -639,7 +643,7 @@ class _OrderDetailsPageState extends State { getCanceledOrder(order) { Navigator.pop(context); - if (widget.orderModel.canCancel && widget.orderModel.canRefund == false) { + if (widget.orderDetails.canCancel && widget.orderDetails.canRefund == false) { // getCanceledOrder(order); // AppToast.showSuccessToast(message: "Request Sent Successfully"); // Navigator.push(context, @@ -647,4 +651,4 @@ class _OrderDetailsPageState extends State { } } -} +} \ No newline at end of file From 634c874eee1fb5fc7e5b6acdf323388776f288da Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Wed, 13 Jan 2021 10:02:39 +0200 Subject: [PATCH 14/42] fix design issues --- assets/images/new-design/covid-19-car.svg | 26 ++++ lib/config/localized_values.dart | 8 ++ lib/core/service/client/base_app_client.dart | 10 +- .../ComprehensiveMedicalCheckup/cmc_page.dart | 2 +- .../E-Referral/e_referral_page.dart | 2 +- .../HomeHealthCare/home_health_care_page.dart | 2 +- .../AlHabibMedicalService/h2o/h2o_page.dart | 2 +- lib/pages/ErService/AmbulanceReq.dart | 2 +- lib/pages/feedback/feedback_home_page.dart | 2 +- lib/pages/landing/home_page.dart | 125 +++++++----------- lib/pages/medical/eye/EyeHomePage.dart | 2 +- .../my_trackers/Weight/WeightHomePage.dart | 2 +- .../blood_pressure/BloodPressureHomePage.dart | 2 +- .../blood_suger/blood_sugar_home_page.dart | 2 +- .../prescriptions_home_page.dart | 8 +- .../medical/reports/report_home_page.dart | 2 +- lib/uitl/translations_delegate_base.dart | 2 + .../medical/medical_profile_item.dart | 1 - 18 files changed, 99 insertions(+), 103 deletions(-) create mode 100644 assets/images/new-design/covid-19-car.svg diff --git a/assets/images/new-design/covid-19-car.svg b/assets/images/new-design/covid-19-car.svg new file mode 100644 index 00000000..b5c9cb85 --- /dev/null +++ b/assets/images/new-design/covid-19-car.svg @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 387dbcb1..a019ae00 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -1449,4 +1449,12 @@ const Map localizedValues = { "en": "View List of Children", "ar": "عرض قائمة الأطفال" }, + "covidTest": { + "en": "COVID-19 TEST", + "ar": "فحص كورونا" + }, + "driveThru": { + "en": "Drive-Thru", + "ar": "من السيارة" + }, }; diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index 04f599f1..8995a4e3 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -58,15 +58,7 @@ class BaseAppClient { body['VersionID'] = VERSION_ID; body['Channel'] = CHANNEL; - body['LanguageID'] = body.containsKey('LanguageID') - ? body['LanguageID'] != null - ? body['LanguageID'] - : languageID == 'ar' - ? 1 - : 2 - : languageID == 'en' - ? 2 - : 1; + body['LanguageID'] = languageID == 'ar' ? 1 : 2; body['IPAdress'] = IP_ADDRESS; body['generalid'] = GENERAL_ID; diff --git a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_page.dart b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_page.dart index 385d0da3..95d02d1f 100644 --- a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_page.dart +++ b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_page.dart @@ -78,7 +78,7 @@ class _CMCPageState extends State isScrollable: true, controller: _tabController, indicatorWeight: 5.0, - indicatorSize: TabBarIndicatorSize.label, + indicatorSize: TabBarIndicatorSize.tab, indicatorColor: Colors.red[800], labelColor: Theme.of(context).primaryColor, labelPadding: diff --git a/lib/pages/AlHabibMedicalService/E-Referral/e_referral_page.dart b/lib/pages/AlHabibMedicalService/E-Referral/e_referral_page.dart index 9f836860..a0583434 100644 --- a/lib/pages/AlHabibMedicalService/E-Referral/e_referral_page.dart +++ b/lib/pages/AlHabibMedicalService/E-Referral/e_referral_page.dart @@ -78,7 +78,7 @@ class _EReferralPageState extends State isScrollable: true, controller: _tabController, indicatorWeight: 5.0, - indicatorSize: TabBarIndicatorSize.label, + indicatorSize: TabBarIndicatorSize.tab, indicatorColor: Colors.red[800], labelColor: Theme.of(context).primaryColor, labelPadding: diff --git a/lib/pages/AlHabibMedicalService/HomeHealthCare/home_health_care_page.dart b/lib/pages/AlHabibMedicalService/HomeHealthCare/home_health_care_page.dart index 8f4821f6..f0dcee7c 100644 --- a/lib/pages/AlHabibMedicalService/HomeHealthCare/home_health_care_page.dart +++ b/lib/pages/AlHabibMedicalService/HomeHealthCare/home_health_care_page.dart @@ -80,7 +80,7 @@ class _HomeHealthCarePageState extends State isScrollable: true, controller: _tabController, indicatorWeight: 5.0, - indicatorSize: TabBarIndicatorSize.label, + indicatorSize: TabBarIndicatorSize.tab, indicatorColor: Colors.red[800], labelColor: Theme.of(context).primaryColor, labelPadding: diff --git a/lib/pages/AlHabibMedicalService/h2o/h2o_page.dart b/lib/pages/AlHabibMedicalService/h2o/h2o_page.dart index ad2c6ece..8ac7b437 100644 --- a/lib/pages/AlHabibMedicalService/h2o/h2o_page.dart +++ b/lib/pages/AlHabibMedicalService/h2o/h2o_page.dart @@ -68,7 +68,7 @@ class _H2OPageState extends State isScrollable: false, controller: _tabController, indicatorWeight: 5.0, - indicatorSize: TabBarIndicatorSize.label, + indicatorSize: TabBarIndicatorSize.tab, indicatorColor: Colors.red[800], labelColor: Theme.of(context).primaryColor, labelPadding: diff --git a/lib/pages/ErService/AmbulanceReq.dart b/lib/pages/ErService/AmbulanceReq.dart index 1690254a..3d4192c5 100644 --- a/lib/pages/ErService/AmbulanceReq.dart +++ b/lib/pages/ErService/AmbulanceReq.dart @@ -92,7 +92,7 @@ class _AmbulanceReqState extends State isScrollable: true, controller: _tabController, indicatorWeight: 5.0, - indicatorSize: TabBarIndicatorSize.label, + indicatorSize: TabBarIndicatorSize.tab, indicatorColor: Colors.red[800], labelColor: Theme.of(context).primaryColor, labelPadding: diff --git a/lib/pages/feedback/feedback_home_page.dart b/lib/pages/feedback/feedback_home_page.dart index 309b5713..fe22b44a 100644 --- a/lib/pages/feedback/feedback_home_page.dart +++ b/lib/pages/feedback/feedback_home_page.dart @@ -73,7 +73,7 @@ class _FeedbackHomePageState extends State isScrollable: true, controller: _tabController, indicatorWeight: 5.0, - indicatorSize: TabBarIndicatorSize.label, + indicatorSize: TabBarIndicatorSize.tab, indicatorColor: Colors.red[800], labelColor: Theme.of(context).primaryColor, labelPadding: diff --git a/lib/pages/landing/home_page.dart b/lib/pages/landing/home_page.dart index cd8a8a2d..bcddd10c 100644 --- a/lib/pages/landing/home_page.dart +++ b/lib/pages/landing/home_page.dart @@ -73,7 +73,7 @@ class _HomePageState extends State { children: [ Expanded( child: Container( - height: 120, + height: 125, padding: EdgeInsets.all(5), margin: EdgeInsets.all(5), decoration: BoxDecoration( @@ -87,72 +87,50 @@ class _HomePageState extends State { borderRadius: BorderRadius.all( Radius.circular(5))), child: Container( - margin: EdgeInsets.only(top: 10.0), + child: Column( children: [ - Text("COVID-19 TEST", - style: TextStyle( - color: Colors.white, - fontWeight: - FontWeight.bold, - fontSize: 18.0)), + Texts(TranslationBase.of(context).covidTest, + color: Colors.white, + fontWeight: FontWeight.w700, + ), Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, children: [ Container( margin: EdgeInsets.only( - top: 15.0, left: 3.5, right: 3.5), + top: 15.0,), child: SvgPicture.asset( 'assets/images/new-design/covid-19-car.svg', width: 45.0, height: 45.0), ), Container( - margin: EdgeInsets.only( - left: 10.0, - top: 10.0), + margin: EdgeInsets.only(top: 5.0), child: Column( children: [ - Text("Drive-Thru", - style: TextStyle( - color: Colors - .white, - fontWeight: - FontWeight - .bold, - fontSize: - 16.0)), + Texts(TranslationBase.of(context).driveThru, + fontWeight: FontWeight.w700, + color: Colors.white,), ButtonTheme( - shape: - RoundedRectangleBorder( + shape: RoundedRectangleBorder( borderRadius: - BorderRadius - .circular( - 5.0), - ), - minWidth: MediaQuery.of( - context) - .size - .width * - 0.15, + BorderRadius.circular(5.0),), + minWidth: MediaQuery.of(context).size.width * 0.15, height: 25.0, child: RaisedButton( - color: Colors - .red[800], - textColor: - Colors.white, - disabledTextColor: - Colors.white, - disabledColor: - new Color( - 0xFFbcc2c4), + color: Colors.red[800], + textColor: Colors.white, + disabledTextColor: Colors.white, + disabledColor: new Color(0xFFbcc2c4), onPressed: () { navigateToCovidDriveThru(); }, - child: Text( - "BOOK NOW", - style: TextStyle( - fontSize: - 12.0)), + child: Texts( + TranslationBase.of(context).bookNow, + fontWeight: FontWeight.w700, + color: Colors.white, + ), ), ), ], @@ -170,7 +148,7 @@ class _HomePageState extends State { onTap: () => Navigator.push(context, FadePage(page: LiveCareHome())), child: Container( - height: 120, + height: 125, padding: EdgeInsets.all(15), margin: EdgeInsets.all(5), decoration: BoxDecoration( @@ -208,7 +186,7 @@ class _HomePageState extends State { Orientation.landscape ? 0.02 : 0.03), - child: (!model.isLogin && projectViewModel.user == null) + child: (!model.isLogin) ? Container( width: double.infinity, height: 125, @@ -229,17 +207,15 @@ class _HomePageState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ SizedBox( - height: 8, + height: 2, ), Texts( TranslationBase.of(context).myMedicalFile, color: Colors.black87, - bold: true, + fontWeight: FontWeight.w700, fontSize: 23, ), - SizedBox( - height: 5, - ), + Texts( TranslationBase.of(context) .myMedicalFileSubTitle, @@ -248,14 +224,14 @@ class _HomePageState extends State { ), Align( alignment: projectViewModel.isArabic - ? Alignment.bottomRight - : Alignment.bottomLeft, + ? Alignment.bottomLeft + : Alignment.bottomRight, child: InkWell( onTap: () { widget.goToMyProfile(); }, child: Container( - margin: EdgeInsets.all(2), + margin: EdgeInsets.only(left: 15,right: 15), width: 90, height: 30, decoration: BoxDecoration( @@ -265,13 +241,13 @@ class _HomePageState extends State { color: Colors.transparent, width: 0.5), borderRadius: BorderRadius.all( - Radius.circular(9)), + Radius.circular(0)), ), child: Center( child: Texts( - TranslationBase.of(context) - .viewMore, + TranslationBase.of(context).viewMore, color: Colors.white, + fontWeight: FontWeight.w700, fontSize: 12, ), ), @@ -303,7 +279,7 @@ class _HomePageState extends State { children: [ Row( children: [ - if (model.user != null) + if (projectViewModel.user != null && model.isLogin) Expanded( child: Column( crossAxisAlignment: @@ -368,13 +344,9 @@ class _HomePageState extends State { ], ), Row( - //crossAxisAlignment: CrossAxisAlignment.center, - //mainAxisAlignment: MainAxisAlignment.spaceAround, children: [ Expanded( child: Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, children: [ Image.asset( 'assets/images/height_icon.png', @@ -384,6 +356,7 @@ class _HomePageState extends State { Texts( "${model.heightCm}", color: Colors.white, + fontSize: 17, ) ], ), @@ -393,8 +366,6 @@ class _HomePageState extends State { ), Expanded( child: Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, children: [ Image.asset( 'assets/images/weight_icon.png', @@ -404,6 +375,7 @@ class _HomePageState extends State { Texts( '${model.weightKg}', color: Colors.white, + fontSize: 17 ) ], ), @@ -467,12 +439,11 @@ class _HomePageState extends State { height: 3, ), Texts( - TranslationBase.of(context) - .homeHealthCareService, + TranslationBase.of(context).homeHealthCareService, textAlign: TextAlign.center, color: Colors.white, - bold: true, - fontSize: SizeConfig.textMultiplier * 1.7, + fontWeight: FontWeight.w700, + fontSize: SizeConfig.textMultiplier * 1.55, ) ], ), @@ -503,8 +474,8 @@ class _HomePageState extends State { TranslationBase.of(context).onlinePharmacy, textAlign: TextAlign.center, color: Colors.white, - bold: true, - fontSize: SizeConfig.textMultiplier * 1.7, + fontWeight: FontWeight.w700, + fontSize: SizeConfig.textMultiplier * 1.55, ) ], ), @@ -540,8 +511,8 @@ class _HomePageState extends State { TranslationBase.of(context).emergencyService, textAlign: TextAlign.center, color: Colors.white, - bold: true, - fontSize: SizeConfig.textMultiplier * 1.7, + fontWeight: FontWeight.w700, + fontSize: SizeConfig.textMultiplier * 1.55, ) ], ), @@ -811,10 +782,8 @@ class DashboardItem extends StatelessWidget { onTap: onTap, child: Container( width: width != null ? width : MediaQuery.of(context).size.width * 0.29, - height: height != null - ? height - : MediaQuery.of(context).orientation == Orientation.portrait - ? MediaQuery.of(context).size.height * 0.19 + height: height != null ? height : MediaQuery.of(context).orientation == Orientation.portrait + ? MediaQuery.of(context).size.height * 0.17 : MediaQuery.of(context).size.height * 0.35, decoration: BoxDecoration( color: !hasBorder diff --git a/lib/pages/medical/eye/EyeHomePage.dart b/lib/pages/medical/eye/EyeHomePage.dart index 3f4df55f..bce778b8 100644 --- a/lib/pages/medical/eye/EyeHomePage.dart +++ b/lib/pages/medical/eye/EyeHomePage.dart @@ -74,7 +74,7 @@ class _EyeHomePageState extends State isScrollable: true, controller: _tabController, indicatorWeight: 5.0, - indicatorSize: TabBarIndicatorSize.label, + indicatorSize: TabBarIndicatorSize.tab, labelColor: Theme.of(context).primaryColor, labelPadding: EdgeInsets.only(top: 4.0, left: 5.0, right: 5.0), diff --git a/lib/pages/medical/my_trackers/Weight/WeightHomePage.dart b/lib/pages/medical/my_trackers/Weight/WeightHomePage.dart index 8e6f808c..9bd89a2c 100644 --- a/lib/pages/medical/my_trackers/Weight/WeightHomePage.dart +++ b/lib/pages/medical/my_trackers/Weight/WeightHomePage.dart @@ -70,7 +70,7 @@ class _WeightHomePageState extends State isScrollable: true, controller: _tabController, indicatorWeight: 5.0, - indicatorSize: TabBarIndicatorSize.label, + indicatorSize: TabBarIndicatorSize.tab, indicatorColor: Colors.red[800], labelColor: Theme.of(context).primaryColor, labelPadding: diff --git a/lib/pages/medical/my_trackers/blood_pressure/BloodPressureHomePage.dart b/lib/pages/medical/my_trackers/blood_pressure/BloodPressureHomePage.dart index e6bb3ed4..de8bb509 100644 --- a/lib/pages/medical/my_trackers/blood_pressure/BloodPressureHomePage.dart +++ b/lib/pages/medical/my_trackers/blood_pressure/BloodPressureHomePage.dart @@ -73,7 +73,7 @@ class _BloodPressureHomePageState extends State isScrollable: true, controller: _tabController, indicatorWeight: 5.0, - indicatorSize: TabBarIndicatorSize.label, + indicatorSize: TabBarIndicatorSize.tab, labelColor: Theme.of(context).primaryColor, labelPadding: EdgeInsets.only(top: 4.0, left: 5.0, right: 5.0), diff --git a/lib/pages/medical/my_trackers/blood_suger/blood_sugar_home_page.dart b/lib/pages/medical/my_trackers/blood_suger/blood_sugar_home_page.dart index 9259e286..71df9a3a 100644 --- a/lib/pages/medical/my_trackers/blood_suger/blood_sugar_home_page.dart +++ b/lib/pages/medical/my_trackers/blood_suger/blood_sugar_home_page.dart @@ -74,7 +74,7 @@ class _BloodSugarHomePageState extends State isScrollable: true, controller: _tabController, indicatorWeight: 5.0, - indicatorSize: TabBarIndicatorSize.label, + indicatorSize: TabBarIndicatorSize.tab, labelColor: Theme.of(context).primaryColor, labelPadding: EdgeInsets.only(top: 4.0, left: 5.0, right: 5.0), diff --git a/lib/pages/medical/prescriptions/prescriptions_home_page.dart b/lib/pages/medical/prescriptions/prescriptions_home_page.dart index 96d4aba0..380d6284 100644 --- a/lib/pages/medical/prescriptions/prescriptions_home_page.dart +++ b/lib/pages/medical/prescriptions/prescriptions_home_page.dart @@ -71,12 +71,12 @@ class _HomePrescriptionsPageState extends State child: Container( height: 60.0, margin: EdgeInsets.only(top: 10.0), - width: MediaQuery.of(context).size.width * 0.9, + width: MediaQuery.of(context).size.width * 0.92, decoration: BoxDecoration( border: Border( bottom: BorderSide( color: Theme.of(context).dividerColor, - width: 0.7), + width: 0.9), //width: 0.7 ), color: Colors.white), child: Center( @@ -84,10 +84,10 @@ class _HomePrescriptionsPageState extends State isScrollable: true, controller: _tabController, indicatorWeight: 5.0, - indicatorSize: TabBarIndicatorSize.label, + indicatorSize: TabBarIndicatorSize.tab, labelColor: Theme.of(context).primaryColor, labelPadding: - EdgeInsets.only(top: 4.0, left: 18.0, right: 18.0), + EdgeInsets.only(top: 4.0, left: 35.0, right: 35.0), unselectedLabelColor: Colors.grey[800], tabs: [ Container( diff --git a/lib/pages/medical/reports/report_home_page.dart b/lib/pages/medical/reports/report_home_page.dart index d3c818ff..42dcf40a 100644 --- a/lib/pages/medical/reports/report_home_page.dart +++ b/lib/pages/medical/reports/report_home_page.dart @@ -101,7 +101,7 @@ class _HomeReportPageState extends State isScrollable: true, controller: _tabController, indicatorWeight: 5.0, - indicatorSize: TabBarIndicatorSize.label, + indicatorSize: TabBarIndicatorSize.tab, labelColor: Theme.of(context).primaryColor, unselectedLabelColor: Colors.grey[800], tabs: [ diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index 63cf8a44..736e7e14 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -1243,6 +1243,8 @@ class TranslationBase { localizedValues['termOfService'][locale.languageCode]; String get shoppingCart => localizedValues['shoppingCart'][locale.languageCode]; + String get covidTest => localizedValues['covidTest'][locale.languageCode]; + String get driveThru => localizedValues['driveThru'][locale.languageCode]; } diff --git a/lib/widgets/data_display/medical/medical_profile_item.dart b/lib/widgets/data_display/medical/medical_profile_item.dart index 7fd97f52..1751e0e5 100644 --- a/lib/widgets/data_display/medical/medical_profile_item.dart +++ b/lib/widgets/data_display/medical/medical_profile_item.dart @@ -26,7 +26,6 @@ class MedicalProfileItem extends StatelessWidget { showBorder: true, borderWidth: 0, margin: 4, - height: 120, child: Container( padding: EdgeInsets.all(10), child: Column( From 30ddea6419a6d2650474c363d8031b2790c4f69b Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Wed, 13 Jan 2021 12:44:11 +0200 Subject: [PATCH 15/42] hot fixing --- lib/core/viewModels/appointment_rate_view_model.dart | 2 +- lib/main.dart | 4 ++-- lib/pages/landing/home_page.dart | 4 ++-- lib/pages/medical/balance/advance_payment_page.dart | 8 +++----- lib/pages/paymentService/payment_service.dart | 8 ++++---- lib/pages/rateAppointment/rate_appointment_clinic.dart | 4 ++-- lib/pages/rateAppointment/rate_appointment_doctor.dart | 2 +- lib/widgets/others/app_scaffold_widget.dart | 1 + 8 files changed, 16 insertions(+), 17 deletions(-) diff --git a/lib/core/viewModels/appointment_rate_view_model.dart b/lib/core/viewModels/appointment_rate_view_model.dart index 23d00366..e1bdfc9e 100644 --- a/lib/core/viewModels/appointment_rate_view_model.dart +++ b/lib/core/viewModels/appointment_rate_view_model.dart @@ -40,7 +40,7 @@ class AppointmentRateViewModel extends BaseViewModel { Future sendAppointmentRate(int rate, int appointmentNo, int projectID, int doctorID, int clinicID, String note) async { - setState(ViewState.BusyLocal); + setState(ViewState.Busy); await _appointmentRateService.sendAppointmentRate( rate, appointmentNo, projectID, doctorID, clinicID, note); if (_appointmentRateService.hasError) { diff --git a/lib/main.dart b/lib/main.dart index fe129e01..e0444a32 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -100,14 +100,14 @@ class MyApp extends StatelessWidget { backgroundColor: Color.fromRGBO(255, 255, 255, 1), highlightColor: Colors.grey[100].withOpacity(0.4), splashColor: Colors.transparent, - primaryColor: Colors.grey, + primaryColor: Color(0xff515A5D), toggleableActiveColor: secondaryColor, indicatorColor: secondaryColor, bottomSheetTheme: BottomSheetThemeData(backgroundColor: HexColor('#E0E0E0')), cursorColor: Colors.grey, iconTheme: IconThemeData(), appBarTheme: AppBarTheme( - color: Colors.grey[700], + color: Color(0xff515A5D), brightness: Brightness.light, elevation: 0.0, actionsIconTheme: IconThemeData( diff --git a/lib/pages/landing/home_page.dart b/lib/pages/landing/home_page.dart index bcddd10c..fff74fd5 100644 --- a/lib/pages/landing/home_page.dart +++ b/lib/pages/landing/home_page.dart @@ -171,7 +171,7 @@ class _HomePageState extends State { ], ), ), - Container(width: double.infinity, height: 80) + Container(width: double.infinity, height:projectViewModel.isArabic ?110: 80) ], ), Positioned( @@ -260,7 +260,7 @@ class _HomePageState extends State { ) : Container( width: double.infinity, - height: 130, + height: projectViewModel.isArabic ? 160:130, decoration: BoxDecoration( color: HexColor('#A59E9E'), shape: BoxShape.rectangle, diff --git a/lib/pages/medical/balance/advance_payment_page.dart b/lib/pages/medical/balance/advance_payment_page.dart index a3005db5..fce664f7 100644 --- a/lib/pages/medical/balance/advance_payment_page.dart +++ b/lib/pages/medical/balance/advance_payment_page.dart @@ -238,15 +238,13 @@ class _AdvancePaymentPageState extends State { ), ), bottomSheet: Container( - height: MediaQuery.of(context).size.height * 0.13, + height: MediaQuery.of(context).size.height * 0.10, width: double.infinity, - padding: EdgeInsets.all(12), + padding: EdgeInsets.all(18), child: SecondaryButton( textColor: Colors.white, label: TranslationBase.of(context).submit, - disabled: amount.isEmpty || - _fileTextController.text.isEmpty || - _selectedHospital == null, + disabled: amount.isEmpty || _fileTextController.text.isEmpty || _selectedHospital == null, onTap: () { var mobileNum; var patientName; diff --git a/lib/pages/paymentService/payment_service.dart b/lib/pages/paymentService/payment_service.dart index c3a19917..cca506ec 100644 --- a/lib/pages/paymentService/payment_service.dart +++ b/lib/pages/paymentService/payment_service.dart @@ -74,7 +74,7 @@ class PaymentService extends StatelessWidget { ), ), ), - if(!projectViewModel.havePrivilege(33)) + //if(!projectViewModel.havePrivilege(33)) Expanded( child: InkWell( onTap: () => navigateToToDoPage(context), @@ -117,7 +117,7 @@ class PaymentService extends StatelessWidget { ) ], ), - if(!projectViewModel.havePrivilege(33)) + // if(!projectViewModel.havePrivilege(33)) Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -136,12 +136,12 @@ class PaymentService extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ Texts( - 'My Balances', + TranslationBase.of(context).hmg, color: HexColor('#B61422'), bold: true, ), Texts( - TranslationBase.of(context).payment, + TranslationBase.of(context).wallet, fontSize: 14, fontWeight: FontWeight.normal, ), diff --git a/lib/pages/rateAppointment/rate_appointment_clinic.dart b/lib/pages/rateAppointment/rate_appointment_clinic.dart index f5ec34c3..bf0f4b4e 100644 --- a/lib/pages/rateAppointment/rate_appointment_clinic.dart +++ b/lib/pages/rateAppointment/rate_appointment_clinic.dart @@ -208,8 +208,8 @@ class _RateAppointmentClinicState extends State { } }, label: TranslationBase.of(context).submit, - disabled: model.state == ViewState.BusyLocal, - loading: model.state == ViewState.BusyLocal, + disabled: (model.state == ViewState.Busy || rating==0), + // loading: model.state == ViewState.BusyLocal, textColor: Theme.of(context).backgroundColor), ), SizedBox( diff --git a/lib/pages/rateAppointment/rate_appointment_doctor.dart b/lib/pages/rateAppointment/rate_appointment_doctor.dart index b3349704..71aacae2 100644 --- a/lib/pages/rateAppointment/rate_appointment_doctor.dart +++ b/lib/pages/rateAppointment/rate_appointment_doctor.dart @@ -206,7 +206,7 @@ class _RateAppointmentDoctorState extends State { } }, label: TranslationBase.of(context).next, - disabled: model.state == ViewState.BusyLocal|| rating==0, + disabled: (model.state == ViewState.BusyLocal || rating==0), loading: model.state == ViewState.BusyLocal, textColor: Theme.of(context).backgroundColor), ), diff --git a/lib/widgets/others/app_scaffold_widget.dart b/lib/widgets/others/app_scaffold_widget.dart index a1c28f7e..fca914a0 100644 --- a/lib/widgets/others/app_scaffold_widget.dart +++ b/lib/widgets/others/app_scaffold_widget.dart @@ -84,6 +84,7 @@ class AppScaffold extends StatelessWidget { isShowDecPage: isShowDecPage, image: image, ):null, + bottomSheet: bottomSheet, body: (!Provider.of(context, listen: false).isLogin && isShowDecPage) ? NotAutPage( From e2bce87e34195476195716ad4f974986388a8271 Mon Sep 17 00:00:00 2001 From: Zohaib Iqbal Kambrani <> Date: Wed, 13 Jan 2021 14:39:36 +0300 Subject: [PATCH 16/42] resolve merge conflicts. --- ios/Flutter/.last_build_id | 6 +---- lib/config/config.dart | 4 +-- lib/pages/landing/landing_page.dart | 35 +++++++++++++++----------- lib/uitl/utils.dart | 38 ++++++++++++++++++----------- 4 files changed, 48 insertions(+), 35 deletions(-) diff --git a/ios/Flutter/.last_build_id b/ios/Flutter/.last_build_id index 6ccef9d4..b8024672 100644 --- a/ios/Flutter/.last_build_id +++ b/ios/Flutter/.last_build_id @@ -1,5 +1 @@ -<<<<<<< HEAD -e7c24319209ad9049a87d4c83aeeb7de -======= -59a6c452ee075b50114918f17f1ad8f5 ->>>>>>> development +59a6c452ee075b50114918f17f1ad8f5 \ No newline at end of file diff --git a/lib/config/config.dart b/lib/config/config.dart index 795da85b..4315f13c 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -12,8 +12,8 @@ const EXA_CART_API_BASE_URL = 'https://mdlaboratories.com/exacartapi'; const PACKAGES_CATEGORIES = '/api/categories'; const PACKAGES_PRODUCTS = '/api/products'; -const BASE_URL = 'https://uat.hmgwebservices.com/'; -// const BASE_URL = 'https://hmgwebservices.com/'; +// const BASE_URL = 'https://uat.hmgwebservices.com/'; +const BASE_URL = 'https://hmgwebservices.com/'; //const BASE_PHARMACY_URL = 'http://swd-pharapp-01:7200/api/'; const BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; diff --git a/lib/pages/landing/landing_page.dart b/lib/pages/landing/landing_page.dart index f45b3780..eabff77a 100644 --- a/lib/pages/landing/landing_page.dart +++ b/lib/pages/landing/landing_page.dart @@ -613,20 +613,27 @@ class _LandingPageState extends State with WidgetsBindingObserver { } } - void checkUserStatus(token) async { - var result = await authService.selectDeviceImei(token); - await setUserValues(result); + void checkUserStatus(token, {isLoader = true}) async { + if (isLoader) + //GifLoaderDialogUtils.showMyDialog(context); + authService + .selectDeviceImei(token) + .then((SelectDeviceIMEIRES value) => setUserValues(value)) + .catchError((err) { + //GifLoaderDialogUtils.hideDialog(context); + }); - if (await sharedPref.getObject(USER_PROFILE) != null) { - var data = AuthenticatedUser.fromJson(await sharedPref.getObject(USER_PROFILE)); - if (data != null) { - authService.registeredAuthenticatedUser(data, token, 0, 0).then((res) => {print(res)}); - authService.getDashboard().then((value) => { - setState(() { - notificationCount = value['List_PatientDashboard'][0]['UnreadPatientNotificationCount'].toString(); - }) - }); - } - } + // if (await sharedPref.getObject(USER_PROFILE) != null) { + // var data = AuthenticatedUser.fromJson(await sharedPref.getObject(USER_PROFILE)); + // if (data != null) { + // authService.registeredAuthenticatedUser(data, token, 0, 0).then((res) => {print(res)}); + // authService.getDashboard().then((value) => { + // setState(() { + // notificationCount = value['List_PatientDashboard'][0]['UnreadPatientNotificationCount'].toString(); + // }) + // }); + // } + // } } + } diff --git a/lib/uitl/utils.dart b/lib/uitl/utils.dart index fdbb1314..b2c52b2b 100644 --- a/lib/uitl/utils.dart +++ b/lib/uitl/utils.dart @@ -4,7 +4,9 @@ import 'dart:typed_data'; import 'package:badges/badges.dart'; import 'package:connectivity/connectivity.dart'; +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/pages/Blood/my_balance_page.dart'; import 'package:diplomaticquarterapp/pages/MyAppointments/MyAppointments.dart'; import 'package:diplomaticquarterapp/pages/insurance/insurance_approval_screen.dart'; @@ -33,6 +35,7 @@ import 'package:diplomaticquarterapp/widgets/dialogs/alert_dialog.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:shared_preferences/shared_preferences.dart'; import '../Constants.dart'; import 'app_shared_preferences.dart'; @@ -491,22 +494,24 @@ class Utils { ), )); } - if (projectViewModel.havePrivilege(32)) { + if (projectViewModel.havePrivilege(32) || true) { medical.add(InkWell( onTap: () { - if (projectViewModel.isLogin) { - String patientID = AuthProvider().getAuthenticatedUser().patientID.toString(); - GifLoaderDialogUtils.showMyDialog(context); - projectViewModel.platformBridge().connectHMGInternetWifi(patientID).then((value) => {GifLoaderDialogUtils.hideDialog(context)}); - } else { - AlertDialogBox( - context: context, - confirmMessage: "Please login with your account first to use this feature", - okText: "OK", - okFunction: () { - AlertDialogBox.closeAlertDialog(context); - }).showAlertDialog(context); - } + userData().then((userData_){ + if (projectViewModel.isLogin && userData_ != null) { + String patientID = userData_.patientID.toString(); + GifLoaderDialogUtils.showMyDialog(context); + projectViewModel.platformBridge().connectHMGInternetWifi(patientID).then((value) => {GifLoaderDialogUtils.hideDialog(context)}); + } else { + AlertDialogBox( + context: context, + confirmMessage: "Please login with your account first to use this feature", + okText: "OK", + okFunction: () { + AlertDialogBox.closeAlertDialog(context); + }).showAlertDialog(context); + } + }); }, child: MedicalProfileItem( title: TranslationBase.of(context).internet, @@ -534,6 +539,11 @@ class Utils { } } +Future userData() async { + var userData = AuthenticatedUser.fromJson(await AppSharedPreferences().getObject(MAIN_USER)); + return userData; +} + // extension function that use in iterations(list.. etc) to iterate items and get index and item it self extension IndexedIterable on Iterable { Iterable mapIndexed(T Function(E e, int i) f) { From d2e1a323ce4aa0b995756cc38de4204d5b05a3e6 Mon Sep 17 00:00:00 2001 From: mosazaid Date: Wed, 13 Jan 2021 13:50:39 +0200 Subject: [PATCH 17/42] simple fix --- lib/pages/pharmacies/screens/cart-order-page.dart | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/pages/pharmacies/screens/cart-order-page.dart b/lib/pages/pharmacies/screens/cart-order-page.dart index 51d93d71..cca6c1df 100644 --- a/lib/pages/pharmacies/screens/cart-order-page.dart +++ b/lib/pages/pharmacies/screens/cart-order-page.dart @@ -28,7 +28,6 @@ class CartOrderPage extends StatelessWidget { child: AppScaffold( appBarTitle: TranslationBase.of(context).shoppingCart, isShowAppBar: true, - isShowDecPage: false, isPharmacy: true, baseViewModel: model, backgroundColor: Colors.white, From 01bfe8464489de10fdcfd0f65822215e59dbc965 Mon Sep 17 00:00:00 2001 From: mosazaid Date: Wed, 13 Jan 2021 14:44:23 +0200 Subject: [PATCH 18/42] solving NearestEr design problem --- lib/pages/ErService/NearestEr.dart | 65 ++++++++++++++++++++++++------ 1 file changed, 52 insertions(+), 13 deletions(-) diff --git a/lib/pages/ErService/NearestEr.dart b/lib/pages/ErService/NearestEr.dart index 227cfb3b..bb8babe1 100644 --- a/lib/pages/ErService/NearestEr.dart +++ b/lib/pages/ErService/NearestEr.dart @@ -42,6 +42,57 @@ class NearestEr extends StatelessWidget { fontWeight: FontWeight.w900, color: new Color(0xFF60686b))), Container( + margin: EdgeInsets.fromLTRB(2.0, 10.0, 0.0, 10.0), + child: GridView.count( + crossAxisCount: 2, + // childAspectRatio: 2.2, + crossAxisSpacing: 10, + mainAxisSpacing: 10, + controller: + new ScrollController(keepScrollOffset: false), + shrinkWrap: true, + padding: const EdgeInsets.all(4.0), + children: List.generate(7, (index) { + return Container( + child: Container( + child: CardPosition( + text: mode + .ProjectAvgERWaitingTimeModeList[index] + .projectName + .toString(), + image: + 'assets/images/new-design/find_us_icon.png', + subText: mode + .ProjectAvgERWaitingTimeModeList[index] + .distanceInKilometers + .toString(), + type: mode + .ProjectAvgERWaitingTimeModeList[index].iD + .toString(), + telephone: mode + .ProjectAvgERWaitingTimeModeList[index] + .phoneNumber + .toString(), + networkImage: mode + .ProjectAvgERWaitingTimeModeList[index] + .projectImageURL + .toString(), + latitude: mode + .ProjectAvgERWaitingTimeModeList[index] + .latitude, + longitude: mode + .ProjectAvgERWaitingTimeModeList[index] + .longitude, + projectname: mode + .ProjectAvgERWaitingTimeModeList[index] + .projectName, + ), + ), + ); + }), + ), + ), + /* Container( margin: EdgeInsets.fromLTRB(0.0, 10.0, 0.0, 10.0), child: Column( mainAxisAlignment: MainAxisAlignment.center, @@ -85,7 +136,6 @@ class NearestEr extends StatelessWidget { .projectName, ), ), - ), Expanded( child: Container( @@ -122,7 +172,6 @@ class NearestEr extends StatelessWidget { .projectName, ), ), - ) ], ), @@ -133,14 +182,12 @@ class NearestEr extends StatelessWidget { Expanded( child: Container( child: CardPosition( - text: mode .ProjectAvgERWaitingTimeModeList[2] .projectName .toString(), image: 'assets/images/new-design/find_us_icon.png', - subText: mode .ProjectAvgERWaitingTimeModeList[2] .distanceInKilometers @@ -167,19 +214,16 @@ class NearestEr extends StatelessWidget { .projectName, ), ), - ), Expanded( child: Container( child: CardPosition( - text: mode .ProjectAvgERWaitingTimeModeList[3] .projectName .toString(), image: 'assets/images/new-design/find_us_icon.png', - subText: mode .ProjectAvgERWaitingTimeModeList[3] .distanceInKilometers @@ -217,14 +261,12 @@ class NearestEr extends StatelessWidget { Expanded( child: Container( child: CardPosition( - text: mode .ProjectAvgERWaitingTimeModeList[4] .projectName .toString(), image: 'assets/images/new-design/find_us_icon.png', - subText: mode .ProjectAvgERWaitingTimeModeList[4] .distanceInKilometers @@ -251,7 +293,6 @@ class NearestEr extends StatelessWidget { .projectName, ), ), - ), Expanded( child: Container( @@ -288,7 +329,6 @@ class NearestEr extends StatelessWidget { .projectName, ), ), - ) ], ), @@ -336,7 +376,7 @@ class NearestEr extends StatelessWidget { ], ), ], - )), + )),*/ ], ), ) @@ -347,4 +387,3 @@ class NearestEr extends StatelessWidget { ); } } - From 5bcc67b77d50b582490a21e20bd731899505286b Mon Sep 17 00:00:00 2001 From: mosazaid Date: Wed, 13 Jan 2021 15:53:31 +0200 Subject: [PATCH 19/42] Nearest Er fix design --- lib/config/localized_values.dart | 8 + lib/pages/ErService/NearestEr.dart | 360 ++---------------- .../ErService/widgets/card_position.dart | 19 +- lib/uitl/translations_delegate_base.dart | 2 + 4 files changed, 61 insertions(+), 328 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index a019ae00..6245735d 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -1457,4 +1457,12 @@ const Map localizedValues = { "en": "Drive-Thru", "ar": "من السيارة" }, + "NearestErDesc": { + "en": "\nThis service Displays nearest branch\n among all the branches of All Habib \n medical Group based on your current Location", + "ar": "\nتعرض هذه الخدمة أقرب فرع\n من بين جميع فروع مجموعة \nالحبيب الطبية بناءً على موقعك الحالي." + }, + "NearestEr": { + "en": "Nearest ER", + "ar": "أقرب ER" + }, }; diff --git a/lib/pages/ErService/NearestEr.dart b/lib/pages/ErService/NearestEr.dart index bb8babe1..eaf0d4ef 100644 --- a/lib/pages/ErService/NearestEr.dart +++ b/lib/pages/ErService/NearestEr.dart @@ -20,6 +20,10 @@ class NearestEr extends StatelessWidget { @override Widget build(BuildContext context) { + var size = MediaQuery.of(context).size; + final double itemHeight = (size.height - kToolbarHeight - 24) / 2; + final double itemWidth = size.width / 2; + return BaseView( onModelReady: appointmentNo != null && projectID != null ? (model) => model.getProjectAvgERWaitingTimeOrders( @@ -27,14 +31,14 @@ class NearestEr extends StatelessWidget { : (model) => model.getProjectAvgERWaitingTimeOrders(), builder: (_, mode, widget) => AppScaffold( isShowAppBar: true, - appBarTitle: 'Nearest ER', + appBarTitle: TranslationBase.of(context).NearestEr, baseViewModel: mode, body: mode.ProjectAvgERWaitingTimeModeList.length > 0 ? Container( child: ListView( children: [ Text( - "\nThis service Displays nearest branch\n among all the branches of All Habib \n medical Group based on your current Location", + "${TranslationBase.of(context).NearestErDesc}", textAlign: TextAlign.center, style: TextStyle( fontSize: 18.0, @@ -45,7 +49,7 @@ class NearestEr extends StatelessWidget { margin: EdgeInsets.fromLTRB(2.0, 10.0, 0.0, 10.0), child: GridView.count( crossAxisCount: 2, - // childAspectRatio: 2.2, + childAspectRatio: (itemWidth / itemWidth), crossAxisSpacing: 10, mainAxisSpacing: 10, controller: @@ -54,329 +58,43 @@ class NearestEr extends StatelessWidget { padding: const EdgeInsets.all(4.0), children: List.generate(7, (index) { return Container( - child: Container( - child: CardPosition( - text: mode - .ProjectAvgERWaitingTimeModeList[index] - .projectName - .toString(), - image: - 'assets/images/new-design/find_us_icon.png', - subText: mode - .ProjectAvgERWaitingTimeModeList[index] - .distanceInKilometers - .toString(), - type: mode - .ProjectAvgERWaitingTimeModeList[index].iD - .toString(), - telephone: mode - .ProjectAvgERWaitingTimeModeList[index] - .phoneNumber - .toString(), - networkImage: mode - .ProjectAvgERWaitingTimeModeList[index] - .projectImageURL - .toString(), - latitude: mode - .ProjectAvgERWaitingTimeModeList[index] - .latitude, - longitude: mode - .ProjectAvgERWaitingTimeModeList[index] - .longitude, - projectname: mode - .ProjectAvgERWaitingTimeModeList[index] - .projectName, - ), + child: CardPosition( + text: mode + .ProjectAvgERWaitingTimeModeList[index] + .projectName + .toString(), + image: + 'assets/images/new-design/find_us_icon.png', + subText: mode + .ProjectAvgERWaitingTimeModeList[index] + .distanceInKilometers + .toString(), + type: mode + .ProjectAvgERWaitingTimeModeList[index].iD + .toString(), + telephone: mode + .ProjectAvgERWaitingTimeModeList[index] + .phoneNumber + .toString(), + networkImage: mode + .ProjectAvgERWaitingTimeModeList[index] + .projectImageURL + .toString(), + latitude: mode + .ProjectAvgERWaitingTimeModeList[index] + .latitude, + longitude: mode + .ProjectAvgERWaitingTimeModeList[index] + .longitude, + projectname: mode + .ProjectAvgERWaitingTimeModeList[index] + .projectName, + cardSize: itemWidth, ), ); }), ), ), - /* Container( - margin: EdgeInsets.fromLTRB(0.0, 10.0, 0.0, 10.0), - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Row( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Expanded( - child: Container( - child: CardPosition( - text: mode - .ProjectAvgERWaitingTimeModeList[0] - .projectName - .toString(), - image: - 'assets/images/new-design/find_us_icon.png', - subText: mode - .ProjectAvgERWaitingTimeModeList[0] - .distanceInKilometers - .toString(), - type: mode - .ProjectAvgERWaitingTimeModeList[0].iD - .toString(), - telephone: mode - .ProjectAvgERWaitingTimeModeList[0] - .phoneNumber - .toString(), - networkImage: mode - .ProjectAvgERWaitingTimeModeList[0] - .projectImageURL - .toString(), - latitude: mode - .ProjectAvgERWaitingTimeModeList[0] - .latitude, - longitude: mode - .ProjectAvgERWaitingTimeModeList[0] - .longitude, - projectname: mode - .ProjectAvgERWaitingTimeModeList[0] - .projectName, - ), - ), - ), - Expanded( - child: Container( - child: CardPosition( - text: mode - .ProjectAvgERWaitingTimeModeList[1] - .projectName - .toString(), - image: - 'assets/images/new-design/find_us_icon.png', - subText: mode - .ProjectAvgERWaitingTimeModeList[1] - .distanceInKilometers - .toString(), - type: mode - .ProjectAvgERWaitingTimeModeList[1].iD - .toString(), - telephone: mode - .ProjectAvgERWaitingTimeModeList[1] - .phoneNumber - .toString(), - networkImage: mode - .ProjectAvgERWaitingTimeModeList[1] - .projectImageURL - .toString(), - latitude: mode - .ProjectAvgERWaitingTimeModeList[1] - .latitude, - longitude: mode - .ProjectAvgERWaitingTimeModeList[1] - .longitude, - projectname: mode - .ProjectAvgERWaitingTimeModeList[1] - .projectName, - ), - ), - ) - ], - ), - Row( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Expanded( - child: Container( - child: CardPosition( - text: mode - .ProjectAvgERWaitingTimeModeList[2] - .projectName - .toString(), - image: - 'assets/images/new-design/find_us_icon.png', - subText: mode - .ProjectAvgERWaitingTimeModeList[2] - .distanceInKilometers - .toString(), - type: mode - .ProjectAvgERWaitingTimeModeList[2].iD - .toString(), - telephone: mode - .ProjectAvgERWaitingTimeModeList[2] - .phoneNumber - .toString(), - networkImage: mode - .ProjectAvgERWaitingTimeModeList[2] - .projectImageURL - .toString(), - latitude: mode - .ProjectAvgERWaitingTimeModeList[2] - .latitude, - longitude: mode - .ProjectAvgERWaitingTimeModeList[2] - .longitude, - projectname: mode - .ProjectAvgERWaitingTimeModeList[2] - .projectName, - ), - ), - ), - Expanded( - child: Container( - child: CardPosition( - text: mode - .ProjectAvgERWaitingTimeModeList[3] - .projectName - .toString(), - image: - 'assets/images/new-design/find_us_icon.png', - subText: mode - .ProjectAvgERWaitingTimeModeList[3] - .distanceInKilometers - .toString(), - type: mode - .ProjectAvgERWaitingTimeModeList[3].iD - .toString(), - telephone: mode - .ProjectAvgERWaitingTimeModeList[3] - .phoneNumber - .toString(), - networkImage: mode - .ProjectAvgERWaitingTimeModeList[3] - .projectImageURL - .toString(), - latitude: mode - .ProjectAvgERWaitingTimeModeList[3] - .latitude, - longitude: mode - .ProjectAvgERWaitingTimeModeList[3] - .longitude, - projectname: mode - .ProjectAvgERWaitingTimeModeList[3] - .projectName, - ), - ), - flex: 0, - ) - ], - ), - Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Expanded( - child: Container( - child: CardPosition( - text: mode - .ProjectAvgERWaitingTimeModeList[4] - .projectName - .toString(), - image: - 'assets/images/new-design/find_us_icon.png', - subText: mode - .ProjectAvgERWaitingTimeModeList[4] - .distanceInKilometers - .toString(), - type: mode - .ProjectAvgERWaitingTimeModeList[4].iD - .toString(), - telephone: mode - .ProjectAvgERWaitingTimeModeList[4] - .phoneNumber - .toString(), - networkImage: mode - .ProjectAvgERWaitingTimeModeList[4] - .projectImageURL - .toString(), - latitude: mode - .ProjectAvgERWaitingTimeModeList[4] - .latitude, - longitude: mode - .ProjectAvgERWaitingTimeModeList[4] - .longitude, - projectname: mode - .ProjectAvgERWaitingTimeModeList[4] - .projectName, - ), - ), - ), - Expanded( - child: Container( - child: CardPosition( - text: mode - .ProjectAvgERWaitingTimeModeList[5] - .projectName - .toString(), - image: - 'assets/images/new-design/find_us_icon.png', - subText: mode - .ProjectAvgERWaitingTimeModeList[5] - .distanceInKilometers - .toString(), - type: mode - .ProjectAvgERWaitingTimeModeList[5].iD - .toString(), - telephone: mode - .ProjectAvgERWaitingTimeModeList[5] - .phoneNumber - .toString(), - networkImage: mode - .ProjectAvgERWaitingTimeModeList[5] - .projectImageURL - .toString(), - latitude: mode - .ProjectAvgERWaitingTimeModeList[5] - .latitude, - longitude: mode - .ProjectAvgERWaitingTimeModeList[5] - .longitude, - projectname: mode - .ProjectAvgERWaitingTimeModeList[5] - .projectName, - ), - ), - ) - ], - ), - Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Expanded( - child: Container( - child: CardPosition( - text: mode - .ProjectAvgERWaitingTimeModeList[6] - .projectName - .toString(), - image: - 'assets/images/new-design/find_us_icon.png', - subText: mode - .ProjectAvgERWaitingTimeModeList[6] - .distanceInKilometers - .toString(), - type: mode - .ProjectAvgERWaitingTimeModeList[6].iD - .toString(), - telephone: mode - .ProjectAvgERWaitingTimeModeList[6] - .phoneNumber - .toString(), - networkImage: mode - .ProjectAvgERWaitingTimeModeList[6] - .projectImageURL - .toString(), - latitude: mode - .ProjectAvgERWaitingTimeModeList[6] - .latitude, - longitude: mode - .ProjectAvgERWaitingTimeModeList[6] - .longitude, - projectname: mode - .ProjectAvgERWaitingTimeModeList[6] - .projectName, - ), - ), - flex: 0, - ), - ], - ), - ], - )),*/ ], ), ) diff --git a/lib/pages/ErService/widgets/card_position.dart b/lib/pages/ErService/widgets/card_position.dart index 8647ad62..69ccaffe 100644 --- a/lib/pages/ErService/widgets/card_position.dart +++ b/lib/pages/ErService/widgets/card_position.dart @@ -19,6 +19,8 @@ class CardPosition extends StatelessWidget { final latitude; final longitude; final projectname; + final cardSize; + const CardPosition( { @required this.image, @@ -30,6 +32,7 @@ class CardPosition extends StatelessWidget { @required this.latitude, @required this.longitude, @required this.projectname , + @required this.cardSize , }); @override @@ -40,17 +43,17 @@ class CardPosition extends StatelessWidget { }, child: Container( - width:MediaQuery.of(context).size.width * 0.47,//165, - margin: EdgeInsets.fromLTRB(7.0, 7.0, 7.0, 7.0), + // width:MediaQuery.of(context).size.width * 0.47,//165, + margin: EdgeInsets.fromLTRB(8.0, 8.0, 8.0, 8.0), decoration: BoxDecoration(boxShadow: [ BoxShadow(color: Colors.grey[400], blurRadius: 2.0, spreadRadius: 0.0) ], borderRadius: BorderRadius.circular(10), color: Colors.white), child: Column( - crossAxisAlignment: CrossAxisAlignment.center, children: [ Container( - margin: EdgeInsets.fromLTRB(10.0, 10.0, 10.0, 0.0), + height: cardSize * 0.2 - 8, + margin: EdgeInsets.fromLTRB(8.0, 8.0, 8.0, 0.0), child: Text(this.text, overflow: TextOverflow.clip, style: TextStyle( @@ -59,12 +62,14 @@ class CardPosition extends StatelessWidget { fontSize: 2 * SizeConfig.textMultiplier)), ), Container( + height: cardSize * 0.5 - 8, alignment: Alignment.center, - margin: EdgeInsets.fromLTRB(0.0, 0.0, 10.0, 8.0), - child: Image.asset(this.image, width: 60.0, height: 60.0), + margin: EdgeInsets.fromLTRB(0.0, 0.0, 8.0, 8.0), + child: Image.asset(this.image, width: 60.0, height: cardSize * 0.4), ), Container( - margin: EdgeInsets.fromLTRB(10.0, 0.0, 10.0, 0.0), + margin: EdgeInsets.fromLTRB(8.0, 0.0, 8.0, 0.0), + height: cardSize * 0.2 - 8, child: Text(this.subText, overflow: TextOverflow.clip, style: TextStyle( diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index 736e7e14..257ceb8e 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -1245,6 +1245,8 @@ class TranslationBase { localizedValues['shoppingCart'][locale.languageCode]; String get covidTest => localizedValues['covidTest'][locale.languageCode]; String get driveThru => localizedValues['driveThru'][locale.languageCode]; + String get NearestErDesc => localizedValues['NearestErDesc'][locale.languageCode]; + String get NearestEr => localizedValues['NearestEr'][locale.languageCode]; } From b63025a9b3ee16bb39c6dbb6b4e791b6f269890a Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Wed, 13 Jan 2021 17:21:14 +0200 Subject: [PATCH 20/42] return CMC HHC --- .../AlHabibMedicalService/cmc_service.dart | 6 +- .../home_health_care_service.dart | 12 +- lib/core/service/client/base_app_client.dart | 2 +- .../Dialog/confirm_cancel_order_dialog.dart | 4 +- .../NewCMC/cmc_location_page.dart | 148 +++++++ .../NewCMC/new_cmc_page.dart | 318 ++++++++------- .../NewCMC/new_cmc_step_one_page.dart | 219 ++++++---- .../NewCMC/new_cmc_step_three_page.dart | 83 ++-- .../NewCMC/new_cmc_step_tow_page.dart | 202 ++++++--- .../ComprehensiveMedicalCheckup/cmc_page.dart | 6 +- .../orders_log_details_page.dart | 102 ++--- .../Dialog/confirm_cancel_order_dialog.dart | 4 +- .../NewHomeHealthCare/location_page.dart | 146 +++++++ .../new_Home_health_care_step_one_page.dart | 53 ++- .../new_Home_health_care_step_three_page.dart | 16 +- .../new_Home_health_care_step_tow_page.dart | 196 ++++++--- .../new_home_health_care_page.dart | 45 +- .../HomeHealthCare/home_health_care_page.dart | 1 + .../orders_log_details_page.dart | 386 +++++++++--------- lib/pages/ContactUs/findus/findus_page.dart | 3 - .../ContactUs/widgets/card_common_contat.dart | 4 +- lib/pages/feedback/send_feedback_page.dart | 26 +- .../dialogs/SelectBeneficiaryDialog.dart | 3 +- .../balance/dialogs/SelectHospitalDialog.dart | 4 +- .../dialogs/SelectPatientFamilyDialog.dart | 4 +- .../dialogs/SelectPatientInfoDialog.dart | 4 +- lib/widgets/buttons/secondary_button.dart | 2 +- .../dialogs/select_location_dialog.dart | 139 +++++++ 28 files changed, 1462 insertions(+), 676 deletions(-) create mode 100644 lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/cmc_location_page.dart create mode 100644 lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/location_page.dart create mode 100644 lib/widgets/dialogs/select_location_dialog.dart diff --git a/lib/core/service/AlHabibMedicalService/cmc_service.dart b/lib/core/service/AlHabibMedicalService/cmc_service.dart index dffa6683..9e99f3ad 100644 --- a/lib/core/service/AlHabibMedicalService/cmc_service.dart +++ b/lib/core/service/AlHabibMedicalService/cmc_service.dart @@ -1,4 +1,5 @@ import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/core/enum/OrderService.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_get_items_request_model.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_get_items_response_model.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_insert_pres_order_request_model.dart'; @@ -47,8 +48,9 @@ class CMCService extends BaseService { await baseAppClient.post(GET_PATIENT_ALL_PRES_ORDERS, onSuccess: (dynamic response, int statusCode) { cmcAllPresOrdersList.clear(); + cmcAllOrderDetail.clear(); response['PatientER_GetPatientAllPresOrdersList'].forEach((data) { - if (data['ServiceID'] == 3) + if (data['ServiceID'] == OrderService.Comprehensive_Medical_Checkup.getIdOrderService()) cmcAllPresOrdersList .add(GetHHCAllPresOrdersResponseModel.fromJson(data)); }); @@ -104,7 +106,7 @@ class CMCService extends BaseService { Future insertPresPresOrder({CMCInsertPresOrderRequestModel order}) async { hasError = false; - await baseAppClient.post(PATIENT_ER_UPDATE_PRES_ORDER, + await baseAppClient.post(PATIENT_ER_INSERT_PRES_ORDER, onSuccess: (dynamic response, int statusCode) { isOrderUpdated = true; }, onFailure: (String error, int statusCode) { diff --git a/lib/core/service/AlHabibMedicalService/home_health_care_service.dart b/lib/core/service/AlHabibMedicalService/home_health_care_service.dart index e636321b..2ec1e310 100644 --- a/lib/core/service/AlHabibMedicalService/home_health_care_service.dart +++ b/lib/core/service/AlHabibMedicalService/home_health_care_service.dart @@ -1,4 +1,5 @@ import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/core/enum/OrderService.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/HHC_get_all_services_request_modle.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/HHC_get_all_services_response_model.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/get_hHC_all_pres_orders_request_model.dart'; @@ -7,6 +8,8 @@ import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealth import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/get_order_detail_by_order_iD_response_model.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/patient_er_insert_pres_order_request_model.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/update_pres_oreder_request_model.dart'; +import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/customer_addresses_service.dart'; +import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/add_new_address_Request_Model.dart'; import '../base_service.dart'; @@ -15,9 +18,10 @@ class HomeHealthCareService extends BaseService { List hhcAllPresOrdersList = List(); List hhcAllOrderDetail = List(); + List addressesList = List(); bool isOrderUpdated; - + CustomerInfo customerInfo; Future getHHCAllServices( HHCGetAllServicesRequestModel hHCGetAllServicesRequestModel) async { hasError = false; @@ -37,11 +41,11 @@ class HomeHealthCareService extends BaseService { GetHHCAllPresOrdersRequestModel getHHCAllPresOrdersRequestModel = GetHHCAllPresOrdersRequestModel(); hasError = false; - await baseAppClient.post(GET_PATIENT_ALL_PRES_ORDERS, + await baseAppClient.post(GET_PATIENT_ALL_PRES_ORD, onSuccess: (dynamic response, int statusCode) { hhcAllPresOrdersList.clear(); response['PatientER_GetPatientAllPresOrdersList'].forEach((data) { - if (data['ServiceID'] == 2) + if (data['ServiceID'] == OrderService.HOME_HEALTH_CARE.getIdOrderService()) hhcAllPresOrdersList .add(GetHHCAllPresOrdersResponseModel.fromJson(data)); }); @@ -91,3 +95,5 @@ class HomeHealthCareService extends BaseService { }, body: order.toJson()); } } + + diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index 8995a4e3..cbe2410d 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -46,7 +46,7 @@ class BaseAppClient { //Map profile = await sharedPref.getObj(DOCTOR_PROFILE); if (!isExternal) { String token = await sharedPref.getString(TOKEN); - var languageID = await sharedPref.getString(APP_LANGUAGE); + var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE,'ar'); var user = await sharedPref.getObject(USER_PROFILE); if (body.containsKey('SetupID')) { body['SetupID'] = body.containsKey('SetupID') diff --git a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/Dialog/confirm_cancel_order_dialog.dart b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/Dialog/confirm_cancel_order_dialog.dart index 45bf01b7..549f90b8 100644 --- a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/Dialog/confirm_cancel_order_dialog.dart +++ b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/Dialog/confirm_cancel_order_dialog.dart @@ -30,7 +30,7 @@ class _ConfirmCancelOrderDialogState extends State { contentPadding: EdgeInsets.fromLTRB(28.0, 24.0, 28.0, 0.0), title: Center( child: Texts( - "Confirm", + TranslationBase.of(context).confirm, color: Colors.black, ), ), @@ -40,7 +40,7 @@ class _ConfirmCancelOrderDialogState extends State { Divider(), Center( child: Texts( - "Are you sure!! want to cancel this order", + TranslationBase.of(context).cancelOrderMsg , color: Colors.grey, ), ), diff --git a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/cmc_location_page.dart b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/cmc_location_page.dart new file mode 100644 index 00000000..4e396427 --- /dev/null +++ b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/cmc_location_page.dart @@ -0,0 +1,148 @@ +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/add_new_address_Request_Model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/cmc_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/home_health_care_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/uitl/utils.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:google_maps_flutter/google_maps_flutter.dart'; +import 'package:google_maps_place_picker/google_maps_place_picker.dart'; +import 'package:provider/provider.dart'; + +class CMCLocationPage extends StatefulWidget { + final Function(PickResult) onPick; + final double latitude; + final double longitude; + final dynamic model; + + const CMCLocationPage({Key key, this.onPick, this.latitude, this.longitude, this.model}) + : super(key: key); + + @override + _CMCLocationPageState createState() => + _CMCLocationPageState(); +} + +class _CMCLocationPageState + extends State { + double latitude = 0; + double longitude = 0; + + @override + void initState() { + + latitude = widget.latitude; + longitude = widget.longitude; + super.initState(); + } + + + @override + Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + return BaseView( + onModelReady: (model) {}, + builder: (_, model, widget) => AppScaffold( + isShowDecPage: false, + isShowAppBar: true, + baseViewModel: model, + body: PlacePicker( + apiKey: GOOGLE_API_KEY, + enableMyLocationButton: true, + automaticallyImplyAppBarLeading: false, + autocompleteOnTrailingWhitespace: true, + selectInitialPosition: true, + autocompleteLanguage: projectViewModel.currentLanguage, + enableMapTypeButton: true, + searchForInitialValue: false, + onPlacePicked: (PickResult result) { + print(result.adrAddress); + + }, + selectedPlaceWidgetBuilder: + (_, selectedPlace, state, isSearchBarFocused) { + print("state: $state, isSearchBarFocused: $isSearchBarFocused"); + return isSearchBarFocused + ? Container() + : FloatingCard( + bottomPosition: 0.0, + leftPosition: 0.0, + rightPosition: 0.0, + width: 500, + borderRadius: BorderRadius.circular(12.0), + child: state == SearchingState.Searching + ? Center(child: CircularProgressIndicator()) + : Container( + margin: EdgeInsets.all(12), + child: Column( + children: [ + SecondaryButton( + color: Colors.grey[800], + textColor: Colors.white, + onTap: () async { + print(selectedPlace); + AddNewAddressRequestModel + addNewAddressRequestModel = + new AddNewAddressRequestModel( + customer: Customer(addresses: [ + Addresses( + address1: + selectedPlace.formattedAddress, + address2: selectedPlace + .formattedAddress, + customerAttributes: "", + city: "", + createdOnUtc: "", + id: 0, + latLong: "$latitude,$longitude", + email: "") + ]), + ); + + selectedPlace.addressComponents.forEach((e) { + if (e.types.contains("country")) { + addNewAddressRequestModel.customer + .addresses[0].country = e.longName; + } + if (e.types.contains("postal_code")) { + addNewAddressRequestModel.customer + .addresses[0].zipPostalCode = + e.longName; + } + if (e.types.contains("locality")) { + addNewAddressRequestModel.customer + .addresses[0].city = + e.longName; + } + }); + + await model.addAddressInfo( + addNewAddressRequestModel: addNewAddressRequestModel); + if (model.state == ViewState.ErrorLocal) { + Utils.showErrorToast(model.error); + } else { + AppToast.showSuccessToast( + message: "Address Added Successfully"); + } + Navigator.of(context).pop(); + }, + label: TranslationBase.of(context).addNewAddress, + ), + ], + ), + ), + ); + }, + initialPosition: LatLng(latitude, longitude), + useCurrentLocation: false, + ), + )); + } +} diff --git a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_page.dart b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_page.dart index 532396cc..ecfe31fb 100644 --- a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_page.dart +++ b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_page.dart @@ -3,15 +3,18 @@ import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/Comprehens import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/get_order_detail_by_order_iD_response_model.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/update_pres_oreder_request_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/cmc_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/Dialog/confirm_cancel_order_dialog.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/HomeHealthCare/StepsWidget.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:flutter/material.dart'; import 'package:geolocator/geolocator.dart'; +import 'package:provider/provider.dart'; import 'new_cmc_step_one_page.dart'; import 'new_cmc_step_three_page.dart'; @@ -46,7 +49,7 @@ class _NewCMCPageState extends State price: widget.model.cmcAllServicesList[0].price, serviceID: widget.model.cmcAllServicesList[0].serviceID.toString(), selectedServiceName: widget.model.cmcAllServicesList[0].description, - selectedServiceNameAR: widget.model.cmcAllServicesList[0].description, + selectedServiceNameAR: widget.model.cmcAllServicesList[0].descriptionN, recordID: 1, totalPrice: widget.model.cmcAllServicesList[0].totalPrice, vAT: widget.model.cmcAllServicesList[0].vAT); @@ -85,6 +88,8 @@ class _NewCMCPageState extends State @override Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + void showConfirmMessage( CMCViewModel model, GetOrderDetailByOrderIDResponseModel order) { showDialog( @@ -101,7 +106,7 @@ class _NewCMCPageState extends State if (model.state == ViewState.ErrorLocal) { Utils.showErrorToast(model.error); } else { - AppToast.showSuccessToast(message: "Done Successfully"); + AppToast.showSuccessToast(message:TranslationBase.of(context).processDoneSuccessfully ); await model.getCmcAllPresOrders(); } }, @@ -134,183 +139,192 @@ class _NewCMCPageState extends State children: [ widget.model.cmcAllOrderDetail.length != 0 ? FractionallySizedBox( - heightFactor: 0.8, widthFactor: 0.9, - child: Container( - width: double.infinity, - margin: EdgeInsets.only(top: 15), - decoration: BoxDecoration( - border: - Border.all(color: Colors.grey, width: 1), - borderRadius: BorderRadius.circular(12), - color: Colors.white), + child: SingleChildScrollView( child: Column( - crossAxisAlignment: CrossAxisAlignment.start, children: [ - SizedBox( - height: 12, - ), Container( width: double.infinity, - padding: EdgeInsets.only( - left: 15, bottom: 15, top: 15), + margin: EdgeInsets.only(top: 15), decoration: BoxDecoration( - border: Border( - bottom: BorderSide( - color: Colors.grey, - width: 1.0, - ), - ), - // borderRadius: BorderRadius.circular(12), + border: + Border.all(color: Colors.grey, width: 1), + borderRadius: BorderRadius.circular(12), color: Colors.white), child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ - Texts( - "Request ID", - bold: false, - fontSize: 13, - ), SizedBox( - height: 4, + height: 12, ), - Texts( - widget.model.cmcAllOrderDetail[0].iD.toString(), - fontSize: 22, - ), - ], - ), - ), - Container( - width: double.infinity, - padding: EdgeInsets.only( - left: 15, bottom: 15, top: 15), - decoration: BoxDecoration( - border: Border( - bottom: BorderSide( - color: Colors.grey, - width: 1.0, + Container( + width: double.infinity, + padding: EdgeInsets.only( + left: 15, bottom: 15, top: 15,right: 15), + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + color: Colors.grey, + width: 1.0, + ), + ), + // borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts( + TranslationBase + .of(context) + .requestID, + bold: false, + fontSize: 13, + ), + SizedBox( + height: 4, + ), + Texts( + widget.model.cmcAllOrderDetail[0].iD.toString(), + fontSize: 22, + ), + ], ), ), - // borderRadius: BorderRadius.circular(12), - color: Colors.white), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Texts( - "Status", - bold: false, - fontSize: 13, - ), - SizedBox( - height: 4, - ), - Texts( - "Pending", - fontSize: 22, + Container( + width: double.infinity, + padding: EdgeInsets.only( + left: 15, bottom: 15, top: 15,right: 15), + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + color: Colors.grey, + width: 1.0, + ), + ), + // borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts( + TranslationBase + .of(context) + .OrderStatus, + bold: false, + fontSize: 13, + ), + SizedBox( + height: 4, + ), + Texts( + + projectViewModel.isArabic ? widget.model.cmcAllOrderDetail[0] + .descriptionN : widget.model.cmcAllOrderDetail[0].description, + fontSize: 22, + ), + ], + ), ), - ], - ), - ), - Container( - width: double.infinity, - padding: EdgeInsets.only( - left: 15, bottom: 15, top: 15), - decoration: BoxDecoration( - border: Border( - bottom: BorderSide( - color: Colors.grey, - width: 1.0, + Container( + width: double.infinity, + padding: EdgeInsets.only( + left: 15, bottom: 15, top: 15,right: 15), + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + color: Colors.grey, + width: 1.0, + ), + ), + // borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts( + TranslationBase.of(context).pickupDate, + bold: false, + fontSize: 13, + ), + SizedBox( + height: 4, + ), + Texts( + DateUtil.getDayMonthYearDateFormatted( + DateUtil.convertStringToDate(widget.model.cmcAllOrderDetail[0].createdOn)), + fontSize: 22, + ), + ], ), ), - // borderRadius: BorderRadius.circular(12), - color: Colors.white), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Texts( - "Pickup Date", - bold: false, - fontSize: 13, + Container( + width: double.infinity, + padding: EdgeInsets.only( + left: 15, bottom: 15, top: 15), + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + color: Colors.grey, + width: 1.0, + ), + ), + // borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Texts( + TranslationBase.of(context).serviceName, + bold: false, + fontSize: 13, + ), + SizedBox( + height: 4, + ), + Texts( + !projectViewModel.isArabic?widget.model.cmcAllOrderDetail[0].description + .toString() : + widget.model.cmcAllOrderDetail[0] + .descriptionN + .toString(), + fontSize: 22, + ), + ], + ), ), SizedBox( - height: 4, - ), - Texts( - DateUtil.getDayMonthYearDateFormatted( - DateUtil.convertStringToDate( - widget.model.cmcAllOrderDetail[0] - .createdOn)), - fontSize: 22, + height: 12, ), - ], - ), - ), - Container( - width: double.infinity, - padding: EdgeInsets.only( - left: 15, bottom: 15, top: 15), - decoration: BoxDecoration( - border: Border( - bottom: BorderSide( - color: Colors.grey, - width: 1.0, + Center( + child: Container( + width: MediaQuery + .of(context) + .size + .width * + 0.85, + child: SecondaryButton( + label: TranslationBase.of(context).cancel.toUpperCase(), + onTap: () { + showConfirmMessage(widget.model, + widget.model.cmcAllOrderDetail[0]); + } + , + color: Colors.red[800], + disabled: false, + textColor: Theme + .of(context) + .backgroundColor), ), ), - // borderRadius: BorderRadius.circular(12), - color: Colors.white), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Texts( - "Service Name", - bold: false, - fontSize: 13, - ), SizedBox( - height: 4, - ), - Texts( - widget.model.cmcAllOrderDetail[0].description - .toString() ?? - widget.model.cmcAllOrderDetail[0] - .descriptionN - .toString(), - fontSize: 22, + height: 22, ), ], ), ), SizedBox( - height: 12, - ), - Center( - child: Container( - width: MediaQuery - .of(context) - .size - .width * - 0.85, - child: SecondaryButton( - label: "Cancel".toUpperCase(), - onTap: () { - showConfirmMessage(widget.model, - widget.model.cmcAllOrderDetail[0]); - } - , - color: Colors.red[800], - disabled: false, - textColor: Theme - .of(context) - .backgroundColor), - ), - ), - SizedBox( - height: 12, + height: 22, ), ], ), diff --git a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_one_page.dart b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_one_page.dart index 02d099b4..b80d125a 100644 --- a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_one_page.dart +++ b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_one_page.dart @@ -1,11 +1,16 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_get_items_request_model.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_insert_pres_order_request_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/cmc_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; class NewCMCStepOnePage extends StatefulWidget { final CMCInsertPresOrderRequestModel cMCInsertPresOrderRequestModel; @@ -31,6 +36,8 @@ class _NewCMCStepOnePageState extends State { @override Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + return AppScaffold( isShowAppBar: false, baseViewModel: widget.model, @@ -50,17 +57,17 @@ class _NewCMCStepOnePageState extends State { height: 20, ), Texts( - "Select Home Health Care Services", + TranslationBase.of(context).selectService, textAlign: TextAlign.center, ), Column( children: - widget.model.cmcAllServicesList.map((service) { + widget.model.cmcAllServicesList.map((service) { return Container( margin: EdgeInsets.only(top: 15), decoration: BoxDecoration( border: - Border.all(color: Colors.grey, width: 1), + Border.all(color: Colors.grey, width: 1), borderRadius: BorderRadius.circular(12), color: Colors.white), child: Column( @@ -72,50 +79,53 @@ class _NewCMCStepOnePageState extends State { activeColor: Colors.red[800], onChanged: (newValue) async { PatientERCMCInsertServicesList - patientERCMCInsertServicesList = - new PatientERCMCInsertServicesList( - price: service.price, - serviceID: service.serviceID - .toString(), - selectedServiceName: - service.description, - selectedServiceNameAR: - service.description, - recordID: 1, - totalPrice: - service.totalPrice, - vAT: service.vAT); + patientERCMCInsertServicesList = + new PatientERCMCInsertServicesList( + price: service.price, + serviceID: service.serviceID + .toString(), + selectedServiceName: + service.description, + selectedServiceNameAR: + service.descriptionN, + recordID: 1, + totalPrice: + service.totalPrice, + vAT: service.vAT); setState(() { widget .cMCInsertPresOrderRequestModel - .patientERCMCInsertServicesList = [ + .patientERCMCInsertServicesList = + [ patientERCMCInsertServicesList ]; }); CMCGetItemsRequestModel - cMCGetItemsRequestModel = - new CMCGetItemsRequestModel( - checkupType: newValue); + cMCGetItemsRequestModel = + new CMCGetItemsRequestModel( + checkupType: newValue); await widget.model.getCheckupItems( cMCGetItemsRequestModel: - cMCGetItemsRequestModel); + cMCGetItemsRequestModel); }, groupValue: widget - .cMCInsertPresOrderRequestModel - .patientERCMCInsertServicesList - .length > - 0 + .cMCInsertPresOrderRequestModel + .patientERCMCInsertServicesList + .length > + 0 ? int.parse(widget - .cMCInsertPresOrderRequestModel - .patientERCMCInsertServicesList[ - 0] - .serviceID) + .cMCInsertPresOrderRequestModel + .patientERCMCInsertServicesList[ + 0] + .serviceID) : 1), Expanded( child: Padding( padding: const EdgeInsets.all(20.0), child: Texts( - service.description, + projectViewModel.isArabic ? service + .descriptionN : service + .description, fontSize: 15, ), ), @@ -137,52 +147,67 @@ class _NewCMCStepOnePageState extends State { color: Colors.white, width: double.infinity, child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: widget.model.checkupItems.map((item) { - return Center( - child: FractionallySizedBox( - widthFactor: 1, - child: Container( - margin: EdgeInsets.only(top: 15), - decoration: BoxDecoration(color: Colors.white), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 12, - ), - Container( - width: double.infinity, - padding: EdgeInsets.only( - left: 15, bottom: 5, top: 5), - decoration: BoxDecoration( - border: BorderDirectional( - bottom: BorderSide( - style: BorderStyle.solid, - width: 0.5, - color: Colors.grey)), - //borderRadius: , - color: Colors.white), - child: Column( - crossAxisAlignment: + children: [ + Row( + children: [ + Container(margin: EdgeInsets.only( + right: 10, left: 10), child: Texts(TranslationBase.of(context).coveredService, fontWeight: FontWeight.bold,)) + ], + ), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: widget.model.checkupItems.map((item) { + return Center( + child: FractionallySizedBox( + widthFactor: 1, + child: Container( + margin: EdgeInsets.only(top: 15), + decoration: BoxDecoration( + color: Colors.white), + child: Column( + crossAxisAlignment: CrossAxisAlignment + .start, + children: [ + SizedBox( + height: 12, + ), + Container( + width: double.infinity, + padding: EdgeInsets.only( + left: 15, bottom: 5, top: 5), + decoration: BoxDecoration( + border: BorderDirectional( + bottom: BorderSide( + style: BorderStyle.solid, + width: 0.5, + color: Colors.grey)), + //borderRadius: , + color: Colors.white), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Texts( - item.itemName, - fontSize: 15, + children: [ + Container(margin: EdgeInsets.only( + right: 10, left: 10), + child: Texts( + item.itemName, + fontSize: 15, fontWeight: FontWeight.bold + ), + ), + ], ), - ], - ), - ), - SizedBox( - height: 12, + ), + SizedBox( + height: 12, + ), + ], ), - ], + ), ), - ), - ), - ); - }).toList()), + ); + }).toList()), + ], + ), ) ], ), @@ -197,28 +222,48 @@ class _NewCMCStepOnePageState extends State { Container( width: MediaQuery.of(context).size.width * 0.9, child: SecondaryButton( - label: "Next", - textColor: Theme.of(context).backgroundColor, - onTap: () { - if (widget.cMCInsertPresOrderRequestModel.patientERCMCInsertServicesList.length = null) { + label: TranslationBase + .of(context) + .next, + textColor: Theme + .of(context) + .backgroundColor, + color: Colors.grey[800], + onTap: () async { + if (widget.cMCInsertPresOrderRequestModel + .patientERCMCInsertServicesList.length != + 0 || + widget.cMCInsertPresOrderRequestModel + .patientERCMCInsertServicesList == + null) { int index = widget.model.cmcAllServicesList.length; PatientERCMCInsertServicesList - patientERCMCInsertServicesList = - new PatientERCMCInsertServicesList( - price: widget.model.cmcAllServicesList[index-1].price, - serviceID: widget.model.cmcAllServicesList[index-1].serviceID.toString(), - selectedServiceName: widget.model.cmcAllServicesList[index-1].description, - selectedServiceNameAR: widget.model.cmcAllServicesList[index-1].description, - recordID: 1, - totalPrice: widget.model.cmcAllServicesList[index-1].totalPrice, - vAT: widget.model.cmcAllServicesList[index-1].vAT); + patientERCMCInsertServicesList = + new PatientERCMCInsertServicesList( + price: widget + .model.cmcAllServicesList[index - 1].price, + serviceID: widget + .model.cmcAllServicesList[index - 1].serviceID + .toString(), + selectedServiceName: widget.model + .cmcAllServicesList[index - 1].description, + selectedServiceNameAR: widget.model + .cmcAllServicesList[index - 1].descriptionN, + recordID: 1, + totalPrice: widget + .model.cmcAllServicesList[index - 1].totalPrice, + vAT: widget.model.cmcAllServicesList[index - 1].vAT); widget.cMCInsertPresOrderRequestModel .patientERCMCInsertServicesList = [ patientERCMCInsertServicesList ]; - - widget.changePageViewIndex(1); + await widget.model.getCustomerInfo(); + if (widget.model.state == ViewState.ErrorLocal) { + Utils.showErrorToast(); + } else { + widget.changePageViewIndex(1); + } } }, ), diff --git a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_three_page.dart b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_three_page.dart index e48bb5d5..eea9853b 100644 --- a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_three_page.dart +++ b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_three_page.dart @@ -2,15 +2,16 @@ import 'dart:async'; import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_insert_pres_order_request_model.dart'; -import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/patient_er_insert_pres_order_request_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/cmc_view_model.dart'; -import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/home_health_care_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:google_maps_flutter/google_maps_flutter.dart'; +import 'package:provider/provider.dart'; class NewCMCStepThreePage extends StatefulWidget { final CMCInsertPresOrderRequestModel cmcInsertPresOrderRequestModel; @@ -63,19 +64,23 @@ class _NewCMCStepThreePageState @override Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); return AppScaffold( isShowDecPage: false, baseViewModel: widget.model, body: SingleChildScrollView( physics: BouncingScrollPhysics(), child: Container( - height: 400, + height: 500, width: double.maxFinite, margin: EdgeInsets.only(left: 12, right: 12), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Texts('Order Details'), + Texts( + TranslationBase.of(context).orderDetails, + fontWeight: FontWeight.bold, + ), SizedBox( height: 12, ), @@ -87,7 +92,9 @@ class _NewCMCStepThreePageState child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Texts('Location :'), + Texts(TranslationBase + .of(context) + .orderLocation + " : ", fontWeight: FontWeight.bold,), SizedBox( height: 12, ), @@ -108,30 +115,40 @@ class _NewCMCStepThreePageState SizedBox( height: 12, ), - Texts('Selected Service :'), + Texts(TranslationBase + .of(context) + .selectedService), ...List.generate( - widget.cmcInsertPresOrderRequestModel.patientERCMCInsertServicesList.length, - (index) => Container( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Texts( - 'Service Name :', - fontSize: 12, - ), - SizedBox( - height: 5, - ), - Texts( - widget - .cmcInsertPresOrderRequestModel.patientERCMCInsertServicesList[index] - .selectedServiceName, - fontSize: 15, - bold: true, + widget.cmcInsertPresOrderRequestModel + .patientERCMCInsertServicesList.length, + (index) => + Container( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts( + TranslationBase + .of(context) + .serviceName, + fontSize: 12, fontWeight: FontWeight.bold, + ), + SizedBox( + height: 5, + ), + Texts( + projectViewModel.isArabic ? widget + .cmcInsertPresOrderRequestModel + .patientERCMCInsertServicesList[index] + .selectedServiceNameAR : widget + .cmcInsertPresOrderRequestModel + .patientERCMCInsertServicesList[index] + .selectedServiceName, + fontSize: 15, + bold: true, + ), + ], ), - ], - ), - ), + ), ) ], ), @@ -148,14 +165,20 @@ class _NewCMCStepThreePageState Container( width: MediaQuery.of(context).size.width * 0.9, child: SecondaryButton( - label: "Confirm", + label: TranslationBase + .of(context) + .confirm, + color: Colors.grey[800], onTap: () async { - await widget.model.insertPresPresOrder(order: widget.cmcInsertPresOrderRequestModel); + await widget.model.insertPresPresOrder( + order: widget.cmcInsertPresOrderRequestModel); if (widget.model.state != ViewState.ErrorLocal) { widget.changePageViewIndex(0); } }, - textColor: Theme.of(context).backgroundColor), + textColor: Theme + .of(context) + .backgroundColor), ), ], ), diff --git a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_tow_page.dart b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_tow_page.dart index 27cddfe3..cc8ea8dd 100644 --- a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_tow_page.dart +++ b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_tow_page.dart @@ -1,19 +1,22 @@ import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_insert_pres_order_request_model.dart'; -import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/patient_er_insert_pres_order_request_model.dart'; +import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/customer_addresses_service.dart'; import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/cmc_view_model.dart'; -import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/home_health_care_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/widgets/dialogs/select_location_dialog.dart'; +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/location_page.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; -import 'package:diplomaticquarterapp/widgets/others/close_back.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:google_maps_place_picker/google_maps_place_picker.dart'; import 'package:google_maps_flutter/google_maps_flutter.dart'; +import 'package:google_maps_place_picker/google_maps_place_picker.dart'; import 'package:provider/provider.dart'; +import 'cmc_location_page.dart'; + class NewCMCStepTowPage extends StatefulWidget { final Function(PickResult) onPick; final double latitude; @@ -41,12 +44,13 @@ class _NewCMCStepTowPageState extends State { double latitude = 0; double longitude = 0; + AddressInfo _selectedAddress; + @override void initState() { if (widget.cmcInsertPresOrderRequestModel.latitude == null) { - latitude = widget.latitude; - longitude = widget.longitude; + setLatitudeAndLongitude(); } else { latitude = widget.cmcInsertPresOrderRequestModel.latitude; longitude = widget.cmcInsertPresOrderRequestModel.longitude; @@ -54,60 +58,152 @@ class _NewCMCStepTowPageState super.initState(); } + setLatitudeAndLongitude({bool isSetState = false, String latLong}) { + if (latLong == null) + latLong = widget.model.addressesList[widget.model.addressesList + .length - 1].latLong; + List latLongArr = latLong.split(','); + + latitude = double.parse(latLongArr[0]); + longitude = double.parse(latLongArr[1]); + } @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); - return AppScaffold( + return AppScaffold( isShowDecPage: false, - body: PlacePicker( - apiKey: GOOGLE_API_KEY, - enableMyLocationButton: true, - automaticallyImplyAppBarLeading: false, - autocompleteOnTrailingWhitespace: true, - selectInitialPosition: true, - autocompleteLanguage: projectViewModel.currentLanguage, - enableMapTypeButton: true, - onPlacePicked: (PickResult result) { - print(result.adrAddress); - widget.changePageViewIndex(3); - }, - selectedPlaceWidgetBuilder: - (_, selectedPlace, state, isSearchBarFocused) { - print("state: $state, isSearchBarFocused: $isSearchBarFocused"); - return isSearchBarFocused - ? Container() - : FloatingCard( - bottomPosition: 0.0, - leftPosition: 0.0, - rightPosition: 0.0, - width: 500, - borderRadius: BorderRadius.circular(12.0), - child: state == SearchingState.Searching - ? Center(child: CircularProgressIndicator()) - : Container( - margin: EdgeInsets.all(12), - child: SecondaryButton( - color: Colors.grey[800], - textColor: Colors.white, - onTap: () { - setState(() { - widget.cmcInsertPresOrderRequestModel - .latitude = - selectedPlace.geometry.location.lat; - widget.cmcInsertPresOrderRequestModel - .longitude = - selectedPlace.geometry.location.lng; - }); - widget.changePageViewIndex(3); - }, - label: TranslationBase.of(context).next, - ), + body: Stack( + children: [ + PlacePicker( + apiKey: GOOGLE_API_KEY, + enableMyLocationButton: true, + automaticallyImplyAppBarLeading: false, + autocompleteOnTrailingWhitespace: true, + selectInitialPosition: true, + autocompleteLanguage: projectViewModel.currentLanguage, + enableMapTypeButton: true, + searchForInitialValue: false, + + onPlacePicked: (PickResult result) { + print(result.adrAddress); + widget.changePageViewIndex(3); + }, + selectedPlaceWidgetBuilder: + (_, selectedPlace, state, isSearchBarFocused) { + print("state: $state, isSearchBarFocused: $isSearchBarFocused"); + return isSearchBarFocused + ? Container() + : FloatingCard( + bottomPosition: 0.0, + leftPosition: 0.0, + rightPosition: 0.0, + width: 500, + borderRadius: BorderRadius.circular(12.0), + child: state == SearchingState.Searching + ? Center(child: CircularProgressIndicator()) + : Container( + margin: EdgeInsets.all(12), + child: Column( + children: [ + SecondaryButton( + color: Colors.grey[800], + textColor: Colors.white, + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (BuildContext context) => + CMCLocationPage( + latitude: latitude, + longitude: longitude, + + ), + ), + ); + }, + label: TranslationBase.of(context).addNewAddress, + ), + SizedBox(height: 10,), + SecondaryButton( + color: Colors.red + [800], + textColor: Colors.white, + onTap: () { + setState(() { + widget.cmcInsertPresOrderRequestModel + .latitude = + selectedPlace.geometry.location.lat; + widget.cmcInsertPresOrderRequestModel + .longitude = + selectedPlace.geometry.location.lng; + }); + widget.changePageViewIndex(3); + }, + label: TranslationBase.of(context).confirm, ), - ); + ], + ) + ), + ); + }, + initialPosition: LatLng(latitude, longitude), + useCurrentLocation: false, + ), + Container( + child: InkWell( + onTap: () => + confirmSelectLocationDialog(widget.model.addressesList), + child: Container( + padding: EdgeInsets.all(10), + width: double.infinity, + // height: 65, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(10), + color: Colors.white), + child: Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Expanded(child: Texts(getAddressName(), fontSize: 14,),), + Icon(Icons.arrow_drop_down) + ], + ), + ), + ), + height: 56, width: double.infinity, color: Theme + .of(context) + .scaffoldBackgroundColor, + + ) + ], + ), + ); + + + } + + + void confirmSelectLocationDialog(List addresses) { + showDialog( + context: context, + child: SelectLocationDialog( + addresses: addresses, + selectedAddress: _selectedAddress + , + onValueSelected: (value) { + setLatitudeAndLongitude(latLong: value.latLong); + setState(() { + _selectedAddress = value; + }); }, - initialPosition: LatLng(latitude, longitude), - useCurrentLocation: true, ), ); } + + String getAddressName() { + if (_selectedAddress != null) + return _selectedAddress.address1; + else + return TranslationBase.of(context).selectAddress; + } } diff --git a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_page.dart b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_page.dart index 95d02d1f..c73f328d 100644 --- a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_page.dart +++ b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_page.dart @@ -40,7 +40,8 @@ class _CMCPageState extends State }, builder: (_, model, widget) => AppScaffold( isShowAppBar: true, - appBarTitle: TranslationBase.of(context).homeHealthCare, + description: TranslationBase.of(context).HHCNotAuthMsg, + appBarTitle: TranslationBase.of(context).comprehensiveMedicalCheckup, body: Scaffold( extendBodyBehindAppBar: true, appBar: PreferredSize( @@ -88,7 +89,8 @@ class _CMCPageState extends State Container( width: MediaQuery.of(context).size.width * 0.37, child: Center( - child: Texts("CMC Service"), + child: Texts(TranslationBase.of(context) + .comprehensiveMedicalCheckup), ), ), Container( diff --git a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/orders_log_details_page.dart b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/orders_log_details_page.dart index 6c915a4c..ec686e70 100644 --- a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/orders_log_details_page.dart +++ b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/orders_log_details_page.dart @@ -2,13 +2,16 @@ import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/get_hhc_all_pres_orders_response_model.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/update_pres_oreder_request_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/cmc_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; import 'Dialog/confirm_cancel_order_dialog.dart'; @@ -19,6 +22,9 @@ class OrdersLogDetailsPage extends StatelessWidget { @override Widget build(BuildContext context) { + + ProjectViewModel projectViewModel = Provider.of(context); + void showConfirmMessage( CMCViewModel model, GetHHCAllPresOrdersResponseModel order) { showDialog( @@ -35,7 +41,7 @@ class OrdersLogDetailsPage extends StatelessWidget { if(model.state == ViewState.ErrorLocal) { Utils.showErrorToast(model.error); } else { - AppToast.showSuccessToast(message: "Done Successfully"); + AppToast.showSuccessToast(message:TranslationBase.of(context).processDoneSuccessfully ); await model.getCmcAllPresOrders(); } }, @@ -78,7 +84,7 @@ class OrdersLogDetailsPage extends StatelessWidget { Container( width: double.infinity, padding: EdgeInsets.only( - left: 15, bottom: 15, top: 15), + left: 15, bottom: 15, top: 15,right: 15), decoration: BoxDecoration( border: Border( bottom: BorderSide( @@ -89,11 +95,12 @@ class OrdersLogDetailsPage extends StatelessWidget { // borderRadius: BorderRadius.circular(12), color: Colors.white), child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ Texts( - "Request ID", + TranslationBase + .of(context) + .requestID, bold: false, fontSize: 13, ), @@ -110,7 +117,7 @@ class OrdersLogDetailsPage extends StatelessWidget { Container( width: double.infinity, padding: EdgeInsets.only( - left: 15, bottom: 15, top: 15), + left: 15, bottom: 15, top: 15,right: 15), decoration: BoxDecoration( border: Border( bottom: BorderSide( @@ -121,11 +128,12 @@ class OrdersLogDetailsPage extends StatelessWidget { // borderRadius: BorderRadius.circular(12), color: Colors.white), child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ Texts( - "Status", + TranslationBase + .of(context) + .OrderStatus, bold: false, fontSize: 13, ), @@ -133,7 +141,9 @@ class OrdersLogDetailsPage extends StatelessWidget { height: 4, ), Texts( - order.description, + + projectViewModel.isArabic ? order + .descriptionN : order.description, fontSize: 22, ), ], @@ -142,7 +152,7 @@ class OrdersLogDetailsPage extends StatelessWidget { Container( width: double.infinity, padding: EdgeInsets.only( - left: 15, bottom: 15, top: 15), + left: 15, bottom: 15, top: 15,right: 15), decoration: BoxDecoration( border: Border( bottom: BorderSide( @@ -153,11 +163,10 @@ class OrdersLogDetailsPage extends StatelessWidget { // borderRadius: BorderRadius.circular(12), color: Colors.white), child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ Texts( - "Pickup Date", + TranslationBase.of(context).pickupDate, bold: false, fontSize: 13, ), @@ -166,8 +175,7 @@ class OrdersLogDetailsPage extends StatelessWidget { ), Texts( DateUtil.getDayMonthYearDateFormatted( - DateUtil.convertStringToDate( - order.createdOn)), + DateUtil.convertStringToDate(order.createdOn)), fontSize: 22, ), ], @@ -176,7 +184,7 @@ class OrdersLogDetailsPage extends StatelessWidget { Container( width: double.infinity, padding: EdgeInsets.only( - left: 15, bottom: 15, top: 15), + left: 15, bottom: 15, top: 15,right: 15), decoration: BoxDecoration( border: Border( bottom: BorderSide( @@ -191,7 +199,7 @@ class OrdersLogDetailsPage extends StatelessWidget { CrossAxisAlignment.start, children: [ Texts( - "Location", + TranslationBase.of(context).orderLocation, bold: false, fontSize: 13, ), @@ -199,10 +207,11 @@ class OrdersLogDetailsPage extends StatelessWidget { height: 4, ), Texts( - order.nearestProjectDescription - .toString() ?? - order.nearestProjectDescriptionN - .toString(), + !projectViewModel.isArabic?order. + projectDescription.toString() : + order + .projectDescriptionN + .toString(), fontSize: 22, ), ], @@ -212,32 +221,33 @@ class OrdersLogDetailsPage extends StatelessWidget { height: 12, ), if (order.status == 1 ||order.status == 2 ) - Center( - child: Container( - width: MediaQuery - .of(context) - .size - .width * - 0.85, - child: SecondaryButton( - label: "Cancel".toUpperCase(), - onTap: () { - showConfirmMessage(model, order); - } - , - color: Colors.red[800], - disabled: false, - textColor: Theme - .of(context) - .backgroundColor), - ), + Center( + child: Container( + width: MediaQuery + .of(context) + .size + .width * + 0.85, + child: SecondaryButton( + label: TranslationBase.of(context).cancel.toUpperCase(), + onTap: () { + showConfirmMessage(model, + order); + } + , + color: Colors.red[800], + disabled: false, + textColor: Theme + .of(context) + .backgroundColor), ), + ), SizedBox( - height: 12, - ), - ], - ), - ); + height: 22, + ), + ], + ), + ); }).toList()) ], ), diff --git a/lib/pages/AlHabibMedicalService/HomeHealthCare/Dialog/confirm_cancel_order_dialog.dart b/lib/pages/AlHabibMedicalService/HomeHealthCare/Dialog/confirm_cancel_order_dialog.dart index 17be8edd..bfab0324 100644 --- a/lib/pages/AlHabibMedicalService/HomeHealthCare/Dialog/confirm_cancel_order_dialog.dart +++ b/lib/pages/AlHabibMedicalService/HomeHealthCare/Dialog/confirm_cancel_order_dialog.dart @@ -29,7 +29,7 @@ class _ConfirmCancelOrderDialogState extends State { contentPadding: EdgeInsets.fromLTRB(28.0, 24.0, 28.0, 0.0), title: Center( child: Texts( - "Confirm", + TranslationBase.of(context).confirm, color: Colors.black, ), ), @@ -39,7 +39,7 @@ class _ConfirmCancelOrderDialogState extends State { Divider(), Center( child: Texts( - "Are you sure!! want to cancel this order", + TranslationBase.of(context).cancelOrderMsg , color: Colors.grey, ), ), diff --git a/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/location_page.dart b/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/location_page.dart new file mode 100644 index 00000000..4bf3a762 --- /dev/null +++ b/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/location_page.dart @@ -0,0 +1,146 @@ +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/add_new_address_Request_Model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/home_health_care_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/uitl/utils.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:google_maps_flutter/google_maps_flutter.dart'; +import 'package:google_maps_place_picker/google_maps_place_picker.dart'; +import 'package:provider/provider.dart'; + +class LocationPage extends StatefulWidget { + final Function(PickResult) onPick; + final double latitude; + final double longitude; + final dynamic model; + + const LocationPage({Key key, this.onPick, this.latitude, this.longitude, this.model}) + : super(key: key); + + @override + _LocationPageState createState() => + _LocationPageState(); +} + +class _LocationPageState + extends State { + double latitude = 0; + double longitude = 0; + + @override + void initState() { + + latitude = widget.latitude; + longitude = widget.longitude; + super.initState(); + } + + + @override + Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + return BaseView( + onModelReady: (model) {}, + builder: (_, model, widget) => AppScaffold( + isShowDecPage: false, + isShowAppBar: true, + baseViewModel: model, + body: PlacePicker( + apiKey: GOOGLE_API_KEY, + enableMyLocationButton: true, + automaticallyImplyAppBarLeading: false, + autocompleteOnTrailingWhitespace: true, + selectInitialPosition: true, + autocompleteLanguage: projectViewModel.currentLanguage, + enableMapTypeButton: true, + searchForInitialValue: false, + onPlacePicked: (PickResult result) { + print(result.adrAddress); + + }, + selectedPlaceWidgetBuilder: + (_, selectedPlace, state, isSearchBarFocused) { + print("state: $state, isSearchBarFocused: $isSearchBarFocused"); + return isSearchBarFocused + ? Container() + : FloatingCard( + bottomPosition: 0.0, + leftPosition: 0.0, + rightPosition: 0.0, + width: 500, + borderRadius: BorderRadius.circular(12.0), + child: state == SearchingState.Searching + ? Center(child: CircularProgressIndicator()) + : Container( + margin: EdgeInsets.all(12), + child: Column( + children: [ + SecondaryButton( + color: Colors.grey[800], + textColor: Colors.white, + onTap: () async { + AddNewAddressRequestModel + addNewAddressRequestModel = + new AddNewAddressRequestModel( + customer: Customer(addresses: [ + Addresses( + address1: + selectedPlace.formattedAddress, + address2: selectedPlace + .formattedAddress, + customerAttributes: "", + city: "", + createdOnUtc: "", + id: 0, + latLong: "$latitude,$longitude", + email: "") + ]), + ); + + selectedPlace.addressComponents.forEach((e) { + if (e.types.contains("country")) { + addNewAddressRequestModel.customer + .addresses[0].country = e.longName; + } + if (e.types.contains("postal_code")) { + addNewAddressRequestModel.customer + .addresses[0].zipPostalCode = + e.longName; + } + if (e.types.contains("locality")) { + addNewAddressRequestModel.customer + .addresses[0].city = + e.longName; + } + }); + + await model.addAddressInfo( + addNewAddressRequestModel: addNewAddressRequestModel); + if (model.state == ViewState.ErrorLocal) { + Utils.showErrorToast(model.error); + } else { + AppToast.showSuccessToast( + message: "Address Added Successfully"); + } + Navigator.of(context).pop(); + }, + label: TranslationBase.of(context).addNewAddress, + ), + ], + ), + ), + ); + }, + initialPosition: LatLng(latitude, longitude), + useCurrentLocation: false, + ), + )); + } +} diff --git a/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_one_page.dart b/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_one_page.dart index 1dbee1b5..447ba177 100644 --- a/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_one_page.dart +++ b/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_one_page.dart @@ -2,15 +2,16 @@ import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/PatientERHHCInsertServicesList.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/patient_er_insert_pres_order_request_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/home_health_care_view_model.dart'; -import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; -import 'package:diplomaticquarterapp/widgets/pickupLocation/PickupLocationFromMap.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:geolocator/geolocator.dart'; import 'package:google_maps_place_picker/google_maps_place_picker.dart'; +import 'package:provider/provider.dart'; class NewHomeHealthCareStepOnePage extends StatefulWidget { final PatientERInsertPresOrderRequestModel @@ -45,6 +46,8 @@ class _NewHomeHealthCareStepOnePageState extends State { double latitude = 0; double longitude = 0; + AddressInfo _selectedAddress; @override void initState() { if (widget.patientERInsertPresOrderRequestModel.latitude == null) { - latitude = widget.latitude; - longitude = widget.longitude; + setLatitudeAndLongitude(); } else { latitude = widget.patientERInsertPresOrderRequestModel.latitude; longitude = widget.patientERInsertPresOrderRequestModel.longitude; } + super.initState(); } + setLatitudeAndLongitude({bool isSetState = false, String latLong}) { + if (latLong == null) + latLong = widget.model.addressesList[widget.model.addressesList + .length - 1].latLong; + List latLongArr = latLong.split(','); + + latitude = double.parse(latLongArr[0]); + longitude = double.parse(latLongArr[1]); + } + @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); return AppScaffold( isShowDecPage: false, - body: PlacePicker( - apiKey: GOOGLE_API_KEY, - enableMyLocationButton: true, - automaticallyImplyAppBarLeading: false, - autocompleteOnTrailingWhitespace: true, - selectInitialPosition: true, - autocompleteLanguage: projectViewModel.currentLanguage, - enableMapTypeButton: true, - onPlacePicked: (PickResult result) { - print(result.adrAddress); - widget.changePageViewIndex(3); - }, - selectedPlaceWidgetBuilder: - (_, selectedPlace, state, isSearchBarFocused) { - print("state: $state, isSearchBarFocused: $isSearchBarFocused"); - return isSearchBarFocused - ? Container() - : FloatingCard( - bottomPosition: 0.0, - leftPosition: 0.0, - rightPosition: 0.0, - width: 500, - borderRadius: BorderRadius.circular(12.0), - child: state == SearchingState.Searching - ? Center(child: CircularProgressIndicator()) - : Container( - margin: EdgeInsets.all(12), - child: SecondaryButton( - color: Colors.grey[800], - textColor: Colors.white, - onTap: () { - setState(() { - widget.patientERInsertPresOrderRequestModel - .latitude = - selectedPlace.geometry.location.lat; - widget.patientERInsertPresOrderRequestModel - .longitude = - selectedPlace.geometry.location.lng; - }); - widget.changePageViewIndex(3); - }, - label: TranslationBase.of(context).next, - ), - ), - ); + body: Stack( + children: [ + PlacePicker( + apiKey: GOOGLE_API_KEY, + enableMyLocationButton: true, + automaticallyImplyAppBarLeading: false, + autocompleteOnTrailingWhitespace: true, + selectInitialPosition: true, + autocompleteLanguage: projectViewModel.currentLanguage, + enableMapTypeButton: true, + searchForInitialValue: false, + + onPlacePicked: (PickResult result) { + print(result.adrAddress); + widget.changePageViewIndex(3); + }, + selectedPlaceWidgetBuilder: + (_, selectedPlace, state, isSearchBarFocused) { + print("state: $state, isSearchBarFocused: $isSearchBarFocused"); + return isSearchBarFocused + ? Container() + : FloatingCard( + bottomPosition: 0.0, + leftPosition: 0.0, + rightPosition: 0.0, + width: 500, + borderRadius: BorderRadius.circular(12.0), + child: state == SearchingState.Searching + ? Center(child: CircularProgressIndicator()) + : Container( + margin: EdgeInsets.all(12), + child: Column( + children: [ + SecondaryButton( + color: Colors.grey[800], + textColor: Colors.white, + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (BuildContext context) => + LocationPage( + latitude: latitude, + longitude: longitude, + ), + ), + ); + }, + label: TranslationBase.of(context).addNewAddress, + ), + SizedBox(height: 10,), + SecondaryButton( + color: Colors.red[800], + textColor: Colors.white, + onTap: () { + setState(() { + widget.patientERInsertPresOrderRequestModel + .latitude = + selectedPlace.geometry.location.lat; + widget.patientERInsertPresOrderRequestModel + .longitude = + selectedPlace.geometry.location.lng; + }); + widget.changePageViewIndex(3); + }, + label: TranslationBase.of(context).confirm, + ), + ], + ), + ), + ); + }, + initialPosition: LatLng(latitude, longitude), + useCurrentLocation: false, + ), + Container( + child: InkWell( + onTap: () => + confirmSelectLocationDialog(widget.model.addressesList), + child: Container( + padding: EdgeInsets.all(10), + width: double.infinity, + // height: 65, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(10), + color: Colors.white), + child: Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Expanded(child: Texts(getAddressName(), fontSize: 14,),), + Icon(Icons.arrow_drop_down) + ], + ), + ), + ), + height: 56, width: double.infinity, color: Theme + .of(context) + .scaffoldBackgroundColor, + + ) + ], + ), + ); + } + + + void confirmSelectLocationDialog(List addresses) { + showDialog( + context: context, + child: SelectLocationDialog( + addresses: addresses, + selectedAddress: _selectedAddress + , + onValueSelected: (value) { + setLatitudeAndLongitude(latLong: value.latLong); + setState(() { + _selectedAddress = value; + }); }, - initialPosition: LatLng(latitude, longitude), - useCurrentLocation: true, ), ); } + + String getAddressName() { + if (_selectedAddress != null) + return _selectedAddress.address1; + else + return TranslationBase.of(context).selectAddress; + } } diff --git a/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_home_health_care_page.dart b/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_home_health_care_page.dart index 87a33c6d..d9bf67d8 100644 --- a/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_home_health_care_page.dart +++ b/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_home_health_care_page.dart @@ -3,16 +3,19 @@ import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealth import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/patient_er_insert_pres_order_request_model.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/update_pres_oreder_request_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/home_health_care_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/HomeHealthCare/Dialog/confirm_cancel_order_dialog.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_three_page.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_tow_page.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:flutter/material.dart'; import 'package:geolocator/geolocator.dart'; +import 'package:provider/provider.dart'; import '../StepsWidget.dart'; import 'new_Home_health_care_step_one_page.dart'; @@ -84,7 +87,7 @@ class _NewHomeHealthCarePageState extends State if (model.state == ViewState.ErrorLocal) { Utils.showErrorToast(model.error); } else { - AppToast.showSuccessToast(message: "Done Successfully"); + AppToast.showSuccessToast(message:TranslationBase.of(context).processDoneSuccessfully ); await model.getHHCAllPresOrders(); // await model.getHHCAllServices(); } @@ -92,6 +95,8 @@ class _NewHomeHealthCarePageState extends State )); } + ProjectViewModel projectViewModel = Provider.of(context); + return Scaffold( body: SafeArea( child: SingleChildScrollView( @@ -99,7 +104,6 @@ class _NewHomeHealthCarePageState extends State height: MediaQuery.of(context).size.height * 0.8, child: Column( children: [ - Container( margin: EdgeInsets.only(left: MediaQuery.of(context).size.width*0.05, right: MediaQuery.of(context).size.width*0.05), child: StepsWidget( @@ -138,7 +142,7 @@ class _NewHomeHealthCarePageState extends State Container( width: double.infinity, padding: EdgeInsets.only( - left: 15, bottom: 15, top: 15), + left: 15, bottom: 15, top: 15,right: 15), decoration: BoxDecoration( border: Border( bottom: BorderSide( @@ -152,7 +156,9 @@ class _NewHomeHealthCarePageState extends State crossAxisAlignment: CrossAxisAlignment.start, children: [ Texts( - "Request ID", + TranslationBase + .of(context) + .requestID, bold: false, fontSize: 13, ), @@ -169,7 +175,7 @@ class _NewHomeHealthCarePageState extends State Container( width: double.infinity, padding: EdgeInsets.only( - left: 15, bottom: 15, top: 15), + left: 15, bottom: 15, top: 15,right: 15), decoration: BoxDecoration( border: Border( bottom: BorderSide( @@ -183,7 +189,9 @@ class _NewHomeHealthCarePageState extends State crossAxisAlignment: CrossAxisAlignment.start, children: [ Texts( - "Status", + TranslationBase + .of(context) + .OrderStatus, bold: false, fontSize: 13, ), @@ -191,7 +199,11 @@ class _NewHomeHealthCarePageState extends State height: 4, ), Texts( - widget.model.pendingOrder.description, + + projectViewModel.isArabic ? widget + .model.pendingOrder + .descriptionN : widget.model + .pendingOrder.description, fontSize: 22, ), ], @@ -200,7 +212,7 @@ class _NewHomeHealthCarePageState extends State Container( width: double.infinity, padding: EdgeInsets.only( - left: 15, bottom: 15, top: 15), + left: 15, bottom: 15, top: 15,right: 15), decoration: BoxDecoration( border: Border( bottom: BorderSide( @@ -214,7 +226,7 @@ class _NewHomeHealthCarePageState extends State crossAxisAlignment: CrossAxisAlignment.start, children: [ Texts( - "Pickup Date", + TranslationBase.of(context).pickupDate, bold: false, fontSize: 13, ), @@ -235,7 +247,7 @@ class _NewHomeHealthCarePageState extends State (index) => Container( width: double.infinity, padding: EdgeInsets.only( - left: 15, bottom: 15, top: 15), + left: 15, bottom: 15, top: 15,right: 15), decoration: BoxDecoration( border: Border( bottom: BorderSide( @@ -250,7 +262,9 @@ class _NewHomeHealthCarePageState extends State CrossAxisAlignment.start, children: [ Texts( - "Service Name", + TranslationBase + .of(context) + .serviceName, bold: false, fontSize: 13, ), @@ -258,7 +272,12 @@ class _NewHomeHealthCarePageState extends State height: 4, ), Texts( - widget.model.hhcAllOrderDetail[index] + projectViewModel.isArabic + ? widget.model + .hhcAllOrderDetail[index] + .descriptionN + : widget.model + .hhcAllOrderDetail[index] .description, fontSize: 22, bold: true, @@ -275,7 +294,7 @@ class _NewHomeHealthCarePageState extends State width: MediaQuery.of(context).size.width * 0.85, child: SecondaryButton( - label: "Cancel".toUpperCase(), + label: TranslationBase.of(context).cancel.toUpperCase(), onTap: () { showConfirmMessage(widget.model, widget.model.hhcAllOrderDetail[0]); diff --git a/lib/pages/AlHabibMedicalService/HomeHealthCare/home_health_care_page.dart b/lib/pages/AlHabibMedicalService/HomeHealthCare/home_health_care_page.dart index f0dcee7c..3180cf18 100644 --- a/lib/pages/AlHabibMedicalService/HomeHealthCare/home_health_care_page.dart +++ b/lib/pages/AlHabibMedicalService/HomeHealthCare/home_health_care_page.dart @@ -42,6 +42,7 @@ class _HomeHealthCarePageState extends State }, builder: (_, model, widget) => AppScaffold( isShowAppBar: true, + description: TranslationBase.of(context).HHCNotAuthMsg, appBarTitle: TranslationBase.of(context).homeHealthCare, body: Scaffold( extendBodyBehindAppBar: true, diff --git a/lib/pages/AlHabibMedicalService/HomeHealthCare/orders_log_details_page.dart b/lib/pages/AlHabibMedicalService/HomeHealthCare/orders_log_details_page.dart index 0cfedb41..f0ca5fe4 100644 --- a/lib/pages/AlHabibMedicalService/HomeHealthCare/orders_log_details_page.dart +++ b/lib/pages/AlHabibMedicalService/HomeHealthCare/orders_log_details_page.dart @@ -2,13 +2,16 @@ import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/get_hhc_all_pres_orders_response_model.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/update_pres_oreder_request_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/home_health_care_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; import 'Dialog/confirm_cancel_order_dialog.dart'; @@ -19,6 +22,8 @@ class OrdersLogDetailsPage extends StatelessWidget { @override Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + void showConfirmMessage( HomeHealthCareViewModel model, GetHHCAllPresOrdersResponseModel order) { showDialog( @@ -29,212 +34,219 @@ class OrdersLogDetailsPage extends StatelessWidget { UpdatePresOrderRequestModel updatePresOrderRequestModel = UpdatePresOrderRequestModel( presOrderID: order.iD, - rejectionReason: "", - presOrderStatus: 4, editedBy: 3); + rejectionReason: "", + presOrderStatus: 4, editedBy: 3); await model.updateHHCPresOrder(updatePresOrderRequestModel); if(model.state == ViewState.ErrorLocal) { - Utils.showErrorToast(model.error); + Utils.showErrorToast(model.error); } else { - AppToast.showSuccessToast(message: "Done Successfully"); + AppToast.showSuccessToast(message:TranslationBase.of(context).processDoneSuccessfully ); await model.getHHCAllPresOrders(); - // await model.getHHCAllServices(); + // await model.getHHCAllServices(); } }, )); } return AppScaffold( - isShowAppBar: false, - baseViewModel: model, - body: SingleChildScrollView( - physics: ScrollPhysics(), - child: Container( - margin: EdgeInsets.all(12), - child: Center( - child: FractionallySizedBox( - widthFactor: 0.94, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 50, - ), - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: model.hhcAllPresOrders.map((order) { - return Container( - width: double.infinity, - margin: EdgeInsets.only(top: 15), - decoration: BoxDecoration( - border: - Border.all(color: Colors.grey, width: 1), - borderRadius: BorderRadius.circular(12), - color: Colors.white), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 12, - ), - Container( - width: double.infinity, - padding: EdgeInsets.only( - left: 15, bottom: 15, top: 15), - decoration: BoxDecoration( - border: Border( - bottom: BorderSide( - color: Colors.grey, - width: 1.0, - ), - ), - // borderRadius: BorderRadius.circular(12), - color: Colors.white), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Texts( - "Request ID", - bold: false, - fontSize: 13, - ), - SizedBox( - height: 4, - ), - Texts( - order.iD.toString(), - fontSize: 22, + isShowAppBar: false, + baseViewModel: model, + body: SingleChildScrollView( + physics: ScrollPhysics(), + child: Container( + margin: EdgeInsets.all(12), + child: Center( + child: FractionallySizedBox( + widthFactor: 0.94, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 50, + ), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: model.hhcAllPresOrders.map((order) { + return Container( + width: double.infinity, + margin: EdgeInsets.only(top: 15), + decoration: BoxDecoration( + border: + Border.all(color: Colors.grey, width: 1), + borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 12, + ), + Container( + width: double.infinity, + padding: EdgeInsets.only( + left: 15, bottom: 15, top: 15, right: 15), + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + color: Colors.grey, + width: 1.0, ), - ], - ), + ), + // borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts( + TranslationBase + .of(context) + .requestID, + bold: false, + fontSize: 13, + ), + SizedBox( + height: 4, + ), + Texts( + order.iD.toString(), + fontSize: 22, + ), + ], ), - Container( - width: double.infinity, - padding: EdgeInsets.only( - left: 15, bottom: 15, top: 15), - decoration: BoxDecoration( - border: Border( - bottom: BorderSide( - color: Colors.grey, - width: 1.0, - ), - ), - // borderRadius: BorderRadius.circular(12), - color: Colors.white), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Texts( - "Status", - bold: false, - fontSize: 13, - ), - SizedBox( - height: 4, - ), - Texts( - order.description, - fontSize: 22, + ), + Container( + width: double.infinity, + padding: EdgeInsets.only( + left: 15, bottom: 15, top: 15, right: 15), + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + color: Colors.grey, + width: 1.0, ), - ], - ), + ), + // borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts( + TranslationBase + .of(context) + .OrderStatus, + bold: false, + fontSize: 13, + ), + SizedBox( + height: 4, + ), + Texts( + + projectViewModel.isArabic ? order.descriptionN : order.description, + fontSize: 22, + ), + ], ), - Container( - width: double.infinity, - padding: EdgeInsets.only( - left: 15, bottom: 15, top: 15), - decoration: BoxDecoration( - border: Border( - bottom: BorderSide( - color: Colors.grey, - width: 1.0, - ), - ), - // borderRadius: BorderRadius.circular(12), - color: Colors.white), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Texts( - "Pickup Date", - bold: false, - fontSize: 13, - ), - SizedBox( - height: 4, - ), - Texts( - DateUtil.getDayMonthYearDateFormatted( - DateUtil.convertStringToDate( - order.createdOn)), - fontSize: 22, + ), + Container( + width: double.infinity, + padding: EdgeInsets.only( + left: 15, bottom: 15, top: 15, right: 15), + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + color: Colors.grey, + width: 1.0, ), - ], - ), + ), + // borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts( + TranslationBase + .of(context) + .pickupDate, + bold: false, + fontSize: 13, + ), + SizedBox( + height: 4, + ), + Texts( + DateUtil.getDayMonthYearDateFormatted( + DateUtil.convertStringToDate(order.createdOn)), + fontSize: 22, + ), + ], ), - Container( - width: double.infinity, - padding: EdgeInsets.only( - left: 15, bottom: 15, top: 15), - decoration: BoxDecoration( - border: Border( - bottom: BorderSide( - color: Colors.grey, - width: 1.0, - ), - ), - // borderRadius: BorderRadius.circular(12), - color: Colors.white), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Texts( - "Location", - bold: false, - fontSize: 13, - ), - SizedBox( - height: 4, - ), - Texts( - order.nearestProjectDescription - .toString() ?? - order.nearestProjectDescriptionN - .toString(), - fontSize: 22, + ), + + SizedBox( + height: 12, + ), + Container( + width: double.infinity, + padding: EdgeInsets.only( + left: 15, bottom: 15, top: 15, right: 15), + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + color: Colors.grey, + width: 1.0, ), - ], - ), - ), - SizedBox( - height: 12, - ), - if (order.status == 1 ||order.status == 2 ) - Center( - child: Container( - width: MediaQuery - .of(context) - .size - .width * - 0.85, - child: SecondaryButton( - label: "Cancel".toUpperCase(), - onTap: () { - showConfirmMessage(model, order); - } - , - color: Colors.red[800], - disabled: false, - textColor: Theme - .of(context) - .backgroundColor), ), + // borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Texts( + TranslationBase.of(context).orderLocation, + bold: false, + fontSize: 13, + ), + SizedBox( + height: 4, + ), + Texts( + !projectViewModel.isArabic ?order.nearestProjectDescription + .toString() : + order.nearestProjectDescriptionN + .toString(), + fontSize: 22, + ), + ], + ), + ), + SizedBox( + height: 12, + ), + if (order.status == 1 ||order.status == 2 ) + Center( + child: Container( + width: MediaQuery + .of(context) + .size + .width * + 0.85, + child: SecondaryButton( + label: "Cancel".toUpperCase(), + onTap: () { + showConfirmMessage(model, order); + } + , + color: Colors.red[800], + disabled: false, + textColor: Theme + .of(context) + .backgroundColor), ), - SizedBox( - height: 12, + ), + SizedBox( + height: 12, ), ], ), diff --git a/lib/pages/ContactUs/findus/findus_page.dart b/lib/pages/ContactUs/findus/findus_page.dart index 5cf59e21..80648292 100644 --- a/lib/pages/ContactUs/findus/findus_page.dart +++ b/lib/pages/ContactUs/findus/findus_page.dart @@ -78,10 +78,7 @@ class _FindUsPageState extends State isScrollable: true, controller: _tabController, indicatorWeight: 5.0, - //indicatorSize: TabBarIndicatorSize.label, indicatorSize: TabBarIndicatorSize.tab, - - indicatorColor: Theme.of(context).primaryColor, labelColor: Theme.of(context).primaryColor, labelPadding: EdgeInsets.only(top: 4.0, left: 35.0, right: 35.0), diff --git a/lib/pages/ContactUs/widgets/card_common_contat.dart b/lib/pages/ContactUs/widgets/card_common_contat.dart index cfb9108b..8848e2ff 100644 --- a/lib/pages/ContactUs/widgets/card_common_contat.dart +++ b/lib/pages/ContactUs/widgets/card_common_contat.dart @@ -7,6 +7,8 @@ import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; +import '../../../Constants.dart'; + class CardCommonContact extends StatelessWidget { final image; final text; @@ -37,7 +39,7 @@ class CardCommonContact extends StatelessWidget { margin: EdgeInsets.fromLTRB(10.0, 10.0, 10.0, 0.0), child: Texts(this.text, // overflow: TextOverflow.clip, - color:Theme.of(context).primaryColor, + color:secondaryColor, fontWeight: FontWeight.w700, fontSize: 20.0), ), diff --git a/lib/pages/feedback/send_feedback_page.dart b/lib/pages/feedback/send_feedback_page.dart index 4d511452..aded1a3b 100644 --- a/lib/pages/feedback/send_feedback_page.dart +++ b/lib/pages/feedback/send_feedback_page.dart @@ -8,6 +8,7 @@ import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.dart'; import 'package:diplomaticquarterapp/widgets/bottom_options/BottomSheet.dart'; import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/input/text_field.dart'; import 'package:diplomaticquarterapp/widgets/others/StarRating.dart'; @@ -417,27 +418,26 @@ class _SendFeedbackPageState extends State { ), ), bottomSheet: Container( - height: MediaQuery.of(context).size.height * 0.13, + height: MediaQuery.of(context).size.height * 0.09, width: double.infinity, - padding: EdgeInsets.all(8.0), + padding: EdgeInsets.all(15.0), child: Center( child: Container( - height: MediaQuery.of(context).size.height * 0.1, - width: MediaQuery.of(context).size.width * 0.8, - child: Button( + height: MediaQuery.of(context).size.height * 0.8, + child: SecondaryButton( label: TranslationBase.of(context).send, - loading: model.state == ViewState.BusyLocal, + disabled: (titleController.text.toString().isEmpty || messageController.text.toString().isEmpty|| messageType == MessageType.NON), onTap: () { final form = formKey.currentState; - if (form.validate()) if (messageType != MessageType.NON) - model - .sendCOCItem( + if (form.validate()) + if (messageType != MessageType.NON){ + GifLoaderDialogUtils.showMyDialog(context); + model.sendCOCItem( title: titleController.text, attachment: images.length > 0 ? images[0] : "", details: messageController.text, cOCTypeName: getCOCName(), - appointHistory:messageType == - MessageType.ComplaintOnAnAppointment + appointHistory:messageType == MessageType.ComplaintOnAnAppointment ? appointHistory : null) .then((value) { @@ -448,12 +448,14 @@ class _SendFeedbackPageState extends State { images = []; }); setMessageType(MessageType.NON); + GifLoaderDialogUtils.hideDialog(context); AppToast.showSuccessToast( message: TranslationBase.of(context).yourFeedback); } else { AppToast.showErrorToast(message: model.error); + GifLoaderDialogUtils.hideDialog(context); } - }); + });} else { AppToast.showErrorToast(message: TranslationBase.of(context).selectPart); } diff --git a/lib/pages/medical/balance/dialogs/SelectBeneficiaryDialog.dart b/lib/pages/medical/balance/dialogs/SelectBeneficiaryDialog.dart index b004bc38..d7ce3fac 100644 --- a/lib/pages/medical/balance/dialogs/SelectBeneficiaryDialog.dart +++ b/lib/pages/medical/balance/dialogs/SelectBeneficiaryDialog.dart @@ -3,6 +3,7 @@ import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import '../../../../Constants.dart'; import '../advance_payment_page.dart'; class SelectBeneficiaryDialog extends StatefulWidget { @@ -45,7 +46,7 @@ class _SelectBeneficiaryDialogState extends State { leading: Radio( value: BeneficiaryType.MyAccount, groupValue: beneficiaryType, - activeColor: Color(0xFF40ACC9), + activeColor: secondaryColor, onChanged: (BeneficiaryType value) { setState(() { beneficiaryType = value; diff --git a/lib/pages/medical/balance/dialogs/SelectHospitalDialog.dart b/lib/pages/medical/balance/dialogs/SelectHospitalDialog.dart index 42bd66b7..a9a4fea2 100644 --- a/lib/pages/medical/balance/dialogs/SelectHospitalDialog.dart +++ b/lib/pages/medical/balance/dialogs/SelectHospitalDialog.dart @@ -4,6 +4,8 @@ import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import '../../../../Constants.dart'; + class SelectHospitalDialog extends StatefulWidget { final List hospitals; final Function(HospitalsModel) onValueSelected; @@ -54,7 +56,7 @@ class _SelectHospitalDialogState extends State { leading: Radio( value: widget.hospitals[index], groupValue: widget.selectedHospital, - activeColor: Color(0xFF40ACC9), + activeColor: secondaryColor, onChanged: (value) { setState(() { widget.selectedHospital = value; diff --git a/lib/pages/medical/balance/dialogs/SelectPatientFamilyDialog.dart b/lib/pages/medical/balance/dialogs/SelectPatientFamilyDialog.dart index bb9afd6c..ab2b48d5 100644 --- a/lib/pages/medical/balance/dialogs/SelectPatientFamilyDialog.dart +++ b/lib/pages/medical/balance/dialogs/SelectPatientFamilyDialog.dart @@ -4,6 +4,8 @@ import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import '../../../../Constants.dart'; + class SelectPatientFamilyDialog extends StatefulWidget { final List getAllSharedRecordsByStatusList; final Function(GetAllSharedRecordsByStatusList) onValueSelected; @@ -53,7 +55,7 @@ class _SelectPatientFamilyDialogState extends State { leading: Radio( value: widget.getAllSharedRecordsByStatusList[index], groupValue: widget.selectedPatientFamily, - activeColor: Colors.red[800], + activeColor: secondaryColor, onChanged: (value) { setState(() { widget.selectedPatientFamily = value; diff --git a/lib/pages/medical/balance/dialogs/SelectPatientInfoDialog.dart b/lib/pages/medical/balance/dialogs/SelectPatientInfoDialog.dart index bea4f694..3cce8e61 100644 --- a/lib/pages/medical/balance/dialogs/SelectPatientInfoDialog.dart +++ b/lib/pages/medical/balance/dialogs/SelectPatientInfoDialog.dart @@ -6,6 +6,8 @@ import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import '../../../../Constants.dart'; + class SelectPatientInfoDialog extends StatefulWidget { final List patientInfoList ; final Function(PatientInfo) onValueSelected; @@ -55,7 +57,7 @@ class _SelectPatientInfoDialogState extends State { leading: Radio( value: widget.patientInfoList[index], groupValue: widget.selectedPatientInfo, - activeColor: Colors.red[800], + activeColor: secondaryColor, onChanged: (value) { setState(() { widget.selectedPatientInfo = value; diff --git a/lib/widgets/buttons/secondary_button.dart b/lib/widgets/buttons/secondary_button.dart index 46b4abfb..8884039b 100644 --- a/lib/widgets/buttons/secondary_button.dart +++ b/lib/widgets/buttons/secondary_button.dart @@ -23,7 +23,7 @@ class SecondaryButton extends StatefulWidget { this.icon, this.iconOnly = false, this.color , - this.textColor, + this.textColor = Colors.white, this.onTap, this.loading: false, this.small = false, diff --git a/lib/widgets/dialogs/select_location_dialog.dart b/lib/widgets/dialogs/select_location_dialog.dart new file mode 100644 index 00000000..77916ddc --- /dev/null +++ b/lib/widgets/dialogs/select_location_dialog.dart @@ -0,0 +1,139 @@ +import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/customer_addresses_service.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +// ignore: must_be_immutable +class SelectLocationDialog extends StatefulWidget { + final List addresses; + final Function(AddressInfo) onValueSelected; + AddressInfo selectedAddress; + + SelectLocationDialog( + {Key key, this.addresses, this.onValueSelected, this.selectedAddress}); + + @override + _SelectLocationDialogState createState() => _SelectLocationDialogState(); +} + +class _SelectLocationDialogState extends State { + @override + void initState() { + super.initState(); + widget.selectedAddress = widget.selectedAddress ?? widget.addresses[0]; + } + + @override + Widget build(BuildContext context) { + return SimpleDialog( + title: Texts(TranslationBase.of(context).selectAddress), + children: [ + Column( + children: [ + Container( + height: 150, + child: SingleChildScrollView( + child: Column( + children: [ + Divider(), + ...List.generate( + widget.addresses.length, + (index) => Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 2, + ), + Row( + children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () { + setState(() { + widget.selectedAddress = widget.addresses[index]; + }); + }, + child: ListTile( + title: Text(widget.addresses[index].address1), + leading: Radio( + value: widget.addresses[index], + groupValue: widget.selectedAddress, + activeColor: Colors.red[800], + onChanged: (value) { + setState(() { + widget.selectedAddress = value; + }); + }, + ), + ), + ), + ) + ], + ), + SizedBox( + height: 5.0, + ), + ], + ), + ), + SizedBox( + height: 5.0, + ), + ], + ), + ), + ), + Row( + // mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () { + Navigator.pop(context); + }, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Container( + child: Center( + child: Texts( + TranslationBase.of(context).cancel.toUpperCase(), + color: Colors.red, + ), + ), + ), + ), + ), + ), + Container( + width: 1, + height: 30, + color: Colors.grey[500], + ), + Expanded( + flex: 1, + child: InkWell( + onTap: () { + widget.onValueSelected(widget.selectedAddress); + Navigator.pop(context); + }, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Center( + child: Texts( + TranslationBase.of(context).ok, + fontWeight: FontWeight.w400, + )), + ), + ), + ), + ], + ) + ], + ) + ], + ); + } +} From d7a046f9ca0028a5a149638aebb2a4f21accddcc Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Wed, 13 Jan 2021 17:58:45 +0200 Subject: [PATCH 21/42] fix issue on cmc --- help/ios/Runner/Info.plist | 3 + ios/Flutter/.last_build_id | 2 +- ios/Podfile.lock | 6 +- ios/Runner.xcodeproj/project.pbxproj | 28 ++++---- lib/config/localized_values.dart | 4 ++ lib/core/model/ImagesInfo.dart | 3 +- lib/core/service/client/base_app_client.dart | 2 +- .../cmc_index_page.dart | 68 ------------------- .../ComprehensiveMedicalCheckup/cmc_page.dart | 4 ++ lib/pages/landing/home_page.dart | 4 +- lib/uitl/translations_delegate_base.dart | 1 + lib/widgets/others/not_auh_page.dart | 2 +- 12 files changed, 36 insertions(+), 91 deletions(-) delete mode 100644 lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_index_page.dart diff --git a/help/ios/Runner/Info.plist b/help/ios/Runner/Info.plist index fe4c8174..71ce57cb 100644 --- a/help/ios/Runner/Info.plist +++ b/help/ios/Runner/Info.plist @@ -41,5 +41,8 @@ UIViewControllerBasedStatusBarAppearance + + < key >NSCameraUsageDescription< /key > + < string >Camera permission is required for barcode scanning.< /string > diff --git a/ios/Flutter/.last_build_id b/ios/Flutter/.last_build_id index b8024672..df846dd6 100644 --- a/ios/Flutter/.last_build_id +++ b/ios/Flutter/.last_build_id @@ -1 +1 @@ -59a6c452ee075b50114918f17f1ad8f5 \ No newline at end of file +269226e53e3ba1b1460fd3df51f89f77 \ No newline at end of file diff --git a/ios/Podfile.lock b/ios/Podfile.lock index a09481c1..82d4be18 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -162,7 +162,7 @@ PODS: - "twilio_programmable_video (0.5.0+4)": - Flutter - TwilioVideo (~> 3.4) - - TwilioVideo (3.7.2) + - TwilioVideo (3.8.0) - url_launcher (0.0.1): - Flutter - url_launcher_linux (0.0.1): @@ -436,7 +436,7 @@ SPEC CHECKSUMS: TOCropViewController: da59f531f8ac8a94ef6d6c0fc34009350f9e8bfe Try: 5ef669ae832617b3cee58cb2c6f99fb767a4ff96 twilio_programmable_video: 6a41593640f3d86af60b22541fd457b22deaae7f - TwilioVideo: 5257640fab00d1b9f44db060815b03516a9eb0e8 + TwilioVideo: c13a51ceca375e91620eb7578d2573c90cf53b46 url_launcher: 6fef411d543ceb26efce54b05a0a40bfd74cbbef url_launcher_linux: ac237cb7a8058736e4aae38bdbcc748a4b394cc0 url_launcher_macos: fd7894421cd39320dce5f292fc99ea9270b2a313 @@ -452,4 +452,4 @@ SPEC CHECKSUMS: PODFILE CHECKSUM: 5a17be3f8af73a757fa4439c77cf6ab2db29a6e7 -COCOAPODS: 1.10.0 +COCOAPODS: 1.10.0.rc.1 diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 009006ed..0f0f942c 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -214,7 +214,7 @@ 9705A1C41CF9048500538489 /* Embed Frameworks */, 3B06AD1E1E4923F5004D2608 /* Thin Binary */, 125A739F71A29FBAE7B4D5AC /* [CP] Embed Pods Frameworks */, - 940F4A376A48B060117A1E5D /* [CP] Copy Pods Resources */, + CBB18A5CEEEB971DCFC36E00 /* [CP] Copy Pods Resources */, ); buildRules = ( ); @@ -330,36 +330,36 @@ shellPath = /bin/sh; shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; }; - 940F4A376A48B060117A1E5D /* [CP] Copy Pods Resources */ = { + 9740EEB61CF901F6004384FC /* Run Script */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); - inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-input-files.xcfilelist", + inputPaths = ( ); - name = "[CP] Copy Pods Resources"; - outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-output-files.xcfilelist", + name = "Run Script"; + outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n"; - showEnvVarsInLog = 0; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; }; - 9740EEB61CF901F6004384FC /* Run Script */ = { + CBB18A5CEEEB971DCFC36E00 /* [CP] Copy Pods Resources */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); - inputPaths = ( + inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-input-files.xcfilelist", ); - name = "Run Script"; - outputPaths = ( + name = "[CP] Copy Pods Resources"; + outputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-output-files.xcfilelist", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n"; + showEnvVarsInLog = 0; }; /* End PBXShellScriptBuildPhase section */ diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index a019ae00..df1ddb97 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -1457,4 +1457,8 @@ const Map localizedValues = { "en": "Drive-Thru", "ar": "من السيارة" }, + "infoCMC": { + "en": "Through this service, you can request a set of tests that help you and your doctor to understand the current health condition and then identify potential risks.", + "ar": "من خلال هذه الخدمة يمكنك طلب مجموعة من الفحوصات التي تساعدك وتساعد طبيبك في فهم حالتك الصحية الحالية ومن ثم تحديد المخاطر المحتملة" + }, }; diff --git a/lib/core/model/ImagesInfo.dart b/lib/core/model/ImagesInfo.dart index 5ab48fb3..54e8042b 100644 --- a/lib/core/model/ImagesInfo.dart +++ b/lib/core/model/ImagesInfo.dart @@ -1,6 +1,7 @@ class ImagesInfo { final String imageAr; final String imageEn; + final bool isAsset; - ImagesInfo({this.imageAr, this.imageEn}); + ImagesInfo({this.imageAr, this.imageEn, this.isAsset = false}); } diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index 8995a4e3..cbe2410d 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -46,7 +46,7 @@ class BaseAppClient { //Map profile = await sharedPref.getObj(DOCTOR_PROFILE); if (!isExternal) { String token = await sharedPref.getString(TOKEN); - var languageID = await sharedPref.getString(APP_LANGUAGE); + var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE,'ar'); var user = await sharedPref.getObject(USER_PROFILE); if (body.containsKey('SetupID')) { body['SetupID'] = body.containsKey('SetupID') diff --git a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_index_page.dart b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_index_page.dart deleted file mode 100644 index e8e9eccc..00000000 --- a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_index_page.dart +++ /dev/null @@ -1,68 +0,0 @@ -import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; -import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; -import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; -import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; -import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; -import 'package:hexcolor/hexcolor.dart'; -import 'cmc_page.dart'; - -class CMCIndexPage extends StatelessWidget { - @override - Widget build(BuildContext context) { - return AppScaffold( - isShowAppBar: true, - appBarTitle: TranslationBase.of(context).serviceInformation, - body: SingleChildScrollView( - padding: EdgeInsets.all(12), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Texts( - "CMC", - fontWeight: FontWeight.normal, - fontSize: 25, - color: Color(0xff60686b), - ), - SizedBox( - height: 12, - ), - Texts( - "This service is designed to help you to set drinking water goals and track the volume of water you are drinking on a daily basis. This service allows for schedule reminders and offers a basic statistical analysis of the amount of what you have consumed over the course of a day, week or month.", - fontWeight: FontWeight.normal, - fontSize: 17, - ), - SizedBox( - height: 22, - ), - Center( - child: Image.asset( - 'assets/images/AlHabibMedicalService/Wifi-AR.png')), - SizedBox( - height: 77, - ), - ], - )), - bottomSheet: Container( - height: MediaQuery.of(context).size.height * 0.10, - width: double.infinity, - child: Column( - children: [ - Container( - width: MediaQuery.of(context).size.width * 0.9, - child: SecondaryButton( - onTap: () => Navigator.push( - context, - FadePage( - page: CMCPage(), - ), - ), - label: "CMC", - textColor: Theme.of(context).backgroundColor), - ), - ], - ), - )); - } -} diff --git a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_page.dart b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_page.dart index 95d02d1f..6becba6a 100644 --- a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_page.dart +++ b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_page.dart @@ -1,5 +1,6 @@ import 'dart:ui'; +import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/cmc_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; @@ -40,6 +41,9 @@ class _CMCPageState extends State }, builder: (_, model, widget) => AppScaffold( isShowAppBar: true, + description:TranslationBase.of(context).infoCMC, + image: 'assets/images/AlHabibMedicalService/Wifi-AR.png', + imagesInfo: [ImagesInfo(imageAr: 'assets/images/AlHabibMedicalService/Wifi-AR.png',imageEn: 'assets/images/AlHabibMedicalService/Wifi-EN.png', isAsset: true)], appBarTitle: TranslationBase.of(context).homeHealthCare, body: Scaffold( extendBodyBehindAppBar: true, diff --git a/lib/pages/landing/home_page.dart b/lib/pages/landing/home_page.dart index fff74fd5..87afb17f 100644 --- a/lib/pages/landing/home_page.dart +++ b/lib/pages/landing/home_page.dart @@ -1,7 +1,7 @@ import 'package:diplomaticquarterapp/config/size_config.dart'; import 'package:diplomaticquarterapp/core/viewModels/dashboard_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; -import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_index_page.dart'; +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_page.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/HomeHealthCare/home_health_care_index_page.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/all_habib_medical_service_page.dart'; import 'package:diplomaticquarterapp/pages/ContactUs/contact_us_page.dart'; @@ -490,7 +490,7 @@ class _HomePageState extends State { Navigator.push( context, FadePage( - page: CMCIndexPage(), + page: CMCPage(), ), ); }, diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index 736e7e14..50e9dd48 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -1245,6 +1245,7 @@ class TranslationBase { localizedValues['shoppingCart'][locale.languageCode]; String get covidTest => localizedValues['covidTest'][locale.languageCode]; String get driveThru => localizedValues['driveThru'][locale.languageCode]; + String get infoCMC => localizedValues['infoCMC'][locale.languageCode]; } diff --git a/lib/widgets/others/not_auh_page.dart b/lib/widgets/others/not_auh_page.dart index 0dbbee43..4bda58a4 100644 --- a/lib/widgets/others/not_auh_page.dart +++ b/lib/widgets/others/not_auh_page.dart @@ -108,7 +108,7 @@ class _NotAutPageState extends State { builder: (BuildContext context){ return SizedBox( width: MediaQuery.of(context).size.width * 0.50, - child: Image.network(projectViewModel.isArabic ? image.imageAr : image.imageEn)); + child: image.isAsset? Image.asset(projectViewModel.isArabic ? image.imageAr : image.imageEn) : Image.network(projectViewModel.isArabic ? image.imageAr : image.imageEn)); }, ); }).toList(), From 4ecce792585b9c3146b4b2247f0a98410b997d4d Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Wed, 13 Jan 2021 20:33:20 +0200 Subject: [PATCH 22/42] first step from fix CMC --- .../NewCMC/new_cmc_page.dart | 15 +++++++++------ .../ComprehensiveMedicalCheckup/cmc_page.dart | 6 +++--- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_page.dart b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_page.dart index ecfe31fb..2a7696b7 100644 --- a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_page.dart +++ b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_page.dart @@ -119,13 +119,16 @@ class _NewCMCPageState extends State height: MediaQuery.of(context).size.height * 0.8, child: Column( children: [ - Container( - margin: EdgeInsets.only(left: MediaQuery.of(context).size.width*0.05, right: MediaQuery.of(context).size.width*0.05), - child: StepsWidget( - index: _currentIndex, - changeCurrentTab: changePageViewIndex, + if (widget.model.cmcAllOrderDetail.length == 0) + Container( + margin: EdgeInsets.only( + left: MediaQuery.of(context).size.width * 0.05, + right: MediaQuery.of(context).size.width * 0.05), + child: StepsWidget( + index: _currentIndex, + changeCurrentTab: changePageViewIndex, + ), ), - ), Expanded( child: PageView( physics: NeverScrollableScrollPhysics(), diff --git a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_page.dart b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_page.dart index 04fca1c6..b745e0c9 100644 --- a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_page.dart +++ b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_page.dart @@ -36,13 +36,13 @@ class _CMCPageState extends State @override Widget build(BuildContext context) { return BaseView( - onModelReady: (model){ - model.getCmcAllPresOrders(); + onModelReady: (model) async{ + await model.getCmcAllPresOrders(); + }, builder: (_, model, widget) => AppScaffold( isShowAppBar: true, description:TranslationBase.of(context).infoCMC, - image: 'assets/images/AlHabibMedicalService/Wifi-AR.png', imagesInfo: [ImagesInfo(imageAr: 'assets/images/AlHabibMedicalService/Wifi-AR.png',imageEn: 'assets/images/AlHabibMedicalService/Wifi-EN.png', isAsset: true)], appBarTitle: TranslationBase.of(context).comprehensiveMedicalCheckup, body: Scaffold( From 200334d8f83866baa67bfba81e6214fe0b74b174 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Sun, 17 Jan 2021 17:07:50 +0200 Subject: [PATCH 23/42] Fix ER service --- ios/Flutter/.last_build_id | 2 +- ios/Podfile.lock | 2 +- lib/config/config.dart | 4 +- lib/config/localized_values.dart | 13 +- lib/core/model/er/PickUpRequestPresOrder.dart | 4 +- lib/core/model/reports/Reports.dart | 76 ++--- lib/core/service/medical/reports_service.dart | 13 + .../medical/reports_monthly_view_model.dart | 32 ++- lib/pages/ErService/AmbulanceReq.dart | 5 +- .../AmbulanceRequestIndex.dart | 14 +- .../BillAmount.dart | 29 +- .../PickupLocation.dart | 37 +-- .../SelectTransportationMethod.dart | 19 +- .../AmbulanceRequestIndexPages/Summary.dart | 9 +- lib/pages/feedback/feedback_home_page.dart | 1 - .../medical/reports/monthly_reports.dart | 266 ++++++++++-------- lib/uitl/translations_delegate_base.dart | 4 +- lib/widgets/input/text_field.dart | 8 +- 18 files changed, 304 insertions(+), 234 deletions(-) diff --git a/ios/Flutter/.last_build_id b/ios/Flutter/.last_build_id index df846dd6..b8024672 100644 --- a/ios/Flutter/.last_build_id +++ b/ios/Flutter/.last_build_id @@ -1 +1 @@ -269226e53e3ba1b1460fd3df51f89f77 \ No newline at end of file +59a6c452ee075b50114918f17f1ad8f5 \ No newline at end of file diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 82d4be18..77dfa5e1 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -452,4 +452,4 @@ SPEC CHECKSUMS: PODFILE CHECKSUM: 5a17be3f8af73a757fa4439c77cf6ab2db29a6e7 -COCOAPODS: 1.10.0.rc.1 +COCOAPODS: 1.10.0 diff --git a/lib/config/config.dart b/lib/config/config.dart index cd7a5383..0c6b5d59 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -225,8 +225,8 @@ const GET_LIVECARE_HISTORY = 'Services/ER_VirtualCall.svc/REST/GetPatientErVirtu const CANCEL_LIVECARE_REQUEST = 'Services/ER_VirtualCall.svc/REST/DeleteErRequest'; const SEND_LIVECARE_INVOICE_EMAIL = 'Services/Notifications.svc/REST/SendInvoiceForLiveCare'; -const GET_USER_TERMS = '/Services/Patients.svc/REST/GetUserTermsAndConditions'; -const UPDATE_HEALTH_TERMS = '/services/Patients.svc/REST/UpdatePateintHealthSummaryReport'; +const GET_USER_TERMS = 'Services/Patients.svc/REST/GetUserTermsAndConditions'; +const UPDATE_HEALTH_TERMS = 'services/Patients.svc/REST/UpdatePateintHealthSummaryReport'; //URL to get medicine and pharmacies list const CHANNEL = 3; diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index afb60a9d..aaa7f16a 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -288,7 +288,7 @@ const Map localizedValues = { }, "ksa": {"en": "KSA", "ar": "السعودية"}, "dubai": {"en": "Dubai", "ar": "دبي"}, - "enter-email": {"en": "Enter Email", "ar": "ادخل البريد الالكتروني"}, + "enter-email": {"en": "Please Enter Email", "ar": "ادخل البريد الالكتروني"}, "family": {"en": "My Family", "ar": "عائلتي"}, "family-title": {"en": "My Family Files", "ar": "ملفات العائلة"}, "myFamily": {"en": "My Family", "ar": "ملفات العائلة"}, @@ -1065,7 +1065,7 @@ const Map localizedValues = { "pickup-location": {"en": "Pickup Location", "ar": "نقطة الانطلاق"}, "pickup-spot": {"en": "Pickup Spot", "ar": "نقطة اللقاء"}, "inside-home": {"en": "Inside Home", "ar": "داخل المنزل"}, - "have-appo": {"en": "Do you have an appointment?", "ar": "هل لديك موعد؟"}, + "have-appo": {"en": "Do you have an appointment ?", "ar": "هل لديك موعد ؟"}, "dropoff-location": {"en": "Dropoff Location", "ar": "نقطة الوصول"}, "select-all": { "en": "Please select all fields", @@ -1469,4 +1469,13 @@ const Map localizedValues = { "en": "Through this service, you can request a set of tests that help you and your doctor to understand the current health condition and then identify potential risks.", "ar": "من خلال هذه الخدمة يمكنك طلب مجموعة من الفحوصات التي تساعدك وتساعد طبيبك في فهم حالتك الصحية الحالية ومن ثم تحديد المخاطر المحتملة" }, + "instructionAgree": { + "en": "This monthly Health Summary Report reflects the health indicators and analysis results of the latest visits. Please note that this will be sent automatically from the system and it's not considered as an official report so no medical decisions should be taken based on it.", + "ar": "هذا ملخص التقرير الصحي الشهري و الذي يسرد المؤشرات الصحية و نتائج التحاليل لأخر الزيارات. يرجى ملاحظة أن هذا التقرير هو تقرير يتم ارساله بشكل آلي من النظام و لا يعتبر رسمي و لا تؤخذ عليه أي قرارات طبية" + }, + "reqId": { + "en": "Request ID:", + "ar": " رقم الطلب" + }, + }; diff --git a/lib/core/model/er/PickUpRequestPresOrder.dart b/lib/core/model/er/PickUpRequestPresOrder.dart index 376e30ae..c4f359f5 100644 --- a/lib/core/model/er/PickUpRequestPresOrder.dart +++ b/lib/core/model/er/PickUpRequestPresOrder.dart @@ -18,8 +18,8 @@ class PickUpRequestPresOrder { int pickupSpot; dynamic dropoffLocationId; int transportationMethodId; - double cost; - double vAT; + dynamic cost; + dynamic vAT; double totalPrice; int amountCollected; int selectedAmbulate; diff --git a/lib/core/model/reports/Reports.dart b/lib/core/model/reports/Reports.dart index a8a5869d..6791a3d4 100644 --- a/lib/core/model/reports/Reports.dart +++ b/lib/core/model/reports/Reports.dart @@ -11,24 +11,24 @@ class Reports { String setupId; int patientID; int doctorID; - Null clinicID; + dynamic clinicID; DateTime requestDate; bool isRead; DateTime isReadOn; int actualDoctorRate; String clinicDescription; - Null clinicDescriptionN; + dynamic clinicDescriptionN; String docName; Null docNameN; String doctorImageURL; - Null doctorName; - Null doctorNameN; + dynamic doctorName; + dynamic doctorNameN; int doctorRate; bool isDoctorAllowVedioCall; bool isExecludeDoctor; int noOfPatientsRate; String projectName; - Null projectNameN; + dynamic projectNameN; Reports( {this.status, @@ -61,37 +61,41 @@ class Reports { this.projectNameN}); Reports.fromJson(Map json) { - status = json['Status']; - encounterDate = DateUtil.convertStringToDate( - json['EncounterDate']); //json['EncounterDate']; - projectID = json['ProjectID']; - invoiceNo = json['InvoiceNo']; - encounterNo = json['EncounterNo']; - procedureId = json['ProcedureId']; - requestType = json['RequestType']; - setupId = json['SetupId']; - patientID = json['PatientID']; - doctorID = json['DoctorID']; - clinicID = json['ClinicID']; - requestDate = DateUtil.convertStringToDate( - json['RequestDate']); //json['RequestDate']; - isRead = json['IsRead']; - isReadOn = - DateUtil.convertStringToDate(json['IsReadOn']); //json['IsReadOn']; - actualDoctorRate = json['ActualDoctorRate']; - clinicDescription = json['ClinicDescription']; - clinicDescriptionN = json['ClinicDescriptionN']; - docName = json['DocName']; - docNameN = json['DocNameN']; - doctorImageURL = json['DoctorImageURL']; - doctorName = json['DoctorName']; - doctorNameN = json['DoctorNameN']; - doctorRate = json['DoctorRate']; - isDoctorAllowVedioCall = json['IsDoctorAllowVedioCall']; - isExecludeDoctor = json['IsExecludeDoctor']; - noOfPatientsRate = json['NoOfPatientsRate']; - projectName = json['ProjectName']; - projectNameN = json['ProjectNameN']; + try { + status = json['Status']; + encounterDate = DateUtil.convertStringToDate( + json['EncounterDate']); //json['EncounterDate']; + projectID = json['ProjectID']; + invoiceNo = json['InvoiceNo']; + encounterNo = json['EncounterNo']; + procedureId = json['ProcedureId']; + requestType = json['RequestType']; + setupId = json['SetupId']; + patientID = json['PatientID']; + doctorID = json['DoctorID']; + clinicID = json['ClinicID']; + requestDate = DateUtil.convertStringToDate( + json['RequestDate']); //json['RequestDate']; + isRead = json['IsRead']; + isReadOn = + DateUtil.convertStringToDate(json['IsReadOn']); //json['IsReadOn']; + actualDoctorRate = json['ActualDoctorRate']; + clinicDescription = json['ClinicDescription']; + clinicDescriptionN = json['ClinicDescriptionN']; + docName = json['DocName']; + docNameN = json['DocNameN']; + doctorImageURL = json['DoctorImageURL']; + doctorName = json['DoctorName']; + doctorNameN = json['DoctorNameN']; + doctorRate = json['DoctorRate']; + isDoctorAllowVedioCall = json['IsDoctorAllowVedioCall']; + isExecludeDoctor = json['IsExecludeDoctor']; + noOfPatientsRate = json['NoOfPatientsRate']; + projectName = json['ProjectName']; + projectNameN = json['ProjectNameN']; + }catch(e){ + print(e); + } } Map toJson() { diff --git a/lib/core/service/medical/reports_service.dart b/lib/core/service/medical/reports_service.dart index b2f90e61..bf340814 100644 --- a/lib/core/service/medical/reports_service.dart +++ b/lib/core/service/medical/reports_service.dart @@ -68,6 +68,19 @@ class ReportsService extends BaseService { }, body: body); } + Future updateEmail({String email}) async { + Map body = Map(); + body['EmailAddress'] = email; + body['isDentalAllowedBackend'] = false; + hasError = false; + await baseAppClient.post(UPDATE_PATENT_EMAIL, + 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(); diff --git a/lib/core/viewModels/medical/reports_monthly_view_model.dart b/lib/core/viewModels/medical/reports_monthly_view_model.dart index 3ae196f5..adb7223e 100644 --- a/lib/core/viewModels/medical/reports_monthly_view_model.dart +++ b/lib/core/viewModels/medical/reports_monthly_view_model.dart @@ -13,11 +13,9 @@ class ReportsMonthlyViewModel extends BaseViewModel { ReportsService _reportsService = locator(); - - String get userAgreementContent => _reportsService.userAgreementContent; - getUserTermsAndConditions() async{ + getUserTermsAndConditions() async { setState(ViewState.Busy); await _reportsService.getUserTermsAndConditions(); if (_reportsService.hasError) { @@ -28,19 +26,33 @@ class ReportsMonthlyViewModel extends BaseViewModel { } } - updatePatientHealthSummaryReport({String message, bool isSummary})async{ + updatePatientHealthSummaryReport( + {String message, + bool isSummary, + bool isUpdateEmail = false, + String email}) async { setState(ViewState.BusyLocal); - await _reportsService.updatePatientHealthSummaryReport(isSummary: isSummary); + await _reportsService.updatePatientHealthSummaryReport( + isSummary: isSummary); if (_reportsService.hasError) { error = _reportsService.error; AppToast.showErrorToast(message: error); setState(ViewState.ErrorLocal); } else { - AppToast.showSuccessToast(message: message); - setState(ViewState.Idle); + if (isUpdateEmail) { + await _reportsService.updateEmail(email: email); + if (_reportsService.hasError) { + error = _reportsService.error; + AppToast.showErrorToast(message: error); + setState(ViewState.ErrorLocal); + } else { + AppToast.showSuccessToast(message: message); + setState(ViewState.Idle); + } + } else { + AppToast.showSuccessToast(message: message); + setState(ViewState.Idle); + } } } - - - } diff --git a/lib/pages/ErService/AmbulanceReq.dart b/lib/pages/ErService/AmbulanceReq.dart index 3d4192c5..fe245133 100644 --- a/lib/pages/ErService/AmbulanceReq.dart +++ b/lib/pages/ErService/AmbulanceReq.dart @@ -79,7 +79,7 @@ class _AmbulanceReqState extends State child: Container( height: 60.0, margin: EdgeInsets.only(top: 10.0), - width: MediaQuery.of(context).size.width * 0.93, + width: MediaQuery.of(context).size.width * 0.90, decoration: BoxDecoration( border: Border( bottom: BorderSide( @@ -92,8 +92,7 @@ class _AmbulanceReqState extends State isScrollable: true, controller: _tabController, indicatorWeight: 5.0, - indicatorSize: TabBarIndicatorSize.tab, - indicatorColor: Colors.red[800], + indicatorSize: TabBarIndicatorSize.label, labelColor: Theme.of(context).primaryColor, labelPadding: EdgeInsets.only(top: 4.0, left: 18.0, right: 18.0), diff --git a/lib/pages/ErService/AmbulanceRequestIndexPages/AmbulanceRequestIndex.dart b/lib/pages/ErService/AmbulanceRequestIndexPages/AmbulanceRequestIndex.dart index 5f303846..c07adabc 100644 --- a/lib/pages/ErService/AmbulanceRequestIndexPages/AmbulanceRequestIndex.dart +++ b/lib/pages/ErService/AmbulanceRequestIndexPages/AmbulanceRequestIndex.dart @@ -46,7 +46,7 @@ class _AmbulanceRequestIndexPageState extends State { @override Widget build(BuildContext context) { return AppScaffold( - body: widget.amRequestViewModel.pickUpRequestPresOrder != null + body: false ? Column( children: [ SizedBox( @@ -62,18 +62,18 @@ class _AmbulanceRequestIndexPageState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ OrderLogItem( - title: 'Request ID', + title: TranslationBase.of(context).reqId, value: widget.amRequestViewModel.pickUpRequestPresOrder .presOrderID .toString(), ), OrderLogItem( - title: 'Status', + title: TranslationBase.of(context).status, value: widget.amRequestViewModel.pickUpRequestPresOrder .ambulateDescription, ), OrderLogItem( - title: 'Last edit time', + title: TranslationBase.of(context).pickupDate, value: DateUtil.getDayMonthYearDateFormatted( DateUtil.convertStringToDate(widget .amRequestViewModel @@ -81,17 +81,17 @@ class _AmbulanceRequestIndexPageState extends State { .lastEditDate)), ), OrderLogItem( - title: 'Pickup Location', + title: TranslationBase.of(context).pickupLocation, value: widget.amRequestViewModel.pickUpRequestPresOrder .pickupLocationName, ), OrderLogItem( - title: 'Drop off Location', + title: TranslationBase.of(context).dropoffLocation, value: widget.amRequestViewModel.pickUpRequestPresOrder .dropoffLocationName, ), OrderLogItem( - title: 'Trasfaer way', + title: TranslationBase.of(context).transportMethod, value: widget .amRequestViewModel.pickUpRequestPresOrder.title, ), diff --git a/lib/pages/ErService/AmbulanceRequestIndexPages/BillAmount.dart b/lib/pages/ErService/AmbulanceRequestIndexPages/BillAmount.dart index cc6af0f2..aeb61609 100644 --- a/lib/pages/ErService/AmbulanceRequestIndexPages/BillAmount.dart +++ b/lib/pages/ErService/AmbulanceRequestIndexPages/BillAmount.dart @@ -2,6 +2,7 @@ import 'package:diplomaticquarterapp/core/enum/Ambulate.dart'; import 'package:diplomaticquarterapp/core/model/er/PatientER.dart'; import 'package:diplomaticquarterapp/core/viewModels/er/am_request_view_model.dart'; import 'package:diplomaticquarterapp/pages/Blood/new_text_Field.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:flutter/cupertino.dart'; @@ -51,7 +52,7 @@ class _BillAmountState extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Texts('Bill Amount '), + Texts(TranslationBase.of(context).billAmount), SizedBox( height: 10, ), @@ -73,7 +74,7 @@ class _BillAmountState extends State { child: Padding( padding: const EdgeInsets.all(8.0), child: Texts( - 'Amount before tax: ', + TranslationBase.of(context).patientShareB, textAlign: TextAlign.start, color: Colors.black, fontSize: 15, @@ -91,7 +92,7 @@ class _BillAmountState extends State { child: Padding( padding: const EdgeInsets.all(8.0), child: Texts( - 'SR ${widget.patientER.patientERTransportationMethod.price}', + TranslationBase.of(context).sar+' ${widget.patientER.patientERTransportationMethod.price}', color: Colors.black, textAlign: TextAlign.start, fontSize: 15, @@ -108,7 +109,7 @@ class _BillAmountState extends State { child: Padding( padding: const EdgeInsets.all(8.0), child: Texts( - 'Tax amount :', + TranslationBase.of(context).patientShareTax, color: Colors.black, fontSize: 15, textAlign: TextAlign.start, @@ -121,7 +122,7 @@ class _BillAmountState extends State { child: Padding( padding: const EdgeInsets.all(8.0), child: Texts( - 'SR ${widget.patientER.patientERTransportationMethod.vAT}', + TranslationBase.of(context).sar+' ${widget.patientER.patientERTransportationMethod.vAT}', color: Colors.black, fontSize: 15, textAlign: TextAlign.start, @@ -143,7 +144,7 @@ class _BillAmountState extends State { child: Padding( padding: const EdgeInsets.all(8.0), child: Texts( - 'Total amount payable', + TranslationBase.of(context).patientShareTotal, color: Colors.black, fontSize: 15, textAlign: TextAlign.start, @@ -162,7 +163,7 @@ class _BillAmountState extends State { child: Padding( padding: const EdgeInsets.all(8.0), child: Texts( - 'SR ${widget.patientER.patientERTransportationMethod.totalPrice}', + TranslationBase.of(context).sar+' ${widget.patientER.patientERTransportationMethod.totalPrice}', color: Colors.black, fontSize: 15, textAlign: TextAlign.start, @@ -176,7 +177,7 @@ class _BillAmountState extends State { SizedBox( height: 10, ), - Texts('Select Ambulate',bold: true,), + Texts(TranslationBase.of(context).selectAmbulate,bold: true,), SizedBox(height: 5,), Row( children: [ @@ -196,7 +197,7 @@ class _BillAmountState extends State { color: Colors.white, ), child: ListTile( - title: Text('Wheelchair'), + title: Text(TranslationBase.of(context).wheelchair), leading: Radio( value: Ambulate.Wheelchair, groupValue: _ambulate, @@ -227,7 +228,7 @@ class _BillAmountState extends State { color: Colors.white, ), child: ListTile( - title: Text('Walker'), + title: Text(TranslationBase.of(context).walker), leading: Radio( value: Ambulate.Walker, groupValue: _ambulate, @@ -263,7 +264,7 @@ class _BillAmountState extends State { color: Colors.white, ), child: ListTile( - title: Text('Stretcher'), + title: Text(TranslationBase.of(context).stretcher), leading: Radio( value: Ambulate.Stretcher, groupValue: _ambulate, @@ -294,7 +295,7 @@ class _BillAmountState extends State { color: Colors.white, ), child: ListTile( - title: Text('None'), + title: Text(TranslationBase.of(context).none), leading: Radio( value: Ambulate.None, groupValue: _ambulate, @@ -313,7 +314,7 @@ class _BillAmountState extends State { ), SizedBox(height: 12,), NewTextFields( - hintText: 'Note', + hintText: TranslationBase.of(context).notes, initialValue: note, onChanged: (value){ setState(() { @@ -340,7 +341,7 @@ class _BillAmountState extends State { widget.changeCurrentTab(3); }); }, - label: 'Next', + label: TranslationBase.of(context).next, ), ) ], diff --git a/lib/pages/ErService/AmbulanceRequestIndexPages/PickupLocation.dart b/lib/pages/ErService/AmbulanceRequestIndexPages/PickupLocation.dart index b99596c8..f6ebfde9 100644 --- a/lib/pages/ErService/AmbulanceRequestIndexPages/PickupLocation.dart +++ b/lib/pages/ErService/AmbulanceRequestIndexPages/PickupLocation.dart @@ -9,6 +9,7 @@ import 'package:diplomaticquarterapp/pages/landing/home_page.dart'; import 'package:diplomaticquarterapp/uitl/ProgressDialog.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/pickupLocation/PickupLocationFromMap.dart'; @@ -78,7 +79,7 @@ class _PickupLocationState extends State { Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Texts('Pickup Location'), + Texts(TranslationBase.of(context).pickupLocation), SizedBox( height: 15, ), @@ -110,7 +111,7 @@ class _PickupLocationState extends State { child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Texts(getSelectFromMapName()), + Texts(getSelectFromMapName(context)), Icon( FontAwesomeIcons.mapMarkerAlt, size: 24, @@ -123,7 +124,7 @@ class _PickupLocationState extends State { SizedBox( height: 12, ), - Texts('Pickup Spot'), + Texts(TranslationBase.of(context).pickupSpot), SizedBox( height: 5, ), @@ -141,7 +142,7 @@ class _PickupLocationState extends State { color: Colors.white, ), child: ListTile( - title: Texts('Inside Home'), + title: Texts(TranslationBase.of(context).insideHome), leading: Checkbox( activeColor: Colors.red[800], value: _isInsideHome, @@ -157,7 +158,7 @@ class _PickupLocationState extends State { SizedBox( height: 12, ), - Texts('Do you have an appointment ?'), + Texts(TranslationBase.of(context).haveAppo), SizedBox( height: 5, ), @@ -182,7 +183,7 @@ class _PickupLocationState extends State { color: Colors.white, ), child: ListTile( - title: Text('Yes'), + title: Texts(TranslationBase.of(context).yes), leading: Radio( value: HaveAppointment.YES, groupValue: _haveAppointment, @@ -217,7 +218,7 @@ class _PickupLocationState extends State { color: Colors.white, ), child: ListTile( - title: Text('No'), + title: Texts(TranslationBase.of(context).no), leading: Radio( value: HaveAppointment.NO, groupValue: _haveAppointment, @@ -250,7 +251,7 @@ class _PickupLocationState extends State { SizedBox( height: 12, ), - Texts('Drop off Location'), + Texts(TranslationBase.of(context).dropoffLocation), SizedBox( height: 8, ), @@ -270,7 +271,7 @@ class _PickupLocationState extends State { child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Texts(getHospitalName('Pickup Location')), + Texts(getHospitalName(TranslationBase.of(context).pickupLocation)), Icon( Icons.arrow_drop_down, size: 24, @@ -286,7 +287,7 @@ class _PickupLocationState extends State { Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Texts('Pickup Location'), + Texts(TranslationBase.of(context).pickupLocation), SizedBox( height: 15, ), @@ -306,7 +307,7 @@ class _PickupLocationState extends State { child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Texts(getHospitalName('Pickup Location')), + Texts(getHospitalName(TranslationBase.of(context).pickupLocation)), Icon( Icons.arrow_drop_down, size: 24, @@ -319,7 +320,7 @@ class _PickupLocationState extends State { SizedBox( height: 12, ), - Texts('Drop off Location'), + Texts(TranslationBase.of(context).dropoffLocation), SizedBox( height: 8, ), @@ -351,7 +352,7 @@ class _PickupLocationState extends State { child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Texts(getSelectFromMapName()), + Texts(getSelectFromMapName(context)), Icon( FontAwesomeIcons.mapMarkerAlt, size: 24, @@ -377,7 +378,7 @@ class _PickupLocationState extends State { onTap: () { if (_result == null || _selectedHospital == null) AppToast.showErrorToast( - message: 'please select all fields'); + message: TranslationBase.of(context).selectAll); else setState(() { widget.patientER.pickupSpot = _isInsideHome ? 1 : 0; @@ -427,7 +428,7 @@ class _PickupLocationState extends State { widget.changeCurrentTab(2); }); }, - label: 'Next', + label: TranslationBase.of(context).next, ), ) ], @@ -455,8 +456,8 @@ class _PickupLocationState extends State { return _selectedHospital == null ? title : _selectedHospital.name; } - String getSelectFromMapName() { - return _result != null ? _result.formattedAddress : 'Select From Map'; + String getSelectFromMapName(context) { + return _result != null ? _result.formattedAddress : TranslationBase.of(context).selectMap; } getAppointment() { @@ -494,7 +495,7 @@ class _PickupLocationState extends State { setState(() { _haveAppointment = HaveAppointment.NO; }); - AppToast.showErrorToast(message: 'You don\'t have any appointment'); + AppToast.showErrorToast(message: TranslationBase.of(context).noAppointment); } }).catchError((e) { ProgressDialogUtil.hideProgressDialog(context); diff --git a/lib/pages/ErService/AmbulanceRequestIndexPages/SelectTransportationMethod.dart b/lib/pages/ErService/AmbulanceRequestIndexPages/SelectTransportationMethod.dart index 01683b55..69669ed3 100644 --- a/lib/pages/ErService/AmbulanceRequestIndexPages/SelectTransportationMethod.dart +++ b/lib/pages/ErService/AmbulanceRequestIndexPages/SelectTransportationMethod.dart @@ -5,6 +5,7 @@ import 'package:diplomaticquarterapp/core/enum/OrderService.dart'; import 'package:diplomaticquarterapp/core/model/er/PatientER.dart'; import 'package:diplomaticquarterapp/core/model/er/get_all_transportation_method_list_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/er/am_request_view_model.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:flutter/cupertino.dart'; @@ -67,7 +68,7 @@ class _SelectTransportationMethodState SizedBox( height: 12, ), - Texts('Select Transportation Method'), + Texts(TranslationBase.of(context).transportHeading), ...List.generate( widget.amRequestViewModel.amRequestModeList.length, (index) => InkWell( @@ -108,7 +109,7 @@ class _SelectTransportationMethodState Expanded( flex: 1, child: Texts( - 'SR ${widget.amRequestViewModel.amRequestModeList[index].price}'), + TranslationBase.of(context).sar+' ${widget.amRequestViewModel.amRequestModeList[index].price}'), ) ], ), @@ -118,7 +119,7 @@ class _SelectTransportationMethodState SizedBox( height: 12, ), - Texts('Select Direction'), + Texts(TranslationBase.of(context).directionHeading), SizedBox( height: 5, ), @@ -144,7 +145,7 @@ class _SelectTransportationMethodState color: Colors.white, ), child: ListTile( - title: Text('To Hospital'), + title: Text(TranslationBase.of(context).toHospital), leading: Radio( value: Direction.ToHospital, groupValue: _direction, @@ -175,7 +176,7 @@ class _SelectTransportationMethodState color: Colors.white, ), child: ListTile( - title: Text('Form Hospital'), + title: Text(TranslationBase.of(context).fromHospital), leading: Radio( value: Direction.FromHospital, groupValue: _direction, @@ -200,7 +201,7 @@ class _SelectTransportationMethodState SizedBox( height: 8, ), - Texts('Select Direction'), + Texts(TranslationBase.of(context).directionHeading), SizedBox( height: 5, ), @@ -222,7 +223,7 @@ class _SelectTransportationMethodState color: Colors.white, ), child: ListTile( - title: Text('One Way'), + title: Text(TranslationBase.of(context).oneDirec), leading: Radio( value: Way.OneWay, groupValue: _way, @@ -253,7 +254,7 @@ class _SelectTransportationMethodState color: Colors.white, ), child: ListTile( - title: Text('Two Ways'), + title: Text(TranslationBase.of(context).twoDirec), leading: Radio( value: Way.TwoWays, groupValue: _way, @@ -298,7 +299,7 @@ class _SelectTransportationMethodState widget.changeCurrentTab(1); }); }, - label: 'Next', + label: TranslationBase.of(context).next, ), ) ], diff --git a/lib/pages/ErService/AmbulanceRequestIndexPages/Summary.dart b/lib/pages/ErService/AmbulanceRequestIndexPages/Summary.dart index 7696dd09..8fd72b8f 100644 --- a/lib/pages/ErService/AmbulanceRequestIndexPages/Summary.dart +++ b/lib/pages/ErService/AmbulanceRequestIndexPages/Summary.dart @@ -1,5 +1,6 @@ import 'package:diplomaticquarterapp/core/model/er/PatientER.dart'; import 'package:diplomaticquarterapp/core/viewModels/er/am_request_view_model.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:flutter/cupertino.dart'; @@ -27,7 +28,7 @@ class _SummaryState extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Texts('Summary'), + Texts(TranslationBase.of(context).RRTSummary), SizedBox(height: 5,), Container( width: double.infinity, @@ -39,11 +40,11 @@ class _SummaryState extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Texts('Transportation Method',color: Colors.grey,), + Texts(TranslationBase.of(context).transportMethod,color: Colors.grey,), Texts('${widget.patientER.patientERTransportationMethod.title}',bold: true,), SizedBox(height: 8,), - Texts('Direction',color: Colors.grey,), + Texts(TranslationBase.of(context).directions,color: Colors.grey,), Texts('From Hospital',bold: true,), SizedBox(height: 8,), @@ -92,7 +93,7 @@ class _SummaryState extends State { child:SecondaryButton( color: Colors.grey[800], textColor: Colors.white, - label: 'Send', + label: TranslationBase.of(context).send, onTap: () async { await widget.amRequestViewModel.insertERPressOrder(patientER: widget.patientER); diff --git a/lib/pages/feedback/feedback_home_page.dart b/lib/pages/feedback/feedback_home_page.dart index fe22b44a..f7f998bf 100644 --- a/lib/pages/feedback/feedback_home_page.dart +++ b/lib/pages/feedback/feedback_home_page.dart @@ -74,7 +74,6 @@ class _FeedbackHomePageState extends State controller: _tabController, indicatorWeight: 5.0, indicatorSize: TabBarIndicatorSize.tab, - indicatorColor: Colors.red[800], labelColor: Theme.of(context).primaryColor, labelPadding: EdgeInsets.only(top: 4.0, left: 18.0, right: 18.0), diff --git a/lib/pages/medical/reports/monthly_reports.dart b/lib/pages/medical/reports/monthly_reports.dart index ae9cc295..4484bd5f 100644 --- a/lib/pages/medical/reports/monthly_reports.dart +++ b/lib/pages/medical/reports/monthly_reports.dart @@ -2,10 +2,12 @@ import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/reports_monthly_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/medical/reports/user_agreement_page.dart'; +import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/input/custom_switch.dart'; +import 'package:diplomaticquarterapp/widgets/input/text_field.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; @@ -19,6 +21,8 @@ class MonthlyReportsPage extends StatefulWidget { class _MonthlyReportsPageState extends State { bool isAgree = false; bool isSummary = false; + String email = ""; + final formKey = GlobalKey(); @override Widget build(BuildContext context) { @@ -29,135 +33,161 @@ class _MonthlyReportsPageState extends State { body: SingleChildScrollView( child: Container( padding: EdgeInsets.all(12), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - padding: EdgeInsets.all(9), - height: 55, - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.all(Radius.circular(8)), - shape: BoxShape.rectangle, - border: Border.all(color: Colors.grey)), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Texts( - TranslationBase.of(context).patientHealthSummaryReport, - bold: true, - ), - CustomSwitch( - value: isSummary, - activeColor: Colors.red, - inactiveColor: Colors.grey, - onChanged: () async { - setState(() { - isSummary = !isSummary; - }); - }, - ) - ], + child: Form( + key: formKey, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + padding: EdgeInsets.all(9), + height: 55, + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all(Radius.circular(8)), + shape: BoxShape.rectangle, + border: Border.all(color: Colors.grey)), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + + Texts( + TranslationBase.of(context).patientHealthSummaryReport, + bold: true, + ), + CustomSwitch( + value: isSummary, + activeColor: Colors.red, + inactiveColor: Colors.grey, + onChanged: () async { + setState(() { + isSummary = !isSummary; + }); + if(!isSummary) { + GifLoaderDialogUtils.showMyDialog(context); + await model.updatePatientHealthSummaryReport( + message: TranslationBase + .of(context) + .updateSuccessfully, isSummary: isSummary); + GifLoaderDialogUtils.hideDialog(context); + } + }, + ) + ], + ), ), - ), - SizedBox( - height: 15, - ), - Container( - margin: EdgeInsets.all(8), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Texts( - model.user.emailAddress, - bold: true, - ), - ], + SizedBox( + height: 15, ), - ), - Divider( - height: 10.4, - thickness: 1.0, - ), - SizedBox( - height: 15, - ), - Container( - margin: EdgeInsets.all(8), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, + Container( + margin: EdgeInsets.all(8), + child: TextFields( + fillColor: Colors.red, + hintText: 'email@email.com', + fontSize: 20, + initialValue: model.user.emailAddress, + fontWeight: FontWeight.w600, + onChanged: (text) { + email = text; + }, + validator: (value) { + if (value.isEmpty) + return TranslationBase.of(context).enterEmail; + else + return null; + }, + ), + ), + Divider( + height: 10.4, + thickness: 1.0, + ), + SizedBox( + height: 15, + ), + Container( + margin: EdgeInsets.all(8), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Expanded( + child: Texts(TranslationBase.of(context) + .toViewTheTermsAndConditions), + ), + InkWell( + onTap: () { + Navigator.push( + context, + FadePage( + page: UserAgreementContent(), + ), + ); + }, + child: Texts( + TranslationBase.of(context).clickHere, + color: Colors.blue, + ), + ) + ], + ), + ), + SizedBox( + height: 5, + ), + Row( crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.start, children: [ - Expanded( - child: Texts(TranslationBase.of(context) - .toViewTheTermsAndConditions), - ), - InkWell( - onTap: () { - Navigator.push( - context, - FadePage( - page: UserAgreementContent(), - ), - ); + Checkbox( + value: isAgree, + onChanged: (value) { + setState(() { + isAgree = !isAgree; + }); }, - child: Texts( - TranslationBase.of(context).clickHere, - color: Colors.blue, - ), - ) + activeColor: Colors.red, + ), + Texts(TranslationBase.of(context).iAgreeToTheTermsAndConditions), ], ), - ), - SizedBox( - height: 5, - ), - Row( - crossAxisAlignment: CrossAxisAlignment.center, - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Checkbox( - value: isAgree, - onChanged: (value) { - setState(() { - isAgree = !isAgree; - }); + Container( + margin: EdgeInsets.all(8), + width: double.infinity, + child: SecondaryButton( + textColor: Colors.white, + label: TranslationBase.of(context).save, + disabled: (!isAgree || !isSummary ), + onTap: () async { + final form = formKey.currentState; + if (form.validate()) { + GifLoaderDialogUtils.showMyDialog(context); + await model.updatePatientHealthSummaryReport( + message: TranslationBase + .of(context) + .updateSuccessfully, + isSummary: isSummary, + isUpdateEmail: true, + email: email.isNotEmpty ? email : model.user + .emailAddress); + GifLoaderDialogUtils.hideDialog(context); + } }, - activeColor: Colors.red, ), - Texts(TranslationBase.of(context) - .iAgreeToTheTermsAndConditions), - ], - ), - Container( - margin: EdgeInsets.all(8), - width: double.infinity, - child: SecondaryButton( - textColor: Colors.white, - label: TranslationBase.of(context).save, - disabled: !isAgree, - loading: model.state == ViewState.BusyLocal, - onTap: () { - model.updatePatientHealthSummaryReport( - message: TranslationBase.of(context) - .updateSuccessfully, - isSummary: isSummary); - }, ), - ), - Padding( - padding: const EdgeInsets.all(5.0), - child: Texts( - TranslationBase.of(context) - .iAgreeToTheTermsAndConditionsSubtitle, - fontWeight: FontWeight.normal, + Padding( + padding: const EdgeInsets.all(5.0), + child: Texts( + TranslationBase.of(context) + .instructionAgree, + fontWeight: FontWeight.normal, + ), + ), + SizedBox( + height: 12, ), - ), - SizedBox( - height: 12, - ), - Center(child: Image.asset('assets/images/report.jpg')) - ], + Center(child: Image.asset('assets/images/report.jpg')) + ], + ), ), ), ), diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index f49c5d34..cb08bd17 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -1042,7 +1042,7 @@ class TranslationBase { String get selectAmbulate => localizedValues['select-ambulate'][locale.languageCode]; String get wheelchair => localizedValues['wheelchair'][locale.languageCode]; - String get walker => localizedValues['walker"'][locale.languageCode]; + String get walker => localizedValues['walker'][locale.languageCode]; String get stretcher => localizedValues['stretcher'][locale.languageCode]; String get none => localizedValues['none'][locale.languageCode]; String get RRTSummary => localizedValues['RRT-Summary'][locale.languageCode]; @@ -1248,6 +1248,8 @@ class TranslationBase { String get NearestErDesc => localizedValues['NearestErDesc'][locale.languageCode]; String get NearestEr => localizedValues['NearestEr'][locale.languageCode]; String get infoCMC => localizedValues['infoCMC'][locale.languageCode]; + String get instructionAgree => localizedValues['instructionAgree'][locale.languageCode]; + String get reqId => localizedValues['reqId'][locale.languageCode]; } diff --git a/lib/widgets/input/text_field.dart b/lib/widgets/input/text_field.dart index 6e740fc8..55ebbc3d 100644 --- a/lib/widgets/input/text_field.dart +++ b/lib/widgets/input/text_field.dart @@ -46,8 +46,7 @@ class TextFields extends StatefulWidget { this.suffixIcon, this.autoFocus, this.onChanged, - - // this.initialValue, + this.initialValue, this.minLines, this.maxLines, this.inputFormatters, @@ -78,8 +77,7 @@ class TextFields extends StatefulWidget { : super(key: key); final String hintText; - - // final String initialValue; + final String initialValue; final String type; final bool autoFocus; final IconData suffixIcon; @@ -230,7 +228,7 @@ class _TextFieldsState extends State { minLines: widget.minLines ?? 1, maxLines: widget.maxLines ?? 1, maxLengthEnforced: widget.maxLengthEnforced, - // initialValue: widget.initialValue, + initialValue: widget.initialValue, onChanged: widget.onChanged, focusNode: _focusNode, maxLength: widget.maxLength ?? null, From 4457b5f109fb88693cd399d1bce82329354b6ca4 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Mon, 18 Jan 2021 14:05:35 +0200 Subject: [PATCH 24/42] add translation to ER service --- lib/config/localized_values.dart | 5 +- lib/core/enum/Ambulate.dart | 11 +- lib/pages/ErService/AmbulanceReq.dart | 2 +- .../AmbulanceRequestIndex.dart | 2 +- .../BillAmount.dart | 532 ++++++------- .../PickupLocation.dart | 705 +++++++++--------- .../SelectTransportationMethod.dart | 466 ++++++------ .../AmbulanceRequestIndexPages/Summary.dart | 147 ++-- lib/pages/ErService/OrderLogPage.dart | 10 +- lib/pages/ErService/widgets/StepsWidget.dart | 22 +- lib/uitl/translations_delegate_base.dart | 1 + 11 files changed, 981 insertions(+), 922 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index aaa7f16a..295a09f9 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -1477,5 +1477,8 @@ const Map localizedValues = { "en": "Request ID:", "ar": " رقم الطلب" }, - + "RRT-orders-log": { + "en": "Orders Log", + "ar": "سجل الطلبات" + }, }; diff --git a/lib/core/enum/Ambulate.dart b/lib/core/enum/Ambulate.dart index f8b2e8be..e4714cb2 100644 --- a/lib/core/enum/Ambulate.dart +++ b/lib/core/enum/Ambulate.dart @@ -1,3 +1,4 @@ +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:flutter/cupertino.dart'; enum Ambulate { Wheelchair, Walker, Stretcher, None } @@ -6,19 +7,19 @@ extension SelectedAmbulate on Ambulate { String getAmbulateTitle(BuildContext context) { switch (this) { case Ambulate.Wheelchair: - return 'Wheelchair'; + return TranslationBase.of(context).wheelchair; break; case Ambulate.Walker: - return 'Walker'; + return TranslationBase.of(context).walker; break; case Ambulate.Stretcher: - return 'Stretcher'; + return TranslationBase.of(context).stretcher; break; case Ambulate.None: - return 'None'; + return TranslationBase.of(context).none; break; } - return 'None'; + return TranslationBase.of(context).none; } int selectAmbulateNumber() { diff --git a/lib/pages/ErService/AmbulanceReq.dart b/lib/pages/ErService/AmbulanceReq.dart index fe245133..1d4e78ee 100644 --- a/lib/pages/ErService/AmbulanceReq.dart +++ b/lib/pages/ErService/AmbulanceReq.dart @@ -107,7 +107,7 @@ class _AmbulanceReqState extends State Container( width: MediaQuery.of(context).size.width * 0.30, child: Center( - child: Texts("Orders Log"), + child: Texts(TranslationBase.of(context).ordersLog), ), ), ], diff --git a/lib/pages/ErService/AmbulanceRequestIndexPages/AmbulanceRequestIndex.dart b/lib/pages/ErService/AmbulanceRequestIndexPages/AmbulanceRequestIndex.dart index c07adabc..1fb47cec 100644 --- a/lib/pages/ErService/AmbulanceRequestIndexPages/AmbulanceRequestIndex.dart +++ b/lib/pages/ErService/AmbulanceRequestIndexPages/AmbulanceRequestIndex.dart @@ -46,7 +46,7 @@ class _AmbulanceRequestIndexPageState extends State { @override Widget build(BuildContext context) { return AppScaffold( - body: false + body: widget.amRequestViewModel.pickUpRequestPresOrder != null ? Column( children: [ SizedBox( diff --git a/lib/pages/ErService/AmbulanceRequestIndexPages/BillAmount.dart b/lib/pages/ErService/AmbulanceRequestIndexPages/BillAmount.dart index aeb61609..051f672e 100644 --- a/lib/pages/ErService/AmbulanceRequestIndexPages/BillAmount.dart +++ b/lib/pages/ErService/AmbulanceRequestIndexPages/BillAmount.dart @@ -5,6 +5,7 @@ import 'package:diplomaticquarterapp/pages/Blood/new_text_Field.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -45,306 +46,309 @@ class _BillAmountState extends State { @override Widget build(BuildContext context) { - return SingleChildScrollView( - physics: BouncingScrollPhysics(), - child: Container( - margin: EdgeInsets.only(left: 12, right: 12), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Texts(TranslationBase.of(context).billAmount), - SizedBox( - height: 10, - ), - Table( - border: TableBorder.symmetric( - inside: BorderSide(width: 1.0, color: Colors.grey[300]), - outside: BorderSide(width: 1.0, color: Colors.grey[300])), - children: [ - TableRow( - children: [ - Container( - height: MediaQuery.of(context).size.height * 0.09, - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.only( - topLeft: Radius.circular(10.0), + return AppScaffold( + isShowDecPage: false, + isShowAppBar: false, + body: SingleChildScrollView( + physics: BouncingScrollPhysics(), + child: Container( + margin: EdgeInsets.only(left: 12, right: 12), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts(TranslationBase.of(context).billAmount), + SizedBox( + height: 10, + ), + Table( + border: TableBorder.symmetric( + inside: BorderSide(width: 1.0, color: Colors.grey[300]), + outside: BorderSide(width: 1.0, color: Colors.grey[300])), + children: [ + TableRow( + children: [ + Container( + height: MediaQuery.of(context).size.height * 0.09, + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.only( + topLeft: Radius.circular(10.0), + ), ), - ), - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Texts( - TranslationBase.of(context).patientShareB, - textAlign: TextAlign.start, - color: Colors.black, - fontSize: 15, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Texts( + TranslationBase.of(context).patientShareB, + textAlign: TextAlign.start, + color: Colors.black, + fontSize: 15, + ), ), ), - ), - Container( - height: MediaQuery.of(context).size.height * 0.09, - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.only( - topRight: Radius.circular(10.0), + Container( + height: MediaQuery.of(context).size.height * 0.09, + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.only( + topRight: Radius.circular(10.0), + ), ), - ), - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Texts( - TranslationBase.of(context).sar+' ${widget.patientER.patientERTransportationMethod.price}', - color: Colors.black, - textAlign: TextAlign.start, - fontSize: 15, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Texts( + TranslationBase.of(context).sar+' ${widget.patientER.patientERTransportationMethod.price}', + color: Colors.black, + textAlign: TextAlign.start, + fontSize: 15, + ), ), ), - ), - ], - ), - TableRow( - children: [ - Container( - color: Colors.white, - height: MediaQuery.of(context).size.height * 0.09, - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Texts( - TranslationBase.of(context).patientShareTax, - color: Colors.black, - fontSize: 15, - textAlign: TextAlign.start, - ), - ), - ), - Container( - height: MediaQuery.of(context).size.height * 0.09, - color: Colors.white, - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Texts( - TranslationBase.of(context).sar+' ${widget.patientER.patientERTransportationMethod.vAT}', - color: Colors.black, - fontSize: 15, - textAlign: TextAlign.start, + ], + ), + TableRow( + children: [ + Container( + color: Colors.white, + height: MediaQuery.of(context).size.height * 0.09, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Texts( + TranslationBase.of(context).patientShareTax, + color: Colors.black, + fontSize: 15, + textAlign: TextAlign.start, + ), ), ), - ), - ], - ), - TableRow( - children: [ - Container( - height: MediaQuery.of(context).size.height * 0.09, - decoration: BoxDecoration( + Container( + height: MediaQuery.of(context).size.height * 0.09, color: Colors.white, - borderRadius: BorderRadius.only( - bottomLeft: Radius.circular(10.0), + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Texts( + TranslationBase.of(context).sar+' ${widget.patientER.patientERTransportationMethod.vAT}', + color: Colors.black, + fontSize: 15, + textAlign: TextAlign.start, + ), ), ), - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Texts( - TranslationBase.of(context).patientShareTotal, - color: Colors.black, - fontSize: 15, - textAlign: TextAlign.start, - bold: true, + ], + ), + TableRow( + children: [ + Container( + height: MediaQuery.of(context).size.height * 0.09, + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.only( + bottomLeft: Radius.circular(10.0), + ), ), - ), - ), - Container( - height: MediaQuery.of(context).size.height * 0.09, - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.only( - bottomRight: Radius.circular(10.0), + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Texts( + TranslationBase.of(context).patientShareTotal, + color: Colors.black, + fontSize: 15, + textAlign: TextAlign.start, + bold: true, + ), ), ), - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Texts( - TranslationBase.of(context).sar+' ${widget.patientER.patientERTransportationMethod.totalPrice}', - color: Colors.black, - fontSize: 15, - textAlign: TextAlign.start, + Container( + height: MediaQuery.of(context).size.height * 0.09, + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.only( + bottomRight: Radius.circular(10.0), + ), + ), + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Texts( + TranslationBase.of(context).sar+' ${widget.patientER.patientERTransportationMethod.totalPrice}', + color: Colors.black, + fontSize: 15, + textAlign: TextAlign.start, + ), ), ), - ), - ], - ), - ], - ), - SizedBox( - height: 10, - ), - Texts(TranslationBase.of(context).selectAmbulate,bold: true,), - SizedBox(height: 5,), - Row( - children: [ - Expanded( - child: InkWell( - onTap: () { - setState(() { - _ambulate = Ambulate.Wheelchair; - }); - }, - child: Container( - decoration: BoxDecoration( - shape: BoxShape.rectangle, - borderRadius: BorderRadius.circular(8), - border: - Border.all(color: Colors.grey, width: 0.5), - color: Colors.white, - ), - child: ListTile( - title: Text(TranslationBase.of(context).wheelchair), - leading: Radio( - value: Ambulate.Wheelchair, - groupValue: _ambulate, - activeColor: Colors.red[800], - onChanged: (value) { - setState(() { - _ambulate = value; - }); - }, + ], + ), + ], + ), + SizedBox( + height: 10, + ), + Texts(TranslationBase.of(context).selectAmbulate,bold: true,), + SizedBox(height: 5,), + Row( + children: [ + Expanded( + child: InkWell( + onTap: () { + setState(() { + _ambulate = Ambulate.Wheelchair; + }); + }, + child: Container( + decoration: BoxDecoration( + shape: BoxShape.rectangle, + borderRadius: BorderRadius.circular(8), + border: + Border.all(color: Colors.grey, width: 0.5), + color: Colors.white, + ), + child: ListTile( + title: Text(TranslationBase.of(context).wheelchair), + leading: Radio( + value: Ambulate.Wheelchair, + groupValue: _ambulate, + onChanged: (value) { + setState(() { + _ambulate = value; + }); + }, + ), ), ), ), ), - ), - Expanded( - child: InkWell( - onTap: () { - setState(() { - _ambulate = Ambulate.Walker; - }); - }, - child: Container( - decoration: BoxDecoration( - shape: BoxShape.rectangle, - borderRadius: BorderRadius.circular(8), - border: - Border.all(color: Colors.grey, width: 0.5), - color: Colors.white, - ), - child: ListTile( - title: Text(TranslationBase.of(context).walker), - leading: Radio( - value: Ambulate.Walker, - groupValue: _ambulate, - activeColor: Colors.red[800], - onChanged: (value) { - setState(() { - _ambulate = value; - }); - }, + Expanded( + child: InkWell( + onTap: () { + setState(() { + _ambulate = Ambulate.Walker; + }); + }, + child: Container( + decoration: BoxDecoration( + shape: BoxShape.rectangle, + borderRadius: BorderRadius.circular(8), + border: + Border.all(color: Colors.grey, width: 0.5), + color: Colors.white, + ), + child: ListTile( + title: Text(TranslationBase.of(context).walker), + leading: Radio( + value: Ambulate.Walker, + groupValue: _ambulate, + + onChanged: (value) { + setState(() { + _ambulate = value; + }); + }, + ), ), ), ), ), - ), - ], - ), - SizedBox(height: 5,), - Row( - children: [ - Expanded( - child: InkWell( - onTap: () { - setState(() { - _ambulate = Ambulate.Stretcher; - }); - }, - child: Container( - decoration: BoxDecoration( - shape: BoxShape.rectangle, - borderRadius: BorderRadius.circular(8), - border: - Border.all(color: Colors.grey, width: 0.5), - color: Colors.white, - ), - child: ListTile( - title: Text(TranslationBase.of(context).stretcher), - leading: Radio( - value: Ambulate.Stretcher, - groupValue: _ambulate, - activeColor: Colors.red[800], - onChanged: (value) { - setState(() { - _ambulate = value; - }); - }, + ], + ), + SizedBox(height: 5,), + Row( + children: [ + Expanded( + child: InkWell( + onTap: () { + setState(() { + _ambulate = Ambulate.Stretcher; + }); + }, + child: Container( + decoration: BoxDecoration( + shape: BoxShape.rectangle, + borderRadius: BorderRadius.circular(8), + border: + Border.all(color: Colors.grey, width: 0.5), + color: Colors.white, + ), + child: ListTile( + title: Text(TranslationBase.of(context).stretcher), + leading: Radio( + value: Ambulate.Stretcher, + groupValue: _ambulate, + + onChanged: (value) { + setState(() { + _ambulate = value; + }); + }, + ), ), ), ), ), - ), - Expanded( - child: InkWell( - onTap: () { - setState(() { - _ambulate = Ambulate.None; - }); - }, - child: Container( - decoration: BoxDecoration( - shape: BoxShape.rectangle, - borderRadius: BorderRadius.circular(8), - border: - Border.all(color: Colors.grey, width: 0.5), - color: Colors.white, - ), - child: ListTile( - title: Text(TranslationBase.of(context).none), - leading: Radio( - value: Ambulate.None, - groupValue: _ambulate, - activeColor: Colors.red[800], - onChanged: (value) { - setState(() { - _ambulate = value; - }); - }, + Expanded( + child: InkWell( + onTap: () { + setState(() { + _ambulate = Ambulate.None; + }); + }, + child: Container( + decoration: BoxDecoration( + shape: BoxShape.rectangle, + borderRadius: BorderRadius.circular(8), + border: + Border.all(color: Colors.grey, width: 0.5), + color: Colors.white, + ), + child: ListTile( + title: Text(TranslationBase.of(context).none), + leading: Radio( + value: Ambulate.None, + groupValue: _ambulate, + + onChanged: (value) { + setState(() { + _ambulate = value; + }); + }, + ), ), ), ), ), - ), - ], - ), - SizedBox(height: 12,), - NewTextFields( - hintText: TranslationBase.of(context).notes, - initialValue: note, - onChanged: (value){ - setState(() { - note = value; - }); - }, - ), - - SizedBox( - height: 15, - ), - Container( - padding: EdgeInsets.all(15), - width: double.maxFinite, - height: 76, - child: SecondaryButton( - color: Colors.grey[800], - textColor: Colors.white, - onTap: () { + ], + ), + SizedBox(height: 12,), + NewTextFields( + hintText: TranslationBase.of(context).notes, + initialValue: note, + onChanged: (value){ setState(() { - widget.patientER.ambulate = _ambulate; - widget.patientER.requesterNote = note; - widget.patientER.selectedAmbulate = _ambulate.selectAmbulateNumber(); - widget.changeCurrentTab(3); + note = value; }); }, - label: TranslationBase.of(context).next, ), - ) - ], + + SizedBox( + height: 15, + ), + ], + ), + ), + ), + bottomSheet: Container( + padding: EdgeInsets.all(15), + width: double.maxFinite, + height: 90, + child: SecondaryButton( + color: Colors.grey[800], + textColor: Colors.white, + onTap: () { + setState(() { + widget.patientER.ambulate = _ambulate; + widget.patientER.requesterNote = note; + widget.patientER.selectedAmbulate = _ambulate.selectAmbulateNumber(); + widget.changeCurrentTab(3); + }); + }, + label: TranslationBase.of(context).next, ), ), ); diff --git a/lib/pages/ErService/AmbulanceRequestIndexPages/PickupLocation.dart b/lib/pages/ErService/AmbulanceRequestIndexPages/PickupLocation.dart index f6ebfde9..1ea0f7f5 100644 --- a/lib/pages/ErService/AmbulanceRequestIndexPages/PickupLocation.dart +++ b/lib/pages/ErService/AmbulanceRequestIndexPages/PickupLocation.dart @@ -5,23 +5,20 @@ import 'package:diplomaticquarterapp/core/viewModels/er/am_request_view_model.da import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; import 'package:diplomaticquarterapp/pages/Blood/dialogs/SelectHospitalDialog.dart'; import 'package:diplomaticquarterapp/pages/ErService/widgets/AppointmentCard.dart'; -import 'package:diplomaticquarterapp/pages/landing/home_page.dart'; import 'package:diplomaticquarterapp/uitl/ProgressDialog.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.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'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/pickupLocation/PickupLocationFromMap.dart'; -import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:geolocator/geolocator.dart'; import 'package:google_maps_place_picker/google_maps_place_picker.dart'; -import 'package:google_maps_flutter/google_maps_flutter.dart'; - -import '../AmbulanceReq.dart'; import '../AvailableAppointmentsPage.dart'; enum HaveAppointment { YES, NO } @@ -68,370 +65,397 @@ class _PickupLocationState extends State { @override Widget build(BuildContext context) { - return SingleChildScrollView( - physics: BouncingScrollPhysics(), - child: Container( - margin: EdgeInsets.only(left: 12, right: 12), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - if (widget.patientER.direction == 1) - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Texts(TranslationBase.of(context).pickupLocation), - SizedBox( - height: 15, - ), - InkWell( - onTap: (){ - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => PickupLocationFromMap( - latitude: _latitude, - longitude: _longitude, - onPick: (value) { + return AppScaffold( + isShowAppBar: false, + isShowDecPage: false, + body: SingleChildScrollView( + physics: BouncingScrollPhysics(), + child: Container( + margin: EdgeInsets.only(left: 12, right: 12), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + if (widget.patientER.direction == 1) + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts(TranslationBase.of(context).pickupLocation), + SizedBox( + height: 15, + ), + InkWell( + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => PickupLocationFromMap( + latitude: _latitude, + longitude: _longitude, + onPick: (value) { + setState(() { + _result = value; + }); + }, + ), + ), + ); + }, + child: Container( + padding: EdgeInsets.all(12), + decoration: BoxDecoration( + shape: BoxShape.rectangle, + borderRadius: BorderRadius.circular(8), + border: Border.all(color: Colors.grey, width: 0.5), + color: Colors.white, + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Expanded(child: Texts(getSelectFromMapName(context))), + Icon( + FontAwesomeIcons.mapMarkerAlt, + size: 24, + color: Colors.black, + ) + ], + ), + ), + ), + SizedBox( + height: 12, + ), + Texts(TranslationBase.of(context).pickupSpot), + SizedBox( + height: 5, + ), + InkWell( + onTap: () { + setState(() { + _isInsideHome = !_isInsideHome; + }); + }, + child: Container( + decoration: BoxDecoration( + shape: BoxShape.rectangle, + borderRadius: BorderRadius.circular(8), + border: Border.all(color: Colors.grey, width: 0.5), + color: Colors.white, + ), + child: ListTile( + title: Texts(TranslationBase.of(context).insideHome), + leading: Checkbox( + value: _isInsideHome, + onChanged: (value) { setState(() { - _result = value; + _isInsideHome = value; }); }, ), ), - ); - }, - child: Container( - padding: EdgeInsets.all(12), - decoration: BoxDecoration( - shape: BoxShape.rectangle, - borderRadius: BorderRadius.circular(8), - border: Border.all(color: Colors.grey, width: 0.5), - color: Colors.white, - ), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Texts(getSelectFromMapName(context)), - Icon( - FontAwesomeIcons.mapMarkerAlt, - size: 24, - color: Colors.black, - ) - ], ), ), - ), - SizedBox( - height: 12, - ), - Texts(TranslationBase.of(context).pickupSpot), - SizedBox( - height: 5, - ), - InkWell( - onTap: () { - setState(() { - _isInsideHome = !_isInsideHome; - }); - }, - child: Container( - decoration: BoxDecoration( - shape: BoxShape.rectangle, - borderRadius: BorderRadius.circular(8), - border: Border.all(color: Colors.grey, width: 0.5), - color: Colors.white, - ), - child: ListTile( - title: Texts(TranslationBase.of(context).insideHome), - leading: Checkbox( - activeColor: Colors.red[800], - value: _isInsideHome, - onChanged: (value) { - setState(() { - _isInsideHome = value; - }); - }, - ), - ), + SizedBox( + height: 12, + ), + Texts(TranslationBase.of(context).haveAppo), + SizedBox( + height: 5, ), - ), - SizedBox( - height: 12, - ), - Texts(TranslationBase.of(context).haveAppo), - SizedBox( - height: 5, - ), - Row( - children: [ - Expanded( - child: InkWell( - onTap: () { - if (myAppointment == null) { - getAppointment(); + Row( + children: [ + Expanded( + child: InkWell( + onTap: () { + if (myAppointment == null) { + getAppointment(); + setState(() { + _haveAppointment = HaveAppointment.YES; + }); + } + }, + child: Container( + decoration: BoxDecoration( + shape: BoxShape.rectangle, + borderRadius: BorderRadius.circular(8), + border: + Border.all(color: Colors.grey, width: 0.5), + color: Colors.white, + ), + child: ListTile( + title: Texts(TranslationBase.of(context).yes), + leading: Radio( + value: HaveAppointment.YES, + groupValue: _haveAppointment, + onChanged: (value) { + if (myAppointment == null) { + getAppointment(); + setState(() { + _haveAppointment = value; + }); + } + }, + ), + ), + ), + ), + ), + Expanded( + child: InkWell( + onTap: () { setState(() { - _haveAppointment = HaveAppointment.YES; + _haveAppointment = HaveAppointment.NO; + myAppointment = null; }); - } - }, - child: Container( - decoration: BoxDecoration( - shape: BoxShape.rectangle, - borderRadius: BorderRadius.circular(8), - border: - Border.all(color: Colors.grey, width: 0.5), - color: Colors.white, - ), - child: ListTile( - title: Texts(TranslationBase.of(context).yes), - leading: Radio( - value: HaveAppointment.YES, - groupValue: _haveAppointment, - activeColor: Colors.red[800], - onChanged: (value) { - if (myAppointment == null) { - getAppointment(); + }, + child: Container( + decoration: BoxDecoration( + shape: BoxShape.rectangle, + borderRadius: BorderRadius.circular(8), + border: + Border.all(color: Colors.grey, width: 0.5), + color: Colors.white, + ), + child: ListTile( + title: Texts(TranslationBase.of(context).no), + leading: Radio( + value: HaveAppointment.NO, + groupValue: _haveAppointment, + onChanged: (value) { setState(() { _haveAppointment = value; + myAppointment = null; }); - } - }, + }, + ), ), ), ), ), - ), - Expanded( - child: InkWell( - onTap: () { - setState(() { - _haveAppointment = HaveAppointment.NO; - myAppointment = null; - }); - }, - child: Container( - decoration: BoxDecoration( - shape: BoxShape.rectangle, - borderRadius: BorderRadius.circular(8), - border: - Border.all(color: Colors.grey, width: 0.5), - color: Colors.white, - ), - child: ListTile( - title: Texts(TranslationBase.of(context).no), - leading: Radio( - value: HaveAppointment.NO, - groupValue: _haveAppointment, - activeColor: Colors.red[800], - onChanged: (value) { - setState(() { - _haveAppointment = value; - myAppointment = null; - }); - }, - ), - ), - ), - ), - ), - ], - ), - if (myAppointment != null) - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 12, - ), - AppointmentCard( - appointment: myAppointment, - ) ], ), - SizedBox( - height: 12, - ), - Texts(TranslationBase.of(context).dropoffLocation), - SizedBox( - height: 8, - ), - InkWell( - onTap: () { - confirmSelectHospitalDialog( - widget.amRequestViewModel.hospitals); - }, - child: Container( - padding: EdgeInsets.all(12), - decoration: BoxDecoration( - shape: BoxShape.rectangle, - borderRadius: BorderRadius.circular(8), - border: Border.all(color: Colors.grey, width: 0.5), - color: Colors.white, - ), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, + if (myAppointment != null) + Column( + crossAxisAlignment: CrossAxisAlignment.start, children: [ - Texts(getHospitalName(TranslationBase.of(context).pickupLocation)), - Icon( - Icons.arrow_drop_down, - size: 24, - color: Colors.black, + SizedBox( + height: 12, + ), + AppointmentCard( + appointment: myAppointment, ) ], ), + SizedBox( + height: 12, ), - ), - ], - ), - if (widget.patientER.direction == 0) - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Texts(TranslationBase.of(context).pickupLocation), - SizedBox( - height: 15, - ), - InkWell( - onTap: () { - confirmSelectHospitalDialog( - widget.amRequestViewModel.hospitals); - }, - child: Container( - padding: EdgeInsets.all(12), - decoration: BoxDecoration( - shape: BoxShape.rectangle, - borderRadius: BorderRadius.circular(8), - border: Border.all(color: Colors.grey, width: 0.5), - color: Colors.white, + Texts(TranslationBase.of(context).dropoffLocation), + SizedBox( + height: 8, + ), + InkWell( + onTap: () { + confirmSelectHospitalDialog( + widget.amRequestViewModel.hospitals); + }, + child: Container( + padding: EdgeInsets.all(12), + decoration: BoxDecoration( + shape: BoxShape.rectangle, + borderRadius: BorderRadius.circular(8), + border: Border.all(color: Colors.grey, width: 0.5), + color: Colors.white, + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Texts(getHospitalName( + TranslationBase.of(context).pickupLocation)), + Icon( + Icons.arrow_drop_down, + size: 24, + color: Colors.black, + ) + ], + ), ), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Texts(getHospitalName(TranslationBase.of(context).pickupLocation)), - Icon( - Icons.arrow_drop_down, - size: 24, - color: Colors.black, - ) - ], + ), + ], + ), + if (widget.patientER.direction == 0) + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts(TranslationBase.of(context).pickupLocation), + SizedBox( + height: 15, + ), + InkWell( + onTap: () { + confirmSelectHospitalDialog( + widget.amRequestViewModel.hospitals); + }, + child: Container( + padding: EdgeInsets.all(12), + decoration: BoxDecoration( + shape: BoxShape.rectangle, + borderRadius: BorderRadius.circular(8), + border: Border.all(color: Colors.grey, width: 0.5), + color: Colors.white, + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Texts(getHospitalName( + TranslationBase.of(context).pickupLocation)), + Icon( + Icons.arrow_drop_down, + size: 24, + color: Colors.black, + ) + ], + ), ), ), - ), - SizedBox( - height: 12, - ), - Texts(TranslationBase.of(context).dropoffLocation), - SizedBox( - height: 8, - ), - InkWell( - onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => PickupLocationFromMap( - latitude: _latitude, - longitude: _longitude, - onPick: (value) { - setState(() { - _result = value; - }); - }, + SizedBox( + height: 12, + ), + Texts(TranslationBase.of(context).dropoffLocation), + SizedBox( + height: 8, + ), + InkWell( + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => PickupLocationFromMap( + latitude: _latitude, + longitude: _longitude, + onPick: (value) { + setState(() { + _result = value; + }); + }, + ), ), + ); + }, + child: Container( + padding: EdgeInsets.all(12), + decoration: BoxDecoration( + shape: BoxShape.rectangle, + borderRadius: BorderRadius.circular(8), + border: Border.all(color: Colors.grey, width: 0.5), + color: Colors.white, + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Expanded(child: Texts(getSelectFromMapName(context))), + Icon( + FontAwesomeIcons.mapMarkerAlt, + size: 24, + color: Colors.black, + ) + ], ), - ); - }, - child: Container( - padding: EdgeInsets.all(12), - decoration: BoxDecoration( - shape: BoxShape.rectangle, - borderRadius: BorderRadius.circular(8), - border: Border.all(color: Colors.grey, width: 0.5), - color: Colors.white, - ), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Texts(getSelectFromMapName(context)), - Icon( - FontAwesomeIcons.mapMarkerAlt, - size: 24, - color: Colors.black, - ) - ], ), ), - ), - ], + ], + ), + SizedBox( + height: 45, ), - SizedBox( - height: 45, - ), - Container( - padding: EdgeInsets.all(15), - width: double.maxFinite, - height: 76, - child: SecondaryButton( - color: Colors.grey[800], - textColor: Colors.white, - onTap: () { - if (_result == null || _selectedHospital == null) - AppToast.showErrorToast( - message: TranslationBase.of(context).selectAll); - else - setState(() { - widget.patientER.pickupSpot = _isInsideHome ? 1 : 0; - if (widget.patientER.direction == 0) { - widget.patientER.pickupLocationLattitude = _result.geometry.location.lat.toString(); - widget.patientER.pickupLocationLongitude = _result.geometry.location.lng.toString(); - widget.patientER.dropoffLocationLattitude = _selectedHospital.latitude; - widget.patientER.dropoffLocationLongitude = _selectedHospital.longitude; - } else { - widget.patientER.pickupLocationLattitude = _selectedHospital.latitude; - widget.patientER.pickupLocationLongitude = _selectedHospital.longitude; - widget.patientER.dropoffLocationLattitude = _result.geometry.location.lat.toString(); - widget.patientER.dropoffLocationLongitude = _result.geometry.location.lng.toString(); - } + ], + ), + ), + ), + bottomSheet: Container( + padding: EdgeInsets.all(15), + width: double.maxFinite, + height: 90, + child: SecondaryButton( + color: Colors.grey[800], + textColor: Colors.white, + onTap: () { + if (_result == null || _selectedHospital == null) + AppToast.showErrorToast( + message: TranslationBase.of(context).selectAll); + else + setState(() { + widget.patientER.pickupSpot = _isInsideHome ? 1 : 0; + if (widget.patientER.direction == 0) { + widget.patientER.pickupLocationLattitude = + _result.geometry.location.lat.toString(); + widget.patientER.pickupLocationLongitude = + _result.geometry.location.lng.toString(); + widget.patientER.dropoffLocationLattitude = + _selectedHospital.latitude; + widget.patientER.dropoffLocationLongitude = + _selectedHospital.longitude; + } else { + widget.patientER.pickupLocationLattitude = + _selectedHospital.latitude; + widget.patientER.pickupLocationLongitude = + _selectedHospital.longitude; + widget.patientER.dropoffLocationLattitude = + _result.geometry.location.lat.toString(); + widget.patientER.dropoffLocationLongitude = + _result.geometry.location.lng.toString(); + } - widget.patientER.latitude = widget.patientER.pickupLocationLattitude; - widget.patientER.longitude = widget.patientER.pickupLocationLongitude; - widget.patientER.dropoffLocationName = _selectedHospital.name; - widget.patientER.createdBy = widget.amRequestViewModel.user.patientID; - widget.patientER.isOutPatient = widget.amRequestViewModel.user.outSA; - widget.patientER.patientIdentificationID = widget.amRequestViewModel.user.patientIdentificationNo; - widget.patientER.pickupDateTime = DateUtil.convertDateToStringLocation(DateTime.now()); - widget.patientER.pickupLocationName = _result.formattedAddress; - widget.patientER.projectID = widget.amRequestViewModel.user.projectID; - widget.patientER.requesterFileNo = widget.amRequestViewModel.user.patientID; - widget.patientER.requesterIsOutSA = false; - widget.patientER.lineItemNo =0; - widget.patientER.requesterMobileNo = widget.amRequestViewModel.user.mobileNumber; + widget.patientER.latitude = + widget.patientER.pickupLocationLattitude; + widget.patientER.longitude = + widget.patientER.pickupLocationLongitude; + widget.patientER.dropoffLocationName = + _selectedHospital.name; + widget.patientER.createdBy = + widget.amRequestViewModel.user.patientID; + widget.patientER.isOutPatient = + widget.amRequestViewModel.user.outSA; + widget.patientER.patientIdentificationID = widget + .amRequestViewModel.user.patientIdentificationNo; + widget.patientER.pickupDateTime = + DateUtil.convertDateToStringLocation(DateTime.now()); + widget.patientER.pickupLocationName = + _result.formattedAddress; + widget.patientER.projectID = + widget.amRequestViewModel.user.projectID; + widget.patientER.requesterFileNo = + widget.amRequestViewModel.user.patientID; + widget.patientER.requesterIsOutSA = false; + widget.patientER.lineItemNo = 0; + widget.patientER.requesterMobileNo = + widget.amRequestViewModel.user.mobileNumber; - if (_haveAppointment == HaveAppointment.YES) { - widget.patientER.appointmentNo = myAppointment.appointmentNo.toString(); - widget.patientER.appointmentClinicName = myAppointment.clinicName; - widget.patientER.appointmentDoctorName = myAppointment.doctorNameObj; - widget.patientER.appointmentBranch = myAppointment.projectName; - widget.patientER.appointmentTime = myAppointment.appointmentDate; - widget.patientER.haveAppointment = true; - } else { - widget.patientER.appointmentNo = "0"; - widget.patientER.appointmentClinicName = null; - widget.patientER.appointmentDoctorName = null; - widget.patientER.appointmentBranch = null; - widget.patientER.appointmentTime = null; - widget.patientER.haveAppointment = false; - } + if (_haveAppointment == HaveAppointment.YES) { + widget.patientER.appointmentNo = + myAppointment.appointmentNo.toString(); + widget.patientER.appointmentClinicName = + myAppointment.clinicName; + widget.patientER.appointmentDoctorName = + myAppointment.doctorNameObj; + widget.patientER.appointmentBranch = + myAppointment.projectName; + widget.patientER.appointmentTime = + myAppointment.appointmentDate; + widget.patientER.haveAppointment = true; + } else { + widget.patientER.appointmentNo = "0"; + widget.patientER.appointmentClinicName = null; + widget.patientER.appointmentDoctorName = null; + widget.patientER.appointmentBranch = null; + widget.patientER.appointmentTime = null; + widget.patientER.haveAppointment = false; + } - widget.patientER.pickupSpot = _isInsideHome ? 1 : 0; - widget.changeCurrentTab(2); - }); - }, - label: TranslationBase.of(context).next, - ), - ) - ], + widget.patientER.pickupSpot = _isInsideHome ? 1 : 0; + widget.changeCurrentTab(2); + }); + }, + label: TranslationBase.of(context).next, ), ), ); @@ -457,11 +481,13 @@ class _PickupLocationState extends State { } String getSelectFromMapName(context) { - return _result != null ? _result.formattedAddress : TranslationBase.of(context).selectMap; + return _result != null + ? _result.formattedAddress + : TranslationBase.of(context).selectMap; } getAppointment() { - ProgressDialogUtil.showProgressDialog(context); + GifLoaderDialogUtils.showMyDialog(context); widget.amRequestViewModel.getAppointmentHistory().then((value) { if (widget.amRequestViewModel.state == ViewState.Error || widget.amRequestViewModel.state == ViewState.ErrorLocal) { @@ -469,7 +495,7 @@ class _PickupLocationState extends State { } else if (widget .amRequestViewModel.appoitmentAllHistoryResultList.length > 0) { - ProgressDialogUtil.hideProgressDialog(context); + GifLoaderDialogUtils.hideDialog(context); Navigator.push( context, MaterialPageRoute( @@ -491,14 +517,15 @@ class _PickupLocationState extends State { } }); } else { - ProgressDialogUtil.hideProgressDialog(context); + GifLoaderDialogUtils.hideDialog(context); setState(() { _haveAppointment = HaveAppointment.NO; }); - AppToast.showErrorToast(message: TranslationBase.of(context).noAppointment); + AppToast.showErrorToast( + message: TranslationBase.of(context).noAppointment); } }).catchError((e) { - ProgressDialogUtil.hideProgressDialog(context); + GifLoaderDialogUtils.hideDialog(context); AppToast.showErrorToast(message: e); }); } diff --git a/lib/pages/ErService/AmbulanceRequestIndexPages/SelectTransportationMethod.dart b/lib/pages/ErService/AmbulanceRequestIndexPages/SelectTransportationMethod.dart index 69669ed3..0770448e 100644 --- a/lib/pages/ErService/AmbulanceRequestIndexPages/SelectTransportationMethod.dart +++ b/lib/pages/ErService/AmbulanceRequestIndexPages/SelectTransportationMethod.dart @@ -1,15 +1,15 @@ import 'package:diplomaticquarterapp/core/enum/OrderService.dart'; -import 'package:diplomaticquarterapp/core/enum/OrderService.dart'; -import 'package:diplomaticquarterapp/core/enum/OrderService.dart'; -import 'package:diplomaticquarterapp/core/enum/OrderService.dart'; import 'package:diplomaticquarterapp/core/model/er/PatientER.dart'; import 'package:diplomaticquarterapp/core/model/er/get_all_transportation_method_list_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/er/am_request_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; enum Direction { ToHospital, FromHospital } enum Way { OneWay, TwoWays } @@ -58,251 +58,267 @@ class _SelectTransportationMethodState @override Widget build(BuildContext context) { - return SingleChildScrollView( - physics: BouncingScrollPhysics(), - child: Container( - margin: EdgeInsets.only(left: 12, right: 12), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 12, - ), - Texts(TranslationBase.of(context).transportHeading), - ...List.generate( - widget.amRequestViewModel.amRequestModeList.length, - (index) => InkWell( - onTap: () { - setState(() { - _erTransportationMethod = - widget.amRequestViewModel.amRequestModeList[index]; - }); - }, - child: Container( - margin: EdgeInsets.all(5), - decoration: BoxDecoration( - shape: BoxShape.rectangle, - borderRadius: BorderRadius.circular(8), - border: Border.all(color: Colors.grey, width: 0.5), - color: Colors.white, - ), - child: Row( - children: [ - Expanded( - flex: 3, - child: ListTile( - title: Text(widget.amRequestViewModel - .amRequestModeList[index].title), - leading: Radio( - value: widget - .amRequestViewModel.amRequestModeList[index], - groupValue: _erTransportationMethod, - activeColor: Colors.red[800], - onChanged: (value) { - setState(() { - _erTransportationMethod = value; - }); - }, + ProjectViewModel projectViewModel = Provider.of(context); + return AppScaffold( + isShowAppBar: false, + isShowDecPage: false, + body: SingleChildScrollView( + physics: BouncingScrollPhysics(), + child: Container( + margin: EdgeInsets.only(left: 12, right: 12), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 12, + ), + Texts(TranslationBase.of(context).transportHeading), + ...List.generate( + widget.amRequestViewModel.amRequestModeList.length, + (index) => InkWell( + onTap: () { + setState(() { + _erTransportationMethod = + widget.amRequestViewModel.amRequestModeList[index]; + }); + }, + child: Container( + margin: EdgeInsets.all(5), + decoration: BoxDecoration( + shape: BoxShape.rectangle, + borderRadius: BorderRadius.circular(8), + border: Border.all(color: Colors.grey, width: 0.5), + color: Colors.white, + ), + child: Row( + children: [ + Expanded( + flex: 3, + child: ListTile( + title: Texts(projectViewModel.isArabic + ? widget.amRequestViewModel + .amRequestModeList[index].titleAR + : widget.amRequestViewModel + .amRequestModeList[index].title), + leading: Radio( + value: widget + .amRequestViewModel.amRequestModeList[index], + groupValue: _erTransportationMethod, + onChanged: (value) { + setState(() { + _erTransportationMethod = value; + }); + }, + ), ), ), - ), - Expanded( - flex: 1, - child: Texts( - TranslationBase.of(context).sar+' ${widget.amRequestViewModel.amRequestModeList[index].price}'), - ) - ], + Expanded( + flex: 1, + child: Texts(TranslationBase.of(context).sar + + ' ${widget.amRequestViewModel.amRequestModeList[index].price}'), + ) + ], + ), ), ), ), - ), - SizedBox( - height: 12, - ), - Texts(TranslationBase.of(context).directionHeading), - SizedBox( - height: 5, - ), - Container( - width: double.maxFinite, - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Expanded( - child: InkWell( - onTap: () { - setState(() { - _direction = Direction.ToHospital; - }); - }, - child: Container( - width: double.maxFinite, - decoration: BoxDecoration( - shape: BoxShape.rectangle, - borderRadius: BorderRadius.circular(8), - border: Border.all(color: Colors.grey, width: 0.5), - color: Colors.white, - ), - child: ListTile( - title: Text(TranslationBase.of(context).toHospital), - leading: Radio( - value: Direction.ToHospital, - groupValue: _direction, - activeColor: Colors.red[800], - onChanged: (value) { - setState(() { - _direction = value; - }); - }, + SizedBox( + height: 12, + ), + Texts(TranslationBase.of(context).directionHeading), + SizedBox( + height: 5, + ), + Container( + width: double.maxFinite, + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Expanded( + child: InkWell( + onTap: () { + setState(() { + _direction = Direction.ToHospital; + }); + }, + child: Container( + width: double.maxFinite, + decoration: BoxDecoration( + shape: BoxShape.rectangle, + borderRadius: BorderRadius.circular(8), + border: Border.all(color: Colors.grey, width: 0.5), + color: Colors.white, + ), + child: ListTile( + title: Texts(TranslationBase.of(context).toHospital), + leading: Radio( + value: Direction.ToHospital, + groupValue: _direction, + onChanged: (value) { + setState(() { + _direction = value; + }); + }, + ), ), ), ), ), - ), - Expanded( - child: InkWell( - onTap: () { - setState(() { - _direction = Direction.FromHospital; - }); - }, - child: Container( - width: double.maxFinite, - decoration: BoxDecoration( - shape: BoxShape.rectangle, - borderRadius: BorderRadius.circular(8), - border: Border.all(color: Colors.grey, width: 0.5), - color: Colors.white, - ), - child: ListTile( - title: Text(TranslationBase.of(context).fromHospital), - leading: Radio( - value: Direction.FromHospital, - groupValue: _direction, - activeColor: Colors.red[800], - onChanged: (value) { - setState(() { - _direction = value; - }); - }, + Expanded( + child: InkWell( + onTap: () { + setState(() { + _direction = Direction.FromHospital; + }); + }, + child: Container( + width: double.maxFinite, + decoration: BoxDecoration( + shape: BoxShape.rectangle, + borderRadius: BorderRadius.circular(8), + border: Border.all(color: Colors.grey, width: 0.5), + color: Colors.white, + ), + child: ListTile( + title: + Texts(TranslationBase.of(context).fromHospital), + leading: Radio( + value: Direction.FromHospital, + groupValue: _direction, + onChanged: (value) { + setState(() { + _direction = value; + }); + }, + ), ), ), ), ), - ), - ], + ], + ), ), - ), - if (_direction == Direction.ToHospital) - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 8, - ), - Texts(TranslationBase.of(context).directionHeading), - SizedBox( - height: 5, - ), - Row( - children: [ - Expanded( - child: InkWell( - onTap: () { - setState(() { - _way = Way.OneWay; - }); - }, - child: Container( - decoration: BoxDecoration( - shape: BoxShape.rectangle, - borderRadius: BorderRadius.circular(8), - border: - Border.all(color: Colors.grey, width: 0.5), - color: Colors.white, - ), - child: ListTile( - title: Text(TranslationBase.of(context).oneDirec), - leading: Radio( - value: Way.OneWay, - groupValue: _way, - activeColor: Colors.red[800], - onChanged: (value) { - setState(() { - _way = value; - }); - }, + if (_direction == Direction.ToHospital) + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 8, + ), + Texts(TranslationBase.of(context).directionHeading), + SizedBox( + height: 5, + ), + Row( + children: [ + Expanded( + child: InkWell( + onTap: () { + setState(() { + _way = Way.OneWay; + }); + }, + child: Container( + decoration: BoxDecoration( + shape: BoxShape.rectangle, + borderRadius: BorderRadius.circular(8), + border: + Border.all(color: Colors.grey, width: 0.5), + color: Colors.white, + ), + child: ListTile( + title: + Texts(TranslationBase.of(context).oneDirec), + leading: Radio( + value: Way.OneWay, + groupValue: _way, + onChanged: (value) { + setState(() { + _way = value; + }); + }, + ), ), ), ), ), - ), - Expanded( - child: InkWell( - onTap: () { - setState(() { - _way = Way.TwoWays; - }); - }, - child: Container( - decoration: BoxDecoration( - shape: BoxShape.rectangle, - borderRadius: BorderRadius.circular(8), - border: - Border.all(color: Colors.grey, width: 0.5), - color: Colors.white, - ), - child: ListTile( - title: Text(TranslationBase.of(context).twoDirec), - leading: Radio( - value: Way.TwoWays, - groupValue: _way, - activeColor: Colors.red[800], - onChanged: (value) { - setState(() { - _way = value; - }); - }, + Expanded( + child: InkWell( + onTap: () { + setState(() { + _way = Way.TwoWays; + }); + }, + child: Container( + decoration: BoxDecoration( + shape: BoxShape.rectangle, + borderRadius: BorderRadius.circular(8), + border: + Border.all(color: Colors.grey, width: 0.5), + color: Colors.white, + ), + child: ListTile( + title: + Texts(TranslationBase.of(context).twoDirec), + leading: Radio( + value: Way.TwoWays, + groupValue: _way, + onChanged: (value) { + setState(() { + _way = value; + }); + }, + ), ), ), ), ), - ), - ], - ), - ], - ), - SizedBox( - height: 15, - ), - Container( - padding: EdgeInsets.all(15), - width: double.maxFinite, - height: 76, - child: SecondaryButton( - color: Colors.grey[800], - textColor: Colors.white, - onTap: () { - setState(() { - widget.patientER.transportationMethodId =(widget.amRequestViewModel.amRequestModeList.indexOf(_erTransportationMethod) + 1); - widget.patientER.direction = _direction == Direction.ToHospital ? 1 : 0; - widget.patientER.tripType = _way == Way.TwoWays ? 0 : 1; - widget.patientER.selectedAmbulate = (widget.amRequestViewModel.amRequestModeList.indexOf(_erTransportationMethod) + 1); - widget.patientER.patientERTransportationMethod = _erTransportationMethod; - widget.patientER.orderServiceID = _orderService.getIdOrderService(); - widget.patientER.pickupUrgency = 1; - widget.patientER.lineItemNo = 1; - widget.patientER.cost = _erTransportationMethod.price; - widget.patientER.vAT = _erTransportationMethod.vAT ?? 0; - widget.patientER.totalPrice = _erTransportationMethod.totalPrice; - widget.changeCurrentTab(1); - }); - }, - label: TranslationBase.of(context).next, + ], + ), + ], + ), + SizedBox( + height: 15, ), - ) - ], + ], + ), + ), + ), + bottomSheet: Container( + padding: EdgeInsets.all(15), + width: double.maxFinite, + height: 90, + child: SecondaryButton( + color: Colors.grey[800], + textColor: Colors.white, + onTap: () { + setState(() { + widget.patientER.transportationMethodId = (widget + .amRequestViewModel.amRequestModeList + .indexOf(_erTransportationMethod) + + 1); + widget.patientER.direction = + _direction == Direction.ToHospital ? 1 : 0; + widget.patientER.tripType = _way == Way.TwoWays ? 0 : 1; + widget.patientER.selectedAmbulate = (widget + .amRequestViewModel.amRequestModeList + .indexOf(_erTransportationMethod) + + 1); + widget.patientER.patientERTransportationMethod = + _erTransportationMethod; + widget.patientER.orderServiceID = + _orderService.getIdOrderService(); + widget.patientER.pickupUrgency = 1; + widget.patientER.lineItemNo = 1; + widget.patientER.cost = _erTransportationMethod.price; + widget.patientER.vAT = _erTransportationMethod.vAT ?? 0; + widget.patientER.totalPrice = + _erTransportationMethod.totalPrice; + widget.changeCurrentTab(1); + }); + }, + label: TranslationBase.of(context).next, ), ), ); diff --git a/lib/pages/ErService/AmbulanceRequestIndexPages/Summary.dart b/lib/pages/ErService/AmbulanceRequestIndexPages/Summary.dart index 8fd72b8f..6140dc62 100644 --- a/lib/pages/ErService/AmbulanceRequestIndexPages/Summary.dart +++ b/lib/pages/ErService/AmbulanceRequestIndexPages/Summary.dart @@ -3,6 +3,7 @@ import 'package:diplomaticquarterapp/core/viewModels/er/am_request_view_model.da import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:diplomaticquarterapp/core/enum/Ambulate.dart'; @@ -18,89 +19,93 @@ class Summary extends StatefulWidget { _SummaryState createState() => _SummaryState(); } -//TODO it should be dynamic class _SummaryState extends State { @override Widget build(BuildContext context) { - return SingleChildScrollView( - child: Container( - margin: EdgeInsets.only(left: 12, right: 12), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Texts(TranslationBase.of(context).RRTSummary), - SizedBox(height: 5,), - Container( - width: double.infinity, - padding: EdgeInsets.all(10), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.circular(12), - ), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Texts(TranslationBase.of(context).transportMethod,color: Colors.grey,), - Texts('${widget.patientER.patientERTransportationMethod.title}',bold: true,), - SizedBox(height: 8,), + return AppScaffold( + isShowDecPage: false, + isShowAppBar: false, + body: SingleChildScrollView( + child: Container( + margin: EdgeInsets.only(left: 12, right: 12), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts(TranslationBase.of(context).RRTSummary), + SizedBox(height: 5,), + Container( + width: double.infinity, + padding: EdgeInsets.all(10), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(12), + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts(TranslationBase.of(context).transportMethod,color: Colors.grey,), + Texts('${widget.patientER.patientERTransportationMethod.title}',bold: true,), + SizedBox(height: 8,), - Texts(TranslationBase.of(context).directions,color: Colors.grey,), - Texts('From Hospital',bold: true,), - SizedBox(height: 8,), + Texts(TranslationBase.of(context).directions,color: Colors.grey,), + Texts(widget.patientER.direction ==0? TranslationBase.of(context).toHospital:TranslationBase.of(context).fromHospital,bold: true,), + SizedBox(height: 8,), - Texts('Pickup Location',color: Colors.grey,), - Texts('SZR Medical Center',bold: true,), - SizedBox(height: 8,), + Texts(TranslationBase.of(context).pickupLocation,color: Colors.grey,), + Texts('${widget.patientER.pickupLocationName}',bold: true,), + SizedBox(height: 8,), - Texts('Drop off location',color: Colors.grey,), - Texts('6199, Al Ameen wlfn nif',bold: true,), - SizedBox(height: 8,), + Texts(TranslationBase.of(context).dropoffLocation,color: Colors.grey,), + Texts('${widget.patientER.dropoffLocationName}',bold: true,), + SizedBox(height: 8,), - Texts('Select Ambulate',color: Colors.grey,), - Texts('${widget.patientER.ambulate.getAmbulateTitle(context)}',bold: true,), - SizedBox(height: 8,), + Texts(TranslationBase.of(context).selectAmbulate,color: Colors.grey,), + Texts('${widget.patientER.ambulate.getAmbulateTitle(context)}',bold: true,), + SizedBox(height: 8,), - Texts('Note',color: Colors.grey,), - Texts('${widget.patientER.requesterNote?? '---'}',bold: true,), - SizedBox(height: 8,), - ], - ), - ), - SizedBox(height: 20,), - Texts('Bill Amount',textAlign: TextAlign.start,), - SizedBox(height: 5,), - Container( - height: 55, - padding: EdgeInsets.all(10), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.circular(8) + Texts(TranslationBase.of(context).notes,color: Colors.grey,), + Texts('${widget.patientER.requesterNote?? '---'}',bold: true,), + SizedBox(height: 8,), + ], + ), ), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Texts('Total amount payable:'), - Texts('SR ${widget.patientER.patientERTransportationMethod.totalPrice}') - ], + SizedBox(height: 20,), + Texts(TranslationBase.of(context).billAmount,textAlign: TextAlign.start,), + SizedBox(height: 5,), + Container( + height: 55, + padding: EdgeInsets.all(10), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(8) + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Texts(TranslationBase.of(context).patientShareTotal+':'), + Texts(TranslationBase.of(context).sar+' ${widget.patientER.patientERTransportationMethod.totalPrice}') + ], + ), ), - ), - SizedBox(height: 45,), - Container( - padding: EdgeInsets.all(15), - width: double.maxFinite, - height: 76, - child:SecondaryButton( - color: Colors.grey[800], - textColor: Colors.white, - label: TranslationBase.of(context).send, - onTap: () async { - await widget.amRequestViewModel.insertERPressOrder(patientER: widget.patientER); + SizedBox(height: 45,), - } - ), - ) - ], + ], + ), + ), + ), + bottomSheet: Container( + padding: EdgeInsets.all(15), + width: double.maxFinite, + height: 90, + child:SecondaryButton( + color: Colors.grey[800], + textColor: Colors.white, + label: TranslationBase.of(context).send, + onTap: () async { + await widget.amRequestViewModel.insertERPressOrder(patientER: widget.patientER); + + } ), ), ); diff --git a/lib/pages/ErService/OrderLogPage.dart b/lib/pages/ErService/OrderLogPage.dart index 6929cd0b..7d2a4a5b 100644 --- a/lib/pages/ErService/OrderLogPage.dart +++ b/lib/pages/ErService/OrderLogPage.dart @@ -30,28 +30,28 @@ class OrderLogPage extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ OrderLogItem( - title: 'Request ID', + title: TranslationBase.of(context).reqId, value: amRequestViewModel.patientAllPresOrdersList[index].iD .toString(), ), OrderLogItem( - title: 'Status', + title: TranslationBase.of(context).orderStatus, value: amRequestViewModel .patientAllPresOrdersList[index].description, ), OrderLogItem( - title: 'Pickup Date', + title: TranslationBase.of(context).pickupDate, value: DateUtil.getDayMonthYearDateFormatted( DateUtil.convertStringToDate(amRequestViewModel .patientAllPresOrdersList[index].createdOn)), ), OrderLogItem( - title: 'Pickup Location', + title: TranslationBase.of(context).pickupLocation, value: amRequestViewModel .patientAllPresOrdersList[index].pickupLocationName, ), OrderLogItem( - title: 'Drop off Location', + title: TranslationBase.of(context).dropoffLocation, value: amRequestViewModel .patientAllPresOrdersList[index].dropoffLocationName, ), diff --git a/lib/pages/ErService/widgets/StepsWidget.dart b/lib/pages/ErService/widgets/StepsWidget.dart index c5864710..56b3de6b 100644 --- a/lib/pages/ErService/widgets/StepsWidget.dart +++ b/lib/pages/ErService/widgets/StepsWidget.dart @@ -13,7 +13,8 @@ class StepsWidget extends StatelessWidget { @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); - return projectViewModel.isArabic? Stack( + return projectViewModel.isArabic? + Stack( children: [ Container( height: 50, @@ -29,7 +30,7 @@ class StepsWidget extends StatelessWidget { ), Positioned( top: 10, - left: 0, + right: 0, child: InkWell( onTap: () => changeCurrentTab(0), child: Container( @@ -51,7 +52,7 @@ class StepsWidget extends StatelessWidget { ), Positioned( top: 10, - left: MediaQuery.of(context).size.width * 0.3, + right: MediaQuery.of(context).size.width * 0.3, child: InkWell( onTap: () => index >= 2 ? changeCurrentTab(1) : null, child: Container( @@ -73,7 +74,7 @@ class StepsWidget extends StatelessWidget { ), Positioned( top: 10, - left: MediaQuery.of(context).size.width * 0.6, + right: MediaQuery.of(context).size.width * 0.6, child: InkWell( onTap: () => index >= 3 ? changeCurrentTab(2) : null, child: Container( @@ -95,7 +96,7 @@ class StepsWidget extends StatelessWidget { ), Positioned( top: 10, - right: 0, + left: 0, child: InkWell( onTap: () => index == 2 ?changeCurrentTab(3):null, child: Container( @@ -117,7 +118,8 @@ class StepsWidget extends StatelessWidget { ), ), ], - ):Stack( + ): + Stack( children: [ Container( height: 50, @@ -133,7 +135,7 @@ class StepsWidget extends StatelessWidget { ), Positioned( top: 10, - right: 0, + left: 0, child: InkWell( onTap: () => changeCurrentTab(0), child: Container( @@ -155,7 +157,7 @@ class StepsWidget extends StatelessWidget { ), Positioned( top: 10, - right: MediaQuery.of(context).size.width * 0.3, + left: MediaQuery.of(context).size.width * 0.3, child: InkWell( onTap: () => index >= 2 ? changeCurrentTab(1) : null, child: Container( @@ -177,7 +179,7 @@ class StepsWidget extends StatelessWidget { ), Positioned( top: 10, - right: MediaQuery.of(context).size.width * 0.6, + left: MediaQuery.of(context).size.width * 0.6, child: InkWell( onTap: () => index >= 3 ? changeCurrentTab(2) : null, child: Container( @@ -199,7 +201,7 @@ class StepsWidget extends StatelessWidget { ), Positioned( top: 10, - left: 0, + right: 0, child: InkWell( onTap: () => index == 2 ?changeCurrentTab(3):null, child: Container( diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index cb08bd17..c5cf339b 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -1250,6 +1250,7 @@ class TranslationBase { String get infoCMC => localizedValues['infoCMC'][locale.languageCode]; String get instructionAgree => localizedValues['instructionAgree'][locale.languageCode]; String get reqId => localizedValues['reqId'][locale.languageCode]; + String get ordersLog => localizedValues['RRT-orders-log'][locale.languageCode]; } From f5d478fd27233d7cc996182dc4cb4edea39ae5dc Mon Sep 17 00:00:00 2001 From: mosazaid Date: Mon, 18 Jan 2021 17:55:49 +0200 Subject: [PATCH 25/42] re-design child vaccine and fix some funcrionalities --- lib/config/localized_values.dart | 34 ++ .../vaccination_table_service.dart | 15 +- .../vaccination_table_view_model.dart | 9 +- .../all_habib_medical_service_page.dart | 20 +- .../ChildVaccines/add_newchild_page.dart | 122 +++--- lib/pages/ChildVaccines/child_page.dart | 168 ++++---- .../ChildVaccines/child_vaccines_page.dart | 372 +++++++++--------- .../dialogs/SelectGenderDialog.dart | 16 +- .../ChildVaccines/vaccinationtable_page.dart | 217 ++++++---- .../vital_sing_chart_and_detials.dart | 1 + lib/uitl/date_uitl.dart | 2 +- lib/uitl/translations_delegate_base.dart | 15 +- 12 files changed, 563 insertions(+), 428 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 6245735d..596bb086 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -242,6 +242,10 @@ const Map localizedValues = { "en": "Email Sent Successfully", "ar": "تم إرسال البريد الإلكتروني بنجاح" }, + "EmailSentError": { + "en": "Error Sending Email", + "ar": "خطأ في إرسال البريد الإلكتروني" + }, "close": {"en": "Close", "ar": "مغلق"}, "booked": {"en": "Booked", "ar": "محجوز"}, "confirmed": {"en": "Confirmed", "ar": "مؤكد"}, @@ -1218,6 +1222,10 @@ const Map localizedValues = { "en": "Send a copy of this report to the email", "ar": "أرسل نسخة من هذا التقرير إلى البريد الإلكتروني" }, + "update-email-msg": { + "en": "Email updated", + "ar": "تم تحديث البريد الالكتروني" + }, "update-email": {"en": "Update Email", "ar": "تحديث البريد الالكتروني"}, "booked-success": { "en": "The appointment has been successfully booked.", @@ -1465,4 +1473,30 @@ const Map localizedValues = { "en": "Nearest ER", "ar": "أقرب ER" }, + "covid19_driveThrueTest": { + "en": "'Covid-19- Drive-Thru Test'", + "ar": "Covid-19- الفحص من خلال القيادة" + }, + "E-Referral": { + "en": "'E-Referral'", + "ar": "الإحالة الإلكترونية" + }, + "childName": { + "en": "'CHILD NAME'", + "ar": "إسم الطفل" + }, + "recordDeleted": { + "en": "'Record Deleted'", + "ar": "تم حذف السجل" + }, + "msg_email_address_up_to_date": { + "en": "Please ensure that the email address is up-to-date and process to view the schedule", + "ar": "يرجى التأكد من أن عنوان البريد الإلكتروني محدث وأن العملية لعرض الجدول الزمني" + }, + "add-new-child": {"en" : "ADD NEW CHILD", "ar": "إضافة طفل جديد"}, + "visit": {"en" : "Visit", "ar": "الزيارة"}, + "send-child-email-msg": {"en" : "Send the child's schedule to the email", "ar": "أرسل جدول الطفل إلى البريد الإلكتروني"}, + "vaccination-add-child-msg": {"en" : "Add the child's information below to receive the schedule of vaccinations.", "ar": "أضف معلومات الطفل أدناه للحصول على جدول التطعيمات."}, + "child_added_successfully": {"en" : "Child added successfully", "ar": "تمت إضافة الطفل بنجاح"}, + }; diff --git a/lib/core/service/childvaccines/vaccination_table_service.dart b/lib/core/service/childvaccines/vaccination_table_service.dart index 7f987b76..fc2b40e9 100644 --- a/lib/core/service/childvaccines/vaccination_table_service.dart +++ b/lib/core/service/childvaccines/vaccination_table_service.dart @@ -1,7 +1,9 @@ import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/core/model/childvaccines/List_BabyInformationModel.dart'; import 'package:diplomaticquarterapp/core/model/childvaccines/add_newchild_model.dart'; import 'package:diplomaticquarterapp/core/model/childvaccines/create_vaccination_table.dart'; import 'package:diplomaticquarterapp/core/model/childvaccines/user_information_model.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import '../base_service.dart'; class VaccinationTableService extends BaseService { @@ -10,19 +12,18 @@ class VaccinationTableService extends BaseService { - Future getCreateVaccinationTableOrders() async { + Future getCreateVaccinationTableOrders(List_BabyInformationModel babyInfo, bool sendEmail) async { + String babyBDFormatted = "${DateUtil.convertDateToString(babyInfo.dOB)}/"; + hasError = false; await getUser(); - body['BabyName']="fffffffffff eeeeeeeeeeeeee"; - body['DOB'] = "/Date(1585774800000+0300)/"; + body['BabyName']= babyInfo.babyName; + body['DOB'] = babyBDFormatted; body['EmailAddress'] = user.emailAddress; body['isDentalAllowedBackend'] = false; - body['SendEmail'] = false; + body['SendEmail'] = sendEmail; body['IsLogin'] =true; - - - await baseAppClient.post(GET_TABLE_REQUEST, onSuccess: (dynamic response, int statusCode) { createVaccinationTableModelList.clear(); diff --git a/lib/core/viewModels/child_vaccines/vaccination_table_view_model.dart b/lib/core/viewModels/child_vaccines/vaccination_table_view_model.dart index 3b72dd50..d0ccb8a1 100644 --- a/lib/core/viewModels/child_vaccines/vaccination_table_view_model.dart +++ b/lib/core/viewModels/child_vaccines/vaccination_table_view_model.dart @@ -1,4 +1,5 @@ import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/childvaccines/List_BabyInformationModel.dart'; import 'package:diplomaticquarterapp/core/model/childvaccines/add_newchild_model.dart'; import 'package:diplomaticquarterapp/core/model/childvaccines/create_vaccination_table.dart'; import 'package:diplomaticquarterapp/core/service/childvaccines/add_new_child_service.dart'; @@ -11,14 +12,12 @@ import '../base_view_model.dart'; class VaccinationTableViewModel extends BaseViewModel{ VaccinationTableService _creteVaccinationTableService = locator(); + List get creteVaccinationTableModelList=> _creteVaccinationTableService.createVaccinationTableModelList; - // String get creteVaccinationTableContent => _creteVaccinationTableService.userAgreementContent; - //String get userAgreementContent => _creteNewBabyService.v//_reportsService.userAgreementContent; - List get creteVaccinationTableModelList=> _creteVaccinationTableService.createVaccinationTableModelList;//.createNewBabyModelList; - getCreateVaccinationTable() async { + getCreateVaccinationTable(List_BabyInformationModel babyInfo, bool sendEmail) async { setState(ViewState.Busy); - await _creteVaccinationTableService.getCreateVaccinationTableOrders();//getCreateNewBabyOrders(); + await _creteVaccinationTableService.getCreateVaccinationTableOrders(babyInfo, sendEmail);//getCreateNewBabyOrders(); if ( _creteVaccinationTableService.hasError) { error = _creteVaccinationTableService.error; diff --git a/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart b/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart index 1359ab8d..3c3c18c1 100644 --- a/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart +++ b/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart @@ -203,7 +203,7 @@ class _AllHabibMedicalServiceState extends State { ), imageLocation: 'assets/images/al-habib_online_payment_service_icon.png', - title: 'Covid-19- Drive-Thru Test', + title: TranslationBase.of(context).covid19_driveThrueTest, ), ServicesContainer( onTap: () { @@ -227,7 +227,7 @@ class _AllHabibMedicalServiceState extends State { ), ), imageLocation: 'assets/images/pharmacy_logo.png', - title: 'Pharmacy'), + title: TranslationBase.of(context).pharmacy), ServicesContainer( onTap: () => Navigator.push( context, @@ -248,7 +248,7 @@ class _AllHabibMedicalServiceState extends State { : EReferralPage()), ), imageLocation: 'assets/images/ereferral_service_icon.png', - title: 'E-Referral', + title: TranslationBase.of(context).ereferral, ), ServicesContainer( onTap: () => Navigator.push( @@ -259,7 +259,7 @@ class _AllHabibMedicalServiceState extends State { ), imageLocation: 'assets/images/new-design/family_menu_icon_red.png', - title: 'My Family', + title: TranslationBase.of(context).myFamily, ), if(projectViewModel.havePrivilege(35)) ServicesContainer( @@ -269,7 +269,7 @@ class _AllHabibMedicalServiceState extends State { ), imageLocation: 'assets/images/new-design/children_vaccines_icon.png', - title: 'Child Vaccines', + title: TranslationBase.of(context).childVaccine, ), ServicesContainer( onTap: () => Navigator.push( @@ -289,7 +289,7 @@ class _AllHabibMedicalServiceState extends State { FadePage(page: SymptomInfo()), ), imageLocation: 'assets/images/new-design/body_icon.png', - title: 'Symptom Checker'), + title: TranslationBase.of(context).symptomCheckerTitle), if(projectViewModel.havePrivilege(36)) ServicesContainer( onTap: () => Navigator.push( @@ -297,7 +297,7 @@ class _AllHabibMedicalServiceState extends State { FadePage(page: BloodDonationPage()), ), imageLocation: 'assets/images/new-design/blood_icon.png', - title: 'Blood Donation', + title: TranslationBase.of(context).bloodD, ), ServicesContainer( onTap: () => Navigator.push( @@ -308,7 +308,7 @@ class _AllHabibMedicalServiceState extends State { ), imageLocation: 'assets/images/new-design/health_calculator_icon.png', - title: 'Health Calculators', + title: TranslationBase.of(context).calculators, ), ServicesContainer( onTap: () => Navigator.push( @@ -319,7 +319,7 @@ class _AllHabibMedicalServiceState extends State { ), imageLocation: 'assets/images/new-design/health_convertor_icon.png', - title: 'Health Converter', + title: TranslationBase.of(context).converters, ), if(projectViewModel.havePrivilege(38)) ServicesContainer( @@ -370,7 +370,7 @@ class _AllHabibMedicalServiceState extends State { }, imageLocation: 'assets/images/new-design/twitter_dashboard_icon.png', - title: 'Latest News', + title: TranslationBase.of(context).latestNews, ), ServicesContainer( onTap: () => Navigator.push( diff --git a/lib/pages/ChildVaccines/add_newchild_page.dart b/lib/pages/ChildVaccines/add_newchild_page.dart index 51b89f98..3c0d072b 100644 --- a/lib/pages/ChildVaccines/add_newchild_page.dart +++ b/lib/pages/ChildVaccines/add_newchild_page.dart @@ -11,6 +11,7 @@ import 'package:diplomaticquarterapp/pages/ChildVaccines/child_page.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/medical/active_medications/DayCheckBoxDialog.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; @@ -84,10 +85,12 @@ class _AddNewChildPageState extends State { @override Widget build(BuildContext context) { + var size = MediaQuery.of(context).size; + return BaseView( builder: (_, model, w) => AppScaffold( isShowAppBar: true, - appBarTitle: "Vaccintion", + appBarTitle: TranslationBase.of(context).vaccination, body: SingleChildScrollView( physics: ScrollPhysics(), child: Container( @@ -96,10 +99,10 @@ class _AddNewChildPageState extends State { // crossAxisAlignment: CrossAxisAlignment.center, children: [ SizedBox( - height: 50, + height: 20, ), Texts( - "Add the child's information below to recieve the schedule of vaccinations.", + TranslationBase.of(context).vaccinationAddChildMsg, //+model.user.firstName, textAlign: TextAlign.center, ), @@ -107,14 +110,14 @@ class _AddNewChildPageState extends State { height: 12, ), NewTextFields( - hintText: "First Name", + hintText: TranslationBase.of(context).firstName, controller: _firstTextController, ), SizedBox( height: 12, ), NewTextFields( - hintText: "Second Name", + hintText: TranslationBase.of(context).middleName, controller: _secondTextController, ), SizedBox( @@ -124,62 +127,57 @@ class _AddNewChildPageState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( - "Gender:", + TranslationBase.of(context).gender, textAlign: TextAlign.end, ), ], ), Container( - height: MediaQuery.of(context).size.height * 0.12, width: double.infinity, + height: size.height * 0.12, padding: EdgeInsets.all(12), - - child: Row( crossAxisAlignment: CrossAxisAlignment.stretch, mainAxisAlignment: MainAxisAlignment.center, children: [ - Container( - height: MediaQuery.of(context).size.height * 0.12, - width: 175, - color: Colors.white, - child: SecondaryButton( - textColor: - checkedValue == 1 ? Colors.white : Colors.black, - color: checkedValue == 1 ? Colors.red : Colors.white, - - label: "Male", - // - onTap: () { + Expanded( + child: Container( + color: Colors.white, + child: SecondaryButton( + textColor: + checkedValue == 1 ? Colors.white : Colors.black, + color: checkedValue == 1 ? Colors.red : Colors.white, + label: TranslationBase.of(context).male, + onTap: () { + setState(() { + checkedValue = 1; + print("checkedValue=" + checkedValue.toString()); + }); - setState(() { - checkedValue = 1; - print("checkedValue=" + checkedValue.toString()); - }); - - // bloodDetails. - }, + // bloodDetails. + }, + ), ), ), - Container( - height: MediaQuery.of(context).size.height * 0.12, - width: 175, - color: Colors.white, - child: SecondaryButton( - textColor: - checkedValue == 2 ? Colors.white : Colors.black, - color: checkedValue == 2 ? Colors.red : Colors.white, - label: "Female", - // - onTap: () { - setState(() { - checkedValue = 2; - print("checkedValue=" + checkedValue.toString()); - }); - // bloodDetails.city=_selectedHospital.toString(); + Expanded( + child: Container( + color: Colors.white, + child: SecondaryButton( + textColor: + checkedValue == 2 ? Colors.white : Colors.black, + color: checkedValue == 2 ? Colors.red : Colors.white, + label: TranslationBase.of(context).female, + // + onTap: () { + setState(() { + checkedValue = 2; + print("checkedValue=" + checkedValue.toString()); + }); + // bloodDetails.city=_selectedHospital.toString(); - // bloodDetails. - }, + // bloodDetails. + }, + ), ), ) ], @@ -193,7 +191,7 @@ class _AddNewChildPageState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( - "Date Of Birth::", + TranslationBase.of(context).dob, textAlign: TextAlign.end, ), ], @@ -249,29 +247,29 @@ class _AddNewChildPageState extends State { color: checkedValue == false ? Colors.white24 : Color.fromRGBO( - 63, - 72, - 74, - 1, - ), - label: "Add", + 63, + 72, + 74, + 1, + ), + label: TranslationBase.of(context).add, // - onTap: () async{ - newChild.babyName = _firstTextController.text + " " + _secondTextController.text; + onTap: () async { + newChild.babyName = _firstTextController.text + + " " + + _secondTextController.text; newChild.gender = checkedValue.toString(); newChild.strDOB = getStartDay(); newChild.tempValue = true; newChild.isLogin = true; await model.createNewBabyOrders(newChild: newChild); - if(model.isAdded){ - AppToast.showSuccessToast(message: "Record Added"); - Navigator.pop(context,model.isAdded); - }else{ - + if (model.isAdded) { + AppToast.showSuccessToast(message: TranslationBase.of(context).childAddedSuccessfully); + Navigator.pop(context, model.isAdded); + } else { //TODO handling error } - }, ), ), @@ -280,7 +278,7 @@ class _AddNewChildPageState extends State { ), ), ), - // bottomSheet: + // bottomSheet: ), ); } diff --git a/lib/pages/ChildVaccines/child_page.dart b/lib/pages/ChildVaccines/child_page.dart index 806a5b71..ae33cc03 100644 --- a/lib/pages/ChildVaccines/child_page.dart +++ b/lib/pages/ChildVaccines/child_page.dart @@ -5,6 +5,7 @@ import 'package:diplomaticquarterapp/pages/ChildVaccines/add_newchild_page.dart' import 'package:diplomaticquarterapp/pages/ChildVaccines/vaccinationtable_page.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; @@ -22,30 +23,51 @@ class ChildPage extends StatefulWidget { class _ChildPageState extends State with SingleTickerProviderStateMixin { - DeleteBaby deleteBaby = DeleteBaby(); @override Widget build(BuildContext context) { + var size = MediaQuery.of(context).size; + final double height = (size.height - kToolbarHeight - 60); + final double itemWidth = size.width / 2; + final double itemHeight = height / 2 + 40; + var checkedValue = true; return BaseView( onModelReady: (model) => model.getNewUserOrders(), builder: (_, model, widget) => AppScaffold( isShowAppBar: true, - appBarTitle: " Vaccination", + appBarTitle: TranslationBase.of(context).vaccination, baseViewModel: model, - body: SingleChildScrollView( - child: Container( - margin: EdgeInsets.only(left: 15, right: 15, top: 70), - child: Column( - children: [ - ...List.generate( + body: Container( + height: height * 0.85, + child: SingleChildScrollView( + child: Container( + margin: EdgeInsets.only(left: 8, right: 8, top: 16), + child: GridView.count( + crossAxisCount: 2, + childAspectRatio: (itemWidth / (itemHeight + 0)), + crossAxisSpacing: 10, + mainAxisSpacing: 10, + controller: ScrollController(keepScrollOffset: true), + shrinkWrap: true, + padding: const EdgeInsets.all(4.0), + children: [ + ...List.generate( model.babyInformationModelList.length, - (index) => Container( - margin: EdgeInsets.only( - left: 0, right: 0, bottom: 20), - - decoration: BoxDecoration( + (index) => InkWell( + onTap: () { + Navigator.push( + context, + FadePage( + page: VaccinationTablePage(model.babyInformationModelList[index]), + ), + ); + }, + child: Container( + margin: EdgeInsets.only( + left: 0, right: 0, bottom: 20), + decoration: BoxDecoration( shape: BoxShape.rectangle, border: Border.all( color: Colors.white, width: 0.5), @@ -54,11 +76,12 @@ class _ChildPageState extends State color: Colors.white, ), padding: EdgeInsets.all(12), - width: 200,//double.infinity, + //double.infinity, child: Column( children: [ Row(children: [ - Texts("CHILD NAME"), + Texts(TranslationBase.of(context) + .childName), ]), Row(children: [ Texts(model @@ -96,19 +119,14 @@ class _ChildPageState extends State Navigator.push( context, FadePage( - - - page: VaccinationTablePage(), - - + page: VaccinationTablePage(model.babyInformationModelList[index]), ), ); - }, ) ]), Row(children: [ - Texts("Birthday"), + Texts(TranslationBase.of(context).dob), ]), Row(children: [ IconButton( @@ -116,9 +134,7 @@ class _ChildPageState extends State 'assets/images/new-design/calender-secondary.png'), tooltip: '', onPressed: () { - setState(() { - - }); + setState(() {}); }, ), Texts(DateUtil.yearMonthDay(model @@ -130,73 +146,71 @@ class _ChildPageState extends State icon: new Image.asset( 'assets/images/new-design/garbage.png'), tooltip: '', - onPressed: ()async { - + onPressed: () async { //===================== - await model.deleteBabyOrders(newChild:deleteBaby ); - + await model.deleteBabyOrders( + newChild: deleteBaby); - deleteBaby.babyID=model.babyInformationModelList[index] + deleteBaby.babyID = model + .babyInformationModelList[index] .babyID; - await model.deleteBabyOrders(newChild:deleteBaby ); - if(model.isDeleted){ - AppToast.showSuccessToast(message: "Record Deleted"); - Navigator.pop(context,model.isDeleted); - }else{ - - //TODO handling error - } - - - - - + await model.deleteBabyOrders( + newChild: deleteBaby); + if (model.isDeleted) { + AppToast.showSuccessToast( + message: + TranslationBase.of(context) + .recordDeleted); + Navigator.pop( + context, model.isDeleted); + } else { + //TODO handling error + } }, ), - Texts("Delete"), + Texts(TranslationBase.of(context) + .deleteView), ]), SizedBox( height: 12, ), ], ), - + ), ), - - - ) - ], - )) + ) + ], + ))), ), - bottomSheet: Container( - height: MediaQuery.of(context).size.height * 0.12, - width: double.infinity, - padding: EdgeInsets.all(15), - child: SecondaryButton( - textColor: Colors.white, - color: checkedValue == false - ? Colors.white24 - : Color.fromRGBO( - 63, - 72, - 74, - 1, - ), - label: "ADD NEW CHILD ", - // - onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => AddNewChildPage(), - ), - ).then((value) { - if (value) model.getNewUserOrders(); - }); - }, - ), + bottomSheet: Container( + height: height * 0.15, + width: double.infinity, + padding: EdgeInsets.all(16), + child: SecondaryButton( + textColor: Colors.white, + color: checkedValue == false + ? Colors.white24 + : Color.fromRGBO( + 63, + 72, + 74, + 1, ), + label: TranslationBase.of(context).addNewChild, + // + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => AddNewChildPage(), + ), + ).then((value) { + if (value) model.getNewUserOrders(); + }); + }, + ), + ), )); } } diff --git a/lib/pages/ChildVaccines/child_vaccines_page.dart b/lib/pages/ChildVaccines/child_vaccines_page.dart index 92f3a0be..38c6b5af 100644 --- a/lib/pages/ChildVaccines/child_vaccines_page.dart +++ b/lib/pages/ChildVaccines/child_vaccines_page.dart @@ -1,10 +1,10 @@ - import 'package:diplomaticquarterapp/core/viewModels/child_vaccines/child_vaccines_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/child_vaccines/user_information_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/my_balance_view_model.dart'; import 'package:diplomaticquarterapp/pages/ChildVaccines/child_page.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/input/text_field.dart'; @@ -13,214 +13,218 @@ import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; - - class ChildVaccinesPage extends StatefulWidget { @override _ChildVaccinesPageState createState() => _ChildVaccinesPageState(); } class _ChildVaccinesPageState extends State - with SingleTickerProviderStateMixin{ + with SingleTickerProviderStateMixin { TextEditingController titleController = TextEditingController(); - var checkedValue=false; - String addEmail=""; + var checkedValue = false; + String addEmail = ""; + @override Widget build(BuildContext context) { - return BaseView( onModelReady: (model) => model.getUserInformationRequestOrders(), builder: (_, model, w) => AppScaffold( - isShowAppBar: true, - baseViewModel: model, - appBarTitle: " Vaccination",//TranslationBase.of(context).advancePayment, - body: SingleChildScrollView( - physics: ScrollPhysics(), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.spaceAround, - children: [ - SizedBox( - height: 20, - ), - - Padding( - padding: const EdgeInsets.all(10.0), - child:Container( - child: Texts("Welcome back",fontSize: 20,), - ) , - ), - Divider(color:Colors.black , indent: 10, - endIndent: 10,), - SizedBox( - height: 20, - ), - Padding( - padding: const EdgeInsets.all(10.0), - child:Container( - child: Texts("Please ensure that the email address is up-to-date and process to view the schedule",fontSize: 20,), - ) , + isShowAppBar: true, + baseViewModel: model, + appBarTitle: TranslationBase.of(context).vaccination, + //TranslationBase.of(context).advancePayment, + body: SingleChildScrollView( + physics: ScrollPhysics(), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + SizedBox( + height: 20, + ), + Padding( + padding: const EdgeInsets.all(10.0), + child: Container( + child: Texts( + TranslationBase.of(context).welcomeBack, + fontSize: 20, ), - - Divider(color:Colors.black , indent: 10, - endIndent: 10,), - Padding( - padding: const EdgeInsets.all(10.0), - child:Container( - - margin: EdgeInsets.only(left: 10, right: 10, top: 15), - child: TextFields( - fillColor: Colors.red, - - hintText: model.user.emailAddress, - controller: titleController, - fontSize: 20, - hintColor: Colors.black, - fontWeight: FontWeight.w600, - onChanged: (text) { - addEmail=text; - model.user.emailAddress==addEmail?checkedValue=false:checkedValue=true; - - - }, - validator: (value) { - - if (value == null) - { - return model.user.emailAddress; - - } - else - - { - return model.user.emailAddress;} - }, - ), - ), + ), + ), + Divider( + color: Colors.black, + indent: 10, + endIndent: 10, + ), + SizedBox( + height: 20, + ), + Padding( + padding: const EdgeInsets.all(10.0), + child: Container( + child: Texts( + TranslationBase.of(context).msg_email_address_up_to_date, + fontSize: 20, ), - Container( - height: MediaQuery.of(context).size.height * 0.12, - width: double.infinity, - - padding: EdgeInsets.all(15), - child: SecondaryButton( - textColor: Colors.white, - color: checkedValue== false ?Colors.white24:Color.fromRGBO(63, 72, 74, 1,), - label: "UPDATE EMAIL", - // - onTap: (){ - model.user.emailAddress=addEmail.toString(); - AppToast.showSuccessToast( - message: "Email updated"); - // bloodDetails.city=_selectedHospital.toString(); - - // bloodDetails. - }, - + ), + ), - ), + Divider( + color: Colors.black, + indent: 10, + endIndent: 10, + ), + Padding( + padding: const EdgeInsets.all(10.0), + child: Container( + margin: EdgeInsets.only(left: 10, right: 10, top: 15), + child: TextFields( + fillColor: Colors.red, + hintText: model.user.emailAddress, + controller: titleController, + fontSize: 20, + hintColor: Colors.black, + fontWeight: FontWeight.w600, + onChanged: (text) { + addEmail = text; + model.user.emailAddress == addEmail + ? checkedValue = false + : checkedValue = true; + }, + validator: (value) { + if (value == null) { + return model.user.emailAddress; + } else { + return model.user.emailAddress; + } + }, ), - Container( - height: MediaQuery.of(context).size.height * 0.12, - width: double.infinity, - - padding: EdgeInsets.all(15), - child: SecondaryButton( - textColor: Colors.white, - color: Color.fromRGBO(63, 72, 74, 1,), - label: " VIEW LIST OF CHILDREN", - // - onTap: () => Navigator.push( - context, - FadePage( - page: ChildPage(), - - - - ), + ), + ), + Container( + height: MediaQuery.of(context).size.height * 0.12, + width: double.infinity, + padding: EdgeInsets.all(15), + child: SecondaryButton( + textColor: Colors.white, + color: checkedValue == false + ? Colors.white24 + : Color.fromRGBO( + 63, + 72, + 74, + 1, ), - - - ), - ), - - // Texts( - // // TranslationBase.of(context).advancePaymentLabel, - // model.user.emailAddress, - // textAlign: TextAlign.center, - // ), - SizedBox( - height: 12, - ), - SizedBox( - height: 12, - ), - SizedBox( - height: 12, + label: TranslationBase.of(context).updateEmail, + // + onTap: () { + model.user.emailAddress = addEmail.toString(); + AppToast.showSuccessToast( + message: TranslationBase.of(context).updateEmailMsg); + // bloodDetails.city=_selectedHospital.toString(); + + // bloodDetails. + }, + ), + ), + Container( + height: MediaQuery.of(context).size.height * 0.12, + width: double.infinity, + padding: EdgeInsets.all(15), + child: SecondaryButton( + textColor: Colors.white, + color: Color.fromRGBO( + 63, + 72, + 74, + 1, ), - - SizedBox( - height: 12, + label: TranslationBase.of(context).viewListChildren, + // + onTap: () => Navigator.push( + context, + FadePage( + page: ChildPage(), + ), ), + ), + ), - SizedBox( - height: 12, - ), + // Texts( + // // TranslationBase.of(context).advancePaymentLabel, + // model.user.emailAddress, + // textAlign: TextAlign.center, + // ), + SizedBox( + height: 12, + ), + SizedBox( + height: 12, + ), + SizedBox( + height: 12, + ), - SizedBox( - height: 10, - ), - // Row( - // mainAxisAlignment: MainAxisAlignment.center, - // crossAxisAlignment: CrossAxisAlignment.center, - // children: [ - // Center( - // child: Container( - // color: Colors.white, - // width: 350, - // child: InkWell( - // onTap: () { - // showDialog( - // context: context, - // builder: (_) => - // AssetGiffyDialog( - // title: Text( - // "", - // style: TextStyle( - // fontSize: 22.0, - // fontWeight: - // FontWeight - // .w600), - // ), - // image: Image.asset( - // 'assets/images/BloodChrt_EN.png'), - // buttonCancelText: - // Text('cancel'), - // buttonCancelColor: - // Colors.grey, - // onlyCancelButton: true, - // )); - // }, - // child: Container( - // width: 250, - // height: 200, - // child:Image.asset( - // 'assets/images/BloodChrt_EN.png')), - // ), - // ), - // ), - // ], - // ), + SizedBox( + height: 12, + ), - SizedBox( - height: MediaQuery.of(context).size.height * 0.15, - ) - ], + SizedBox( + height: 12, ), + SizedBox( + height: 10, + ), + // Row( + // mainAxisAlignment: MainAxisAlignment.center, + // crossAxisAlignment: CrossAxisAlignment.center, + // children: [ + // Center( + // child: Container( + // color: Colors.white, + // width: 350, + // child: InkWell( + // onTap: () { + // showDialog( + // context: context, + // builder: (_) => + // AssetGiffyDialog( + // title: Text( + // "", + // style: TextStyle( + // fontSize: 22.0, + // fontWeight: + // FontWeight + // .w600), + // ), + // image: Image.asset( + // 'assets/images/BloodChrt_EN.png'), + // buttonCancelText: + // Text('cancel'), + // buttonCancelColor: + // Colors.grey, + // onlyCancelButton: true, + // )); + // }, + // child: Container( + // width: 250, + // height: 200, + // child:Image.asset( + // 'assets/images/BloodChrt_EN.png')), + // ), + // ), + // ), + // ], + // ), + + SizedBox( + height: MediaQuery.of(context).size.height * 0.15, + ) + ], ), - ), + ), + ), ); } } - diff --git a/lib/pages/ChildVaccines/dialogs/SelectGenderDialog.dart b/lib/pages/ChildVaccines/dialogs/SelectGenderDialog.dart index 259bbdb7..c08749b8 100644 --- a/lib/pages/ChildVaccines/dialogs/SelectGenderDialog.dart +++ b/lib/pages/ChildVaccines/dialogs/SelectGenderDialog.dart @@ -7,8 +7,11 @@ import 'package:flutter/material.dart'; class SelectGenderDialog extends StatefulWidget { final Email; + final Function okFunction; + + const SelectGenderDialog({Key key, this.Email, this.okFunction}) + : super(key: key); - const SelectGenderDialog({Key key, this.Email}) : super(key: key); @override _SelectGenderDialogState createState() => _SelectGenderDialogState(); } @@ -33,9 +36,8 @@ class _SelectGenderDialogState extends State { }); }, child: ListTile( - title: Text("Send the child's schedule to the email\n Tamer.dasdasdas@gmail.com "), - - + title: Text( + "${TranslationBase.of(context).sendChildEmailMsg}\n Tamer.dasdasdas@gmail.com "), ), ), ) @@ -44,7 +46,6 @@ class _SelectGenderDialogState extends State { SizedBox( height: 5.0, ), - SizedBox( height: 5.0, ), @@ -82,7 +83,7 @@ class _SelectGenderDialogState extends State { flex: 1, child: InkWell( onTap: () { - AppToast.showSuccessToast(message: "Email Sended"); + widget.okFunction(); // widget.onValueSelected(beneficiaryType); Navigator.pop(context); }, @@ -105,7 +106,4 @@ class _SelectGenderDialogState extends State { ], ); } - - - } diff --git a/lib/pages/ChildVaccines/vaccinationtable_page.dart b/lib/pages/ChildVaccines/vaccinationtable_page.dart index c160acfb..7b8499e0 100644 --- a/lib/pages/ChildVaccines/vaccinationtable_page.dart +++ b/lib/pages/ChildVaccines/vaccinationtable_page.dart @@ -1,8 +1,13 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/childvaccines/List_BabyInformationModel.dart'; import 'package:diplomaticquarterapp/core/viewModels/child_vaccines/vaccination_table_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/reports_monthly_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -12,91 +17,161 @@ import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'dialogs/SelectGenderDialog.dart'; class VaccinationTablePage extends StatelessWidget { + final List_BabyInformationModel babyInfo; + + VaccinationTablePage(this.babyInfo); + @override Widget build(BuildContext context) { + var size = MediaQuery.of(context).size; + final double height = (size.height - kToolbarHeight - 60); + var checkedValue; return BaseView( - onModelReady: (model) => model.getCreateVaccinationTable(),//getUserTermsAndConditions(), + onModelReady: (model) => model.getCreateVaccinationTable(babyInfo, false), builder: (_, model, w) => AppScaffold( isShowAppBar: true, baseViewModel: model, - appBarTitle: "Vaccination", - body: SingleChildScrollView( - child:Container( - margin: EdgeInsets.only(left: 15,right: 15,top: 70), - child: Column( - children: [//babyInformationModelList.length - ...List.generate(model.creteVaccinationTableModelList.length, (index) => - Container( - decoration: BoxDecoration( - shape: BoxShape.rectangle, - border: Border.all(color: Colors.white, width: 0.5), - borderRadius: BorderRadius.all(Radius.circular(5)), - color: Colors.white, - - ), - padding: EdgeInsets.all(12), - width: double.infinity, - child: Column( - - children: [ - Row(children: [ - Text(model.creteVaccinationTableModelList[index].visit), - SizedBox(width: 10,), - - Expanded( - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Html( - // data:"
BCG
HEPATITIS B
"//model.creteVaccinationTableModelList[index].vaccinesDescription - data:model.creteVaccinationTableModelList[index].vaccinesDescription, - - ), - ],), - ), - Text(model.creteVaccinationTableModelList[index].givenAt), - - - ],), - Divider(color:Colors.black ,), - - ], - ) - - - ) - - ) - ], + appBarTitle: TranslationBase.of(context).vaccination, + body: Container( + height: height * 0.85, + child: SingleChildScrollView( + child: Container( + margin: EdgeInsets.only(left: 16, right: 16, top: 16), + child: Column( + children: [ + Row( + children: [ + Expanded( + child: Texts(TranslationBase.of(context).childName), + ), + Expanded( + child: Texts(TranslationBase.of(context).dob), + ), + ], + ), + SizedBox( + height: 10, + ), + Row( + children: [ + Expanded( + child: Texts(babyInfo.babyName), + ), + Expanded( + child: Texts(DateUtil.getFormattedDate( + babyInfo.dOB, "MMM dd,yyyy")), + ), + ], + ), + SizedBox( + height: 10, + ), + Divider( + color: Colors.black, + ), + Row( + children: [ + Text(TranslationBase.of(context).visit), + SizedBox( + width: 25, + ), + Expanded( + child: Text(TranslationBase.of(context).description)), + Text(TranslationBase.of(context).dueDate), + ], + ), + ...List.generate( + model.creteVaccinationTableModelList.length, + (index) => Container( + decoration: BoxDecoration( + shape: BoxShape.rectangle, + // border: Border.all(color: Colors.white, width: 0.5), + borderRadius: BorderRadius.all(Radius.circular(5)), + // color: Colors.white, + ), + padding: EdgeInsets.all(12), + width: double.infinity, + child: Column( + children: [ + Row( + children: [ + Text(model + .creteVaccinationTableModelList[index] + .visit), + SizedBox( + width: 10, + ), + Expanded( + child: Column( + mainAxisAlignment: + MainAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Html( + // data:"
BCG
HEPATITIS B
"//model.creteVaccinationTableModelList[index].vaccinesDescription + data: model + .creteVaccinationTableModelList[ + index] + .vaccinesDescription, + ), + ], + ), + ), + Text(model + .creteVaccinationTableModelList[index] + .givenAt), + ], + ), + Divider( + color: Colors.black, + ), + ], + ))) + ], + ), ), - + ), ), - ), bottomSheet: Container( - height: MediaQuery.of(context).size.height * 0.12, + height: height * 0.15, width: double.infinity, - padding: EdgeInsets.all(12), child: SecondaryButton( - textColor: Colors.white, - color: checkedValue== false ?Colors.white24:Color.fromRGBO(63, 72, 74, 1,), - label: "Send Email ", - // - onTap: () { - //SelectGenderDialog(); + textColor: Colors.white, + color: checkedValue == false + ? Colors.white24 + : Color.fromRGBO( + 63, + 72, + 74, + 1, + ), + label: TranslationBase.of(context).sendEmail, + // + onTap: () { + //SelectGenderDialog(); //=============== - showDialog( - context: context, - child: SelectGenderDialog( - ), - ); - //========= - } - - - ), + showDialog( + context: context, + child: SelectGenderDialog( + okFunction: () async { + await model.getCreateVaccinationTable(babyInfo, true); + if (model.state == ViewState.Idle) { + AppToast.showSuccessToast( + message: TranslationBase.of(context) + .emailSentSuccessfully); + } else { + AppToast.showErrorToast( + message: TranslationBase.of(context) + .EmailSentError); + } + }, + ), + ); + //========= + }), ), ), ); diff --git a/lib/pages/medical/vital_sign/vital_sing_chart_and_detials.dart b/lib/pages/medical/vital_sign/vital_sing_chart_and_detials.dart index 43bc9f0a..b09a579d 100644 --- a/lib/pages/medical/vital_sign/vital_sing_chart_and_detials.dart +++ b/lib/pages/medical/vital_sign/vital_sing_chart_and_detials.dart @@ -1,5 +1,6 @@ import 'package:diplomaticquarterapp/core/model/vital_sign/vital_sign_res_model.dart'; import 'package:diplomaticquarterapp/pages/medical/vital_sign/vital_sign_details_wideget.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/widgets/charts/app_time_series_chart.dart'; import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart'; import 'package:flutter/material.dart'; diff --git a/lib/uitl/date_uitl.dart b/lib/uitl/date_uitl.dart index 460a4066..9f959885 100644 --- a/lib/uitl/date_uitl.dart +++ b/lib/uitl/date_uitl.dart @@ -4,7 +4,7 @@ import 'package:intl/intl.dart'; class DateUtil { /// convert String To Date function /// [date] String we want to convert - static DateTime convertStringToDate(String date) { + static DateTime convertStringToDate(String date) { // /Date(1585774800000+0300)/ if (date != null) { const start = "/Date("; const end = "+0300)"; diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index 257ceb8e..fe0b6bc3 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -581,6 +581,8 @@ class TranslationBase { localizedValues['UpdateSuccessfully'][locale.languageCode]; String get emailSentSuccessfully => localizedValues['EmailSentSuccessfully'][locale.languageCode]; + String get EmailSentError => + localizedValues['EmailSentError'][locale.languageCode]; String get checkVaccineAvailability => localizedValues['CHECK_VACCINE_AVAILABILITY'][locale.languageCode]; String get myVaccinesAvailability => @@ -1172,6 +1174,7 @@ class TranslationBase { String get infoInsurCards => localizedValues['info-insur-cards'][locale.languageCode]; String get scanNow => localizedValues['scan-now'][locale.languageCode]; String get pharmacyServiceTermsCondition => localizedValues['pharmacyServiceTermsCondition'][locale.languageCode]; + String get recordDeleted => localizedValues['recordDeleted'][locale.languageCode]; String get referralStatus => localizedValues['referralStatus'][locale.languageCode]; @@ -1214,7 +1217,6 @@ class TranslationBase { String get viewListChildren => localizedValues['view-list-children'][locale.languageCode]; String get addChild => localizedValues['add-child'][locale.languageCode]; - String get childName => localizedValues['child-name'][locale.languageCode]; String get childDob => localizedValues['childDob'][locale.languageCode]; String get deletedChildMes => localizedValues['deleted-child-mes'][locale.languageCode]; @@ -1247,7 +1249,16 @@ class TranslationBase { String get driveThru => localizedValues['driveThru'][locale.languageCode]; String get NearestErDesc => localizedValues['NearestErDesc'][locale.languageCode]; String get NearestEr => localizedValues['NearestEr'][locale.languageCode]; - + String get covid19_driveThrueTest => localizedValues['covid19_driveThrueTest'][locale.languageCode]; + String get eReferral => localizedValues['E-Referral'][locale.languageCode]; + String get vaccination => localizedValues["vaccination"][locale.languageCode]; + String get msg_email_address_up_to_date => localizedValues["msg_email_address_up_to_date"][locale.languageCode]; + String get updateEmailMsg => localizedValues["update-email-msg"][locale.languageCode]; + String get childName => localizedValues["childName"][locale.languageCode]; + String get addNewChild => localizedValues["add-new-child"][locale.languageCode]; + String get sendChildEmailMsg => localizedValues["send-child-email-msg"][locale.languageCode]; + String get vaccinationAddChildMsg => localizedValues["vaccination-add-child-msg"][locale.languageCode]; + String get childAddedSuccessfully => localizedValues["child_added_successfully"][locale.languageCode]; } From bbd953ae43cf5c49d3ec8df0e370d10ae653c1cf Mon Sep 17 00:00:00 2001 From: Zohaib Iqbal Kambrani <> Date: Tue, 19 Jan 2021 11:41:55 +0300 Subject: [PATCH 26/42] Order Delivery Driver tracking [inprogress] --- .../map_markers/destination_map_marker.png | Bin 0 -> 4974 bytes assets/images/map_markers/driver-pin.png | Bin 0 -> 13918 bytes .../images/map_markers/source_map_marker.png | Bin 0 -> 5311 bytes lib/config/config.dart | 4 +- lib/config/localized_values.dart | 5 + lib/core/model/pharmacies/order_model.dart | 28 ++- lib/pages/pharmacy/order/Order.dart | 17 +- lib/pages/pharmacy/order/OrderDetails.dart | 177 ++++++++------- lib/pages/pharmacy/order/TrackDriver.dart | 211 ++++++++++++++++++ lib/uitl/translations_delegate_base.dart | 1 + pubspec.yaml | 4 +- 11 files changed, 356 insertions(+), 91 deletions(-) create mode 100644 assets/images/map_markers/destination_map_marker.png create mode 100644 assets/images/map_markers/driver-pin.png create mode 100644 assets/images/map_markers/source_map_marker.png create mode 100644 lib/pages/pharmacy/order/TrackDriver.dart diff --git a/assets/images/map_markers/destination_map_marker.png b/assets/images/map_markers/destination_map_marker.png new file mode 100644 index 0000000000000000000000000000000000000000..4f4eca3531d475b04944fc5341f98cd910e313eb GIT binary patch literal 4974 zcmV-!6OrtRP)KLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uhf59&ghTmgWD0l;*T zI709Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKvYIYoh62rY33S640`D9%Y2D-rV&neh&#Q1i z007~1e$oCcFS8neI|hJl{-P!B1ZZ9hpmq0)X0i`JwE&>$+E?>%_LC6RbVIkUx0b+_+BaR3cnT7Zv!AJxW zizFb)h!jyGOOZ85F;a?DAXP{m@;!0_IfqH8(HlgRxt7s3}k3K`kFu>>-2Q$QMFfPW!La{h336o>X zu_CMttHv6zR;&ZNiS=X8v3CR#fknUxHUxJ0uoBa_M6WNWeqIg~6QE69c9o#eyhGvpiOA@W-aonk<7r1(?fC{oI5N*U!4 zfg=2N-7=cNnjjOr{yriy6mMFgG#l znCF=fnQv8CDz++o6_Lscl}eQ+l^ZHARH>?_s@|##Rr6KLRFA1%Q+=*RRWnoLsR`7U zt5vFIcfW3@?wFpwUVxrVZ>QdQz32KIeJ}k~{cZZE^+ya? z2D1z#2HOnI7(B%_ac?{wFUQ;QQA1tBKtrWrm0_3Rgps+?Jfqb{jYbcQX~taRB;#$y zZN{S}1|}gUOHJxc?wV3fxuz+mJ4`!F$IZ;mqRrNsHJd##*D~ju=bP7?-?v~|cv>vB zsJ6IeNwVZxrdjT`yl#bBIa#GxRa#xMMy;K#CDyyGyQdMSxlWT#tDe?p!?5wT$+oGt z8L;Kp2HUQ-ZMJ=3XJQv;x5ci*?vuTfeY$;({XGW_huIFR9a(?@3)XSs8O^N5RyOM=TTmp(3=8^+zpz2r)C z^>JO{deZfso3oq3?Wo(Y?l$ge?uXo;%ru`Vo>?<<(8I_>;8Eq#KMS9gFl*neeosSB zfoHYnBQIkwkyowPu(zdms`p{<7e4kra-ZWq<2*OsGTvEV%s0Td$hXT+!*8Bnh2KMe zBmZRodjHV?r+_5^X9J0WL4jKW`}lf%A-|44I@@LTvf1rHjG(ze6+w@Jt%Bvjts!X0 z?2xS?_ve_-kiKB_KiJlZ$9G`c^=E@oNG)mWWaNo-3TIW8)$Hg0Ub-~8?KhvJ>$ z3*&nim@mj(aCxE5!t{lw7O5^0EIO7zOo&c6l<+|iDySBWCGrz@C5{St!X3hAA}`T4 z(TLbXTq+(;@<=L8dXnssyft|w#WSTW<++3>sgS%(4NTpeI-VAqb|7ssJvzNHgOZVu zaYCvgO_R1~>SyL=cFU|~g|hy|Zi}}s9+d~lYqOB71z9Z$wnC=pR9Yz4DhIM>Wmjgu z&56o6maCpC&F##y%G;1PobR9i?GnNg;gYtchD%p19a!eQtZF&3JaKv33gZ<8D~47E ztUS1iwkmDaPpj=$m#%)jCVEY4fnLGNg2A-`YwHVD3gv};>)hAvT~AmqS>Lr``i7kw zJ{5_It`yrBmlc25DBO7E8;5VoznR>Ww5hAaxn$2~(q`%A-YuS64wkBy=9dm`4cXeX z4c}I@?e+FW+b@^RDBHV(wnMq2zdX3SWv9u`%{xC-q*U}&`cyXV(%rRT*Z6MH?i+i& z_B8C(+grT%{XWUQ+f@NoP1R=AW&26{v-dx)iK^-Nmiuj8txj!m?Z*Ss1N{dh4z}01 z)YTo*JycSU)+_5r4#yw9{+;i4Ee$peRgIj+;v;ZGdF1K$3E%e~4LaI(jC-u%2h$&R z9cLXcYC@Xwnns&bn)_Q~Te?roKGD|d-g^8;+aC{{G(1^(O7m37Y1-+6)01cN&y1aw zoqc{T`P^XJqPBbIW6s}d4{z_f5Om?vMgNQEJG?v2T=KYd^0M3I6IZxbny)%vZR&LD zJpPl@Psh8QyPB@KTx+@RdcC!KX7}kEo;S|j^u2lU7XQ}Oo;f|;z4Ll+_r>@1-xl3| zawq-H%e&ckC+@AhPrP6BKT#_XdT7&;F71j}Joy zkC~6lh7E@6o;W@^IpRNZ{ptLtL(gQ-CY~4mqW;US7Zxvm_|@yz&e53Bp_lTPlfP|z zrTyx_>lv@x#=^!PzR7qqF<$gm`|ZJZ+;<)Cqu&ot2z=0000WV@Og>004R=004l4008;_004mL004C`008P>0026e000+nl3&F} z000P?Nkl6anGbppBJLhR60z+83I0M`JCEUz^H{1<2eo&mN19i}_LWKffUPXnI< zl0IHH0aU7EvHCX`cpP{Pc*#U(6d3r!Sp+->900!WGo(u?soFXKY*jWC#-J`#F>r?( zKQ^fDEfInp31E)0VUM!uZ80e6m|KB;K!fUzOi`t>X}_{Dk*}btfmYzxz(j+`%8AOx z7GQclfhqzX1pWog!XC{A+JFbb7{7uBb+!6se$ApsgQ1h1ud92wI;x;*f#-n_V!s?< zhq|Xof%*c_2$T^WjRhJ-GIdu}Kz$EbZQwJTU;g`1&+eBaA5y{jVTS3(W z%g7%s6Uo#MZ3A@=a4-3%6(X5hZVRY|z)JF0t3)!j&~#8$zL*Mma<^-wA*JiY(KBpZ;?n8*_Wj#wV2p5`j6>Dy7&R@Dkd|I` zNk{;r#uZUl@9Wb@G4g9kZIg+qk%YATU6=iT71Kug-LzIv*G8_p%K(xlX$4i44`b5B z)O)JmZxg2J1XYobkN}=rbI5NqCg_}=Tff67(=jPst!q2@+pk{s+muqB5mlOxkhZKk zsKcBXlwT7EjgYj1D#@2Isdb%JNS=M^b&NV=9i%L}yOxFyo_XY;Zqu~BJwF+BNUduF zf#lhjUL)$54vWWKQ$kfu8AT-p9Nu|?1Ka)=#W889Ue^igRllvBapRTDySI{((({{1 z+cqEJk77T4X9og}qyQlS9MTEO*E@ON%@de^-@8c+*$n;Oo5oXAT)@-cXs5q#Kz}5y z3mg*2Y&F`(sNH^9SvhmeMIjAp`uuVh+&_ha5eaXQyw2{{cCck-;E+6n@)}Xw{Ic=` ziz+S&X;9U*e_PZ>W7aki@LjXy{rwC zaGhRc4x^lP+`~SE>e_M^)K6waVZ!$AZcu%|e{@C^fG_XbALO18H=yo-C zkpSxICucmntFA3)eAN|9m^#u{NC5xvdV=SO60UO;nGn$z?QHJy99b39MqYNtXxPMI zsGimiN~zILt9Lbb(c}@9MH7b$ew)H|_F4&QFtYrH)zV;GBmw+Bo0GEp?8bFo0{*E3 zR-;d_TGs{k7Tl|z3=EXg&vo2|AKhT?*eaVhjocD%K}IMKN7B!laKsJ65okTclIr< zu$sH*>FUL~^_`5JbOk*}dfBo02s@j)Ooy}|cqG@0Bz&sKRtmHOuz&0kXJbK6iPyOyA` zm7kL3BAKN+4cy{)mlp&mfX}I4Sw85C!gZe4b#dLGx{*ayPDLEj?}Y0#=xiW}Drvir zrSqbyJ;3L6Hxg7iyYRCE@&S-8%>gJ>*BP^Z**)g2K~ z%YZ)z)mYG#JohSCwm%F%2>c?*2E!=1`WN6fS z3S=g(593pMpR{MUd1y$*kk6n%zHj>o@FyRx)rBm!wbhoJw+R%;FB|KC$8vmDn+>$t zbmO*x8hmT87pJ8T}0E~ftv0FvFXP!wG5>;M1&07*qoM6N<$f`0-`-v9sr literal 0 HcmV?d00001 diff --git a/assets/images/map_markers/driver-pin.png b/assets/images/map_markers/driver-pin.png new file mode 100644 index 0000000000000000000000000000000000000000..9d16ceca4edf852f6c6e969dce7a63342a332073 GIT binary patch literal 13918 zcmZ|01ymeQmp+WUySwY)?(XjHuEXFEWN>$P_u%dX50>C0xCEEr34HwCegC`r?b+>f zs_M?I=ebq4tGc^vV$@aTP?3m`ARr)6738HgKT_+Dkd6TN5!<-Ot3W^?tvEYdPSBygx1xvxbDEF9v*|r_Noa~quIov{~7RPt`u}?C8y2c#XFleNeTWN%Ny~d+z zKF3vX#J>2APz>hug~t8_(tbMC8`3=gdOQKk>~A;!eIA?B)>1JQr`^Nv4U$Xr2I-T= zKoM0I1HIzz{0ySz8ZB&dZ2$A*j6f@&qDQ2`d2+P_925rHT8NZZAsxi6U)&u%k;PF= zW;AThpFkq$ZWm!9rOD>j5`hgNK?s0{PnBuZqEng=){<^PbAuw3xod?nn;5TEocL|K zEOn9$uN4D>-iO=DqhAmu-|yIUB%&R~N%G(PI(bJhjGhu6Zta?(K}+fxH<-I+nQW&hL`XGlz^HW3_+l zVbkT(72fr&D|idzlDZJgHzc$NeZ%NWIRImpAQmDPaWx?}nuM*5Pzi%BNfWB1FS#bZ zCUrt%OpSs$9#bm~EXC(Y%$6~hsi)+{p2sG~+D?_Hp-vTI%%!1dpjl2vOJhrglP{Wd zv}Wc^%U8@yT}^vT>79I>bYsMcCH#_=DmhhEU&XCCr%9$I%A}ETp02NGT!E_yQgl)L ztJsu|I9)l7atJ#uGrc@5m(j#Hs7+a&T?5crW17)9)lRJ0(je5Ts1>Z1tv#x3)DkK7 zR{-gwR@qkK6_4vM>uff7>$)VzmJ(^@XrqC6K&H81k`{j|!*cA?yQ%kdpTg86TcO6H^2L7!Ct-h@*bB=|}VrSti&a7svg}U9k zaVxA1^Bde35EsrDDjOFYNnQ(rx`K;>5rRTqb7y_|4WgSsUOVsSbL!TsvymR%9*!O* zkk6UvGU>N(tH?{(zg)fv)jevOX>IF?DGe&Vr@uu*E)Q*ro2%QnZ|n%DgpU^=E;!mB z+m}W5L=H!4j+#XFNAAlW$==A)%CgEP#m9_$?W627?Yr)4U_+<5r&*@arM*_dX!S5| zd(}B4{etHLwo141*k0I<9vL37+)>@p-9_QyAd|<*;GyF2u{LLV%{b3oWUe-tGvhN4 z=oBpTIIV3g8=Ck3=$VJJ+IOXHbNJkCrPN`whPTGMj<)8o5wV`J*1p-FYsE=#Ggm1f z0vuTHT{~X8YW}oSe1x&5zPIq}dVFy@Wncf;_gl;!&Pm%y&FHW8)^@IWzo3xsORdImxBSJJiDGvCXW^8m~;Z?NF3t@%Ab9 zGm83))|!^DpudH8$FCnI-J;*JKVG4#BS)iGqxzEA<75-A;qVh3V6|~qGZSEw5cM%W zp(!POvEXTumD-ZbjL1i(jT(%Vx_WP;XF6&@g)f56T$s zs%11L%9{`Uuh~wMecX-G5G4(PwRO?hp zGDdg_u~J_GXp^l6%Bjsr2~!&tSU;FNo=&mqXq~cznUPpt z92or>?HqiXEpBS}LT%!0dNZYFzGe9|0ZcV|EbVO;rvKJO*R|;VHMBI-G`MvI?VZkP z_Ag~rgm1$Jt!h_l)3Noojsw5WT`g`S4_uj?wRvxDxE*fY&fq@aF5{Z5c&wPb4ev(f zk{_ILtvtHA|M+Z0?Oo=+f1x6p_n=p+i>HI;inhI_D^thR$1BI{2VlU}mD!@A`M+1%0!7^VR3+(*9>nXRGD$F*&T*&mXvLbq&My zCH{QgKEsz)0ay>e|46^rcr?xZjO{mjM0}ijm^c?(Jy}`v6@MIxr0Y`H;PwRE@7znh zMG5A*`#b%Q*W#~cHjUL8t{gkKUVLvc{yeXTqwW)6 z|FP7(Ss#Y)t}}Ys@o$-?IC?feV?pnn;O@V%XBi!JYc^xtr~YXP2u& zuSX9Br;oqHfTQo@5qb4_dag2Cr@f?~UM~y23$^ra^^QJzUiJ@|xqtdIJROxCb(o}0 zrX#izv~`_#=*G&aw>|~=9$KenStLwwfHLr8a{HQ9vQ(8`wLFhf$b%+?Rz!eE()||r z^R5KH6n~$6=B?x<=|vB(DfoHxF{!Rhp-igjOVgp-O8;_j?^VHF?`3m!^TZW!JLwa{ zd-Y$BclwvA!ugn@q6GZl;h>sl$LIDtqm$04TjOryF}zlKIY^vRcUd?Hw+G5r4^9Ye zYc~41yxazQ*xVPgY?|vLU&psX96gBK6dOwxOK(Vb0u3%R8s5^B=<#Q$wJC*?cPxd- zw0&)s3OWe)NYCdyVF-liV8qm!iL!&+rhEBjK1hBZVV-Yl2zWV%c{MZ0NlLGS87EujQIxfsn0*X%!8ZB|wkj$ROdm1=1RNwB1oVdl2?6yH zVf|Z%{E&$tVE?6ufY5~`{!iHylHtGbQ4SC=|HjyUr2kyOT?I#nAsL zr~d=}-87H(ks!Lu8vr37kg@*>kPx}~1P~BV9S++1UivD^f>v%WY!=pTmNsm@F7E%Z zAcTDdKSUQBFAEA^7iU+XpsxtkzYu~S@;_>JDvEzWyqrX+^i|X;q})7hD0tZbYyc`z zBnk=&VNYvYK}~7df73sHiBQ>ldASR+v-|k?u=#MYxp~^La|j3sumd>RIXPKB5UfBy zS1$`+R#zbPe;E0HcBE~9R-O*-UJh=q6#v+@uyg}?iBM7fQ_z22|4~mb2iyND$rbo- zw>}(X|0jo?gAKs`ztL=b9sUp6KRN$F`i@}7^K`KJxGn$C{4tc*g1jt z7nV|lu(Ab}$G1<%%YNE}!A-A+!3n^Uo?6!*0hd#J1+{v(Ok6sv%gZ|98{gE#epF-2 z4LiL5eQe4R0NUb)!1$D?s=z|CazaQoP6FrEpFlS54FYIkB^BBNG!5wZr4p@81I}kBdMT8~4n^uJRI%vSCe% ztG0^WEk8Os#b>cJ+d(s|oyID&KQ-fj7#@cTJ}x)6Bs!8R9E~+$=P(57*gG1QKVe}# zBLCh2X1t4s<+5b6pT4y-YE=eiRoi{~wucp9nmHr$J)@#qnwrB&-tipI$hocKL*m(H+56U1+GF!81)KSklGi0<351cPQ0FUsq#d z5rLa~Iq>SbWoV#f02@Y8Jcsxr@b0S~o)nt)%9R&NdH@Hcw4}R5sMVhZmpMd64_`BI zh$9A?!bM8q>S2QtOY_)MmZ`r3-tz@zwkP7)k5CSSur=v0e$xrarMU{qfszu)$dZ&D zm@35tqcm`fdf1SsqXt~T@IHKdQ15M1@ZbB@_Yx;;7e$^Pv#K=Tm=#G$SGg z9}dmjZu||#y{RKYD8LzI8EL8!x+LeWwCjZ`c5jj+ z@49u`&!wR|8gTfcBqp*1hHhP%HUGgB$JU1A?mA+f1fb=>V_HaQ#C+@s&uU{Vh(n7p zdvTVjT*nS+mrKT&9`m?>b45M2BW{Y=r-Y{^wH6i`Z#FA=F6g3tb*?N$(?CfhN3yB` zjkuC;N`%9@Ut+8t-+{2P27AnFXzWiVwySQ?Os{6+dp@_r(oAWYBDdZvMFoKut_nrU zxV{;O`_7Pt|uB$M)W1vVskhy zYs{Y_u=Gn`7>xSuFIY+f*()}!ZV#r|1=*1txH!0`v7x9LBio4G`fea4om*xJEp|!; z&-9HWAUlg2xY`s6M7;VaEJ#q;cN8ewj)fkYN-ZMW^IUs=Efxs*kj0tlSTd|>2)SO* z^9&D0l=d5jX9Wd3oD0ZZp2@)Ry+1{LWdufKZClSqP&V-Ei2n9;h;`?TIbhz&$80J_ zTBb5VD{WSgBX2xVyo4I~xj*F0X}o^elWiigz^R zF#4@|JpJ_emB^s9odS(E&$K>xVh(E>h4GU4`uwbEaL$k+?z0>8Og6wf1wdB9@68mZ z#DtQKG`d`g81njjcO2z+cNEbLJdV5?d>8$5SM<((o@MA*^ZC#1OjJdd=>}TER<1Z; z@8t!y!&}!85^+$LQ5iRCt#!4oX~4het`QY)bH5&DFDP=Q{6+EQD!O{kF*{>DpM`}O z%&;#RQc`|3@XFTr_%p!!YmsQs3;2G;h`qjRFSaD$@v=lIi%s`9%PbhN)ovbbJNUIB zoL$05T%AWhi*F|yt26Ar|5fTB(%n>~v*er8 z97)#3m~0>9SOVi&7cHjWV!kvXTxO3byO+A~J4y6~;iI48TdbP+pnh0YTkv+(2Y%&I zfr#La4tRaqPa2(JADo3VSdeF^ZyqPIbrF02(~8&v6J|hB$YDmvzS=%`JyF)ygS=iV zzV+zfa*Cl4kPp^Kg_VQ_fC;&5!RVq-6e#4P!X$y$!}aJnLY|Zq+-Rv>bMvN=tywW< zT5P7?EA<8v;c4!h4V@9q`{R*sXTQ;z8`~_OepMCi6~}_U#usK>VmjWz9XrtNG$4+d z=&0$usl%|E%&L-%@8%M4^k0u4Tg;0*qRRag!^a%J$2szO{yVu5T5jL3ybR_;KB`eR&aI@~v6I67@cm;n3-8$B7Ux$o*^U;EP zES#2qkDa#|I&nQBKa-^b=7buqmmt5U!&5H|*cJNG<@@~fv-o|oXtAuLr}FYw6PXH^ z9bY-D&wTX6#Cx3_;}0yHkA0<~n& zAJx=*)Jj`iV1MWnZIR(coI4J!w(;` z(UKaCztSKkq=)JsZ|1BBQDfInA<$?DLYG}-4JbIVIDP52!!u2w{tj6a77l`WQg1HV znWmgC)vZFZZ)g_gq+h3fzc|lhMCVBoe0W}k816?~U|WF*or?k26qAuI+Kzw`zrLiF zKlGO4G=2)P{pwV08GcGzbUcj?4$WJl)8*ff=W-sABa7NOLTWre9L6+Opq7nCs4DQz zWyIt53l^0h)YphJS?^^_vIfa{&f5Mmc#eJJY7{+I*|$W^^sGzU5;6g{%AA z6{gsMLXetEV#nyX<~I1(`6iW?3=RU8#_ZT%`|l)MSa=m@h%MwSNyef)ObkGBUYDv zWZkZawC$I5TZc|l#Fc}5=lA0Zjk;%oSqB5~$nPL}nc?PibEnfiWTq)#xZC;lI zh-JlCoi&~lz)sVIB%*o)7x?^K*R5E$y6H>bTi+VlheHisGuTQ&0{Jht8*VsTrnbS! z9A#wzASO@tzw&LP$dPz}K?nBQ91)?i9$m>m0j+shgvMu@jc__a-^daF68dhPWOU&s z>aEBp9_B>kcJu|E0O&kfC=RY0sP#gL%nL0nB~+T**o>jC?I{T~_}*aPQr5)g0g(g% zrV5)*gPo`g2b}v2p$|$Er2Pp9A}wgwZXL=DS%!SXZf1_*|D$heY|U;g5x^UI+V0P8 zrJgSUOHn|AgE2I8JM;H(+im8d4RMq*R>w*gc5R+wQi7U53!$*)6H35Uzt5Ugl8AFC zHs{@!uNh$%+ghrkw8lYSmn9bSo*R+$WRRBSAPIj{UuBDbv<5fL0cPjn;j}n`cq%!{ zGEYo%FLe=fy{{hz99mfi*Ss*7F=$z5cL*9CW#VmjZK2qOsL%?sYud=Qn>OEl1hGV~ z$#hD@vrsMnDSEm4AXUj(uLYxTPgjqxn$6hr7i~vP=5cE5J#~wI7$q;(55&+D%l$we zxFd}$7d5P1fpW{b*#{wKtU~Tz;C>r_ckOwkM7OQq2vSdhue0 z8~{nXY19JXoB$r2*FlP0E&yQb9@$(D_NWr$!nYhO^cqFw%WlUV5)U6G-?41ynuL0x z1sY*Z8xC=YMt^Rn3O!i#G=BFTR>e}Gg=s4(E4oYCn~QglaBqu(HvU8*j6xBZ3KfxwDUL5 zqE_+hlO6;IXM~;|ioK!BbcdCob&ylNUl23Dl!{2K@QJZ{xw>#ud zMs5Wk05f8)IjUU3lkjL?W$t^L?=@Jb*l3}!Ir0ps(hO%YJ$w!yYYsVo1Uz@aSC&;$ z+mT0{;Eex0`)xEK-UXr{(1V*!GuG-p7Epe)i;p~!y6n9ga6fD4q_bF$cngX8`>neH z#u;n39+r+TjEzXHcM1qpu^whbU{)VlDykwnXI%lpD5ex-!GZSea_5;V$-5+Sl2gvh~(5jK33@Q zceoRWVx@`H-Ax_m7jKUsQLZ9OIosetCJ*|f5fVyMO0ZtCzs|eqjE!IqO~w3PVsD zj3lY>dC_S0H2QQ-L?ZPczP$hI+yo(Roj6Ng~)C6%50{lm>||$* zFtgr8BzXOClf-rg)*zPbQcxaNjNDvE>76vBr^@<&b0M@gfZ>bF#14|BW~Zy=?B?i* zE>m=j1Rp*o78^emBsfCQMb~MJPrlb^HO$X+s3I9}V&Kd_sU9S?bH0;Dz_>jodv;*p zPoj(cF~9mlh=Ews4j%VAo{kgf{NbI4TeU4t@X`6@_)m(%b3=VUUP<-Xw)CD&{SS^0 zEP2GGXPDzEd_Sxy6>bD)w{WR#dh?^mgS$ki^3%U(dU7y`bEqr6gaoE-7*HHO6B46C z!=vPvGmNlWHZnVPQJ|E-jP8~#dSXb=7%G{tgmIKy6S`KFcKmv`7DvdQP9T;Z;bH6(H#`Af0Zt_c~(^dB|88(7% z$03@QhBU-?Bd3P;k;5!AGS!dy^Fl*FC&2E3gjum3*QJ|SrJ=|loy9#;_lSA+4f#YY z{`eN5X)*Dh(vV3UR2j42Dv30uFACeDV$b!4b0^22=+$w*e|VyIvJ;a%0lH}Wruy(^ z))*E&>MXtM1(6p+?zYc4O%(p$w^)e z8JY6-KnU>=glSwgPM~zumI=i%$0Es!jEV3W18N2jFhdAqD17&79J5N_d>D&`obvI? z@4YudL+*N}IZ~mqpNHpbpMRwSXAC3)P|{&6X0r^$$SBtyc787C|BmvvC%cT~DelPR z!&`RtgJntN4>gwZ0-Mb!8XWP*Yp?yZ<-I1w*F`3Xef;%p;^b?kD-ky)LYv4Om$gO% z+E*9~)IgTgKlNq`THVVmfee!zbMM!q=nX8B$9a1&<4t!F_)Yjx_=AaAQ(hO`93d92 zqn?TAj-1O=$>_lBZ0ck=#&DLW(n>_>*?g)JNl7#JC-?4=+8RlBf<5ROS4 zaPsk0@Hbb0U(HYpn@9nvst2V(+7Wv?uucWW5s|2sF=cC2k;z4`v&We8stui=Ou^$W z?6y(n2d4Q-DzhWKej0Koe7eqT^-v+530OLRV~XD74Ar2_I*>A_Q~CS)$k)mS^K87q zrem-c`h~0B?&q*4BCuS32I#V4`iL>>kV|}@RX0MNgOb1N$|-+-8SUrS%?cQ8Y8h1Z zf-hr7sIg{_*&lD;o|p#|E>hQxoac#K6^;P#hOuv+$-o*}PqpEMU}SJiw$Fi&bXlb8 z_gVVTF4JYCk0r*6i>&Z2>@4&?%~eP-g7{m2;Xz0wI4${1zU$_CCmcODwb{7HZ5wlO zWJLg~zaYRz&$xGHFBcp_gzNZRPQx!RZ%OMXpcrkvo7@jy)K6`HWo2LApT`Cj(P8zK;Lk`9s+Z$P-KPqWb`1kz$7TSlC&TkXdgho z0FMve;kTgOx{D7l5ze!8&c!tT8WeWk_qmGexL-0j{+yt{iGSPga>1~RTA^N-SVfFE zyErR(Q!`_I##uwvZ=}~@fI!JCoWckJb_^3H_e%gN#u>5N9K^EID$Je0g8%g)(bB|LfK2K#Te(y}A9QFI!UWJ$2ghp_r=j3zYWH5y$>8nEN?5ZTW7Z1i9f}S=r z1G7*{J|zstH)%?7S0+|mJJ5|^^^Fc!std5fMwZ<(Kp{z#)94OMkoi)fjHIqn4|D4K znQw2+JQKos7EsX(`|uRcj1f7lk$i*VMMvC2eP%7Gt*`!$8(lrOf8voGIe@fvk?STtCVoV zLkt*E1V_}y*c+pwyhg=p!f)Up5D}aveCP-RLjEAd?p^m$G0Mo!c}yUTyeRzYrEYzE zY*_dzB=4bqiY>oT;FJ4iFx?C65fu6(66;ntpKdrOrkC7j7{4KDdH)rP3arV~nX$Y# zrd6}Q`(|E+b;lFc{ls4eFTgXqdrtj#D>q3+Tu5L^5K(3gbS^U-TNT`shWyI)JB6h| zO`tMrLp9J2u{LW?MY4scC{89sSh{$(3kHLpAtcKm1Bpl$024MU$S`qcJA2Nk6g3Yt zhMT1xmd{o(;ISi`%?ZFl3Cr0kTTHJ&y8s@EOGIzcnVH$4S(3H<`(c-VaoEW4` zz#~SQebvxhF*GzuO)5!*T;uhz#qgG`1cFvJT|6w&o^4hMag3<qYiRpb5q1QI5PReXYY>)$b2^N{XvCXX&kayn!MF$vc9k2Ged(mb00Mt71 zI}0*b2%pGbTv+?}P;F@ef_}rzs)d|@1PszGV$85}ivX&Y2z$^G;*gA0jPpTm2{V-4 zU>;vD233h5fK);gjnbSjJ!&{OA=Q_PJWyDJ9QF<;U~UTqc2mdKj7oo^W|m8E0Qb-S zL2YAMA~>ak`Z%Xb_cggX`67cM@t2STN5Ew-QVOHxjxvX1IR?ie&VGi8O?)vKc!_d^ z!SYjqItG1G3qpLrH(vC;MwA5PWdf~d_Pod; z29q*8`o{iwZ0HF8+;>QLLC_B8buk&W#7?pK8%f`1@8L$QhWfqR-G#=MTVl{<*{cmG zSpL$JNeh8-n(CKf9P2wbkc*X^9(bZd%wu*!D^0FV-Iv@+BpuV-<5C;Oj|Coe#Zg5f#(O>~E(MBqSm8A*IDIVK)W1Mb%(Wo6Z zZ*~ZML+QEsO}C(Du&*8RT81F?HsIKI_ms}=DvXO5-D=@vMzuRtB>4Y0!%F(qJCw-M zJR&`d$PjROm74>^qYsoj^G?VP1ojXu_ofKN2h4<6PR9vnMCShpD0|nHv302zj^4y} zerfN-j8Y1Y>-Y^+2<-i$Wi{R3c`*;_*n!>Eq8|Q9<#SIy&Gqxkv~{2Hcg=CC82CO1 z>D2W?Hp^^S))e2=Ct^EwVe-i9dR=A&KmxT6K|1|B;pBSG*H-Py3Q;=>aZd?|xR)HT zgu%6Zgi^4hsWHKWFdfNdze{7;SQeopO?7w6h%`gL`dySuK`UPL)nCW9>(JU3Qo~Ecw14>5@j+R+V;VhrN-}Z;#@gC)uzD5WHj~ktafn*Gd(@K zkP4Hs3P=>bKz16a$2zg*y&npFIc0ZdJCR4EE{XMf#!i=$`)W(ZPHQXRvHROu7F3O1 zC4i9<_UF|6opQ*2ed{U1bK+R6@rak`5paj?;jieq3a!T%eVwv;8^46E%3nQsXo1$E zpS4|@6<}2FDl|Imo)4i-MMLQg9?9LQ=(A*CX~(lGlM98ggD00 zfYJeKdW)fq!1fIqcIIED9>QV-9X+z9ggz+vN)Hp!sdb!Z3w}LEN@piBWRkj`9cbc5 zR+Qgc2c&gJoLz8oDN7E%`$1ZJD3p?hnv=dK0LrUtdcg*1xlIw=PU1&Xn|gVZpQzH! zjNskGTA6yb)#V0i=KKsIxwy@cn_p7s07s%yhI@cdAiH|0UnpP2Kj^>NX z9pAGmlR&D@&A@mUo+R5U3s56plgw)6-2f{tkqo)+B z3-*K1rFTVf5kQF}SgbJ*jparp%d^sZz-YJA{(O z`VJ=C10`hI`my_8LIkHtvIL7XfHT;!6?f)L@zlJ>pqJm>(m{x35$3xd9{G76`>&85 zxgFW>_(vVMT?@GonnfS`*HHO^d3q!K1trB8X6J%F_9KD^DenhHSPO;IYk^lvyZbkK z=PaUhV^Q*H?j|lWod~WQQShnIZ#(c&&|KN5=7f#eaUpW}V}~0q<(9e(ZJ>If zgLNeKPkxpQLHQp&$^g>!9c?D$n~u=!^6Rg9UO$C%hke@6eg=2yb`8?#wI`ea&U~Qa zg4i-52nw4s=F_mSeW)wfxYKb8>qkbUL82*<-1dw$SXpgl1&w^l2K$T5a79cEmY|%! z5QvfX8L1sc(um8*b}*i-XF3(9llxDZ+8Y{DwtM05=$9oBCpB0IH;pV@>E8wSrH}kv zjFwvBb7GG#>M(I7kZD1BI|gW#`tVKYYQar&f9Jif6-i6NJ6#MA54gb^v-eB{$&4AJ zl6@}U*g)6wag#1QD2)e%eP1UJYYV^c?V4k%d(K32O*JX`CxRj;V$?TE$r(3@)G<@+ z9DWR}lwF2D3M>9hnebpYIwmR_K0B*Wie0;)$&Sq%uKU!QKyPp@(303YvzRggtErkL z)7xfOHxhg7ZK&MmKeE`(}VHt04^kU5fCa(ns!pF&h zhVXT_KYjsb$OTNM9Q?A;1daJKG1}`qT)ccam8`x4{M_QYnux$O|I8KIWDftcUy8;V z1H2}`zl?T(H%(6+%J48%iXXH&EF!!M^L!aj`1~nr$lYdXL3G;^FxFJ+7ii(1$&V?s?B_ z%da*d-WQp9xVC=ZLRQCcku|SQc>;RA4krs%bjPxF z@9W1pbIXxEUK^_m+e2nk!@)F`Su&s_t`iySqJU|{Mn?IwnuG@{Dj6m6u1v9IFB>rG zwDc)(5n&^>x1NSfd$yFU&jIgS1@11BfkFXGxqYM3--w0-MFP7?k)K8ijnf3hVi^Z5 zd;B?PSff9a)p^;Ls%K<%!gvfucJx%z*p`SJ!9bZDr?KSnv!&WIcjGLqaCB@k3kjjvYqe5ZJ3G(mp4Au#OPR89#$-9i5RcF-rg7S#NjeL6 z;%mJmwrs$KAyJ~bClP4T%^o&{!ePpCdI-T+ria=G2WmML)}Jb4l3Sa1 z9S=5Jv~%cYO?l1IpiTETfY@xfkq+^qKNKsmxWf<;x4&p1C6;5_JX0phbouMeNS_7j z1K-5W)dXxme3cS;Rp9y~C7~*LuCBOBX`HF_!z4@a7diK7F5~LQk*_2*f^|sgDYQkl z10~Wa9f1T=#Q+kA0*&&Bm(UP+&`%K}(9N4Ky-AYRpa;QSg5=;Vwo{XH7U_~r0uj%& ztkR3BkdsMYr$h+x$dlyir;q?F*{EN9L!G1aTbR-(tC$ZO-;u63JkJ#i#r9v!YT`+v zGbNrB;_?m$TuU70nW>519ht@<&!BlyPldfs)Zg)f29T@ZV#q^Y&<@INsb X{s0vkKK?KU0ihtHD%~h)9`^qMzf|}` literal 0 HcmV?d00001 diff --git a/assets/images/map_markers/source_map_marker.png b/assets/images/map_markers/source_map_marker.png new file mode 100644 index 0000000000000000000000000000000000000000..4b493b097b087a641bfbadb013f4a59935c7f394 GIT binary patch literal 5311 zcmV;w6hP~VP)KLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uhf59&ghTmgWD0l;*T zI709Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKvYIYoh62rY33S640`D9%Y2D-rV&neh&#Q1i z007~1e$oCcFS8neI|hJl{-P!B1ZZ9hpmq0)X0i`JwE&>$+E?>%_LC6RbVIkUx0b+_+BaR3cnT7Zv!AJxW zizFb)h!jyGOOZ85F;a?DAXP{m@;!0_IfqH8(HlgRxt7s3}k3K`kFu>>-2Q$QMFfPW!La{h336o>X zu_CMttHv6zR;&ZNiS=X8v3CR#fknUxHUxJ0uoBa_M6WNWeqIg~6QE69c9o#eyhGvpiOA@W-aonk<7r1(?fC{oI5N*U!4 zfg=2N-7=cNnjjOr{yriy6mMFgG#l znCF=fnQv8CDz++o6_Lscl}eQ+l^ZHARH>?_s@|##Rr6KLRFA1%Q+=*RRWnoLsR`7U zt5vFIcfW3@?wFpwUVxrVZ>QdQz32KIeJ}k~{cZZE^+ya? z2D1z#2HOnI7(B%_ac?{wFUQ;QQA1tBKtrWrm0_3Rgps+?Jfqb{jYbcQX~taRB;#$y zZN{S}1|}gUOHJxc?wV3fxuz+mJ4`!F$IZ;mqRrNsHJd##*D~ju=bP7?-?v~|cv>vB zsJ6IeNwVZxrdjT`yl#bBIa#GxRa#xMMy;K#CDyyGyQdMSxlWT#tDe?p!?5wT$+oGt z8L;Kp2HUQ-ZMJ=3XJQv;x5ci*?vuTfeY$;({XGW_huIFR9a(?@3)XSs8O^N5RyOM=TTmp(3=8^+zpz2r)C z^>JO{deZfso3oq3?Wo(Y?l$ge?uXo;%ru`Vo>?<<(8I_>;8Eq#KMS9gFl*neeosSB zfoHYnBQIkwkyowPu(zdms`p{<7e4kra-ZWq<2*OsGTvEV%s0Td$hXT+!*8Bnh2KMe zBmZRodjHV?r+_5^X9J0WL4jKW`}lf%A-|44I@@LTvf1rHjG(ze6+w@Jt%Bvjts!X0 z?2xS?_ve_-kiKB_KiJlZ$9G`c^=E@oNG)mWWaNo-3TIW8)$Hg0Ub-~8?KhvJ>$ z3*&nim@mj(aCxE5!t{lw7O5^0EIO7zOo&c6l<+|iDySBWCGrz@C5{St!X3hAA}`T4 z(TLbXTq+(;@<=L8dXnssyft|w#WSTW<++3>sgS%(4NTpeI-VAqb|7ssJvzNHgOZVu zaYCvgO_R1~>SyL=cFU|~g|hy|Zi}}s9+d~lYqOB71z9Z$wnC=pR9Yz4DhIM>Wmjgu z&56o6maCpC&F##y%G;1PobR9i?GnNg;gYtchD%p19a!eQtZF&3JaKv33gZ<8D~47E ztUS1iwkmDaPpj=$m#%)jCVEY4fnLGNg2A-`YwHVD3gv};>)hAvT~AmqS>Lr``i7kw zJ{5_It`yrBmlc25DBO7E8;5VoznR>Ww5hAaxn$2~(q`%A-YuS64wkBy=9dm`4cXeX z4c}I@?e+FW+b@^RDBHV(wnMq2zdX3SWv9u`%{xC-q*U}&`cyXV(%rRT*Z6MH?i+i& z_B8C(+grT%{XWUQ+f@NoP1R=AW&26{v-dx)iK^-Nmiuj8txj!m?Z*Ss1N{dh4z}01 z)YTo*JycSU)+_5r4#yw9{+;i4Ee$peRgIj+;v;ZGdF1K$3E%e~4LaI(jC-u%2h$&R z9cLXcYC@Xwnns&bn)_Q~Te?roKGD|d-g^8;+aC{{G(1^(O7m37Y1-+6)01cN&y1aw zoqc{T`P^XJqPBbIW6s}d4{z_f5Om?vMgNQEJG?v2T=KYd^0M3I6IZxbny)%vZR&LD zJpPl@Psh8QyPB@KTx+@RdcC!KX7}kEo;S|j^u2lU7XQ}Oo;f|;z4Ll+_r>@1-xl3| zawq-H%e&ckC+@AhPrP6BKT#_XdT7&;F71j}Joy zkC~6lh7E@6o;W@^IpRNZ{ptLtL(gQ-CY~4mqW;US7Zxvm_|@yz&e53Bp_lTPlfP|z zrTyx_>lv@x#=^!PzR7qqF<$gm`|ZJZ+;<)Cqu&ot2z=0000WV@Og>004R=004l4008;_004mL004C`008P>0026e000+nl3&F} z000T60K;Nf=WQ65DZ#Y{z%G5z)B~G9L6x=5(HscZg#T^GdnY#Ke{37 zvS)X{K4#`y)wNZ-+x>p;ecpZio}{WOW+X=y98fVZ1Q@FSEC+ftdjRU2J*RGzr)NJncmLWjCn)dd_^zLqmg>ot?+^IP}j}P&0vDz)g5x5n!htr>p|? z2(St0N%p7|*d#}lhqDFLGGLVp$81)m--~ioS?YCAF9AO%`}GSss=VY?P`?BglRH{0 zN0pe@KrI1&Lhk9Oa#VTLE1>2A&yl-&UXChr-43b>SdGKeEe=ZpR?AW42DgIh2CV1* z3wOD!9>4}Usua2r)USXsc}7<>Mo$x0ftmz7m}hg99+IPqCG(k*1$!m}Xp@zW%q%}R zrIIDn+n;tj-~i@P~-A?bvP9|Pm!u}IqK67@YCoc^!s9qRCZ!l3}YN*r7N8>Od_ zb5)-lReAzXI9azer8`$6BvY!BW-gVZO4!T?0v42}65(B_ZUMR#_>fxZ^cMv?m)Clg z1UcK#bk*-Os>=Ds6sfdOkR^IrJ!yLzB}bL+XghXFMaAy6QRU1TSHa+lB8m(BND{O( zw zn?0D@$M>@Ao5h9xHviT$6kzDJA#NR6#**LfW7m;-5z#8sd&Vp6ZlfL&mGu@)uCx?V zXVt4D$jbRulol5V>!jM+nUJH(Bw(s!b#UT*6LpuF6530!ZOJXa#S(22ij=W zcekjR+%lq!a466+V+e)Qa{u_Ou@$WOpoU~BBOkFBu16t&C< z1IvrJX^^na?0h+@6bJ_ed=Wb0?5DNO4F``V==WiAYN{%Wa;LAd? zm|RL(_X6CcZ;dG@;1^QFBVApq>S~D^hPEZyQb`ib8CT&rn3g4YSf66PG(bqFq7d!0 zq%crJMOZzoPcdWr_i#X_zzcT{W!wO7Y*-2f{Y)EP%H$zomc4U`jUSz~; zexJnB*@HX-skwpyA5Y90#OQuKvLDpMsxV)dOYy1#eu?|5D{TkW)vB+XS?j8Ygge#a zakGVMdi*UAnRw+wDOYlmvh zK9~lPpw5}KPF2ZE(^-+AYV+x9nU0DCbwq^4ZW-L#Y{x;7y}rGo6G@ILj)Jq%j)Njg z)IYNzhy!>$oDVsuUOcDQo8xM{Qk_WGaJClBmCwG85eHcr3EtPEgMq zdGV=t598OlWHPW~eihS(x4u5L=Xe8)*6cx5Y4x{!b^h!N^Ny zD%)RMVRgGDMY69w^K}rG&l+1kjK?B-?FRK4aLP0&gMYJH9dWQI&n!2bk&M0=k3|w_ ze!)$ty{a#jv2XFJy+dmm6`InftG!Qww`>R1tok$M4&^^JZ7+20uWhsq)Zx>Y+H_%1 zdm+K8degfQo-^aU#T2M`EK&pf*338F-gSzjXRn@3IoFutHRXhDpbnkB$cF8$uZynv zpoWHosWJW;H1~MMt7Z#)A@u8w4)s@T~T|sGafaB*Ays@p8H@BHy*nT`7i#+QzD9}8T{EWQXYMX}ZZMyMZsYS*- z3!Ka|X;qJzg=8hDdK`9Mx~R8Tby)&xG4N-*0<-%j&;2?quMdWw0baE;KqszT{R^-VZK}nK zT8{(wH#&7U?mD!qyuGHs0}GtUWKLdUyc~nuq8-vfU>0!6iNKw{ZTg46n;w947Pt*K z?UVsdgHq8v>%Z?}NC{w$KCmTML4md`G8@?KLP$xym%7DiLwqhtkUHR2;INAzHKAQ? z@va+;@wq5rYS0eHxdB!R_%`siTN1}jpg_Cftr|Gwpbcr@E?}dZ62@(yK=Zd$jkd$o zZe{e&&3d;biW@%?S zI)!%G)@H9n-b#cT5N(Sw)!hLvrLrpe-0?jG$ z1Ymo!-!-5u_^r%_2xbc?(3VLiqj~Q-s+Y2NvL$i>vP&0%`9Rpq?NMv`-vA#uir2W- R8VCRY002ovPDHLkV1k@%_;3IK literal 0 HcmV?d00001 diff --git a/lib/config/config.dart b/lib/config/config.dart index 4315f13c..795da85b 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -12,8 +12,8 @@ const EXA_CART_API_BASE_URL = 'https://mdlaboratories.com/exacartapi'; const PACKAGES_CATEGORIES = '/api/categories'; const PACKAGES_PRODUCTS = '/api/products'; -// const BASE_URL = 'https://uat.hmgwebservices.com/'; -const BASE_URL = 'https://hmgwebservices.com/'; +const BASE_URL = 'https://uat.hmgwebservices.com/'; +// const BASE_URL = 'https://hmgwebservices.com/'; //const BASE_PHARMACY_URL = 'http://swd-pharapp-01:7200/api/'; const BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 387dbcb1..b103825c 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -1449,4 +1449,9 @@ const Map localizedValues = { "en": "View List of Children", "ar": "عرض قائمة الأطفال" }, + + "trackDeliveryDriver": { + "en": "Track Delivery Driver", + "ar": "trackDeliveryDriver" + }, }; diff --git a/lib/core/model/pharmacies/order_model.dart b/lib/core/model/pharmacies/order_model.dart index 027d1f81..c0a12caa 100644 --- a/lib/core/model/pharmacies/order_model.dart +++ b/lib/core/model/pharmacies/order_model.dart @@ -2,6 +2,7 @@ import 'dart:convert'; import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyImageObject.dart'; +import 'package:google_maps_flutter/google_maps_flutter.dart'; List orderModelFromJson(String str) => List.from(json.decode(str).map((x) => OrderModel.fromJson(x))); @@ -306,7 +307,22 @@ class IngAddress { String customerAttributes; DateTime createdOnUtc; dynamic province; - LatLong latLong; + String latLong; + + LatLng getLocation(){ + if(latLong.contains(',')){ + var parts = latLong.trim().split(','); + if(parts.length == 2){ + var lat = double.tryParse(parts.first); + var lng = double.tryParse(parts.last); + if(lat != null || lng != null) { + var location = LatLng(lat, lng); + return location; + } + } + } + return null; + } factory IngAddress.fromJson(Map json) => IngAddress( id: json["id"], @@ -326,7 +342,7 @@ class IngAddress { customerAttributes: json["customer_attributes"], createdOnUtc: DateTime.parse(json["created_on_utc"]), province: json["province"], - latLong: latLongValues.map[json["lat_long"]], + latLong: json["lat_long"], ); Map toJson() => { @@ -347,7 +363,7 @@ class IngAddress { "customer_attributes": customerAttributes, "created_on_utc": createdOnUtc.toIso8601String(), "province": province, - "lat_long": latLongValues.reverse[latLong], + "lat_long": latLong, }; } @@ -491,9 +507,9 @@ class OrderModelCustomer { isSystemAccount: json["is_system_account"], systemName: json["system_name"], lastIpAddress: lastIpAddressValues.map[json["last_ip_address"]], - createdOnUtc: DateTime.parse(json["created_on_utc"]), - lastLoginDateUtc: DateTime.parse(json["last_login_date_utc"]), - lastActivityDateUtc: DateTime.parse(json["last_activity_date_utc"]), + createdOnUtc: (json["created_on_utc"] != null) ? DateTime.parse(json["created_on_utc"]) : null, + lastLoginDateUtc: (json["created_on_utc"] != null) ? DateTime.parse(json["last_login_date_utc"]) : null, + lastActivityDateUtc: (json["created_on_utc"] != null) ? DateTime.parse(json["last_activity_date_utc"]) : null, registeredInStoreId: json["registered_in_store_id"], roleIds: List.from(json["role_ids"].map((x) => x)), ); diff --git a/lib/pages/pharmacy/order/Order.dart b/lib/pages/pharmacy/order/Order.dart index 576bf2a0..5bb4ea42 100644 --- a/lib/pages/pharmacy/order/Order.dart +++ b/lib/pages/pharmacy/order/Order.dart @@ -924,6 +924,7 @@ class _OrderPageState extends State with SingleTickerProviderStateMix } Widget getCancelledOrder(OrderModelViewModel model){ + for(int i=0 ; i< model.order.length; i++){ if( model.order[i].orderStatusId == 40 || model.order[i].orderStatusId == 996 || model.order[i].orderStatusId == 200){ @@ -1136,13 +1137,17 @@ class _OrderPageState extends State with SingleTickerProviderStateMix ), ), ); - } + int test = Test()["1"]; + } } - - - - - +class Test{ + static const values = { + "1":1, + "2":2, + "3":3 + }; + int operator [](String key) => values[key]; +} \ No newline at end of file diff --git a/lib/pages/pharmacy/order/OrderDetails.dart b/lib/pages/pharmacy/order/OrderDetails.dart index 5438663d..d5d064a7 100644 --- a/lib/pages/pharmacy/order/OrderDetails.dart +++ b/lib/pages/pharmacy/order/OrderDetails.dart @@ -1,6 +1,7 @@ import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/order_model_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/pharmacy/order/Order.dart'; +import 'package:diplomaticquarterapp/pages/pharmacy/order/TrackDriver.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; @@ -46,6 +47,7 @@ class _OrderDetailsPageState extends State { var model; var isCancel = false; var isRefund = false; + var isActiveDelivery = true; var dataIsCancel; var dataIsRefund; @@ -105,9 +107,9 @@ class _OrderDetailsPageState extends State { color: getStatusBackgroundColor(), borderRadius: BorderRadius.circular(30.0)), child: Text( - languageID == "ar" - ? widget.orderModel.orderStatusn.toString(): - widget.orderModel.orderStatus.toString().substring(12) , + languageID == "ar" + ? widget.orderModel.orderStatusn.toString(): + widget.orderModel.orderStatus.toString().substring(12) , // TranslationBase.of(context).delivered, style: TextStyle( color: Colors.white, @@ -125,8 +127,8 @@ class _OrderDetailsPageState extends State { children: [ Text( widget.orderModel.shippingAddress.firstName - .toString() - .substring(10) + + .toString() + .substring(10) + ' ' + widget.orderModel.shippingAddress.lastName .toString() @@ -141,18 +143,18 @@ class _OrderDetailsPageState extends State { Container( margin: EdgeInsets.fromLTRB(10.0, 5.0, 1.0, 5.0), child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - widget.orderModel.shippingAddress.address1 - .toString() - .substring(9), - style: TextStyle( - fontSize: 10.0, - fontWeight: FontWeight.bold, - color: Colors.grey, - ), - ),] + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + widget.orderModel.shippingAddress.address1 + .toString() + .substring(9), + style: TextStyle( + fontSize: 10.0, + fontWeight: FontWeight.bold, + color: Colors.grey, + ), + ),] ), ), Container( @@ -162,8 +164,8 @@ class _OrderDetailsPageState extends State { children: [ Text( widget.orderModel.shippingAddress.address2 - .toString() - .substring(9) + + .toString() + .substring(9) + ' ' + widget.orderModel.shippingAddress.country .toString() + @@ -231,7 +233,7 @@ class _OrderDetailsPageState extends State { Container( child: flutterImage.Image.asset( widget.orderModel.shippingRateComputationMethodSystemName != - "Shipping.Aramex" + "Shipping.Aramex" ? "assets/images/pharmacy_module/payment/LogoParmacyGreen.png" : "assets/images/pharmacy_module/payment/aramex_shipping_logo.png", fit: BoxFit.contain, @@ -320,19 +322,19 @@ class _OrderDetailsPageState extends State { physics: ScrollPhysics(), itemCount:widget.orderModel.orderItems.length, itemBuilder: (context, index){ - return Container( - child: productTile(productName: widget.orderModel.orderItems[index].product.name.toString(), - productPrice: widget.orderModel.orderItems[index].product.price.toString(), - productRate: widget.orderModel.orderItems[index].product.approvedRatingSum.toDouble(), - productReviews:widget.orderModel.orderItems[index].product.approvedTotalReviews, - totalPrice: "${(widget.orderModel.orderItems[index].product.price - * widget.orderModel.orderItems[index].quantity).toStringAsFixed(2)}", - qyt: widget.orderModel.orderItems[index].quantity.toString(), - isOrderDetails:true, - imgs: widget.orderModel.orderItems[index].product.images != null && - widget.orderModel.orderItems[index].product.images.length != 0 - ? widget.orderModel.orderItems[index].product.images [0].src.toString() - : null, + return Container( + child: productTile(productName: widget.orderModel.orderItems[index].product.name.toString(), + productPrice: widget.orderModel.orderItems[index].product.price.toString(), + productRate: widget.orderModel.orderItems[index].product.approvedRatingSum.toDouble(), + productReviews:widget.orderModel.orderItems[index].product.approvedTotalReviews, + totalPrice: "${(widget.orderModel.orderItems[index].product.price + * widget.orderModel.orderItems[index].quantity).toStringAsFixed(2)}", + qyt: widget.orderModel.orderItems[index].quantity.toString(), + isOrderDetails:true, + imgs: widget.orderModel.orderItems[index].product.images != null && + widget.orderModel.orderItems[index].product.images.length != 0 + ? widget.orderModel.orderItems[index].product.images [0].src.toString() + : null, status: widget.orderModel.orderStatusId, product: widget.orderModel.orderItems[index].product, ), @@ -510,58 +512,81 @@ class _OrderDetailsPageState extends State { ), widget.orderModel.orderStatusId == 10 ? InkWell( - onTap: () { - model.makeOrder(); - }, - child: Container( + onTap: () { + model.makeOrder(); + }, + child: Container( // margin: EdgeInsets.only(top: 20.0), - height: 50.0, - color: Colors.transparent, - child: Container( - padding: EdgeInsets.only(left: 130.0, right: 130.0), - decoration: BoxDecoration( - border: Border.all( - color: Colors.green, - style: BorderStyle.solid, - width: 4.0), - color: Colors.green, - borderRadius: BorderRadius.circular(5.0)), - child: Center( - child: Text( - TranslationBase.of(context).payOnline, - style: TextStyle( - color: Colors.white, - fontWeight: FontWeight.bold, - ), - ), - ), + height: 50.0, + color: Colors.transparent, + child: Container( + padding: EdgeInsets.only(left: 130.0, right: 130.0), + decoration: BoxDecoration( + border: Border.all( + color: Colors.green, + style: BorderStyle.solid, + width: 4.0), + color: Colors.green, + borderRadius: BorderRadius.circular(5.0)), + child: Center( + child: Text( + TranslationBase.of(context).payOnline, + style: TextStyle( + color: Colors.white, + fontWeight: FontWeight.bold, ), ), - ) + ), + ), + ), + ) : Container(), // getCancelOrder(canCancel, canRefund), isCancel ? InkWell( - onTap: () { - presentConfirmDialog(model, - widget.orderModel.id); //(widget.orderModel.id)); + onTap: () { + presentConfirmDialog(model, + widget.orderModel.id); //(widget.orderModel.id)); // - }, - child: Container( + }, + child: Container( // padding: EdgeInsets.only(left: 13.0, right: 13.0, top: 5.0), - height: 50.0, - color: Colors.transparent, - child: Center( - child: Text( - TranslationBase.of(context).cancelOrder, - style: TextStyle( - color: Colors.red[900], - fontWeight: FontWeight.bold, - decoration: TextDecoration.underline), - ), - ), - ), - ) + height: 50.0, + color: Colors.transparent, + child: Center( + child: Text( + TranslationBase.of(context).cancelOrder, + style: TextStyle( + color: Colors.red[900], + fontWeight: FontWeight.bold, + decoration: TextDecoration.underline), + ), + ), + ), + ) + : Container(), + isActiveDelivery + ? InkWell( + onTap: () { + Navigator.push( + context, + MaterialPageRoute(builder: (context) => TrackDriver(order: widget.orderModel), + )); + }, + child: Container( + height: 50.0, + color: Colors.transparent, + child: Center( + child: Text( + TranslationBase.of(context).trackDeliveryDriver, + style: TextStyle( + color: Colors.green[900], + fontWeight: FontWeight.normal, + decoration: TextDecoration.none), + ), + ), + ), + ) : Container(), ], ), diff --git a/lib/pages/pharmacy/order/TrackDriver.dart b/lib/pages/pharmacy/order/TrackDriver.dart new file mode 100644 index 00000000..b9a8056f --- /dev/null +++ b/lib/pages/pharmacy/order/TrackDriver.dart @@ -0,0 +1,211 @@ +import 'dart:async'; + +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/core/model/pharmacies/order_model.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_polyline_points/flutter_polyline_points.dart'; +import 'package:google_maps_flutter/google_maps_flutter.dart'; +import 'package:location/location.dart'; + + +class TrackDriver extends StatefulWidget { + final OrderModel order; + TrackDriver({this.order}); + + @override + State createState() => _TrackDriverState(); +} + +class _TrackDriverState extends State { + OrderModel _order; + + Completer _controller = Completer(); + + + double CAMERA_ZOOM = 16; + double CAMERA_TILT = 0; + double CAMERA_BEARING = 30; + LatLng SOURCE_LOCATION = null; + LatLng DEST_LOCATION = null; + + // for my drawn routes on the map + Set _polylines = Set(); + List polylineCoordinates = []; + PolylinePoints polylinePoints; + + Set _markers = Set(); + + BitmapDescriptor sourceIcon; // for my custom marker pins + BitmapDescriptor destinationIcon; // for my custom marker pins + Location location;// wrapper around the location API + + @override + void initState() { + _order = widget.order; + DEST_LOCATION = _order.shippingAddress.getLocation(); + location = new Location(); + polylinePoints = PolylinePoints(); + setSourceAndDestinationIcons(); + } + + @override + Widget build(BuildContext context) { + return new Scaffold( + body: GoogleMap( + myLocationEnabled: true, + compassEnabled: true, + markers: _markers, + polylines: _polylines, + mapType: MapType.normal, + initialCameraPosition: _orderDeliveryLocationCamera(), + onMapCreated: (GoogleMapController controller) { + _controller.complete(controller); + showPinsOnMap(); + }, + ), + floatingActionButton: FloatingActionButton.extended( + onPressed: _goToDriver, + label: Text('To the lake!'), + icon: Icon(Icons.directions_boat), + ), + ); + } + + + void setSourceAndDestinationIcons() async { + sourceIcon = await BitmapDescriptor.fromAssetImage( + ImageConfiguration(devicePixelRatio: 2.5), + 'assets/images/map_markers/source_map_marker.png'); + + destinationIcon = await BitmapDescriptor.fromAssetImage( + ImageConfiguration(devicePixelRatio: 2.5), + 'assets/images/map_markers/destination_map_marker.png'); + } + + CameraPosition _orderDeliveryLocationCamera(){ + + final CameraPosition orderDeliveryLocCamera = CameraPosition( + bearing: CAMERA_BEARING, + target: DEST_LOCATION, + tilt: CAMERA_TILT, + zoom: CAMERA_ZOOM); + return orderDeliveryLocCamera; + } + + CameraPosition _driverLocationCamera(){ + final CameraPosition driverLocCamera = CameraPosition( + bearing: CAMERA_BEARING, + target: SOURCE_LOCATION, + tilt: CAMERA_TILT, + zoom: CAMERA_ZOOM); + return driverLocCamera; + } + + + Future _goToOrderDeliveryLocation() async { + final GoogleMapController controller = await _controller.future; + final CameraPosition orderDeliveryLocCamera = _orderDeliveryLocationCamera(); + controller.animateCamera(CameraUpdate.newCameraPosition(orderDeliveryLocCamera)); + } + + Future _goToDriver() async { + final GoogleMapController controller = await _controller.future; + final CameraPosition driverLocCamera = _driverLocationCamera(); + controller.animateCamera(CameraUpdate.newCameraPosition(driverLocCamera)); + } + + + Future _fitCameraBetweenBothPoints() async { + final GoogleMapController controller = await _controller.future; + final CameraPosition driverLocCamera = CameraPosition( + bearing: CAMERA_BEARING, + target: SOURCE_LOCATION, + tilt: CAMERA_TILT, + zoom: CAMERA_ZOOM); + controller.animateCamera(CameraUpdate.newCameraPosition(driverLocCamera)); + } + + void showPinsOnMap() { + // source pin + if(SOURCE_LOCATION != null){ + setState(() { + var pinPosition = SOURCE_LOCATION; + _markers.add(Marker( + markerId: MarkerId('sourcePin'), + position: pinPosition, + icon: sourceIcon + )); + }); + } + + // destination pin + if(DEST_LOCATION != null){ + setState(() { + var destPosition = DEST_LOCATION; + _markers.add(Marker( + markerId: MarkerId('destPin'), + position: destPosition, + icon: destinationIcon + )); + }); + } + // set the route lines on the map from source to destination + // for more info follow this tutorial + // drawRoute(); + } + + void updatePinOnMap() async { + // create a new CameraPosition instance + // every time the location changes, so the camera + // follows the pin as it moves with an animation + CameraPosition cPosition = CameraPosition( + zoom: CAMERA_ZOOM, + tilt: CAMERA_TILT, + bearing: CAMERA_BEARING, + target: SOURCE_LOCATION, + ); + final GoogleMapController controller = await _controller.future; + controller.animateCamera(CameraUpdate.newCameraPosition(cPosition)); + // do this inside the setState() so Flutter gets notified + // that a widget update is due + setState(() { + // updated position + var pinPosition = SOURCE_LOCATION; + + // the trick is to remove the marker (by id) + // and add it again at the updated location + _markers.removeWhere((m) => m.markerId.value == 'sourcePin'); + _markers.add(Marker( + markerId: MarkerId('sourcePin'), + position: pinPosition, // updated position + icon: sourceIcon + )); + }); + } + + void drawRoute() async { + return; // Ignore draw Route + + List result = await polylinePoints.getRouteBetweenCoordinates( + GOOGLE_API_KEY, + SOURCE_LOCATION.latitude, + SOURCE_LOCATION.longitude, + DEST_LOCATION.latitude, + DEST_LOCATION.longitude); + if(result.isNotEmpty){ + result.forEach((PointLatLng point){ + polylineCoordinates.add( + LatLng(point.latitude,point.longitude) + ); + }); + setState(() { + _polylines.add(Polyline( + width: 5, // set the width of the polylines + polylineId: PolylineId('poly'), + color: Color.fromARGB(255, 40, 122, 198), + points: polylineCoordinates + )); + }); + } + } +} \ No newline at end of file diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index 63cf8a44..954af3b9 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -550,6 +550,7 @@ class TranslationBase { localizedValues['Prescriptions'][locale.languageCode]; String get history => localizedValues['History'][locale.languageCode]; String get orderNo => localizedValues['OrderNo'][locale.languageCode]; + String get trackDeliveryDriver => localizedValues['trackDeliveryDriver'][locale.languageCode]; String get orderDetails => localizedValues['OrderDetails'][locale.languageCode]; String get vitalSign => localizedValues['VitalSign'][locale.languageCode]; diff --git a/pubspec.yaml b/pubspec.yaml index 785e831d..24589cbb 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -82,7 +82,8 @@ dependencies: google_maps_flutter: ^1.0.3 - + flutter_polyline_points: ^0.1.0 + location: ^2.3.5 # Qr code Scanner barcode_scan_fix: ^1.0.2 @@ -183,6 +184,7 @@ flutter: # assets: assets: - assets/images/ + - assets/images/map_markers/ - assets/images/pharmacy/ - assets/images/medical/ - assets/images/new-design/ From 0b1014a91cddd4482e4ac8e973cb9b373b932fef Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Tue, 19 Jan 2021 14:23:42 +0200 Subject: [PATCH 27/42] fix blood sugar service on my tracker --- lib/config/config.dart | 2 + lib/config/localized_values.dart | 44 ++ .../blood_sugar/DiabtecPatientResult.dart | 2 +- .../WeekDiabtectResultAverage.dart | 2 +- .../service/medical/BloodSugarService.dart | 31 +- .../medical/blood_sugar_view_model.dart | 27 +- .../blood_suger/AddBloodSugarPage.dart | 476 +++++++++--------- .../my_trackers/blood_suger/BloodMonthly.dart | 33 +- .../my_trackers/blood_suger/BloodYeaPage.dart | 33 +- .../blood_suger/blood_sugar_home_page.dart | 19 +- .../blood_suger/blood_sugar_weekly_page.dart | 82 ++- .../medical/my_trackers/my_trackers.dart | 10 +- lib/uitl/translations_delegate_base.dart | 11 + 13 files changed, 442 insertions(+), 330 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 0c6b5d59..5bfb8d49 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -289,6 +289,8 @@ const ADD_DIABTEC_RESULT = 'Services/Patients.svc/REST/Patient_AddDiabtecResult' const GET_BLOOD_PRESSURE_RESULT_AVERAGE = 'Services/Patients.svc/REST/Patient_GetBloodPressureResultAverage'; const GET_BLOOD_PRESSURE_RESULT = 'Services/Patients.svc/REST/Patient_GetBloodPressureResult'; const ADD_BLOOD_PRESSURE_RESULT = 'Services/Patients.svc/REST/Patient_AddBloodPressureResult'; +const UPDATE_DIABETIC_RESULT = 'Services/Patients.svc/REST/Patient_UpdateDiabeticResult'; + const GET_WEIGHT_PRESSURE_RESULT_AVERAGE = 'Services/Patients.svc/REST/Patient_GetWeightMeasurementResultAverage'; const GET_WEIGHT_PRESSURE_RESULT = 'Services/Patients.svc/REST/Patient_GetWeightMeasurementResult'; diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 295a09f9..970eb78d 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -1481,4 +1481,48 @@ const Map localizedValues = { "en": "Orders Log", "ar": "سجل الطلبات" }, + "blood-sugar": { + "en": "Blood Sugar", + "ar": "سكر الدم" + }, + + "my-tracker": { + "en": "My Tracker", + "ar": "قراءاتي" + }, + "weekly": { + "en": "Weekly", + "ar": "أسبوعي" + }, + "monthly": { + "en": "Monthly", + "ar": "شهري" + }, + "yearly": { + "en": "Yearly", + "ar": "سنوي" + }, + "measured": { + "en": "Measured", + "ar": "قياس" + }, + "sugar-add": { + "en": "Enter Blood Sugar Value", + "ar": "أدخل قيمة قراءة السكر" + }, + "other": { + "en": "Other", + "ar": "آخر" + }, + "measure-unit": { + "en": "Measure unit", + "ar": "وحدة القياس" + }, + "measure-time": { + "en": "Measure time", + "ar": "وقت القياس" + },"update": { + "en": "Update", + "ar": "تعديل" + }, }; diff --git a/lib/core/model/my_trakers/blood_sugar/DiabtecPatientResult.dart b/lib/core/model/my_trakers/blood_sugar/DiabtecPatientResult.dart index 5b95409e..86263155 100644 --- a/lib/core/model/my_trakers/blood_sugar/DiabtecPatientResult.dart +++ b/lib/core/model/my_trakers/blood_sugar/DiabtecPatientResult.dart @@ -17,7 +17,7 @@ class DiabtecPatientResult { int patientID; var remark; var resultDesc; - int resultValue; + dynamic resultValue; String unit; var weekAverageResult; String weekDesc; diff --git a/lib/core/model/my_trakers/blood_sugar/WeekDiabtectResultAverage.dart b/lib/core/model/my_trakers/blood_sugar/WeekDiabtectResultAverage.dart index c18e5433..3b1a8d9c 100644 --- a/lib/core/model/my_trakers/blood_sugar/WeekDiabtectResultAverage.dart +++ b/lib/core/model/my_trakers/blood_sugar/WeekDiabtectResultAverage.dart @@ -1,7 +1,7 @@ import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; class WeekDiabtectResultAverage { - int dailyAverageResult; + dynamic dailyAverageResult; DateTime dateChart; WeekDiabtectResultAverage({this.dailyAverageResult, this.dateChart}); diff --git a/lib/core/service/medical/BloodSugarService.dart b/lib/core/service/medical/BloodSugarService.dart index 09fe9fe9..e0c5007c 100644 --- a/lib/core/service/medical/BloodSugarService.dart +++ b/lib/core/service/medical/BloodSugarService.dart @@ -69,25 +69,34 @@ class BloodSugarService extends BaseService { }, body: Map()); } - addDiabtecResult( - {String bloodSugerDateChart, - String bloodSugerResult, - String diabtecUnit, - int measuredTime}) async { + addDiabtecResult({String bloodSugerDateChart, String bloodSugerResult, String diabtecUnit, int measuredTime}) async { hasError = false; super.error = ""; - Map body = Map(); body['BloodSugerDateChart'] = bloodSugerDateChart; body['BloodSugerResult'] = bloodSugerResult; body['DiabtecUnit'] = diabtecUnit; - body['MeasuredTime'] =2;// measuredTime; + body['MeasuredTime'] = measuredTime; body['isDentalAllowedBackend'] = false; - await baseAppClient.post(ADD_BLOOD_PRESSURE_RESULT, - onSuccess: (response, statusCode) async { - var asd =""; - }, + onSuccess: (response, statusCode) async {}, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } + updateDiabtecResult({DateTime month,DateTime hour,String bloodSugerResult,String diabtecUnit, int measuredTime,int lineItemNo}) async { + hasError = false; + super.error = ""; + Map body = Map(); + body['BloodSugerResult'] = bloodSugerResult; + body['DiabtecUnit'] = diabtecUnit; + body['BloodSugerDateChart'] = '${month.year}-${month.month}-${month.day} ${hour.hour}:${hour.minute}:00'; + body['isDentalAllowedBackend'] = false; + body['MeasuredTime'] = measuredTime; + body['LineItemNo'] = lineItemNo; + await baseAppClient.post(UPDATE_DIABETIC_RESULT, + onSuccess: (response, statusCode) async {}, onFailure: (String error, int statusCode) { hasError = true; super.error = error; diff --git a/lib/core/viewModels/medical/blood_sugar_view_model.dart b/lib/core/viewModels/medical/blood_sugar_view_model.dart index fb00f80e..29cc3249 100644 --- a/lib/core/viewModels/medical/blood_sugar_view_model.dart +++ b/lib/core/viewModels/medical/blood_sugar_view_model.dart @@ -45,7 +45,6 @@ class BloodSugarViewMode extends BaseViewModel { x: index, y: bloodSugarService .monthDiabtectResultAverageList[index].weekAverageResult)); - var asd=""; } bloodSugarService.yearDiabtecResultAverageList.forEach((element) { @@ -94,11 +93,7 @@ class BloodSugarViewMode extends BaseViewModel { ]; } - addDiabtecResult( - {String bloodSugerDateChart, - String bloodSugerResult, - String diabtecUnit, - int measuredTime}) async { + Future addDiabtecResult({String bloodSugerDateChart, String bloodSugerResult, String diabtecUnit, int measuredTime}) async { setState(ViewState.BusyLocal); await bloodSugarService.addDiabtecResult( bloodSugerDateChart: bloodSugerDateChart, @@ -113,7 +108,25 @@ class BloodSugarViewMode extends BaseViewModel { setState(ViewState.Idle); } } - + + Future updateDiabtecResult({DateTime month,DateTime hour,String bloodSugerResult,String diabtecUnit, int measuredTime,int lineItemNo}) async { + setState(ViewState.BusyLocal); + await bloodSugarService.updateDiabtecResult( + bloodSugerResult: bloodSugerResult , + diabtecUnit: diabtecUnit, + hour: hour, + measuredTime: measuredTime, + lineItemNo: lineItemNo, + month: month); + if (bloodSugarService.hasError) { + error = bloodSugarService.error; + setState(ViewState.Error); + } else { + await getBloodSugar(); + setState(ViewState.Idle); + } + } + } diff --git a/lib/pages/medical/my_trackers/blood_suger/AddBloodSugarPage.dart b/lib/pages/medical/my_trackers/blood_suger/AddBloodSugarPage.dart index 00f06a25..f39479ac 100644 --- a/lib/pages/medical/my_trackers/blood_suger/AddBloodSugarPage.dart +++ b/lib/pages/medical/my_trackers/blood_suger/AddBloodSugarPage.dart @@ -3,18 +3,37 @@ import 'package:diplomaticquarterapp/core/viewModels/medical/blood_sugar_view_mo import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/medical/balance/new_text_Field.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.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'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/RadioStringDialog.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; -import 'package:feather_icons_flutter/feather_icons_flutter.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_datetime_picker/flutter_datetime_picker.dart'; import 'package:provider/provider.dart'; class AddBloodSugarPage extends StatefulWidget { + final DateTime bloodSugarDate; + final String measureUnitSelectedType; + final bool isUpdate; + final String measuredTime; + final String bloodSugarValue; + final int lineItemNo; + final BloodSugarViewMode bloodSugarViewMode; + + AddBloodSugarPage( + {Key key, + this.bloodSugarDate, + this.measureUnitSelectedType, + this.isUpdate = false, + this.measuredTime, + this.bloodSugarValue, this.lineItemNo, this.bloodSugarViewMode}) + : super(key: key); + @override _AddBloodSugarPageState createState() => _AddBloodSugarPageState(); } @@ -24,7 +43,7 @@ class _AddBloodSugarPageState extends State { DateTime bloodSugarDate = DateTime.now(); DateTime timeSugarDate = DateTime.now(); String measureUnitSelectedType = 'mg/dlt'; - int measuredTime=1; + int measuredTime = 1; final List measureUnitList = ['mg/dlt', 'mol/L']; final List measureTimeEnList = [ 'Before Breakfast', @@ -39,270 +58,229 @@ class _AddBloodSugarPageState extends State { 'Other', ]; final List measureTimeArList = [ - 'Before Breakfast', - 'After Breakfast', - 'Before Lunch', - 'After Lunch', - 'Before Dinner', - 'After Dinner', - 'Before Sleep', - 'After Sleep', - 'Fasting', - 'Other', + "قبل الإفطار", + "بعد الإفطار", + "بعد الغداء", + "بعد الغداء", + "قبل العشاء", + "بعد العشاء", + "قبل النوم", + "بعد النوم", + "صائم", + "آخر", ]; String measureTimeSelectedType; + @override + void initState() { + super.initState(); + if (widget.isUpdate) { + bloodSugarDate = widget.bloodSugarDate; + timeSugarDate = widget.bloodSugarDate; + measureUnitSelectedType = widget.measureUnitSelectedType; + if (measureTimeEnList.contains(widget.measuredTime)) + measuredTime = measureTimeEnList.indexOf(widget.measuredTime); + else if (measureTimeArList.contains(widget.measuredTime)) + measuredTime = measureTimeArList.indexOf(widget.measuredTime); + _bloodSugarValueController.text = widget.bloodSugarValue; + } + } @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); - showTaskOptions() { - showModalBottomSheet( - backgroundColor: Colors.white, - context: context, - builder: (BuildContext bc) { - return Container( - padding: EdgeInsets.symmetric(vertical: 12.0), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.only( - topLeft: Radius.circular(16.0), - topRight: Radius.circular(16.0))), - child: Column( - mainAxisSize: MainAxisSize.min, - children: [ - Container( - decoration: BoxDecoration( - color: Colors.grey[200], - borderRadius: BorderRadius.circular(3.0)), - width: 40.0, - height: 6.0, - ), - InkWell( - onTap: () { - Navigator.pop(context); - }, - child: Padding( - padding: EdgeInsets.symmetric( - horizontal: 18.0, vertical: 18.0), - child: Row( - children: [ - Icon( - FeatherIcons.share, - color: Theme - .of(context) - .primaryColor, - size: 18.0, - ), - SizedBox(width: 24.0), - Texts('Share Task', - variant: "body2Link", color: Colors.grey[800]), - ], - ), - ), - ), - InkWell( - onTap: () { - Navigator.pop(context); - // Navigator.of(context).push(SlideUpPageRoute(widget: PostTaskIndex(task: new Task(category: task?.category, description: task?.description, title: task?.title)))); - }, - child: Padding( - padding: EdgeInsets.symmetric( - horizontal: 18.0, vertical: 18.0), - child: Row( - children: [ - Icon( - FeatherIcons.copy, - color: Theme - .of(context) - .primaryColor, - size: 18.0, - ), - SizedBox(width: 24.0), - Texts('Post Similar Task', - variant: "body2Link", color: Colors.grey[800]), - ], - ), - ), + return AppScaffold( + isShowAppBar: true, + appBarTitle: widget.isUpdate + ? TranslationBase.of(context).update + : TranslationBase.of(context).add, + body: SingleChildScrollView( + physics: BouncingScrollPhysics(), + child: Container( + margin: EdgeInsets.all(15), + child: Column( + children: [ + SizedBox( + height: 15, + ), + NewTextFields( + hintText: TranslationBase.of(context).sugarAdd, + controller: _bloodSugarValueController, + keyboardType: TextInputType.number, + ), + SizedBox( + height: 8, + ), + InkWell( + onTap: () { + confirmSelectMeasureUnitDialog(); + }, + child: Container( + padding: EdgeInsets.all(12), + width: double.infinity, + height: 65, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Texts(measureUnitSelectedType), + Icon( + Icons.arrow_drop_down, + color: Colors.grey, + ) + ], ), - ], + ), ), - ); - }); - } - - return BaseView( - builder: (_, model, w) => - AppScaffold( - isShowAppBar: true, - appBarTitle: 'Add', - body: SingleChildScrollView( - physics: BouncingScrollPhysics(), - child: Container( - margin: EdgeInsets.all(15), - child: Column( - children: [ - SizedBox( - height: 15, - ), - NewTextFields( - hintText: 'Enter Blood Sugar Value', - controller: _bloodSugarValueController, - keyboardType: TextInputType.number, - ), - SizedBox( - height: 8, - ), - InkWell( - onTap: () { - confirmSelectMeasureUnitDialog(); - }, - child: Container( - padding: EdgeInsets.all(12), - width: double.infinity, - height: 65, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(12), - color: Colors.white), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Texts(measureUnitSelectedType), - Icon( - Icons.arrow_drop_down, - color: Colors.grey, - ) - ], - ), - ), - ), - SizedBox( - height: 8, - ), - InkWell( - onTap: () { - DatePicker.showDatePicker(context, - showTitleActions: true, - minTime: DateTime(DateTime - .now() - .year - 1, 1, 1), - maxTime: DateTime.now(), - onConfirm: (date) { - print('confirm $date'); - setState(() { - bloodSugarDate = date; - }); - }, - currentTime: bloodSugarDate, - locale: projectViewModel.localeType); - }, - child: Container( - padding: EdgeInsets.all(12), - width: double.infinity, - height: 65, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(12), - color: Colors.white), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Texts('Date'), - Texts(getDate()), - ], - ), - ), - ), - SizedBox( - height: 8, - ), - InkWell( - onTap: () { - DatePicker.showTimePicker( - context, showTitleActions: true, - onConfirm: (date) { - print('confirm $date'); - setState(() { - timeSugarDate = date; - }); - }, - currentTime: timeSugarDate, - locale: projectViewModel.localeType); + SizedBox( + height: 8, + ), + InkWell( + onTap: () { + DatePicker.showDatePicker(context, + showTitleActions: true, + minTime: DateTime(DateTime.now().year - 1, 1, 1), + maxTime: DateTime.now(), onConfirm: (date) { + setState(() { + bloodSugarDate = date; + }); }, - child: Container( - padding: EdgeInsets.all(12), - width: double.infinity, - height: 65, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(12), - color: Colors.white), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [Texts('Time'), Texts(getTime())], - ), - ), - ), - SizedBox( - height: 8, - ), - InkWell( - onTap: () { - confirmSelectMeasureTimeDialog(projectViewModel.isArabic - ? measureTimeEnList - : measureTimeArList); + currentTime: bloodSugarDate, + locale: projectViewModel.localeType); + }, + child: Container( + padding: EdgeInsets.all(12), + width: double.infinity, + height: 65, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Texts(TranslationBase.of(context).date), + Texts(getDate()), + ], + ), + ), + ), + SizedBox( + height: 8, + ), + InkWell( + onTap: () { + DatePicker.showTimePicker(context, showTitleActions: true, + onConfirm: (date) { + setState(() { + timeSugarDate = date; + }); }, - child: Container( - padding: EdgeInsets.all(12), - width: double.infinity, - height: 65, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(12), - color: Colors.white), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Texts(measureTimeSelectedType ?? 'Others'), - Icon( - Icons.arrow_drop_down, - color: Colors.grey, - ) - ], - ), - ), - ), - ], + currentTime: timeSugarDate, + locale: projectViewModel.localeType); + }, + child: Container( + padding: EdgeInsets.all(12), + width: double.infinity, + height: 65, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Texts(TranslationBase.of(context).time), + Texts(getTime()) + ], + ), ), ), - ), - bottomSheet: Container( - color: Colors.transparent, - width: double.infinity, - height: MediaQuery - .of(context) - .size - .width * 0.2, - child: Padding( - padding: const EdgeInsets.all(15.0), - child: SecondaryButton( - loading: model.state == ViewState.BusyLocal, - label: 'SAVE', textColor: Colors.white, onTap: () { - if (_bloodSugarValueController.text.isNotEmpty) { - model.addDiabtecResult(diabtecUnit: measureUnitSelectedType, - measuredTime: measuredTime, - bloodSugerResult:_bloodSugarValueController.text.toString(), - bloodSugerDateChart: '${bloodSugarDate.year}-${bloodSugarDate.month}-${bloodSugarDate.day} ${timeSugarDate.hour}:${timeSugarDate.minute}:00', - - ); - } - }), + SizedBox( + height: 8, + ), + InkWell( + onTap: () { + confirmSelectMeasureTimeDialog(projectViewModel.isArabic + ? measureTimeArList + : measureTimeEnList); + }, + child: Container( + padding: EdgeInsets.all(12), + width: double.infinity, + height: 65, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Texts(measureTimeSelectedType ?? + TranslationBase.of(context).other), + Icon( + Icons.arrow_drop_down, + color: Colors.grey, + ) + ], + ), + ), ), - ), + ], ), + ), + ), + bottomSheet: Container( + color: Colors.transparent, + width: double.infinity, + height: MediaQuery.of(context).size.width * 0.2, + child: Padding( + padding: const EdgeInsets.all(15.0), + child: SecondaryButton( + label: TranslationBase.of(context).save, + textColor: Colors.white, + onTap: () { + if (_bloodSugarValueController.text.isNotEmpty) { + GifLoaderDialogUtils.showMyDialog(context); + if (widget.isUpdate) + widget.bloodSugarViewMode.updateDiabtecResult( + month: bloodSugarDate, + hour: timeSugarDate, + diabtecUnit: measureUnitSelectedType, + measuredTime: measuredTime, + lineItemNo: widget.lineItemNo, + bloodSugerResult: + _bloodSugarValueController.text.toString()).then((value) { + GifLoaderDialogUtils.hideDialog(context); + if(widget.bloodSugarViewMode.state == ViewState.Error) + AppToast.showErrorToast(message: widget.bloodSugarViewMode.error); + else + Navigator.pop(context); + + }); + else + widget.bloodSugarViewMode.addDiabtecResult( + diabtecUnit: measureUnitSelectedType, + measuredTime: measuredTime, + bloodSugerResult: + _bloodSugarValueController.text.toString(), + bloodSugerDateChart: + '${bloodSugarDate.year}-${bloodSugarDate.month}-${bloodSugarDate.day} ${timeSugarDate.hour}:${timeSugarDate.minute}:00', + ).then((value) { + GifLoaderDialogUtils.hideDialog(context); + if(widget.bloodSugarViewMode.state == ViewState.Error) + AppToast.showErrorToast(message: widget.bloodSugarViewMode.error); + else + Navigator.pop(context); + }); + } + }), + ), + ), ); } String getDate() { - return "${DateUtil.getMonth(bloodSugarDate.month)} ${bloodSugarDate - .day}, ${bloodSugarDate.year}"; + return "${DateUtil.getMonth(bloodSugarDate.month)} ${bloodSugarDate.day}, ${bloodSugarDate.year}"; } String getTime() { @@ -314,7 +292,7 @@ class _AddBloodSugarPageState extends State { context: context, child: RadioStringDialog( radioList: measureUnitList, - title: 'Measure unit', + title: TranslationBase.of(context).measureUnit, selectedValue: measureUnitSelectedType, onValueSelected: (value) { setState(() { @@ -330,7 +308,7 @@ class _AddBloodSugarPageState extends State { context: context, child: RadioStringDialog( radioList: list, - title: 'Measure time', + title: TranslationBase.of(context).measureTime, selectedValue: measureTimeSelectedType, onValueSelected: (value) { setState(() { diff --git a/lib/pages/medical/my_trackers/blood_suger/BloodMonthly.dart b/lib/pages/medical/my_trackers/blood_suger/BloodMonthly.dart index fdd7b348..fa49382f 100644 --- a/lib/pages/medical/my_trackers/blood_suger/BloodMonthly.dart +++ b/lib/pages/medical/my_trackers/blood_suger/BloodMonthly.dart @@ -1,13 +1,16 @@ import 'package:diplomaticquarterapp/core/model/my_trakers/blood_sugar/DiabtecPatientResult.dart'; import 'package:diplomaticquarterapp/core/model/my_trakers/chartData/WeekChartDate.dart'; import 'package:diplomaticquarterapp/core/model/my_trakers/chartData/YearMonthlyChartDate.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:charts_flutter/flutter.dart' as charts; import 'package:hexcolor/hexcolor.dart'; +import 'package:provider/provider.dart'; class BloodMonthlyPage extends StatelessWidget { final List> data; @@ -17,6 +20,7 @@ class BloodMonthlyPage extends StatelessWidget { : super(key: key); @override Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); return AppScaffold( body: ListView( children: [ @@ -34,7 +38,7 @@ class BloodMonthlyPage extends StatelessWidget { ), Padding( padding: const EdgeInsets.all(8.0), - child: Texts('Details'), + child: Texts(TranslationBase.of(context).details), ), Container( padding: EdgeInsets.all(10), @@ -46,7 +50,7 @@ class BloodMonthlyPage extends StatelessWidget { border: TableBorder.symmetric( inside: BorderSide(width: 2.0, color: Colors.grey[300]), ), - children: fullData(), + children: fullData(context,projectViewModel), ), ], ), @@ -56,7 +60,7 @@ class BloodMonthlyPage extends StatelessWidget { ); } - List fullData() { + List fullData(BuildContext context,ProjectViewModel projectViewModel) { List tableRow = []; tableRow.add( TableRow( @@ -64,14 +68,15 @@ class BloodMonthlyPage extends StatelessWidget { Container( child: Container( decoration: BoxDecoration( - color: HexColor('#515B5D'), + color: Theme.of(context).primaryColor, borderRadius: BorderRadius.only( - topLeft: Radius.circular(10.0), + topLeft: projectViewModel.isArabic? Radius.circular(0.0):Radius.circular(10.0), + topRight: projectViewModel.isArabic? Radius.circular(10.0):Radius.circular(0.0), ), ), child: Center( child: Texts( - 'Date', + TranslationBase.of(context).date, color: Colors.white, fontSize: 15, ), @@ -82,11 +87,11 @@ class BloodMonthlyPage extends StatelessWidget { Container( child: Container( decoration: BoxDecoration( - color: HexColor('#515B5D'), + color: Theme.of(context).primaryColor, ), child: Center( child: Texts( - 'Time', + TranslationBase.of(context).time, color: Colors.white, fontSize: 15, ), @@ -96,11 +101,11 @@ class BloodMonthlyPage extends StatelessWidget { Container( child: Container( decoration: BoxDecoration( - color: HexColor('#515B5D'), + color: Theme.of(context).primaryColor, ), child: Center( child: Texts( - 'Measured', + TranslationBase.of(context).measured, color: Colors.white, fontSize: 15, ), @@ -110,20 +115,22 @@ class BloodMonthlyPage extends StatelessWidget { Container( child: Container( decoration: BoxDecoration( - color: HexColor('#515B5D'), + color: Theme.of(context).primaryColor, borderRadius: BorderRadius.only( - topRight: Radius.circular(10.0), + topLeft: projectViewModel.isArabic? Radius.circular(10.0):Radius.circular(0.0), + topRight: projectViewModel.isArabic? Radius.circular(0.0):Radius.circular(10.0), ), ), child: Center( child: Texts( - 'Value', + TranslationBase.of(context).value, color: Colors.white, fontSize: 15, ), ), height: 40), ), + ], ), ); diff --git a/lib/pages/medical/my_trackers/blood_suger/BloodYeaPage.dart b/lib/pages/medical/my_trackers/blood_suger/BloodYeaPage.dart index 47f87847..69f00e61 100644 --- a/lib/pages/medical/my_trackers/blood_suger/BloodYeaPage.dart +++ b/lib/pages/medical/my_trackers/blood_suger/BloodYeaPage.dart @@ -1,12 +1,15 @@ import 'package:diplomaticquarterapp/core/model/my_trakers/blood_sugar/DiabtecPatientResult.dart'; import 'package:diplomaticquarterapp/core/model/my_trakers/chartData/WeekChartDate.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:charts_flutter/flutter.dart' as charts; import 'package:hexcolor/hexcolor.dart'; +import 'package:provider/provider.dart'; class BloodYearPage extends StatelessWidget { final List> data; @@ -17,6 +20,7 @@ class BloodYearPage extends StatelessWidget { @override Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); return AppScaffold( body: ListView( children: [ @@ -34,7 +38,7 @@ class BloodYearPage extends StatelessWidget { ), Padding( padding: const EdgeInsets.all(8.0), - child: Texts('Details'), + child: Texts(TranslationBase.of(context).details), ), Container( padding: EdgeInsets.all(10), @@ -46,7 +50,7 @@ class BloodYearPage extends StatelessWidget { border: TableBorder.symmetric( inside: BorderSide(width: 2.0, color: Colors.grey[300]), ), - children: fullData(), + children: fullData(context,projectViewModel), ), ], ), @@ -56,7 +60,7 @@ class BloodYearPage extends StatelessWidget { ); } - List fullData() { + List fullData(BuildContext context,ProjectViewModel projectViewModel) { List tableRow = []; tableRow.add( TableRow( @@ -64,14 +68,15 @@ class BloodYearPage extends StatelessWidget { Container( child: Container( decoration: BoxDecoration( - color: HexColor('#515B5D'), + color: Theme.of(context).primaryColor, borderRadius: BorderRadius.only( - topLeft: Radius.circular(10.0), + topLeft: projectViewModel.isArabic? Radius.circular(0.0):Radius.circular(10.0), + topRight: projectViewModel.isArabic? Radius.circular(10.0):Radius.circular(0.0), ), ), child: Center( child: Texts( - 'Date', + TranslationBase.of(context).date, color: Colors.white, fontSize: 15, ), @@ -82,11 +87,11 @@ class BloodYearPage extends StatelessWidget { Container( child: Container( decoration: BoxDecoration( - color: HexColor('#515B5D'), + color: Theme.of(context).primaryColor, ), child: Center( child: Texts( - 'Time', + TranslationBase.of(context).time, color: Colors.white, fontSize: 15, ), @@ -96,11 +101,11 @@ class BloodYearPage extends StatelessWidget { Container( child: Container( decoration: BoxDecoration( - color: HexColor('#515B5D'), + color: Theme.of(context).primaryColor, ), child: Center( child: Texts( - 'Measured', + TranslationBase.of(context).measured, color: Colors.white, fontSize: 15, ), @@ -110,20 +115,22 @@ class BloodYearPage extends StatelessWidget { Container( child: Container( decoration: BoxDecoration( - color: HexColor('#515B5D'), + color: Theme.of(context).primaryColor, borderRadius: BorderRadius.only( - topRight: Radius.circular(10.0), + topLeft: projectViewModel.isArabic? Radius.circular(10.0):Radius.circular(0.0), + topRight: projectViewModel.isArabic? Radius.circular(0.0):Radius.circular(10.0), ), ), child: Center( child: Texts( - 'Value', + TranslationBase.of(context).value, color: Colors.white, fontSize: 15, ), ), height: 40), ), + ], ), ); diff --git a/lib/pages/medical/my_trackers/blood_suger/blood_sugar_home_page.dart b/lib/pages/medical/my_trackers/blood_suger/blood_sugar_home_page.dart index 71df9a3a..70cdea0f 100644 --- a/lib/pages/medical/my_trackers/blood_suger/blood_sugar_home_page.dart +++ b/lib/pages/medical/my_trackers/blood_suger/blood_sugar_home_page.dart @@ -43,7 +43,7 @@ class _BloodSugarHomePageState extends State onModelReady: (model) => model.getBloodSugar(), builder: (_, model, w) => AppScaffold( isShowAppBar: true, - appBarTitle: 'Blood Sugar', + appBarTitle: TranslationBase.of(context).bloodSugar, baseViewModel: model, body: Scaffold( extendBodyBehindAppBar: true, @@ -81,21 +81,21 @@ class _BloodSugarHomePageState extends State unselectedLabelColor: Colors.grey[800], tabs: [ Container( - width: MediaQuery.of(context).size.width * 0.27, + width: MediaQuery.of(context).size.width * 0.33, child: Center( - child: Texts('Weekly'), + child: Texts(TranslationBase.of(context).weekly), ), ), Container( - width: MediaQuery.of(context).size.width * 0.27, + width: MediaQuery.of(context).size.width * 0.33, child: Center( - child: Texts('Monthly'), + child: Texts(TranslationBase.of(context).monthlyT), ), ), Container( - width: MediaQuery.of(context).size.width * 0.27, + width: MediaQuery.of(context).size.width * 0.34, child: Center( - child: Texts('Yearly'), + child: Texts(TranslationBase.of(context).yearly), ), ), ], @@ -116,6 +116,7 @@ class _BloodSugarHomePageState extends State BloodSugarWeeklyPage( data: model.getBloodWeeklySeries(), diabtecPatientResult: model.weekDiabtecPatientResult, + bloodSugarViewMode: model, ), BloodMonthlyPage( data: model.getBloodMonthlyTimeSeriesSales(), @@ -132,13 +133,13 @@ class _BloodSugarHomePageState extends State ), floatingActionButton: InkWell( onTap: () { - Navigator.push(context, FadePage(page: AddBloodSugarPage())); + Navigator.push(context, FadePage(page: AddBloodSugarPage(bloodSugarViewMode: model,))); }, child: Container( width: 55, height: 55, decoration: BoxDecoration( - shape: BoxShape.circle, color: HexColor('515B5D')), + shape: BoxShape.circle, color:Theme.of(context).primaryColor), child: Center( child: Icon( Icons.add, diff --git a/lib/pages/medical/my_trackers/blood_suger/blood_sugar_weekly_page.dart b/lib/pages/medical/my_trackers/blood_suger/blood_sugar_weekly_page.dart index 4b007929..139548e1 100644 --- a/lib/pages/medical/my_trackers/blood_suger/blood_sugar_weekly_page.dart +++ b/lib/pages/medical/my_trackers/blood_suger/blood_sugar_weekly_page.dart @@ -1,22 +1,31 @@ import 'package:diplomaticquarterapp/core/model/my_trakers/blood_sugar/DiabtecPatientResult.dart'; import 'package:diplomaticquarterapp/core/model/my_trakers/chartData/WeekChartDate.dart'; +import 'package:diplomaticquarterapp/core/viewModels/medical/blood_sugar_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:charts_flutter/flutter.dart' as charts; import 'package:hexcolor/hexcolor.dart'; +import 'package:provider/provider.dart'; + +import 'AddBloodSugarPage.dart'; class BloodSugarWeeklyPage extends StatelessWidget { final List> data; final List diabtecPatientResult; + final BloodSugarViewMode bloodSugarViewMode; - const BloodSugarWeeklyPage({Key key, this.data, this.diabtecPatientResult}) + const BloodSugarWeeklyPage({Key key, this.data, this.diabtecPatientResult, this.bloodSugarViewMode}) : super(key: key); @override Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); return AppScaffold( body: ListView( children: [ @@ -34,7 +43,7 @@ class BloodSugarWeeklyPage extends StatelessWidget { ), Padding( padding: const EdgeInsets.all(8.0), - child: Texts('Details'), + child: Texts(TranslationBase.of(context).details), ), Container( padding: EdgeInsets.all(10), @@ -46,7 +55,7 @@ class BloodSugarWeeklyPage extends StatelessWidget { border: TableBorder.symmetric( inside: BorderSide(width: 2.0, color: Colors.grey[300]), ), - children: fullData(), + children: fullData(context, projectViewModel,bloodSugarViewMode), ), ], ), @@ -56,7 +65,8 @@ class BloodSugarWeeklyPage extends StatelessWidget { ); } - List fullData() { + List fullData( + BuildContext context, ProjectViewModel projectViewModel, BloodSugarViewMode bloodSugarViewMode) { List tableRow = []; tableRow.add( TableRow( @@ -64,14 +74,19 @@ class BloodSugarWeeklyPage extends StatelessWidget { Container( child: Container( decoration: BoxDecoration( - color: HexColor('#515B5D'), + color: Theme.of(context).primaryColor, borderRadius: BorderRadius.only( - topLeft: Radius.circular(10.0), + topLeft: projectViewModel.isArabic + ? Radius.circular(0.0) + : Radius.circular(10.0), + topRight: projectViewModel.isArabic + ? Radius.circular(10.0) + : Radius.circular(0.0), ), ), child: Center( child: Texts( - 'Date', + TranslationBase.of(context).date, color: Colors.white, fontSize: 15, ), @@ -82,11 +97,11 @@ class BloodSugarWeeklyPage extends StatelessWidget { Container( child: Container( decoration: BoxDecoration( - color: HexColor('#515B5D'), + color: Theme.of(context).primaryColor, ), child: Center( child: Texts( - 'Time', + TranslationBase.of(context).time, color: Colors.white, fontSize: 15, ), @@ -96,11 +111,11 @@ class BloodSugarWeeklyPage extends StatelessWidget { Container( child: Container( decoration: BoxDecoration( - color: HexColor('#515B5D'), + color: Theme.of(context).primaryColor, ), child: Center( child: Texts( - 'Measured', + TranslationBase.of(context).measured, color: Colors.white, fontSize: 15, ), @@ -110,11 +125,11 @@ class BloodSugarWeeklyPage extends StatelessWidget { Container( child: Container( decoration: BoxDecoration( - color: HexColor('#515B5D'), + color: Theme.of(context).primaryColor, ), child: Center( child: Texts( - 'Value', + TranslationBase.of(context).value, color: Colors.white, fontSize: 15, ), @@ -124,14 +139,19 @@ class BloodSugarWeeklyPage extends StatelessWidget { Container( child: Container( decoration: BoxDecoration( - color: HexColor('#515B5D'), + color: Theme.of(context).primaryColor, borderRadius: BorderRadius.only( - topRight: Radius.circular(10.0), + topLeft: projectViewModel.isArabic + ? Radius.circular(10.0) + : Radius.circular(0.0), + topRight: projectViewModel.isArabic + ? Radius.circular(0.0) + : Radius.circular(10.0), ), ), child: Center( child: Texts( - 'Edit', + TranslationBase.of(context).edit, color: Colors.white, fontSize: 15, ), @@ -203,12 +223,30 @@ class BloodSugarWeeklyPage extends StatelessWidget { ), ), Container( - child: Container( - height: 70, - padding: EdgeInsets.all(10), - color: Colors.white, - child: Center( - child: Icon(Icons.edit), + child: InkWell( + onTap: () { + Navigator.push( + context, + FadePage( + page: AddBloodSugarPage( + isUpdate: true, + bloodSugarDate: diabtec.dateChart, + measuredTime: diabtec.measuredDesc, + bloodSugarValue: diabtec.resultValue.toString(), + lineItemNo: diabtec.lineItemNo, + measureUnitSelectedType: diabtec.unit, + bloodSugarViewMode: bloodSugarViewMode, + ), + ), + ); + }, + child: Container( + height: 70, + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Icon(Icons.edit), + ), ), ), ), diff --git a/lib/pages/medical/my_trackers/my_trackers.dart b/lib/pages/medical/my_trackers/my_trackers.dart index ecdf5a53..5e5c4527 100644 --- a/lib/pages/medical/my_trackers/my_trackers.dart +++ b/lib/pages/medical/my_trackers/my_trackers.dart @@ -1,3 +1,5 @@ +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; @@ -11,7 +13,7 @@ class MyTrackers extends StatelessWidget { @override Widget build(BuildContext context) { return AppScaffold( - appBarTitle: 'My Tracker', + appBarTitle: TranslationBase.of(context).myTracker, isShowAppBar: true, body: SingleChildScrollView( child: Container( @@ -41,7 +43,7 @@ class MyTrackers extends StatelessWidget { children: [ Image.asset('assets/tracker/blood-suger.png',width: 60.0,), SizedBox(height: 15,), - Text('Blood Sugar'), + Texts(TranslationBase.of(context).bloodSugar), ], ), ), @@ -65,7 +67,7 @@ class MyTrackers extends StatelessWidget { children: [ Image.asset('assets/tracker/blood-pressure.png',width: 60.0,), SizedBox(height: 15,), - Text('Blood Pressure'), + Texts(TranslationBase.of(context).bloodPressure), ], ), ), @@ -94,7 +96,7 @@ class MyTrackers extends StatelessWidget { children: [ Image.asset('assets/tracker/weight.png',width: 60.0,), SizedBox(height: 15,), - Text('Weight'), + Texts(TranslationBase.of(context).weight), ], ), ), diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index c5cf339b..b9be8fe4 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -1251,6 +1251,17 @@ class TranslationBase { String get instructionAgree => localizedValues['instructionAgree'][locale.languageCode]; String get reqId => localizedValues['reqId'][locale.languageCode]; String get ordersLog => localizedValues['RRT-orders-log'][locale.languageCode]; + String get bloodSugar => localizedValues['blood-sugar'][locale.languageCode]; + String get myTracker => localizedValues['my-tracker'][locale.languageCode]; + String get weekly => localizedValues['weekly'][locale.languageCode]; + String get monthlyT => localizedValues['monthly'][locale.languageCode]; + String get yearly => localizedValues['yearly'][locale.languageCode]; + String get measured => localizedValues['measured'][locale.languageCode]; + String get sugarAdd => localizedValues['sugar-add'][locale.languageCode]; + String get other => localizedValues['other'][locale.languageCode]; + String get measureUnit => localizedValues['measure-unit'][locale.languageCode]; + String get measureTime => localizedValues['measure-time'][locale.languageCode]; + String get update => localizedValues['update'][locale.languageCode]; } From 174534d8a5ff5459e92d816b3ab8368b33847550 Mon Sep 17 00:00:00 2001 From: mosazaid Date: Tue, 19 Jan 2021 18:00:34 +0200 Subject: [PATCH 28/42] fix Blood donation functionality and design --- lib/config/config.dart | 2 + lib/config/localized_values.dart | 4 +- .../service/medical/my_balance_service.dart | 50 ++- lib/core/service/termsConditionsService.dart | 18 ++ .../viewModels/TermsConditionsViewModel.dart | 29 ++ .../medical/my_balance_view_model.dart | 17 +- lib/locator.dart | 4 + lib/pages/Blood/blood_donation.dart | 302 ++++++++---------- .../Blood/dialogs/SelectGenderDialog.dart | 4 +- lib/pages/Blood/user_agreement_page.dart | 62 +--- .../balance/dialogs/SelectCiteisDialog.dart | 18 +- lib/uitl/translations_delegate_base.dart | 2 + 12 files changed, 282 insertions(+), 230 deletions(-) create mode 100644 lib/core/service/termsConditionsService.dart create mode 100644 lib/core/viewModels/TermsConditionsViewModel.dart diff --git a/lib/config/config.dart b/lib/config/config.dart index 0c6b5d59..454f05fc 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -373,6 +373,8 @@ const GET_PATIENT_ALL_PRES_ORD = const PATIENT_ER_INSERT_PRES_ORDER = 'Services/Patients.svc/REST/PatientER_InsertPresOrder'; const PHARMACY_MAKE_REVIEW = 'epharmacy/api/insertreviews'; +const BLOOD_DONATION_REGISTER_BLOOD_TYPE = 'Services/PatientVarification.svc/REST/BloodDonation_RegisterBloodType'; +const ADD_USER_AGREEMENT_FOR_BLOOD_DONATION = 'Services/PatientVarification.svc/REST/AddUserAgreementForBloodDonation'; //Pharmacy wishlist const GET_WISHLIST = "shopping_cart_items/"; diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index d32078a3..fdf84bf0 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -1511,5 +1511,7 @@ const Map localizedValues = { "send-child-email-msg": {"en" : "Send the child's schedule to the email", "ar": "أرسل جدول الطفل إلى البريد الإلكتروني"}, "vaccination-add-child-msg": {"en" : "Add the child's information below to receive the schedule of vaccinations.", "ar": "أضف معلومات الطفل أدناه للحصول على جدول التطعيمات."}, "child_added_successfully": {"en" : "Child added successfully", "ar": "تمت إضافة الطفل بنجاح"}, - + "bloodD-enter-desc": {"en" : "Enter the required information, In order to register for Blood Donation Service", "ar": "أدخل المعلومات المطلوبة ، للتسجيل في خدمة التبرع بالدم"}, + "viewTermsConditions": {"en" : "To view the terms and conditions", "ar": "لعرض الشروط والأحكام"}, + // "visit": {"en" : "Visit", "ar": "الزيارة"}, }; diff --git a/lib/core/service/medical/my_balance_service.dart b/lib/core/service/medical/my_balance_service.dart index 86e925b8..e2744250 100644 --- a/lib/core/service/medical/my_balance_service.dart +++ b/lib/core/service/medical/my_balance_service.dart @@ -2,6 +2,7 @@ import 'dart:convert'; import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/core/model/blooddonation/blood_groub_details.dart'; import 'package:diplomaticquarterapp/core/model/my_balance/AdvanceModel.dart'; import 'package:diplomaticquarterapp/core/model/my_balance/patient_advance_balance_amount.dart'; import 'package:diplomaticquarterapp/core/model/my_balance/patient_info.dart'; @@ -23,11 +24,11 @@ class MyBalanceService extends BaseService { PatientInfoAndMobileNumber patientInfoAndMobileNumber; String logInTokenID; String verificationCode; - + String updatedRegisterBloodMessage = ""; AuthenticatedUserObject authenticatedUserObject = locator(); - MyBalanceService(){ + MyBalanceService() { getFamilyFiles(); } @@ -156,4 +157,49 @@ class MyBalanceService extends BaseService { return await getSharedRecordByStatus(); } } + + Future updateBloodGroup(List_BloodGroupDetailsModel detailsModel) async { + hasError = false; + await getUser(); + var languageID = + await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + Map body = Map(); + body['City'] = detailsModel.city; + body['cityCode'] = detailsModel.cityCode; + body['Gender'] = detailsModel.gender; + body['BloodGroup'] = detailsModel.bloodGroup; + body['CellNumber'] = user.mobileNumber; + body['LanguageID'] = languageID; + body['NationalID'] = user.nationalityID; + body['ZipCode'] = user.zipCode ?? "+966"; + body['isDentalAllowedBackend'] = false; + + await baseAppClient.post(BLOOD_DONATION_REGISTER_BLOOD_TYPE, + onSuccess: (dynamic response, int statusCode) { + updatedRegisterBloodMessage = response['ErrorEndUserMessage']; + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + if(error == null){ + super.error = "Something went wrong"; + } + }, body: body); + } + + Future addUserAgreementForBloodDonation() async { + hasError = false; + var languageID = + await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + Map body = Map(); + body['IsAgreed'] = true; + body['LanguageID'] = languageID; + body['isDentalAllowedBackend'] = false; + + await baseAppClient.post(ADD_USER_AGREEMENT_FOR_BLOOD_DONATION, + onSuccess: (dynamic response, int statusCode) { + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } } diff --git a/lib/core/service/termsConditionsService.dart b/lib/core/service/termsConditionsService.dart new file mode 100644 index 00000000..1f806e22 --- /dev/null +++ b/lib/core/service/termsConditionsService.dart @@ -0,0 +1,18 @@ +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/core/service/base_service.dart'; + +class TermsConditionsService extends BaseService { + + String userAgreementContent = ""; + + Future getUserTermsAndConditions() async { + hasError = false; + await baseAppClient.post(GET_USER_TERMS, + onSuccess: (dynamic response, int statusCode) { + userAgreementContent = response['UserAgreementContent']; + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: Map()); + } +} \ No newline at end of file diff --git a/lib/core/viewModels/TermsConditionsViewModel.dart b/lib/core/viewModels/TermsConditionsViewModel.dart new file mode 100644 index 00000000..0cd667cf --- /dev/null +++ b/lib/core/viewModels/TermsConditionsViewModel.dart @@ -0,0 +1,29 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/service/termsConditionsService.dart'; +import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; + +import '../../locator.dart'; + +class TermsConditionsViewModel extends BaseViewModel{ + + TermsConditionsService _service = locator(); + + String get userAgreementContent => _service.userAgreementContent; + + getUserTermsAndConditions() async { + setState(ViewState.Busy); + await _service.getUserTermsAndConditions(); + if (_service.hasError) { + error = _service.error; + setState(ViewState.Error); + } else { + setState(ViewState.Idle); + } + } + + @override + void dispose() { + super.dispose(); + } + +} \ No newline at end of file diff --git a/lib/core/viewModels/medical/my_balance_view_model.dart b/lib/core/viewModels/medical/my_balance_view_model.dart index f9554d94..acbbee07 100644 --- a/lib/core/viewModels/medical/my_balance_view_model.dart +++ b/lib/core/viewModels/medical/my_balance_view_model.dart @@ -41,6 +41,9 @@ class MyBalanceViewModel extends BaseViewModel { double get totalAdvanceBalanceAmount => _myBalanceService.totalAdvanceBalanceAmount; + String get updatedRegisterBloodMessage => + _myBalanceService.updatedRegisterBloodMessage; + GetAllSharedRecordsByStatusResponse get getAllSharedRecordsByStatusResponse => _myBalanceService.getAllSharedRecordsByStatusResponse; @@ -74,7 +77,6 @@ class MyBalanceViewModel extends BaseViewModel { setState(ViewState.Idle); } - Future getCities() async { setState(ViewState.Busy); await _bloodDonationService.getAllCitiesOrders(); @@ -159,4 +161,17 @@ class MyBalanceViewModel extends BaseViewModel { setState(ViewState.Idle); } } + + Future updateBloodGroup(List_BloodGroupDetailsModel detailsModel) async { + setState(ViewState.Busy); + await _myBalanceService.updateBloodGroup(detailsModel); + if (_myBalanceService.hasError) { + error = _myBalanceService.error; + setState(ViewState.ErrorLocal); + } else { + await _myBalanceService.addUserAgreementForBloodDonation(); + setState(ViewState.Idle); + } + + } } diff --git a/lib/locator.dart b/lib/locator.dart index cfdad053..4a6733ae 100644 --- a/lib/locator.dart +++ b/lib/locator.dart @@ -59,12 +59,14 @@ import 'core/service/parmacyModule/order-preview-service.dart'; import 'core/service/notifications_service.dart'; import 'core/service/parmacyModule/terms-condition-service.dart'; import 'core/service/privilege_service.dart'; +import 'core/service/termsConditionsService.dart'; import 'core/service/weather_service.dart'; import 'core/viewModels/AlHabibMedicalService/cmc_view_model.dart'; import 'core/service/parmacyModule/parmacy_module_service.dart'; import 'core/service/offers_service.dart'; import 'core/service/pharmacy_categorise_service.dart'; +import 'core/viewModels/TermsConditionsViewModel.dart'; import 'core/viewModels/all_habib_medical_services/e_referral_view_model.dart'; import 'core/viewModels/appointment_rate_view_model.dart'; import 'core/viewModels/blooddonation/blood_details_view_model.dart'; @@ -204,6 +206,7 @@ void setupLocator() { locator.registerLazySingleton(() => CancelOrderService()); locator.registerLazySingleton(() => PrivilegeService()); locator.registerLazySingleton(() => WeatherService()); + locator.registerLazySingleton(() => TermsConditionsService()); /// View Model locator.registerFactory(() => HospitalViewModel()); @@ -278,4 +281,5 @@ void setupLocator() { // Geofencing // --------------------- locator.registerLazySingleton(() => GeofencingServices()); // Geofencing Services + locator.registerFactory(() => TermsConditionsViewModel()); } diff --git a/lib/pages/Blood/blood_donation.dart b/lib/pages/Blood/blood_donation.dart index 99e5242e..e6eae56c 100644 --- a/lib/pages/Blood/blood_donation.dart +++ b/lib/pages/Blood/blood_donation.dart @@ -1,14 +1,15 @@ - import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/model/blooddonation/blood_groub_details.dart'; import 'package:diplomaticquarterapp/core/model/blooddonation/get_all_cities.dart'; + //import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart'; import 'package:diplomaticquarterapp/core/model/my_balance/AdvanceModel.dart'; import 'package:diplomaticquarterapp/core/model/my_balance/patient_info.dart'; import 'package:diplomaticquarterapp/core/service/blood/blood_details_servies.dart'; import 'package:diplomaticquarterapp/core/viewModels/blooddonation/blood_details_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/my_balance_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart'; import 'package:diplomaticquarterapp/pages/Blood/user_agreement_page.dart'; @@ -27,6 +28,7 @@ import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:giffy_dialog/giffy_dialog.dart'; +import 'package:provider/provider.dart'; import 'package:smart_progress_bar/smart_progress_bar.dart'; //import '../../../core/model/my_balance/AdvanceModel.dart'; @@ -39,8 +41,8 @@ import 'dialogs/SelectPatientInfoDialog.dart'; import 'new_text_Field.dart'; enum BeneficiaryType { MyAccount, MyFamilyFiles, OtherAccount, NON } -enum Gender{Male,Female,NON} -enum Blood{Oplus,Ominus,Aplus,Aminus,Bplus,Bminus,ABplus,ABminus,NON} +enum Gender { Male, Female, NON } +enum Blood { Oplus, Ominus, Aplus, Aminus, Bplus, Bminus, ABplus, ABminus, NON } class BloodDonationPage extends StatefulWidget { @override @@ -51,10 +53,11 @@ class _BloodDonationPageState extends State { TextEditingController _fileTextController = TextEditingController(); TextEditingController _notesTextController = TextEditingController(); BeneficiaryType beneficiaryType = BeneficiaryType.NON; - Gender gender = Gender.Male;//Gender.NON; - Blood blood = Blood.Aminus;//Blood.NON; + Gender gender = Gender.Male; //Gender.NON; + Blood blood = Blood.Aminus; //Blood.NON; //HospitalsModel _selectedHospital; - CitiesModel _selectedHospital; + CitiesModel _selectedHospital = + CitiesModel(description: "Riyadh", descriptionN: "الرياض", iD: 1); String amount = ""; String email; @@ -62,22 +65,27 @@ class _BloodDonationPageState extends State { AuthenticatedUser authenticatedUser; GetAllSharedRecordsByStatusList selectedPatientFamily; AdvanceModel advanceModel = AdvanceModel(); - List_BloodGroupDetailsModel bloodDetails=List_BloodGroupDetailsModel(); + List_BloodGroupDetailsModel bloodDetails = List_BloodGroupDetailsModel(); AppSharedPreferences sharedPref = AppSharedPreferences(); AuthenticatedUser authUser; - var checkedValue = false; + var checkedValue = false; + @override void initState() { super.initState(); getAuthUser(); } + @override Widget build(BuildContext context) { + ProjectViewModel projectProvider = Provider.of(context); + return BaseView( - onModelReady: (model) => model.getCities(),//model.getHospitals(), + onModelReady: (model) => model.getCities(), //model.getHospitals(), builder: (_, model, w) => AppScaffold( isShowAppBar: true, - appBarTitle: "Blood Donation",//TranslationBase.of(context).advancePayment, + baseViewModel: model, + appBarTitle: TranslationBase.of(context).bloodD, body: SingleChildScrollView( physics: ScrollPhysics(), child: Container( @@ -86,15 +94,16 @@ class _BloodDonationPageState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ Texts( - // TranslationBase.of(context).advancePaymentLabel, - "Enter the required information, In order to register for Blood Donation Service",//+model.user.firstName, + TranslationBase.of(context).bloodDEnterDesc, textAlign: TextAlign.center, ), SizedBox( height: 12, ), InkWell( - onTap: () => confirmSelectHospitalDialog(model.CitiesModelList),//model.hospitals + onTap: () => + confirmSelectHospitalDialog(model.CitiesModelList), + //model.hospitals child: Container( padding: EdgeInsets.all(12), width: double.infinity, @@ -105,7 +114,7 @@ class _BloodDonationPageState extends State { child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Texts(getHospitalName()), + Texts(getHospitalName(projectProvider)), Icon(Icons.arrow_drop_down) ], ), @@ -116,7 +125,8 @@ class _BloodDonationPageState extends State { ), InkWell( //======Gender======== - onTap: () => confirmSelectGenderDialog(),//confirmSelectBeneficiaryDialog(model), + onTap: () => confirmSelectGenderDialog(), + //confirmSelectBeneficiaryDialog(model), child: Container( padding: EdgeInsets.all(12), width: double.infinity, @@ -128,49 +138,19 @@ class _BloodDonationPageState extends State { mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ //Texts(getBeneficiaryType()), - Texts(getGender()), + Texts(getGender(context)), Icon(Icons.arrow_drop_down) ], ), ), ), - // if (beneficiaryType == BeneficiaryType.MyFamilyFiles) - // SizedBox( - // height: 12, - // ), - // if (beneficiaryType == BeneficiaryType.MyFamilyFiles) - // InkWell( - // onTap: () { - // model.getFamilyFiles().then((value) { - // confirmSelectFamilyDialog(model - // .getAllSharedRecordsByStatusResponse - // .getAllSharedRecordsByStatusList); - // }).showProgressBar( - // text: "Loading", - // backgroundColor: Colors.blue.withOpacity(0.6)); - // }, - // child: Container( - // padding: EdgeInsets.all(12), - // width: double.infinity, - // height: 65, - // decoration: BoxDecoration( - // borderRadius: BorderRadius.circular(12), - // color: Colors.white), - // child: Row( - // mainAxisAlignment: MainAxisAlignment.spaceBetween, - // children: [ - // Texts(getFamilyMembersName()), - // Icon(Icons.arrow_drop_down) - // ], - // ), - // ), - // ), SizedBox( height: 12, ), InkWell( //======Gender======== - onTap: () => confirmSelectBloodDialog(),//confirmSelectBeneficiaryDialog(model), + onTap: () => confirmSelectBloodDialog(), + //confirmSelectBeneficiaryDialog(model), child: Container( padding: EdgeInsets.all(12), width: double.infinity, @@ -188,44 +168,14 @@ class _BloodDonationPageState extends State { ), ), ), - // if (beneficiaryType == BeneficiaryType.MyFamilyFiles) - // SizedBox( - // height: 12, - // ), - // if (beneficiaryType == BeneficiaryType.MyFamilyFiles) - // InkWell( - // onTap: () { - // model.getFamilyFiles().then((value) { - // confirmSelectFamilyDialog(model - // .getAllSharedRecordsByStatusResponse - // .getAllSharedRecordsByStatusList); - // }).showProgressBar( - // text: "Loading", - // backgroundColor: Colors.blue.withOpacity(0.6)); - // }, - // child: Container( - // padding: EdgeInsets.all(12), - // width: double.infinity, - // height: 65, - // decoration: BoxDecoration( - // borderRadius: BorderRadius.circular(12), - // color: Colors.white), - // child: Row( - // mainAxisAlignment: MainAxisAlignment.spaceBetween, - // children: [ - // Texts(getFamilyMembersName()), - // Icon(Icons.arrow_drop_down) - // ], - // ), - // ), - // ), SizedBox( height: 12, ), Row( children: [ Container( - child: Text(" To view the terms and conditions "), + child: Text( + TranslationBase.of(context).viewTermsConditions), ), SizedBox( width: MediaQuery.of(context).size.height * 0.10, @@ -233,10 +183,14 @@ class _BloodDonationPageState extends State { InkWell( onTap: () { Navigator.of(context).push(MaterialPageRoute( - builder: (BuildContext context) => UserAgreementPage())); + builder: (BuildContext context) => + UserAgreementPage())); }, child: Container( - child: Texts(" Click here ",color: Colors.blue,), + child: Texts( + TranslationBase.of(context).clickHere, + color: Colors.blue, + ), ), ) ], @@ -247,25 +201,31 @@ class _BloodDonationPageState extends State { Row( children: [ Checkbox( - onChanged: (bool value) { + onChanged: (bool value) { setState(() { checkedValue = value; }); }, - // tristate: checkedValue==true,//i == 1, + // tristate: checkedValue==true,//i == 1, value: checkedValue, - activeColor: Colors.red,//Color(0xFF6200EE), + activeColor: Color(0xFFc5272d), //Color(0xFF6200EE), + ), + SizedBox( + height: 10, + ), + Row( + children: [], ), - SizedBox(height: 10,), - Row(children: [ - - ],), SizedBox( width: 10, ), Text( - 'I agree to the terms and conditions ', - style: Theme.of(context).textTheme.subtitle1.copyWith(color: checkedValue? Colors.red : Colors.black), + TranslationBase.of(context) + .iAgreeToTheTermsAndConditions, + style: Theme.of(context).textTheme.subtitle1.copyWith( + color: checkedValue + ? Color(0xFFc5272d) + : Colors.black), ), ], ), @@ -355,29 +315,25 @@ class _BloodDonationPageState extends State { onTap: () { showDialog( context: context, - builder: (_) => - AssetGiffyDialog( + builder: (_) => AssetGiffyDialog( title: Text( "", style: TextStyle( fontSize: 22.0, - fontWeight: - FontWeight - .w600), + fontWeight: FontWeight.w600), ), image: Image.asset( 'assets/images/BloodChrt_EN.png'), - buttonCancelText: - Text('cancel'), - buttonCancelColor: - Colors.grey, + buttonCancelText: Text( + TranslationBase.of(context).cancel), + buttonCancelColor: Colors.grey, onlyCancelButton: true, )); }, child: Container( width: 250, height: 200, - child:Image.asset( + child: Image.asset( 'assets/images/BloodChrt_EN.png')), ), ), @@ -395,25 +351,37 @@ class _BloodDonationPageState extends State { bottomSheet: Container( height: MediaQuery.of(context).size.height * 0.12, width: double.infinity, - padding: EdgeInsets.all(12), child: SecondaryButton( textColor: Colors.white, - color: checkedValue== false ?Colors.white24:Color.fromRGBO(63, 72, 74, 1,), - label: "Save", - // - onTap: (){ - - bloodDetails.city=_selectedHospital.toString(); - - // bloodDetails. + color: checkedValue == false + ? Color(0xFFa0a4a6) + : Color.fromRGBO( + 63, + 72, + 74, + 1, + ), + label: TranslationBase.of(context).save, + onTap: () async { + bloodDetails.city = projectProvider.isArabic + ? _selectedHospital.descriptionN + : _selectedHospital.description; + bloodDetails.cityCode = _selectedHospital.iD.toString(); + bloodDetails.gender = gender == Gender.Male ? 1 : 2; + await model.updateBloodGroup(bloodDetails); + if (model.state == ViewState.Idle) { + AppToast.showSuccessToast( + message: model.updatedRegisterBloodMessage); + } else { + AppToast.showErrorToast(message: model.error); + } }, - - ), )), ); } + //============== void confirmSelectBeneficiaryDialog(MyBalanceViewModel model) { showDialog( @@ -435,94 +403,85 @@ class _BloodDonationPageState extends State { ), ); } - void confirmSelectBloodDialog(){ + + void confirmSelectBloodDialog() { showDialog( context: context, - child: SelectBloodDialog(bloodType: blood, + child: SelectBloodDialog( + bloodType: blood, onValueSelected: (value) { setState(() { if (value == Blood.Oplus) { - bloodDetails.bloodGroup="O+"; + bloodDetails.bloodGroup = "O+"; // _fileTextController.text = model.user.patientID.toString(); // advanceModel.depositorName = // model.user.firstName + " " + model.user.lastName; - }else - if (value == Blood.Ominus) { + } else if (value == Blood.Ominus) { // _fileTextController.text = model.user.patientID.toString(); - bloodDetails.bloodGroup="O-"; + bloodDetails.bloodGroup = "O-"; // advanceModel.depositorName = // model.user.firstName + " " + model.user.lastName; - }else - if (value == Blood.ABplus) { - bloodDetails.bloodGroup="AB+"; + } else if (value == Blood.ABplus) { + bloodDetails.bloodGroup = "AB+"; // _fileTextController.text = model.user.patientID.toString(); // advanceModel.depositorName = // model.user.firstName + " " + model.user.lastName; - }else - if (value == Blood.ABminus) { - bloodDetails.bloodGroup="AB-"; + } else if (value == Blood.ABminus) { + bloodDetails.bloodGroup = "AB-"; // _fileTextController.text = model.user.patientID.toString(); // advanceModel.depositorName = // model.user.firstName + " " + model.user.lastName; - }else - if (value == Blood.Aplus) { - bloodDetails.bloodGroup="A+"; + } else if (value == Blood.Aplus) { + bloodDetails.bloodGroup = "A+"; // _fileTextController.text = model.user.patientID.toString(); // advanceModel.depositorName = // model.user.firstName + " " + model.user.lastName; - }else - if (value == Blood.Aminus) { - bloodDetails.bloodGroup="A-"; + } else if (value == Blood.Aminus) { + bloodDetails.bloodGroup = "A-"; // _fileTextController.text = model.user.patientID.toString(); // advanceModel.depositorName = // model.user.firstName + " " + model.user.lastName; - }else - if (value == Blood.Bplus) { - bloodDetails.bloodGroup="B+"; + } else if (value == Blood.Bplus) { + bloodDetails.bloodGroup = "B+"; // _fileTextController.text = model.user.patientID.toString(); // advanceModel.depositorName = // model.user.firstName + " " + model.user.lastName; - }else - if (value == Blood.Bminus) { - bloodDetails.bloodGroup="B-"; + } else if (value == Blood.Bminus) { + bloodDetails.bloodGroup = "B-"; // _fileTextController.text = model.user.patientID.toString(); // advanceModel.depositorName = // model.user.firstName + " " + model.user.lastName; - } - - - else + } else _fileTextController.text = ""; // beneficiaryType = value; - blood=value; - } - - - - - ); + blood = value; + }); }, ), ); } - void confirmSelectGenderDialog(){ + + void confirmSelectGenderDialog() { showDialog( context: context, - child: SelectGenderDialog(beneficiaryType: gender, + child: SelectGenderDialog( + beneficiaryType: gender, onValueSelected: (value) { setState(() { if (value == Gender.Male) { // _fileTextController.text = model.user.patientID.toString(); - bloodDetails.patientType=1; + bloodDetails.patientType = 1; // advanceModel.depositorName = // model.user.firstName + " " + model.user.lastName; } else - // _fileTextController.text = ""; - {bloodDetails.gender=2;} + // _fileTextController.text = ""; + { + bloodDetails.gender = 2; + } - // beneficiaryType = value; - gender=value; + // beneficiaryType = value; + gender = value; }); }, ), @@ -591,23 +550,25 @@ class _BloodDonationPageState extends State { return TranslationBase.of(context).otherAccount; break; case BeneficiaryType.NON: - return "Select Gender";//TranslationBase.of(context).selectBeneficiary; + return TranslationBase.of(context).selectBeneficiary; } - return "Select Gender";//TranslationBase.of(context).selectBeneficiary; + return TranslationBase.of(context).selectBeneficiary; } - String getGender() { + + String getGender(BuildContext context) { switch (gender) { case Gender.Male: - return "Male"; + return TranslationBase.of(context).male; case Gender.Female: - return "Female"; + return TranslationBase.of(context).female; break; case Gender.NON: - return "Select Gender";//TranslationBase.of(context).selectBeneficiary; + return TranslationBase.of(context).selectGender; } - return "Select Gender";//TranslationBase.of(context).selectBeneficiary; + return TranslationBase.of(context).selectGender; } + String getBlood() { switch (blood) { case Blood.Oplus: @@ -639,18 +600,19 @@ class _BloodDonationPageState extends State { break; case Blood.NON: - return "Select Blood Type";//TranslationBase.of(context).selectBeneficiary; + return "Select Blood Type"; //TranslationBase.of(context).selectBeneficiary; } - return "Select Blood Type";//TranslationBase.of(context).selectBeneficiary; + return "Select Blood Type"; //TranslationBase.of(context).selectBeneficiary; } - String getHospitalName() { + String getHospitalName(ProjectViewModel projectProvider) { if (_selectedHospital != null) - return _selectedHospital.description; + return projectProvider.isArabic + ? _selectedHospital.descriptionN + : _selectedHospital.description; else - return - "Riyadh"; - // return List_BloodGroupDetailsModel.fromJson(0).city.toString();//"Select City";//TranslationBase.of(context).selectHospital; + return projectProvider.isArabic ? "الرياض" : "Riyadh"; + // return List_BloodGroupDetailsModel.fromJson(0).city.toString();//"Select City";//TranslationBase.of(context).selectHospital; } String getPatientName() { @@ -677,8 +639,6 @@ class _BloodDonationPageState extends State { return TranslationBase.of(context).selectFamilyPatientName; } - - //================ - +//================ } diff --git a/lib/pages/Blood/dialogs/SelectGenderDialog.dart b/lib/pages/Blood/dialogs/SelectGenderDialog.dart index 295c6dcd..a097ae8e 100644 --- a/lib/pages/Blood/dialogs/SelectGenderDialog.dart +++ b/lib/pages/Blood/dialogs/SelectGenderDialog.dart @@ -38,7 +38,7 @@ class _SelectGenderDialogState extends State { }); }, child: ListTile( - title: Text("Male"), + title: Text(TranslationBase.of(context).male), leading: Radio( value: Gender.Male, groupValue: beneficiaryType, @@ -68,7 +68,7 @@ class _SelectGenderDialogState extends State { }); }, child: ListTile( - title: Text("Female"), + title: Text(TranslationBase.of(context).female), leading: Radio( value: Gender.Female, groupValue: beneficiaryType, diff --git a/lib/pages/Blood/user_agreement_page.dart b/lib/pages/Blood/user_agreement_page.dart index d05725b4..36989ea5 100644 --- a/lib/pages/Blood/user_agreement_page.dart +++ b/lib/pages/Blood/user_agreement_page.dart @@ -1,55 +1,23 @@ +import 'package:diplomaticquarterapp/core/viewModels/TermsConditionsViewModel.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; +import 'package:flutter_html/flutter_html.dart'; class UserAgreementPage extends StatelessWidget { @override Widget build(BuildContext context) { - return AppScaffold( - isShowAppBar: true, - appBarTitle: "User Agreement", - - body: - Container( - child:ListView( - scrollDirection: Axis.vertical, - children: [ - /////////// - Column( - children: [ - SizedBox( - height: 20, - ), - Container( - child:Text("Communication via email, text messages and phone calls",textAlign: TextAlign.center,style: TextStyle(fontWeight: FontWeight.bold,fontSize: 16)), - ), - SizedBox( - height: 20, - ), - Container( - child: - Text("I understand that the contact number or Email that \n I have provided on registration will be used for communication by HMG.\n I hereby agree to be notified by HMG through SMS, Email or any other method for appointments notifications, current HMG’s medical services, and any services introduced by the HMG in the future or any modifications made to the services offered by the HMG. And these messages may be submitted as evidence where the HMG has the right to use at any time whatsoever and as it sees fit.",textAlign: TextAlign.center,style: TextStyle(fontWeight: FontWeight.bold,fontSize: 16)), - ), - SizedBox( - height: 20, - ), - Container( - child: - Text("I understand the risks of communicating by email and text messages, in particular the privacy risks. \nI understand that HMG cannot guarantee the security and confidentiality of email or text communication. HMG will not be responsible for messages that are not received or delivered due to technical failure, or for disclosure of confidential information unless caused by intentional misconduct.",textAlign: TextAlign.center,style: TextStyle(fontWeight: FontWeight.bold,fontSize: 16)), - ), - SizedBox( - height: 20, - ), - Container( - child: - Text("\b I hereby agree to receive emails, text messages, phone calls for appointments notifications, special promotions and new features or products introduced by HMG or any third party.",textAlign: TextAlign.center,style: TextStyle(fontWeight: FontWeight.bold,fontSize: 16)), - ), - ], - ) - /////////// - ]) - - - - )); + return BaseView( + onModelReady: (model) => model.getUserTermsAndConditions(), + builder: (_, model, w) => AppScaffold( + isShowAppBar: true, + appBarTitle: TranslationBase.of(context).userAgreement, + body: SingleChildScrollView( + child: Html( + data: model.userAgreementContent, + ), + )), + ); } } diff --git a/lib/pages/medical/balance/dialogs/SelectCiteisDialog.dart b/lib/pages/medical/balance/dialogs/SelectCiteisDialog.dart index 3d07c08c..19e4fea4 100644 --- a/lib/pages/medical/balance/dialogs/SelectCiteisDialog.dart +++ b/lib/pages/medical/balance/dialogs/SelectCiteisDialog.dart @@ -1,9 +1,11 @@ //import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart'; import 'package:diplomaticquarterapp/core/model/blooddonation/get_all_cities.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; class SelectCiteisDialog extends StatefulWidget { final List hospitals; @@ -12,6 +14,7 @@ class SelectCiteisDialog extends StatefulWidget { SelectCiteisDialog( {Key key, this.hospitals, this.onValueSelected, this.selectedHospital}); + @override _SelectCiteisDialogState createState() => _SelectCiteisDialogState(); } @@ -24,9 +27,10 @@ class _SelectCiteisDialogState extends State { widget.selectedHospital = widget.selectedHospital ?? widget.hospitals[0]; } - @override Widget build(BuildContext context) { + ProjectViewModel projectProvider = Provider.of(context); + return SimpleDialog( children: [ Column( @@ -34,7 +38,7 @@ class _SelectCiteisDialogState extends State { Divider(), ...List.generate( widget.hospitals.length, - (index) => Column( + (index) => Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ SizedBox( @@ -53,7 +57,9 @@ class _SelectCiteisDialogState extends State { child: ListTile( // title: Text(widget.hospitals[index].description + // ' ${widget.hospitals[index].distanceInKilometers} KM'), - title: Text(widget.hospitals[index].description), + title: Text(projectProvider.isArabic + ? widget.hospitals[index].descriptionN + : widget.hospitals[index].description), leading: Radio( value: widget.hospitals[index], groupValue: widget.selectedHospital, @@ -116,9 +122,9 @@ class _SelectCiteisDialogState extends State { padding: const EdgeInsets.all(8.0), child: Center( child: Texts( - TranslationBase.of(context).ok, - fontWeight: FontWeight.w400, - )), + TranslationBase.of(context).ok, + fontWeight: FontWeight.w400, + )), ), ), ), diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index 72ab198b..f6f2c664 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -1263,6 +1263,8 @@ class TranslationBase { String get sendChildEmailMsg => localizedValues["send-child-email-msg"][locale.languageCode]; String get vaccinationAddChildMsg => localizedValues["vaccination-add-child-msg"][locale.languageCode]; String get childAddedSuccessfully => localizedValues["child_added_successfully"][locale.languageCode]; + String get bloodDEnterDesc => localizedValues["bloodD-enter-desc"][locale.languageCode]; + String get viewTermsConditions => localizedValues["viewTermsConditions"][locale.languageCode]; } From db2376f50c73758202cac3254e6a715859d38ea6 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Thu, 21 Jan 2021 18:42:07 +0200 Subject: [PATCH 29/42] fix blood and weight on my trackers --- ios/Podfile.lock | 14 +- lib/config/config.dart | 4 + lib/config/localized_values.dart | 4 + .../service/medical/BloodSugarService.dart | 40 +- .../medical/WeightPressureService.dart | 52 ++- .../medical/blood_sugar_view_model.dart | 116 +++--- .../medical/weight_pressure_view_model.dart | 105 +++--- lib/core/viewModels/project_view_model.dart | 2 +- lib/locator.dart | 2 +- .../my_trackers/Weight/AddWeightPage.dart | 351 +++++++++++------- .../my_trackers/Weight/WeightHomePage.dart | 85 +---- .../my_trackers/Weight/WeightMonthlyPage.dart | 69 ++-- .../my_trackers/Weight/WeightWeeklyPage.dart | 118 ++++-- .../my_trackers/Weight/WeightYeaPage.dart | 67 ++-- .../blood_suger/AddBloodSugarPage.dart | 103 +++-- .../my_trackers/blood_suger/BloodMonthly.dart | 23 +- .../my_trackers/blood_suger/BloodYeaPage.dart | 19 +- .../blood_suger/blood_sugar_home_page.dart | 97 ++--- .../blood_suger/blood_sugar_weekly_page.dart | 31 +- .../my_trackers/widget/LineChartCurved.dart | 222 +++++++++++ .../widget/MonthLineChartCurved.dart | 206 ++++++++++ .../my_trackers/widget/TabBarWidget.dart | 73 ++++ .../medical/vital_sign/LineChartCurved.dart | 4 +- lib/uitl/translations_delegate_base.dart | 1 + lib/widgets/charts/app_time_series_chart.dart | 6 + lib/widgets/others/app_scaffold_widget.dart | 6 +- 26 files changed, 1276 insertions(+), 544 deletions(-) create mode 100644 lib/pages/medical/my_trackers/widget/LineChartCurved.dart create mode 100644 lib/pages/medical/my_trackers/widget/MonthLineChartCurved.dart create mode 100644 lib/pages/medical/my_trackers/widget/TabBarWidget.dart diff --git a/ios/Podfile.lock b/ios/Podfile.lock index e16b62e0..fdb971fd 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -20,7 +20,7 @@ PODS: - Firebase/Messaging (6.33.0): - Firebase/CoreOnly - FirebaseMessaging (~> 4.7.0) - - firebase_core (0.5.2): + - firebase_core (0.5.3): - Firebase/CoreOnly (~> 6.33.0) - Flutter - firebase_core_web (0.1.0): @@ -70,7 +70,7 @@ PODS: - Flutter - flutter_tts (0.0.1): - Flutter - - "geolocator (6.0.0+4)": + - geolocator (6.1.9): - Flutter - google_maps_flutter (0.0.1): - Flutter @@ -110,6 +110,8 @@ PODS: - Flutter - local_auth (0.0.1): - Flutter + - location (0.0.1): + - Flutter - manage_calendar_events (0.0.1): - Flutter - map_launcher (0.0.1): @@ -213,6 +215,7 @@ DEPENDENCIES: - image_picker (from `.symlinks/plugins/image_picker/ios`) - just_audio (from `.symlinks/plugins/just_audio/ios`) - local_auth (from `.symlinks/plugins/local_auth/ios`) + - location (from `.symlinks/plugins/location/ios`) - manage_calendar_events (from `.symlinks/plugins/manage_calendar_events/ios`) - map_launcher (from `.symlinks/plugins/map_launcher/ios`) - maps_launcher (from `.symlinks/plugins/maps_launcher/ios`) @@ -315,6 +318,8 @@ EXTERNAL SOURCES: :path: ".symlinks/plugins/just_audio/ios" local_auth: :path: ".symlinks/plugins/local_auth/ios" + location: + :path: ".symlinks/plugins/location/ios" manage_calendar_events: :path: ".symlinks/plugins/manage_calendar_events/ios" map_launcher: @@ -385,7 +390,7 @@ SPEC CHECKSUMS: device_calendar: 23b28a5f1ab3bf77e34542fb1167e1b8b29a98f5 device_info: d7d233b645a32c40dfdc212de5cf646ca482f175 Firebase: 8db6f2d1b2c5e2984efba4949a145875a8f65fe5 - firebase_core: 350ba329d1641211bc6183a3236893cafdacfea7 + firebase_core: 5d6a02f3d85acd5f8321c2d6d62877626a670659 firebase_core_web: d501d8b946b60c8af265428ce483b0fff5ad52d1 firebase_messaging: 0aea2cd5885b65e19ede58ee3507f485c992cc75 FirebaseCore: d889d9e12535b7f36ac8bfbf1713a0836a3012cd @@ -400,7 +405,7 @@ SPEC CHECKSUMS: flutter_local_notifications: 9e4738ce2471c5af910d961a6b7eadcf57c50186 flutter_plugin_android_lifecycle: dc0b544e129eebb77a6bfb1239d4d1c673a60a35 flutter_tts: 0f492aab6accf87059b72354fcb4ba934304771d - geolocator: 1ae40084cc6c1586ce5ad12cfc3fd38c64d05f2f + geolocator: 057a0c63a43e9c5296d8ad845a3ac8e6df23d899 google_maps_flutter: c7f9c73576de1fbe152a227bfd6e6c4ae8088619 GoogleDataTransport: f56af7caa4ed338dc8e138a5d7c5973e66440833 GoogleMaps: 4b5346bddfe6911bb89155d43c903020170523ac @@ -410,6 +415,7 @@ SPEC CHECKSUMS: image_picker: 9c3312491f862b28d21ecd8fdf0ee14e601b3f09 just_audio: baa7252489dbcf47a4c7cc9ca663e9661c99aafa local_auth: 25938960984c3a7f6e3253e3f8d962fdd16852bd + location: 3a2eed4dd2fab25e7b7baf2a9efefe82b512d740 manage_calendar_events: 0338d505ea26cdfd20cd883279bc28afa11eca34 map_launcher: e325db1261d029ff33e08e03baccffe09593ffea maps_launcher: eae38ee13a9c3f210fa04e04bb4c073fa4c6ed92 diff --git a/lib/config/config.dart b/lib/config/config.dart index 1a34e96d..f25d3272 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -288,6 +288,8 @@ const GET_PATIENT_LAST_RECORD = 'Services/Patients.svc/REST/Med_GetPatientLastRe const GET_DIABETIC_RESULT_AVERAGE = 'Services/Patients.svc/REST/Patient_GetDiabeticResultAverage'; const GET_DIABTEC_RESULT = 'Services/Patients.svc/REST/Patient_GetDiabtecResults'; const ADD_DIABTEC_RESULT = 'Services/Patients.svc/REST/Patient_AddDiabtecResult'; +const SEND_AVERAGE_BLOOD_SUGAR_REPORT = 'Services/Notifications.svc/REST/SendAverageBloodSugarReport'; +const DEACTIVATE_DIABETIC_STATUS = 'services/Patients.svc/REST/Patient_DeactivateDiabeticStatus'; const GET_BLOOD_PRESSURE_RESULT_AVERAGE = 'Services/Patients.svc/REST/Patient_GetBloodPressureResultAverage'; const GET_BLOOD_PRESSURE_RESULT = 'Services/Patients.svc/REST/Patient_GetBloodPressureResult'; @@ -298,6 +300,8 @@ const UPDATE_DIABETIC_RESULT = 'Services/Patients.svc/REST/Patient_UpdateDiabeti const GET_WEIGHT_PRESSURE_RESULT_AVERAGE = 'Services/Patients.svc/REST/Patient_GetWeightMeasurementResultAverage'; const GET_WEIGHT_PRESSURE_RESULT = 'Services/Patients.svc/REST/Patient_GetWeightMeasurementResult'; const ADD_WEIGHT_PRESSURE_RESULT = 'Services/Patients.svc/REST/Patient_AddWeightMeasurementResult'; +const UPDATE_WEIGHT_PRESSURE_RESULT = 'Services/Patients.svc/REST/Patient_UpdateWeightMeasurementResult'; +const DEACTIVATE_WEIGHT_PRESSURE_RESULT = 'services/Patients.svc/REST/Patient_DeactivateWeightMeasurementStatus'; const ADD_ACTIVE_PRESCRIPTIONS_REPORT_BY_PATIENT_ID = 'Services/Patients.svc/Rest/GetActivePrescriptionReportByPatientID'; diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 09f279ed..a184006c 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -1568,4 +1568,8 @@ const Map localizedValues = { "bloodD-enter-desc": {"en" : "Enter the required information, In order to register for Blood Donation Service", "ar": "أدخل المعلومات المطلوبة ، للتسجيل في خدمة التبرع بالدم"}, "viewTermsConditions": {"en" : "To view the terms and conditions", "ar": "لعرض الشروط والأحكام"}, // "visit": {"en" : "Visit", "ar": "الزيارة"}, + "weight-add": { + "en": "Enter Weight Value", + "ar": "أدخل الوزن " + }, }; diff --git a/lib/core/service/medical/BloodSugarService.dart b/lib/core/service/medical/BloodSugarService.dart index e0c5007c..e8e2fabf 100644 --- a/lib/core/service/medical/BloodSugarService.dart +++ b/lib/core/service/medical/BloodSugarService.dart @@ -24,6 +24,11 @@ class BloodSugarService extends BaseService { monthDiabtectResultAverageList.clear(); weekDiabtectResultAverageList.clear(); yearDiabtecResultAverageList.clear(); + + monthDiabtecPatientResult.clear(); + weekDiabtecPatientResult.clear(); + yearDiabtecPatientResult.clear(); + response['List_MonthDiabtectResultAverage'].forEach((item) { monthDiabtectResultAverageList .add(MonthDiabtectResultAverage.fromJson(item)); @@ -76,15 +81,16 @@ class BloodSugarService extends BaseService { body['BloodSugerDateChart'] = bloodSugerDateChart; body['BloodSugerResult'] = bloodSugerResult; body['DiabtecUnit'] = diabtecUnit; - body['MeasuredTime'] = measuredTime; + body['MeasuredTime'] = measuredTime+1; body['isDentalAllowedBackend'] = false; - await baseAppClient.post(ADD_BLOOD_PRESSURE_RESULT, + await baseAppClient.post(ADD_DIABTEC_RESULT, onSuccess: (response, statusCode) async {}, onFailure: (String error, int statusCode) { hasError = true; super.error = error; }, body: body); } + updateDiabtecResult({DateTime month,DateTime hour,String bloodSugerResult,String diabtecUnit, int measuredTime,int lineItemNo}) async { hasError = false; super.error = ""; @@ -93,7 +99,7 @@ class BloodSugarService extends BaseService { body['DiabtecUnit'] = diabtecUnit; body['BloodSugerDateChart'] = '${month.year}-${month.month}-${month.day} ${hour.hour}:${hour.minute}:00'; body['isDentalAllowedBackend'] = false; - body['MeasuredTime'] = measuredTime; + body['MeasuredTime'] = measuredTime+1; body['LineItemNo'] = lineItemNo; await baseAppClient.post(UPDATE_DIABETIC_RESULT, onSuccess: (response, statusCode) async {}, @@ -102,4 +108,32 @@ class BloodSugarService extends BaseService { super.error = error; }, body: body); } + + Future sendReportByEmail() async { + hasError = false; + super.error = ""; + Map body = Map(); + body['isDentalAllowedBackend'] = false; + body['to'] = user.emailAddress; + await baseAppClient.post(SEND_AVERAGE_BLOOD_SUGAR_REPORT, + onSuccess: (response, statusCode) async {}, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } + + Future deactivateDiabeticStatus({int lineItemNo }) async { + hasError = false; + super.error = ""; + Map body = Map(); + body['isDentalAllowedBackend'] = false; + body['LineItemNo'] =lineItemNo; + await baseAppClient.post(DEACTIVATE_DIABETIC_STATUS, + onSuccess: (response, statusCode) async {}, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } } diff --git a/lib/core/service/medical/WeightPressureService.dart b/lib/core/service/medical/WeightPressureService.dart index 27048dc8..3c38e5d2 100644 --- a/lib/core/service/medical/WeightPressureService.dart +++ b/lib/core/service/medical/WeightPressureService.dart @@ -6,11 +6,13 @@ import 'package:diplomaticquarterapp/core/model/my_trakers/weight/YearWeightMeas import 'package:diplomaticquarterapp/core/service/base_service.dart'; class WeightService extends BaseService { - ///Average - List monthWeightMeasurementResultAverage = List(); - List weekWeightMeasurementResultAverage = List(); - List yearWeightMeasurementResultAverage = List(); + List + monthWeightMeasurementResultAverage = List(); + List weekWeightMeasurementResultAverage = + List(); + List yearWeightMeasurementResultAverage = + List(); ///Result List monthWeightMeasurementResult = List(); @@ -59,7 +61,8 @@ class WeightService extends BaseService { }); response['List_MonthWeightMeasurementResult'].forEach((item) { - monthWeightMeasurementResult.add(WeightMeasurementResult.fromJson(item)); + monthWeightMeasurementResult + .add(WeightMeasurementResult.fromJson(item)); }); response['List_YearWeightMeasurementResult'].forEach((item) { @@ -72,9 +75,7 @@ class WeightService extends BaseService { } addWeightResult( - {String weightDate, - String weightMeasured, - int weightUnit}) async { + {String weightDate, String weightMeasured, int weightUnit}) async { hasError = false; super.error = ""; @@ -85,9 +86,40 @@ class WeightService extends BaseService { body['isDentalAllowedBackend'] = false; await baseAppClient.post(ADD_WEIGHT_PRESSURE_RESULT, - onSuccess: (response, statusCode) async { + onSuccess: (response, statusCode) async {}, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } + + updateWeightResult({int lineItemNo, int weightUnit,String weightMeasured,String weightDate}) async { + hasError = false; + super.error = ""; + Map body = Map(); + body['LineItemNo'] = lineItemNo; + body['weightUnit'] = '$weightUnit'; + body['WeightMeasured'] = weightMeasured; + body['WeightDate'] = weightDate; + body['isDentalAllowedBackend'] = false; + + await baseAppClient.post(UPDATE_WEIGHT_PRESSURE_RESULT, + onSuccess: (response, statusCode) async {}, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } + + deleteWeightResult({int lineItemNo, }) async { + hasError = false; + super.error = ""; + Map body = Map(); + body['LineItemNo'] = lineItemNo; + body['isDentalAllowedBackend'] = false; - }, + await baseAppClient.post(DEACTIVATE_WEIGHT_PRESSURE_RESULT, + onSuccess: (response, statusCode) async {}, onFailure: (String error, int statusCode) { hasError = true; super.error = error; diff --git a/lib/core/viewModels/medical/blood_sugar_view_model.dart b/lib/core/viewModels/medical/blood_sugar_view_model.dart index 29cc3249..8a513992 100644 --- a/lib/core/viewModels/medical/blood_sugar_view_model.dart +++ b/lib/core/viewModels/medical/blood_sugar_view_model.dart @@ -5,17 +5,13 @@ import 'package:diplomaticquarterapp/core/model/my_trakers/chartData/YearMonthly import 'package:diplomaticquarterapp/core/service/medical/BloodSugarService.dart'; import 'package:diplomaticquarterapp/locator.dart'; import 'package:charts_flutter/flutter.dart' as charts; +import 'package:diplomaticquarterapp/widgets/charts/app_time_series_chart.dart'; import '../../../core/viewModels/base_view_model.dart'; class BloodSugarViewMode extends BaseViewModel { BloodSugarService bloodSugarService = locator(); - ///BLOOD - List _bloodWeeklyTimeSeriesSalesList = List(); - List _bloodMonthlyTimeSeriesSalesList = List(); - List _bloodYearTimeSeriesSalesList = List(); - List get monthDiabtecPatientResult => bloodSugarService.monthDiabtecPatientResult; @@ -25,6 +21,10 @@ class BloodSugarViewMode extends BaseViewModel { List get yearDiabtecPatientResult => bloodSugarService.yearDiabtecPatientResult; + List bloodWeekTimeSeriesData = []; + List yearTimeSeriesData = []; + List monthTimeSeriesData = []; + Future getBloodSugar() async { setState(ViewState.Busy); await bloodSugarService.getBloodSugar(); @@ -34,70 +34,43 @@ class BloodSugarViewMode extends BaseViewModel { setState(ViewState.Error); } else { bloodSugarService.weekDiabtectResultAverageList.forEach((element) { - _bloodWeeklyTimeSeriesSalesList.add( - WeekChartDate(x: element.dateChart, y: element.dailyAverageResult)); + bloodWeekTimeSeriesData.add(TimeSeriesSales2( + element.dateChart, + element.dailyAverageResult.toDouble(), + )); }); for (int index = 0; index < bloodSugarService.monthDiabtectResultAverageList.length; index++) { - _bloodMonthlyTimeSeriesSalesList.add(YearMonthlyChartDate( - x: index, - y: bloodSugarService - .monthDiabtectResultAverageList[index].weekAverageResult)); + monthTimeSeriesData.add(TimeSeriesSales3( + index, + bloodSugarService + .monthDiabtectResultAverageList[index].weekAverageResult + .toDouble(), + )); } bloodSugarService.yearDiabtecResultAverageList.forEach((element) { - _bloodYearTimeSeriesSalesList - .add(WeekChartDate(x: element.date, y: element.monthAverageResult)); + yearTimeSeriesData.add(TimeSeriesSales2( + element.date, + element.monthAverageResult.toDouble(), + )); }); setState(ViewState.Idle); } } - List> getBloodWeeklySeries() { - return [ - new charts.Series( - id: 'Sales', - colorFn: (_, __) => charts.MaterialPalette.red.shadeDefault, - domainFn: (WeekChartDate sales, _) => sales.x, - measureFn: (WeekChartDate sales, _) => sales.y, - data: _bloodWeeklyTimeSeriesSalesList, - ) - ]; - } - - List> - getBloodMonthlyTimeSeriesSales() { - return [ - new charts.Series( - id: 'Sales', - colorFn: (_, __) => charts.MaterialPalette.red.shadeDefault, - domainFn: (YearMonthlyChartDate sales, _) => sales.x, - measureFn: (YearMonthlyChartDate sales, _) => sales.y, - data: _bloodMonthlyTimeSeriesSalesList, - ) - ]; - } - - List> getBloodYearTimeSeriesSales() { - return [ - new charts.Series( - id: 'Sales', - colorFn: (_, __) => charts.MaterialPalette.red.shadeDefault, - domainFn: (WeekChartDate sales, _) => sales.x, - measureFn: (WeekChartDate sales, _) => sales.y, - data: _bloodYearTimeSeriesSalesList, - ) - ]; - } - - Future addDiabtecResult({String bloodSugerDateChart, String bloodSugerResult, String diabtecUnit, int measuredTime}) async { + Future addDiabtecResult( + {String bloodSugerDateChart, + String bloodSugerResult, + String diabtecUnit, + int measuredTime}) async { setState(ViewState.BusyLocal); await bloodSugarService.addDiabtecResult( bloodSugerDateChart: bloodSugerDateChart, - bloodSugerResult: bloodSugerResult , + bloodSugerResult: bloodSugerResult, diabtecUnit: diabtecUnit, measuredTime: measuredTime); if (bloodSugarService.hasError) { @@ -109,10 +82,17 @@ class BloodSugarViewMode extends BaseViewModel { } } - Future updateDiabtecResult({DateTime month,DateTime hour,String bloodSugerResult,String diabtecUnit, int measuredTime,int lineItemNo}) async { + Future updateDiabtecResult( + {DateTime month, + DateTime hour, + String bloodSugerResult, + String diabtecUnit, + int measuredTime, + int lineItemNo}) async { setState(ViewState.BusyLocal); + await bloodSugarService.updateDiabtecResult( - bloodSugerResult: bloodSugerResult , + bloodSugerResult: bloodSugerResult, diabtecUnit: diabtecUnit, hour: hour, measuredTime: measuredTime, @@ -120,13 +100,35 @@ class BloodSugarViewMode extends BaseViewModel { month: month); if (bloodSugarService.hasError) { error = bloodSugarService.error; - setState(ViewState.Error); + setState(ViewState.ErrorLocal); } else { await getBloodSugar(); setState(ViewState.Idle); } } - - + Future sendReportByEmail() async { + setState(ViewState.BusyLocal); + + await bloodSugarService.sendReportByEmail(); + if (bloodSugarService.hasError) { + error = bloodSugarService.error; + setState(ViewState.ErrorLocal); + } else { + setState(ViewState.Idle); + } + } + + Future deactivateDiabeticStatus({int lineItemNo}) async { + setState(ViewState.BusyLocal); + + await bloodSugarService.deactivateDiabeticStatus(lineItemNo: lineItemNo); + if (bloodSugarService.hasError) { + error = bloodSugarService.error; + setState(ViewState.ErrorLocal); + } else { + await getBloodSugar(); + setState(ViewState.Idle); + } + } } diff --git a/lib/core/viewModels/medical/weight_pressure_view_model.dart b/lib/core/viewModels/medical/weight_pressure_view_model.dart index 29095895..24ddae18 100644 --- a/lib/core/viewModels/medical/weight_pressure_view_model.dart +++ b/lib/core/viewModels/medical/weight_pressure_view_model.dart @@ -9,16 +9,13 @@ import 'package:diplomaticquarterapp/core/service/medical/BloodSugarService.dart import 'package:diplomaticquarterapp/core/service/medical/WeightPressureService.dart'; import 'package:diplomaticquarterapp/locator.dart'; import 'package:charts_flutter/flutter.dart' as charts; +import 'package:diplomaticquarterapp/widgets/charts/app_time_series_chart.dart'; import '../../../core/viewModels/base_view_model.dart'; -class WeightPressureViewMode extends BaseViewModel { +class WeightPressureViewModel extends BaseViewModel { WeightService weightService = locator(); - List _weightWeeklyTimeSeriesSalesList = List(); - List _weightMonthlyTimeSeriesSalesList = List(); - List _weightYearTimeSeriesSalesList = List(); - List get monthWeightMeasurementResult => weightService.monthWeightMeasurementResult; @@ -28,6 +25,10 @@ class WeightPressureViewMode extends BaseViewModel { List get yearWeightMeasurementResult => weightService.yearWeightMeasurementResult; + List weightWeekTimeSeriesData = []; + List weighMonthTimeSeriesData = []; + List weightYearTimeSeriesData = []; + Future getWeight() async { setState(ViewState.Busy); await weightService.getWeightAverage(); @@ -37,71 +38,73 @@ class WeightPressureViewMode extends BaseViewModel { setState(ViewState.Error); } else { weightService.weekWeightMeasurementResultAverage.forEach((element) { - _weightWeeklyTimeSeriesSalesList.add(WeekChartDate( - x: element.weightDate, y: element.dailyAverageResult)); + weightWeekTimeSeriesData.add(TimeSeriesSales2( + element.weightDate, + element.dailyAverageResult.toDouble(), + )); }); for (int index = 0; index < weightService.monthWeightMeasurementResultAverage.length; index++) { - _weightMonthlyTimeSeriesSalesList.add(YearMonthlyChartDate( - x: index, - y: weightService.monthWeightMeasurementResultAverage[index].weekAverageResult)); + weighMonthTimeSeriesData.add(TimeSeriesSales3( + index, + weightService + .monthWeightMeasurementResultAverage[index].weekAverageResult + .toDouble(), + )); } weightService.yearWeightMeasurementResultAverage.forEach((element) { - _weightYearTimeSeriesSalesList - .add(WeekChartDate(x: element.date, y: element.monthAverageResult)); + weightYearTimeSeriesData.add(TimeSeriesSales2( + element.date, + element.monthAverageResult.toDouble(), + )); }); setState(ViewState.Idle); } } - List> getWeightWeeklySeries() { - return [ - charts.Series( - id: 'Diastolic', - colorFn: (_, __) => charts.MaterialPalette.red.shadeDefault, - domainFn: (WeekChartDate sales, _) => sales.x, - measureFn: (WeekChartDate sales, _) => sales.y, - data: _weightWeeklyTimeSeriesSalesList, - ), - ]; - } - - List> - getWeightMonthlyTimeSeriesSales() { - return [ - charts.Series( - id: 'Sales', - colorFn: (_, __) => charts.MaterialPalette.red.shadeDefault, - domainFn: (YearMonthlyChartDate sales, _) => sales.x, - measureFn: (YearMonthlyChartDate sales, _) => sales.y, - data: _weightMonthlyTimeSeriesSalesList, - ), - ]; + addWeightResult( + {String weightDate, String weightMeasured, int weightUnit}) async { + setState(ViewState.BusyLocal); + await weightService.addWeightResult( + weightDate: weightDate, + weightMeasured: weightMeasured, + weightUnit: weightUnit, + ); + if (weightService.hasError) { + error = weightService.error; + setState(ViewState.Error); + } else { + await getWeight(); + setState(ViewState.Idle); + } } - List> getWeightYearTimeSeriesSales() { - return [ - charts.Series( - id: 'Sales', - colorFn: (_, __) => charts.MaterialPalette.red.shadeDefault, - domainFn: (WeekChartDate sales, _) => sales.x, - measureFn: (WeekChartDate sales, _) => sales.y, - data: _weightYearTimeSeriesSalesList, - ), - ]; + updateWeightResult({int lineItemNo, int weightUnit, String weightMeasured,String weightDate}) async { + setState(ViewState.BusyLocal); + await weightService.updateWeightResult( + lineItemNo: lineItemNo, + weightMeasured: weightMeasured, + weightUnit: weightUnit, + weightDate: weightDate + ); + if (weightService.hasError) { + error = weightService.error; + setState(ViewState.Error); + } else { + await getWeight(); + setState(ViewState.Idle); + } } - addWeightResult( - {String weightDate, String weightMeasured, int weightUnit}) async { + deleteWeightResult({int lineItemNo, }) async { setState(ViewState.BusyLocal); - await weightService.addWeightResult( - weightDate: weightDate, - weightMeasured: weightMeasured, - weightUnit: weightUnit,); + await weightService.deleteWeightResult( + lineItemNo: lineItemNo, + ); if (weightService.hasError) { error = weightService.error; setState(ViewState.Error); diff --git a/lib/core/viewModels/project_view_model.dart b/lib/core/viewModels/project_view_model.dart index baaf6b5b..2bb75305 100644 --- a/lib/core/viewModels/project_view_model.dart +++ b/lib/core/viewModels/project_view_model.dart @@ -32,7 +32,7 @@ class ProjectViewModel extends BaseViewModel { Locale get appLocal => _appLocale; - LocaleType get localeType => isArabic ? LocaleType.en : LocaleType.ar; + LocaleType get localeType => isArabic ? LocaleType.ar : LocaleType.en; bool get isArabic => _isArabic; diff --git a/lib/locator.dart b/lib/locator.dart index 89cafd68..c5bde524 100644 --- a/lib/locator.dart +++ b/lib/locator.dart @@ -248,7 +248,7 @@ void setupLocator() { locator.registerFactory(() => H2OViewModel()); locator.registerFactory(() => BloodSugarViewMode()); locator.registerFactory(() => BloodPressureViewMode()); - locator.registerFactory(() => WeightPressureViewMode()); + locator.registerFactory(() => WeightPressureViewModel()); locator.registerFactory(() => EyeViewModel()); locator.registerFactory(() => ActiveMedicationsViewModel()); locator.registerFactory(() => AskDoctorViewModel()); diff --git a/lib/pages/medical/my_trackers/Weight/AddWeightPage.dart b/lib/pages/medical/my_trackers/Weight/AddWeightPage.dart index a7b23191..aa087081 100644 --- a/lib/pages/medical/my_trackers/Weight/AddWeightPage.dart +++ b/lib/pages/medical/my_trackers/Weight/AddWeightPage.dart @@ -1,188 +1,283 @@ import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; -import 'package:diplomaticquarterapp/core/viewModels/medical/blood_pressure_view_model.dart'; -import 'package:diplomaticquarterapp/core/viewModels/medical/blood_sugar_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/weight_pressure_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; -import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/medical/balance/new_text_Field.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.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'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/RadioStringDialog.dart'; +import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; -import 'package:feather_icons_flutter/feather_icons_flutter.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_datetime_picker/flutter_datetime_picker.dart'; import 'package:provider/provider.dart'; class AddWeightPage extends StatefulWidget { + final WeightPressureViewModel model; + final bool isUpdate; + final DateTime dayWeightDate; + final int lineItemNo; + final String weightValue; + final String measureTimeSelectedType; + final int weightUnit; + + AddWeightPage( + {Key key, + this.model, + this.isUpdate = false, + this.dayWeightDate, + this.lineItemNo, + this.weightValue, + this.measureTimeSelectedType, + this.weightUnit}) + : super(key: key); + @override _AddWeightPageState createState() => _AddWeightPageState(); } class _AddWeightPageState extends State { TextEditingController _weightValueController = TextEditingController(); - DateTime bloodSugarDate = DateTime.now(); - DateTime timeSugarDate = DateTime.now(); + DateTime dayWeightDate = DateTime.now(); + DateTime timeWeightDate = DateTime.now(); int weightUnit = 1; final List measureUnitEnList = [ 'Kg', 'Pound', ]; - final List measureUnitArList = [ - 'Kg', - 'Pound', - ]; - String measureTimeSelectedType = 'Kg'; + final List measureUnitArList = ["كيلو جرام", "باوند"]; + String measureTimeSelectedType; + @override + void initState() { + super.initState(); + if (widget.isUpdate) { + dayWeightDate = widget.dayWeightDate; + timeWeightDate = widget.dayWeightDate; + measureTimeSelectedType = widget.measureTimeSelectedType; + if (measureUnitEnList.contains(widget.measureTimeSelectedType)) + weightUnit = measureUnitEnList.indexOf(widget.measureTimeSelectedType); + else if (measureUnitArList.contains(widget.measureTimeSelectedType)) + weightUnit = measureUnitArList.indexOf(widget.measureTimeSelectedType); + _weightValueController.text = widget.weightValue; + } + } @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); - return BaseView( - builder: (_, model, w) => AppScaffold( - isShowAppBar: true, - appBarTitle: 'Add', - body: SingleChildScrollView( - physics: BouncingScrollPhysics(), - child: Container( - margin: EdgeInsets.all(15), - child: Column( - children: [ - SizedBox( - height: 15, - ), - NewTextFields( - hintText: 'Enter Weight Value', - controller: _weightValueController, - keyboardType: TextInputType.number, - ), - SizedBox( - height: 8, - ), - InkWell( - onTap: () { - confirmSelectMeasureTimeDialog(projectViewModel.isArabic - ? measureUnitEnList - : measureUnitArList); + return AppScaffold( + isShowAppBar: true, + appBarTitle: widget.isUpdate + ? TranslationBase.of(context).update + : TranslationBase.of(context).add, + appBarIcons: [ + IconButton( + icon: Icon(Icons.delete), + color: Colors.white, + onPressed: () { + ConfirmDialog dialog = new ConfirmDialog( + context: context, + confirmMessage: 'Remove this measure', + okText: TranslationBase.of(context).ok, + cancelText: TranslationBase.of(context).cancel, + okFunction: () async { + ConfirmDialog.closeAlertDialog(context); + + GifLoaderDialogUtils.showMyDialog(context); + widget.model + .deleteWeightResult(lineItemNo: widget.lineItemNo) + .then((value) { + GifLoaderDialogUtils.hideDialog(context); + if (widget.model.state == ViewState.ErrorLocal) + AppToast.showErrorToast( + message: widget.model.error); + else + Navigator.pop(context); + }).catchError((e) { + GifLoaderDialogUtils.hideDialog(context); + AppToast.showErrorToast( + message: widget.model.error); + }); }, - child: Container( - padding: EdgeInsets.all(12), - width: double.infinity, - height: 65, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(12), - color: Colors.white), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Texts(measureTimeSelectedType), - Icon( - Icons.arrow_drop_down, - color: Colors.grey, - ) - ], - ), + cancelFunction: () => {}); + dialog.showAlertDialog(context); + }, + ) + ], + body: SingleChildScrollView( + physics: BouncingScrollPhysics(), + child: Container( + margin: EdgeInsets.all(15), + child: Column( + children: [ + SizedBox( + height: 15, + ), + NewTextFields( + hintText: TranslationBase.of(context).weightAdd, + controller: _weightValueController, + keyboardType: TextInputType.number, + ), + SizedBox( + height: 8, + ), + InkWell( + onTap: () { + confirmSelectMeasureTimeDialog(projectViewModel.isArabic + ? measureUnitArList + : measureUnitEnList); + }, + child: Container( + padding: EdgeInsets.all(12), + width: double.infinity, + height: 65, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Texts(measureTimeSelectedType ?? + TranslationBase.of(context).other), + Icon( + Icons.arrow_drop_down, + color: Colors.grey, + ) + ], ), ), - SizedBox( - height: 8, - ), - InkWell( - onTap: () { - DatePicker.showDatePicker(context, - showTitleActions: true, - minTime: DateTime(DateTime.now().year - 1, 1, 1), - maxTime: DateTime.now(), onConfirm: (date) { - print('confirm $date'); + ), + SizedBox( + height: 8, + ), + InkWell( + onTap: () { + DatePicker.showDatePicker( + context, + showTitleActions: true, + minTime: DateTime(DateTime.now().year - 1, 1, 1), + maxTime: DateTime.now(), + onConfirm: (date) { setState(() { - bloodSugarDate = date; + dayWeightDate = date; }); }, - currentTime: bloodSugarDate, - locale: projectViewModel.localeType); - }, - child: Container( - padding: EdgeInsets.all(12), - width: double.infinity, - height: 65, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(12), - color: Colors.white), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Texts('Date'), - Texts(getDate()), - ], - ), + currentTime: dayWeightDate, + locale: projectViewModel.localeType, + ); + }, + child: Container( + padding: EdgeInsets.all(12), + width: double.infinity, + height: 65, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Texts(TranslationBase.of(context).date), + Texts(getDate()), + ], ), ), - SizedBox( - height: 8, - ), - InkWell( - onTap: () { - DatePicker.showTimePicker(context, showTitleActions: true, - onConfirm: (date) { - print('confirm $date'); + ), + SizedBox( + height: 8, + ), + InkWell( + onTap: () { + DatePicker.showTimePicker( + context, + showTitleActions: true, + onConfirm: (date) { setState(() { - timeSugarDate = date; + timeWeightDate = date; }); }, - currentTime: timeSugarDate, - locale: projectViewModel.localeType); - }, - child: Container( - padding: EdgeInsets.all(12), - width: double.infinity, - height: 65, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(12), - color: Colors.white), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [Texts('Time'), Texts(getTime())], - ), + currentTime: timeWeightDate, + locale: projectViewModel.localeType, + ); + }, + child: Container( + padding: EdgeInsets.all(12), + width: double.infinity, + height: 65, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Texts(TranslationBase.of(context).time), + Texts(getTime()) + ], ), ), - ], - ), + ), + ], ), ), - bottomSheet: Container( - color: Colors.transparent, - width: double.infinity, - height: MediaQuery.of(context).size.width * 0.2, - child: Padding( - padding: const EdgeInsets.all(15.0), - child: SecondaryButton( - loading: model.state == ViewState.BusyLocal, - label: 'SAVE', - textColor: Colors.white, - onTap: () { - if (_weightValueController.text.isNotEmpty ) { - model.addWeightResult( - weightDate: '${bloodSugarDate.year}-${bloodSugarDate.month}-${bloodSugarDate.day} ${timeSugarDate.hour}:${timeSugarDate.minute}:00', + ), + bottomSheet: Container( + color: Colors.transparent, + width: double.infinity, + height: MediaQuery.of(context).size.width * 0.2, + child: Padding( + padding: const EdgeInsets.all(15.0), + child: SecondaryButton( + loading: widget.model.state == ViewState.BusyLocal, + label: TranslationBase.of(context).save.toUpperCase(), + textColor: Colors.white, + onTap: () { + if (_weightValueController.text.isNotEmpty) { + if (widget.isUpdate) { + GifLoaderDialogUtils.showMyDialog(context); + widget.model.updateWeightResult( + weightDate: '${dayWeightDate.year}-${dayWeightDate.month}-${dayWeightDate.day} ${timeWeightDate.hour}:${timeWeightDate.minute}:00', weightMeasured: _weightValueController.text.toString(), weightUnit: weightUnit, - ); - } - }), - ), + lineItemNo: widget.lineItemNo + ) + .then((value) { + GifLoaderDialogUtils.hideDialog(context); + if (widget.model.state == ViewState.Error) + AppToast.showErrorToast(message: widget.model.error); + else + Navigator.pop(context); + }); + } else + widget.model.addWeightResult( + weightDate: '${dayWeightDate.year}-${dayWeightDate.month}-${dayWeightDate.day} ${timeWeightDate.hour}:${timeWeightDate.minute}:00', + weightMeasured: _weightValueController.text.toString(), + weightUnit: weightUnit, + ) + .then((value) { + GifLoaderDialogUtils.hideDialog(context); + if (widget.model.state == ViewState.Error) + AppToast.showErrorToast(message: widget.model.error); + else + Navigator.pop(context); + }); + } + }), ), ), ); } String getDate() { - return "${DateUtil.getMonth(bloodSugarDate.month)} ${bloodSugarDate.day}, ${bloodSugarDate.year}"; + return "${DateUtil.getMonth(dayWeightDate.month)} ${dayWeightDate.day}, ${dayWeightDate.year}"; } String getTime() { - return " ${timeSugarDate.hour}:${timeSugarDate.minute}"; + return " ${timeWeightDate.hour}:${timeWeightDate.minute}"; } void confirmSelectMeasureTimeDialog(List list) { @@ -190,7 +285,7 @@ class _AddWeightPageState extends State { context: context, child: RadioStringDialog( radioList: list, - title: 'Measure unit', + title: TranslationBase.of(context).measureUnit, selectedValue: measureTimeSelectedType, onValueSelected: (value) { setState(() { diff --git a/lib/pages/medical/my_trackers/Weight/WeightHomePage.dart b/lib/pages/medical/my_trackers/Weight/WeightHomePage.dart index 9bd89a2c..cbe5de17 100644 --- a/lib/pages/medical/my_trackers/Weight/WeightHomePage.dart +++ b/lib/pages/medical/my_trackers/Weight/WeightHomePage.dart @@ -1,12 +1,11 @@ -import 'dart:ui'; import 'package:diplomaticquarterapp/core/viewModels/medical/weight_pressure_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; -import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/pages/medical/my_trackers/widget/TabBarWidget.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:hexcolor/hexcolor.dart'; import 'AddWeightPage.dart'; import 'WeightMonthlyPage.dart'; import 'WeightYeaPage.dart'; @@ -35,73 +34,16 @@ class _WeightHomePageState extends State @override Widget build(BuildContext context) { - return BaseView( + return BaseView( onModelReady: (model) => model.getWeight(), builder: (_, model, w) => AppScaffold( isShowAppBar: true, - appBarTitle: 'Weight', + appBarTitle: TranslationBase.of(context).weight, baseViewModel: model, body: Scaffold( extendBodyBehindAppBar: true, - appBar: PreferredSize( - preferredSize: Size.fromHeight(60.0), - child: Stack( - children: [ - Positioned( - bottom: 1, - left: 0, - right: 0, - child: BackdropFilter( - filter: ImageFilter.blur(sigmaX: 10, sigmaY: 10), - child: Container( - color: Theme.of(context) - .scaffoldBackgroundColor - .withOpacity(0.8), - height: 70.0, - ), - ), - ), - Center( - child: Container( - height: 55.0, - color: Colors.white, - child: Center( - child: TabBar( - isScrollable: true, - controller: _tabController, - indicatorWeight: 5.0, - indicatorSize: TabBarIndicatorSize.tab, - indicatorColor: Colors.red[800], - labelColor: Theme.of(context).primaryColor, - labelPadding: - EdgeInsets.only(top: 4.0, left: 5.0, right: 5.0), - unselectedLabelColor: Colors.grey[800], - tabs: [ - Container( - width: MediaQuery.of(context).size.width * 0.27, - child: Center( - child: Texts('Weekly'), - ), - ), - Container( - width: MediaQuery.of(context).size.width * 0.27, - child: Center( - child: Texts('Monthly'), - ), - ), - Container( - width: MediaQuery.of(context).size.width * 0.27, - child: Center( - child: Texts('Yearly'), - ), - ), - ], - ), - ), - ), - ), - ], - ), + appBar: TabBarWidget( + tabController: _tabController, ), body: Column( children: [ @@ -111,16 +53,13 @@ class _WeightHomePageState extends State controller: _tabController, children: [ WeightWeeklyPage( - data: model.getWeightWeeklySeries(), - diabtecPatientResult: model.weekWeightMeasurementResult, + model: model, ), WeightMonthlyPage( - data: model.getWeightMonthlyTimeSeriesSales(), - diabtecPatientResult: model.monthWeightMeasurementResult, + model: model, ), WeightYearPage( - data: model.getWeightYearTimeSeriesSales(), - diabtecPatientResult: model.yearWeightMeasurementResult, + model: model, ) ], ), @@ -129,13 +68,15 @@ class _WeightHomePageState extends State ), floatingActionButton: InkWell( onTap: () { - Navigator.push(context, FadePage(page: AddWeightPage())); + Navigator.push(context, FadePage(page: AddWeightPage(model: model,))); }, child: Container( width: 55, height: 55, decoration: BoxDecoration( - shape: BoxShape.circle, color: HexColor('515B5D')), + shape: BoxShape.circle, + color: Theme.of(context).primaryColor, + ), child: Center( child: Icon( Icons.add, diff --git a/lib/pages/medical/my_trackers/Weight/WeightMonthlyPage.dart b/lib/pages/medical/my_trackers/Weight/WeightMonthlyPage.dart index 9f7063f1..56748ea0 100644 --- a/lib/pages/medical/my_trackers/Weight/WeightMonthlyPage.dart +++ b/lib/pages/medical/my_trackers/Weight/WeightMonthlyPage.dart @@ -3,41 +3,48 @@ import 'package:diplomaticquarterapp/core/model/my_trakers/blood_sugar/DiabtecPa import 'package:diplomaticquarterapp/core/model/my_trakers/chartData/WeekChartDate.dart'; import 'package:diplomaticquarterapp/core/model/my_trakers/chartData/YearMonthlyChartDate.dart'; import 'package:diplomaticquarterapp/core/model/my_trakers/weight/WeightMeasurementResult.dart'; +import 'package:diplomaticquarterapp/core/viewModels/medical/weight_pressure_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/pages/medical/my_trackers/widget/MonthLineChartCurved.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:charts_flutter/flutter.dart' as charts; import 'package:hexcolor/hexcolor.dart'; +import 'package:provider/provider.dart'; class WeightMonthlyPage extends StatelessWidget { - final List> data; - final List diabtecPatientResult; + final WeightPressureViewModel model; - const WeightMonthlyPage({Key key, this.data, this.diabtecPatientResult}) - : super(key: key); + const WeightMonthlyPage({ + Key key, + this.model, + }) : super(key: key); @override Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); return AppScaffold( body: ListView( children: [ Container( - width: double.maxFinite, - height: 180, - color: Colors.white, - child: charts.LineChart(data, - //animate: animate, - defaultRenderer: - new charts.LineRendererConfig(includePoints: true)), - ), + width: double.maxFinite, + color: Colors.white, + child: MonthLineChartCurved( + horizontalInterval: 1.0, + title: TranslationBase.of(context).weight, + timeSeries: model.weighMonthTimeSeriesData, + indexes: model.weighMonthTimeSeriesData.length ~/ 5.5, + )), SizedBox( height: 12, ), Padding( padding: const EdgeInsets.all(8.0), - child: Texts('Details'), + child: Texts(TranslationBase.of(context).details), ), Container( padding: EdgeInsets.all(10), @@ -49,7 +56,7 @@ class WeightMonthlyPage extends StatelessWidget { border: TableBorder.symmetric( inside: BorderSide(width: 2.0, color: Colors.grey[300]), ), - children: fullData(), + children: fullData(context, projectViewModel, model), ), ], ), @@ -59,21 +66,27 @@ class WeightMonthlyPage extends StatelessWidget { ); } - List fullData() { + List fullData(BuildContext context, + ProjectViewModel projectViewModel, WeightPressureViewModel model) { List tableRow = []; tableRow.add( TableRow( children: [ Container( decoration: BoxDecoration( - color: HexColor('#515B5D'), + color: Theme.of(context).primaryColor, borderRadius: BorderRadius.only( - topLeft: Radius.circular(10.0), + topLeft: projectViewModel.isArabic + ? Radius.circular(0.0) + : Radius.circular(10.0), + topRight: projectViewModel.isArabic + ? Radius.circular(10.0) + : Radius.circular(0.0), ), ), child: Center( child: Texts( - 'Date', + TranslationBase.of(context).date, color: Colors.white, fontSize: 15, ), @@ -82,11 +95,11 @@ class WeightMonthlyPage extends StatelessWidget { ), Container( decoration: BoxDecoration( - color: HexColor('#515B5D'), + color: Theme.of(context).primaryColor, ), child: Center( child: Texts( - 'Time', + TranslationBase.of(context).time, color: Colors.white, fontSize: 15, ), @@ -94,11 +107,19 @@ class WeightMonthlyPage extends StatelessWidget { height: 40), Container( decoration: BoxDecoration( - color: HexColor('#515B5D'), + color: Theme.of(context).primaryColor, + borderRadius: BorderRadius.only( + topLeft: projectViewModel.isArabic + ? Radius.circular(10.0) + : Radius.circular(0.0), + topRight: projectViewModel.isArabic + ? Radius.circular(0.0) + : Radius.circular(10.0), + ), ), child: Center( child: Texts( - 'Value', + TranslationBase.of(context).value, color: Colors.white, fontSize: 15, ), @@ -107,7 +128,7 @@ class WeightMonthlyPage extends StatelessWidget { ], ), ); - diabtecPatientResult.forEach( + model.monthWeightMeasurementResult.forEach( (diabtec) { tableRow.add( TableRow( @@ -119,7 +140,7 @@ class WeightMonthlyPage extends StatelessWidget { color: Colors.white, child: Center( child: Texts( - '${DateUtil.getMonthDayYearDateFormatted(diabtec.weightDate)} ', + '${projectViewModel.isArabic ? DateUtil.getMonthDayYearDateFormattedAr(diabtec.weightDate) : DateUtil.getMonthDayYearDateFormatted(diabtec.weightDate)} ', textAlign: TextAlign.center, fontSize: 12, ), diff --git a/lib/pages/medical/my_trackers/Weight/WeightWeeklyPage.dart b/lib/pages/medical/my_trackers/Weight/WeightWeeklyPage.dart index 9c3363dd..9c8a50a5 100644 --- a/lib/pages/medical/my_trackers/Weight/WeightWeeklyPage.dart +++ b/lib/pages/medical/my_trackers/Weight/WeightWeeklyPage.dart @@ -1,32 +1,41 @@ import 'package:diplomaticquarterapp/core/model/my_trakers/chartData/WeekChartDate.dart'; import 'package:diplomaticquarterapp/core/model/my_trakers/weight/WeightMeasurementResult.dart'; +import 'package:diplomaticquarterapp/core/viewModels/medical/weight_pressure_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/pages/medical/my_trackers/widget/LineChartCurved.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:charts_flutter/flutter.dart' as charts; import 'package:hexcolor/hexcolor.dart'; +import 'package:provider/provider.dart'; + +import 'AddWeightPage.dart'; class WeightWeeklyPage extends StatelessWidget { - final List> data; - final List diabtecPatientResult; + final WeightPressureViewModel model; - const WeightWeeklyPage({Key key, this.data, this.diabtecPatientResult}) - : super(key: key); + const WeightWeeklyPage({Key key, this.model}) : super(key: key); @override Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + return AppScaffold( body: ListView( children: [ Container( - width: double.maxFinite, - height: 180, + margin: EdgeInsets.only(top: 12, left: 8, right: 8), color: Colors.white, - child: charts.TimeSeriesChart( - data, - dateTimeFactory: const charts.LocalDateTimeFactory(), + child: LineChartCurved( + horizontalInterval: 1.0, + title: TranslationBase.of(context).weight, + timeSeries: model.weightWeekTimeSeriesData, + indexes: model.weightWeekTimeSeriesData.length ~/ 5.5, ), ), SizedBox( @@ -34,7 +43,7 @@ class WeightWeeklyPage extends StatelessWidget { ), Padding( padding: const EdgeInsets.all(8.0), - child: Texts('Details'), + child: Texts(TranslationBase.of(context).details), ), Container( padding: EdgeInsets.all(10), @@ -46,7 +55,7 @@ class WeightWeeklyPage extends StatelessWidget { border: TableBorder.symmetric( inside: BorderSide(width: 2.0, color: Colors.grey[300]), ), - children: fullData(), + children: fullData(context, projectViewModel, model), ), ], ), @@ -56,21 +65,27 @@ class WeightWeeklyPage extends StatelessWidget { ); } - List fullData() { + List fullData(BuildContext context, + ProjectViewModel projectViewModel, WeightPressureViewModel model) { List tableRow = []; tableRow.add( TableRow( children: [ Container( decoration: BoxDecoration( - color: HexColor('#515B5D'), + color: Theme.of(context).primaryColor, borderRadius: BorderRadius.only( - topLeft: Radius.circular(10.0), + topLeft: projectViewModel.isArabic + ? Radius.circular(0.0) + : Radius.circular(10.0), + topRight: projectViewModel.isArabic + ? Radius.circular(10.0) + : Radius.circular(0.0), ), ), child: Center( child: Texts( - 'Date', + TranslationBase.of(context).date, color: Colors.white, fontSize: 15, ), @@ -79,11 +94,11 @@ class WeightWeeklyPage extends StatelessWidget { ), Container( decoration: BoxDecoration( - color: HexColor('#515B5D'), + color: Theme.of(context).primaryColor, ), child: Center( child: Texts( - 'Time', + TranslationBase.of(context).time, color: Colors.white, fontSize: 15, ), @@ -91,37 +106,40 @@ class WeightWeeklyPage extends StatelessWidget { height: 40), Container( decoration: BoxDecoration( - color: HexColor('#515B5D'), + color: Theme.of(context).primaryColor, ), child: Center( child: Texts( - 'Value', + TranslationBase.of(context).value, color: Colors.white, fontSize: 15, ), ), height: 40), Container( - child: Container( - decoration: BoxDecoration( - color: HexColor('#515B5D'), - borderRadius: BorderRadius.only( - topRight: Radius.circular(10.0), - ), + decoration: BoxDecoration( + color: Theme.of(context).primaryColor, + borderRadius: BorderRadius.only( + topLeft: projectViewModel.isArabic + ? Radius.circular(10.0) + : Radius.circular(0.0), + topRight: projectViewModel.isArabic + ? Radius.circular(0.0) + : Radius.circular(10.0), ), - child: Center( - child: Texts( - 'Edit', - color: Colors.white, - fontSize: 15, - ), + ), + child: Center( + child: Texts( + TranslationBase.of(context).edit, + color: Colors.white, + fontSize: 15, ), - height: 40), - ), + ), + height: 40), ], ), ); - diabtecPatientResult.forEach( + model.weekWeightMeasurementResult.forEach( (diabtec) { tableRow.add( TableRow( @@ -133,7 +151,7 @@ class WeightWeeklyPage extends StatelessWidget { color: Colors.white, child: Center( child: Texts( - '${DateUtil.getMonthDayYearDateFormatted(diabtec.weightDate)} ', + '${projectViewModel.isArabic ? DateUtil.getMonthDayYearDateFormattedAr(diabtec.weightDate) : DateUtil.getMonthDayYearDateFormatted(diabtec.weightDate)} ', textAlign: TextAlign.center, fontSize: 12, ), @@ -166,12 +184,30 @@ class WeightWeeklyPage extends StatelessWidget { ), ), ), - Container( - height: 70, - padding: EdgeInsets.all(10), - color: Colors.white, - child: Center( - child: Icon(Icons.edit), + InkWell( + onTap: () { + Navigator.push( + context, + FadePage( + page: AddWeightPage( + isUpdate: true, + dayWeightDate: diabtec.weightDate, + measureTimeSelectedType: 'Kg', + weightValue: diabtec.weightMeasured.toString(), + lineItemNo: diabtec.lineItemNo, + weightUnit: int.parse(diabtec.unit), + model: model, + ), + ), + ); + }, + child: Container( + height: 70, + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Icon(Icons.edit), + ), ), ), ], diff --git a/lib/pages/medical/my_trackers/Weight/WeightYeaPage.dart b/lib/pages/medical/my_trackers/Weight/WeightYeaPage.dart index 587cc3f6..c5a1a3b3 100644 --- a/lib/pages/medical/my_trackers/Weight/WeightYeaPage.dart +++ b/lib/pages/medical/my_trackers/Weight/WeightYeaPage.dart @@ -2,41 +2,48 @@ import 'package:diplomaticquarterapp/core/model/my_trakers/blood_pressur/BloodPr import 'package:diplomaticquarterapp/core/model/my_trakers/blood_sugar/DiabtecPatientResult.dart'; import 'package:diplomaticquarterapp/core/model/my_trakers/chartData/WeekChartDate.dart'; import 'package:diplomaticquarterapp/core/model/my_trakers/weight/WeightMeasurementResult.dart'; +import 'package:diplomaticquarterapp/core/viewModels/medical/weight_pressure_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/pages/medical/my_trackers/widget/LineChartCurved.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:charts_flutter/flutter.dart' as charts; import 'package:hexcolor/hexcolor.dart'; +import 'package:provider/provider.dart'; class WeightYearPage extends StatelessWidget { - final List> data; - final List diabtecPatientResult; + final WeightPressureViewModel model; - const WeightYearPage({Key key, this.data, this.diabtecPatientResult}) + + const WeightYearPage({Key key, this.model, }) : super(key: key); @override Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); return AppScaffold( body: ListView( children: [ Container( - width: double.maxFinite, - height: 180, - color: Colors.white, - child: charts.TimeSeriesChart( - data, - dateTimeFactory: const charts.LocalDateTimeFactory(), - ), + width: double.maxFinite, + color: Colors.white, + child: LineChartCurved( + horizontalInterval: 2.0, + title: TranslationBase.of(context).weight, + timeSeries: model.weightYearTimeSeriesData, + indexes: model.weightYearTimeSeriesData.length ~/ 5.5, + ) ), SizedBox( height: 12, ), Padding( padding: const EdgeInsets.all(8.0), - child: Texts('Details'), + child: Texts(TranslationBase.of(context).details), ), Container( padding: EdgeInsets.all(10), @@ -48,7 +55,7 @@ class WeightYearPage extends StatelessWidget { border: TableBorder.symmetric( inside: BorderSide(width: 2.0, color: Colors.grey[300]), ), - children: fullData(), + children: fullData(context, projectViewModel, model), ), ], ), @@ -58,21 +65,27 @@ class WeightYearPage extends StatelessWidget { ); } - List fullData() { + List fullData(BuildContext context, + ProjectViewModel projectViewModel, WeightPressureViewModel model) { List tableRow = []; tableRow.add( TableRow( children: [ Container( decoration: BoxDecoration( - color: HexColor('#515B5D'), + color: Theme.of(context).primaryColor, borderRadius: BorderRadius.only( - topLeft: Radius.circular(10.0), + topLeft: projectViewModel.isArabic + ? Radius.circular(0.0) + : Radius.circular(10.0), + topRight: projectViewModel.isArabic + ? Radius.circular(10.0) + : Radius.circular(0.0), ), ), child: Center( child: Texts( - 'Date', + TranslationBase.of(context).date, color: Colors.white, fontSize: 15, ), @@ -81,11 +94,11 @@ class WeightYearPage extends StatelessWidget { ), Container( decoration: BoxDecoration( - color: HexColor('#515B5D'), + color: Theme.of(context).primaryColor, ), child: Center( child: Texts( - 'Time', + TranslationBase.of(context).time, color: Colors.white, fontSize: 15, ), @@ -93,11 +106,19 @@ class WeightYearPage extends StatelessWidget { height: 40), Container( decoration: BoxDecoration( - color: HexColor('#515B5D'), + color: Theme.of(context).primaryColor, + borderRadius: BorderRadius.only( + topLeft: projectViewModel.isArabic + ? Radius.circular(10.0) + : Radius.circular(0.0), + topRight: projectViewModel.isArabic + ? Radius.circular(0.0) + : Radius.circular(10.0), + ), ), child: Center( child: Texts( - 'Value', + TranslationBase.of(context).value, color: Colors.white, fontSize: 15, ), @@ -106,8 +127,8 @@ class WeightYearPage extends StatelessWidget { ], ), ); - diabtecPatientResult.forEach( - (diabtec) { + model.yearWeightMeasurementResult.forEach( + (diabtec) { tableRow.add( TableRow( children: [ @@ -118,7 +139,7 @@ class WeightYearPage extends StatelessWidget { color: Colors.white, child: Center( child: Texts( - '${DateUtil.getMonthDayYearDateFormatted(diabtec.weightDate)} ', + '${projectViewModel.isArabic ? DateUtil.getMonthDayYearDateFormattedAr(diabtec.weightDate) : DateUtil.getMonthDayYearDateFormatted(diabtec.weightDate)} ', textAlign: TextAlign.center, fontSize: 12, ), diff --git a/lib/pages/medical/my_trackers/blood_suger/AddBloodSugarPage.dart b/lib/pages/medical/my_trackers/blood_suger/AddBloodSugarPage.dart index f39479ac..a1fbff8d 100644 --- a/lib/pages/medical/my_trackers/blood_suger/AddBloodSugarPage.dart +++ b/lib/pages/medical/my_trackers/blood_suger/AddBloodSugarPage.dart @@ -1,7 +1,6 @@ import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/blood_sugar_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; -import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/medical/balance/new_text_Field.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; @@ -10,6 +9,7 @@ import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/RadioStringDialog.dart'; +import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -31,7 +31,9 @@ class AddBloodSugarPage extends StatefulWidget { this.measureUnitSelectedType, this.isUpdate = false, this.measuredTime, - this.bloodSugarValue, this.lineItemNo, this.bloodSugarViewMode}) + this.bloodSugarValue, + this.lineItemNo, + this.bloodSugarViewMode}) : super(key: key); @override @@ -94,6 +96,40 @@ class _AddBloodSugarPageState extends State { appBarTitle: widget.isUpdate ? TranslationBase.of(context).update : TranslationBase.of(context).add, + appBarIcons: [ + IconButton( + icon: Icon(Icons.delete), + color: Colors.white, + onPressed: () { + ConfirmDialog dialog = new ConfirmDialog( + context: context, + confirmMessage: 'Remove this measure', + okText: TranslationBase.of(context).ok, + cancelText: TranslationBase.of(context).cancel, + okFunction: () async { + ConfirmDialog.closeAlertDialog(context); + + GifLoaderDialogUtils.showMyDialog(context); + widget.bloodSugarViewMode + .deactivateDiabeticStatus(lineItemNo: widget.lineItemNo) + .then((value) { + GifLoaderDialogUtils.hideDialog(context); + if (widget.bloodSugarViewMode.state == ViewState.ErrorLocal) + AppToast.showErrorToast( + message: widget.bloodSugarViewMode.error); + else + Navigator.pop(context); + }).catchError((e) { + GifLoaderDialogUtils.hideDialog(context); + AppToast.showErrorToast( + message: widget.bloodSugarViewMode.error); + }); + }, + cancelFunction: () => {}); + dialog.showAlertDialog(context); + }, + ) + ], body: SingleChildScrollView( physics: BouncingScrollPhysics(), child: Container( @@ -143,10 +179,10 @@ class _AddBloodSugarPageState extends State { showTitleActions: true, minTime: DateTime(DateTime.now().year - 1, 1, 1), maxTime: DateTime.now(), onConfirm: (date) { - setState(() { - bloodSugarDate = date; - }); - }, + setState(() { + bloodSugarDate = date; + }); + }, currentTime: bloodSugarDate, locale: projectViewModel.localeType); }, @@ -173,10 +209,10 @@ class _AddBloodSugarPageState extends State { onTap: () { DatePicker.showTimePicker(context, showTitleActions: true, onConfirm: (date) { - setState(() { - timeSugarDate = date; - }); - }, + setState(() { + timeSugarDate = date; + }); + }, currentTime: timeSugarDate, locale: projectViewModel.localeType); }, @@ -236,39 +272,44 @@ class _AddBloodSugarPageState extends State { child: Padding( padding: const EdgeInsets.all(15.0), child: SecondaryButton( - label: TranslationBase.of(context).save, + label: TranslationBase.of(context).save.toUpperCase(), textColor: Colors.white, onTap: () { if (_bloodSugarValueController.text.isNotEmpty) { - GifLoaderDialogUtils.showMyDialog(context); - if (widget.isUpdate) - widget.bloodSugarViewMode.updateDiabtecResult( - month: bloodSugarDate, - hour: timeSugarDate, - diabtecUnit: measureUnitSelectedType, - measuredTime: measuredTime, - lineItemNo: widget.lineItemNo, - bloodSugerResult: - _bloodSugarValueController.text.toString()).then((value) { + if (widget.isUpdate) { + GifLoaderDialogUtils.showMyDialog(context); + widget.bloodSugarViewMode + .updateDiabtecResult( + month: bloodSugarDate, + hour: timeSugarDate, + diabtecUnit: measureUnitSelectedType, + measuredTime: measuredTime, + lineItemNo: widget.lineItemNo, + bloodSugerResult: + _bloodSugarValueController.text.toString()) + .then((value) { GifLoaderDialogUtils.hideDialog(context); - if(widget.bloodSugarViewMode.state == ViewState.Error) - AppToast.showErrorToast(message: widget.bloodSugarViewMode.error); + if (widget.bloodSugarViewMode.state == ViewState.ErrorLocal) + AppToast.showErrorToast( + message: widget.bloodSugarViewMode.error); else Navigator.pop(context); - }); - else - widget.bloodSugarViewMode.addDiabtecResult( + } else + widget.bloodSugarViewMode + .addDiabtecResult( diabtecUnit: measureUnitSelectedType, measuredTime: measuredTime, bloodSugerResult: - _bloodSugarValueController.text.toString(), + _bloodSugarValueController.text.toString(), bloodSugerDateChart: - '${bloodSugarDate.year}-${bloodSugarDate.month}-${bloodSugarDate.day} ${timeSugarDate.hour}:${timeSugarDate.minute}:00', - ).then((value) { + '${bloodSugarDate.year}-${bloodSugarDate.month}-${bloodSugarDate.day} ${timeSugarDate.hour}:${timeSugarDate.minute}:00', + ) + .then((value) { GifLoaderDialogUtils.hideDialog(context); - if(widget.bloodSugarViewMode.state == ViewState.Error) - AppToast.showErrorToast(message: widget.bloodSugarViewMode.error); + if (widget.bloodSugarViewMode.state == ViewState.Error) + AppToast.showErrorToast( + message: widget.bloodSugarViewMode.error); else Navigator.pop(context); }); diff --git a/lib/pages/medical/my_trackers/blood_suger/BloodMonthly.dart b/lib/pages/medical/my_trackers/blood_suger/BloodMonthly.dart index fa49382f..f5ef9aa9 100644 --- a/lib/pages/medical/my_trackers/blood_suger/BloodMonthly.dart +++ b/lib/pages/medical/my_trackers/blood_suger/BloodMonthly.dart @@ -2,8 +2,11 @@ import 'package:diplomaticquarterapp/core/model/my_trakers/blood_sugar/DiabtecPa import 'package:diplomaticquarterapp/core/model/my_trakers/chartData/WeekChartDate.dart'; import 'package:diplomaticquarterapp/core/model/my_trakers/chartData/YearMonthlyChartDate.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/pages/medical/my_trackers/widget/LineChartCurved.dart'; +import 'package:diplomaticquarterapp/pages/medical/my_trackers/widget/MonthLineChartCurved.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/charts/app_time_series_chart.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; @@ -13,10 +16,10 @@ import 'package:hexcolor/hexcolor.dart'; import 'package:provider/provider.dart'; class BloodMonthlyPage extends StatelessWidget { - final List> data; final List diabtecPatientResult; + final List timeSeriesData ; - const BloodMonthlyPage({Key key, this.data, this.diabtecPatientResult}) + const BloodMonthlyPage({Key key, this.diabtecPatientResult, this.timeSeriesData}) : super(key: key); @override Widget build(BuildContext context) { @@ -25,13 +28,13 @@ class BloodMonthlyPage extends StatelessWidget { body: ListView( children: [ Container( - width: double.maxFinite, - height: 180, - color: Colors.white, - child: charts.LineChart(data, - //animate: animate, - defaultRenderer: - new charts.LineRendererConfig(includePoints: true)), + width: double.maxFinite, + color: Colors.white, + child: MonthLineChartCurved( + title: 'Sugar', + timeSeries: timeSeriesData, + indexes: timeSeriesData.length ~/ 5.5, + ) ), SizedBox( height: 12, @@ -146,7 +149,7 @@ class BloodMonthlyPage extends StatelessWidget { color: Colors.white, child: Center( child: Texts( - '${DateUtil.getMonthDayYearDateFormatted(diabtec.dateChart)} ', + '${projectViewModel.isArabic ? DateUtil.getMonthDayYearDateFormattedAr(diabtec.dateChart):DateUtil.getMonthDayYearDateFormatted(diabtec.dateChart)} ', textAlign: TextAlign.center, fontSize: 12, ), diff --git a/lib/pages/medical/my_trackers/blood_suger/BloodYeaPage.dart b/lib/pages/medical/my_trackers/blood_suger/BloodYeaPage.dart index 69f00e61..d94da7fe 100644 --- a/lib/pages/medical/my_trackers/blood_suger/BloodYeaPage.dart +++ b/lib/pages/medical/my_trackers/blood_suger/BloodYeaPage.dart @@ -1,8 +1,10 @@ import 'package:diplomaticquarterapp/core/model/my_trakers/blood_sugar/DiabtecPatientResult.dart'; import 'package:diplomaticquarterapp/core/model/my_trakers/chartData/WeekChartDate.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/pages/medical/my_trackers/widget/LineChartCurved.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/charts/app_time_series_chart.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; @@ -12,10 +14,11 @@ import 'package:hexcolor/hexcolor.dart'; import 'package:provider/provider.dart'; class BloodYearPage extends StatelessWidget { - final List> data; + final List diabtecPatientResult; + final List timeSeriesData ; - const BloodYearPage({Key key, this.data, this.diabtecPatientResult}) + const BloodYearPage({Key key, this.diabtecPatientResult, this.timeSeriesData}) : super(key: key); @override @@ -26,12 +29,12 @@ class BloodYearPage extends StatelessWidget { children: [ Container( width: double.maxFinite, - height: 180, color: Colors.white, - child: charts.TimeSeriesChart( - data, - dateTimeFactory: const charts.LocalDateTimeFactory(), - ), + child: LineChartCurved( + title: 'Sugar', + timeSeries: timeSeriesData, + indexes: timeSeriesData.length ~/ 5.5, + ) ), SizedBox( height: 12, @@ -146,7 +149,7 @@ class BloodYearPage extends StatelessWidget { color: Colors.white, child: Center( child: Texts( - '${DateUtil.getMonthDayYearDateFormatted(diabtec.dateChart)} ', + '${projectViewModel.isArabic ? DateUtil.getMonthDayYearDateFormattedAr(diabtec.dateChart):DateUtil.getMonthDayYearDateFormatted(diabtec.dateChart)} ', textAlign: TextAlign.center, fontSize: 12, ), diff --git a/lib/pages/medical/my_trackers/blood_suger/blood_sugar_home_page.dart b/lib/pages/medical/my_trackers/blood_suger/blood_sugar_home_page.dart index 70cdea0f..7abbcceb 100644 --- a/lib/pages/medical/my_trackers/blood_suger/blood_sugar_home_page.dart +++ b/lib/pages/medical/my_trackers/blood_suger/blood_sugar_home_page.dart @@ -1,9 +1,14 @@ import 'dart:ui'; +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/blood_sugar_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/pages/medical/my_trackers/widget/TabBarWidget.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/dialogs/confirm_send_email_dialog.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; @@ -42,70 +47,38 @@ class _BloodSugarHomePageState extends State return BaseView( onModelReady: (model) => model.getBloodSugar(), builder: (_, model, w) => AppScaffold( + appBarIcons: [IconButton( + icon: Icon(Icons.email), + color: Colors.white, + onPressed: () { + showDialog( + context: context, + child: ConfirmSendEmailDialog( + email: model.user.emailAddress, + onTapSendEmail: () async{ + GifLoaderDialogUtils.showMyDialog(context); + model.sendReportByEmail().then((value) { + GifLoaderDialogUtils.hideDialog(context); + if(model.state == ViewState.ErrorLocal){ + AppToast.showErrorToast(message: model.error); + }else{ + AppToast.showSuccessToast(message:TranslationBase.of(context).emailSentSuccessfully, ); + } + }).catchError((e){ + GifLoaderDialogUtils.hideDialog(context); + AppToast.showErrorToast(message: model.error); + }); + }, + ), + ); + }, + ),], isShowAppBar: true, appBarTitle: TranslationBase.of(context).bloodSugar, baseViewModel: model, body: Scaffold( extendBodyBehindAppBar: true, - appBar: PreferredSize( - preferredSize: Size.fromHeight(60.0), - child: Stack( - children: [ - Positioned( - bottom: 1, - left: 0, - right: 0, - child: BackdropFilter( - filter: ImageFilter.blur(sigmaX: 10, sigmaY: 10), - child: Container( - color: Theme.of(context) - .scaffoldBackgroundColor - .withOpacity(0.8), - height: 70.0, - ), - ), - ), - Center( - child: Container( - height: 55.0, - color: Colors.white, - child: Center( - child: TabBar( - isScrollable: true, - controller: _tabController, - indicatorWeight: 5.0, - indicatorSize: TabBarIndicatorSize.tab, - labelColor: Theme.of(context).primaryColor, - labelPadding: - EdgeInsets.only(top: 4.0, left: 5.0, right: 5.0), - unselectedLabelColor: Colors.grey[800], - tabs: [ - Container( - width: MediaQuery.of(context).size.width * 0.33, - child: Center( - child: Texts(TranslationBase.of(context).weekly), - ), - ), - Container( - width: MediaQuery.of(context).size.width * 0.33, - child: Center( - child: Texts(TranslationBase.of(context).monthlyT), - ), - ), - Container( - width: MediaQuery.of(context).size.width * 0.34, - child: Center( - child: Texts(TranslationBase.of(context).yearly), - ), - ), - ], - ), - ), - ), - ), - ], - ), - ), + appBar: TabBarWidget(tabController: _tabController,), body: Column( children: [ Expanded( @@ -114,16 +87,16 @@ class _BloodSugarHomePageState extends State controller: _tabController, children: [ BloodSugarWeeklyPage( - data: model.getBloodWeeklySeries(), + timeSeriesData: model.bloodWeekTimeSeriesData, diabtecPatientResult: model.weekDiabtecPatientResult, bloodSugarViewMode: model, ), BloodMonthlyPage( - data: model.getBloodMonthlyTimeSeriesSales(), + timeSeriesData: model.monthTimeSeriesData, diabtecPatientResult: model.monthDiabtecPatientResult, ), BloodYearPage( - data: model.getBloodYearTimeSeriesSales(), + timeSeriesData: model.yearTimeSeriesData, diabtecPatientResult: model.yearDiabtecPatientResult, ) ], diff --git a/lib/pages/medical/my_trackers/blood_suger/blood_sugar_weekly_page.dart b/lib/pages/medical/my_trackers/blood_suger/blood_sugar_weekly_page.dart index 139548e1..4bda58fa 100644 --- a/lib/pages/medical/my_trackers/blood_suger/blood_sugar_weekly_page.dart +++ b/lib/pages/medical/my_trackers/blood_suger/blood_sugar_weekly_page.dart @@ -2,25 +2,29 @@ import 'package:diplomaticquarterapp/core/model/my_trakers/blood_sugar/DiabtecPa import 'package:diplomaticquarterapp/core/model/my_trakers/chartData/WeekChartDate.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/blood_sugar_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/pages/medical/my_trackers/widget/LineChartCurved.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/charts/app_time_series_chart.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:charts_flutter/flutter.dart' as charts; -import 'package:hexcolor/hexcolor.dart'; import 'package:provider/provider.dart'; - import 'AddBloodSugarPage.dart'; class BloodSugarWeeklyPage extends StatelessWidget { - final List> data; final List diabtecPatientResult; final BloodSugarViewMode bloodSugarViewMode; + final List timeSeriesData; - const BloodSugarWeeklyPage({Key key, this.data, this.diabtecPatientResult, this.bloodSugarViewMode}) + BloodSugarWeeklyPage( + {Key key, + this.diabtecPatientResult, + this.bloodSugarViewMode, + this.timeSeriesData}) : super(key: key); @override @@ -30,12 +34,12 @@ class BloodSugarWeeklyPage extends StatelessWidget { body: ListView( children: [ Container( - width: double.maxFinite, - height: 180, + margin: EdgeInsets.only(top: 12, left: 8, right: 8), color: Colors.white, - child: charts.TimeSeriesChart( - data, - dateTimeFactory: const charts.LocalDateTimeFactory(), + child: LineChartCurved( + title: 'Sugar', + timeSeries: timeSeriesData, + indexes: timeSeriesData.length ~/ 5.5, ), ), SizedBox( @@ -55,7 +59,8 @@ class BloodSugarWeeklyPage extends StatelessWidget { border: TableBorder.symmetric( inside: BorderSide(width: 2.0, color: Colors.grey[300]), ), - children: fullData(context, projectViewModel,bloodSugarViewMode), + children: + fullData(context, projectViewModel, bloodSugarViewMode), ), ], ), @@ -66,7 +71,9 @@ class BloodSugarWeeklyPage extends StatelessWidget { } List fullData( - BuildContext context, ProjectViewModel projectViewModel, BloodSugarViewMode bloodSugarViewMode) { + BuildContext context, + ProjectViewModel projectViewModel, + BloodSugarViewMode bloodSugarViewMode) { List tableRow = []; tableRow.add( TableRow( @@ -173,7 +180,7 @@ class BloodSugarWeeklyPage extends StatelessWidget { color: Colors.white, child: Center( child: Texts( - '${DateUtil.getMonthDayYearDateFormatted(diabtec.dateChart)}', + '${projectViewModel.isArabic ? DateUtil.getMonthDayYearDateFormattedAr(diabtec.dateChart):DateUtil.getMonthDayYearDateFormatted(diabtec.dateChart)} ', textAlign: TextAlign.center, fontSize: 12, ), diff --git a/lib/pages/medical/my_trackers/widget/LineChartCurved.dart b/lib/pages/medical/my_trackers/widget/LineChartCurved.dart new file mode 100644 index 00000000..eeff06dd --- /dev/null +++ b/lib/pages/medical/my_trackers/widget/LineChartCurved.dart @@ -0,0 +1,222 @@ +import 'package:diplomaticquarterapp/widgets/charts/app_time_series_chart.dart'; +import 'package:fl_chart/fl_chart.dart'; +import 'package:flutter/material.dart'; + +import '../../../../Constants.dart'; + +class LineChartCurved extends StatelessWidget { + final String title; + final List timeSeries; + final int indexes; + final double horizontalInterval; + + LineChartCurved( + {this.title, + this.timeSeries, + this.indexes, + this.horizontalInterval = 20.0}); + + List xAxixs = List(); + List yAxixs = List(); + + @override + Widget build(BuildContext context) { + getXaxix(); + getYaxix(); + return AspectRatio( + aspectRatio: 1.1, + child: Container( + decoration: const BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(18)), + // color: Colors.white, + ), + child: Stack( + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + const SizedBox( + height: 4, + ), + Text( + title, + style: TextStyle( + color: Colors.black, fontSize: 15, letterSpacing: 2), + textAlign: TextAlign.center, + ), + SizedBox( + height: 10, + ), + Expanded( + child: Padding( + padding: const EdgeInsets.only( + right: 18.0, left: 16.0, top: 15, bottom: 15), + child: LineChart( + sampleData1(context), + swapAnimationDuration: const Duration(milliseconds: 250), + ), + ), + ), + const SizedBox( + height: 10, + ), + ], + ), + ], + ), + ), + ); + } + + getXaxix() { + for (int index = 0; index < timeSeries.length; index++) { + int mIndex = indexes * index; + if (mIndex < timeSeries.length) { + xAxixs.add(mIndex); + } + } + } + + getYaxix() { + int indexess = (timeSeries.length * 0.30).toInt(); + for (int index = 0; index < timeSeries.length; index++) { + int mIndex = indexess * index; + if (mIndex < timeSeries.length) { + yAxixs.add(timeSeries[mIndex].sales); + } + } + } + + LineChartData sampleData1(context) { + return LineChartData( + lineTouchData: LineTouchData( + touchTooltipData: LineTouchTooltipData( + tooltipBgColor: Colors.white, + ), + touchCallback: (LineTouchResponse touchResponse) {}, + handleBuiltInTouches: true, + ), + gridData: FlGridData( + horizontalInterval: horizontalInterval, + show: true, + drawVerticalLine: true, + drawHorizontalLine: true), + titlesData: FlTitlesData( + bottomTitles: SideTitles( + showTitles: true, + getTextStyles: (value) => const TextStyle( + color: Colors.black, + fontSize: 10, + ), + // rotateAngle: 90, + //rotateAngle:-65, + margin: 22, + getTitles: (value) { + if (timeSeries.length < 15) { + if (timeSeries.length > value.toInt()) { + return '${timeSeries[value.toInt()].time.month}/ ${timeSeries[value.toInt()].time.year}'; + } else + return ''; + } else { + if (value.toInt() == 0) + return '${timeSeries[value.toInt()].time.month}/ ${timeSeries[value.toInt()].time.year}'; + if (value.toInt() == timeSeries.length - 1) + return '${timeSeries[value.toInt()].time.month}/ ${timeSeries[value.toInt()].time.year}'; + if (xAxixs.contains(value.toInt())) { + return '${timeSeries[value.toInt()].time.month}/ ${timeSeries[value.toInt()].time.year}'; + } + } + return ''; + }, + ), + leftTitles: SideTitles( + showTitles: true, + getTextStyles: (value) => const TextStyle( + color: Colors.black, + fontWeight: FontWeight.bold, + fontSize: 10, + ), + getTitles: (value) { + if (value.toInt() == 0) + return '${value.toInt()}'; + else if (value.toInt() % horizontalInterval == 0) + return '${value.toInt()}'; + else + return ''; + }, + margin: 12, + ), + ), + borderData: FlBorderData( + show: true, + border: const Border( + bottom: BorderSide( + color: Colors.black, + width: 0.5, + ), + left: BorderSide( + color: Colors.black, + ), + right: BorderSide( + color: Colors.black, + ), + top: BorderSide( + color: Colors.transparent, + ), + ), + ), + minX: 0, + maxX: (timeSeries.length - 1).toDouble(), + maxY: getMaxY() + 0.3, + minY: getMinY(), + lineBarsData: getData(context), + ); + } + + double getMaxY() { + double max = 0; + timeSeries.forEach((element) { + double resultValueDouble = element.sales; + if (resultValueDouble > max) max = resultValueDouble; + }); + + return max.roundToDouble(); + } + + double getMinY() { + double min = timeSeries[0].sales; + timeSeries.forEach((element) { + double resultValueDouble = element.sales; + if (resultValueDouble < min) min = resultValueDouble; + }); + int value = min.toInt(); + + return value.toDouble(); + } + + List getData(context) { + List spots = List(); + for (int index = 0; index < timeSeries.length; index++) { + spots.add(FlSpot(index.toDouble(), timeSeries[index].sales)); + } + + final LineChartBarData lineChartBarData1 = LineChartBarData( + spots: spots, + isCurved: true, + colors: [secondaryColor], + barWidth: 5, + isStrokeCapRound: true, + curveSmoothness: 0.12, + dotData: FlDotData( + show: false, + ), + belowBarData: BarAreaData( + show: false, + ), + ); + + return [ + lineChartBarData1, + ]; + } +} diff --git a/lib/pages/medical/my_trackers/widget/MonthLineChartCurved.dart b/lib/pages/medical/my_trackers/widget/MonthLineChartCurved.dart new file mode 100644 index 00000000..607f3ab0 --- /dev/null +++ b/lib/pages/medical/my_trackers/widget/MonthLineChartCurved.dart @@ -0,0 +1,206 @@ +import 'package:diplomaticquarterapp/widgets/charts/app_time_series_chart.dart'; +import 'package:fl_chart/fl_chart.dart'; +import 'package:flutter/material.dart'; + +import '../../../../Constants.dart'; + +class MonthLineChartCurved extends StatelessWidget { + final String title; + final List timeSeries; + final int indexes; + final double horizontalInterval; + + MonthLineChartCurved( + {this.title, + this.timeSeries, + this.indexes, + this.horizontalInterval = 15.0}); + + List xAxixs = List(); + List yAxixs = List(); + + @override + Widget build(BuildContext context) { + getXaxix(); + getYaxix(); + return AspectRatio( + aspectRatio: 1.1, + child: Container( + decoration: const BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(18)), + // color: Colors.white, + ), + child: Stack( + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + const SizedBox( + height: 4, + ), + Text( + title, + style: TextStyle( + color: Colors.black, fontSize: 15, letterSpacing: 2), + textAlign: TextAlign.center, + ), + SizedBox( + height: 10, + ), + Expanded( + child: Padding( + padding: const EdgeInsets.only( + right: 18.0, left: 16.0, top: 15, bottom: 15), + child: LineChart( + sampleData1(context), + swapAnimationDuration: const Duration(milliseconds: 250), + ), + ), + ), + const SizedBox( + height: 10, + ), + ], + ), + ], + ), + ), + ); + } + + getXaxix() { + for (int index = 0; index < timeSeries.length; index++) { + int mIndex = indexes * index; + if (mIndex < timeSeries.length) { + xAxixs.add(mIndex); + } + } + } + + getYaxix() { + int indexess = (timeSeries.length * 0.30).toInt(); + for (int index = 0; index < timeSeries.length; index++) { + int mIndex = indexess * index; + if (mIndex < timeSeries.length) { + yAxixs.add(timeSeries[mIndex].sales); + } + } + } + + LineChartData sampleData1(context) { + return LineChartData( + lineTouchData: LineTouchData( + touchTooltipData: LineTouchTooltipData( + tooltipBgColor: Colors.white, + ), + touchCallback: (LineTouchResponse touchResponse) {}, + handleBuiltInTouches: true, + ), + gridData: FlGridData( + horizontalInterval: horizontalInterval, + show: true, + drawVerticalLine: true, + drawHorizontalLine: true), + titlesData: FlTitlesData( + bottomTitles: SideTitles( + showTitles: true, + getTextStyles: (value) => const TextStyle( + color: Colors.black, + fontSize: 10, + ), + margin: 22, + getTitles: (value) { + return '${value.toInt()}'; + }, + ), + leftTitles: SideTitles( + showTitles: true, + getTextStyles: (value) => const TextStyle( + color: Colors.black, + fontWeight: FontWeight.bold, + fontSize: 10, + ), + getTitles: (value) { + if (value.toInt() == 0) + return '${value.toInt()}'; + else if (value.toInt() % horizontalInterval == 0) + return '${value.toInt()}'; + else + return ''; + }, + margin: 12, + ), + ), + borderData: FlBorderData( + show: true, + border: const Border( + bottom: BorderSide( + color: Colors.black, + width: 0.5, + ), + left: BorderSide( + color: Colors.black, + ), + right: BorderSide( + color: Colors.black, + ), + top: BorderSide( + color: Colors.transparent, + ), + ), + ), + minX: 0, + maxX: (timeSeries.length - 1).toDouble(), + maxY: getMaxY() + 0.3, + minY: getMinY(), + lineBarsData: getData(context), + ); + } + + double getMaxY() { + double max = 0; + timeSeries.forEach((element) { + double resultValueDouble = element.sales; + if (resultValueDouble > max) max = resultValueDouble; + }); + + return max.roundToDouble(); + } + + double getMinY() { + double min = timeSeries[0].sales; + timeSeries.forEach((element) { + double resultValueDouble = element.sales; + if (resultValueDouble < min) min = resultValueDouble; + }); + int value = min.toInt(); + + return value.toDouble(); + } + + List getData(context) { + List spots = List(); + for (int index = 0; index < timeSeries.length; index++) { + spots.add(FlSpot(index.toDouble(), timeSeries[index].sales)); + } + + final LineChartBarData lineChartBarData1 = LineChartBarData( + spots: spots, + isCurved: true, + colors: [secondaryColor], + barWidth: 5, + isStrokeCapRound: true, + curveSmoothness: 0.0, + dotData: FlDotData( + show: false, + ), + belowBarData: BarAreaData( + show: false, + ), + ); + + return [ + lineChartBarData1, + ]; + } +} diff --git a/lib/pages/medical/my_trackers/widget/TabBarWidget.dart b/lib/pages/medical/my_trackers/widget/TabBarWidget.dart new file mode 100644 index 00000000..199dbc54 --- /dev/null +++ b/lib/pages/medical/my_trackers/widget/TabBarWidget.dart @@ -0,0 +1,73 @@ +import 'dart:ui'; + +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +class TabBarWidget extends StatelessWidget with PreferredSizeWidget{ + final TabController tabController; + + const TabBarWidget({Key key, this.tabController}) : super(key: key); + + @override + Widget build(BuildContext context) { + return Stack( + children: [ + Positioned( + bottom: 1, + left: 0, + right: 0, + child: BackdropFilter( + filter: ImageFilter.blur(sigmaX: 10, sigmaY: 10), + child: Container( + color: + Theme.of(context).scaffoldBackgroundColor.withOpacity(0.8), + height: 70.0, + ), + ), + ), + Center( + child: Container( + height: 55.0, + color: Colors.white, + child: Center( + child: TabBar( + isScrollable: true, + controller: tabController, + indicatorWeight: 5.0, + indicatorSize: TabBarIndicatorSize.tab, + labelColor: Theme.of(context).primaryColor, + labelPadding: + EdgeInsets.only(top: 4.0, left: 5.0, right: 5.0), + unselectedLabelColor: Colors.grey[800], + tabs: [ + Container( + width: MediaQuery.of(context).size.width * 0.33, + child: Center( + child: Texts(TranslationBase.of(context).weekly), + ), + ), + Container( + width: MediaQuery.of(context).size.width * 0.33, + child: Center( + child: Texts(TranslationBase.of(context).monthlyT), + ), + ), + Container( + width: MediaQuery.of(context).size.width * 0.34, + child: Center( + child: Texts(TranslationBase.of(context).yearly), + ), + ), + ], + ), + ), + ), + ), + ], + ); + } + @override + Size get preferredSize => Size(double.maxFinite, 60); +} diff --git a/lib/pages/medical/vital_sign/LineChartCurved.dart b/lib/pages/medical/vital_sign/LineChartCurved.dart index 7b7449a8..f2bc3d5f 100644 --- a/lib/pages/medical/vital_sign/LineChartCurved.dart +++ b/lib/pages/medical/vital_sign/LineChartCurved.dart @@ -2,6 +2,8 @@ import 'package:diplomaticquarterapp/widgets/charts/app_time_series_chart.dart'; import 'package:fl_chart/fl_chart.dart'; import 'package:flutter/material.dart'; +import '../../../Constants.dart'; + class LineChartCurved extends StatelessWidget { final String title; final List timeSeries; @@ -199,7 +201,7 @@ class LineChartCurved extends StatelessWidget { final LineChartBarData lineChartBarData1 = LineChartBarData( spots: spots, isCurved: true, - colors: [Theme.of(context).primaryColor], + colors: [secondaryColor], barWidth: 5, isStrokeCapRound: true, dotData: FlDotData( diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index 8dff17c4..6280bf01 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -1282,6 +1282,7 @@ class TranslationBase { String get childAddedSuccessfully => localizedValues["child_added_successfully"][locale.languageCode]; String get bloodDEnterDesc => localizedValues["bloodD-enter-desc"][locale.languageCode]; String get viewTermsConditions => localizedValues["viewTermsConditions"][locale.languageCode]; + String get weightAdd => localizedValues["weight-add"][locale.languageCode]; } diff --git a/lib/widgets/charts/app_time_series_chart.dart b/lib/widgets/charts/app_time_series_chart.dart index d34bc591..24d632bc 100644 --- a/lib/widgets/charts/app_time_series_chart.dart +++ b/lib/widgets/charts/app_time_series_chart.dart @@ -69,3 +69,9 @@ class TimeSeriesSales2 { TimeSeriesSales2(this.time, this.sales); } +class TimeSeriesSales3 { + final int time; + final double sales; + + TimeSeriesSales3(this.time, this.sales); +} diff --git a/lib/widgets/others/app_scaffold_widget.dart b/lib/widgets/others/app_scaffold_widget.dart index fca914a0..3fce4b51 100644 --- a/lib/widgets/others/app_scaffold_widget.dart +++ b/lib/widgets/others/app_scaffold_widget.dart @@ -40,7 +40,6 @@ class AppScaffold extends StatelessWidget { final bool isPharmacy; final String title; final String description; - final String image; final bool isShowDecPage; final List infoList; final Color backgroundColor; @@ -68,7 +67,6 @@ class AppScaffold extends StatelessWidget { this.backgroundColor, this.preferredSize = 0.0, this.appBarIcons, - this.image, this.infoList, this.imagesInfo}); @override @@ -82,7 +80,6 @@ class AppScaffold extends StatelessWidget { appBarIcons:appBarIcons, isPharmacy: isPharmacy, isShowDecPage: isShowDecPage, - image: image, ):null, bottomSheet: bottomSheet, body: (!Provider.of(context, listen: false).isLogin && @@ -116,10 +113,9 @@ class AppBarWidget extends StatelessWidget with PreferredSizeWidget { final List appBarIcons; final bool isPharmacy; final bool isShowDecPage; - final String image; AppBarWidget({this.appBarTitle, this.appBarIcons, - this.isPharmacy = true, this.isShowDecPage = true, this.image}); + this.isPharmacy = true, this.isShowDecPage = true}); @override Widget build(BuildContext context) { From dde10cd27b6f81fff15376aab8b389379f274e8f Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Sun, 24 Jan 2021 09:29:57 +0300 Subject: [PATCH 30/42] working in LiveCare Scheduling --- lib/pages/BookAppointment/BookConfirm.dart | 56 +++++++++------- lib/pages/BookAppointment/BookSuccess.dart | 4 +- .../BookAppointment/widgets/DoctorView.dart | 2 +- lib/pages/ToDoList/ToDo.dart | 48 ++++++++----- lib/pages/livecare/livecare_home.dart | 1 + .../schedule_clinic_card.dart | 6 +- .../livecare/widgets/LiveCareHistoryCard.dart | 3 +- lib/widgets/in_app_browser/InAppBrowser.dart | 67 ++++++++++++------- 8 files changed, 114 insertions(+), 73 deletions(-) diff --git a/lib/pages/BookAppointment/BookConfirm.dart b/lib/pages/BookAppointment/BookConfirm.dart index d7e08a66..03a28d90 100644 --- a/lib/pages/BookAppointment/BookConfirm.dart +++ b/lib/pages/BookAppointment/BookConfirm.dart @@ -187,27 +187,29 @@ class _BookConfirmState extends State { crossAxisAlignment: CrossAxisAlignment.start, mainAxisSize: MainAxisSize.max, children: [ - Row( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Container( - margin: EdgeInsets.fromLTRB(5.0, 0.0, 5.0, 0.0), - child: Image.asset( - "assets/images/new-design/icon_hospital.png"), - ), - Container( - margin: EdgeInsets.fromLTRB(20.0, 5.0, 10.0, 5.0), - child: Text( - TranslationBase.of(context).hospital + - ": " + - widget.doctor.projectName, - style: TextStyle( - fontSize: 14.0, - color: Colors.grey[700], - letterSpacing: 1.0)), - ), - ], - ), + !widget.isLiveCareAppointment ? Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Container( + margin: + EdgeInsets.fromLTRB(5.0, 0.0, 5.0, 0.0), + child: Image.asset( + "assets/images/new-design/icon_hospital.png"), + ), + Container( + margin: + EdgeInsets.fromLTRB(20.0, 5.0, 10.0, 5.0), + child: Text( + TranslationBase.of(context).hospital + + ": " + + widget.doctor.projectName, + style: TextStyle( + fontSize: 14.0, + color: Colors.grey[700], + letterSpacing: 1.0)), + ), + ], + ) : Container(), Row( mainAxisAlignment: MainAxisAlignment.start, children: [ @@ -325,7 +327,8 @@ class _BookConfirmState extends State { Container( margin: EdgeInsets.only(top: 5.0), child: Text( - TranslationBase.of(context).gender + ": " + + TranslationBase.of(context).gender + + ": " + widget.authUser.genderDescription, style: TextStyle( fontSize: 12.0, @@ -335,7 +338,9 @@ class _BookConfirmState extends State { Container( margin: EdgeInsets.only(top: 5.0, bottom: 3.0), child: Text( - TranslationBase.of(context).age + ": " + widget.authUser.age.toString(), + TranslationBase.of(context).age + + ": " + + widget.authUser.age.toString(), style: TextStyle( fontSize: 12.0, color: Colors.grey[600], @@ -423,7 +428,8 @@ class _BookConfirmState extends State { context) .then((res) { if (res['MessageStatus'] == 1) { - AppToast.showSuccessToast(message: TranslationBase.of(context).bookedSuccess); + AppToast.showSuccessToast( + message: TranslationBase.of(context).bookedSuccess); print(res['AppointmentNo']); Future.delayed(new Duration(milliseconds: 500), () { @@ -543,13 +549,13 @@ class _BookConfirmState extends State { getLiveCareAppointmentPatientShare(context, String appointmentNo, int clinicID, int projectID, DoctorList docObject) { - GifLoaderDialogUtils.hideDialog(context); 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); }).catchError((err) { GifLoaderDialogUtils.hideDialog(context); diff --git a/lib/pages/BookAppointment/BookSuccess.dart b/lib/pages/BookAppointment/BookSuccess.dart index f513c434..a478b2f1 100644 --- a/lib/pages/BookAppointment/BookSuccess.dart +++ b/lib/pages/BookAppointment/BookSuccess.dart @@ -255,7 +255,7 @@ class _BookSuccessState extends State { minWidth: MediaQuery.of(context).size.width * 0.7, height: 45.0, child: RaisedButton( - color: new Color(0xFF40ACC9), + color: new Color(0xffc5272d), textColor: Colors.white, disabledTextColor: Colors.white, disabledColor: new Color(0xFFbcc2c4), @@ -318,7 +318,7 @@ class _BookSuccessState extends State { minWidth: MediaQuery.of(context).size.width * 0.7, height: 45.0, child: RaisedButton( - color: new Color(0xFF40ACC9), + color: new Color(0xFFc5272d), textColor: Colors.white, disabledTextColor: Colors.white, disabledColor: new Color(0xFFbcc2c4), diff --git a/lib/pages/BookAppointment/widgets/DoctorView.dart b/lib/pages/BookAppointment/widgets/DoctorView.dart index d419e4af..1562c5f7 100644 --- a/lib/pages/BookAppointment/widgets/DoctorView.dart +++ b/lib/pages/BookAppointment/widgets/DoctorView.dart @@ -61,7 +61,7 @@ class DoctorView extends StatelessWidget { letterSpacing: 1.0)), Container( margin: EdgeInsets.only(top: 3.0), - child: Text(this.doctor.clinicName, + child: Text(this.doctor.clinicName != null ? this.doctor.clinicName : "", style: TextStyle( fontSize: 12.0, color: Colors.grey[600], diff --git a/lib/pages/ToDoList/ToDo.dart b/lib/pages/ToDoList/ToDo.dart index 1066ca15..d36bb250 100644 --- a/lib/pages/ToDoList/ToDo.dart +++ b/lib/pages/ToDoList/ToDo.dart @@ -13,7 +13,6 @@ import 'package:diplomaticquarterapp/pages/ToDoList/payment_method_select.dart'; import 'package:diplomaticquarterapp/pages/ToDoList/widgets/paymentDialog.dart'; import 'package:diplomaticquarterapp/routes.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'; @@ -26,7 +25,6 @@ import 'package:flutter/material.dart'; import 'package:flutter_countdown_timer/countdown_timer_controller.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'; @@ -130,24 +128,18 @@ class _ToDoState extends State { .substring(0, 5), style: TextStyle(fontSize: 10.0)), ), - widget.appoList[index].isLiveCareAppointment - ? SvgPicture.asset( - "assets/images/new-design/liveCare_logo_icon.svg", - width: 20.0, - height: 20.0) - : Image.asset( + !widget.appoList[index].isLiveCareAppointment + ? Image.asset( "assets/images/new-design/hospital_address_icon.png", width: 20.0, - height: 20.0), + height: 20.0) + : Container(), Container( margin: EdgeInsets.only(left: 5.0, right: 5.0), child: widget .appoList[index].isLiveCareAppointment - ? Text( - TranslationBase.of(context) - .liveCareAppo, - style: TextStyle(fontSize: 12.0)) + ? Container() : Text( widget.appoList[index].projectName != null @@ -249,7 +241,7 @@ class _ToDoState extends State { (_, CurrentRemainingTime time) { return time != null ? Text( - '${time.days}:${time.hours}:${time.min}:${time.sec} ' + + '${time.days != null ? time.days : "0"}:${time.hours.toString().length == 1 ? "0" + time.hours.toString() : time.hours}:${time.min}:${time.sec} ' + TranslationBase.of( context) .upcomingTimeLeft, @@ -567,12 +559,34 @@ class _ToDoState extends State { } getPatientShare(context, AppoitmentAllHistoryResultList appo) { - GifLoaderDialogUtils.showMyDialog(context); DoctorsListService service = new DoctorsListService(); + if (appo.isLiveCareAppointment) { + getLiveCareAppointmentPatientShare(context, service, appo); + } else { + GifLoaderDialogUtils.showMyDialog(context); + service + .getPatientShare(appo.appointmentNo.toString(), appo.clinicID, + appo.projectID, context) + .then((res) { + GifLoaderDialogUtils.hideDialog(context); + widget.patientShareResponse = new PatientShareResponse.fromJson(res); + openPaymentDialog(appo, widget.patientShareResponse); + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + AppToast.showErrorToast(message: err); + print(err); + }); + } + } + + getLiveCareAppointmentPatientShare(context, DoctorsListService service, + AppoitmentAllHistoryResultList appo) { + GifLoaderDialogUtils.showMyDialog(context); service - .getPatientShare(appo.appointmentNo.toString(), appo.clinicID, - appo.projectID, context) + .getLiveCareAppointmentPatientShare(appo.appointmentNo.toString(), + appo.clinicID, appo.projectID, context) .then((res) { + print(res); GifLoaderDialogUtils.hideDialog(context); widget.patientShareResponse = new PatientShareResponse.fromJson(res); openPaymentDialog(appo, widget.patientShareResponse); diff --git a/lib/pages/livecare/livecare_home.dart b/lib/pages/livecare/livecare_home.dart index fc5c4eab..1974753f 100644 --- a/lib/pages/livecare/livecare_home.dart +++ b/lib/pages/livecare/livecare_home.dart @@ -49,6 +49,7 @@ class _LiveCareHomeState extends State child: Column(children: [ /// this is will not colored with theme data TabBar( + labelColor: Colors.black, tabs: [ Tab(text: TranslationBase.of(context).consultation), Tab(text: TranslationBase.of(context).logs), diff --git a/lib/pages/livecare/livecare_scheduling/schedule_clinic_card.dart b/lib/pages/livecare/livecare_scheduling/schedule_clinic_card.dart index 4309cc62..19144263 100644 --- a/lib/pages/livecare/livecare_scheduling/schedule_clinic_card.dart +++ b/lib/pages/livecare/livecare_scheduling/schedule_clinic_card.dart @@ -21,7 +21,7 @@ class _ScheduleClinicCardState extends State { return Container( child: Card( margin: EdgeInsets.fromLTRB(15.0, 10.0, 15.0, 8.0), - color: widget.isSelected ? Colors.blue : Colors.white, + color: widget.isSelected ? Color(0xff06b806) : Colors.white, shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(10), ), @@ -35,8 +35,8 @@ class _ScheduleClinicCardState extends State { Container( child: Text( widget.languageID == 'ar' - ? widget.clinicsHaveScheduleList.clinicDescN - : widget.clinicsHaveScheduleList.clinicDesc, + ? widget.clinicsHaveScheduleList.clinicDescN != null ? widget.clinicsHaveScheduleList.clinicDescN: "" + : widget.clinicsHaveScheduleList.clinicDesc != null ? widget.clinicsHaveScheduleList.clinicDesc: "Dermatology", style: TextStyle( fontSize: 16.0, color: diff --git a/lib/pages/livecare/widgets/LiveCareHistoryCard.dart b/lib/pages/livecare/widgets/LiveCareHistoryCard.dart index 25ec8514..15c14557 100644 --- a/lib/pages/livecare/widgets/LiveCareHistoryCard.dart +++ b/lib/pages/livecare/widgets/LiveCareHistoryCard.dart @@ -42,10 +42,11 @@ class _LiveCareHistoryCardState extends State { ), child: Container( width: MediaQuery.of(context).size.width, - height: MediaQuery.of(context).size.height * 0.22, + // height: MediaQuery.of(context).size.height * 0.22, padding: EdgeInsets.all(10.0), child: Column( crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, children: [ Text("Requested date:", style: diff --git a/lib/widgets/in_app_browser/InAppBrowser.dart b/lib/widgets/in_app_browser/InAppBrowser.dart index c46b5616..001bcdfa 100644 --- a/lib/widgets/in_app_browser/InAppBrowser.dart +++ b/lib/widgets/in_app_browser/InAppBrowser.dart @@ -1,8 +1,6 @@ import 'dart:convert'; -import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; -import 'package:diplomaticquarterapp/core/model/my_balance/AdvanceModel.dart'; import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; @@ -13,14 +11,14 @@ class MyInAppBrowser extends InAppBrowser { // static String SERVICE_URL = // 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT - static String SERVICE_URL = - 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE + static String SERVICE_URL = + 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE // static String PREAUTH_SERVICE_URL = // 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort PreAuth Payment Gateway URL UAT - static String PREAUTH_SERVICE_URL = - 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort PreAuth Payment Gateway URL Live Store + static String PREAUTH_SERVICE_URL = + 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort PreAuth Payment Gateway URL Live Store static List successURLS = [ 'success', @@ -42,6 +40,9 @@ class MyInAppBrowser extends InAppBrowser { String deviceToken; + double lat = 0.0; + double long = 0.0; + static bool isPaymentDone = false; MyInAppBrowser({this.onExitCallback, this.appo, this.onLoadStartCallback}); @@ -98,6 +99,11 @@ class MyInAppBrowser extends InAppBrowser { await this.sharedPref.getObject(USER_PROFILE)); authUser = data; } + if (await this.sharedPref.getDouble(USER_LAT) != null && + await this.sharedPref.getDouble(USER_LONG) != null) { + lat = await this.sharedPref.getDouble(USER_LAT); + long = await this.sharedPref.getDouble(USER_LONG); + } } openPaymentBrowser( @@ -112,11 +118,22 @@ class MyInAppBrowser extends InAppBrowser { dynamic patientID, AuthenticatedUser authenticatedUser, InAppBrowser browser) { - getDeviceToken(); this.browser = browser; - this.browser.openUrl( - url: generateURL(amount, orderDesc, transactionID, projId, emailId, - paymentMethod, patientType, patientName, patientID, authenticatedUser)); + getPatientData(); + generateURL( + amount, + orderDesc, + transactionID, + projId, + emailId, + paymentMethod, + patientType, + patientName, + patientID, + authenticatedUser) + .then((value) { + this.browser.openUrl(url: value); + }); } openBrowser(String url) { @@ -124,7 +141,7 @@ class MyInAppBrowser extends InAppBrowser { this.browser.openUrl(url: url); } - String generateURL( + Future generateURL( double amount, String orderDesc, String transactionID, @@ -137,15 +154,16 @@ class MyInAppBrowser extends InAppBrowser { AuthenticatedUser authUser, [var patientData, var servID, - var LiveServID]) { - getPatientData(); + var LiveServID]) async { + // getPatientData(); + getDeviceToken(); String currentLanguageID = getLanguageID() == 'ar' ? 'AR' : 'EN'; String form = getForm(); // if (authUser != null) { // form = form.replaceFirst("EMAIL_VALUE", authUser.emailAddress); // } else { - form = form.replaceFirst("EMAIL_VALUE", emailId); + form = form.replaceFirst("EMAIL_VALUE", emailId); // } form = form.replaceFirst('AMOUNT_VALUE', amount.toString()); @@ -157,12 +175,13 @@ class MyInAppBrowser extends InAppBrowser { form = form.replaceFirst('LANG_VALUE', currentLanguageID); form = form.replaceFirst('PATIENT_OUT_SA', authUser.outSA == 0 ? false.toString() : true.toString()); - form = form.replaceFirst('PATIENT_TYPE_ID', - patientData == null ? patientType.toString() : "1"); + form = form.replaceFirst( + 'PATIENT_TYPE_ID', patientData == null ? patientType.toString() : "1"); -// form = form.replaceFirst('DEVICE_TOKEN', this.cs.sharedService.getSharedData(AuthenticationService.DEVICE_TOKEN, false) + "," + this.cs.sharedService.getSharedData(AuthenticationService.APNS_TOKEN, false)); -// form = form.replaceFirst('LATITUDE_VALUE', this.cs.sharedService.getSharedData('userLat', false)); -// form = form.replaceFirst('LONGITUDE_VALUE', this.cs.sharedService.getSharedData('userLong', false)); + form = form.replaceFirst( + 'DEVICE_TOKEN', await sharedPref.getString(PUSH_TOKEN)); + form = form.replaceFirst('LATITUDE_VALUE', this.lat.toString()); + form = form.replaceFirst('LONGITUDE_VALUE', this.long.toString()); if (servID == "4") form = form.replaceFirst( @@ -179,16 +198,16 @@ class MyInAppBrowser extends InAppBrowser { } // if (patientData == null) { - form = form.replaceFirst('CUSTNAME_VALUE', patientName); - form = form.replaceFirst('CUSTID_VALUE', patientID.toString()); + form = form.replaceFirst('CUSTNAME_VALUE', patientName); + form = form.replaceFirst('CUSTID_VALUE', patientID.toString()); // } else { // form = form.replaceFirst('CUSTNAME_VALUE', patientData.depositorName); // form = form.replaceFirst('CUSTID_VALUE', patientData.fileNumber); // } - form = form.replaceFirst('LATITUDE_VALUE', "24.708488"); - form = form.replaceFirst('LONGITUDE_VALUE', "46.665925"); - form = form.replaceFirst('DEVICE_TOKEN', DEVICE_TOKEN); + // form = form.replaceFirst('LATITUDE_VALUE', "24.708488"); + // form = form.replaceFirst('LONGITUDE_VALUE', "46.665925"); + // form = form.replaceFirst('DEVICE_TOKEN', DEVICE_TOKEN); var bytes = utf8.encode(form); var base64Str = base64.encode(bytes); From 1ce0ef7b6cb2085da8c90ca76c4ded4cafed5343 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Sun, 24 Jan 2021 12:04:02 +0200 Subject: [PATCH 31/42] health-converter fix --- lib/config/localized_values.dart | 468 +++++++++++------- .../bmi_calculator/bmi_calculator.dart | 9 +- .../bmr_calculator/bmr_calculator.dart | 5 +- .../health_calculator/body_fat/body_fat.dart | 8 +- .../calorie_calculator.dart | 3 +- .../health_calculator/carbs/carbs.dart | 5 +- .../delivery_due/delivery_due.dart | 5 +- .../ideal_body/ideal_body.dart | 3 +- .../ovulation_period/ovulation_period.dart | 5 +- .../health_converter.dart | 14 +- .../health_converter/blood_cholesterol.dart | 23 +- .../health_converter/blood_sugar.dart | 22 +- .../health_converter/triglycerides.dart | 26 +- lib/uitl/translations_delegate_base.dart | 225 ++++++--- 14 files changed, 506 insertions(+), 315 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 34781055..dbe04170 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -2,23 +2,45 @@ // Used for Native through Platform Method Channel // --------- - -- - - - - - - - - ---------------- const Map platformLocalizedValues = { - "errorConnectingHmgNetwork": {"en": "Sorry you are not connecting to HMG network", "ar": "نعتذر لست متصل في شكبة مستشفى د.سليمان الحبيب"}, - "successConnectingHmgNetwork": {"en": "You connected to HMG network successfully, you can access the app", "ar": "تم التصال بشبكة د.سليمان الحبيب بنجاح, تستطيع الان استخدام تطبيق الحبيب"}, + "errorConnectingHmgNetwork": { + "en": "Sorry you are not connecting to HMG network", + "ar": "نعتذر لست متصل في شكبة مستشفى د.سليمان الحبيب" + }, + "successConnectingHmgNetwork": { + "en": "You connected to HMG network successfully, you can access the app", + "ar": + "تم التصال بشبكة د.سليمان الحبيب بنجاح, تستطيع الان استخدام تطبيق الحبيب" + }, "failedConnectingHmgNetwork": { - "en": "Sorry the connection to HMG network had been failed, make sure you are in range of HMG network", - "ar": "نعتذر لقد فشل الاتصال بشبكة د.سليمان الحبيب, تاكد من وجودك داخل نطاق الشبكة" + "en": + "Sorry the connection to HMG network had been failed, make sure you are in range of HMG network", + "ar": + "نعتذر لقد فشل الاتصال بشبكة د.سليمان الحبيب, تاكد من وجودك داخل نطاق الشبكة" + }, + "alreadyConnectedHmgNetwork": { + "en": " You already connected to HMG network to access Alhabib app", + "ar": "انت متصل مسبقاً بالشبكة تستطيع استخدام تطبيق الحبيب" + }, + "somethingWentWrong": { + "en": "Sorry something went wrong please try again later", + "ar": "نعتذر لخدمتكم يرجى المحاولة لاحقا" }, - "alreadyConnectedHmgNetwork": {"en": " You already connected to HMG network to access Alhabib app", "ar": "انت متصل مسبقاً بالشبكة تستطيع استخدام تطبيق الحبيب"}, - "somethingWentWrong": {"en": "Sorry something went wrong please try again later", "ar": "نعتذر لخدمتكم يرجى المحاولة لاحقا"}, "enablingWifi": {"en": "Enabling wifi...", "ar": "Enabling wifi..."}, - "connectedHmgNetworkWithInternet": {"en": "Successfully connected to the HMG network to access internet", "ar": "Successfully connected to the HMG network to access internet"}, + "connectedHmgNetworkWithInternet": { + "en": "Successfully connected to the HMG network to access internet", + "ar": "Successfully connected to the HMG network to access internet" + }, "connectedToHmgNetworkWithNoInternet": { - "en": "Successfully connected to the HMG network but it have no internet access", - "ar": "Successfully connected to the HMG network but it have no internet access" + "en": + "Successfully connected to the HMG network but it have no internet access", + "ar": + "Successfully connected to the HMG network but it have no internet access" }, "notConnectedToHmgNetworkSecurityIssue": { - "en": "We are not able to connect you to HMG network due to security reasons", - "ar": "We are not able to connect you to HMG network due to security reasons" + "en": + "We are not able to connect you to HMG network due to security reasons", + "ar": + "We are not able to connect you to HMG network due to security reasons" } }; @@ -45,7 +67,10 @@ const Map localizedValues = { 'clinicName': {'en': 'Clinic Name', 'ar': 'اسم العيادة'}, 'doctorName': {'en': 'Doctor Name', 'ar': 'إسم الطبيب'}, 'nearestAppo': {'en': 'Nearest appointment', 'ar': 'أقرب موعد'}, - 'searchByDocText': {'en': 'Type the name of the doctor to help you find him', 'ar': 'اكتب اسم الطبيب لمساعدتك في العثور عليه'}, + 'searchByDocText': { + 'en': 'Type the name of the doctor to help you find him', + 'ar': 'اكتب اسم الطبيب لمساعدتك في العثور عليه' + }, 'enterDocName': {'en': 'Enter Doctor name', 'ar': 'أدخل إسم الطبيب'}, 'search': {'en': 'Search', 'ar': 'بحث'}, 'bookNow': {'en': 'BOOK NOW', 'ar': 'احجز الآن'}, @@ -55,11 +80,17 @@ const Map localizedValues = { 'gender': {'en': 'Gender', 'ar': 'الجنس'}, 'nationality': {'en': 'Nationality', 'ar': 'الجنسية'}, 'docQualifications': {'en': 'Doctor Qualifications', 'ar': 'مؤهلات الطبيب'}, - 'confirmAppoHeading': {'en': 'Kindly confirm your Appointment', 'ar': 'يرجى تأكيد موعدك'}, + 'confirmAppoHeading': { + 'en': 'Kindly confirm your Appointment', + 'ar': 'يرجى تأكيد موعدك' + }, 'patientInfo': {'en': 'Patient Information', 'ar': 'معلومات المريض'}, 'bookSuccess': {'en': 'Book Success', 'ar': 'تم حجز الموعد بنجاح'}, 'patientShare': {'en': 'Patient Share', 'ar': 'المبلغ المستحق'}, - 'patientShareWithTax': {'en': 'Patient Share with Tax', 'ar': 'المبلغ الإجمالي المستحق'}, + 'patientShareWithTax': { + 'en': 'Patient Share with Tax', + 'ar': 'المبلغ الإجمالي المستحق' + }, 'confirmAppo': {'en': 'Confirm Appointment', 'ar': 'تأكيد الموعد'}, 'confirm': {'en': 'Confirm', 'ar': 'تأكيد'}, 'confirmLiveCare': {'en': 'Confirm LiveCare', 'ar': 'تأكيد لايف كير'}, @@ -81,18 +112,41 @@ const Map localizedValues = { 'ar': 'هل أنت متأكد أنك تريد إلغاء هذا الموعد؟' }, - 'upcoming-noAction': {'en': 'No Action Required', 'ar': 'لا يوجد إجراء مطلوب'}, - 'upcoming-confirm': {'en': 'Please confirm the appointment to avoid cancellation', 'ar': 'يرجى تأكيد الموعد لتفادي الإلغاء'}, + 'upcoming-noAction': { + 'en': 'No Action Required', + 'ar': 'لا يوجد إجراء مطلوب' + }, + 'upcoming-confirm': { + 'en': 'Please confirm the appointment to avoid cancellation', + 'ar': 'يرجى تأكيد الموعد لتفادي الإلغاء' + }, "book-success-confirm-more-24-1-2": { "en": "The online payment process will be available 24 hours before the appointment.", "ar": "- عملية الدفع الالكتروني ستكون متاحة قبل الموعد ب 24 ساعة." }, - 'upcoming-payment-pending': {'en': 'Online Payment will be Activated before 24 Hours of Appointment Time', 'ar': 'سيتم تفعيل خدمة الدفع الالكتروني قبل 24 ساعة من موعد الحجز'}, - 'upcoming-payment-now': {'en': 'Pay Online now to avoid long waiting queue', 'ar': 'ادفع الآن لتفادي الانتظار'}, - 'upcoming-QR': {'en': 'Use the QR Code to Check-In in hospital', 'ar': 'استخدم الرمز لتسجيل الحضور في المستشفى'}, - 'upcoming-virtual': {'en': 'This is a virtual appointment, Please adhere to the instructions for a seamless experience.', 'ar': 'هذا موعد اتصال مرئي عن بعد ، يرجى اتباع تعليمات الخدمة.'}, - 'upcoming-livecare': {'en': 'This is a LiveCare appointment', 'ar': 'هذا موعد لايف كير'}, + 'upcoming-payment-pending': { + 'en': + 'Online Payment will be Activated before 24 Hours of Appointment Time', + 'ar': 'سيتم تفعيل خدمة الدفع الالكتروني قبل 24 ساعة من موعد الحجز' + }, + 'upcoming-payment-now': { + 'en': 'Pay Online now to avoid long waiting queue', + 'ar': 'ادفع الآن لتفادي الانتظار' + }, + 'upcoming-QR': { + 'en': 'Use the QR Code to Check-In in hospital', + 'ar': 'استخدم الرمز لتسجيل الحضور في المستشفى' + }, + 'upcoming-virtual': { + 'en': + 'This is a virtual appointment, Please adhere to the instructions for a seamless experience.', + 'ar': 'هذا موعد اتصال مرئي عن بعد ، يرجى اتباع تعليمات الخدمة.' + }, + 'upcoming-livecare': { + 'en': 'This is a LiveCare appointment', + 'ar': 'هذا موعد لايف كير' + }, 'upcoming-details': {'en': 'More Details', 'ar': 'المزيد'}, 'reschedule': {'en': 'Reschedule', 'ar': 'إعادة جدولة'}, 'raise': {'en': 'Raise', 'ar': 'رفع'}, @@ -339,35 +393,70 @@ const Map localizedValues = { "seeDetails": {"en": "SEE DETAILS", "ar": "منافعك التامينية"}, "insuranceCards": {"en": "Insurance Cards", "ar": "بطاقات التأمين"}, "requestType": {"en": "Request Type", "ar": "نوع الاستفسار"}, - "register-info-family": {"en": "How would like to add the new member?", "ar": "كيف ترغب باضافة العضو الجديد؟"}, - "remove-family-member": {"en": "Remove this member?", "ar": "إزالة ملف العضو؟"}, + "register-info-family": { + "en": "How would like to add the new member?", + "ar": "كيف ترغب باضافة العضو الجديد؟" + }, + "remove-family-member": { + "en": "Remove this member?", + "ar": "إزالة ملف العضو؟" + }, "MyMedicalFile": {"en": "My Medical File", 'ar': 'ملف الطبي الالكتروني'}, - "myMedicalFileSubTitle": {"en": "All your medical records", 'ar': 'جميع سجلاتك الطبية'}, + "myMedicalFileSubTitle": { + "en": "All your medical records", + 'ar': 'جميع سجلاتك الطبية' + }, "viewMore": {"en": "View More", 'ar': 'عرض المزيد'}, - "homeHealthCareService": {"en": "Home Health Care Service", 'ar': 'الرعاية الصحية المنزلية'}, + "homeHealthCareService": { + "en": "Home Health Care Service", + 'ar': 'الرعاية الصحية المنزلية' + }, "OnlinePharmacy": {"en": "Online Pharmacy", 'ar': 'صيدليات الحبيب'}, "EmergencyService": {"en": "Emergency Service", 'ar': 'الفحص الطبي الشامل'}, - "OnlinePaymentService": {"en": "Online Payment Service", 'ar': 'خدمة الدفع الإلكتدوني'}, - "OffersAndPackages": {"en": "Online transfer request", 'ar': 'طلب التحويل الالكتروني'}, - "ComprehensiveMedicalCheckup": {"en": "Comprehensive Medical Check up", 'ar': 'فحص طبي شامل'}, + "OnlinePaymentService": { + "en": "Online Payment Service", + 'ar': 'خدمة الدفع الإلكتدوني' + }, + "OffersAndPackages": { + "en": "Online transfer request", + 'ar': 'طلب التحويل الالكتروني' + }, + "ComprehensiveMedicalCheckup": { + "en": "Comprehensive Medical Check up", + 'ar': 'فحص طبي شامل' + }, "HMGService": {"en": "HMG Service", 'ar': 'جميع خدمات الحبيب'}, - "ViewAllHabibMedicalService": {"en": "View All Habib Medical Service", 'ar': 'عرض خدمات الحبيب الطبية'}, + "ViewAllHabibMedicalService": { + "en": "View All Habib Medical Service", + 'ar': 'عرض خدمات الحبيب الطبية' + }, "viewAll": {"en": "View All", 'ar': 'عرض الكل'}, "view": {"en": "View", 'ar': 'عرض'}, "ContactUs": {"en": "Contact Us", 'ar': 'الوصول إلينا'}, - "ViewAllWaysReachUs": {"en": "View All Ways Reach Us", 'ar': 'جميع طرق الاتصال بنا'}, + "ViewAllWaysReachUs": { + "en": "View All Ways Reach Us", + 'ar': 'جميع طرق الاتصال بنا' + }, "medicalProfile": {"en": "Medical Profile", 'ar': 'الملف الطبي'}, "consultation": {"en": "Consultation", "ar": "استشارة"}, "logs": {"en": "Logs", "ar": "السجلات"}, "textToSpeech": {"en": "How May I Help You?", "ar": "كيف يمكنني مساعدتك؟"}, "locationDialogMessage": { - "en": "Allow the HMG app to access your location will assist you in showing the hospitals according to the nearest to you.", - "ar": "السماح لتطبيق مجموعة الحبيب الطبية بالوصول إلى موقعك سيساعدك في إظهار المستشفيات وفقًا للأقرب إليك." + "en": + "Allow the HMG app to access your location will assist you in showing the hospitals according to the nearest to you.", + "ar": + "السماح لتطبيق مجموعة الحبيب الطبية بالوصول إلى موقعك سيساعدك في إظهار المستشفيات وفقًا للأقرب إليك." }, - "user-view-requester": {"en": "User Wants To View Your Medical File", "ar": "أشخاص يرغبون الاطلاع على ملفك الطبي"}, - "user-view": {"en": "User Can View Your Medical File", "ar": "أشخاص يمكنهم الاطلاع على ملفك الطبي"}, + "user-view-requester": { + "en": "User Wants To View Your Medical File", + "ar": "أشخاص يرغبون الاطلاع على ملفك الطبي" + }, + "user-view": { + "en": "User Can View Your Medical File", + "ar": "أشخاص يمكنهم الاطلاع على ملفك الطبي" + }, "parking": {"en": "Parking", "ar": "مواقف"}, "alhabiServices": {"en": "HMG Service", "ar": "خدمات الحبيب"}, @@ -492,12 +581,22 @@ const Map localizedValues = { "MyBalances": {"en": "My Balances", "ar": "رصيدي"}, "BalanceAmount": {"en": "Balance Amount", "ar": "رصيدالحساب"}, "TotalBalance": {"en": "Total Balance", "ar": "الرصيد الكلي"}, - "CreateAdvancedPayment": {"en": "Create Advanced Payment", "ar": "إنشاء دفعة مقدمة"}, + "CreateAdvancedPayment": { + "en": "Create Advanced Payment", + "ar": "إنشاء دفعة مقدمة" + }, "AdvancePayment": {"en": "Advance Payment", "ar": "الدفع مقدما"}, - "AdvancePaymentLabel": {"en": "You can create and add an Advanced Payment for you account or other accounts.", "ar": "يمكنك تحويل مبلغ لحسابك لدى المجموعة أو لحساب احد المراجعين"}, + "AdvancePaymentLabel": { + "en": + "You can create and add an Advanced Payment for you account or other accounts.", + "ar": "يمكنك تحويل مبلغ لحسابك لدى المجموعة أو لحساب احد المراجعين" + }, "FileNumber": {"en": "File Number", "ar": "رقم الملف"}, "Amount": {"en": "Amount *", "ar": "المبلغ *"}, - "DepositorEmail": {"en": "Depositor Email *", "ar": "البريد الإلكتروني للمودع *"}, + "DepositorEmail": { + "en": "Depositor Email *", + "ar": "البريد الإلكتروني للمودع *" + }, "Notes": {"en": "Notes", "ar": "ملاحظات"}, "SelectPatientName": {"en": "Select Patient Name", "ar": "اختر اسم المريض"}, "SelectFamilyPatientName": {"en": "Family Members", "ar": "أفراد الأسرة"}, @@ -711,9 +810,15 @@ const Map localizedValues = { // pharmacy module "medicationRefill": {"en": "MEDICATION REFILL", "ar": "إعادة تعبئة الدواء"}, - "offersAndPromotions": {"en": "OFFERS & SPECIAL PROMOTIONS", "ar": "العروض والترقيات الخاصة"}, + "offersAndPromotions": { + "en": "OFFERS & SPECIAL PROMOTIONS", + "ar": "العروض والترقيات الخاصة" + }, "myPrescriptions": {"en": "MY PRESCRIPTIONS", "ar": "وصفاتي"}, - "searchAndScanMedication": {"en": "SEARCH & SCAN FOR MEDICATION", "ar": "البحث والمسح للأدوية"}, + "searchAndScanMedication": { + "en": "SEARCH & SCAN FOR MEDICATION", + "ar": "البحث والمسح للأدوية" + }, "shopByBrands": {"en": "Shop By Brands", "ar": "تسوق حسب الماركات"}, "recentlyViewed": {"en": "Recently Viewed", "ar": "شوهدت مؤخرا"}, "bestSellers": {"en": "Best Sellers", "ar": "أفضل البائعين"}, @@ -771,7 +876,10 @@ const Map localizedValues = { "profile": {"en": "Profile", "ar": "ملفي"}, "notifications": {"en": "Notifications", "ar": "إشعارات"}, "notificationDetails": {"en": "Notification Details", "ar": "تفاصيل الاشعار"}, - "notificationDetailsa": {"en": "Notification Details", "ar": "تفاصيل الاشعار"}, + "notificationDetailsa": { + "en": "Notification Details", + "ar": "تفاصيل الاشعار" + }, "info-my-doctor-points": { "en": [ @@ -780,15 +888,24 @@ const Map localizedValues = { "View details of your appointments with the selected doctor.", "Book appointment with the doctor. ", ], - "ar": ["الاطلاع على معلومات الطبيب ومؤهلاته.", "الاطلاع على جدول الطبيب.", "الاطلاع على تفاصيل المواعيد التي تمت مع الطبيب.", "حجز موعد مع الطبيب."] + "ar": [ + "الاطلاع على معلومات الطبيب ومؤهلاته.", + "الاطلاع على جدول الطبيب.", + "الاطلاع على تفاصيل المواعيد التي تمت مع الطبيب.", + "حجز موعد مع الطبيب." + ] }, "info-my-doctor": { - "en": "This service allows you to see all the doctors you have visited in Al Habib Medical Group, and through this service:", - "ar": "خدمة اطبائي: هذه الخدمة تمكنك من الاطلاع على جميع الاطباء الذين قمت بزيارتهم في مجموعة الحبيب الطبية, كما تستطيع من خلال هذه الخدمة:" + "en": + "This service allows you to see all the doctors you have visited in Al Habib Medical Group, and through this service:", + "ar": + "خدمة اطبائي: هذه الخدمة تمكنك من الاطلاع على جميع الاطباء الذين قمت بزيارتهم في مجموعة الحبيب الطبية, كما تستطيع من خلال هذه الخدمة:" }, "info-prescriptions": { - "en": "This service allows you to view all the medical prescriptions issued by Al Habib Medical Group, and through this service, you can:", - "ar": "خدمة الوصفات الطبية: هذه الخدمة تمكنك من الاطلاع على جميع الوصفات الطبية التي تم اصدارها في مجموعة الحبيب الطبية، كما تستطيع من خلال هذه الخدمة:" + "en": + "This service allows you to view all the medical prescriptions issued by Al Habib Medical Group, and through this service, you can:", + "ar": + "خدمة الوصفات الطبية: هذه الخدمة تمكنك من الاطلاع على جميع الوصفات الطبية التي تم اصدارها في مجموعة الحبيب الطبية، كما تستطيع من خلال هذه الخدمة:" }, "info-my-prescription-points": { "en": [ @@ -812,8 +929,10 @@ const Map localizedValues = { }, "info-insurance-cards": { - "en": "This service allows you to view all the insurance cards that recorded during your visits to Al Habib Medical Group in addition to:", - "ar": "خدمة بطاقات التامين: هذه الخدمة تمكنك من الاطلاع على جميع بطاقات التامين والتي تم تسجيلها اثناء زياراتك لمجموعة الحبيب الطبية بالاضافة الى:" + "en": + "This service allows you to view all the insurance cards that recorded during your visits to Al Habib Medical Group in addition to:", + "ar": + "خدمة بطاقات التامين: هذه الخدمة تمكنك من الاطلاع على جميع بطاقات التامين والتي تم تسجيلها اثناء زياراتك لمجموعة الحبيب الطبية بالاضافة الى:" }, "info-insurance-cards-points": { @@ -986,7 +1105,10 @@ const Map localizedValues = { "message-type": {"en": "Message Type", "ar": "نوع الرسالة"}, "compliment": {"en": "compliment", "ar": "ثناء"}, "suggestion": {"en": "Suggestion", "ar": "إقتراح"}, - "your-feedback": {"en": "Your feedback was sent", "ar": "لقد تم ارسال اقراحك شكرا لك"}, + "your-feedback": { + "en": "Your feedback was sent", + "ar": "لقد تم ارسال اقراحك شكرا لك" + }, "select-part": { "en": "Please select the part that complain about", "ar": "يرجى تحديد الجزء الذي تشكو منه" @@ -1001,10 +1123,15 @@ const Map localizedValues = { "YouCanFind": {"en": "You Can Find ", "ar": "باستطاعتك العثور على "}, "ItemInSearch": {"en": " Item In Search", "ar": " عنصر في البحث "}, "wantConnectHmgNetwork": { - "en": "Dear customer there is no internet access, Do you want to connect with HMG network to use our app, make sure you are in range of HMG network", - "ar": "عزيز العميل لا يوجد اتصال بالإنترنت, هل تريد الاتصال بشبكة مستشفى د. سليمان الحبيب لاستخدام التطبيق. يجب عليك ان تكون في نطاق شبكة المستشفى" + "en": + "Dear customer there is no internet access, Do you want to connect with HMG network to use our app, make sure you are in range of HMG network", + "ar": + "عزيز العميل لا يوجد اتصال بالإنترنت, هل تريد الاتصال بشبكة مستشفى د. سليمان الحبيب لاستخدام التطبيق. يجب عليك ان تكون في نطاق شبكة المستشفى" + }, + "failedToAccessHmgServices": { + "en": "Connected with HMG Network,\n\nBut failed to access HMG services", + "ar": "Connected with HMG Network,\n\nBut failed to access HMG services" }, - "failedToAccessHmgServices": {"en": "Connected with HMG Network,\n\nBut failed to access HMG services", "ar": "Connected with HMG Network,\n\nBut failed to access HMG services"}, "offerAndPackages": {"en": "Offers And Packages", "ar": "العروض والباقات"}, "InvoiceNo": {"en": " Invoice No", "ar": "رقم الفاتورة"}, "SpecialResult": {"en": " Special Result", "ar": "نتيجة خاصة"}, @@ -1256,18 +1383,9 @@ const Map localizedValues = { "selectFileSouse": {"en": "Select file souse", "ar": "حدد الملف"}, "gallery": {"en": "Gallery", "ar": "معرض الصور"}, "camera": {"en": "Camera", "ar": "كاميرا"}, - "med-report": { - "en": "Medical Reports", - "ar": "التقارير الطبية" - }, - "new-med-report": { - "en": "Requests", - "ar": "الطلبات" - }, - "requestReport":{ - "en":"Request a report", - "ar":" طلب تقرير" - }, + "med-report": {"en": "Medical Reports", "ar": "التقارير الطبية"}, + "new-med-report": {"en": "Requests", "ar": "الطلبات"}, + "requestReport": {"en": "Request a report", "ar": " طلب تقرير"}, "confirm-msg-report": { "en": "Request for medical report?", "ar": "طلب تقرير طبي؟" @@ -1276,26 +1394,11 @@ const Map localizedValues = { "en": "The request has been submitted successfully", "ar": "تم تنفيذ طلبك بنجاح" }, - "pulseTitle": { - "en": "Heart rate", - "ar": "معدل النبض بالدقيقة" - }, - "systolic-lng": { - "en": "Systolic", - "ar": "الإنقباض" - }, - "diastolic-lng": { - "en": "Diastolic", - "ar": "الإنبساط" - }, - "policy-holder": { - "en": "Policy Holder", - "ar": "حامل بطاقة التأمين" - }, - "policy-no": { - "en": "Policy Number", - "ar": "رقم سياسات" - }, + "pulseTitle": {"en": "Heart rate", "ar": "معدل النبض بالدقيقة"}, + "systolic-lng": {"en": "Systolic", "ar": "الإنقباض"}, + "diastolic-lng": {"en": "Diastolic", "ar": "الإنبساط"}, + "policy-holder": {"en": "Policy Holder", "ar": "حامل بطاقة التأمين"}, + "policy-no": {"en": "Policy Number", "ar": "رقم سياسات"}, "agree": { "en": "I agree, this is the correct information", "ar": "موافق، هذه المعلومات صحيحة" @@ -1304,30 +1407,12 @@ const Map localizedValues = { "en": "No, this is not the correct information", "ar": "غير موافق، هذه المعلومات غير الصحيحة" }, - "expiry-date": { - "en": "Expiry Date", - "ar": "تاريخ انتهاء الصلاحية" - }, - "class": { - "en": "Class", - "ar": "فئة" - }, - "approval": { - "en": "Approval", - "ar": "موافقة" - }, - "no-data": { - "en": "No data found", - "ar": "لاتوجد بيانات" - }, - "insurance-details": { - "en": "Insurance Details", - "ar": "تفاصيل التأمين" - }, - "nearest-hospital": { - "en": "Nearest Hospital", - "ar": "أقرب مستشفى" - }, + "expiry-date": {"en": "Expiry Date", "ar": "تاريخ انتهاء الصلاحية"}, + "class": {"en": "Class", "ar": "فئة"}, + "approval": {"en": "Approval", "ar": "موافقة"}, + "no-data": {"en": "No data found", "ar": "لاتوجد بيانات"}, + "insurance-details": {"en": "Insurance Details", "ar": "تفاصيل التأمين"}, + "nearest-hospital": {"en": "Nearest Hospital", "ar": "أقرب مستشفى"}, "request-sent": { "en": "Request sent successfully", "ar": "تم إرسال الطلب بنجاح" @@ -1336,10 +1421,7 @@ const Map localizedValues = { "en": "Message sent successfully", "ar": "تم إرسال الرسالة بنجاح" }, - "sent-on": { - "en": "Sent on", - "ar": "أرسلت في" - }, + "sent-on": {"en": "Sent on", "ar": "أرسلت في"}, "attach-insurace-image": { "en": "Attach insurance card image", "ar": "إرفاق صورة بطاقة التأمين" @@ -1349,56 +1431,31 @@ const Map localizedValues = { "ar": "لا يزال بإمكانك الإرسال ، إذا لم يكن لديك صورة تأمين" }, "info-insur-cards": { - "en": "This service allows you to view all the insurance cards that recorded during your visits to Al Habib Medical Group in addition to:", - "ar": "خدمة بطاقات التامين: هذه الخدمة تمكنك من الاطلاع على جميع بطاقات التامين والتي تم تسجيلها اثناء زياراتك لمجموعة الحبيب الطبية بالاضافة الى:" + "en": + "This service allows you to view all the insurance cards that recorded during your visits to Al Habib Medical Group in addition to:", + "ar": + "خدمة بطاقات التامين: هذه الخدمة تمكنك من الاطلاع على جميع بطاقات التامين والتي تم تسجيلها اثناء زياراتك لمجموعة الحبيب الطبية بالاضافة الى:" }, "scan-now": { "en": "If you have a card / Document Scan now", "ar": "إذا كانت لديك بطاقة / مستند ارفقها الان" }, - "liveCare": { - "en": "Live Care", - "ar": "لايف كير" - }, - "topBrands":{ - "en":"Top Brands", - "ar":"اعلى العلامات التجارية" - }, - - "notifyMe":{ - "en":"notify me", - "ar":"اعلمني" - }, - "specification":{ - "en":"Specification", - "ar":"تخصيص" - }, + "liveCare": {"en": "Live Care", "ar": "لايف كير"}, + "topBrands": {"en": "Top Brands", "ar": "اعلى العلامات التجارية"}, - "availability":{ - "en":"Availability", - "ar":"التوفر" - }, + "notifyMe": {"en": "notify me", "ar": "اعلمني"}, + "specification": {"en": "Specification", "ar": "تخصيص"}, - "quantitySize":{ - "en":"Quantity", - "ar":"كميه" - }, - "addToCart":{ - "en":"add to cart", - "ar":"إضفة للسلة" - }, - "buyNow":{ - "en":"buy now", - "ar":"إشتري الان" - }, - "quantityShortcut":{ - "en":"QTY", - "ar":"كمية" - }, + "availability": {"en": "Availability", "ar": "التوفر"}, + "quantitySize": {"en": "Quantity", "ar": "كميه"}, + "addToCart": {"en": "add to cart", "ar": "إضفة للسلة"}, + "buyNow": {"en": "buy now", "ar": "إشتري الان"}, + "quantityShortcut": {"en": "QTY", "ar": "كمية"}, "pharmacyServiceTermsCondition": { - "en": "I agree with the terms of service and I adhere to them unconditionally", + "en": + "I agree with the terms of service and I adhere to them unconditionally", "ar": " أوافق على شروط الخدمة وألتزم بها دون قيد أو شرط" }, "Year": {"en": "YEAR", "ar": "السنة"}, @@ -1461,58 +1518,87 @@ const Map localizedValues = { "en": "Track Delivery Driver", "ar": "trackDeliveryDriver" }, - "covidTest": { - "en": "COVID-19 TEST", - "ar": "فحص كورونا" - }, - "driveThru": { - "en": "Drive-Thru", - "ar": "من السيارة" - }, + "covidTest": {"en": "COVID-19 TEST", "ar": "فحص كورونا"}, + "driveThru": {"en": "Drive-Thru", "ar": "من السيارة"}, "NearestErDesc": { - "en": "\nThis service Displays nearest branch\n among all the branches of All Habib \n medical Group based on your current Location", - "ar": "\nتعرض هذه الخدمة أقرب فرع\n من بين جميع فروع مجموعة \nالحبيب الطبية بناءً على موقعك الحالي." - }, - "NearestEr": { - "en": "Nearest ER", - "ar": "أقرب ER" + "en": + "\nThis service Displays nearest branch\n among all the branches of All Habib \n medical Group based on your current Location", + "ar": + "\nتعرض هذه الخدمة أقرب فرع\n من بين جميع فروع مجموعة \nالحبيب الطبية بناءً على موقعك الحالي." }, + "NearestEr": {"en": "Nearest ER", "ar": "أقرب ER"}, "infoCMC": { - "en": "Through this service, you can request a set of tests that help you and your doctor to understand the current health condition and then identify potential risks.", - "ar": "من خلال هذه الخدمة يمكنك طلب مجموعة من الفحوصات التي تساعدك وتساعد طبيبك في فهم حالتك الصحية الحالية ومن ثم تحديد المخاطر المحتملة" + "en": + "Through this service, you can request a set of tests that help you and your doctor to understand the current health condition and then identify potential risks.", + "ar": + "من خلال هذه الخدمة يمكنك طلب مجموعة من الفحوصات التي تساعدك وتساعد طبيبك في فهم حالتك الصحية الحالية ومن ثم تحديد المخاطر المحتملة" }, "instructionAgree": { - "en": "This monthly Health Summary Report reflects the health indicators and analysis results of the latest visits. Please note that this will be sent automatically from the system and it's not considered as an official report so no medical decisions should be taken based on it.", - "ar": "هذا ملخص التقرير الصحي الشهري و الذي يسرد المؤشرات الصحية و نتائج التحاليل لأخر الزيارات. يرجى ملاحظة أن هذا التقرير هو تقرير يتم ارساله بشكل آلي من النظام و لا يعتبر رسمي و لا تؤخذ عليه أي قرارات طبية" - }, - "reqId": { - "en": "Request ID:", - "ar": " رقم الطلب" + "en": + "This monthly Health Summary Report reflects the health indicators and analysis results of the latest visits. Please note that this will be sent automatically from the system and it's not considered as an official report so no medical decisions should be taken based on it.", + "ar": + "هذا ملخص التقرير الصحي الشهري و الذي يسرد المؤشرات الصحية و نتائج التحاليل لأخر الزيارات. يرجى ملاحظة أن هذا التقرير هو تقرير يتم ارساله بشكل آلي من النظام و لا يعتبر رسمي و لا تؤخذ عليه أي قرارات طبية" }, + "reqId": {"en": "Request ID:", "ar": " رقم الطلب"}, "covid19_driveThrueTest": { "en": "'Covid-19- Drive-Thru Test'", "ar": "Covid-19- الفحص من خلال القيادة" }, - "E-Referral": { - "en": "'E-Referral'", - "ar": "الإحالة الإلكترونية" + "E-Referral": {"en": "'E-Referral'", "ar": "الإحالة الإلكترونية"}, + "childName": {"en": "'CHILD NAME'", "ar": "إسم الطفل"}, + "recordDeleted": {"en": "'Record Deleted'", "ar": "تم حذف السجل"}, + "msg_email_address_up_to_date": { + "en": + "Please ensure that the email address is up-to-date and process to view the schedule", + "ar": + "يرجى التأكد من أن عنوان البريد الإلكتروني محدث وأن العملية لعرض الجدول الزمني" + }, + "add-new-child": {"en": "ADD NEW CHILD", "ar": "إضافة طفل جديد"}, + "visit": {"en": "Visit", "ar": "الزيارة"}, + "send-child-email-msg": { + "en": "Send the child's schedule to the email", + "ar": "أرسل جدول الطفل إلى البريد الإلكتروني" }, - "childName": { - "en": "'CHILD NAME'", - "ar": "إسم الطفل" + "vaccination-add-child-msg": { + "en": + "Add the child's information below to receive the schedule of vaccinations.", + "ar": "أضف معلومات الطفل أدناه للحصول على جدول التطعيمات." }, - "recordDeleted": { - "en": "'Record Deleted'", - "ar": "تم حذف السجل" + "child_added_successfully": { + "en": "Child added successfully", + "ar": "تمت إضافة الطفل بنجاح" + }, + "bloodSugar": {"en": "Blood", "ar": "السكر في الدم"}, + "sugar": {"en": "Sugar", "ar": ""}, + "bloodCholesterol": {"en": "Blood", "ar": " الكولسترول في الدم"}, + + "cholesterol": {"en": "Cholesterol", "ar": ""}, + "triglycerides": {"en": "Triglycerides", "ar": "الدهون الثلاثية"}, + + "fatInBlood": {"en": "Fat In Blood", "ar": ""}, + "convertFrom": {"en": "Convert From", "ar": "تحويل من"}, + "calculate": {"en": "calculate", "ar": "حساب"}, + "enterReadingValue": {"en": "Enter the reading value", "ar": "ادخل القيمة"}, + "result": {"en": "Result", "ar": "النتيجة"}, + "bloodSugarConversion": { + "en": "Blood Sugar Conversion", + "ar": "السكر في الدم" + }, + "convertBloodSugarStatement": { + "en": + "Convert blood sugar/glucose from mmol/l (UK standard) to mg/dlt (US standard) and vice versa.", + "ar": + "تحويل مستوى السكر في الدم من مليمول/ لتر (مقياس المملكة المتحدة) الى ملغ/ ديسيلتر (مقياس الولايات المتحدة) والعكس" + }, + "convertCholesterolStatement": { + "en": "Convert blood cholesterol from\n mmol/l to mg/dlt and vice versa.", + "ar": + "تحويل مستوى الكولسترول في الدم من مليمول/ لتر (مقياس المملكة المتحدة) الى ملغ/ ديسيلتر (مقياس الولايات المتحدة) والعكس" + }, + "triglyceridesConvertStatement": { + "en": "Convert Triglycerides from mmol/l to mg/dlt and vice versa.", + "ar": + "تحويل مستوى الدهون الثلاثية في الدم من مليمول/ لتر (مقياس المملكة المتحدة) الى ملغ/ ديسيلتر (مقياس الولايات المتحدة) والعكس" }, - "msg_email_address_up_to_date": { - "en": "Please ensure that the email address is up-to-date and process to view the schedule", - "ar": "يرجى التأكد من أن عنوان البريد الإلكتروني محدث وأن العملية لعرض الجدول الزمني" - }, - "add-new-child": {"en" : "ADD NEW CHILD", "ar": "إضافة طفل جديد"}, - "visit": {"en" : "Visit", "ar": "الزيارة"}, - "send-child-email-msg": {"en" : "Send the child's schedule to the email", "ar": "أرسل جدول الطفل إلى البريد الإلكتروني"}, - "vaccination-add-child-msg": {"en" : "Add the child's information below to receive the schedule of vaccinations.", "ar": "أضف معلومات الطفل أدناه للحصول على جدول التطعيمات."}, - "child_added_successfully": {"en" : "Child added successfully", "ar": "تمت إضافة الطفل بنجاح"}, }; diff --git a/lib/pages/AlHabibMedicalService/health_calculator/bmi_calculator/bmi_calculator.dart b/lib/pages/AlHabibMedicalService/health_calculator/bmi_calculator/bmi_calculator.dart index c84053c5..68cd2c99 100644 --- a/lib/pages/AlHabibMedicalService/health_calculator/bmi_calculator/bmi_calculator.dart +++ b/lib/pages/AlHabibMedicalService/health_calculator/bmi_calculator/bmi_calculator.dart @@ -1,4 +1,5 @@ import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/material.dart'; @@ -490,11 +491,11 @@ class _BMICalculatorState extends State { height: 25.0, ), Container( - height: 100.0, + height: 50.0, width: 350.0, - child: Button( + child: SecondaryButton( label: 'CALCULATE', - onTap: () { + onTap: () => { setState(() { calculateBMI(); showTextResult(); @@ -510,7 +511,7 @@ class _BMICalculatorState extends State { )), ); } - }); + }) }, ), ), diff --git a/lib/pages/AlHabibMedicalService/health_calculator/bmr_calculator/bmr_calculator.dart b/lib/pages/AlHabibMedicalService/health_calculator/bmr_calculator/bmr_calculator.dart index 1af0f949..01393e0b 100644 --- a/lib/pages/AlHabibMedicalService/health_calculator/bmr_calculator/bmr_calculator.dart +++ b/lib/pages/AlHabibMedicalService/health_calculator/bmr_calculator/bmr_calculator.dart @@ -1,4 +1,5 @@ import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/material.dart'; @@ -687,9 +688,9 @@ class _BmrCalculatorState extends State { height: 30.0, ), Container( - height: 100.0, + height: 50.0, width: 350.0, - child: Button( + child: SecondaryButton( label: 'CALCULATE', onTap: () { setState(() { diff --git a/lib/pages/AlHabibMedicalService/health_calculator/body_fat/body_fat.dart b/lib/pages/AlHabibMedicalService/health_calculator/body_fat/body_fat.dart index 91847e37..51b4cad6 100644 --- a/lib/pages/AlHabibMedicalService/health_calculator/body_fat/body_fat.dart +++ b/lib/pages/AlHabibMedicalService/health_calculator/body_fat/body_fat.dart @@ -1,4 +1,5 @@ import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/material.dart'; @@ -985,8 +986,13 @@ class _BodyFatState extends State { Container( height: 100.0, width: 350.0, - child: Button( + child: SecondaryButton( label: 'CALCULATE', + // onTap: () => { + // setState(() { + // print('hiii'); + // }) + // } onTap: () { setState(() { calculateBodyFat(); diff --git a/lib/pages/AlHabibMedicalService/health_calculator/calorie_calculator/calorie_calculator.dart b/lib/pages/AlHabibMedicalService/health_calculator/calorie_calculator/calorie_calculator.dart index 4361425a..e2196540 100644 --- a/lib/pages/AlHabibMedicalService/health_calculator/calorie_calculator/calorie_calculator.dart +++ b/lib/pages/AlHabibMedicalService/health_calculator/calorie_calculator/calorie_calculator.dart @@ -1,4 +1,5 @@ import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/material.dart'; @@ -648,7 +649,7 @@ class _CalorieCalculatorState extends State { Container( height: 100.0, width: 350.0, - child: Button( + child: SecondaryButton( label: 'CALCULATE', onTap: () { setState(() { diff --git a/lib/pages/AlHabibMedicalService/health_calculator/carbs/carbs.dart b/lib/pages/AlHabibMedicalService/health_calculator/carbs/carbs.dart index e273b075..50152328 100644 --- a/lib/pages/AlHabibMedicalService/health_calculator/carbs/carbs.dart +++ b/lib/pages/AlHabibMedicalService/health_calculator/carbs/carbs.dart @@ -1,4 +1,5 @@ import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/material.dart'; @@ -329,9 +330,9 @@ class _CarbsState extends State { height: 55.0, ), Container( - height: 100.0, + height: 50.0, width: 350.0, - child: Button( + child: SecondaryButton( label: 'CALCULATE', onTap: () { setState(() { diff --git a/lib/pages/AlHabibMedicalService/health_calculator/delivery_due/delivery_due.dart b/lib/pages/AlHabibMedicalService/health_calculator/delivery_due/delivery_due.dart index c9993b95..c69f0564 100644 --- a/lib/pages/AlHabibMedicalService/health_calculator/delivery_due/delivery_due.dart +++ b/lib/pages/AlHabibMedicalService/health_calculator/delivery_due/delivery_due.dart @@ -1,5 +1,6 @@ import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/material.dart'; @@ -111,9 +112,9 @@ class _DeliveryDueState extends State { height: 280.0, ), Container( - height: 100.0, + height: 50.0, width: 350.0, - child: Button( + child: SecondaryButton( label: 'CALCULATE', onTap: () { setState(() { diff --git a/lib/pages/AlHabibMedicalService/health_calculator/ideal_body/ideal_body.dart b/lib/pages/AlHabibMedicalService/health_calculator/ideal_body/ideal_body.dart index 9bdbfb36..2aff7836 100644 --- a/lib/pages/AlHabibMedicalService/health_calculator/ideal_body/ideal_body.dart +++ b/lib/pages/AlHabibMedicalService/health_calculator/ideal_body/ideal_body.dart @@ -1,4 +1,5 @@ import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/material.dart'; @@ -518,7 +519,7 @@ class _IdealBodyState extends State { Container( height: 100.0, width: 350.0, - child: Button( + child: SecondaryButton( label: 'CALCULATE', onTap: () { setState(() { diff --git a/lib/pages/AlHabibMedicalService/health_calculator/ovulation_period/ovulation_period.dart b/lib/pages/AlHabibMedicalService/health_calculator/ovulation_period/ovulation_period.dart index 1a272c11..9c5dc0d3 100644 --- a/lib/pages/AlHabibMedicalService/health_calculator/ovulation_period/ovulation_period.dart +++ b/lib/pages/AlHabibMedicalService/health_calculator/ovulation_period/ovulation_period.dart @@ -1,5 +1,6 @@ import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/material.dart'; @@ -319,9 +320,9 @@ class _OvulationPeriodState extends State { height: 220.0, ), Container( - height: 100.0, + height: 50.0, width: 350.0, - child: Button( + child: SecondaryButton( label: 'CALCULATE', onTap: () { setState(() { diff --git a/lib/pages/AlHabibMedicalService/health_converter.dart b/lib/pages/AlHabibMedicalService/health_converter.dart index 61ea406f..2b3b1a8e 100644 --- a/lib/pages/AlHabibMedicalService/health_converter.dart +++ b/lib/pages/AlHabibMedicalService/health_converter.dart @@ -18,7 +18,7 @@ class _HealthConverterState extends State { Widget build(BuildContext context) { return AppScaffold( isShowAppBar: true, - appBarTitle: 'Health Converter', + appBarTitle: TranslationBase.of(context).converters, body: Column( children: [ Container( @@ -37,9 +37,9 @@ class _HealthConverterState extends State { ); }, child: MedicalProfileItem( - title: 'Blood', + title: TranslationBase.of(context).bloodSugar, imagePath: 'blood_sugar_icon.png', - subTitle: 'Sugar', + subTitle: TranslationBase.of(context).sugar, ), ), ), @@ -55,9 +55,9 @@ class _HealthConverterState extends State { ); }, child: MedicalProfileItem( - title: 'Blood', + title: TranslationBase.of(context).bloodCholesterol, imagePath: 'blood_cholesterol_icon.png', - subTitle: 'Cholesterol', + subTitle: TranslationBase.of(context).cholesterol, ), ), ), @@ -77,9 +77,9 @@ class _HealthConverterState extends State { ); }, child: MedicalProfileItem( - title: 'Triglycerides', + title: TranslationBase.of(context).triglycerides, imagePath: 'triglycerides_blood_icon.png', - subTitle: 'Fat in blood', + subTitle: TranslationBase.of(context).fatInBlood, ), ), ), diff --git a/lib/pages/AlHabibMedicalService/health_converter/blood_cholesterol.dart b/lib/pages/AlHabibMedicalService/health_converter/blood_cholesterol.dart index 58caee36..513b50ab 100644 --- a/lib/pages/AlHabibMedicalService/health_converter/blood_cholesterol.dart +++ b/lib/pages/AlHabibMedicalService/health_converter/blood_cholesterol.dart @@ -1,3 +1,4 @@ +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:flutter/material.dart'; import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; @@ -62,7 +63,7 @@ class _BloodCholesterolState extends State { Widget build(BuildContext context) { return AppScaffold( isShowAppBar: true, - appBarTitle: 'Blood Cholesterol ', + appBarTitle: TranslationBase.of(context).bloodCholesterol, body: Padding( padding: const EdgeInsets.all(16.0), child: SingleChildScrollView( @@ -74,7 +75,7 @@ class _BloodCholesterolState extends State { Container( width: 350.0, child: Text( - 'Convert blood cholesterol from\n mmol/l to mg/dlt and vice versa.', + TranslationBase.of(context).convertCholesterolStatement, //textAlign: TextAlign.center, style: TextStyle(fontSize: 20.0), ), @@ -95,7 +96,7 @@ class _BloodCholesterolState extends State { child: Row( children: [ Texts( - 'Convert from', + TranslationBase.of(context).convertFrom, ), ], ), @@ -117,7 +118,7 @@ class _BloodCholesterolState extends State { }); }, child: Container( - height: 55.0, + height: 65.0, width: 150.0, decoration: BoxDecoration( boxShadow: [ @@ -150,7 +151,7 @@ class _BloodCholesterolState extends State { }); }, child: Container( - height: 55.0, + height: 65.0, width: 150.0, decoration: BoxDecoration( color: cardMMOLColor, @@ -196,7 +197,7 @@ class _BloodCholesterolState extends State { decoration: InputDecoration( border: OutlineInputBorder( borderSide: BorderSide(color: Colors.black45)), - labelText: " Enter the reading value", + labelText: TranslationBase.of(context).enterReadingValue, labelStyle: TextStyle( color: Colors.black87, ), @@ -209,7 +210,7 @@ class _BloodCholesterolState extends State { Visibility( visible: _visible, child: Container( - height: 95.0, + height: 115.0, width: 350.0, decoration: BoxDecoration( color: Colors.white, @@ -222,7 +223,7 @@ class _BloodCholesterolState extends State { crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.center, children: [ - Texts('Result:'), + Texts(TranslationBase.of(context).result + ":"), Row( children: [ Text( @@ -252,10 +253,10 @@ class _BloodCholesterolState extends State { ), Flexible( child: Container( - height: 100.0, + height: 60.0, width: 150.0, - child: Button( - label: 'CALCULATE', + child: SecondaryButton( + label: TranslationBase.of(context).calculate, onTap: () { setState(() { _visible == false diff --git a/lib/pages/AlHabibMedicalService/health_converter/blood_sugar.dart b/lib/pages/AlHabibMedicalService/health_converter/blood_sugar.dart index f5d66ccf..8a7e9792 100644 --- a/lib/pages/AlHabibMedicalService/health_converter/blood_sugar.dart +++ b/lib/pages/AlHabibMedicalService/health_converter/blood_sugar.dart @@ -64,7 +64,7 @@ class _BloodSugarState extends State { Widget build(BuildContext context) { return AppScaffold( isShowAppBar: true, - appBarTitle: 'Blood Sugar Conversion', + appBarTitle: TranslationBase.of(context).bloodSugarConversion, body: Padding( padding: const EdgeInsets.all(16.0), child: SingleChildScrollView( @@ -76,7 +76,7 @@ class _BloodSugarState extends State { Container( width: 350.0, child: Text( - 'Convert blood sugar/glucose from mmol/l (UK standard) to mg/dlt (US standard) and vice versa.', + TranslationBase.of(context).convertBloodSugarStatement, //textAlign: TextAlign.center, style: TextStyle(fontSize: 20.0), ), @@ -97,7 +97,7 @@ class _BloodSugarState extends State { child: Row( children: [ Texts( - 'Convert from', + TranslationBase.of(context).convertFrom, ) ], ), @@ -119,7 +119,7 @@ class _BloodSugarState extends State { }); }, child: Container( - height: 55.0, + height: 65.0, width: 150.0, decoration: BoxDecoration( boxShadow: [ @@ -152,7 +152,7 @@ class _BloodSugarState extends State { }); }, child: Container( - height: 55.0, + height: 65.0, width: 150.0, decoration: BoxDecoration( color: cardMMOLColor, @@ -196,7 +196,7 @@ class _BloodSugarState extends State { ], keyboardType: TextInputType.number, decoration: InputDecoration( - labelText: " Enter the reading value", + labelText: TranslationBase.of(context).enterReadingValue, border: OutlineInputBorder( borderSide: BorderSide(color: Colors.black45)), labelStyle: TextStyle( @@ -211,7 +211,7 @@ class _BloodSugarState extends State { Visibility( visible: _visible, child: Container( - height: 95.0, + height: 115.0, width: 350.0, decoration: BoxDecoration( color: Colors.white, @@ -224,7 +224,7 @@ class _BloodSugarState extends State { crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.center, children: [ - Texts('Result:'), + Texts(TranslationBase.of(context).result + ": "), Row( children: [ Text( @@ -254,10 +254,10 @@ class _BloodSugarState extends State { ), Flexible( child: Container( - height: 100.0, + height: 60.0, width: 150.0, - child: Button( - label: 'CALCULATE', + child: SecondaryButton( + label: TranslationBase.of(context).calculate, onTap: () { setState(() { _visible == false diff --git a/lib/pages/AlHabibMedicalService/health_converter/triglycerides.dart b/lib/pages/AlHabibMedicalService/health_converter/triglycerides.dart index a86fdb88..4c5f9a83 100644 --- a/lib/pages/AlHabibMedicalService/health_converter/triglycerides.dart +++ b/lib/pages/AlHabibMedicalService/health_converter/triglycerides.dart @@ -1,3 +1,4 @@ +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -64,7 +65,7 @@ class _TriglyceridesState extends State { Widget build(BuildContext context) { return AppScaffold( isShowAppBar: true, - appBarTitle: 'Triglycerides', + appBarTitle: TranslationBase.of(context).triglycerides, body: Padding( padding: const EdgeInsets.all(16.0), child: SingleChildScrollView( @@ -76,7 +77,7 @@ class _TriglyceridesState extends State { Container( width: 350.0, child: Text( - 'Convert Triglycerides from mmol/l to\n mg/dlt and vice versa.', + TranslationBase.of(context).triglyceridesConvertStatement, //textAlign: TextAlign.center, style: TextStyle(fontSize: 20.0), ), @@ -95,7 +96,9 @@ class _TriglyceridesState extends State { Padding( padding: const EdgeInsets.symmetric(horizontal: 15.0), child: Row( - children: [Texts('Convert from')], + children: [ + Texts(TranslationBase.of(context).convertFrom) + ], ), ), SizedBox( @@ -115,7 +118,7 @@ class _TriglyceridesState extends State { }); }, child: Container( - height: 55.0, + height: 65.0, width: 150.0, decoration: BoxDecoration( boxShadow: [ @@ -148,7 +151,7 @@ class _TriglyceridesState extends State { }); }, child: Container( - height: 55.0, + height: 65.0, width: 150.0, decoration: BoxDecoration( color: cardMMOLColor, @@ -194,7 +197,7 @@ class _TriglyceridesState extends State { decoration: InputDecoration( border: OutlineInputBorder( borderSide: BorderSide(color: Colors.black45)), - labelText: " Enter the reading value", + labelText: TranslationBase.of(context).enterReadingValue, labelStyle: TextStyle( color: Colors.black87, ), @@ -207,7 +210,7 @@ class _TriglyceridesState extends State { Visibility( visible: _visible, child: Container( - height: 95.0, + height: 115.0, width: 350.0, decoration: BoxDecoration( color: Colors.white, @@ -220,7 +223,7 @@ class _TriglyceridesState extends State { crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.center, children: [ - Texts('Result:'), + Texts(TranslationBase.of(context).result + ":"), Row( children: [ Text( @@ -250,10 +253,11 @@ class _TriglyceridesState extends State { ), Flexible( child: Container( - height: 100.0, + height: 60.0, width: 250.0, - child: Button( - label: 'CALCULATE', + child: SecondaryButton( + label: + TranslationBase.of(context).calculate.toUpperCase(), onTap: () { setState(() { _visible == false diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index c4ac7190..667ebb39 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -18,7 +18,8 @@ class TranslationBase { return localizedValues[key][locale.languageCode]; } - String get dashboardScreenToolbarTitle => localizedValues['dashboardScreenToolbarTitle'][locale.languageCode]; + String get dashboardScreenToolbarTitle => + localizedValues['dashboardScreenToolbarTitle'][locale.languageCode]; String get settings => localizedValues['settings'][locale.languageCode]; @@ -89,19 +90,24 @@ class TranslationBase { String get bookSuccess => localizedValues['bookSuccess'][locale.languageCode]; - String get patientShare => localizedValues['patientShare'][locale.languageCode]; + String get patientShare => + localizedValues['patientShare'][locale.languageCode]; - String get patientShareWithTax => localizedValues['patientShareWithTax'][locale.languageCode]; + String get patientShareWithTax => + localizedValues['patientShareWithTax'][locale.languageCode]; String get confirmAppo => localizedValues['confirmAppo'][locale.languageCode]; String get confirm => localizedValues['confirm'][locale.languageCode]; - String get confirmLiveCare => localizedValues['confirmLiveCare'][locale.languageCode]; + String get confirmLiveCare => + localizedValues['confirmLiveCare'][locale.languageCode]; - String get waitingForDoctor => localizedValues['waitingForDoctor'][locale.languageCode]; + String get waitingForDoctor => + localizedValues['waitingForDoctor'][locale.languageCode]; - String get confirmLater => localizedValues['confirmLater'][locale.languageCode]; + String get confirmLater => + localizedValues['confirmLater'][locale.languageCode]; String get todoList => localizedValues['todoList'][locale.languageCode]; @@ -117,7 +123,8 @@ class TranslationBase { String get login => localizedValues['login'][locale.languageCode]; - String get loginregister => localizedValues['loginregister'][locale.languageCode]; + String get loginregister => + localizedValues['loginregister'][locale.languageCode]; String get poweredBy => localizedValues['poweredBy'][locale.languageCode]; @@ -126,7 +133,8 @@ class TranslationBase { String get welcomeText => localizedValues['welcome_text'][locale.languageCode]; - String get welcomeText2 => localizedValues['welcome_text2'][locale.languageCode]; + String get welcomeText2 => + localizedValues['welcome_text2'][locale.languageCode]; String get yes => localizedValues['yes'][locale.languageCode]; @@ -288,17 +296,24 @@ class TranslationBase { String get appsetting => localizedValues['app-settings'][locale.languageCode]; String get rateApp => localizedValues['rate-app'][locale.languageCode]; - String get setReminder => localizedValues['set-reminder'][locale.languageCode]; + String get setReminder => + localizedValues['set-reminder'][locale.languageCode]; String get before => localizedValues['before'][locale.languageCode]; String get minute => localizedValues['minute'][locale.languageCode]; String get hour => localizedValues['hour'][locale.languageCode]; - String get reminderSuccess => localizedValues['reminderSuccess'][locale.languageCode]; - String get patientShareToDo => localizedValues['patientShareToDo'][locale.languageCode]; - String get patientTaxToDo => localizedValues['patientTaxToDo'][locale.languageCode]; - String get patientShareTotalToDo => localizedValues['patientShareTotalToDo'][locale.languageCode]; - String get paymentMethod => localizedValues['paymentMethod'][locale.languageCode]; - - String get moreVerification => localizedValues['more-verify'][locale.languageCode]; + String get reminderSuccess => + localizedValues['reminderSuccess'][locale.languageCode]; + String get patientShareToDo => + localizedValues['patientShareToDo'][locale.languageCode]; + String get patientTaxToDo => + localizedValues['patientTaxToDo'][locale.languageCode]; + String get patientShareTotalToDo => + localizedValues['patientShareTotalToDo'][locale.languageCode]; + String get paymentMethod => + localizedValues['paymentMethod'][locale.languageCode]; + + String get moreVerification => + localizedValues['more-verify'][locale.languageCode]; String get welcomeBack => localizedValues['welcome-back'][locale.languageCode]; @@ -328,11 +343,15 @@ class TranslationBase { String get booked => localizedValues['booked'][locale.languageCode]; String get confirmed => localizedValues['confirmed'][locale.languageCode]; String get arrived => localizedValues['arrived'][locale.languageCode]; - String get payNowBookSuccess => localizedValues['payNowBookSuccess'][locale.languageCode]; - String get payNowBookSuccesstext1 => localizedValues['payNowBookSuccesstext1'][locale.languageCode]; - String get payNowBookSuccesstext2 => localizedValues['payNowBookSuccesstext2'][locale.languageCode]; + String get payNowBookSuccess => + localizedValues['payNowBookSuccess'][locale.languageCode]; + String get payNowBookSuccesstext1 => + localizedValues['payNowBookSuccesstext1'][locale.languageCode]; + String get payNowBookSuccesstext2 => + localizedValues['payNowBookSuccesstext2'][locale.languageCode]; String get payLater => localizedValues['payLater'][locale.languageCode]; - String get askDocNotAllowed => localizedValues['askDocNotAllowed'][locale.languageCode]; + String get askDocNotAllowed => + localizedValues['askDocNotAllowed'][locale.languageCode]; String get firstName => localizedValues['first-name'][locale.languageCode]; String get middleName => localizedValues['middle-name'][locale.languageCode]; @@ -343,13 +362,15 @@ class TranslationBase { String get female => localizedValues['female'][locale.languageCode]; - String get prefferedLanguage => localizedValues['preferred-language'][locale.languageCode]; + String get prefferedLanguage => + localizedValues['preferred-language'][locale.languageCode]; String get english => localizedValues['english'][locale.languageCode]; String get arabic => localizedValues['arabic'][locale.languageCode]; - String get registrLocation => localizedValues['locations-register'][locale.languageCode]; + String get registrLocation => + localizedValues['locations-register'][locale.languageCode]; String get ksa => localizedValues['ksa'][locale.languageCode]; @@ -359,7 +380,8 @@ class TranslationBase { String get family => localizedValues['family'][locale.languageCode]; - String get myFamilyFiles => localizedValues['family-title'][locale.languageCode]; + String get myFamilyFiles => + localizedValues['family-title'][locale.languageCode]; String get myFamily => localizedValues['myFamily'][locale.languageCode]; String get oxygenation => localizedValues['oxygenation'][locale.languageCode]; @@ -442,11 +464,15 @@ class TranslationBase { String get viewAll => localizedValues['viewAll'][locale.languageCode]; String get view => localizedValues['view'][locale.languageCode]; String get contactUs => localizedValues['ContactUs'][locale.languageCode]; - String get viewAllWaysReachUs => localizedValues['ViewAllWaysReachUs'][locale.languageCode]; - String get medicalProfile => localizedValues['medicalProfile'][locale.languageCode]; + String get viewAllWaysReachUs => + localizedValues['ViewAllWaysReachUs'][locale.languageCode]; + String get medicalProfile => + localizedValues['medicalProfile'][locale.languageCode]; String get parking => localizedValues['parking'][locale.languageCode]; - String get alhabiServices => localizedValues['alhabiServices'][locale.languageCode]; - String get parkingTitle => localizedValues['parkingTitle'][locale.languageCode]; + String get alhabiServices => + localizedValues['alhabiServices'][locale.languageCode]; + String get parkingTitle => + localizedValues['parkingTitle'][locale.languageCode]; String get readBarcode => localizedValues['readBarcode'][locale.languageCode]; String get showMyPark => localizedValues['showMyPark'][locale.languageCode]; String get clearMyData => localizedValues['clearMyData'][locale.languageCode]; @@ -454,7 +480,8 @@ class TranslationBase { String get gate => localizedValues['gate'][locale.languageCode]; String get building => localizedValues['building'][locale.languageCode]; String get branch => localizedValues['branch'][locale.languageCode]; - String get emergencyServices => localizedValues['emergencyServices'][locale.languageCode]; + String get emergencyServices => + localizedValues['emergencyServices'][locale.languageCode]; String get nearester => localizedValues['nearester'][locale.languageCode]; String get locationa => localizedValues['locationa'][locale.languageCode]; String get ambulancerequest => @@ -550,7 +577,8 @@ class TranslationBase { localizedValues['Prescriptions'][locale.languageCode]; String get history => localizedValues['History'][locale.languageCode]; String get orderNo => localizedValues['OrderNo'][locale.languageCode]; - String get trackDeliveryDriver => localizedValues['trackDeliveryDriver'][locale.languageCode]; + String get trackDeliveryDriver => + localizedValues['trackDeliveryDriver'][locale.languageCode]; String get orderDetails => localizedValues['OrderDetails'][locale.languageCode]; String get vitalSign => localizedValues['VitalSign'][locale.languageCode]; @@ -724,7 +752,8 @@ class TranslationBase { String get use => localizedValues['use'][locale.languageCode]; String get proceedPay => localizedValues['proceedPay'][locale.languageCode]; String get vat => localizedValues['vat'][locale.languageCode]; - String get inclusiveVat => localizedValues['inclusiveVat'][locale.languageCode]; + String get inclusiveVat => + localizedValues['inclusiveVat'][locale.languageCode]; String get items => localizedValues['items'][locale.languageCode]; String get checkOut => localizedValues['checkOut'][locale.languageCode]; String get total => localizedValues['total'][locale.languageCode]; @@ -760,15 +789,22 @@ class TranslationBase { String get itemsNo => localizedValues['itemsNo'][locale.languageCode]; String get noOrder => localizedValues['noOrder'][locale.languageCode]; String get review => localizedValues['review'][locale.languageCode]; - String get deliveredOrder => localizedValues['deliveredOrder'][locale.languageCode]; - String get pendingOrder => localizedValues['pendingOrder'][locale.languageCode]; - String get processingOrder => localizedValues['processingOrder'][locale.languageCode]; - String get cancelledOrder => localizedValues['cancelledOrder'][locale.languageCode]; + String get deliveredOrder => + localizedValues['deliveredOrder'][locale.languageCode]; + String get pendingOrder => + localizedValues['pendingOrder'][locale.languageCode]; + String get processingOrder => + localizedValues['processingOrder'][locale.languageCode]; + String get cancelledOrder => + localizedValues['cancelledOrder'][locale.languageCode]; String get compare => localizedValues['compare'][locale.languageCode]; - String get medicationsRefill => localizedValues['medicationsRefill'][locale.languageCode]; - String get myPrescription => localizedValues['myPrescription'][locale.languageCode]; + String get medicationsRefill => + localizedValues['medicationsRefill'][locale.languageCode]; + String get myPrescription => + localizedValues['myPrescription'][locale.languageCode]; String get quantity => localizedValues['quantity'][locale.languageCode]; - String get conditionsHMG => localizedValues['conditionsHMG'][locale.languageCode]; + String get conditionsHMG => + localizedValues['conditionsHMG'][locale.languageCode]; String get conditions => localizedValues['conditions'][locale.languageCode]; // pharmacy module @@ -976,11 +1012,16 @@ class TranslationBase { String get searchItemError => localizedValues['searchItemError'][locale.languageCode]; String get youCanFind => localizedValues['YouCanFind'][locale.languageCode]; - String get itemInSearch => localizedValues['ItemInSearch'][locale.languageCode]; - String get wantToConnectWithHmgNetwork => localizedValues['wantConnectHmgNetwork'][locale.languageCode]; - String get failedToAccessHmgServices => localizedValues['failedToAccessHmgServices'][locale.languageCode]; - String get enablingWifi => localizedValues['enablingWifi'][locale.languageCode]; - String get offerAndPackages => localizedValues['offerAndPackages'][locale.languageCode]; + String get itemInSearch => + localizedValues['ItemInSearch'][locale.languageCode]; + String get wantToConnectWithHmgNetwork => + localizedValues['wantConnectHmgNetwork'][locale.languageCode]; + String get failedToAccessHmgServices => + localizedValues['failedToAccessHmgServices'][locale.languageCode]; + String get enablingWifi => + localizedValues['enablingWifi'][locale.languageCode]; + String get offerAndPackages => + localizedValues['offerAndPackages'][locale.languageCode]; String get invoiceNo => localizedValues['InvoiceNo'][locale.languageCode]; String get specialResult => localizedValues['SpecialResult'][locale.languageCode]; @@ -1156,26 +1197,39 @@ class TranslationBase { String get gallery => localizedValues['gallery'][locale.languageCode]; String get camera => localizedValues['camera'][locale.languageCode]; String get medReport => localizedValues['med-report'][locale.languageCode]; - String get newMedReport => localizedValues['new-med-report'][locale.languageCode]; - String get requestReport => localizedValues['requestReport'][locale.languageCode]; - String get confirmMsgReport => localizedValues['confirm-msg-report'][locale.languageCode]; - String get successSendReport => localizedValues['successSendReport'][locale.languageCode]; + String get newMedReport => + localizedValues['new-med-report'][locale.languageCode]; + String get requestReport => + localizedValues['requestReport'][locale.languageCode]; + String get confirmMsgReport => + localizedValues['confirm-msg-report'][locale.languageCode]; + String get successSendReport => + localizedValues['successSendReport'][locale.languageCode]; String get pulseTitle => localizedValues['pulseTitle'][locale.languageCode]; - String get systolicLng => localizedValues['systolic-lng'][locale.languageCode]; - String get diastolicLng => localizedValues['diastolic-lng'][locale.languageCode]; - String get policyHolder => localizedValues['policy-holder'][locale.languageCode]; + String get systolicLng => + localizedValues['systolic-lng'][locale.languageCode]; + String get diastolicLng => + localizedValues['diastolic-lng'][locale.languageCode]; + String get policyHolder => + localizedValues['policy-holder'][locale.languageCode]; String get policyNo => localizedValues['policy-no'][locale.languageCode]; - String get expiryDateTitle => localizedValues['expiry-date'][locale.languageCode]; + String get expiryDateTitle => + localizedValues['expiry-date'][locale.languageCode]; String get classTitle => localizedValues['class'][locale.languageCode]; String get approval => localizedValues['approval'][locale.languageCode]; String get agree => localizedValues['agree'][locale.languageCode]; String get disagree => localizedValues['disagree'][locale.languageCode]; - String get requestSent => localizedValues['request-sent'][locale.languageCode]; - String get attachInsuraceImage => localizedValues['attach-insurace-image'][locale.languageCode]; - String get infoInsurCards => localizedValues['info-insur-cards'][locale.languageCode]; + String get requestSent => + localizedValues['request-sent'][locale.languageCode]; + String get attachInsuraceImage => + localizedValues['attach-insurace-image'][locale.languageCode]; + String get infoInsurCards => + localizedValues['info-insur-cards'][locale.languageCode]; String get scanNow => localizedValues['scan-now'][locale.languageCode]; - String get pharmacyServiceTermsCondition => localizedValues['pharmacyServiceTermsCondition'][locale.languageCode]; - String get recordDeleted => localizedValues['recordDeleted'][locale.languageCode]; + String get pharmacyServiceTermsCondition => + localizedValues['pharmacyServiceTermsCondition'][locale.languageCode]; + String get recordDeleted => + localizedValues['recordDeleted'][locale.languageCode]; String get referralStatus => localizedValues['referralStatus'][locale.languageCode]; @@ -1206,12 +1260,16 @@ class TranslationBase { String get topBrands => localizedValues['topBrands'][locale.languageCode]; String get notifyMe => localizedValues['notifyMe'][locale.languageCode]; - String get specification => localizedValues['specification'][locale.languageCode]; - String get availability => localizedValues['availability'][locale.languageCode]; - String get quantitySize => localizedValues['quantitySize'][locale.languageCode]; + String get specification => + localizedValues['specification'][locale.languageCode]; + String get availability => + localizedValues['availability'][locale.languageCode]; + String get quantitySize => + localizedValues['quantitySize'][locale.languageCode]; String get addToCart => localizedValues['addToCart'][locale.languageCode]; String get buyNow => localizedValues['buyNow'][locale.languageCode]; - String get quantityShortcut => localizedValues['quantityShortcut'][locale.languageCode]; + String get quantityShortcut => + localizedValues['quantityShortcut'][locale.languageCode]; String get updatedEmail => localizedValues['updated-email'][locale.languageCode]; @@ -1248,23 +1306,52 @@ class TranslationBase { localizedValues['shoppingCart'][locale.languageCode]; String get covidTest => localizedValues['covidTest'][locale.languageCode]; String get driveThru => localizedValues['driveThru'][locale.languageCode]; - String get NearestErDesc => localizedValues['NearestErDesc'][locale.languageCode]; + String get NearestErDesc => + localizedValues['NearestErDesc'][locale.languageCode]; String get NearestEr => localizedValues['NearestEr'][locale.languageCode]; String get infoCMC => localizedValues['infoCMC'][locale.languageCode]; - String get instructionAgree => localizedValues['instructionAgree'][locale.languageCode]; + String get instructionAgree => + localizedValues['instructionAgree'][locale.languageCode]; String get reqId => localizedValues['reqId'][locale.languageCode]; - String get covid19_driveThrueTest => localizedValues['covid19_driveThrueTest'][locale.languageCode]; + String get covid19_driveThrueTest => + localizedValues['covid19_driveThrueTest'][locale.languageCode]; String get eReferral => localizedValues['E-Referral'][locale.languageCode]; String get vaccination => localizedValues["vaccination"][locale.languageCode]; - String get msg_email_address_up_to_date => localizedValues["msg_email_address_up_to_date"][locale.languageCode]; - String get updateEmailMsg => localizedValues["update-email-msg"][locale.languageCode]; + String get msg_email_address_up_to_date => + localizedValues["msg_email_address_up_to_date"][locale.languageCode]; + String get updateEmailMsg => + localizedValues["update-email-msg"][locale.languageCode]; String get childName => localizedValues["childName"][locale.languageCode]; - String get addNewChild => localizedValues["add-new-child"][locale.languageCode]; - String get sendChildEmailMsg => localizedValues["send-child-email-msg"][locale.languageCode]; - String get vaccinationAddChildMsg => localizedValues["vaccination-add-child-msg"][locale.languageCode]; - String get childAddedSuccessfully => localizedValues["child_added_successfully"][locale.languageCode]; - + String get addNewChild => + localizedValues["add-new-child"][locale.languageCode]; + String get sendChildEmailMsg => + localizedValues["send-child-email-msg"][locale.languageCode]; + String get vaccinationAddChildMsg => + localizedValues["vaccination-add-child-msg"][locale.languageCode]; + String get childAddedSuccessfully => + localizedValues["child_added_successfully"][locale.languageCode]; + String get bloodSugar => localizedValues["bloodSugar"][locale.languageCode]; + String get sugar => localizedValues["sugar"][locale.languageCode]; + String get bloodCholesterol => + localizedValues["bloodCholesterol"][locale.languageCode]; + String get cholesterol => localizedValues["cholesterol"][locale.languageCode]; + String get triglycerides => + localizedValues["triglycerides"][locale.languageCode]; + String get fatInBlood => localizedValues["fatInBlood"][locale.languageCode]; + String get calculate => localizedValues["calculate"][locale.languageCode]; + String get enterReadingValue => + localizedValues["enterReadingValue"][locale.languageCode]; + String get convertBloodSugarStatement => + localizedValues["convertBloodSugarStatement"][locale.languageCode]; + String get convertFrom => localizedValues["convertFrom"][locale.languageCode]; + String get result => localizedValues["result"][locale.languageCode]; + String get bloodSugarConversion => + localizedValues["bloodSugarConversion"][locale.languageCode]; + String get convertCholesterolStatement => + localizedValues["convertCholesterolStatement"][locale.languageCode]; + String get triglyceridesConvertStatement => + localizedValues["triglyceridesConvertStatement"][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { From b76774831569598afd23261f987f59a60893fc7b Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Sun, 24 Jan 2021 12:16:17 +0200 Subject: [PATCH 32/42] health-converter fix --- lib/config/localized_values.dart | 66 +++++++----------------- lib/uitl/translations_delegate_base.dart | 24 ++++----- 2 files changed, 31 insertions(+), 59 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 266a47aa..ee1dd7a7 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -1543,14 +1543,8 @@ const Map localizedValues = { "هذا ملخص التقرير الصحي الشهري و الذي يسرد المؤشرات الصحية و نتائج التحاليل لأخر الزيارات. يرجى ملاحظة أن هذا التقرير هو تقرير يتم ارساله بشكل آلي من النظام و لا يعتبر رسمي و لا تؤخذ عليه أي قرارات طبية" }, "reqId": {"en": "Request ID:", "ar": " رقم الطلب"}, - "RRT-orders-log": { - "en": "Orders Log", - "ar": "سجل الطلبات" - }, - "blood-sugar": { - "en": "Blood Sugar", - "ar": "سكر الدم" - }, + "RRT-orders-log": {"en": "Orders Log", "ar": "سجل الطلبات"}, + "blood-sugar": {"en": "Blood Sugar", "ar": "سكر الدم"}, "covid19_driveThrueTest": { "en": "'Covid-19- Drive-Thru Test'", @@ -1612,46 +1606,24 @@ const Map localizedValues = { "ar": "تحويل مستوى الدهون الثلاثية في الدم من مليمول/ لتر (مقياس المملكة المتحدة) الى ملغ/ ديسيلتر (مقياس الولايات المتحدة) والعكس" }, - "my-tracker": { - "en": "My Tracker", - "ar": "قراءاتي" - }, - "weekly": { - "en": "Weekly", - "ar": "أسبوعي" - }, - "monthly": { - "en": "Monthly", - "ar": "شهري" - }, - "yearly": { - "en": "Yearly", - "ar": "سنوي" - }, - "measured": { - "en": "Measured", - "ar": "قياس" - }, - "sugar-add": { - "en": "Enter Blood Sugar Value", - "ar": "أدخل قيمة قراءة السكر" - }, - "other": { - "en": "Other", - "ar": "آخر" - }, - "measure-unit": { - "en": "Measure unit", - "ar": "وحدة القياس" + "my-tracker": {"en": "My Tracker", "ar": "قراءاتي"}, + "weekly": {"en": "Weekly", "ar": "أسبوعي"}, + "monthly": {"en": "Monthly", "ar": "شهري"}, + "yearly": {"en": "Yearly", "ar": "سنوي"}, + "measured": {"en": "Measured", "ar": "قياس"}, + "sugar-add": {"en": "Enter Blood Sugar Value", "ar": "أدخل قيمة قراءة السكر"}, + "other": {"en": "Other", "ar": "آخر"}, + "measure-unit": {"en": "Measure unit", "ar": "وحدة القياس"}, + "measure-time": {"en": "Measure time", "ar": "وقت القياس"}, + "update": {"en": "Update", "ar": "تعديل"}, + "bloodD-enter-desc": { + "en": + "Enter the required information, In order to register for Blood Donation Service", + "ar": "أدخل المعلومات المطلوبة ، للتسجيل في خدمة التبرع بالدم" }, - "measure-time": { - "en": "Measure time", - "ar": "وقت القياس" - },"update": { - "en": "Update", - "ar": "تعديل" + "viewTermsConditions": { + "en": "To view the terms and conditions", + "ar": "لعرض الشروط والأحكام" }, - "bloodD-enter-desc": {"en" : "Enter the required information, In order to register for Blood Donation Service", "ar": "أدخل المعلومات المطلوبة ، للتسجيل في خدمة التبرع بالدم"}, - "viewTermsConditions": {"en" : "To view the terms and conditions", "ar": "لعرض الشروط والأحكام"}, // "visit": {"en" : "Visit", "ar": "الزيارة"}, }; diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index f29f89f4..9f7b09cf 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -645,8 +645,7 @@ class TranslationBase { localizedValues['SelectFamilyPatientName'][locale.languageCode]; String get selectHospital => localizedValues['SelectHospital'][locale.languageCode]; - String get selectCity => - localizedValues['selectCity'][locale.languageCode]; + String get selectCity => localizedValues['selectCity'][locale.languageCode]; String get myAccount => localizedValues['MyAccount'][locale.languageCode]; String get otherAccount => localizedValues['OtherAccount'][locale.languageCode]; @@ -1317,7 +1316,8 @@ class TranslationBase { String get instructionAgree => localizedValues['instructionAgree'][locale.languageCode]; String get reqId => localizedValues['reqId'][locale.languageCode]; - String get ordersLog => localizedValues['RRT-orders-log'][locale.languageCode]; + String get ordersLog => + localizedValues['RRT-orders-log'][locale.languageCode]; String get bloodSugar => localizedValues['blood-sugar'][locale.languageCode]; String get myTracker => localizedValues['my-tracker'][locale.languageCode]; String get weekly => localizedValues['weekly'][locale.languageCode]; @@ -1326,8 +1326,10 @@ class TranslationBase { String get measured => localizedValues['measured'][locale.languageCode]; String get sugarAdd => localizedValues['sugar-add'][locale.languageCode]; String get other => localizedValues['other'][locale.languageCode]; - String get measureUnit => localizedValues['measure-unit'][locale.languageCode]; - String get measureTime => localizedValues['measure-time'][locale.languageCode]; + String get measureUnit => + localizedValues['measure-unit'][locale.languageCode]; + String get measureTime => + localizedValues['measure-time'][locale.languageCode]; String get update => localizedValues['update'][locale.languageCode]; String get covid19_driveThrueTest => @@ -1347,7 +1349,7 @@ class TranslationBase { localizedValues["vaccination-add-child-msg"][locale.languageCode]; String get childAddedSuccessfully => localizedValues["child_added_successfully"][locale.languageCode]; - String get bloodSugar => localizedValues["bloodSugar"][locale.languageCode]; + String get sugar => localizedValues["sugar"][locale.languageCode]; String get bloodCholesterol => localizedValues["bloodCholesterol"][locale.languageCode]; @@ -1368,13 +1370,11 @@ class TranslationBase { localizedValues["convertCholesterolStatement"][locale.languageCode]; String get triglyceridesConvertStatement => localizedValues["triglyceridesConvertStatement"][locale.languageCode]; - String get addNewChild => localizedValues["add-new-child"][locale.languageCode]; - String get sendChildEmailMsg => localizedValues["send-child-email-msg"][locale.languageCode]; - String get vaccinationAddChildMsg => localizedValues["vaccination-add-child-msg"][locale.languageCode]; - String get childAddedSuccessfully => localizedValues["child_added_successfully"][locale.languageCode]; - String get bloodDEnterDesc => localizedValues["bloodD-enter-desc"][locale.languageCode]; - String get viewTermsConditions => localizedValues["viewTermsConditions"][locale.languageCode]; + String get bloodDEnterDesc => + localizedValues["bloodD-enter-desc"][locale.languageCode]; + String get viewTermsConditions => + localizedValues["viewTermsConditions"][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { From 7c538b350f71db321ebb78ed3ea45c66ed99b13a Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Sun, 24 Jan 2021 14:49:55 +0300 Subject: [PATCH 33/42] LiveCare Scheduling finalized, Appointments in ToDo list categorized --- assets/images/new-design/video.png | Bin 0 -> 1445 bytes assets/images/new-design/walkin.png | Bin 0 -> 2204 bytes lib/config/localized_values.dart | 8 + lib/pages/Blood/confirm_payment_page.dart | 11 +- lib/pages/BookAppointment/BookSuccess.dart | 7 +- .../widgets/AppointmentCardView.dart | 2 +- lib/pages/ToDoList/ToDo.dart | 519 ++++++++++-------- lib/pages/ToDoList/widgets/upcomingCard.dart | 2 +- lib/pages/livecare/widgets/clinic_list.dart | 3 +- .../medical/balance/confirm_payment_page.dart | 3 +- lib/uitl/translations_delegate_base.dart | 3 + lib/widgets/in_app_browser/InAppBrowser.dart | 79 ++- 12 files changed, 388 insertions(+), 249 deletions(-) create mode 100644 assets/images/new-design/video.png create mode 100644 assets/images/new-design/walkin.png diff --git a/assets/images/new-design/video.png b/assets/images/new-design/video.png new file mode 100644 index 0000000000000000000000000000000000000000..2962aade25b0cbf40d7f439963947c58f5d4dd19 GIT binary patch literal 1445 zcmeAS@N?(olHy`uVBq!ia0vp^DImc-mj#PnPRIHZt82`Ti~3Uk?B!Ylp0*+7m{3+ootz+WN)WnQ(*-(AUCxn zQK2F?C$HG5!d3}vt`(3C64qBz04piUwpD^SD#ABF!8yMuRl!uxOgGuk#8koDQqR!L z*u>ION5ROz&_dt9Lf_C>*U-$$#K6kPNC66zfVLH-q*(>IxIyg#@@$ndN=gc>^!3Zj z%k|2Q_413-^$jg8E%gnI^o@*kfhu&1EAvVcD|GXUm0>2hq!uR^WfqiV=I1GZOiWD5 zFD$Tv3bSNU;+l1ennz|zM-B0$V)JVzP|XC=H|jx7ncO3BHWAB;NpiyW)Z+ZoqGVvir744~DzI`cN=+=uFAB-e&w+(vKt_H^esM;Afr7I$DAX(!G{Q6U zQu51-HNkp(eXTt6ic1pnl2bihY?Xkf=w)W6Secm`yP6p~Iy)J=nHd_oIy#!T8o0W; zIvcwfx*3|AIKuS0gIDEVtyeO#YU;PhZ@9vGv7G%e?Q^Us6jU5qN%d0qw0jGJxv)_22u>%&=pUB1-LjI%I)n>(Xw+xM86^OE+* zOp396^Vj+B{g>arGCpOVV6##qJgR?+n8ITfhR3zv>fd|J{KBwlGRu;EeP@~7P9580 ze<8YYj~COYU1#>C#RaZ&yZ_bT?OOAbdnM(f^|<=K?|Ogs!{Z$&ldc^C>Y0D-5gpUXO@ GgeCweDhUPv literal 0 HcmV?d00001 diff --git a/assets/images/new-design/walkin.png b/assets/images/new-design/walkin.png new file mode 100644 index 0000000000000000000000000000000000000000..248c8788d0802be9a0403ecf04aa0ba3972057b2 GIT binary patch literal 2204 zcmaJ@X;>5I7LFKM6bmSVpu!Loq?(n0Bqjv1Nze#{D4+rj$p8_vkPIX&E>Msv5n{1W zSCmaGLhJIllubZE(W;;iixi|)3qpm+ErONhPE=@rT<$#2obNkl&ikJA#~kwCx@qx3 z+l2@OVll^u$%9Xk{xvp)rTq8r`0!x^v4WvMStO(qC_sd_NEQJC9El(bS+aYqaBL^ogq34?ccC6Y+%0Rj&1fyH@X@vdmRJDG?h69~ZP2L(q{ zh$6{6Ci`?M&*i;DWb4=5{ZPx5wHXT8umad6Qqzpjg~4MXBe2E zQm7EiA+byf=otkOvN(u}f;0V8fbF*tomGmc#D|96#0X1$dV z5Bw+J|4FRmC&)o84^+zH6he4#k&gOMaxy~!3Lu$+FO%(=>7swM43a6MWpaSQ(07dl ztPK)NMKYDr&m4$Fj-dxpQI6$@dv6 znmZTfoLDTJ3|2qfe+_%a1aFZ3I=i~CGQ0es6yA6RyxP0$!@3ZN1*ROPH(&ki&r^%O z;cr{sR4YMmx!+1$$J)tE*B#xloz3<>CO*b@ie9~&<#WjL8{Ytj0!s%}I@@nivSC0p z>x6H}MVrWo3#_Brt@UC35jI`ZFYNk)lc$YM*s5^ZH=x>r_$N$;?#lXuQ z>iNmJv64lUB~y7`1BJ@o23;pOP-W^T$lGSmEk`iiY--Zr4;Chap8wrC)xnP%o=;F=V$+qqtQiwNSi#u69A;SwZ>wb!_ zbEaqKqs(cncI$APxPwVoRn`+>{jsWXPXmsbXpFqcq zuNJ?$>f2gwYG7tSH>%jAaaWmf-{qfuc9Lid3h=aPz&O-_xwKHL(b836dSX>C_%$<)auFMlX#o&5V3 z-Eri%Tm~hjlo&Lc8_;9v%KhW)&^$)Y{>4WX-L%f*z3;;h@3ji1#f~~S-VTp3U0!?W z^qK2LUr%@!CKD^y@29%NH&2Fe_O1WR=Yg7_4b7eAx1Zol0#imyiN(+NFgw#*-~DRk zSfttBbnN-*0`#hwEOzr>x=}=Y$UUNCB+wRm=TYF*_TLT1N)KB2fUm7@2j6rKP4~P1 zc*xy=bAB8C)eFM4&45eM^C&k|#Tk zC2g~o^u-|A { authenticatedUser.firstName, authenticatedUser.patientID, authenticatedUser, - widget.browser); + widget.browser, + widget.patientShareResponse.isLiveCareAppointment, + widget.patientShareResponse.appointmentDate, + widget.patientShareResponse.appointmentNo, + widget.patientShareResponse.clinicID, + widget.patientShareResponse.doctorID); } } diff --git a/lib/pages/MyAppointments/widgets/AppointmentCardView.dart b/lib/pages/MyAppointments/widgets/AppointmentCardView.dart index c4299e33..0d3ac2e5 100644 --- a/lib/pages/MyAppointments/widgets/AppointmentCardView.dart +++ b/lib/pages/MyAppointments/widgets/AppointmentCardView.dart @@ -166,7 +166,7 @@ class _ApointmentCardState extends State { ), Container( transform: - Matrix4.translationValues(15.0, -40.0, 0.0), + Matrix4.translationValues(15.0, -40.0, 0.0), child: projectViewModel.isArabic ? Image.asset( "assets/images/new-design/arrow_menu_black-ar.png", diff --git a/lib/pages/ToDoList/ToDo.dart b/lib/pages/ToDoList/ToDo.dart index d36bb250..383bedb3 100644 --- a/lib/pages/ToDoList/ToDo.dart +++ b/lib/pages/ToDoList/ToDo.dart @@ -93,243 +93,315 @@ class _ToDoState extends State { itemBuilder: (context, index) { return Container( margin: EdgeInsets.all(10.0), - child: Card( - margin: EdgeInsets.fromLTRB(8.0, 0.0, 8.0, 8.0), - color: Colors.white, - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(10), - ), - child: Container( - width: MediaQuery.of(context).size.width, - padding: EdgeInsets.all(10.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisSize: MainAxisSize.max, - children: [ - Row( - children: [ - Image.asset( - "assets/images/new-design/time_icon.png", - width: 20.0, - height: 20.0), - Container( - margin: - EdgeInsets.only(left: 10.0, right: 10.0), - child: Text( - DateUtil.getWeekDayMonthDayYearDateFormatted( - DateUtil.convertStringToDate( - widget.appoList[index] - .appointmentDate), - projectViewModel.isArabic - ? "ar" - : "en") + - " " + - widget.appoList[index].startTime - .substring(0, 5), - style: TextStyle(fontSize: 10.0)), - ), - !widget.appoList[index].isLiveCareAppointment - ? Image.asset( - "assets/images/new-design/hospital_address_icon.png", - width: 20.0, - height: 20.0) - : Container(), - Container( - margin: - EdgeInsets.only(left: 5.0, right: 5.0), - child: widget - .appoList[index].isLiveCareAppointment - ? Container() - : Text( - widget.appoList[index].projectName != - null - ? widget - .appoList[index].projectName - : "-", - overflow: TextOverflow.clip, - maxLines: 2, - style: TextStyle(fontSize: 10.0)), - ), - ], - ), - Container( - margin: EdgeInsets.only(top: 5.0), - child: Divider( - color: Colors.grey[500], - ), + child: Column( + children: [ + Container( + child: Card( + margin: EdgeInsets.fromLTRB(8.0, 0.0, 8.0, 8.0), + color: Colors.white, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10), ), - Flex( - direction: Axis.horizontal, - children: [ - Expanded( - flex: 1, - child: Container( - height: MediaQuery.of(context).size.height * - 0.1, + child: Container( + width: MediaQuery.of(context).size.width, + padding: EdgeInsets.all(10.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.max, + children: [ + Row( + children: [ + Image.asset( + "assets/images/new-design/time_icon.png", + width: 20.0, + height: 20.0), + Container( + margin: EdgeInsets.only( + left: 10.0, right: 10.0), + child: Text( + DateUtil.getWeekDayMonthDayYearDateFormatted( + DateUtil.convertStringToDate( + widget.appoList[index] + .appointmentDate), + projectViewModel.isArabic + ? "ar" + : "en") + + " " + + widget.appoList[index].startTime + .substring(0, 5), + style: TextStyle(fontSize: 10.0)), + ), + !widget.appoList[index] + .isLiveCareAppointment + ? Image.asset( + "assets/images/new-design/hospital_address_icon.png", + width: 20.0, + height: 20.0) + : Container(), + Container( + margin: EdgeInsets.only( + left: 5.0, right: 5.0), + child: widget.appoList[index] + .isLiveCareAppointment + ? Container() + : Text( + widget.appoList[index] + .projectName != + null + ? widget.appoList[index] + .projectName + : "-", + overflow: TextOverflow.clip, + maxLines: 2, + style: + TextStyle(fontSize: 10.0)), + ), + ], + ), + Container( margin: EdgeInsets.only(top: 5.0), - child: ClipRRect( - borderRadius: - BorderRadius.circular(100.0), - child: Image.network( - widget.appoList[index].doctorImageURL, - fit: BoxFit.fill), + child: Divider( + color: Colors.grey[500], ), ), - ), - Expanded( - flex: 3, - child: Container( - margin: EdgeInsets.only( - top: 10.0, left: 20.0, right: 20.0), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Text( - widget.appoList[index].doctorTitle + - " " + + Flex( + direction: Axis.horizontal, + children: [ + Expanded( + flex: 1, + child: Container( + height: MediaQuery.of(context) + .size + .height * + 0.1, + margin: EdgeInsets.only(top: 5.0), + child: ClipRRect( + borderRadius: + BorderRadius.circular(100.0), + child: Image.network( widget.appoList[index] - .doctorNameObj, - style: TextStyle( - fontSize: 14.0, - color: Colors.black, - fontWeight: FontWeight.bold, - letterSpacing: 1.0)), - Container( - margin: EdgeInsets.only( - top: 3.0, bottom: 3.0), - child: Text( - getDoctorSpeciality(widget - .appoList[index] - .doctorSpeciality) - .trim(), - style: TextStyle( - fontSize: 12.0, - color: Colors.grey[600], - letterSpacing: 1.0)), + .doctorImageURL, + fit: BoxFit.fill), + ), ), - Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - mainAxisSize: MainAxisSize.max, - children: [ - RatingBar.readOnly( - initialRating: widget - .appoList[index] - .actualDoctorRate - .toDouble(), - size: 20.0, - filledColor: Colors.yellow[700], - emptyColor: Colors.grey[500], - isHalfAllowed: true, - halfFilledIcon: Icons.star_half, - filledIcon: Icons.star, - emptyIcon: Icons.star, - ), - ], + ), + Expanded( + flex: 3, + child: Container( + margin: EdgeInsets.only( + top: 10.0, + left: 20.0, + right: 20.0), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Text( + widget.appoList[index] + .doctorTitle + + " " + + widget.appoList[index] + .doctorNameObj, + style: TextStyle( + fontSize: 14.0, + color: Colors.black, + fontWeight: + FontWeight.bold, + letterSpacing: 1.0)), + Container( + margin: EdgeInsets.only( + top: 3.0, bottom: 3.0), + child: Text( + getDoctorSpeciality(widget + .appoList[index] + .doctorSpeciality) + .trim(), + style: TextStyle( + fontSize: 12.0, + color: Colors.grey[600], + letterSpacing: 1.0)), + ), + Row( + mainAxisAlignment: + MainAxisAlignment + .spaceBetween, + mainAxisSize: MainAxisSize.max, + children: [ + RatingBar.readOnly( + initialRating: widget + .appoList[index] + .actualDoctorRate + .toDouble(), + size: 20.0, + filledColor: + Colors.yellow[700], + emptyColor: + Colors.grey[500], + isHalfAllowed: true, + halfFilledIcon: + Icons.star_half, + filledIcon: Icons.star, + emptyIcon: Icons.star, + ), + ], + ), + Container( + child: CountdownTimer( + controller: new CountdownTimerController( + endTime: DateTime.now() + .millisecondsSinceEpoch + + (widget + .appoList[ + index] + .remaniningHoursTocanPay * + 1000) * + 60), + widgetBuilder: (_, + CurrentRemainingTime + time) { + return time != null + ? Text( + '${time.days != null ? time.days : "0"}:${time.hours.toString().length == 1 ? "0" + time.hours.toString() : time.hours}:${time.min}:${time.sec} ' + + TranslationBase.of( + context) + .upcomingTimeLeft, + style: TextStyle( + fontSize: 12.0, + color: Color( + 0xff40ACC9))) + : Container(); + }, + ), + ), + ], + ), ), - Container( - child: CountdownTimer( - controller: new CountdownTimerController( - endTime: DateTime.now() - .millisecondsSinceEpoch + - (widget.appoList[index] - .remaniningHoursTocanPay * - 1000) * - 60), - widgetBuilder: - (_, CurrentRemainingTime time) { - return time != null - ? Text( - '${time.days != null ? time.days : "0"}:${time.hours.toString().length == 1 ? "0" + time.hours.toString() : time.hours}:${time.min}:${time.sec} ' + - TranslationBase.of( - context) - .upcomingTimeLeft, + ), + Expanded( + flex: 1, + child: InkWell( + onTap: () => performNextAction( + widget.appoList[index]), + child: Container( + margin: EdgeInsets.only(top: 20.0), + child: Column( + children: [ + Image.asset( + getNextActionImage(widget + .appoList[index] + .nextAction), + width: 50.0, + height: 50.0), + Container( + margin: + EdgeInsets.only(top: 5.0), + child: Text( + getNextActionText(widget + .appoList[index] + .nextAction), + textAlign: + TextAlign.center, style: TextStyle( - fontSize: 12.0, - color: Color( - 0xff40ACC9))) - : Container(); - }, + fontSize: 12.0)), + ) + ], + ), ), ), - ], - ), + ) + ], + ), + Divider( + color: Colors.grey[500], ), - ), - Expanded( - flex: 1, - child: InkWell( - onTap: () => performNextAction( - widget.appoList[index]), - child: Container( - margin: EdgeInsets.only(top: 20.0), - child: Column( - children: [ - Image.asset( - getNextActionImage(widget + Flex( + direction: Axis.horizontal, + children: [ + Expanded( + flex: 2, + child: Container( + child: Text( + getNextActionDescription(widget .appoList[index].nextAction), - width: 50.0, - height: 50.0), - Container( - margin: EdgeInsets.only(top: 5.0), - child: Text( - getNextActionText(widget - .appoList[index] - .nextAction), - textAlign: TextAlign.center, - style: - TextStyle(fontSize: 12.0)), - ) - ], + style: TextStyle( + fontSize: 12.0, + color: Colors.grey[700])), + ), ), - ), + Expanded( + flex: 1, + child: GestureDetector( + onTap: () { + navigateToAppointmentDetails( + context, + widget.appoList[index]); + }, + child: Container( + child: Text( + TranslationBase.of(context) + .upcomingDetails, + textAlign: TextAlign.end, + style: TextStyle( + fontSize: 12.0, + color: + new Color(0xFF40ACC9), + decoration: TextDecoration + .underline)), + ), + ), + ) + ], ), - ) - ], - ), - Divider( - color: Colors.grey[500], + ], + ), ), - Flex( - direction: Axis.horizontal, - children: [ - Expanded( - flex: 2, - child: Container( - child: Text( - getNextActionDescription( - widget.appoList[index].nextAction), - style: TextStyle( - fontSize: 12.0, - color: Colors.grey[700])), - ), - ), - Expanded( - flex: 1, - child: GestureDetector( - onTap: () { - navigateToAppointmentDetails( - context, widget.appoList[index]); - }, - child: Container( - child: Text( - TranslationBase.of(context) - .upcomingDetails, - textAlign: TextAlign.end, - style: TextStyle( - fontSize: 12.0, - color: new Color(0xFF40ACC9), - decoration: - TextDecoration.underline)), + ), + ), + Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.only( + bottomLeft: Radius.circular(10.0), + bottomRight: Radius.circular(10.0)), + color: Color(0xff20bc44), + ), + height: 30.0, + margin: projectViewModel.isArabic ? EdgeInsets.fromLTRB(160.0, 0.0, 30.0, 0.0) : EdgeInsets.fromLTRB(30.0, 0.0, 160.0, 0.0), + transform: Matrix4.translationValues(0.0, -8.0, 0.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + widget.appoList[index].isLiveCareAppointment + ? Container( + margin: EdgeInsets.fromLTRB( + 5.0, 0.0, 5.0, 0.0), + child: Image.asset( + "assets/images/new-design/video.png"), + ) + : Container( + margin: EdgeInsets.fromLTRB( + 5.0, 0.0, 5.0, 0.0), + child: Image.asset( + "assets/images/new-design/walkin.png"), ), - ), - ) - ], - ), - ], + widget.appoList[index].isLiveCareAppointment + ? Container( + child: Text(TranslationBase.of(context).videoAppo, + style: TextStyle( + color: Colors.white, + fontWeight: FontWeight.bold, + fontSize: 12.0)), + ) + : Container( + child: Text(TranslationBase.of(context).walkinAppo, + style: TextStyle( + color: Colors.white, + fontWeight: FontWeight.bold, + fontSize: 12.0)), + ) + ], + ), ), - ), + ], ), ); }, @@ -688,7 +760,12 @@ class _ToDoState extends State { authenticatedUser.firstName, authenticatedUser.patientID, authenticatedUser, - widget.browser); + widget.browser, + appo.isLiveCareAppointment, + appo.appointmentDate, + appo.appointmentNo, + appo.clinicID, + appo.doctorID); } onBrowserLoadStart(String url) { diff --git a/lib/pages/ToDoList/widgets/upcomingCard.dart b/lib/pages/ToDoList/widgets/upcomingCard.dart index 04930e59..3fefe616 100644 --- a/lib/pages/ToDoList/widgets/upcomingCard.dart +++ b/lib/pages/ToDoList/widgets/upcomingCard.dart @@ -197,7 +197,7 @@ class _TodoListCardState extends State { ), ) ], - ) + ), ], ), ), diff --git a/lib/pages/livecare/widgets/clinic_list.dart b/lib/pages/livecare/widgets/clinic_list.dart index fc27d92b..195d8879 100644 --- a/lib/pages/livecare/widgets/clinic_list.dart +++ b/lib/pages/livecare/widgets/clinic_list.dart @@ -283,7 +283,8 @@ class _clinic_listState extends State { authenticatedUser.firstName, authenticatedUser.patientID, authenticatedUser, - browser); + browser, + false); } onBrowserLoadStart(String url) { diff --git a/lib/pages/medical/balance/confirm_payment_page.dart b/lib/pages/medical/balance/confirm_payment_page.dart index 8a69bf5d..eecb6abd 100644 --- a/lib/pages/medical/balance/confirm_payment_page.dart +++ b/lib/pages/medical/balance/confirm_payment_page.dart @@ -225,7 +225,8 @@ class ConfirmPaymentPage extends StatelessWidget { advanceModel.patientName, advanceModel.fileNumber, authenticatedUser, - browser); + browser, + false); } onBrowserLoadStart(String url) { diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index 8dff17c4..741ba44b 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -1283,6 +1283,9 @@ class TranslationBase { String get bloodDEnterDesc => localizedValues["bloodD-enter-desc"][locale.languageCode]; String get viewTermsConditions => localizedValues["viewTermsConditions"][locale.languageCode]; + String get walkinAppo => localizedValues["WalkinAppo"][locale.languageCode]; + String get videoAppo => localizedValues["videoAppo"][locale.languageCode]; + } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/widgets/in_app_browser/InAppBrowser.dart b/lib/widgets/in_app_browser/InAppBrowser.dart index 001bcdfa..ba7dfd8b 100644 --- a/lib/widgets/in_app_browser/InAppBrowser.dart +++ b/lib/widgets/in_app_browser/InAppBrowser.dart @@ -117,7 +117,12 @@ class MyInAppBrowser extends InAppBrowser { String patientName, dynamic patientID, AuthenticatedUser authenticatedUser, - InAppBrowser browser) { + InAppBrowser browser, + bool isLiveCareAppo, + [var appoDate, + var appoNo, + var clinicID, + var doctorID]) { this.browser = browser; getPatientData(); generateURL( @@ -130,7 +135,12 @@ class MyInAppBrowser extends InAppBrowser { patientType, patientName, patientID, - authenticatedUser) + authenticatedUser, + isLiveCareAppo, + appoDate, + appoNo, + clinicID, + doctorID) .then((value) { this.browser.openUrl(url: value); }); @@ -152,19 +162,19 @@ class MyInAppBrowser extends InAppBrowser { String patientName, dynamic patientID, AuthenticatedUser authUser, - [var patientData, + bool isLiveCareAppo, + [var appoDate, + var appoNo, + var clinicID, + var doctorID, + var patientData, var servID, var LiveServID]) async { - // getPatientData(); getDeviceToken(); String currentLanguageID = getLanguageID() == 'ar' ? 'AR' : 'EN'; - String form = getForm(); + String form = isLiveCareAppo ? getLiveCareForm() : getForm(); - // if (authUser != null) { - // form = form.replaceFirst("EMAIL_VALUE", authUser.emailAddress); - // } else { form = form.replaceFirst("EMAIL_VALUE", emailId); - // } form = form.replaceFirst('AMOUNT_VALUE', amount.toString()); form = form.replaceFirst('ORDER_DESCRIPTION_VALUE', orderDesc); @@ -197,17 +207,16 @@ class MyInAppBrowser extends InAppBrowser { form = form.replaceFirst('LIVE_SERVICE_ID', "2"); } - // if (patientData == null) { form = form.replaceFirst('CUSTNAME_VALUE', patientName); form = form.replaceFirst('CUSTID_VALUE', patientID.toString()); - // } else { - // form = form.replaceFirst('CUSTNAME_VALUE', patientData.depositorName); - // form = form.replaceFirst('CUSTID_VALUE', patientData.fileNumber); - // } - // form = form.replaceFirst('LATITUDE_VALUE', "24.708488"); - // form = form.replaceFirst('LONGITUDE_VALUE', "46.665925"); - // form = form.replaceFirst('DEVICE_TOKEN', DEVICE_TOKEN); + if (isLiveCareAppo) { + form = form.replaceFirst('IS_SCHEDULE_VALUE', "true"); + form = form.replaceFirst('APPOINTMENT_DATE_VALUE', appoDate); + form = form.replaceFirst('APPOINTMENT_NO_VALUE', appoNo.toString()); + form = form.replaceFirst('DOCTOR_ID_VALUE', doctorID.toString()); + form = form.replaceFirst('CLINIC_ID_VALUE', clinicID.toString()); + } var bytes = utf8.encode(form); var base64Str = base64.encode(bytes); @@ -247,6 +256,42 @@ class MyInAppBrowser extends InAppBrowser { '' + ''; } + + String getLiveCareForm() { + return ' ' + + '' + + '' + + '
' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '
' + + '' + + '' + + ''; + } } class MyChromeSafariBrowser extends ChromeSafariBrowser { From 484cca086e00f66f8067ae3dfb610d030637efa2 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Mon, 25 Jan 2021 16:12:57 +0200 Subject: [PATCH 34/42] fix my my Trackers --- lib/config/config.dart | 4 + lib/config/localized_values.dart | 8 + .../service/medical/BloodPressureService.dart | 52 +++ .../medical/WeightPressureService.dart | 13 + .../medical/blood_pressure_view_model.dart | 180 ++++----- .../medical/weight_pressure_view_model.dart | 11 + .../my_trackers/Weight/AddWeightPage.dart | 4 +- .../my_trackers/Weight/WeightHomePage.dart | 30 ++ .../my_trackers/Weight/WeightMonthlyPage.dart | 2 +- .../my_trackers/Weight/WeightWeeklyPage.dart | 2 +- .../my_trackers/Weight/WeightYeaPage.dart | 2 +- .../blood_pressure/AddBloodPressurePage.dart | 356 +++++++++++------- .../blood_pressure/BloodPressureHomePage.dart | 113 ++---- .../blood_pressure/BloodPressureMonthly.dart | 109 +++--- .../blood_pressure/BloodPressureYeaPage.dart | 72 ++-- .../bloodPressureWeeklyPage.dart | 97 +++-- .../blood_suger/AddBloodSugarPage.dart | 4 +- .../my_trackers/blood_suger/BloodMonthly.dart | 2 +- .../my_trackers/blood_suger/BloodYeaPage.dart | 93 +++-- .../blood_suger/blood_sugar_weekly_page.dart | 2 +- .../widget/CurvedChartBloodPressure.dart | 273 ++++++++++++++ .../widget/MonthCurvedChartBloodPressure.dart | 252 +++++++++++++ .../LineChartCurvedBloodPressure.dart | 4 +- lib/uitl/translations_delegate_base.dart | 2 + 24 files changed, 1204 insertions(+), 483 deletions(-) create mode 100644 lib/pages/medical/my_trackers/widget/CurvedChartBloodPressure.dart create mode 100644 lib/pages/medical/my_trackers/widget/MonthCurvedChartBloodPressure.dart diff --git a/lib/config/config.dart b/lib/config/config.dart index f25d3272..a6acecd6 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -290,10 +290,14 @@ const GET_DIABTEC_RESULT = 'Services/Patients.svc/REST/Patient_GetDiabtecResults const ADD_DIABTEC_RESULT = 'Services/Patients.svc/REST/Patient_AddDiabtecResult'; const SEND_AVERAGE_BLOOD_SUGAR_REPORT = 'Services/Notifications.svc/REST/SendAverageBloodSugarReport'; const DEACTIVATE_DIABETIC_STATUS = 'services/Patients.svc/REST/Patient_DeactivateDiabeticStatus'; +const DEACTIVATE_BLOOD_PRESSURES_STATUS = 'services/Patients.svc/REST/Patient_DeactivateBloodPressureStatus'; const GET_BLOOD_PRESSURE_RESULT_AVERAGE = 'Services/Patients.svc/REST/Patient_GetBloodPressureResultAverage'; const GET_BLOOD_PRESSURE_RESULT = 'Services/Patients.svc/REST/Patient_GetBloodPressureResult'; const ADD_BLOOD_PRESSURE_RESULT = 'Services/Patients.svc/REST/Patient_AddBloodPressureResult'; +const UPDATE_BLOOD_PRESSURE_RESULT = 'Services/Patients.svc/REST/Patient_UpdateBloodPressureResult'; +const SEND_AVERAGE_BLOOD_WEIGHT_REPORT = 'Services/Notifications.svc/REST/SendAverageBodyWeightReport'; +const SEND_AVERAGE_BLOOD_PRESSURE_REPORT = 'Services/Notifications.svc/REST/SendAverageBloodPressureReport'; const UPDATE_DIABETIC_RESULT = 'Services/Patients.svc/REST/Patient_UpdateDiabeticResult'; diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index a184006c..533dd7e8 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -1572,4 +1572,12 @@ const Map localizedValues = { "en": "Enter Weight Value", "ar": "أدخل الوزن " }, + "systolic-add": { + "en": "Enter Systolic Value", + "ar": "أدخل قيمة الإنقباض " + }, + "diastolic-add": { + "en": "Enter Diastolic Value", + "ar": "أدخل قيمة الإنبساط " + }, }; diff --git a/lib/core/service/medical/BloodPressureService.dart b/lib/core/service/medical/BloodPressureService.dart index f2681191..82130750 100644 --- a/lib/core/service/medical/BloodPressureService.dart +++ b/lib/core/service/medical/BloodPressureService.dart @@ -68,6 +68,19 @@ class BloodPressureService extends BaseService { super.error = error; }, body: Map()); } + Future sendReportByEmail() async { + hasError = false; + super.error = ""; + Map body = Map(); + body['isDentalAllowedBackend'] = false; + body['to'] = user.emailAddress; + await baseAppClient.post(SEND_AVERAGE_BLOOD_PRESSURE_REPORT, + onSuccess: (response, statusCode) async {}, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } addDiabtecResult( {String bloodPressureDate, @@ -93,4 +106,43 @@ class BloodPressureService extends BaseService { super.error = error; }, body: body); } + + updateDiabtecResult( + {String bloodPressureDate, + String diastolicPressure, + String systolicePressure, + int measuredArm}) async { + hasError = false; + super.error = ""; + + Map body = Map(); + body['BloodPressureDate'] = bloodPressureDate; + body['DiastolicPressure'] = diastolicPressure; + body['SystolicePressure'] = systolicePressure; + body['MeasuredArm'] ='$measuredArm'; + body['isDentalAllowedBackend'] = false; + + await baseAppClient.post(UPDATE_BLOOD_PRESSURE_RESULT, + onSuccess: (response, statusCode) async { + + }, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } + + Future deactivateDiabeticStatus({int lineItemNo }) async { + hasError = false; + super.error = ""; + Map body = Map(); + body['isDentalAllowedBackend'] = false; + body['LineItemNo'] =lineItemNo; + await baseAppClient.post(DEACTIVATE_BLOOD_PRESSURES_STATUS, + onSuccess: (response, statusCode) async {}, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } } diff --git a/lib/core/service/medical/WeightPressureService.dart b/lib/core/service/medical/WeightPressureService.dart index 3c38e5d2..b48c4795 100644 --- a/lib/core/service/medical/WeightPressureService.dart +++ b/lib/core/service/medical/WeightPressureService.dart @@ -110,6 +110,19 @@ class WeightService extends BaseService { super.error = error; }, body: body); } + Future sendReportByEmail() async { + hasError = false; + super.error = ""; + Map body = Map(); + body['isDentalAllowedBackend'] = false; + body['to'] = user.emailAddress; + await baseAppClient.post(SEND_AVERAGE_BLOOD_WEIGHT_REPORT, + onSuccess: (response, statusCode) async {}, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } deleteWeightResult({int lineItemNo, }) async { hasError = false; diff --git a/lib/core/viewModels/medical/blood_pressure_view_model.dart b/lib/core/viewModels/medical/blood_pressure_view_model.dart index dfff5b45..ae3abbcb 100644 --- a/lib/core/viewModels/medical/blood_pressure_view_model.dart +++ b/lib/core/viewModels/medical/blood_pressure_view_model.dart @@ -1,33 +1,31 @@ import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/model/my_trakers/blood_pressur/BloodPressureResult.dart'; -import 'package:diplomaticquarterapp/core/model/my_trakers/blood_sugar/DiabtecPatientResult.dart'; -import 'package:diplomaticquarterapp/core/model/my_trakers/chartData/WeekChartDate.dart'; -import 'package:diplomaticquarterapp/core/model/my_trakers/chartData/YearMonthlyChartDate.dart'; import 'package:diplomaticquarterapp/core/service/medical/BloodPressureService.dart'; -import 'package:diplomaticquarterapp/core/service/medical/BloodSugarService.dart'; import 'package:diplomaticquarterapp/locator.dart'; -import 'package:charts_flutter/flutter.dart' as charts; +import 'package:diplomaticquarterapp/widgets/charts/app_time_series_chart.dart'; import '../../../core/viewModels/base_view_model.dart'; class BloodPressureViewMode extends BaseViewModel { BloodPressureService bloodPressureService = locator(); - ///BLOOD - List _bloodDiastolicPressureWeeklyTimeSeriesSalesList = List(); - List _bloodSystolicePressureWeeklyTimeSeriesSalesList = List(); + List get monthDiabtecPatientResult => + bloodPressureService.monthDiabtecPatientResult; - List _bloodDiastolicMonthlyTimeSeriesSalesList = List(); - List _bloodSystolicMonthlyTimeSeriesSalesList = List(); + List get weekDiabtecPatientResult => + bloodPressureService.weekDiabtecPatientResult; - List _bloodSystoliceYearTimeSeriesSalesList = List(); - List _bloodDiastolicYearTimeSeriesSalesList = List(); + List get yearDiabtecPatientResult => + bloodPressureService.yearDiabtecPatientResult; - List get monthDiabtecPatientResult => bloodPressureService.monthDiabtecPatientResult; + List weightWeekTimeSeriesDataTop = []; + List weightWeekTimeSeriesDataLow = []; - List get weekDiabtecPatientResult => bloodPressureService.weekDiabtecPatientResult; + List weighMonthTimeSeriesDataTop = []; + List weighMonthTimeSeriesDataLow = []; - List get yearDiabtecPatientResult => bloodPressureService.yearDiabtecPatientResult; + List weightYearTimeSeriesDataTop = []; + List weightYearTimeSeriesDataLow = []; Future getBloodPressure() async { setState(ViewState.Busy); @@ -35,114 +33,94 @@ class BloodPressureViewMode extends BaseViewModel { await bloodPressureService.getDiabtecResults(); if (bloodPressureService.hasError) { error = bloodPressureService.error; - setState(ViewState.Error); + setState(ViewState.ErrorLocal); } else { + clearDate(); bloodPressureService.weekDiabtectResultAverageList.forEach((element) { - _bloodDiastolicPressureWeeklyTimeSeriesSalesList.add(WeekChartDate( - x: element.bloodPressureDate, - y: element.dailyDiastolicPressureAverageResult)); - _bloodSystolicePressureWeeklyTimeSeriesSalesList.add(WeekChartDate( - x: element.bloodPressureDate, - y: element.dailySystolicePressureAverageResult)); - }); + weightWeekTimeSeriesDataTop.add(TimeSeriesSales2( + element.bloodPressureDate, + element.dailyDiastolicPressureAverageResult.toDouble())); + weightWeekTimeSeriesDataLow.add(TimeSeriesSales2( + element.bloodPressureDate, + element.dailySystolicePressureAverageResult.toDouble())); - for (int index = 0; - index < bloodPressureService.monthDiabtectResultAverageList.length; - index++) { - _bloodDiastolicMonthlyTimeSeriesSalesList.add(YearMonthlyChartDate( - x: index, - y: bloodPressureService.monthDiabtectResultAverageList[index] - .weekDiastolicPressureAverageResult)); - _bloodSystolicMonthlyTimeSeriesSalesList.add(YearMonthlyChartDate( - x: index, - y: bloodPressureService.monthDiabtectResultAverageList[index] - .weekSystolicePressureAverageResult)); - } - - bloodPressureService.yearDiabtecResultAverageList.forEach((element) { - _bloodSystoliceYearTimeSeriesSalesList - .add(WeekChartDate(x: element.date, y: element.monthSystolicePressureAverageResult)); - - _bloodDiastolicYearTimeSeriesSalesList - .add(WeekChartDate(x: element.date, y: element.monthDiastolicPressureAverageResult)); - }); + for (int index = 0; index < bloodPressureService.monthDiabtectResultAverageList.length; index++) { + + weighMonthTimeSeriesDataTop.add(TimeSeriesSales3(index, bloodPressureService.monthDiabtectResultAverageList[index].weekDiastolicPressureAverageResult.toDouble())); + + weighMonthTimeSeriesDataLow.add(TimeSeriesSales3(index, bloodPressureService.monthDiabtectResultAverageList[index].weekSystolicePressureAverageResult.toDouble())); + } + bloodPressureService.yearDiabtecResultAverageList.forEach((element) { + weightYearTimeSeriesDataTop.add(TimeSeriesSales2(element.date, + element.monthSystolicePressureAverageResult.toDouble())); + + weightYearTimeSeriesDataLow.add(TimeSeriesSales2(element.date, + element.monthDiastolicPressureAverageResult.toDouble())); + }); + + }); setState(ViewState.Idle); } } - List> getBloodWeeklySeries() { - return [ - charts.Series( - id: 'Diastolic', - colorFn: (_, __) => charts.MaterialPalette.red.shadeDefault, - domainFn: (WeekChartDate sales, _) => sales.x, - measureFn: (WeekChartDate sales, _) => sales.y, - data: _bloodDiastolicPressureWeeklyTimeSeriesSalesList, - ), - charts.Series( - id: 'Systolice', - colorFn: (_, __) => charts.MaterialPalette.blue.shadeDefault, - domainFn: (WeekChartDate sales, _) => sales.x, - measureFn: (WeekChartDate sales, _) => sales.y, - data: _bloodSystolicePressureWeeklyTimeSeriesSalesList, - ) - ]; - } - List> - getBloodMonthlyTimeSeriesSales() { - return [ - charts.Series( - id: 'Sales', - colorFn: (_, __) => charts.MaterialPalette.red.shadeDefault, - domainFn: (YearMonthlyChartDate sales, _) => sales.x, - measureFn: (YearMonthlyChartDate sales, _) => sales.y, - data: _bloodDiastolicMonthlyTimeSeriesSalesList, - ), - charts.Series( - id: 'Sales', - colorFn: (_, __) => charts.MaterialPalette.blue.shadeDefault, - domainFn: (YearMonthlyChartDate sales, _) => sales.x, - measureFn: (YearMonthlyChartDate sales, _) => sales.y, - data: _bloodSystolicMonthlyTimeSeriesSalesList, - ), - ]; + void clearDate(){ + weightWeekTimeSeriesDataTop.clear(); + weightWeekTimeSeriesDataLow.clear(); + weighMonthTimeSeriesDataTop.clear(); + weighMonthTimeSeriesDataLow.clear(); + weightYearTimeSeriesDataTop.clear(); + weightYearTimeSeriesDataLow.clear(); } - List> getBloodYearTimeSeriesSales() { - return [ - charts.Series( - id: 'Sales', - colorFn: (_, __) => charts.MaterialPalette.red.shadeDefault, - domainFn: (WeekChartDate sales, _) => sales.x, - measureFn: (WeekChartDate sales, _) => sales.y, - data: _bloodSystoliceYearTimeSeriesSalesList, - ), - charts.Series( - id: 'Sales', - colorFn: (_, __) => charts.MaterialPalette.blue.shadeDefault, - domainFn: (WeekChartDate sales, _) => sales.x, - measureFn: (WeekChartDate sales, _) => sales.y, - data: _bloodDiastolicYearTimeSeriesSalesList, - ) - ]; + Future sendReportByEmail() async { + setState(ViewState.BusyLocal); + + await bloodPressureService.sendReportByEmail(); + if (bloodPressureService.hasError) { + error = bloodPressureService.error; + setState(ViewState.ErrorLocal); + } else { + setState(ViewState.Idle); + } } - addDiabtecResult( + Future addORUpdateDiabtecResult( {String bloodPressureDate, - String diastolicPressure, - String systolicePressure, - int measuredArm}) async { + String diastolicPressure, + String systolicePressure, + int measuredArm,bool isUpdate = false}) async { setState(ViewState.BusyLocal); + if(!isUpdate) await bloodPressureService.addDiabtecResult( bloodPressureDate: bloodPressureDate, diastolicPressure: diastolicPressure, systolicePressure: systolicePressure, measuredArm: measuredArm); + else + await bloodPressureService.updateDiabtecResult( + bloodPressureDate: bloodPressureDate, + diastolicPressure: diastolicPressure, + systolicePressure: systolicePressure, + measuredArm: measuredArm); + if (bloodPressureService.hasError) { + error = bloodPressureService.error; + setState(ViewState.ErrorLocal); + } else { + await getBloodPressure(); + setState(ViewState.Idle); + } + } + + + Future deactivateDiabeticStatus({int lineItemNo}) async { + setState(ViewState.BusyLocal); + + await bloodPressureService.deactivateDiabeticStatus(lineItemNo: lineItemNo); if (bloodPressureService.hasError) { error = bloodPressureService.error; - setState(ViewState.Error); + setState(ViewState.ErrorLocal); } else { await getBloodPressure(); setState(ViewState.Idle); diff --git a/lib/core/viewModels/medical/weight_pressure_view_model.dart b/lib/core/viewModels/medical/weight_pressure_view_model.dart index 24ddae18..42db0a58 100644 --- a/lib/core/viewModels/medical/weight_pressure_view_model.dart +++ b/lib/core/viewModels/medical/weight_pressure_view_model.dart @@ -82,6 +82,17 @@ class WeightPressureViewModel extends BaseViewModel { setState(ViewState.Idle); } } + Future sendReportByEmail() async { + setState(ViewState.BusyLocal); + + await weightService.sendReportByEmail(); + if (weightService.hasError) { + error = weightService.error; + setState(ViewState.ErrorLocal); + } else { + setState(ViewState.Idle); + } + } updateWeightResult({int lineItemNo, int weightUnit, String weightMeasured,String weightDate}) async { setState(ViewState.BusyLocal); diff --git a/lib/pages/medical/my_trackers/Weight/AddWeightPage.dart b/lib/pages/medical/my_trackers/Weight/AddWeightPage.dart index aa087081..71799084 100644 --- a/lib/pages/medical/my_trackers/Weight/AddWeightPage.dart +++ b/lib/pages/medical/my_trackers/Weight/AddWeightPage.dart @@ -76,7 +76,7 @@ class _AddWeightPageState extends State { appBarTitle: widget.isUpdate ? TranslationBase.of(context).update : TranslationBase.of(context).add, - appBarIcons: [ + appBarIcons:widget.isUpdate? [ IconButton( icon: Icon(Icons.delete), color: Colors.white, @@ -109,7 +109,7 @@ class _AddWeightPageState extends State { dialog.showAlertDialog(context); }, ) - ], + ]:null, body: SingleChildScrollView( physics: BouncingScrollPhysics(), child: Container( diff --git a/lib/pages/medical/my_trackers/Weight/WeightHomePage.dart b/lib/pages/medical/my_trackers/Weight/WeightHomePage.dart index cbe5de17..c90b29a7 100644 --- a/lib/pages/medical/my_trackers/Weight/WeightHomePage.dart +++ b/lib/pages/medical/my_trackers/Weight/WeightHomePage.dart @@ -1,7 +1,11 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/weight_pressure_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/medical/my_trackers/widget/TabBarWidget.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/dialogs/confirm_send_email_dialog.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; @@ -39,6 +43,32 @@ class _WeightHomePageState extends State builder: (_, model, w) => AppScaffold( isShowAppBar: true, appBarTitle: TranslationBase.of(context).weight, + appBarIcons: [IconButton( + icon: Icon(Icons.email), + color: Colors.white, + onPressed: () { + showDialog( + context: context, + child: ConfirmSendEmailDialog( + email: model.user.emailAddress, + onTapSendEmail: () async{ + GifLoaderDialogUtils.showMyDialog(context); + model.sendReportByEmail().then((value) { + GifLoaderDialogUtils.hideDialog(context); + if(model.state == ViewState.ErrorLocal){ + AppToast.showErrorToast(message: model.error); + }else{ + AppToast.showSuccessToast(message:TranslationBase.of(context).emailSentSuccessfully, ); + } + }).catchError((e){ + GifLoaderDialogUtils.hideDialog(context); + AppToast.showErrorToast(message: model.error); + }); + }, + ), + ); + }, + ),], baseViewModel: model, body: Scaffold( extendBodyBehindAppBar: true, diff --git a/lib/pages/medical/my_trackers/Weight/WeightMonthlyPage.dart b/lib/pages/medical/my_trackers/Weight/WeightMonthlyPage.dart index 56748ea0..6f64bacb 100644 --- a/lib/pages/medical/my_trackers/Weight/WeightMonthlyPage.dart +++ b/lib/pages/medical/my_trackers/Weight/WeightMonthlyPage.dart @@ -28,7 +28,7 @@ class WeightMonthlyPage extends StatelessWidget { Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); return AppScaffold( - body: ListView( + body: model.weighMonthTimeSeriesData.isEmpty?Container(child: Center(child: Texts(TranslationBase.of(context).noDataAvailable),),):ListView( children: [ Container( width: double.maxFinite, diff --git a/lib/pages/medical/my_trackers/Weight/WeightWeeklyPage.dart b/lib/pages/medical/my_trackers/Weight/WeightWeeklyPage.dart index 9c8a50a5..866c2b5b 100644 --- a/lib/pages/medical/my_trackers/Weight/WeightWeeklyPage.dart +++ b/lib/pages/medical/my_trackers/Weight/WeightWeeklyPage.dart @@ -26,7 +26,7 @@ class WeightWeeklyPage extends StatelessWidget { ProjectViewModel projectViewModel = Provider.of(context); return AppScaffold( - body: ListView( + body: model.weightWeekTimeSeriesData.isEmpty?Container(child: Center(child: Texts(TranslationBase.of(context).noDataAvailable),),):ListView( children: [ Container( margin: EdgeInsets.only(top: 12, left: 8, right: 8), diff --git a/lib/pages/medical/my_trackers/Weight/WeightYeaPage.dart b/lib/pages/medical/my_trackers/Weight/WeightYeaPage.dart index c5a1a3b3..7fa03819 100644 --- a/lib/pages/medical/my_trackers/Weight/WeightYeaPage.dart +++ b/lib/pages/medical/my_trackers/Weight/WeightYeaPage.dart @@ -26,7 +26,7 @@ class WeightYearPage extends StatelessWidget { Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); return AppScaffold( - body: ListView( + body: model.weightYearTimeSeriesData.isEmpty ? Container(child: Center(child: Texts(TranslationBase.of(context).noDataAvailable),),) : ListView( children: [ Container( width: double.maxFinite, diff --git a/lib/pages/medical/my_trackers/blood_pressure/AddBloodPressurePage.dart b/lib/pages/medical/my_trackers/blood_pressure/AddBloodPressurePage.dart index b8d9a557..678ef7dc 100644 --- a/lib/pages/medical/my_trackers/blood_pressure/AddBloodPressurePage.dart +++ b/lib/pages/medical/my_trackers/blood_pressure/AddBloodPressurePage.dart @@ -1,21 +1,41 @@ import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/blood_pressure_view_model.dart'; -import 'package:diplomaticquarterapp/core/viewModels/medical/blood_sugar_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; -import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/medical/balance/new_text_Field.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.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'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/RadioStringDialog.dart'; +import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; -import 'package:feather_icons_flutter/feather_icons_flutter.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_datetime_picker/flutter_datetime_picker.dart'; import 'package:provider/provider.dart'; class AddBloodPressurePage extends StatefulWidget { + final DateTime bloodSugarDate; + final String measureTimeSelectedType; + final bool isUpdate; + final int lineItemNo; + final String bloodSystolicValue; + final String bloodDiastolicValue; + final BloodPressureViewMode model; + + const AddBloodPressurePage( + {Key key, + this.bloodSugarDate, + this.measureTimeSelectedType, + this.isUpdate=false, + this.lineItemNo, + this.model, + this.bloodSystolicValue, + this.bloodDiastolicValue}) + : super(key: key); + @override _AddBloodPressurePageState createState() => _AddBloodPressurePageState(); } @@ -28,8 +48,8 @@ class _AddBloodPressurePageState extends State { DateTime timeSugarDate = DateTime.now(); int measuredArm = 1; final List measureTimeEnList = [ - 'Left Arm', - 'Right Arm', + 'Left', + 'Right', ]; final List measureTimeArList = [ 'الذراع الأيسر', @@ -37,152 +57,220 @@ class _AddBloodPressurePageState extends State { ]; String measureTimeSelectedType = 'Left Arm'; + @override + void initState() { + super.initState(); + if (widget.isUpdate) { + bloodSugarDate = widget.bloodSugarDate; + bloodSugarDate = widget.bloodSugarDate; + measureTimeSelectedType = widget.measureTimeSelectedType; + if (measureTimeEnList.contains(widget.measureTimeSelectedType)) + measuredArm = measureTimeEnList.indexOf(widget.measureTimeSelectedType); + else if (measureTimeArList.contains(widget.measureTimeSelectedType)) + measuredArm = measureTimeArList.indexOf(widget.measureTimeSelectedType); + _bloodSystolicValueController.text = widget.bloodSystolicValue; + _bloodDiastolicValueController.text = widget.bloodDiastolicValue; + } + } @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); - return BaseView( - builder: (_, model, w) => AppScaffold( - isShowAppBar: true, - appBarTitle: 'Add', - body: SingleChildScrollView( - physics: BouncingScrollPhysics(), - child: Container( - margin: EdgeInsets.all(15), - child: Column( - children: [ - SizedBox( - height: 15, - ), - NewTextFields( - hintText: 'Enter Systolic Value', - controller: _bloodSystolicValueController, - keyboardType: TextInputType.number, - ), - SizedBox( - height: 8, - ), - NewTextFields( - hintText: 'Blood Diastolic Value', - controller: _bloodDiastolicValueController, - keyboardType: TextInputType.number, - ), - SizedBox( - height: 8, - ), - InkWell( - onTap: () { - confirmSelectMeasureTimeDialog(projectViewModel.isArabic - ? measureTimeEnList - : measureTimeArList); - }, - child: Container( - padding: EdgeInsets.all(12), - width: double.infinity, - height: 65, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(12), - color: Colors.white), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Texts(measureTimeSelectedType), - Icon( - Icons.arrow_drop_down, - color: Colors.grey, - ) - ], - ), + return AppScaffold( + isShowAppBar: true, + appBarTitle: widget.isUpdate + ? TranslationBase.of(context).update + : TranslationBase.of(context).add, + appBarIcons: widget.isUpdate?[ + IconButton( + icon: Icon(Icons.delete), + color: Colors.white, + onPressed: () { + ConfirmDialog dialog = new ConfirmDialog( + context: context, + confirmMessage: 'Remove this measure', + okText: TranslationBase.of(context).ok, + cancelText: TranslationBase.of(context).cancel, + okFunction: () async { + ConfirmDialog.closeAlertDialog(context); + + GifLoaderDialogUtils.showMyDialog(context); + widget.model + .deactivateDiabeticStatus(lineItemNo: widget.lineItemNo) + .then((value) { + GifLoaderDialogUtils.hideDialog(context); + if (widget.model.state == ViewState.ErrorLocal) + AppToast.showErrorToast(message: widget.model.error); + else + Navigator.pop(context); + }).catchError((e) { + GifLoaderDialogUtils.hideDialog(context); + AppToast.showErrorToast(message: widget.model.error); + }); + }, + cancelFunction: () => {}); + dialog.showAlertDialog(context); + }, + ) + ]:null, + body: SingleChildScrollView( + physics: BouncingScrollPhysics(), + child: Container( + margin: EdgeInsets.all(15), + child: Column( + children: [ + SizedBox( + height: 15, + ), + NewTextFields( + hintText: TranslationBase.of(context).systolicAdd, + controller: _bloodSystolicValueController, + keyboardType: TextInputType.number, + ), + SizedBox( + height: 8, + ), + NewTextFields( + hintText: TranslationBase.of(context).diastolicAdd, + controller: _bloodDiastolicValueController, + keyboardType: TextInputType.number, + ), + SizedBox( + height: 8, + ), + InkWell( + onTap: () { + confirmSelectMeasureTimeDialog(projectViewModel.isArabic + ? measureTimeEnList + : measureTimeArList); + }, + child: Container( + padding: EdgeInsets.all(12), + width: double.infinity, + height: 65, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Texts(measureTimeSelectedType), + Icon( + Icons.arrow_drop_down, + color: Colors.grey, + ) + ], ), ), - SizedBox( - height: 8, - ), - InkWell( - onTap: () { - DatePicker.showDatePicker(context, - showTitleActions: true, - minTime: DateTime(DateTime.now().year - 1, 1, 1), - maxTime: DateTime.now(), onConfirm: (date) { - print('confirm $date'); - setState(() { + ), + SizedBox( + height: 8, + ), + InkWell( + onTap: () { + DatePicker.showDatePicker(context, + showTitleActions: true, + minTime: DateTime(DateTime.now().year - 1, 1, 1), + maxTime: DateTime.now(), onConfirm: (date) { + setState( + () { bloodSugarDate = date; - }); - }, - currentTime: bloodSugarDate, - locale: projectViewModel.localeType); + }, + ); }, - child: Container( - padding: EdgeInsets.all(12), - width: double.infinity, - height: 65, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(12), - color: Colors.white), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Texts('Date'), - Texts(getDate()), - ], - ), + currentTime: bloodSugarDate, + locale: projectViewModel.localeType); + }, + child: Container( + padding: EdgeInsets.all(12), + width: double.infinity, + height: 65, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Texts(TranslationBase.of(context).date), + Texts(getDate()), + ], ), ), - SizedBox( - height: 8, - ), - InkWell( - onTap: () { - DatePicker.showTimePicker(context, showTitleActions: true, - onConfirm: (date) { - print('confirm $date'); - setState(() { + ), + SizedBox( + height: 8, + ), + InkWell( + onTap: () { + DatePicker.showTimePicker(context, showTitleActions: true, + onConfirm: (date) { + setState( + () { timeSugarDate = date; - }); - }, - currentTime: timeSugarDate, - locale: projectViewModel.localeType); + }, + ); }, - child: Container( - padding: EdgeInsets.all(12), - width: double.infinity, - height: 65, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(12), - color: Colors.white), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [Texts('Time'), Texts(getTime())], - ), + currentTime: timeSugarDate, + locale: projectViewModel.localeType); + }, + child: Container( + padding: EdgeInsets.all(12), + width: double.infinity, + height: 65, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Texts(TranslationBase.of(context).time), + Texts(getTime()) + ], ), ), - ], - ), + ), + ], ), ), - bottomSheet: Container( - color: Colors.transparent, - width: double.infinity, - height: MediaQuery.of(context).size.width * 0.2, - child: Padding( - padding: const EdgeInsets.all(15.0), - child: SecondaryButton( - loading: model.state == ViewState.BusyLocal, - label: 'SAVE', - textColor: Colors.white, - onTap: () { - if (_bloodSystolicValueController.text.isNotEmpty && - _bloodDiastolicValueController.text.isNotEmpty) { - model.addDiabtecResult( - bloodPressureDate: '${bloodSugarDate.year}-${bloodSugarDate.month}-${bloodSugarDate.day} ${timeSugarDate.hour}:${timeSugarDate.minute}:00', - diastolicPressure: _bloodDiastolicValueController.text.toString(), - systolicePressure: _bloodSystolicValueController.text.toString(), - measuredArm: measuredArm, - ); - } - }), - ), + ), + bottomSheet: Container( + color: Colors.transparent, + width: double.infinity, + height: MediaQuery.of(context).size.width * 0.2, + child: Padding( + padding: const EdgeInsets.all(15.0), + child: SecondaryButton( + loading: widget.model.state == ViewState.BusyLocal, + label: TranslationBase.of(context).save.toUpperCase(), + textColor: Colors.white, + onTap: () async { + if (_bloodSystolicValueController.text.isNotEmpty && + _bloodDiastolicValueController.text.isNotEmpty) { + GifLoaderDialogUtils.showMyDialog(context); + + widget.model.addORUpdateDiabtecResult( + isUpdate: widget.isUpdate, + bloodPressureDate: + '${bloodSugarDate.year}-${bloodSugarDate.month}-${bloodSugarDate.day} ${timeSugarDate.hour}:${timeSugarDate.minute}:00', + diastolicPressure: + _bloodDiastolicValueController.text.toString(), + systolicePressure: + _bloodSystolicValueController.text.toString(), + measuredArm: measuredArm, + ).then((value) { + GifLoaderDialogUtils.hideDialog(context); + if(widget.model.state == ViewState.BusyLocal) + AppToast.showErrorToast(message: widget.model.error); + else + Navigator.pop(context); +; + }).catchError((e){ + GifLoaderDialogUtils.hideDialog(context); + AppToast.showErrorToast(message: widget.model.error); + }); + } + }), ), ), ); diff --git a/lib/pages/medical/my_trackers/blood_pressure/BloodPressureHomePage.dart b/lib/pages/medical/my_trackers/blood_pressure/BloodPressureHomePage.dart index de8bb509..723871cb 100644 --- a/lib/pages/medical/my_trackers/blood_pressure/BloodPressureHomePage.dart +++ b/lib/pages/medical/my_trackers/blood_pressure/BloodPressureHomePage.dart @@ -1,15 +1,15 @@ -import 'dart:ui'; - +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/blood_pressure_view_model.dart'; -import 'package:diplomaticquarterapp/core/viewModels/medical/blood_sugar_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; -import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/pages/medical/my_trackers/widget/TabBarWidget.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/dialogs/confirm_send_email_dialog.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:hexcolor/hexcolor.dart'; - import 'AddBloodPressurePage.dart'; import 'BloodPressureMonthly.dart'; import 'BloodPressureYeaPage.dart'; @@ -42,69 +42,37 @@ class _BloodPressureHomePageState extends State onModelReady: (model) => model.getBloodPressure(), builder: (_, model, w) => AppScaffold( isShowAppBar: true, - appBarTitle: 'Blood Pressure', + appBarTitle: TranslationBase.of(context).bloodPressure, baseViewModel: model, + appBarIcons: [IconButton( + icon: Icon(Icons.email), + color: Colors.white, + onPressed: () { + showDialog( + context: context, + child: ConfirmSendEmailDialog( + email: model.user.emailAddress, + onTapSendEmail: () async{ + GifLoaderDialogUtils.showMyDialog(context); + model.sendReportByEmail().then((value) { + GifLoaderDialogUtils.hideDialog(context); + if(model.state == ViewState.ErrorLocal){ + AppToast.showErrorToast(message: model.error); + }else{ + AppToast.showSuccessToast(message:TranslationBase.of(context).emailSentSuccessfully, ); + } + }).catchError((e){ + GifLoaderDialogUtils.hideDialog(context); + AppToast.showErrorToast(message: model.error); + }); + }, + ), + ); + }, + ),], body: Scaffold( extendBodyBehindAppBar: true, - appBar: PreferredSize( - preferredSize: Size.fromHeight(60.0), - child: Stack( - children: [ - Positioned( - bottom: 1, - left: 0, - right: 0, - child: BackdropFilter( - filter: ImageFilter.blur(sigmaX: 10, sigmaY: 10), - child: Container( - color: Theme.of(context) - .scaffoldBackgroundColor - .withOpacity(0.8), - height: 70.0, - ), - ), - ), - Center( - child: Container( - height: 55.0, - color: Colors.white, - child: Center( - child: TabBar( - isScrollable: true, - controller: _tabController, - indicatorWeight: 5.0, - indicatorSize: TabBarIndicatorSize.tab, - labelColor: Theme.of(context).primaryColor, - labelPadding: - EdgeInsets.only(top: 4.0, left: 5.0, right: 5.0), - unselectedLabelColor: Colors.grey[800], - tabs: [ - Container( - width: MediaQuery.of(context).size.width * 0.27, - child: Center( - child: Texts('Weekly'), - ), - ), - Container( - width: MediaQuery.of(context).size.width * 0.27, - child: Center( - child: Texts('Monthly'), - ), - ), - Container( - width: MediaQuery.of(context).size.width * 0.27, - child: Center( - child: Texts('Yearly'), - ), - ), - ], - ), - ), - ), - ), - ], - ), - ), + appBar: TabBarWidget(tabController: _tabController,), body: Column( children: [ Expanded( @@ -113,16 +81,13 @@ class _BloodPressureHomePageState extends State controller: _tabController, children: [ BloodPressureWeeklyPage( - data: model.getBloodWeeklySeries(), - diabtecPatientResult: model.weekDiabtecPatientResult, + model: model, ), BloodPressureMonthlyPage( - data: model.getBloodMonthlyTimeSeriesSales(), - diabtecPatientResult: model.monthDiabtecPatientResult, + model: model, ), BloodPressureYearPage( - data: model.getBloodYearTimeSeriesSales(), - diabtecPatientResult: model.yearDiabtecPatientResult, + model: model, ) ], ), @@ -131,13 +96,13 @@ class _BloodPressureHomePageState extends State ), floatingActionButton: InkWell( onTap: () { - Navigator.push(context, FadePage(page: AddBloodPressurePage())); + Navigator.push(context, FadePage(page: AddBloodPressurePage(model: model,))); }, child: Container( width: 55, height: 55, decoration: BoxDecoration( - shape: BoxShape.circle, color: HexColor('515B5D')), + shape: BoxShape.circle, color: Theme.of(context).primaryColor), child: Center( child: Icon( Icons.add, diff --git a/lib/pages/medical/my_trackers/blood_pressure/BloodPressureMonthly.dart b/lib/pages/medical/my_trackers/blood_pressure/BloodPressureMonthly.dart index 8b9e504f..04853689 100644 --- a/lib/pages/medical/my_trackers/blood_pressure/BloodPressureMonthly.dart +++ b/lib/pages/medical/my_trackers/blood_pressure/BloodPressureMonthly.dart @@ -1,43 +1,45 @@ -import 'package:diplomaticquarterapp/core/model/my_trakers/blood_pressur/BloodPressureResult.dart'; -import 'package:diplomaticquarterapp/core/model/my_trakers/blood_sugar/DiabtecPatientResult.dart'; -import 'package:diplomaticquarterapp/core/model/my_trakers/chartData/WeekChartDate.dart'; -import 'package:diplomaticquarterapp/core/model/my_trakers/chartData/YearMonthlyChartDate.dart'; +import 'package:diplomaticquarterapp/core/viewModels/medical/blood_pressure_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/pages/medical/my_trackers/widget/MonthCurvedChartBloodPressure.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:charts_flutter/flutter.dart' as charts; import 'package:hexcolor/hexcolor.dart'; +import 'package:provider/provider.dart'; class BloodPressureMonthlyPage extends StatelessWidget { - final List> data; - final List diabtecPatientResult; + final BloodPressureViewMode model; + + const BloodPressureMonthlyPage({Key key, this.model}) : super(key: key); - const BloodPressureMonthlyPage( - {Key key, this.data, this.diabtecPatientResult}) - : super(key: key); @override Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + return AppScaffold( - body: ListView( + body: model.weighMonthTimeSeriesDataTop.isEmpty? Container(child: Center(child: Texts(TranslationBase.of(context).noDataAvailable),),):ListView( children: [ - Container( - width: double.maxFinite, - height: 180, - color: Colors.white, - child: charts.LineChart(data, - //animate: animate, - defaultRenderer: - new charts.LineRendererConfig(includePoints: true)), - ), + Container( + margin: EdgeInsets.only(top: 12, left: 8, right: 8), + color: Colors.white, + child: MonthCurvedChartBloodPressure( + horizontalInterval: 20.0, + title: TranslationBase.of(context).bloodPressure, + timeSeries1: model.weighMonthTimeSeriesDataTop, + timeSeries2: model.weighMonthTimeSeriesDataLow, + indexes: model.weightWeekTimeSeriesDataLow.length ~/ 5.5, + ), + ), SizedBox( height: 12, ), Padding( padding: const EdgeInsets.all(8.0), - child: Texts('Details'), + child: Texts(TranslationBase.of(context).details), ), Container( padding: EdgeInsets.all(10), @@ -49,7 +51,7 @@ class BloodPressureMonthlyPage extends StatelessWidget { border: TableBorder.symmetric( inside: BorderSide(width: 2.0, color: Colors.grey[300]), ), - children: fullData(), + children: fullData(context,projectViewModel,model), ), ], ), @@ -59,7 +61,8 @@ class BloodPressureMonthlyPage extends StatelessWidget { ); } - List fullData() { + List fullData(BuildContext context, + ProjectViewModel projectViewModel, BloodPressureViewMode model) { List tableRow = []; tableRow.add( TableRow( @@ -67,7 +70,7 @@ class BloodPressureMonthlyPage extends StatelessWidget { Container( child: Container( decoration: BoxDecoration( - color: HexColor('#515B5D'), + color: Theme.of(context).primaryColor, borderRadius: BorderRadius.only( topLeft: Radius.circular(10.0), ), @@ -85,7 +88,7 @@ class BloodPressureMonthlyPage extends StatelessWidget { Container( child: Container( decoration: BoxDecoration( - color: HexColor('#515B5D'), + color: Theme.of(context).primaryColor, ), child: Center( child: Texts( @@ -99,11 +102,11 @@ class BloodPressureMonthlyPage extends StatelessWidget { Container( child: Container( decoration: BoxDecoration( - color: HexColor('#515B5D'), + color: Theme.of(context).primaryColor, ), child: Center( child: Texts( - 'Measured', + 'Arm', color: Colors.white, fontSize: 15, ), @@ -113,14 +116,14 @@ class BloodPressureMonthlyPage extends StatelessWidget { Container( child: Container( decoration: BoxDecoration( - color: HexColor('#515B5D'), + color: Theme.of(context).primaryColor, borderRadius: BorderRadius.only( topRight: Radius.circular(10.0), ), ), child: Center( child: Texts( - 'Value', + 'SBP/DBP', color: Colors.white, fontSize: 15, ), @@ -130,68 +133,50 @@ class BloodPressureMonthlyPage extends StatelessWidget { ], ), ); - diabtecPatientResult.forEach( + model.monthDiabtecPatientResult.reversed.forEach( (diabtec) { tableRow.add( TableRow( children: [ Container( - child: Container( - height: 70, - padding: EdgeInsets.all(10), - color: Colors.white, - child: Center( - child: Texts( - '${DateUtil.getMonthDayYearDateFormatted(diabtec.bloodPressureDate)} ', - textAlign: TextAlign.center, - fontSize: 12, - ), + color: Colors.white, + child: Center( + child: Texts( + '${projectViewModel.isArabic? DateUtil.getMonthDayYearDateFormattedAr(diabtec.bloodPressureDate):DateUtil.getMonthDayYearDateFormatted(diabtec.bloodPressureDate)}', + fontSize: 15, + textAlign: TextAlign.center, ), ), + height: 40, ), Container( - child: Container( - height: 70, - padding: EdgeInsets.all(10), color: Colors.white, child: Center( child: Texts( '${diabtec.bloodPressureDate.hour}:${diabtec.bloodPressureDate.minute}', - textAlign: TextAlign.center, - fontSize: 12, + fontSize: 15, ), ), - ), - ), + height: 40), Container( - child: Container( - height: 70, - padding: EdgeInsets.all(10), color: Colors.white, child: Center( child: Texts( - '${diabtec.measuredArmDesc}', - textAlign: TextAlign.center, - fontSize: 12, + diabtec.measuredArmDesc, + fontSize: 15, ), ), - ), - ), + height: 40), Container( - child: Container( - height: 70, - padding: EdgeInsets.all(10), color: Colors.white, child: Center( child: Texts( '${diabtec.systolicePressure}/${diabtec.diastolicPressure}', - textAlign: TextAlign.center, - fontSize: 12, color: Colors.red, + fontSize: 15, ), ), - ), - ), + height: 40), ], ), ); diff --git a/lib/pages/medical/my_trackers/blood_pressure/BloodPressureYeaPage.dart b/lib/pages/medical/my_trackers/blood_pressure/BloodPressureYeaPage.dart index 0c67be7c..b5b01f06 100644 --- a/lib/pages/medical/my_trackers/blood_pressure/BloodPressureYeaPage.dart +++ b/lib/pages/medical/my_trackers/blood_pressure/BloodPressureYeaPage.dart @@ -1,33 +1,34 @@ -import 'package:diplomaticquarterapp/core/model/my_trakers/blood_pressur/BloodPressureResult.dart'; -import 'package:diplomaticquarterapp/core/model/my_trakers/blood_sugar/DiabtecPatientResult.dart'; -import 'package:diplomaticquarterapp/core/model/my_trakers/chartData/WeekChartDate.dart'; +import 'package:diplomaticquarterapp/core/viewModels/medical/blood_pressure_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/pages/medical/my_trackers/widget/CurvedChartBloodPressure.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:charts_flutter/flutter.dart' as charts; -import 'package:hexcolor/hexcolor.dart'; +import 'package:provider/provider.dart'; class BloodPressureYearPage extends StatelessWidget { - final List> data; - final List diabtecPatientResult; + final BloodPressureViewMode model; - const BloodPressureYearPage({Key key, this.data, this.diabtecPatientResult}) - : super(key: key); + const BloodPressureYearPage({Key key, this.model}) : super(key: key); @override Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); return AppScaffold( - body: ListView( + body: model.weightYearTimeSeriesDataTop.isEmpty? Container(child: Center(child: Texts(TranslationBase.of(context).noDataAvailable),),):ListView( children: [ Container( - width: double.maxFinite, - height: 180, + margin: EdgeInsets.only(top: 12, left: 8, right: 8), color: Colors.white, - child: charts.TimeSeriesChart( - data, - dateTimeFactory: const charts.LocalDateTimeFactory(), + child: CurvedChartBloodPressure( + horizontalInterval: 3.0,// model.weightWeekTimeSeriesDataLow.length==1 ?1 :20.0, + title: TranslationBase.of(context).bloodPressure, + timeSeries1: model.weightYearTimeSeriesDataTop, + timeSeries2: model.weightYearTimeSeriesDataLow, + indexes: model.weightWeekTimeSeriesDataLow.length ~/ 5.5, ), ), SizedBox( @@ -35,7 +36,7 @@ class BloodPressureYearPage extends StatelessWidget { ), Padding( padding: const EdgeInsets.all(8.0), - child: Texts('Details'), + child: Texts(TranslationBase.of(context).details), ), Container( padding: EdgeInsets.all(10), @@ -47,7 +48,7 @@ class BloodPressureYearPage extends StatelessWidget { border: TableBorder.symmetric( inside: BorderSide(width: 2.0, color: Colors.grey[300]), ), - children: fullData(), + children: fullData(context, projectViewModel, model), ), ], ), @@ -57,7 +58,10 @@ class BloodPressureYearPage extends StatelessWidget { ); } - List fullData() { + List fullData( + BuildContext context, + ProjectViewModel projectViewModel, + BloodPressureViewMode bloodSugarViewMode) { List tableRow = []; tableRow.add( TableRow( @@ -65,14 +69,19 @@ class BloodPressureYearPage extends StatelessWidget { Container( child: Container( decoration: BoxDecoration( - color: HexColor('#515B5D'), + color: Theme.of(context).primaryColor, borderRadius: BorderRadius.only( - topLeft: Radius.circular(10.0), + topLeft: projectViewModel.isArabic + ? Radius.circular(0.0) + : Radius.circular(10.0), + topRight: projectViewModel.isArabic + ? Radius.circular(10.0) + : Radius.circular(0.0), ), ), child: Center( child: Texts( - 'Date', + TranslationBase.of(context).date, color: Colors.white, fontSize: 15, ), @@ -83,11 +92,11 @@ class BloodPressureYearPage extends StatelessWidget { Container( child: Container( decoration: BoxDecoration( - color: HexColor('#515B5D'), + color: Theme.of(context).primaryColor, ), child: Center( child: Texts( - 'Time', + TranslationBase.of(context).time, color: Colors.white, fontSize: 15, ), @@ -97,11 +106,11 @@ class BloodPressureYearPage extends StatelessWidget { Container( child: Container( decoration: BoxDecoration( - color: HexColor('#515B5D'), + color: Theme.of(context).primaryColor, ), child: Center( child: Texts( - 'Measured', + TranslationBase.of(context).measured, color: Colors.white, fontSize: 15, ), @@ -111,14 +120,19 @@ class BloodPressureYearPage extends StatelessWidget { Container( child: Container( decoration: BoxDecoration( - color: HexColor('#515B5D'), + color: Theme.of(context).primaryColor, borderRadius: BorderRadius.only( - topRight: Radius.circular(10.0), + topLeft: projectViewModel.isArabic + ? Radius.circular(10.0) + : Radius.circular(0.0), + topRight: projectViewModel.isArabic + ? Radius.circular(0.0) + : Radius.circular(10.0), ), ), child: Center( child: Texts( - 'Value', + TranslationBase.of(context).value, color: Colors.white, fontSize: 15, ), @@ -128,7 +142,7 @@ class BloodPressureYearPage extends StatelessWidget { ], ), ); - diabtecPatientResult.forEach( + model.yearDiabtecPatientResult.reversed.forEach( (diabtec) { tableRow.add( TableRow( diff --git a/lib/pages/medical/my_trackers/blood_pressure/bloodPressureWeeklyPage.dart b/lib/pages/medical/my_trackers/blood_pressure/bloodPressureWeeklyPage.dart index 52313483..e4ff7332 100644 --- a/lib/pages/medical/my_trackers/blood_pressure/bloodPressureWeeklyPage.dart +++ b/lib/pages/medical/my_trackers/blood_pressure/bloodPressureWeeklyPage.dart @@ -1,33 +1,37 @@ -import 'package:diplomaticquarterapp/core/model/my_trakers/blood_pressur/BloodPressureResult.dart'; -import 'package:diplomaticquarterapp/core/model/my_trakers/blood_sugar/DiabtecPatientResult.dart'; -import 'package:diplomaticquarterapp/core/model/my_trakers/chartData/WeekChartDate.dart'; +import 'package:diplomaticquarterapp/core/viewModels/medical/blood_pressure_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/pages/medical/my_trackers/widget/CurvedChartBloodPressure.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:charts_flutter/flutter.dart' as charts; -import 'package:hexcolor/hexcolor.dart'; +import 'package:provider/provider.dart'; + +import 'AddBloodPressurePage.dart'; class BloodPressureWeeklyPage extends StatelessWidget { - final List> data; - final List diabtecPatientResult; + final BloodPressureViewMode model; - const BloodPressureWeeklyPage({Key key, this.data, this.diabtecPatientResult}) - : super(key: key); + const BloodPressureWeeklyPage({Key key, this.model}) : super(key: key); @override Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); return AppScaffold( - body: ListView( + body: model.weightWeekTimeSeriesDataTop.isEmpty? Container(child: Center(child: Texts(TranslationBase.of(context).noDataAvailable),),): ListView( children: [ Container( - width: double.maxFinite, - height: 180, + margin: EdgeInsets.only(top: 12, left: 8, right: 8), color: Colors.white, - child: charts.TimeSeriesChart( - data, - dateTimeFactory: const charts.LocalDateTimeFactory(), + child: CurvedChartBloodPressure( + horizontalInterval:3.0, + title: TranslationBase.of(context).bloodPressure, + timeSeries1: model.weightWeekTimeSeriesDataTop, + timeSeries2: model.weightWeekTimeSeriesDataLow, + indexes: model.weightWeekTimeSeriesDataLow.length ~/ 5.5, ), ), SizedBox( @@ -35,7 +39,7 @@ class BloodPressureWeeklyPage extends StatelessWidget { ), Padding( padding: const EdgeInsets.all(8.0), - child: Texts('Details'), + child: Texts(TranslationBase.of(context).details), ), Container( padding: EdgeInsets.all(10), @@ -47,7 +51,7 @@ class BloodPressureWeeklyPage extends StatelessWidget { border: TableBorder.symmetric( inside: BorderSide(width: 2.0, color: Colors.grey[300]), ), - children: fullData(), + children: fullData(context, projectViewModel, model), ), ], ), @@ -57,7 +61,10 @@ class BloodPressureWeeklyPage extends StatelessWidget { ); } - List fullData() { + List fullData( + BuildContext context, + ProjectViewModel projectViewModel, + BloodPressureViewMode bloodSugarViewMode) { List tableRow = []; tableRow.add( TableRow( @@ -65,14 +72,19 @@ class BloodPressureWeeklyPage extends StatelessWidget { Container( child: Container( decoration: BoxDecoration( - color: HexColor('#515B5D'), + color: Theme.of(context).primaryColor, borderRadius: BorderRadius.only( - topLeft: Radius.circular(10.0), + topLeft: projectViewModel.isArabic + ? Radius.circular(0.0) + : Radius.circular(10.0), + topRight: projectViewModel.isArabic + ? Radius.circular(10.0) + : Radius.circular(0.0), ), ), child: Center( child: Texts( - 'Date', + TranslationBase.of(context).date, color: Colors.white, fontSize: 15, ), @@ -83,11 +95,11 @@ class BloodPressureWeeklyPage extends StatelessWidget { Container( child: Container( decoration: BoxDecoration( - color: HexColor('#515B5D'), + color: Theme.of(context).primaryColor, ), child: Center( child: Texts( - 'Time', + TranslationBase.of(context).time, color: Colors.white, fontSize: 15, ), @@ -97,11 +109,11 @@ class BloodPressureWeeklyPage extends StatelessWidget { Container( child: Container( decoration: BoxDecoration( - color: HexColor('#515B5D'), + color: Theme.of(context).primaryColor, ), child: Center( child: Texts( - 'Measured', + TranslationBase.of(context).measured, color: Colors.white, fontSize: 15, ), @@ -111,11 +123,11 @@ class BloodPressureWeeklyPage extends StatelessWidget { Container( child: Container( decoration: BoxDecoration( - color: HexColor('#515B5D'), + color: Theme.of(context).primaryColor, ), child: Center( child: Texts( - 'Value', + TranslationBase.of(context).value, color: Colors.white, fontSize: 15, ), @@ -125,14 +137,19 @@ class BloodPressureWeeklyPage extends StatelessWidget { Container( child: Container( decoration: BoxDecoration( - color: HexColor('#515B5D'), + color: Theme.of(context).primaryColor, borderRadius: BorderRadius.only( - topRight: Radius.circular(10.0), + topLeft: projectViewModel.isArabic + ? Radius.circular(10.0) + : Radius.circular(0.0), + topRight: projectViewModel.isArabic + ? Radius.circular(0.0) + : Radius.circular(10.0), ), ), child: Center( child: Texts( - 'Edit', + TranslationBase.of(context).edit, color: Colors.white, fontSize: 15, ), @@ -142,7 +159,7 @@ class BloodPressureWeeklyPage extends StatelessWidget { ], ), ); - diabtecPatientResult.forEach( + model.weekDiabtecPatientResult.reversed.forEach( (diabtec) { tableRow.add( TableRow( @@ -202,7 +219,23 @@ class BloodPressureWeeklyPage extends StatelessWidget { ), ), ), - Container( + InkWell( + onTap: () { + Navigator.push( + context, + FadePage( + page: AddBloodPressurePage( + model: model, + isUpdate: true, + lineItemNo: diabtec.lineItemNo, + bloodSugarDate: diabtec.bloodPressureDate, + bloodDiastolicValue: diabtec.diastolicPressure.toString(), + bloodSystolicValue: diabtec.systolicePressure.toString(), + measureTimeSelectedType: diabtec.measuredArmDesc, + ), + ), + ); + }, child: Container( height: 70, padding: EdgeInsets.all(10), diff --git a/lib/pages/medical/my_trackers/blood_suger/AddBloodSugarPage.dart b/lib/pages/medical/my_trackers/blood_suger/AddBloodSugarPage.dart index a1fbff8d..94e48b92 100644 --- a/lib/pages/medical/my_trackers/blood_suger/AddBloodSugarPage.dart +++ b/lib/pages/medical/my_trackers/blood_suger/AddBloodSugarPage.dart @@ -96,7 +96,7 @@ class _AddBloodSugarPageState extends State { appBarTitle: widget.isUpdate ? TranslationBase.of(context).update : TranslationBase.of(context).add, - appBarIcons: [ + appBarIcons: widget.isUpdate?[ IconButton( icon: Icon(Icons.delete), color: Colors.white, @@ -129,7 +129,7 @@ class _AddBloodSugarPageState extends State { dialog.showAlertDialog(context); }, ) - ], + ]:null, body: SingleChildScrollView( physics: BouncingScrollPhysics(), child: Container( diff --git a/lib/pages/medical/my_trackers/blood_suger/BloodMonthly.dart b/lib/pages/medical/my_trackers/blood_suger/BloodMonthly.dart index f5ef9aa9..1294c5dd 100644 --- a/lib/pages/medical/my_trackers/blood_suger/BloodMonthly.dart +++ b/lib/pages/medical/my_trackers/blood_suger/BloodMonthly.dart @@ -25,7 +25,7 @@ class BloodMonthlyPage extends StatelessWidget { Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); return AppScaffold( - body: ListView( + body: timeSeriesData.isEmpty?Container(child: Center(child: Texts(TranslationBase.of(context).noDataAvailable),),): ListView( children: [ Container( width: double.maxFinite, diff --git a/lib/pages/medical/my_trackers/blood_suger/BloodYeaPage.dart b/lib/pages/medical/my_trackers/blood_suger/BloodYeaPage.dart index d94da7fe..842d55f1 100644 --- a/lib/pages/medical/my_trackers/blood_suger/BloodYeaPage.dart +++ b/lib/pages/medical/my_trackers/blood_suger/BloodYeaPage.dart @@ -14,9 +14,8 @@ import 'package:hexcolor/hexcolor.dart'; import 'package:provider/provider.dart'; class BloodYearPage extends StatelessWidget { - final List diabtecPatientResult; - final List timeSeriesData ; + final List timeSeriesData; const BloodYearPage({Key key, this.diabtecPatientResult, this.timeSeriesData}) : super(key: key); @@ -25,45 +24,52 @@ class BloodYearPage extends StatelessWidget { Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); return AppScaffold( - body: ListView( - children: [ - Container( - width: double.maxFinite, - color: Colors.white, - child: LineChartCurved( - title: 'Sugar', - timeSeries: timeSeriesData, - indexes: timeSeriesData.length ~/ 5.5, + body: timeSeriesData.isEmpty + ? Container( + child: Center( + child: Texts(TranslationBase.of(context).noDataAvailable), + ), ) - ), - SizedBox( - height: 12, - ), - Padding( - padding: const EdgeInsets.all(8.0), - child: Texts(TranslationBase.of(context).details), - ), - Container( - padding: EdgeInsets.all(10), - color: Colors.transparent, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Table( - border: TableBorder.symmetric( - inside: BorderSide(width: 2.0, color: Colors.grey[300]), - ), - children: fullData(context,projectViewModel), + : ListView( + children: [ + Container( + width: double.maxFinite, + color: Colors.white, + child: LineChartCurved( + title: 'Sugar', + timeSeries: timeSeriesData, + indexes: timeSeriesData.length ~/ 5.5, + )), + SizedBox( + height: 12, ), + Padding( + padding: const EdgeInsets.all(8.0), + child: Texts(TranslationBase.of(context).details), + ), + Container( + padding: EdgeInsets.all(10), + color: Colors.transparent, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Table( + border: TableBorder.symmetric( + inside: + BorderSide(width: 2.0, color: Colors.grey[300]), + ), + children: fullData(context, projectViewModel), + ), + ], + ), + ) ], ), - ) - ], - ), ); } - List fullData(BuildContext context,ProjectViewModel projectViewModel) { + List fullData( + BuildContext context, ProjectViewModel projectViewModel) { List tableRow = []; tableRow.add( TableRow( @@ -73,8 +79,12 @@ class BloodYearPage extends StatelessWidget { decoration: BoxDecoration( color: Theme.of(context).primaryColor, borderRadius: BorderRadius.only( - topLeft: projectViewModel.isArabic? Radius.circular(0.0):Radius.circular(10.0), - topRight: projectViewModel.isArabic? Radius.circular(10.0):Radius.circular(0.0), + topLeft: projectViewModel.isArabic + ? Radius.circular(0.0) + : Radius.circular(10.0), + topRight: projectViewModel.isArabic + ? Radius.circular(10.0) + : Radius.circular(0.0), ), ), child: Center( @@ -120,8 +130,12 @@ class BloodYearPage extends StatelessWidget { decoration: BoxDecoration( color: Theme.of(context).primaryColor, borderRadius: BorderRadius.only( - topLeft: projectViewModel.isArabic? Radius.circular(10.0):Radius.circular(0.0), - topRight: projectViewModel.isArabic? Radius.circular(0.0):Radius.circular(10.0), + topLeft: projectViewModel.isArabic + ? Radius.circular(10.0) + : Radius.circular(0.0), + topRight: projectViewModel.isArabic + ? Radius.circular(0.0) + : Radius.circular(10.0), ), ), child: Center( @@ -133,7 +147,6 @@ class BloodYearPage extends StatelessWidget { ), height: 40), ), - ], ), ); @@ -149,7 +162,7 @@ class BloodYearPage extends StatelessWidget { color: Colors.white, child: Center( child: Texts( - '${projectViewModel.isArabic ? DateUtil.getMonthDayYearDateFormattedAr(diabtec.dateChart):DateUtil.getMonthDayYearDateFormatted(diabtec.dateChart)} ', + '${projectViewModel.isArabic ? DateUtil.getMonthDayYearDateFormattedAr(diabtec.dateChart) : DateUtil.getMonthDayYearDateFormatted(diabtec.dateChart)} ', textAlign: TextAlign.center, fontSize: 12, ), diff --git a/lib/pages/medical/my_trackers/blood_suger/blood_sugar_weekly_page.dart b/lib/pages/medical/my_trackers/blood_suger/blood_sugar_weekly_page.dart index 4bda58fa..60f3293d 100644 --- a/lib/pages/medical/my_trackers/blood_suger/blood_sugar_weekly_page.dart +++ b/lib/pages/medical/my_trackers/blood_suger/blood_sugar_weekly_page.dart @@ -31,7 +31,7 @@ class BloodSugarWeeklyPage extends StatelessWidget { Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); return AppScaffold( - body: ListView( + body:timeSeriesData.isEmpty?Container(child: Center(child: Texts(TranslationBase.of(context).noDataAvailable),),): ListView( children: [ Container( margin: EdgeInsets.only(top: 12, left: 8, right: 8), diff --git a/lib/pages/medical/my_trackers/widget/CurvedChartBloodPressure.dart b/lib/pages/medical/my_trackers/widget/CurvedChartBloodPressure.dart new file mode 100644 index 00000000..ac2349bc --- /dev/null +++ b/lib/pages/medical/my_trackers/widget/CurvedChartBloodPressure.dart @@ -0,0 +1,273 @@ +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/charts/app_time_series_chart.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:fl_chart/fl_chart.dart'; +import 'package:flutter/material.dart'; + +import '../../../../Constants.dart'; + +class CurvedChartBloodPressure extends StatelessWidget { + final String title; + final List timeSeries1; + final List timeSeries2; + final int indexes; + final double horizontalInterval; + + CurvedChartBloodPressure( + {this.title, + this.timeSeries1, + this.indexes, + this.timeSeries2, + this.horizontalInterval = 20.0}); + + List xAxixs = List(); + List yAxixs = List(); + + @override + Widget build(BuildContext context) { + getXaxix(); + return AspectRatio( + aspectRatio: 1.1, + child: Container( + decoration: const BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(18)), + // color: Colors.white, + ), + child: Stack( + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + const SizedBox( + height: 15, + ), + Text( + title, + style: TextStyle( + color: Colors.black, fontSize: 15, letterSpacing: 2), + textAlign: TextAlign.center, + ), + SizedBox( + height: 10, + ), + Expanded( + child: Padding( + padding: + const EdgeInsets.only(right: 18.0, left: 16.0, top: 15), + child: LineChart( + sampleData1(context), + swapAnimationDuration: const Duration(milliseconds: 250), + ), + ), + ), + SizedBox( + height: 10, + ), + Row( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Row( + children: [ + Container( + width: 20, + height: 20, + decoration: BoxDecoration( + shape: BoxShape.rectangle, + color: Theme.of(context).primaryColor), + ), + SizedBox( + width: 5, + ), + Texts(TranslationBase.of(context).systolicLng) + ], + ), + SizedBox( + width: 15, + ), + Row( + children: [ + Container( + width: 20, + height: 20, + decoration: BoxDecoration( + shape: BoxShape.rectangle, color: secondaryColor), + ), + SizedBox( + width: 5, + ), + Texts(TranslationBase.of(context).diastolicLng) + ], + ), + ], + ) + ], + ), + ], + ), + ), + ); + } + + getXaxix() { + for (int index = 0; index < timeSeries1.length; index++) { + int mIndex = indexes * index; + if (mIndex < timeSeries1.length) { + xAxixs.add(mIndex); + } + } + } + + LineChartData sampleData1(context) { + return LineChartData( + lineTouchData: LineTouchData( + touchTooltipData: LineTouchTooltipData( + tooltipBgColor: Colors.white, + ), + touchCallback: (LineTouchResponse touchResponse) {}, + handleBuiltInTouches: true, + ), + gridData: FlGridData( + show: true, drawVerticalLine: true, drawHorizontalLine: true), + titlesData: FlTitlesData( + bottomTitles: SideTitles( + showTitles: true, + getTextStyles: (value) => const TextStyle( + color: Colors.black, + fontSize: 10, + ), + + margin: 22, + getTitles: (value) { + if (timeSeries1.length < 15) { + if (timeSeries1.length > value.toInt()) { + return '${timeSeries1[value.toInt()].time.month}/ ${timeSeries1[value.toInt()].time.year}'; + } else + return ''; + } else { + if (value.toInt() == 0) + return '${timeSeries1[value.toInt()].time.month}/ ${timeSeries1[value.toInt()].time.year}'; + if (value.toInt() == timeSeries1.length - 1) + return '${timeSeries1[value.toInt()].time.month}/ ${timeSeries1[value.toInt()].time.year}'; + if (xAxixs.contains(value.toInt())) { + return '${timeSeries1[value.toInt()].time.month}/ ${timeSeries1[value.toInt()].time.year}'; + } + } + return ''; + }, + ), + leftTitles: SideTitles( + showTitles: true, + getTextStyles: (value) => const TextStyle( + color: Colors.black, + fontWeight: FontWeight.bold, + fontSize: 10, + ), + getTitles: (value) { + if (value.toInt() == 0) + return '${value.toInt()}'; + else if (value.toInt() % horizontalInterval == 0) + return '${value.toInt()}'; + else + return ''; + }, + margin: 12, + ), + ), + borderData: FlBorderData( + show: true, + border: const Border( + bottom: BorderSide( + color: Colors.black, + width: 0.5, + ), + left: BorderSide( + color: Colors.black, + ), + right: BorderSide( + color: Colors.black, + ), + top: BorderSide( + color: Colors.transparent, + ), + ), + ), + minX: 0, + maxX: (timeSeries1.length - 1).toDouble(), + maxY: getMaxY() + 0.3, + minY: getMinY(), + lineBarsData: getData(context), + ); + } + + double getMaxY() { + double max = 0; + timeSeries1.forEach((element) { + double resultValueDouble = element.sales; + if (resultValueDouble > max) max = resultValueDouble; + }); + timeSeries2.forEach((element) { + double resultValueDouble = element.sales; + if (resultValueDouble > max) max = resultValueDouble; + }); + + return max.roundToDouble(); + } + + double getMinY() { + double min = timeSeries1[0].sales; + timeSeries1.forEach((element) { + double resultValueDouble = element.sales; + if (resultValueDouble < min) min = resultValueDouble; + }); + timeSeries2.forEach((element) { + double resultValueDouble = element.sales; + if (resultValueDouble < min) min = resultValueDouble; + }); + + int value = min.toInt(); + + return value.toDouble(); + } + + List getData(context) { + List spots = List(); + for (int index = 0; index < timeSeries1.length; index++) { + spots.add(FlSpot(index.toDouble(), timeSeries1[index].sales)); + } + + List spots2 = List(); + for (int index = 0; index < timeSeries2.length; index++) { + spots2.add(FlSpot(index.toDouble(), timeSeries2[index].sales)); + } + + final LineChartBarData lineChartBarData1 = LineChartBarData( + spots: spots, + isCurved: true, + colors: [Colors.red], + barWidth: 5, + isStrokeCapRound: true, + dotData: FlDotData( + show: false, + ), + belowBarData: BarAreaData( + show: false, + ), + ); + final LineChartBarData lineChartBarData2 = LineChartBarData( + spots: spots2, + isCurved: true, + colors: [Theme.of(context).primaryColor], + barWidth: 5, + isStrokeCapRound: true, + dotData: FlDotData( + show: false, + ), + belowBarData: BarAreaData( + show: false, + ), + ); + + return [lineChartBarData1, lineChartBarData2]; + } +} diff --git a/lib/pages/medical/my_trackers/widget/MonthCurvedChartBloodPressure.dart b/lib/pages/medical/my_trackers/widget/MonthCurvedChartBloodPressure.dart new file mode 100644 index 00000000..135d0a95 --- /dev/null +++ b/lib/pages/medical/my_trackers/widget/MonthCurvedChartBloodPressure.dart @@ -0,0 +1,252 @@ +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/charts/app_time_series_chart.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:fl_chart/fl_chart.dart'; +import 'package:flutter/material.dart'; + +class MonthCurvedChartBloodPressure extends StatelessWidget { + final String title; + final List timeSeries1; + final List timeSeries2; + final int indexes; + final double horizontalInterval; + + MonthCurvedChartBloodPressure( + {this.title, this.timeSeries1, this.indexes, this.timeSeries2, this.horizontalInterval = 20.0}); + + List xAxixs = List(); + List yAxixs = List(); + + @override + Widget build(BuildContext context) { + getXaxix(); + return AspectRatio( + aspectRatio: 1.1, + child: Container( + decoration: const BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(18)), + // color: Colors.white, + ), + child: Stack( + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + const SizedBox( + height: 15, + ), + Text( + title, + style: TextStyle( + color: Colors.black, fontSize: 15, letterSpacing: 2), + textAlign: TextAlign.center, + ), + SizedBox( + height: 10, + ), + Expanded( + child: Padding( + padding: + const EdgeInsets.only(right: 18.0, left: 16.0, top: 15), + child: LineChart( + sampleData1(context), + swapAnimationDuration: const Duration(milliseconds: 250), + ), + ), + ), + SizedBox( + height: 10, + ), + Row( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Row( + children: [ + Container( + width: 20, + height: 20, + decoration: BoxDecoration( + shape: BoxShape.rectangle, + color: Theme.of(context).primaryColor), + ), + SizedBox( + width: 5, + ), + Texts(TranslationBase.of(context).systolicLng) + ], + ), + SizedBox( + width: 15, + ), + Row( + children: [ + Container( + width: 20, + height: 20, + decoration: BoxDecoration( + shape: BoxShape.rectangle, color: Colors.grey), + ), + SizedBox( + width: 5, + ), + Texts(TranslationBase.of(context).diastolicLng) + ], + ), + ], + ) + ], + ), + ], + ), + ), + ); + } + + getXaxix() { + for (int index = 0; index < timeSeries1.length; index++) { + int mIndex = indexes * index; + if (mIndex < timeSeries1.length) { + xAxixs.add(mIndex); + } + } + } + + LineChartData sampleData1(context) { + return LineChartData( + lineTouchData: LineTouchData( + touchTooltipData: LineTouchTooltipData( + tooltipBgColor: Colors.white, + ), + touchCallback: (LineTouchResponse touchResponse) {}, + handleBuiltInTouches: true, + ), + gridData: FlGridData( + show: true, drawVerticalLine: true, drawHorizontalLine: true), + titlesData: FlTitlesData( + bottomTitles: SideTitles( + showTitles: true, + getTextStyles: (value) => const TextStyle( + color: Colors.black, + fontSize: 10, + ), + margin: 22, + getTitles: (value) { + return ''; + }, + ), + leftTitles: SideTitles( + showTitles: true, + getTextStyles: (value) => const TextStyle( + color: Colors.black, + fontWeight: FontWeight.bold, + fontSize: 10, + ), + getTitles: (value) { + if (value.toInt() == 0) + return '${value.toInt()}'; + else if (value.toInt() % horizontalInterval == 0) + return '${value.toInt()}'; + else + return ''; + }, + margin: 12, + ), + ), + borderData: FlBorderData( + show: true, + border: const Border( + bottom: BorderSide( + color: Colors.black, + width: 0.5, + ), + left: BorderSide( + color: Colors.black, + ), + right: BorderSide( + color: Colors.black, + ), + top: BorderSide( + color: Colors.transparent, + ), + ), + ), + minX: 0, + maxX: (timeSeries1.length - 1).toDouble(), + maxY: getMaxY() + 0.3, + minY: getMinY(), + lineBarsData: getData(context), + ); + } + + double getMaxY() { + double max = 0; + timeSeries1.forEach((element) { + double resultValueDouble = element.sales; + if (resultValueDouble > max) max = resultValueDouble; + }); + timeSeries2.forEach((element) { + double resultValueDouble = element.sales; + if (resultValueDouble > max) max = resultValueDouble; + }); + + return max.roundToDouble(); + } + + double getMinY() { + double min = timeSeries1[0].sales; + timeSeries1.forEach((element) { + double resultValueDouble = element.sales; + if (resultValueDouble < min) min = resultValueDouble; + }); + timeSeries2.forEach((element) { + double resultValueDouble = element.sales; + if (resultValueDouble < min) min = resultValueDouble; + }); + + int value = min.toInt(); + + return value.toDouble(); + } + + List getData(context) { + List spots = List(); + for (int index = 0; index < timeSeries1.length; index++) { + spots.add(FlSpot(index.toDouble(), timeSeries1[index].sales)); + } + + List spots2 = List(); + for (int index = 0; index < timeSeries2.length; index++) { + spots2.add(FlSpot(index.toDouble(), timeSeries2[index].sales)); + } + + final LineChartBarData lineChartBarData1 = LineChartBarData( + spots: spots, + isCurved: true, + colors: [Colors.red], + barWidth: 5, + isStrokeCapRound: true, + dotData: FlDotData( + show: false, + ), + belowBarData: BarAreaData( + show: false, + ), + ); + final LineChartBarData lineChartBarData2 = LineChartBarData( + spots: spots2, + isCurved: true, + colors: [Theme.of(context).primaryColor], + barWidth: 5, + isStrokeCapRound: true, + dotData: FlDotData( + show: false, + ), + belowBarData: BarAreaData( + show: false, + ), + ); + + return [lineChartBarData1, lineChartBarData2]; + } +} diff --git a/lib/pages/medical/vital_sign/LineChartCurvedBloodPressure.dart b/lib/pages/medical/vital_sign/LineChartCurvedBloodPressure.dart index e8cb8b24..fa177b1a 100644 --- a/lib/pages/medical/vital_sign/LineChartCurvedBloodPressure.dart +++ b/lib/pages/medical/vital_sign/LineChartCurvedBloodPressure.dart @@ -228,7 +228,7 @@ class LineChartCurvedBloodPressure extends StatelessWidget { final LineChartBarData lineChartBarData1 = LineChartBarData( spots: spots, isCurved: true, - colors: [Theme.of(context).primaryColor], + colors: [Colors.red], barWidth: 5, isStrokeCapRound: true, dotData: FlDotData( @@ -241,7 +241,7 @@ class LineChartCurvedBloodPressure extends StatelessWidget { final LineChartBarData lineChartBarData2 = LineChartBarData( spots: spots2, isCurved: true, - colors: [Colors.grey], + colors: [Theme.of(context).primaryColor], barWidth: 5, isStrokeCapRound: true, dotData: FlDotData( diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index 6280bf01..14e10607 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -1283,6 +1283,8 @@ class TranslationBase { String get bloodDEnterDesc => localizedValues["bloodD-enter-desc"][locale.languageCode]; String get viewTermsConditions => localizedValues["viewTermsConditions"][locale.languageCode]; String get weightAdd => localizedValues["weight-add"][locale.languageCode]; + String get systolicAdd => localizedValues["systolic-add"][locale.languageCode]; + String get diastolicAdd => localizedValues["systolic-add"][locale.languageCode]; } From 3e441c55b22549ee50ef4706c1f232f5c7d428d2 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Tue, 26 Jan 2021 12:41:50 +0200 Subject: [PATCH 35/42] fix bottom nav bar --- lib/config/localized_values.dart | 4 ++ lib/pages/landing/home_page.dart | 9 ++-- lib/pages/landing/landing_page.dart | 2 + lib/pages/medical/medical_profile_page.dart | 53 ++++++++++--------- lib/uitl/translations_delegate_base.dart | 7 +-- .../bottom_navigation/bottom_nav_bar.dart | 2 +- .../medical/time_line_widget.dart | 14 +++-- 7 files changed, 46 insertions(+), 45 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 1601471a..5658469e 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -1646,4 +1646,8 @@ const Map localizedValues = { "en": "Enter Diastolic Value", "ar": "أدخل قيمة الإنبساط " }, + "cmc-heading": { + "en": "Comprehensive Medical Checkup", + "ar": "فحص طبي شامل" + }, }; diff --git a/lib/pages/landing/home_page.dart b/lib/pages/landing/home_page.dart index 87afb17f..3a64fbd5 100644 --- a/lib/pages/landing/home_page.dart +++ b/lib/pages/landing/home_page.dart @@ -3,6 +3,7 @@ import 'package:diplomaticquarterapp/core/viewModels/dashboard_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_page.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/HomeHealthCare/home_health_care_index_page.dart'; +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/HomeHealthCare/home_health_care_page.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/all_habib_medical_service_page.dart'; import 'package:diplomaticquarterapp/pages/ContactUs/contact_us_page.dart'; import 'package:diplomaticquarterapp/pages/Covid-DriveThru/covid-drivethru-location.dart'; @@ -421,7 +422,7 @@ class _HomePageState extends State { Navigator.push( context, FadePage( - page: HomeHealthCareIndexPage(), + page: HomeHealthCarePage(), ), ); }, @@ -436,10 +437,10 @@ class _HomePageState extends State { height: 50, ), SizedBox( - height: 3, + height: 10, ), Texts( - TranslationBase.of(context).homeHealthCareService, + TranslationBase.of(context).cmcHeading, textAlign: TextAlign.center, color: Colors.white, fontWeight: FontWeight.w700, @@ -505,7 +506,7 @@ class _HomePageState extends State { height: 50, ), SizedBox( - height: 3, + height:10, ), Texts( TranslationBase.of(context).emergencyService, diff --git a/lib/pages/landing/landing_page.dart b/lib/pages/landing/landing_page.dart index 01a50fda..e63df76c 100644 --- a/lib/pages/landing/landing_page.dart +++ b/lib/pages/landing/landing_page.dart @@ -607,6 +607,8 @@ class _LandingPageState extends State with WidgetsBindingObserver { return TranslationBase.of(context).medicalProfile; case 2: return TranslationBase.of(context).bookAppo; + case 5: + return TranslationBase.of(context).bookAppo; case 3: return TranslationBase.of(context).services; case 4: diff --git a/lib/pages/medical/medical_profile_page.dart b/lib/pages/medical/medical_profile_page.dart index ade69f45..431990e8 100644 --- a/lib/pages/medical/medical_profile_page.dart +++ b/lib/pages/medical/medical_profile_page.dart @@ -54,15 +54,19 @@ class MedicalProfilePage extends StatefulWidget { class _MedicalProfilePageState extends State { var authProvider = new AuthProvider(); - List medical=List(); + List medical = List(); ProjectViewModel projectViewModel; + @override Widget build(BuildContext context) { - projectViewModel = Provider.of(context); + projectViewModel = Provider.of(context); var appoCountProvider = Provider.of(context); - - List myMedicalList = Utils.myMedicalList(projectViewModel: projectViewModel,context: context,count: appoCountProvider.count,isLogin: projectViewModel.isLogin); - return BaseView( + List myMedicalList = Utils.myMedicalList( + projectViewModel: projectViewModel, + context: context, + count: appoCountProvider.count, + isLogin: projectViewModel.isLogin); + return BaseView( onModelReady: (model) => model.getAppointmentHistory(), builder: (_, model, widget) => AppScaffold( isShowDecPage: false, @@ -97,25 +101,30 @@ class _MedicalProfilePageState extends State { itemCount: model .appoitmentAllHistoryResultList.length, scrollDirection: Axis.horizontal, - reverse: !projectViewModel.isArabic, + reverse: projectViewModel.isArabic, ), ], ), ), - SizedBox(height: 50,), + SizedBox( + height: 50, + ), Padding( padding: EdgeInsets.symmetric(vertical: 5.0), child: GridView.builder( shrinkWrap: true, primary: false, physics: NeverScrollableScrollPhysics(), - gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( + gridDelegate: + SliverGridDelegateWithFixedCrossAxisCount( crossAxisCount: 3, - childAspectRatio: MediaQuery.of(context).size.width / (MediaQuery.of(context).size.height / 2.40), + childAspectRatio: MediaQuery.of(context) + .size + .width / + (MediaQuery.of(context).size.height / 2.40), ), itemCount: myMedicalList.length, itemBuilder: (BuildContext context, int index) { - return myMedicalList[index]; }, ), @@ -123,8 +132,7 @@ class _MedicalProfilePageState extends State { ], ), SizedBox( - height: - MediaQuery.of(context).size.height * 0.12, + height: MediaQuery.of(context).size.height * 0.12, ), if (model.user != null && model.isLogin) Positioned( @@ -135,7 +143,7 @@ class _MedicalProfilePageState extends State { width: double.infinity, height: 80, decoration: BoxDecoration( - color: Theme.of(context).primaryColor, + color: Colors.grey[500], shape: BoxShape.rectangle, border: Border.all( color: Colors.transparent, width: 0.5), @@ -187,20 +195,13 @@ class _MedicalProfilePageState extends State { ), ); } - - fullMedicalData(){ - if(projectViewModel.havePrivilege(5)) - {} - } } -class Medical{ - - final String title; - final String imagePath; - final String subTitle; - final Widget page; - - Medical({this.title, this.imagePath, this.subTitle, this.page}); +class Medical { + final String title; + final String imagePath; + final String subTitle; + final Widget page; + Medical({this.title, this.imagePath, this.subTitle, this.page}); } diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index 2365359d..82d3d5c4 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -1377,15 +1377,10 @@ class TranslationBase { localizedValues["viewTermsConditions"][locale.languageCode]; String get walkinAppo => localizedValues["WalkinAppo"][locale.languageCode]; String get videoAppo => localizedValues["videoAppo"][locale.languageCode]; - String get addNewChild => localizedValues["add-new-child"][locale.languageCode]; - String get sendChildEmailMsg => localizedValues["send-child-email-msg"][locale.languageCode]; - String get vaccinationAddChildMsg => localizedValues["vaccination-add-child-msg"][locale.languageCode]; - String get childAddedSuccessfully => localizedValues["child_added_successfully"][locale.languageCode]; - String get bloodDEnterDesc => localizedValues["bloodD-enter-desc"][locale.languageCode]; - String get viewTermsConditions => localizedValues["viewTermsConditions"][locale.languageCode]; String get weightAdd => localizedValues["weight-add"][locale.languageCode]; String get systolicAdd => localizedValues["systolic-add"][locale.languageCode]; String get diastolicAdd => localizedValues["systolic-add"][locale.languageCode]; + String get cmcHeading => localizedValues["cmc-heading"][locale.languageCode]; } diff --git a/lib/widgets/bottom_navigation/bottom_nav_bar.dart b/lib/widgets/bottom_navigation/bottom_nav_bar.dart index 66a83224..107e730c 100644 --- a/lib/widgets/bottom_navigation/bottom_nav_bar.dart +++ b/lib/widgets/bottom_navigation/bottom_nav_bar.dart @@ -95,7 +95,7 @@ class _BottomNavBarState extends State { icon: EvaIcons.calendar, activeIcon: EvaIcons.calendar, changeIndex: _changeIndex, - index: _index, + index: widget.index, currentIndex: 2, name: TranslationBase.of(context).bookAppo, ), diff --git a/lib/widgets/data_display/medical/time_line_widget.dart b/lib/widgets/data_display/medical/time_line_widget.dart index 6e946aa5..810fc0d8 100644 --- a/lib/widgets/data_display/medical/time_line_widget.dart +++ b/lib/widgets/data_display/medical/time_line_widget.dart @@ -72,9 +72,8 @@ class TimeLineWidget extends StatelessWidget { width: 15, height: 15, decoration: BoxDecoration( - color: Theme.of(context).primaryColor, - border: Border.all( - color: Theme.of(context).primaryColor, width: 2), + color: Colors.yellow[700], + border: Border.all(color: Colors.yellow[700], width: 2), shape: BoxShape.rectangle, borderRadius: BorderRadius.all( Radius.circular(25.0), @@ -111,7 +110,7 @@ class TimeLineWidget extends StatelessWidget { child: Column( children: [ Texts( - appoitmentAllHistoryResul.clinicName, + appoitmentAllHistoryResul.clinicName.trim(), color: Colors.white, fontSize: 12.5, fontWeight: FontWeight.normal, @@ -132,9 +131,8 @@ class TimeLineWidget extends StatelessWidget { width: 15, height: 15, decoration: BoxDecoration( - color: Theme.of(context).primaryColor, - border: Border.all( - color: Theme.of(context).primaryColor, width: 2), + color: Colors.yellow[700], + border: Border.all(color: Colors.yellow[700], width: 2), shape: BoxShape.rectangle, borderRadius: BorderRadius.all( Radius.circular(25.0), @@ -164,7 +162,7 @@ class TimeLineWidget extends StatelessWidget { height: 3, ), Texts( - appoitmentAllHistoryResul.doctorNameObj, + appoitmentAllHistoryResul.doctorNameObj.trim(), color: Colors.white, fontSize: 10.5, fontWeight: FontWeight.normal, From 8f37fbf2604e4e1c2e1634cfa0cec9fb017a5e58 Mon Sep 17 00:00:00 2001 From: Sikander Saleem Date: Thu, 28 Jan 2021 09:39:33 +0300 Subject: [PATCH 36/42] Qr icon added, notify me api added & improvements --- lib/config/config.dart | 101 +-- .../parmacyModule/parmacy_module_service.dart | 32 +- .../product_detail_view_model.dart | 11 + lib/pages/landing/landing_page_pharmcy.dart | 231 +++--- lib/pages/login/login.dart | 113 ++- lib/pages/pharmacies/product_detail.dart | 764 ++++++------------ .../pharmacies/screens/cart-order-page.dart | 2 +- lib/pages/pharmacies/widgets/BannerPager.dart | 35 +- lib/pages/pharmacy_categorise.dart | 82 +- .../product_detail_service.dart | 20 +- 10 files changed, 564 insertions(+), 827 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index d276d51a..856ae36a 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -36,40 +36,29 @@ const GET_PRIVILEGE = 'Services/Patients.svc/REST/Service_Privilege'; const WIFI_CREDENTIALS = "Services/Patients.svc/Hmg_SMS_Get_By_ProjectID_And_PatientID"; ///Doctor -const GET_MY_DOCTOR = - 'Services/Doctors.svc/REST/GetPatientDoctorAppointmentResult'; +const GET_MY_DOCTOR = 'Services/Doctors.svc/REST/GetPatientDoctorAppointmentResult'; const GET_DOCTOR_PROFILE = 'Services/Doctors.svc/REST/GetDocProfiles'; -const GET_DOCTOR_RATING_NOTES = - 'Services/Doctors.svc/REST/dr_GetNotesDoctorRating'; -const GET_DOCTOR_RATING_DETAILS = - 'Services/Doctors.svc/REST/dr_GetDoctorRatingDetails'; +const GET_DOCTOR_RATING_NOTES = 'Services/Doctors.svc/REST/dr_GetNotesDoctorRating'; +const GET_DOCTOR_RATING_DETAILS = 'Services/Doctors.svc/REST/dr_GetDoctorRatingDetails'; const GET_DOCTOR_RATING = 'Services/Doctors.svc/REST/dr_GetAvgDoctorRating'; ///Prescriptions const PRESCRIPTIONS = 'Services/Patients.svc/REST/GetPrescriptionApptList'; -const GET_PRESCRIPTIONS_ALL_ORDERS = - 'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders'; -const GET_PRESCRIPTION_REPORT = - 'Services/Patients.svc/REST/INP_GetPrescriptionReport'; -const SEND_PRESCRIPTION_EMAIL = - 'Services/Notifications.svc/REST/SendPrescriptionEmail'; -const GET_PRESCRIPTION_REPORT_ENH = - 'Services/Patients.svc/REST/GetPrescriptionReport_enh'; +const GET_PRESCRIPTIONS_ALL_ORDERS = 'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders'; +const GET_PRESCRIPTION_REPORT = 'Services/Patients.svc/REST/INP_GetPrescriptionReport'; +const SEND_PRESCRIPTION_EMAIL = 'Services/Notifications.svc/REST/SendPrescriptionEmail'; +const GET_PRESCRIPTION_REPORT_ENH = 'Services/Patients.svc/REST/GetPrescriptionReport_enh'; ///Lab Order const GET_Patient_LAB_ORDERS = 'Services/Patients.svc/REST/GetPatientLabOrders'; const GET_Patient_LAB_SPECIAL_RESULT = 'Services/Patients.svc/REST/GetPatientLabSpecialResults'; -const SEND_LAB_RESULT_EMAIL = - 'Services/Notifications.svc/REST/SendLabReportEmail'; -const GET_Patient_LAB_RESULT = - 'Services/Patients.svc/REST/GetPatientLabResults'; -const GET_Patient_LAB_ORDERS_RESULT = - 'Services/Patients.svc/REST/GetPatientLabOrdersResults'; +const SEND_LAB_RESULT_EMAIL = 'Services/Notifications.svc/REST/SendLabReportEmail'; +const GET_Patient_LAB_RESULT = 'Services/Patients.svc/REST/GetPatientLabResults'; +const GET_Patient_LAB_ORDERS_RESULT = 'Services/Patients.svc/REST/GetPatientLabOrdersResults'; /// const GET_PATIENT_ORDERS = 'Services/Patients.svc/REST/GetPatientRadOrders'; -const GET_PATIENT_LAB_ORDERS_BY_APPOINTMENT = - 'Services/Patients.svc/REST/GetPatientLabResultsByAppointmentNo'; +const GET_PATIENT_LAB_ORDERS_BY_APPOINTMENT = 'Services/Patients.svc/REST/GetPatientLabResultsByAppointmentNo'; const GET_PATIENT_ORDERS_DETAILS = 'Services/Patients.svc/REST/Rad_UpdatePatientRadOrdersToRead'; const GET_RAD_IMAGE_URL = 'Services/Patients.svc/Rest/GetRadImageURL'; @@ -134,8 +123,7 @@ const GET_BLOOD_REQUEST = 'services/PatientVarification.svc/REST/BloodDonation_G ///Reports 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'; +const SEND_MEDICAL_REPORT_EMAIL = 'Services/Notifications.svc/REST/SendMedicalReportEmail'; ///Rate const IS_LAST_APPOITMENT_RATED = 'Services/Doctors.svc/REST/IsLastAppoitmentRated'; @@ -254,10 +242,8 @@ const GET_PAtIENTS_INSURANCE = "Services/Patients.svc/REST/Get_PatientInsuranceD const GET_PAtIENTS_INSURANCE_UPDATED = "Services/Patients.svc/REST/PatientER_GetPatientInsuranceCardUpdateHistory"; const INSURANCE_DETAILS = "Services/Patients.svc/REST/Get_InsuranceCheckList"; -const GET_PATIENT_INSURANCE_DETAILS = - "Services/Patients.svc/REST/PatientER_GetPatientInsuranceDetails"; -const UPLOAD_INSURANCE_CARD = - 'Services/Patients.svc/REST/PatientER_PatientInfoForInsuranceCardUpdate'; +const GET_PATIENT_INSURANCE_DETAILS = "Services/Patients.svc/REST/PatientER_GetPatientInsuranceDetails"; +const UPLOAD_INSURANCE_CARD = 'Services/Patients.svc/REST/PatientER_PatientInfoForInsuranceCardUpdate'; const GET_VACCINES = "Services/Patients.svc/REST/GetDoneVaccinesByPatientID"; const GET_VACCINES_EMAIL = "Services/Notifications.svc/REST/SendVaccinesEmail"; @@ -302,10 +288,10 @@ const SEND_AVERAGE_BLOOD_WEIGHT_REPORT = 'Services/Notifications.svc/REST/SendAv const SEND_AVERAGE_BLOOD_PRESSURE_REPORT = 'Services/Notifications.svc/REST/SendAverageBloodPressureReport'; const UPDATE_DIABETIC_RESULT = 'Services/Patients.svc/REST/Patient_UpdateDiabeticResult'; - const GET_WEIGHT_PRESSURE_RESULT_AVERAGE = 'Services/Patients.svc/REST/Patient_GetWeightMeasurementResultAverage'; const GET_WEIGHT_PRESSURE_RESULT = 'Services/Patients.svc/REST/Patient_GetWeightMeasurementResult'; const ADD_WEIGHT_PRESSURE_RESULT = 'Services/Patients.svc/REST/Patient_AddWeightMeasurementResult'; + const UPDATE_WEIGHT_PRESSURE_RESULT = 'Services/Patients.svc/REST/Patient_UpdateWeightMeasurementResult'; const DEACTIVATE_WEIGHT_PRESSURE_RESULT = 'services/Patients.svc/REST/Patient_DeactivateWeightMeasurementStatus'; @@ -342,7 +328,9 @@ const GET_PHARMACY_BANNER = "epharmacy/api/promotionbanners"; const GET_PHARMACY_TOP_MANUFACTURER = "epharmacy/api/topmanufacturer"; const GET_PHARMACY_BEST_SELLER_PRODUCT = "epharmacy/api/bestsellerproducts"; const GET_PHARMACY_PRODUCTs_BY_IDS = "epharmacy/api/productsbyids/"; +const GET_PHARMACY_PRODUCTs_BY_SKU = "epharmacy/api/productbysku/"; const GET_CUSTOMERS_ADDRESSES = "epharmacy/api/Customers/"; +const SUBSCRIBE_PRODUCT = "epharmacy/api/subscribe?"; const GET_ORDER = "orders?"; const GET_ORDER_DETAILS = "orders/"; const ADD_CUSTOMER_ADDRESS = "epharmacy/api/addcustomeraddress"; @@ -354,23 +342,15 @@ const WRITE_REVIEW = "Content-Type" + "text/plain; charset=utf-8"; const GET_SHOPPING_CART = "epharmacy/api/shopping_cart_items/"; const GET_SHIPPING_OPTIONS = "epharmacy/api/get_shipping_option/"; const DELETE_SHOPPING_CART = "epharmacy/api/delete_shopping_cart_items/"; -const DELETE_SHOPPING_CART_ALL = - "epharmacy/api/delete_shopping_cart_item_by_customer/"; +const DELETE_SHOPPING_CART_ALL = "epharmacy/api/delete_shopping_cart_item_by_customer/"; const ORDER_SHOPPING_CART = "epharmacy/api/orders"; -const GET_LACUM_ACCOUNT_INFORMATION = - "Services/Patients.svc/REST/GetLakumAccountInformation"; -const GET_LACUM_GROUP_INFORMATION = - "Services/Patients.svc/REST/GetlakumInQueryInfoGrouping"; -const LACUM_ACCOUNT_ACTIVATE = - "Services/Patients.svc/REST/LakumAccountActivation"; -const LACUM_ACCOUNT_DEACTIVATE = - "Services/Patients.svc/REST/LakumAccountDeactivation"; -const CREATE_LAKUM_ACCOUNT = - "Services/Patients.svc/REST/PHR_CreateLakumAccount"; -const TRANSFER_YAHALA_LOYALITY_POINTS = - "Services/Patients.svc/REST/TransferYaHalaLoyaltyPoints"; -const LAKUM_GET_USER_TERMS_AND_CONDITIONS = - "Services/ERP.svc/REST/GetUserTermsAndConditionsForEPharmcy"; +const GET_LACUM_ACCOUNT_INFORMATION = "Services/Patients.svc/REST/GetLakumAccountInformation"; +const GET_LACUM_GROUP_INFORMATION = "Services/Patients.svc/REST/GetlakumInQueryInfoGrouping"; +const LACUM_ACCOUNT_ACTIVATE = "Services/Patients.svc/REST/LakumAccountActivation"; +const LACUM_ACCOUNT_DEACTIVATE = "Services/Patients.svc/REST/LakumAccountDeactivation"; +const CREATE_LAKUM_ACCOUNT = "Services/Patients.svc/REST/PHR_CreateLakumAccount"; +const TRANSFER_YAHALA_LOYALITY_POINTS = "Services/Patients.svc/REST/TransferYaHalaLoyaltyPoints"; +const LAKUM_GET_USER_TERMS_AND_CONDITIONS = "Services/ERP.svc/REST/GetUserTermsAndConditionsForEPharmcy"; const PRESCRIPTION = 'Services/Patients.svc/REST/GetPrescriptionApptList'; // Home Health Care @@ -380,14 +360,10 @@ const PATIENT_ER_UPDATE_PRES_ORDER = "Services/Patients.svc/REST/PatientER_Updat const GET_ORDER_DETAIL_BY_ID = "Services/Patients.svc/REST/PatientER_HHC_GetTransactionsForOrder"; const GET_CMC_ORDER_DETAIL_BY_ID = "Services/Patients.svc/REST/PatientER_CMC_GetTransactionsForOrder"; const GET_CHECK_UP_ITEMS = "Services/Patients.svc/REST/GetCheckUpItems"; -const PUSH_NOTIFICATION_GET_ALL_NOTIFICATIONS = - 'Services/MobileNotifications.svc/REST/PushNotification_GetAllNotifications'; -const PUSH_NOTIFICATION_SET_MESSAGES_FROM_POOL_AS_READ = - 'Services/MobileNotifications.svc/REST/PushNotification_SetMessagesFromPoolAsRead'; -const GET_PATIENT_ALL_PRES_ORD = - 'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders'; -const PATIENT_ER_INSERT_PRES_ORDER = - 'Services/Patients.svc/REST/PatientER_InsertPresOrder'; +const PUSH_NOTIFICATION_GET_ALL_NOTIFICATIONS = 'Services/MobileNotifications.svc/REST/PushNotification_GetAllNotifications'; +const PUSH_NOTIFICATION_SET_MESSAGES_FROM_POOL_AS_READ = 'Services/MobileNotifications.svc/REST/PushNotification_SetMessagesFromPoolAsRead'; +const GET_PATIENT_ALL_PRES_ORD = 'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders'; +const PATIENT_ER_INSERT_PRES_ORDER = 'Services/Patients.svc/REST/PatientER_InsertPresOrder'; const PHARMACY_MAKE_REVIEW = 'epharmacy/api/insertreviews'; const BLOOD_DONATION_REGISTER_BLOOD_TYPE = 'Services/PatientVarification.svc/REST/BloodDonation_RegisterBloodType'; const ADD_USER_AGREEMENT_FOR_BLOOD_DONATION = 'Services/PatientVarification.svc/REST/AddUserAgreementForBloodDonation'; @@ -404,29 +380,22 @@ const GET_SPECIFICATION = "productspecification/"; const GET_BRAND_ITEMS = "products?ManufacturerId="; // External API -const ADD_ADDRESS_INFO = - "https://mdlaboratories.com/exacartapi/api/addcustomeraddress"; -const GET_CUSTOMER_ADDRESSES = - "https://mdlaboratories.com/exacartapi/api/Customers/"; -const GET_CUSTOMER_INFO = - "https://mdlaboratories.com/exacartapi/api/VerifyCustomer"; +const ADD_ADDRESS_INFO = "https://mdlaboratories.com/exacartapi/api/addcustomeraddress"; +const GET_CUSTOMER_ADDRESSES = "https://mdlaboratories.com/exacartapi/api/Customers/"; +const GET_CUSTOMER_INFO = "https://mdlaboratories.com/exacartapi/api/VerifyCustomer"; //Pharmacy -const GET_PHARMACY_CATEGORISE = - 'epharmacy/api/categories?fields=id,name,namen,description,image,localized_names,display_order,parent_category_id,is_leaf&parent_id=0'; +const GET_PHARMACY_CATEGORISE = 'epharmacy/api/categories?fields=id,name,namen,description,image,localized_names,display_order,parent_category_id,is_leaf&parent_id=0'; const GET_OFFERS_CATEGORISE = 'epharmacy/api/discountcategories'; const GET_OFFERS_PRODUCTS = 'epharmacy/api/offerproducts/'; -const GET_CATEGORISE_PARENT = - 'epharmacy/api/categories?fields=id,name,namen,description,image,localized_names,display_order,parent_category_id,is_leaf&parent_id='; +const GET_CATEGORISE_PARENT = 'epharmacy/api/categories?fields=id,name,namen,description,image,localized_names,display_order,parent_category_id,is_leaf&parent_id='; const GET_PARENT_PRODUCTS = 'epharmacy/api/products?categoryid='; -const GET_SUB_CATEGORISE = - 'epharmacy/api/categories?fields=id,name,namen,description,image,localized_names,display_order,parent_category_id,is_leaf&parent_id='; +const GET_SUB_CATEGORISE = 'epharmacy/api/categories?fields=id,name,namen,description,image,localized_names,display_order,parent_category_id,is_leaf&parent_id='; const GET_SUB_PRODUCTS = 'epharmacy/api/products?categoryid='; const GET_FINAL_PRODUCTS = 'epharmacy/api/products?fields=id,reviews,discount_ids,name,namen,localized_names,display_order,short_description,full_description,full_descriptionn,sku,order_minimum_quantity,order_maximum_quantity,price,old_price,images,is_rx,rx_message,rx_messagen,discount_name,discount_namen,approved_rating_sum,approved_total_reviews,allow_back_in_stock_subscriptions,stock_quantity,stock_availability,stock_availabilityn,discount_percentage&CategoryId='; - const TIMER_MIN = 10; const GOOGLE_API_KEY = "AIzaSyCmevVlr2Bh-c8W1VUzo8gt8JRY7n5PANw"; diff --git a/lib/core/service/parmacyModule/parmacy_module_service.dart b/lib/core/service/parmacyModule/parmacy_module_service.dart index 7f0a1050..264af2c2 100644 --- a/lib/core/service/parmacyModule/parmacy_module_service.dart +++ b/lib/core/service/parmacyModule/parmacy_module_service.dart @@ -6,27 +6,23 @@ import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyProduct.dart' import 'package:diplomaticquarterapp/core/service/base_service.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; - class PharmacyModuleService extends BaseService { final AppSharedPreferences sharedPref = AppSharedPreferences(); bool isFinished = true; bool hasError = false; String errorMsg = ''; - String url =""; + String url = ""; List bannerItems = List(); List manufacturerList = List(); List bestSellerProducts = List(); List lastVisitedProducts = List(); - - Future makeVerifyCustomer(dynamic data) async { Map queryParams = {'FileNumber': data['PatientID'].toString()}; hasError = false; try { - await baseAppClient.get(PHARMACY_VERIFY_CUSTOMER, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.get(PHARMACY_VERIFY_CUSTOMER, onSuccess: (dynamic response, int statusCode) { if (response['UserName'] != null) { sharedPref.setString(PHARMACY_CUSTOMER_ID, response['CustomerId'].toString()); print(response); @@ -58,8 +54,7 @@ class PharmacyModuleService extends BaseService { }; hasError = false; try { - await baseAppClient.get(PHARMACY_CREATE_CUSTOMER, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.get(PHARMACY_CREATE_CUSTOMER, onSuccess: (dynamic response, int statusCode) { if (!response['IsRegistered']) {} }, onFailure: (String error, int statusCode) { hasError = true; @@ -73,8 +68,7 @@ class PharmacyModuleService extends BaseService { Future getBannerListList() async { hasError = false; try { - await baseAppClient.get(GET_PHARMACY_BANNER, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.get(GET_PHARMACY_BANNER, onSuccess: (dynamic response, int statusCode) { bannerItems.clear(); response['images'].forEach((item) { bannerItems.add(PharmacyImageObject.fromJson(item)); @@ -91,12 +85,11 @@ class PharmacyModuleService extends BaseService { Future getTopManufacturerList() async { Map queryParams = {'page': '1', 'limit': '8'}; try { - await baseAppClient.get(GET_PHARMACY_TOP_MANUFACTURER, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.get(GET_PHARMACY_TOP_MANUFACTURER, onSuccess: (dynamic response, int statusCode) { manufacturerList.clear(); response['manufacturer'].forEach((item) { Manufacturer manufacturer = Manufacturer.fromJson(item); - if(manufacturer.image != null){ + if (manufacturer.image != null) { manufacturerList.add(Manufacturer.fromJson(item)); } }); @@ -115,8 +108,7 @@ class PharmacyModuleService extends BaseService { 'id,discount_ids,name,namen,localized_names,display_order,short_description,full_description,full_descriptionn,sku,order_minimum_quantity,order_maximum_quantity,price,old_price,images,is_rx,rx_message,rx_messagen,discount_name,discount_namen,approved_rating_sum,approved_total_reviews,allow_back_in_stock_subscriptions,stock_quantity,stock_availability,stock_availabilityn,discount_percentage,reviews', }; try { - await baseAppClient.get(GET_PHARMACY_BEST_SELLER_PRODUCT, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.get(GET_PHARMACY_BEST_SELLER_PRODUCT, onSuccess: (dynamic response, int statusCode) { bestSellerProducts.clear(); response['products'].forEach((item) { bestSellerProducts.add(PharmacyProduct.fromJson(item)); @@ -132,13 +124,10 @@ class PharmacyModuleService extends BaseService { Future getLastVisitedProducts() async { String lastVisited = ""; - if (await this.sharedPref.getString(PHARMACY_LAST_VISITED_PRODUCTS) != - null) { - lastVisited = - await this.sharedPref.getString(PHARMACY_LAST_VISITED_PRODUCTS); + if (await this.sharedPref.getString(PHARMACY_LAST_VISITED_PRODUCTS) != null) { + lastVisited = await this.sharedPref.getString(PHARMACY_LAST_VISITED_PRODUCTS); try { - await baseAppClient.get("$GET_PHARMACY_PRODUCTs_BY_IDS$lastVisited", - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.get("$GET_PHARMACY_PRODUCTs_BY_IDS$lastVisited", onSuccess: (dynamic response, int statusCode) { lastVisitedProducts.clear(); response['products'].forEach((item) { lastVisitedProducts.add(PharmacyProduct.fromJson(item)); @@ -152,5 +141,4 @@ class PharmacyModuleService extends BaseService { } } } - } diff --git a/lib/core/viewModels/pharmacyModule/product_detail_view_model.dart b/lib/core/viewModels/pharmacyModule/product_detail_view_model.dart index 47a3bb11..e3a6255e 100644 --- a/lib/core/viewModels/pharmacyModule/product_detail_view_model.dart +++ b/lib/core/viewModels/pharmacyModule/product_detail_view_model.dart @@ -50,6 +50,17 @@ class ProductDetailViewModel extends BaseViewModel{ setState(ViewState.Idle); } + Future notifyMe(customerId, itemID) async { + hasError = false; + setState(ViewState.Busy); + await _productLocationService.notifyMe(customerId, itemID); + if (_productLocationService.hasError) { + error = _productLocationService.error; + setState(ViewState.ErrorLocal); + } else + setState(ViewState.Idle); + } + Future addToCartData(quantity, itemID) async { hasError = false; setState(ViewState.Busy); diff --git a/lib/pages/landing/landing_page_pharmcy.dart b/lib/pages/landing/landing_page_pharmcy.dart index fda83fc2..a41c263f 100644 --- a/lib/pages/landing/landing_page_pharmcy.dart +++ b/lib/pages/landing/landing_page_pharmcy.dart @@ -1,19 +1,29 @@ +import 'dart:convert'; + +import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:barcode_scan_fix/barcode_scan.dart'; +import 'package:diplomaticquarterapp/core/service/client/base_app_client.dart'; +import 'package:diplomaticquarterapp/core/viewModels/pharmacy_categorise_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/parent_categorise_page.dart'; +import 'package:diplomaticquarterapp/pages/pharmacies/product_detail.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/screens/cart-order-page.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/screens/pharmacy_module_page.dart'; +import 'package:diplomaticquarterapp/pages/pharmacies/medicine_search_screen.dart'; import 'package:diplomaticquarterapp/pages/pharmacy/profile/profile.dart'; import 'package:diplomaticquarterapp/pages/pharmacy_categorise.dart'; import 'package:diplomaticquarterapp/pages/search_products_page.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; -import 'package:diplomaticquarterapp/widgets/drawer/app_drawer_widget.dart'; +import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyProduct.dart'; import 'package:diplomaticquarterapp/widgets/pharmacy/bottom_nav_pharmacy_bar.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/wishlist.dart'; -import '../offers_categorise_page.dart'; - class LandingPagePharmacy extends StatefulWidget { @override _LandingPagePharmacyState createState() => _LandingPagePharmacyState(); @@ -39,105 +49,107 @@ class _LandingPagePharmacyState extends State { @override Widget build(BuildContext context) { return Scaffold( - appBar: currentTab == 0 || currentTab == 1 - ? AppBar( - backgroundColor: Color(0xff5AB145), - elevation: 0, - title: Container( - height: MediaQuery.of(context).size.height * 0.056, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(5.0), - color: Colors.white, - ), - child: InkWell( - child: Padding( - padding: EdgeInsets.all(8.0), - child: Row( - //crossAxisAlignment: CrossAxisAlignment.center, - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Icon(Icons.search, size: 25.0), - SizedBox( - width: 15.0, - ), - Texts( - TranslationBase.of(context).searchProductHere, - fontSize: 13, - ) - ], - ), + appBar: + + // currentTab == 0 || currentTab == 1 || currentTab == 2 + // ? + + AppBar( + backgroundColor: Color(0xff5AB145), + elevation: 0, + title: Container( + height: MediaQuery.of(context).size.height * 0.056, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(5.0), + color: Colors.white, + ), + child: InkWell( + child: Padding( + padding: EdgeInsets.all(8.0), + child: Row( + //crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Icon(Icons.search, size: 25.0), + SizedBox( + width: 15.0, ), - onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => SearchProductsPage()), - ); - }, + Texts( + TranslationBase.of(context).searchProductHere, + fontSize: 13, + ) + ], + ), + ), + onTap: () { + Navigator.push( + context, + MaterialPageRoute(builder: (context) => SearchProductsPage()), + ); + }, + ), + ), + leading: Builder( + builder: (BuildContext context) { + return InkWell( + onTap: () { + setState(() { + currentTab = 0; + pageController.jumpToPage(0); + }); + }, + child: Container( + height: 2.0, + width: 10.0, + child: Image.asset( + 'assets/images/pharmacy_logo.png', ), ), - leading: Builder( - builder: (BuildContext context) { - return InkWell( - onTap: (){ - setState(() { - currentTab = 0; - pageController.jumpToPage(0); - }); - }, - child: Container( - height: 2.0, - width: 10.0, - child: Image.asset( - 'assets/images/pharmacy_logo.png', - ), - ), - ); - }, + ); + }, + ), + actions: [ + IconButton( + // iconSize: 70, + icon: Image.asset( + 'assets/images/new-design/qr-code.png', ), - actions: [ - // IconButton( - // iconSize: 70, - // icon: SvgPicture.asset('assets/images/svg/robort_svg.svg', - // height: 100, width: 100, fit: BoxFit.cover), - // onPressed: () { - // triggerRobot(); - // } //do something, - // ) - ], - centerTitle: true, - ) - : currentTab == 4 - ? null - : AppBar( - backgroundColor: Color(0xff5AB145), - elevation: 0, - textTheme: TextTheme( - headline6: TextStyle( - color: Colors.white, fontWeight: FontWeight.bold), - ), - title: Text(getText(currentTab).toUpperCase()), - leading: Builder( - builder: (BuildContext context) { - return IconButton( - icon: Icon(Icons.arrow_back), - color: Colors.white, - onPressed: () => Scaffold.of(context).openDrawer(), - ); - }, - ), - actions: [ - // IconButton( - // iconSize: 70, - // icon: SvgPicture.asset('assets/images/svg/robort_svg.svg', - // height: 100, width: 100, fit: BoxFit.cover), - // onPressed: () { - // triggerRobot(); - // } //do something, - // ) - ], - centerTitle: true, - ), + onPressed: _scanQrAndGetProduct //do something, + ) + ], + centerTitle: true, + ), + // : currentTab == 4 + // ? null:null, + // : AppBar( + // backgroundColor: Color(0xff5AB145), + // elevation: 0, + // textTheme: TextTheme( + // headline6: TextStyle( + // color: Colors.white, fontWeight: FontWeight.bold), + // ), + // title: Text(getText(currentTab).toUpperCase()), + // leading: Builder( + // builder: (BuildContext context) { + // return IconButton( + // icon: Icon(Icons.arrow_back), + // color: Colors.white, + // onPressed: () => Scaffold.of(context).openDrawer(), + // ); + // }, + // ), + // actions: [ + // // IconButton( + // // iconSize: 70, + // // icon: SvgPicture.asset('assets/images/svg/robort_svg.svg', + // // height: 100, width: 100, fit: BoxFit.cover), + // // onPressed: () { + // // triggerRobot(); + // // } //do something, + // // ) + // ], + // centerTitle: true, + // ), extendBody: false, body: PageView( physics: NeverScrollableScrollPhysics(), @@ -162,6 +174,29 @@ class _LandingPagePharmacyState extends State { ); } + void _scanQrAndGetProduct() async { + try { + String result = await BarcodeScanner.scan(); + try { + String barcode = result; + GifLoaderDialogUtils.showMyDialog(context); + await BaseAppClient().get("$GET_PHARMACY_PRODUCTs_BY_SKU$barcode", + onSuccess: (dynamic response, int statusCode) { + print(response); + var product = PharmacyProduct.fromJson(response["products"][0]); + GifLoaderDialogUtils.hideDialog(context); + Navigator.push(context, FadePage(page: ProductDetailPage(product))); + }, onFailure: (String error, int statusCode) { + GifLoaderDialogUtils.hideDialog(context); + AppToast.showErrorToast(message: "Product not found"); + }); + } catch (apiEx) { + AppToast.showErrorToast( + message: "Something went wrong, please try again"); + } + } catch (barcodeEx) {} + } + getText(currentTab) { switch (currentTab) { case 2: diff --git a/lib/pages/login/login.dart b/lib/pages/login/login.dart index c2a943d2..2c554c1c 100644 --- a/lib/pages/login/login.dart +++ b/lib/pages/login/login.dart @@ -44,11 +44,9 @@ class _Login extends State { final authService = new AuthProvider(); var sharedPref = new AppSharedPreferences(); bool isLoading = false; - AppointmentRateViewModel appointmentRateViewModel = - locator(); + AppointmentRateViewModel appointmentRateViewModel = locator(); - AuthenticatedUserObject authenticatedUserObject = - locator(); + AuthenticatedUserObject authenticatedUserObject = locator(); ProjectViewModel projectViewModel; ToDoCountProviderModel toDoProvider; @@ -101,16 +99,9 @@ class _Login extends State { fontWeight: FontWeight.normal, controller: nationalIDorFile, onChanged: (value) => {validateForm()}, - prefixIcon: Icon( - loginType == 1 - ? Icons.chrome_reader_mode - : Icons.receipt, - color: Color(0xFF40ACC9)), - padding: EdgeInsets.only( - top: 20, bottom: 20, left: 10, right: 10), - hintText: loginType == 1 - ? TranslationBase.of(context).nationalID - : TranslationBase.of(context).fileNo, + prefixIcon: Icon(loginType == 1 ? Icons.chrome_reader_mode : Icons.receipt, color: Color(0xFF40ACC9)), + padding: EdgeInsets.only(top: 20, bottom: 20, left: 10, right: 10), + hintText: loginType == 1 ? TranslationBase.of(context).nationalID : TranslationBase.of(context).fileNo, ))) ], ), @@ -133,9 +124,7 @@ class _Login extends State { child: DefaultButton( TranslationBase.of(context).login, () => {this.startLogin()}, - color: isButtonDisabled == true - ? Colors.grey - : Colors.grey[900], + color: isButtonDisabled == true ? Colors.grey : Colors.grey[900], textColor: Colors.white, )) ], @@ -156,8 +145,7 @@ class _Login extends State { } void validateForm() { - if (util.validateIDBox(nationalIDorFile.text, loginType) == true && - util.isSAUDIIDValid(nationalIDorFile.text, loginType) == true) { + if (util.validateIDBox(nationalIDorFile.text, loginType) == true && util.isSAUDIIDValid(nationalIDorFile.text, loginType) == true) { setState(() { isButtonDisabled = false; }); @@ -242,50 +230,49 @@ class _Login extends State { this.authService.checkActivationCode(request, code).then((result) async { sharedPref.remove(FAMILY_FILE); // Register GeoZones after login - registerGeoZones(); - projectViewModel.setPrivilege(privilegeList: result); - result = CheckActivationCode.fromJson(result); - result.list.isFamily = false; - // this.sharedPref.setString(BLOOD_TYPE, result['PatientBloodType']), - this.sharedPref.setObject(USER_PROFILE, result.list); - this.sharedPref.setObject(MAIN_USER, result.list); - this.sharedPref.setObject(LOGIN_TOKEN_ID, result.logInTokenID); - this.sharedPref.setString(TOKEN, result.authenticationTokenID); - await authenticatedUserObject.getUser(getUser: true); - authenticatedUserObject.isLogin = true; - appointmentRateViewModel.isLogin = true; - projectViewModel.isLogin = true; - projectViewModel.user = authenticatedUserObject.user; - appointmentRateViewModel - .getIsLastAppointmentRatedList() - .then((value) => { - getToDoCount(), - GifLoaderDialogUtils.hideDialog(context), - if (appointmentRateViewModel.isHaveAppointmentNotRate) - { - Navigator.pushAndRemoveUntil( - context, - FadePage( - page: RateAppointmentDoctor(), - ), - (r) => false) - } - else - { - Navigator.pushAndRemoveUntil( - context, - FadePage( - page: LandingPage(), - ), - (r) => false) - } - }) - .catchError((err) { - print(err); - GifLoaderDialogUtils.hideDialog(context); - }); - - }); + registerGeoZones(); + projectViewModel.setPrivilege(privilegeList: result); + result = CheckActivationCode.fromJson(result); + result.list.isFamily = false; + // this.sharedPref.setString(BLOOD_TYPE, result['PatientBloodType']), + this.sharedPref.setObject(USER_PROFILE, result.list); + this.sharedPref.setObject(MAIN_USER, result.list); + this.sharedPref.setObject(LOGIN_TOKEN_ID, result.logInTokenID); + this.sharedPref.setString(TOKEN, result.authenticationTokenID); + await authenticatedUserObject.getUser(getUser: true); + authenticatedUserObject.isLogin = true; + appointmentRateViewModel.isLogin = true; + projectViewModel.isLogin = true; + projectViewModel.user = authenticatedUserObject.user; + appointmentRateViewModel + .getIsLastAppointmentRatedList() + .then((value) => { + getToDoCount(), + GifLoaderDialogUtils.hideDialog(context), + if (appointmentRateViewModel.isHaveAppointmentNotRate) + { + Navigator.pushAndRemoveUntil( + context, + FadePage( + page: RateAppointmentDoctor(), + ), + (r) => false) + } + else + { + Navigator.pushAndRemoveUntil( + context, + FadePage( + page: LandingPage(), + ), + (r) => false) + } + }) + .catchError((err) { + print(err); + GifLoaderDialogUtils.hideDialog(context); + }); + }); } getToDoCount() { diff --git a/lib/pages/pharmacies/product_detail.dart b/lib/pages/pharmacies/product_detail.dart index ebb7fe39..6cd3a7d1 100644 --- a/lib/pages/pharmacies/product_detail.dart +++ b/lib/pages/pharmacies/product_detail.dart @@ -2,6 +2,7 @@ import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyProduct.dart'; import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/product_detail_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/pages/login/welcome.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/material.dart'; @@ -38,7 +39,7 @@ class __ProductDetailPageState extends State { dynamic wishlistItems; void initState() { - price = 0; + price = 1; specificationData = widget.product; setState(() { customerId = userInfo(widget.product.id, widget.product); @@ -79,18 +80,12 @@ class __ProductDetailPageState extends State { alignment: Alignment.centerRight, child: languageID == 'ar' ? Text( - widget.product - .discountDescriptionn, - style: TextStyle( - fontWeight: FontWeight.bold, - fontSize: 17), + widget.product.discountDescriptionn, + style: TextStyle(fontWeight: FontWeight.bold, fontSize: 17), ) : Text( - widget.product - .discountDescription, - style: TextStyle( - fontWeight: FontWeight.bold, - fontSize: 17), + widget.product.discountDescription, + style: TextStyle(fontWeight: FontWeight.bold, fontSize: 17), ), ), ), @@ -101,8 +96,7 @@ class __ProductDetailPageState extends State { flex: 0, child: Container( child: Image( - image: AssetImage( - 'assets/images/offer.png'), + image: AssetImage('assets/images/offer.png'), ), ), ), @@ -180,9 +174,7 @@ class __ProductDetailPageState extends State { }, child: Text( TranslationBase.of(context).details, - style: TextStyle( - fontSize: 16, - fontWeight: FontWeight.bold), + style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold), ), color: Colors.white, ), @@ -210,9 +202,7 @@ class __ProductDetailPageState extends State { }, child: Text( TranslationBase.of(context).reviews, - style: TextStyle( - fontSize: 16, - fontWeight: FontWeight.bold), + style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold), ), color: Colors.white, ), @@ -240,9 +230,7 @@ class __ProductDetailPageState extends State { }, child: Text( TranslationBase.of(context).availability, - style: TextStyle( - fontSize: 16, - fontWeight: FontWeight.bold), + style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold), ), color: Colors.white, ), @@ -270,10 +258,7 @@ class __ProductDetailPageState extends State { Container( child: Text( TranslationBase.of(context).description, - style: TextStyle( - fontSize: 17, - color: Colors.grey, - fontWeight: FontWeight.w600), + style: TextStyle(fontSize: 17, color: Colors.grey, fontWeight: FontWeight.w600), ), ), SizedBox( @@ -281,12 +266,8 @@ class __ProductDetailPageState extends State { ), Container( child: Text( - languageID == 'ar' - ? widget.product.shortDescriptionn - : widget.product.shortDescription, - style: TextStyle( - fontSize: 16, - fontFamily: 'WorkSans-Regular'), + languageID == 'ar' ? widget.product.shortDescriptionn : widget.product.shortDescription ?? "", + style: TextStyle(fontSize: 16, fontFamily: 'WorkSans-Regular'), ), ), SizedBox( @@ -295,10 +276,7 @@ class __ProductDetailPageState extends State { Container( child: Text( TranslationBase.of(context).howToUse, - style: TextStyle( - fontSize: 17, - color: Colors.grey, - fontWeight: FontWeight.w600), + style: TextStyle(fontSize: 17, color: Colors.grey, fontWeight: FontWeight.w600), ), ), SizedBox( @@ -306,12 +284,8 @@ class __ProductDetailPageState extends State { ), Container( child: Text( - languageID == 'ar' - ? widget.product.fullDescriptionn - : widget.product.fullDescription, - style: TextStyle( - fontSize: 16, - fontFamily: 'WorkSans-Regular'), + languageID == 'ar' ? widget.product.fullDescriptionn : widget.product.fullDescription, + style: TextStyle(fontSize: 16, fontFamily: 'WorkSans-Regular'), ), ), ], @@ -319,162 +293,98 @@ class __ProductDetailPageState extends State { ) : isReviews ? BaseView( - onModelReady: (model) => - model.getProductReviewsData( - widget.product.id), - builder: (_, model, wi) => model - .productDetailService - .length != - 0 && - model.productDetailService[0] - .reviews.length != - 0 - ? ListView.builder( - physics: ScrollPhysics(), - itemCount: model - .productDetailService[0] - .reviews - .length, - scrollDirection: Axis.vertical, - shrinkWrap: true, - itemBuilder: (BuildContext context, - int index) { - return Padding( - padding: EdgeInsets.all(8.0), - child: Column( - mainAxisAlignment: - MainAxisAlignment.start, - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Container( - child: Row( - children: [ - Container( - child: Text( - model - .productDetailService[ - 0] - .reviews[ - index] - .customerId - .toString(), - style: TextStyle( - fontSize: 17, - color: Colors - .grey, - fontWeight: - FontWeight - .w600), - ), + onModelReady: (model) => model.getProductReviewsData(widget.product.id), + builder: (_, model, wi) => + model.productDetailService.length != 0 && model.productDetailService[0].reviews.length != 0 + ? ListView.builder( + physics: ScrollPhysics(), + itemCount: model.productDetailService[0].reviews.length, + scrollDirection: Axis.vertical, + shrinkWrap: true, + itemBuilder: (BuildContext context, int index) { + return Padding( + padding: EdgeInsets.all(8.0), + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + child: Row( + children: [ + Container( + child: Text( + model.productDetailService[0].reviews[index].customerId.toString(), + style: TextStyle(fontSize: 17, color: Colors.grey, fontWeight: FontWeight.w600), + ), + ), + Container( + margin: EdgeInsets.only(left: 210), + child: RatingBar.readOnly( + initialRating: model.productDetailService[0].reviews[index].rating.toDouble(), + size: 15.0, + filledColor: Colors.yellow[700], + emptyColor: Colors.grey[500], + isHalfAllowed: true, + halfFilledIcon: Icons.star_half, + filledIcon: Icons.star, + emptyIcon: Icons.star, + ), + ), + ], ), - Container( - margin: - EdgeInsets.only( - left: 210), - child: RatingBar - .readOnly( - initialRating: model - .productDetailService[ - 0] - .reviews[ - index] - .rating - .toDouble(), - size: 15.0, - filledColor: - Colors.yellow[ - 700], - emptyColor: Colors - .grey[500], - isHalfAllowed: - true, - halfFilledIcon: - Icons - .star_half, - filledIcon: - Icons.star, - emptyIcon: - Icons.star, - ), + ), + SizedBox( + height: 10, + ), + Container( + child: Text( + model.productDetailService[0].reviews[index].reviewText, + style: TextStyle(fontSize: 20), ), - ], - ), - ), - SizedBox( - height: 10, - ), - Container( - child: Text( - model - .productDetailService[ - 0] - .reviews[index] - .reviewText, - style: TextStyle( - fontSize: 20), - ), - ), - SizedBox( - height: 50, + ), + SizedBox( + height: 50, + ), + Divider(height: 1, color: Colors.grey), + ], ), - Divider( - height: 1, - color: Colors.grey), - ], - ), - ); - }, - ) - : Container( - padding: EdgeInsets.all(15), - alignment: Alignment.center, - child: Text('No Reviews Available'), - ), + ); + }, + ) + : Container( + padding: EdgeInsets.all(15), + alignment: Alignment.center, + child: Text('No Reviews Available'), + ), ) : isAvailabilty ? BaseView( - onModelReady: (model) => - model.getProductLocationData(), - builder: (_, model, wi) => model - .productLocationService - .length == - 0 + onModelReady: (model) => model.getProductLocationData(), + builder: (_, model, wi) => model.productLocationService.length == 0 ? Container( padding: EdgeInsets.all(15), alignment: Alignment.center, - child: Text( - 'No location Available'), + child: Text('No location Available'), ) : ListView.builder( physics: ScrollPhysics(), scrollDirection: Axis.vertical, shrinkWrap: true, - itemCount: model - .productLocationService - .length, - itemBuilder: - (BuildContext context, - int index) { + itemCount: model.productLocationService.length, + itemBuilder: (BuildContext context, int index) { return Padding( - padding: - EdgeInsets.all(8.0), + padding: EdgeInsets.all(8.0), child: Column( // crossAxisAlignment: CrossAxisAlignment.start, // mainAxisAlignment: MainAxisAlignment.start, children: [ Row( // crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: - MainAxisAlignment - .start, + mainAxisAlignment: MainAxisAlignment.start, children: [ Expanded( flex: 1, - child: Image.network(model - .productLocationService[ - index] - .projectImageUrl), + child: Image.network(model.productLocationService[index].projectImageUrl), ), SizedBox( width: 10, @@ -482,48 +392,31 @@ class __ProductDetailPageState extends State { Expanded( flex: 4, child: Text( - model - .productLocationService[ - index] - .locationDescription + + model.productLocationService[index].locationDescription + "\n" + - fixingString(model - .productLocationService[ - 0] - .cityName - .toString()), - style: TextStyle( - fontSize: - 12), + fixingString(model.productLocationService[0].cityName.toString()), + style: TextStyle(fontSize: 12), ), ), Expanded( flex: 1, child: IconButton( - icon: Icon(Icons - .location_on), - color: - Colors.red, - onPressed: - () {}, + icon: Icon(Icons.location_on), + color: Colors.red, + onPressed: () {}, ), ), Expanded( flex: 1, child: IconButton( - icon: Icon(Icons - .phone), - color: - Colors.red, - onPressed: - () {}, + icon: Icon(Icons.phone), + color: Colors.red, + onPressed: () {}, ), ), ], ), - Divider( - height: 1.2, - color: Colors.grey) + Divider(height: 1.2, color: Colors.grey) ], ), ); @@ -538,12 +431,8 @@ class __ProductDetailPageState extends State { ], ), ), - bottomSheet: footerWidget( - widget.product.stockAvailability != 'Out of stock', - widget.product.orderMaximumQuantity, - widget.product.orderMinimumQuantity, - widget.product.stockQuantity, - widget.product), + bottomSheet: footerWidget(widget.product.stockAvailability != 'Out of stock', widget.product.orderMaximumQuantity, + widget.product.orderMinimumQuantity, widget.product.stockQuantity, widget.product), ) : AppScaffold( appBarTitle: 'product detail page', @@ -576,18 +465,12 @@ class __ProductDetailPageState extends State { alignment: Alignment.centerRight, child: languageID == 'ar' ? Text( - widget.product - .discountDescriptionn, - style: TextStyle( - fontWeight: FontWeight.bold, - fontSize: 17), + widget.product.discountDescriptionn, + style: TextStyle(fontWeight: FontWeight.bold, fontSize: 17), ) : Text( - widget.product - .discountDescription, - style: TextStyle( - fontWeight: FontWeight.bold, - fontSize: 17), + widget.product.discountDescription, + style: TextStyle(fontWeight: FontWeight.bold, fontSize: 17), ), ), ), @@ -598,8 +481,7 @@ class __ProductDetailPageState extends State { flex: 0, child: Container( child: Image( - image: AssetImage( - 'assets/images/offer.png'), + image: AssetImage('assets/images/offer.png'), ), ), ), @@ -669,9 +551,7 @@ class __ProductDetailPageState extends State { }, child: Text( TranslationBase.of(context).details, - style: TextStyle( - fontSize: 16, - fontWeight: FontWeight.bold), + style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold), ), color: Colors.white, ), @@ -699,9 +579,7 @@ class __ProductDetailPageState extends State { }, child: Text( TranslationBase.of(context).reviews, - style: TextStyle( - fontSize: 16, - fontWeight: FontWeight.bold), + style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold), ), color: Colors.white, ), @@ -729,9 +607,7 @@ class __ProductDetailPageState extends State { }, child: Text( TranslationBase.of(context).availability, - style: TextStyle( - fontSize: 16, - fontWeight: FontWeight.bold), + style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold), ), color: Colors.white, ), @@ -759,10 +635,7 @@ class __ProductDetailPageState extends State { Container( child: Text( TranslationBase.of(context).description, - style: TextStyle( - fontSize: 17, - color: Colors.grey, - fontWeight: FontWeight.w600), + style: TextStyle(fontSize: 17, color: Colors.grey, fontWeight: FontWeight.w600), ), ), SizedBox( @@ -770,12 +643,8 @@ class __ProductDetailPageState extends State { ), Container( child: Text( - languageID == 'ar' - ? widget.product.fullDescriptionn - : widget.product.fullDescription, - style: TextStyle( - fontSize: 16, - fontFamily: 'WorkSans-Regular'), + languageID == 'ar' ? widget.product.fullDescriptionn : widget.product.fullDescription, + style: TextStyle(fontSize: 16, fontFamily: 'WorkSans-Regular'), ), ), ], @@ -783,132 +652,79 @@ class __ProductDetailPageState extends State { ) : isReviews ? BaseView( - onModelReady: (model) => - model.getProductReviewsData( - widget.product.id), - builder: (_, model, wi) => model - .productDetailService - .length != - 0 && - model.productDetailService[0] - .reviews.length != - 0 - ? ListView.builder( - physics: ScrollPhysics(), - itemCount: model - .productDetailService[0] - .reviews - .length, - scrollDirection: Axis.vertical, - shrinkWrap: true, - itemBuilder: (BuildContext context, - int index) { - return Padding( - padding: EdgeInsets.all(8.0), - child: Column( - mainAxisAlignment: - MainAxisAlignment.start, - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Container( - child: Row( - children: [ - Container( - child: Text( - model - .productDetailService[ - 0] - .reviews[ - index] - .customerId - .toString(), - style: TextStyle( - fontSize: 17, - color: Colors - .grey, - fontWeight: - FontWeight - .w600), - ), + onModelReady: (model) => model.getProductReviewsData(widget.product.id), + builder: (_, model, wi) => + model.productDetailService.length != 0 && model.productDetailService[0].reviews.length != 0 + ? ListView.builder( + physics: ScrollPhysics(), + itemCount: model.productDetailService[0].reviews.length, + scrollDirection: Axis.vertical, + shrinkWrap: true, + itemBuilder: (BuildContext context, int index) { + return Padding( + padding: EdgeInsets.all(8.0), + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + child: Row( + children: [ + Container( + child: Text( + model.productDetailService[0].reviews[index].customerId.toString(), + style: TextStyle(fontSize: 17, color: Colors.grey, fontWeight: FontWeight.w600), + ), + ), + Container( + margin: EdgeInsets.only(left: 210), + child: RatingBar.readOnly( + initialRating: model.productDetailService[0].reviews[index].rating.toDouble(), + size: 15.0, + filledColor: Colors.yellow[700], + emptyColor: Colors.grey[500], + isHalfAllowed: true, + halfFilledIcon: Icons.star_half, + filledIcon: Icons.star, + emptyIcon: Icons.star, + ), + ), + ], ), - Container( - margin: - EdgeInsets.only( - left: 210), - child: RatingBar - .readOnly( - initialRating: model - .productDetailService[ - 0] - .reviews[ - index] - .rating - .toDouble(), - size: 15.0, - filledColor: - Colors.yellow[ - 700], - emptyColor: Colors - .grey[500], - isHalfAllowed: - true, - halfFilledIcon: - Icons - .star_half, - filledIcon: - Icons.star, - emptyIcon: - Icons.star, - ), + ), + SizedBox( + height: 10, + ), + Container( + child: Text( + model.productDetailService[0].reviews[index].reviewText, + style: TextStyle(fontSize: 20), ), - ], - ), - ), - SizedBox( - height: 10, - ), - Container( - child: Text( - model - .productDetailService[ - 0] - .reviews[index] - .reviewText, - style: TextStyle( - fontSize: 20), - ), - ), - SizedBox( - height: 50, + ), + SizedBox( + height: 50, + ), + Divider(height: 1, color: Colors.grey), + ], ), - Divider( - height: 1, - color: Colors.grey), - ], - ), - ); - }, - ) - : Container( - padding: EdgeInsets.all(15), - alignment: Alignment.center, - child: Text('No Reviews Available'), - ), + ); + }, + ) + : Container( + padding: EdgeInsets.all(15), + alignment: Alignment.center, + child: Text('No Reviews Available'), + ), ) : isAvailabilty ? BaseView( - onModelReady: (model) => - model.getProductLocationData(), - builder: (_, model, wi) => - ListView.builder( + onModelReady: (model) => model.getProductLocationData(), + builder: (_, model, wi) => ListView.builder( physics: ScrollPhysics(), scrollDirection: Axis.vertical, shrinkWrap: true, - itemCount: model - .productLocationService.length, - itemBuilder: (BuildContext context, - int index) { + itemCount: model.productLocationService.length, + itemBuilder: (BuildContext context, int index) { return Padding( padding: EdgeInsets.all(8.0), child: Column( @@ -917,15 +733,11 @@ class __ProductDetailPageState extends State { children: [ Row( // crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: - MainAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, children: [ Expanded( flex: 1, - child: Image.network(model - .productLocationService[ - index] - .projectImageUrl), + child: Image.network(model.productLocationService[index].projectImageUrl), ), SizedBox( width: 10, @@ -933,25 +745,16 @@ class __ProductDetailPageState extends State { Expanded( flex: 4, child: Text( - model - .productLocationService[ - index] - .locationDescription + + model.productLocationService[index].locationDescription + "\n" + - fixingString(model - .productLocationService[ - 0] - .cityName - .toString()), - style: TextStyle( - fontSize: 12), + fixingString(model.productLocationService[0].cityName.toString()), + style: TextStyle(fontSize: 12), ), ), Expanded( flex: 1, child: IconButton( - icon: Icon(Icons - .location_on), + icon: Icon(Icons.location_on), color: Colors.red, onPressed: () {}, ), @@ -959,17 +762,14 @@ class __ProductDetailPageState extends State { Expanded( flex: 1, child: IconButton( - icon: - Icon(Icons.phone), + icon: Icon(Icons.phone), color: Colors.red, onPressed: () {}, ), ), ], ), - Divider( - height: 1.2, - color: Colors.grey) + Divider(height: 1.2, color: Colors.grey) ], ), ); @@ -984,12 +784,8 @@ class __ProductDetailPageState extends State { ], ), ), - bottomSheet: footerWidget( - widget.product.stockAvailability != 'Out of stock', - widget.product.orderMaximumQuantity, - widget.product.orderMinimumQuantity, - widget.product.stockQuantity, - widget.product), + bottomSheet: footerWidget(widget.product.stockAvailability != 'Out of stock', widget.product.orderMaximumQuantity, + widget.product.orderMinimumQuantity, widget.product.stockQuantity, widget.product), ); } } @@ -1000,8 +796,7 @@ class footerWidget extends StatefulWidget { final int minQuantity; final int quantityLimit; final PharmacyProduct item; - footerWidget(this.isAvailble, this.maxQuantity, this.minQuantity, - this.quantityLimit, this.item); + footerWidget(this.isAvailble, this.maxQuantity, this.minQuantity, this.quantityLimit, this.item); @override _footerWidgetState createState() => _footerWidgetState(); } @@ -1031,8 +826,7 @@ class _footerWidgetState extends State { padding: const EdgeInsets.all(8.0), child: Text( TranslationBase.of(context).quantity, - style: TextStyle( - fontSize: 15, fontWeight: FontWeight.bold), + style: TextStyle(fontSize: 15, fontWeight: FontWeight.bold), ), ), // ListView( @@ -1054,9 +848,7 @@ class _footerWidgetState extends State { color: Colors.white, child: Text( '1', - style: TextStyle( - fontWeight: FontWeight.bold, - fontSize: 20), + style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20), ), ), onTap: () { @@ -1081,9 +873,7 @@ class _footerWidgetState extends State { color: Colors.white, child: Text( '2', - style: TextStyle( - fontWeight: FontWeight.bold, - fontSize: 20), + style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20), ), ), onTap: () { @@ -1108,9 +898,7 @@ class _footerWidgetState extends State { color: Colors.white, child: Text( '3', - style: TextStyle( - fontWeight: FontWeight.bold, - fontSize: 20), + style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20), ), ), onTap: () { @@ -1135,9 +923,7 @@ class _footerWidgetState extends State { color: Colors.white, child: Text( '4', - style: TextStyle( - fontWeight: FontWeight.bold, - fontSize: 20), + style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20), ), ), onTap: () { @@ -1162,9 +948,7 @@ class _footerWidgetState extends State { color: Colors.white, child: Text( '5', - style: TextStyle( - fontWeight: FontWeight.bold, - fontSize: 20), + style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20), ), ), onTap: () { @@ -1189,9 +973,7 @@ class _footerWidgetState extends State { color: Colors.white, child: Text( '6', - style: TextStyle( - fontWeight: FontWeight.bold, - fontSize: 20), + style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20), ), ), onTap: () { @@ -1216,9 +998,7 @@ class _footerWidgetState extends State { color: Colors.white, child: Text( '7', - style: TextStyle( - fontWeight: FontWeight.bold, - fontSize: 20), + style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20), ), ), onTap: () { @@ -1243,9 +1023,7 @@ class _footerWidgetState extends State { color: Colors.white, child: Text( '8', - style: TextStyle( - fontWeight: FontWeight.bold, - fontSize: 20), + style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20), ), ), onTap: () { @@ -1270,9 +1048,7 @@ class _footerWidgetState extends State { color: Colors.white, child: Text( '9', - style: TextStyle( - fontWeight: FontWeight.bold, - fontSize: 20), + style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20), ), ), onTap: () { @@ -1297,9 +1073,7 @@ class _footerWidgetState extends State { color: Colors.white, child: Text( '10', - style: TextStyle( - fontWeight: FontWeight.bold, - fontSize: 20), + style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20), ), ), onTap: () { @@ -1320,8 +1094,7 @@ class _footerWidgetState extends State { Container( width: 50.0, child: TextField( - decoration: - InputDecoration(labelText: 'quantity #'), + decoration: InputDecoration(labelText: 'quantity #'), onChanged: (text) { print(price); print(widget.quantityLimit); @@ -1400,10 +1173,7 @@ class _footerWidgetState extends State { alignment: Alignment.center, child: Text( TranslationBase.of(context).addToCart, - style: TextStyle( - color: Colors.white, - fontWeight: FontWeight.bold, - fontSize: 15), + style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold, fontSize: 15), ), ), ) @@ -1418,10 +1188,7 @@ class _footerWidgetState extends State { color: Colors.green, child: Text( TranslationBase.of(context).addToCart, - style: TextStyle( - color: Colors.white, - fontWeight: FontWeight.bold, - fontSize: 15), + style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold, fontSize: 15), ), ), ), @@ -1437,10 +1204,7 @@ class _footerWidgetState extends State { alignment: Alignment.center, child: Text( TranslationBase.of(context).buyNow, - style: TextStyle( - color: Colors.white, - fontWeight: FontWeight.bold, - fontSize: 15), + style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold, fontSize: 15), ), ), ) @@ -1450,8 +1214,7 @@ class _footerWidgetState extends State { addToCartFunction(price, widget.item.id); Navigator.push( context, - MaterialPageRoute( - builder: (context) => CartOrderPage()), + MaterialPageRoute(builder: (context) => CartOrderPage()), ); }, child: Container( @@ -1461,10 +1224,7 @@ class _footerWidgetState extends State { color: Colors.blue, child: Text( TranslationBase.of(context).buyNow, - style: TextStyle( - color: Colors.white, - fontWeight: FontWeight.bold, - fontSize: 15), + style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold, fontSize: 15), ), ), ), @@ -1505,57 +1265,57 @@ class _productNameAndPriceState extends State { widget.item.stockAvailability, style: widget.item.stockAvailability == 'Out of stock' ? TextStyle(fontWeight: FontWeight.bold, color: Colors.red) - : TextStyle( - fontWeight: FontWeight.bold, color: Colors.green), + : TextStyle(fontWeight: FontWeight.bold, color: Colors.green), ), SizedBox(width: 20), - widget.item.stockAvailability == 'Out of stock' - ? Text( - TranslationBase.of(context).notifyMe, - style: TextStyle( - color: Colors.blue, - decoration: TextDecoration.underline, - ), - ) - : Container(), - widget.item.stockAvailability == 'Out of stock' - ? Icon( - FontAwesomeIcons.bell, - color: Colors.blue, - size: 15.0, + widget.item.stockAvailability == 'Out of stock' && customerId != null + ? InkWell( + onTap: () => notifyMeWhenAvailable(context, widget.item.id), + child: Row(children: [ + Text( + TranslationBase.of(context).notifyMe, + style: TextStyle( + color: Colors.blue, + decoration: TextDecoration.underline, + ), + ), + SizedBox(width: 4), + Icon( + FontAwesomeIcons.bell, + color: Colors.blue, + size: 15.0, + ) + ]), ) - : Container(), - Container( - margin: languageID == 'ar' - ? EdgeInsets.only(right: 25) - : EdgeInsets.only(left: 25), - width: 40, - height: 40, - decoration: BoxDecoration( - color: Colors.grey, - borderRadius: BorderRadius.circular(30), - ), - child: !isInWishlit - ? IconButton( - icon: Icon(Icons.favorite_border), - color: Colors.white, - onPressed: () { - setState(() { - addToWishlistFunction(widget.item.id); - }); + : Container( + margin: languageID == 'ar' ? EdgeInsets.only(right: 25) : EdgeInsets.only(left: 25), + width: 40, + height: 40, + decoration: BoxDecoration( + color: Colors.grey, + borderRadius: BorderRadius.circular(30), + ), + child: !isInWishlit + ? IconButton( + icon: Icon(Icons.favorite_border), + color: Colors.white, + onPressed: () { + setState(() { + addToWishlistFunction(widget.item.id); + }); // MyStatelessWidget(); - }, - ) - : IconButton( - icon: Icon(Icons.favorite), - color: Colors.red, - onPressed: () { - setState(() { - deleteFromWishlistFunction(widget.item.id); - }); + }, + ) + : IconButton( + icon: Icon(Icons.favorite), + color: Colors.red, + onPressed: () { + setState(() { + deleteFromWishlistFunction(widget.item.id); + }); // MyStatelessWidget(); - }, - )), + }, + )), ], ), ), @@ -1564,12 +1324,9 @@ class _productNameAndPriceState extends State { child: Container( margin: EdgeInsets.only(left: 5), child: Align( - alignment: - languageID == 'ar' ? Alignment.topRight : Alignment.topLeft, + alignment: languageID == 'ar' ? Alignment.topRight : Alignment.topLeft, child: Text( - languageID == 'ar' - ? widget.item.fullDescriptionn - : widget.item.fullDescription, + languageID == 'ar' ? widget.item.fullDescriptionn : widget.item.fullDescription, style: TextStyle(fontWeight: FontWeight.bold, fontSize: 15), ), ), @@ -1601,9 +1358,7 @@ class _productNameAndPriceState extends State { child: Container( child: widget.item.rxMessage != null ? Text( - languageID == 'ar' - ? widget.item.rxMessagen.toString() - : widget.item.rxMessage.toString(), + languageID == 'ar' ? widget.item.rxMessagen.toString() : widget.item.rxMessage.toString(), style: TextStyle(color: Colors.red, fontSize: 10), ) : Container()), @@ -1769,9 +1524,7 @@ slideDetail() { ), color: Colors.white, ), - child: const Text('1', - textAlign: TextAlign.center, - style: TextStyle(color: Color(0xFF000000))), + child: const Text('1', textAlign: TextAlign.center, style: TextStyle(color: Color(0xFF000000))), ), ) ], @@ -1801,6 +1554,11 @@ addToCartFunction(quantity, itemID) async { await x.addToCartData(quantity, itemID); } +notifyMeWhenAvailable(context, itemId) async { + ProductDetailViewModel x = new ProductDetailViewModel(); + await x.notifyMe(customerId, itemId); +} + addToWishlistFunction(itemID) async { ProductDetailViewModel x = new ProductDetailViewModel(); isInWishlit = true; @@ -1848,13 +1606,7 @@ settingModalBottomSheet(context) { leading: new Icon(Icons.shopping_cart), title: new Text('Add to cart'), onTap: () => { - if (price > 0) - {addToCartFunction(price, itemID)} - else - { - AppToast.showErrorToast( - message: "you should add quantity") - } + if (price > 0) {addToCartFunction(price, itemID)} else {AppToast.showErrorToast(message: "you should add quantity")} }), new ListTile( leading: new Icon(Icons.favorite_border), @@ -1865,8 +1617,7 @@ settingModalBottomSheet(context) { leading: new Icon(Icons.compare), title: new Text('Compare'), onTap: () => { - Provider.of(context, listen: false) - .addItem(specificationData), + Provider.of(context, listen: false).addItem(specificationData), }, ), ], @@ -1875,13 +1626,14 @@ settingModalBottomSheet(context) { }); } -userInfo(id, product) async { +Future userInfo(id, product) async { customerId = await sharedPref.getString(PHARMACY_CUSTOMER_ID); if (customerId != null) { itemID = id; product = product; checkWishlist(); } + print("customerId:$customerId"); return customerId; // getSpecificationData(itemID); } diff --git a/lib/pages/pharmacies/screens/cart-order-page.dart b/lib/pages/pharmacies/screens/cart-order-page.dart index cca6c1df..6926f9f4 100644 --- a/lib/pages/pharmacies/screens/cart-order-page.dart +++ b/lib/pages/pharmacies/screens/cart-order-page.dart @@ -27,7 +27,7 @@ class CartOrderPage extends StatelessWidget { value: model.cartResponse, child: AppScaffold( appBarTitle: TranslationBase.of(context).shoppingCart, - isShowAppBar: true, + isShowAppBar: false, isPharmacy: true, baseViewModel: model, backgroundColor: Colors.white, diff --git a/lib/pages/pharmacies/widgets/BannerPager.dart b/lib/pages/pharmacies/widgets/BannerPager.dart index 989c7557..b088eefb 100644 --- a/lib/pages/pharmacies/widgets/BannerPager.dart +++ b/lib/pages/pharmacies/widgets/BannerPager.dart @@ -1,5 +1,7 @@ import 'package:carousel_slider/carousel_slider.dart'; import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/pharmacy_module_view_model.dart'; +import 'package:diplomaticquarterapp/pages/offers_categorise_page.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart'; @@ -39,20 +41,25 @@ class _BannerPagerState extends State { items: widget._model .getBannerImagesUrl() .mapIndexed( - (item, index) => Container( - margin: EdgeInsets.symmetric(horizontal: 1.0), - child: ClipRRect( - borderRadius: BorderRadius.all(Radius.circular(5.0)), - child: Center( - child: index == 0 - ? Image.asset( - item, - fit: BoxFit.cover, - ) - : Image.network( - item, - fit: BoxFit.cover, - ), + (item, index) => InkWell( + onTap: () { + Navigator.push(context, FadePage(page: OffersCategorisePage())); + }, + child: Container( + margin: EdgeInsets.symmetric(horizontal: 1.0), + child: ClipRRect( + borderRadius: BorderRadius.all(Radius.circular(5.0)), + child: Center( + child: index == 0 + ? Image.asset( + item, + fit: BoxFit.cover, + ) + : Image.network( + item, + fit: BoxFit.cover, + ), + ), ), ), ), diff --git a/lib/pages/pharmacy_categorise.dart b/lib/pages/pharmacy_categorise.dart index 06bba8c3..f0062a1c 100644 --- a/lib/pages/pharmacy_categorise.dart +++ b/lib/pages/pharmacy_categorise.dart @@ -29,9 +29,7 @@ class _PharmacyCategorisePageState extends State { ProjectViewModel projectViewModel = Provider.of(context); return BaseView( onModelReady: (model) => model.getCategorise(), - builder: (BuildContext context, PharmacyCategoriseViewModel model, - Widget child) => - AppScaffold( + builder: (BuildContext context, PharmacyCategoriseViewModel model, Widget child) => AppScaffold( isShowDecPage: false, baseViewModel: model, body: Column( @@ -59,9 +57,7 @@ class _PharmacyCategorisePageState extends State { child: Padding( padding: EdgeInsets.symmetric(horizontal: 10.0), child: Texts( - projectViewModel.isArabic - ? model.categorise[index].namen - : model.categorise[index].name, + projectViewModel.isArabic ? model.categorise[index].namen : model.categorise[index].name, fontWeight: FontWeight.w600, ), ), @@ -70,15 +66,14 @@ class _PharmacyCategorisePageState extends State { Navigator.push( context, MaterialPageRoute( - builder: (context) => - model.categorise[index].id != '12' - ? ParentCategorisePage( - id: model.categorise[index].id, - titleName: model.categorise[index].name, - ) - : FinalProductsPage( - id: model.categorise[index].id, - ), + builder: (context) => model.categorise[index].id != '12' + ? ParentCategorisePage( + id: model.categorise[index].id, + titleName: model.categorise[index].name, + ) + : FinalProductsPage( + id: model.categorise[index].id, + ), ), ), }, @@ -91,10 +86,7 @@ class _PharmacyCategorisePageState extends State { height: 140, child: Column( children: [ - Divider( - height: 2.0, - thickness: 1.0, - color: Colors.black12.withOpacity(0.14)), + Divider(height: 2.0, thickness: 1.0, color: Colors.black12.withOpacity(0.14)), SizedBox( height: 10.0, ), @@ -103,20 +95,21 @@ class _PharmacyCategorisePageState extends State { Expanded( child: Padding( padding: EdgeInsets.all(4.0), - child: Container( - height: 50.0, - width: 55.0, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(5.0), - color: Colors.green.shade300.withOpacity(0.34), - ), - child: Padding( - padding: EdgeInsets.symmetric(horizontal: 10.0), - child: Texts( - projectViewModel.isArabic - ? 'الاكثر مبيعا' - : 'Best Sellers', - fontWeight: FontWeight.w600, + child: InkWell( + onTap: () {}, + child: Container( + height: 50.0, + width: 55.0, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(5.0), + color: Colors.green.shade300.withOpacity(0.34), + ), + child: Padding( + padding: EdgeInsets.symmetric(horizontal: 10.0), + child: Texts( + projectViewModel.isArabic ? 'الاكثر مبيعا' : 'Best Sellers', + fontWeight: FontWeight.w600, + ), ), ), ), @@ -129,16 +122,13 @@ class _PharmacyCategorisePageState extends State { height: 50.0, width: 55.0, decoration: BoxDecoration( - color: Colors.orangeAccent.shade200 - .withOpacity(0.34), + color: Colors.orangeAccent.shade200.withOpacity(0.34), borderRadius: BorderRadius.circular(5.0), ), child: Padding( padding: EdgeInsets.symmetric(horizontal: 10.0), child: Texts( - projectViewModel.isArabic - ? 'الاكثر مشاهدة' - : 'Most Viewed', + projectViewModel.isArabic ? 'الاكثر مشاهدة' : 'Most Viewed', fontWeight: FontWeight.w600, ), ), @@ -162,9 +152,7 @@ class _PharmacyCategorisePageState extends State { child: Padding( padding: EdgeInsets.symmetric(horizontal: 10.0), child: Texts( - projectViewModel.isArabic - ? 'منتجات جديدة' - : 'New Products', + projectViewModel.isArabic ? 'منتجات جديدة' : 'New Products', fontWeight: FontWeight.w600, ), ), @@ -182,17 +170,13 @@ class _PharmacyCategorisePageState extends State { height: 50.0, width: 55.0, decoration: BoxDecoration( - color: - Colors.purple.shade200.withOpacity(0.34), + color: Colors.purple.shade200.withOpacity(0.34), borderRadius: BorderRadius.circular(5.0), ), child: Padding( - padding: - EdgeInsets.symmetric(horizontal: 10.0), + padding: EdgeInsets.symmetric(horizontal: 10.0), child: Texts( - projectViewModel.isArabic - ? 'شوهد مؤخرا' - : 'Recently Viewed', + projectViewModel.isArabic ? 'شوهد مؤخرا' : 'Recently Viewed', fontWeight: FontWeight.w600, ), ), @@ -220,7 +204,7 @@ class _PharmacyCategorisePageState extends State { /// int patientID = get from qr result String result = await BarcodeScanner.scan(); var data = json.decode(result); - if (data!=null) { + if (data != null) { var qRParkingID = data['QRParkingID']; await model.scanQr(); if (model.state == ViewState.ErrorLocal) { diff --git a/lib/services/pharmacy_services/product_detail_service.dart b/lib/services/pharmacy_services/product_detail_service.dart index 7a2947b0..b974e1b1 100644 --- a/lib/services/pharmacy_services/product_detail_service.dart +++ b/lib/services/pharmacy_services/product_detail_service.dart @@ -102,20 +102,24 @@ class ProductDetailService extends BaseService { }, body: request); } + Future notifyMe(customerId, itemID) async { + hasError = false; + await baseAppClient.get(SUBSCRIBE_PRODUCT + "SinceId=$customerId&ProductId=$itemID", onSuccess: (dynamic response, int statusCode) { + AppToast.showSuccessToast(message: 'You will be notified when product available'); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + AppToast.showErrorToast(message: 'something went wrong please try again'); + }); + } + Future addToWishlist(itemID) async { var customerId = await sharedPref.getString(PHARMACY_CUSTOMER_ID); hasError = false; Map request; request = { - "shopping_cart_item": - { - "quantity": 1, - "shopping_cart_type": "Wishlist", - "product_id": itemID, - "customer_id": customerId, - "language_id": 1 - } + "shopping_cart_item": {"quantity": 1, "shopping_cart_type": "Wishlist", "product_id": itemID, "customer_id": customerId, "language_id": 1} }; await baseAppClient.post(GET_SHOPPING_CART, onSuccess: (dynamic response, int statusCode) { From ab53ca82b18764ee2a1fcdea70dad9ccd07ca20e Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Mon, 1 Feb 2021 09:43:43 +0200 Subject: [PATCH 37/42] fix colors issues --- lib/pages/login/confirm-login.dart | 37 ++++++++-------- lib/pages/login/login.dart | 11 +++-- lib/widgets/mobile-no/mobile_no.dart | 4 +- lib/widgets/others/not_auh_page.dart | 64 +++++++++++++++++----------- 4 files changed, 68 insertions(+), 48 deletions(-) diff --git a/lib/pages/login/confirm-login.dart b/lib/pages/login/confirm-login.dart index 646158db..444ce9cd 100644 --- a/lib/pages/login/confirm-login.dart +++ b/lib/pages/login/confirm-login.dart @@ -21,6 +21,7 @@ import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/card/rounded_container.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/otp/sms-popup.dart'; import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart'; @@ -109,11 +110,11 @@ class _ConfirmLogin extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ Image.asset( - 'assets/images/DQ/dq_logo_icon.png', + 'assets/images/DQ/logo.png', height: 90, width: 90, ), - AppText( + Texts( TranslationBase.of(context).welcomeBack + ' ' + user.name, @@ -122,7 +123,7 @@ class _ConfirmLogin extends State { SizedBox( height: 20, ), - AppText( + Texts( TranslationBase.of(context).accountInfo, fontSize: SizeConfig.textMultiplier * 2.5, ), @@ -173,17 +174,17 @@ class _ConfirmLogin extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ Image.asset( - 'assets/images/DQ/dq_logo_icon.png', + 'assets/images/DQ/logo.png', height: 90, width: 90, ), this.onlySMSBox == false - ? AppText( + ? Texts( TranslationBase.of(context).verifyLoginWith, fontSize: SizeConfig.textMultiplier * 3.5, textAlign: TextAlign.left, ) - : AppText( + : Texts( TranslationBase.of(context) .verifyFingerprint2, fontSize: SizeConfig.textMultiplier * 2.5, @@ -634,7 +635,7 @@ class _ConfirmLogin extends State { return InkWell( onTap: () => {authenticateUser(4, true)}, child: RoundedContainer( - height: 140, + height: 150, borderColor: Colors.grey, showBorder: true, child: Padding( @@ -649,7 +650,7 @@ class _ConfirmLogin extends State { SizedBox( height: 20, ), - AppText( + Texts( TranslationBase.of(context).verifyWhatsApp, fontSize: SizeConfig.textMultiplier * 2, ) @@ -661,7 +662,7 @@ class _ConfirmLogin extends State { return InkWell( onTap: () => {authenticateUser(1, true)}, child: RoundedContainer( - height: 140, + height: 150, borderColor: Colors.grey, showBorder: true, child: Padding( @@ -681,7 +682,7 @@ class _ConfirmLogin extends State { : SizedBox( height: 20, ), - AppText( + Texts( TranslationBase.of(context).verifySMS, fontSize: projectViewModel.isArabic ? SizeConfig.textMultiplier * 1.8 @@ -696,7 +697,7 @@ class _ConfirmLogin extends State { return InkWell( onTap: () => {authenticateUser(2, BiometricType.fingerprint.index)}, child: RoundedContainer( - height: 140, + height: 150, backgroundColor: BiometricType.fingerprint.index == 1 ? Colors.white : Colors.white.withOpacity(.7), @@ -714,7 +715,7 @@ class _ConfirmLogin extends State { SizedBox( height: 20, ), - AppText( + Texts( TranslationBase.of(context).verifyFingerprint, fontSize: SizeConfig.textMultiplier * 2, ) @@ -726,7 +727,7 @@ class _ConfirmLogin extends State { return InkWell( onTap: () => {authenticateUser(3, BiometricType.face.index)}, child: RoundedContainer( - height: 140, + height: 150, backgroundColor: checkIfBiometricAvailable(BiometricType.face) ? Colors.white : Colors.white.withOpacity(.7), @@ -745,7 +746,7 @@ class _ConfirmLogin extends State { SizedBox( height: 20, ), - AppText( + Texts( TranslationBase.of(context).verifyFaceID, fontSize: SizeConfig.textMultiplier * 2, ) @@ -762,7 +763,7 @@ class _ConfirmLogin extends State { }) }, child: RoundedContainer( - height: 140, + height: 150, backgroundColor: BiometricType.fingerprint.index == 1 ? Colors.white : Colors.white.withOpacity(.7), @@ -774,7 +775,7 @@ class _ConfirmLogin extends State { children: [ Image.asset( 'assets/images/login/more_icon.png', - height: SizeConfig.imageSizeMultiplier * 13, + height: 45, width: SizeConfig.imageSizeMultiplier * 16, ), projectViewModel.isArabic @@ -784,9 +785,9 @@ class _ConfirmLogin extends State { : SizedBox( height: 10, ), - AppText( + Texts( TranslationBase.of(context).moreVerification, - fontSize: SizeConfig.textMultiplier * 2, + fontSize: SizeConfig.textMultiplier * 1.8, textAlign: TextAlign.center, ) ], diff --git a/lib/pages/login/login.dart b/lib/pages/login/login.dart index c2a943d2..68649db7 100644 --- a/lib/pages/login/login.dart +++ b/lib/pages/login/login.dart @@ -18,6 +18,7 @@ import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; import 'package:diplomaticquarterapp/widgets/input/text_field.dart'; import 'package:diplomaticquarterapp/widgets/mobile-no/mobile_no.dart'; @@ -29,6 +30,8 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; +import '../../Constants.dart'; + class Login extends StatefulWidget { @override _Login createState() => _Login(); @@ -82,7 +85,7 @@ class _Login extends State { children: [ Expanded( flex: 2, - child: AppText( + child: Texts( TranslationBase.of(context).enterNationalId, fontSize: SizeConfig.textMultiplier * 3.5, textAlign: TextAlign.start, @@ -92,7 +95,9 @@ class _Login extends State { child: Column( mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [ - MobileNo(onNumberChange: (value) => {mobileNo = value, validateForm()}, onCountryChange: (value) => countryCode = value), + Directionality( + textDirection: TextDirection.ltr, + child: MobileNo(onNumberChange: (value) => {mobileNo = value, validateForm()}, onCountryChange: (value) => countryCode = value)), Directionality( textDirection: TextDirection.ltr, child: Container( @@ -105,7 +110,7 @@ class _Login extends State { loginType == 1 ? Icons.chrome_reader_mode : Icons.receipt, - color: Color(0xFF40ACC9)), + color: secondaryColor), padding: EdgeInsets.only( top: 20, bottom: 20, left: 10, right: 10), hintText: loginType == 1 diff --git a/lib/widgets/mobile-no/mobile_no.dart b/lib/widgets/mobile-no/mobile_no.dart index 5b963b1f..d088586b 100644 --- a/lib/widgets/mobile-no/mobile_no.dart +++ b/lib/widgets/mobile-no/mobile_no.dart @@ -3,6 +3,8 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; +import '../../Constants.dart'; + // OWNER : Ibrahim albitar // DATE : 12-04-2020 // DESCRIPTION : Customization for Texts in app @@ -102,7 +104,7 @@ class _MobileNo extends State { flex: 1, child: Icon( Icons.phone, - color: Color(0xFF40ACC9), + color: secondaryColor, )), Expanded( flex: 1, diff --git a/lib/widgets/others/not_auh_page.dart b/lib/widgets/others/not_auh_page.dart index 4bda58a4..88f6cfde 100644 --- a/lib/widgets/others/not_auh_page.dart +++ b/lib/widgets/others/not_auh_page.dart @@ -20,17 +20,17 @@ class NotAutPage extends StatefulWidget { final List infoList; final List imagesInfo; - NotAutPage({@required this.title, @required this.description, this.infoList, this.imagesInfo}); + NotAutPage( + {@required this.title, + @required this.description, + this.infoList, + this.imagesInfo}); @override _NotAutPageState createState() => _NotAutPageState(); } class _NotAutPageState extends State { - - int _current = 0; - - @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); @@ -47,7 +47,6 @@ class _NotAutPageState extends State { bold: true, color: Color(0xff60686b), ), - SizedBox( height: 12, ), @@ -63,7 +62,7 @@ class _NotAutPageState extends State { if (widget.infoList != null) ...List.generate( widget.infoList.length, - (index) => Container( + (index) => Container( child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -76,14 +75,21 @@ class _NotAutPageState extends State { borderRadius: BorderRadius.circular(20), color: Theme.of(context).primaryColor), child: Center( - child: Texts('${index+1}',color: Colors.white,), + child: Texts( + '${index + 1}', + color: Colors.white, + ), ), ), - SizedBox(width: 6,), + SizedBox( + width: 6, + ), Expanded(child: Texts('${widget.infoList[index]}')) ], ), - SizedBox(height: 12,), + SizedBox( + height: 12, + ), ], ), ), @@ -91,34 +97,40 @@ class _NotAutPageState extends State { SizedBox( height: 22, ), - if(!projectViewModel.isInternetConnection) - Center( - child: SizedBox( - height: MediaQuery.of(context).size.height * 0.55, - width: MediaQuery.of(context).size.width * 0.50, - child: Image.asset(projectViewModel.isArabic - ? 'assets/images/Wifi-AR.png' - : 'assets/images/wifi-EN.png'), + if (!projectViewModel.isInternetConnection) + Center( + child: SizedBox( + height: MediaQuery.of(context).size.height * 0.55, + width: MediaQuery.of(context).size.width * 0.50, + child: Image.asset(projectViewModel.isArabic + ? 'assets/images/Wifi-AR.png' + : 'assets/images/wifi-EN.png'), + ), ), - ), - if(projectViewModel.isInternetConnection && widget.imagesInfo!=null) + if (projectViewModel.isInternetConnection && + widget.imagesInfo != null) CarouselSlider( items: widget.imagesInfo.map((image) { return Builder( - builder: (BuildContext context){ + builder: (BuildContext context) { return SizedBox( width: MediaQuery.of(context).size.width * 0.50, - child: image.isAsset? Image.asset(projectViewModel.isArabic ? image.imageAr : image.imageEn) : Image.network(projectViewModel.isArabic ? image.imageAr : image.imageEn)); + child: image.isAsset + ? Image.asset(projectViewModel.isArabic + ? image.imageAr + : image.imageEn) + : Image.network(projectViewModel.isArabic + ? image.imageAr + : image.imageEn)); }, ); }).toList(), options: CarouselOptions( height: MediaQuery.of(context).size.height * 0.55, - autoPlay: widget.imagesInfo.length>1, + autoPlay: widget.imagesInfo.length > 1, viewportFraction: 1.0, ), ), - SizedBox( height: 77, ), @@ -133,7 +145,7 @@ class _NotAutPageState extends State { Container( width: MediaQuery.of(context).size.width * 0.9, child: SecondaryButton( - onTap: (){ + onTap: () { loginCheck(context); }, label: TranslationBase.of(context).serviceInformationButton, @@ -145,7 +157,7 @@ class _NotAutPageState extends State { ); } - loginCheck(context) async{ + loginCheck(context) async { var data = await sharedPref.getObject(IMEI_USER_DATA); sharedPref.remove(REGISTER_DATA_FOR_LOGIIN); if (data != null) { From 3b4e7910171b3b53da48b7acb6561275f5e4ca10 Mon Sep 17 00:00:00 2001 From: Sikander Saleem Date: Mon, 1 Feb 2021 17:18:05 +0300 Subject: [PATCH 38/42] H2O feature improvement --- lib/config/localized_values.dart | 2 + .../all_habib_medical_service_page.dart | 156 ++++++++---------- .../h2o/Dialog/confirm_add_amount_dialog.dart | 26 ++- .../AlHabibMedicalService/h2o/h2o_page.dart | 62 ++++--- .../AlHabibMedicalService/h2o/month_page.dart | 39 ++++- .../AlHabibMedicalService/h2o/today_page.dart | 78 +++------ .../AlHabibMedicalService/h2o/week_page.dart | 38 ++++- .../widgets/h20_floating_action_button.dart | 66 ++++---- lib/uitl/translations_delegate_base.dart | 2 + lib/widgets/charts/app_bar_chart.dart | 36 ++-- lib/widgets/others/app_scaffold_widget.dart | 1 + 11 files changed, 256 insertions(+), 250 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 5658469e..20b81d43 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -610,6 +610,8 @@ const Map localizedValues = { "DepositorName": {"en": "Depositor Name", "ar": "اسم المودع *"}, "MobileNumber": {"en": "Mobile Number", "ar": "رقم الجوال"}, "Ok": {"en": "Ok", "ar": "حسنا"}, + "WaterConsumedInWeek": {"en": "Water consumed in a week", "ar": "معدل شرب الماء خلال الاسبوع"}, + "WaterConsumedInMonth": {"en": "Water consumed in a month", "ar": "معدل شرب الماء خلال الشهر"}, "TheVerificationCodeExpiresIn": { "en": "The Verification Code Expires In", "ar": "تنتهي صلاحية رمز التحقق في" diff --git a/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart b/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart index 3c3c18c1..dfb53471 100644 --- a/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart +++ b/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart @@ -37,6 +37,8 @@ import 'package:geolocator/geolocator.dart'; import 'package:provider/provider.dart'; import 'package:url_launcher/url_launcher.dart'; +import 'h2o/h2o_page.dart'; + class AllHabibMedicalService extends StatefulWidget { //TODO final Function goToMyProfile; @@ -56,12 +58,8 @@ class _AllHabibMedicalServiceState extends State { @override void initState() { WidgetsBinding.instance.addPostFrameCallback((timeStamp) { - locationUtils = - new LocationUtils(isShowConfirmDialog: true, context: context); - WidgetsBinding.instance.addPostFrameCallback((_) => { - Geolocator.getLastKnownPosition() - .then((value) => setLocation(value)) - }); + locationUtils = new LocationUtils(isShowConfirmDialog: true, context: context); + WidgetsBinding.instance.addPostFrameCallback((_) => {Geolocator.getLastKnownPosition().then((value) => setLocation(value))}); }); super.initState(); } @@ -100,8 +98,7 @@ class _AllHabibMedicalServiceState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ Texts( - TranslationBase.of(context) - .healthWeatherIndicators, + TranslationBase.of(context).healthWeatherIndicators, color: Colors.white, fontWeight: FontWeight.w600, ), @@ -134,11 +131,7 @@ class _AllHabibMedicalServiceState extends State { width: 60, height: 60, ), - Directionality( - textDirection: TextDirection.ltr, - child: AppText(weather, - fontSize: 22, - color: Colors.white)) + Directionality(textDirection: TextDirection.ltr, child: AppText(weather, fontSize: 22, color: Colors.white)) ], ), Texts( @@ -158,8 +151,7 @@ class _AllHabibMedicalServiceState extends State { Navigator.pop(context); widget.goToMyProfile(); }, - imageLocation: - 'assets/images/new-design/my_file_bottom_bar.png', + imageLocation: 'assets/images/new-design/my_file_bottom_bar.png', title: TranslationBase.of(context).myMedicalFile, ), ServicesContainer( @@ -181,8 +173,7 @@ class _AllHabibMedicalServiceState extends State { ), ), ), - imageLocation: - 'assets/images/new-design/booking_icon_active.png', + imageLocation: 'assets/images/new-design/booking_icon_active.png', title: TranslationBase.of(context).bookAppo, ), ServicesContainer( @@ -192,8 +183,7 @@ class _AllHabibMedicalServiceState extends State { page: PaymentService(), ), ), - imageLocation: - 'assets/images/al-habib_online_payment_service_icon.png', + imageLocation: 'assets/images/al-habib_online_payment_service_icon.png', title: TranslationBase.of(context).onlinePaymentService, ), ServicesContainer( @@ -201,8 +191,7 @@ class _AllHabibMedicalServiceState extends State { context, FadePage(), ), - imageLocation: - 'assets/images/al-habib_online_payment_service_icon.png', + imageLocation: 'assets/images/al-habib_online_payment_service_icon.png', title: TranslationBase.of(context).covid19_driveThrueTest, ), ServicesContainer( @@ -235,17 +224,13 @@ class _AllHabibMedicalServiceState extends State { page: InsuranceUpdate(), ), ), - imageLocation: - 'assets/images/medical/insurance_card_icon.png', + imageLocation: 'assets/images/medical/insurance_card_icon.png', title: TranslationBase.of(context).updateInsurance, ), ServicesContainer( onTap: () => Navigator.push( context, - FadePage( - page: authUser.patientID == null - ? EReferralIndexPage() - : EReferralPage()), + FadePage(page: authUser.patientID == null ? EReferralIndexPage() : EReferralPage()), ), imageLocation: 'assets/images/ereferral_service_icon.png', title: TranslationBase.of(context).ereferral, @@ -257,20 +242,18 @@ class _AllHabibMedicalServiceState extends State { page: MyFamily(), ), ), - imageLocation: - 'assets/images/new-design/family_menu_icon_red.png', + imageLocation: 'assets/images/new-design/family_menu_icon_red.png', title: TranslationBase.of(context).myFamily, ), - if(projectViewModel.havePrivilege(35)) - ServicesContainer( - onTap: () => Navigator.push( - context, - FadePage(page: ChildVaccinesPage()), + if (projectViewModel.havePrivilege(35)) + ServicesContainer( + onTap: () => Navigator.push( + context, + FadePage(page: ChildVaccinesPage()), + ), + imageLocation: 'assets/images/new-design/children_vaccines_icon.png', + title: TranslationBase.of(context).childVaccine, ), - imageLocation: - 'assets/images/new-design/children_vaccines_icon.png', - title: TranslationBase.of(context).childVaccine, - ), ServicesContainer( onTap: () => Navigator.push( context, @@ -278,27 +261,26 @@ class _AllHabibMedicalServiceState extends State { page: ToDo(isShowAppBar: true), ), ), - imageLocation: - 'assets/images/new-design/upcoming_icon_bottom_bar.png', + imageLocation: 'assets/images/new-design/upcoming_icon_bottom_bar.png', title: TranslationBase.of(context).todoList, ), - if(projectViewModel.havePrivilege(42)) - ServicesContainer( - onTap: () => Navigator.push( - context, - FadePage(page: SymptomInfo()), - ), - imageLocation: 'assets/images/new-design/body_icon.png', - title: TranslationBase.of(context).symptomCheckerTitle), - if(projectViewModel.havePrivilege(36)) + if (projectViewModel.havePrivilege(42)) ServicesContainer( - onTap: () => Navigator.push( - context, - FadePage(page: BloodDonationPage()), + onTap: () => Navigator.push( + context, + FadePage(page: SymptomInfo()), + ), + imageLocation: 'assets/images/new-design/body_icon.png', + title: TranslationBase.of(context).symptomCheckerTitle), + if (projectViewModel.havePrivilege(36)) + ServicesContainer( + onTap: () => Navigator.push( + context, + FadePage(page: BloodDonationPage()), + ), + imageLocation: 'assets/images/new-design/blood_icon.png', + title: TranslationBase.of(context).bloodD, ), - imageLocation: 'assets/images/new-design/blood_icon.png', - title: TranslationBase.of(context).bloodD, - ), ServicesContainer( onTap: () => Navigator.push( context, @@ -306,8 +288,7 @@ class _AllHabibMedicalServiceState extends State { page: (HealthCalculators()), ), ), - imageLocation: - 'assets/images/new-design/health_calculator_icon.png', + imageLocation: 'assets/images/new-design/health_calculator_icon.png', title: TranslationBase.of(context).calculators, ), ServicesContainer( @@ -317,30 +298,30 @@ class _AllHabibMedicalServiceState extends State { page: HealthConverter(), ), ), - imageLocation: - 'assets/images/new-design/health_convertor_icon.png', + imageLocation: 'assets/images/new-design/health_convertor_icon.png', title: TranslationBase.of(context).converters, ), - if(projectViewModel.havePrivilege(38)) - ServicesContainer( - onTap: () => Navigator.push( - context, - FadePage( - page: H2OPageIndexPage(), - ), + if (projectViewModel.havePrivilege(38)) + ServicesContainer( + onTap: () => Navigator.push(context, FadePage(page: H2OPage())), + // Navigator.push( + // context, + // FadePage( + // page: H2OPageIndexPage(), + // ), + // ), + imageLocation: 'assets/images/new-design/water_icon.png', + title: 'H2O', ), - imageLocation: 'assets/images/new-design/water_icon.png', - title: 'H2O', - ), - if(projectViewModel.havePrivilege(41)) - ServicesContainer( - onTap: () => Navigator.push( - context, - FadePage(), + if (projectViewModel.havePrivilege(41)) + ServicesContainer( + onTap: () => Navigator.push( + context, + FadePage(), + ), + imageLocation: 'assets/images/new-design/smartwatch_icon.png', + title: TranslationBase.of(context).smartWatches, ), - imageLocation: 'assets/images/new-design/smartwatch_icon.png', - title: TranslationBase.of(context).smartWatches, - ), ServicesContainer( onTap: () => Navigator.push( context, @@ -348,15 +329,12 @@ class _AllHabibMedicalServiceState extends State { page: ParkingPage(), ), ), - imageLocation: - 'assets/images/new-design/parking_system_icon.png', + imageLocation: 'assets/images/new-design/parking_system_icon.png', title: TranslationBase.of(context).parking, ), ServicesContainer( - onTap: () => launch( - "https://hmgwebservices.com/vt_mobile/html/index.html"), - imageLocation: - 'assets/images/new-design/virtual_tour_icon.png', + onTap: () => launch("https://hmgwebservices.com/vt_mobile/html/index.html"), + imageLocation: 'assets/images/new-design/virtual_tour_icon.png', title: TranslationBase.of(context).vTour, ), ServicesContainer( @@ -364,12 +342,10 @@ class _AllHabibMedicalServiceState extends State { Navigator.of(context).push(MaterialPageRoute( builder: (BuildContext context) => MyWebView( title: "HMG News", - selectedUrl: - "https://twitter.com/hashtag/مجموعة_د_سليمان_الحبيب_الطبية?src=hashtag_click&f=live", + selectedUrl: "https://twitter.com/hashtag/مجموعة_د_سليمان_الحبيب_الطبية?src=hashtag_click&f=live", ))); }, - imageLocation: - 'assets/images/new-design/twitter_dashboard_icon.png', + imageLocation: 'assets/images/new-design/twitter_dashboard_icon.png', title: TranslationBase.of(context).latestNews, ), ServicesContainer( @@ -392,8 +368,7 @@ class _AllHabibMedicalServiceState extends State { getAuthUser() async { if (await this.sharedPref.getObject(USER_PROFILE) != null) { - var data = AuthenticatedUser.fromJson( - await this.sharedPref.getObject(USER_PROFILE)); + var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); setState(() { authUser = data; }); @@ -407,8 +382,7 @@ class _AllHabibMedicalServiceState extends State { }); } else { setState(() { - weather = - data != null ? data['Temperature'].toString() + '\u2103' : '--'; + weather = data != null ? data['Temperature'].toString() + '\u2103' : '--'; }); } } diff --git a/lib/pages/AlHabibMedicalService/h2o/Dialog/confirm_add_amount_dialog.dart b/lib/pages/AlHabibMedicalService/h2o/Dialog/confirm_add_amount_dialog.dart index 90386827..9ca557af 100644 --- a/lib/pages/AlHabibMedicalService/h2o/Dialog/confirm_add_amount_dialog.dart +++ b/lib/pages/AlHabibMedicalService/h2o/Dialog/confirm_add_amount_dialog.dart @@ -12,9 +12,7 @@ class ConfirmAddAmountDialog extends StatefulWidget { final String unit; final H2OViewModel model; - - ConfirmAddAmountDialog( - {Key key, this.model,this.amount,this.unit ="ml"}); + ConfirmAddAmountDialog({Key key, this.model, this.amount, this.unit = "ml"}); @override _ConfirmAddAmountDialogState createState() => _ConfirmAddAmountDialogState(); @@ -29,10 +27,12 @@ class _ConfirmAddAmountDialogState extends State { @override Widget build(BuildContext context) { return SimpleDialog( - contentPadding: EdgeInsets.fromLTRB(28.0, 24.0, 28.0, 0.0), + contentPadding: EdgeInsets.fromLTRB(24.0, 0.0, 24.0, 8.0), + titlePadding: EdgeInsets.fromLTRB(24.0, 16.0, 24.0, 8.0), title: Center( child: Texts( "Confirm", + textAlign: TextAlign.center, color: Colors.black, ), ), @@ -43,11 +43,12 @@ class _ConfirmAddAmountDialogState extends State { Center( child: Texts( "Are you sure you want to Add ${widget.amount} ${widget.unit} ?", + textAlign: TextAlign.center, color: Colors.grey, ), ), SizedBox( - height: 5.0, + height: 16.0, ), Row( // mainAxisAlignment: MainAxisAlignment.spaceBetween, @@ -79,8 +80,8 @@ class _ConfirmAddAmountDialogState extends State { Expanded( flex: 1, child: InkWell( - onTap: () async{ - InsertUserActivityRequestModel insertUserActivityRequestModel= InsertUserActivityRequestModel(quantityIntake:widget.amount ); + onTap: () async { + InsertUserActivityRequestModel insertUserActivityRequestModel = InsertUserActivityRequestModel(quantityIntake: widget.amount); await widget.model.insertUserActivity(insertUserActivityRequestModel); Navigator.pop(context); }, @@ -88,20 +89,17 @@ class _ConfirmAddAmountDialogState extends State { padding: const EdgeInsets.all(8.0), child: Center( child: Texts( - TranslationBase.of(context).ok, - fontWeight: FontWeight.w400, - )), + TranslationBase.of(context).ok.toUpperCase(), + fontWeight: FontWeight.w400, + )), ), ), ), ], - ) + ), ], ) ], ); } } - - - diff --git a/lib/pages/AlHabibMedicalService/h2o/h2o_page.dart b/lib/pages/AlHabibMedicalService/h2o/h2o_page.dart index 8ac7b437..89e4b774 100644 --- a/lib/pages/AlHabibMedicalService/h2o/h2o_page.dart +++ b/lib/pages/AlHabibMedicalService/h2o/h2o_page.dart @@ -60,48 +60,46 @@ class _H2OPageState extends State Center( child: Container( height: 60.0, - margin: EdgeInsets.only(top: 10.0), - width: MediaQuery.of(context).size.width * 0.9, + alignment: Alignment.center, + // margin: EdgeInsets.only(top: 10.0), + // width: MediaQuery.of(context).size.width * 0.9, - child: Center( - child: TabBar( - isScrollable: false, - controller: _tabController, - indicatorWeight: 5.0, - indicatorSize: TabBarIndicatorSize.tab, - indicatorColor: Colors.red[800], - labelColor: Theme.of(context).primaryColor, - labelPadding: - EdgeInsets.only(top: 4.0, left: 10.0, right: 13.0), - unselectedLabelColor: Colors.grey[800], - tabs: [ - Container( - width: MediaQuery.of(context).size.width * 0.28, - child: Center( - child: Texts( - "Today"), - ), + child: TabBar( + isScrollable: false, + controller: _tabController, + indicatorWeight: 5.0, + indicatorSize: TabBarIndicatorSize.tab, + indicatorColor: Colors.red[800], + labelColor: Theme.of(context).primaryColor, + labelPadding: EdgeInsets.only(top: 4.0, left: 10.0, right: 13.0), + unselectedLabelColor: Colors.grey[800], + tabs: [ + Container( + width: MediaQuery.of(context).size.width * 0.28, + child: Center( + child: Texts("Today"), ), - Container( - width: MediaQuery.of(context).size.width * 0.28, - child: Center( - child: Texts("Week"), - ), + ), + Container( + width: MediaQuery.of(context).size.width * 0.28, + child: Center( + child: Texts("Week"), ), - Container( - width: MediaQuery.of(context).size.width * 0.28, - child: Center( - child: Texts("Month"), - ), + ), + Container( + width: MediaQuery.of(context).size.width * 0.28, + child: Center( + child: Texts("Month"), ), - ], - ), + ), + ], ), ), ), ], ), ), + backgroundColor: Colors.white, body: Column( children: [ Expanded( diff --git a/lib/pages/AlHabibMedicalService/h2o/month_page.dart b/lib/pages/AlHabibMedicalService/h2o/month_page.dart index f0baf34d..9b255d9e 100644 --- a/lib/pages/AlHabibMedicalService/h2o/month_page.dart +++ b/lib/pages/AlHabibMedicalService/h2o/month_page.dart @@ -1,11 +1,13 @@ import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/H2O_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/charts/app_bar_chart.dart'; import 'package:diplomaticquarterapp/widgets/errors/app_embedded_error.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/progress_indicator/app_circular_progress_Indeicator.dart'; import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; class MonthPage extends StatelessWidget { @override @@ -15,11 +17,38 @@ class MonthPage extends StatelessWidget { builder: (_, model, widget) => AppScaffold( isShowAppBar: false, appBarTitle: "Water Tracker", - baseViewModel:model , - body: SingleChildScrollView( - padding: EdgeInsets.symmetric(vertical: 12), - child: AppBarChart( - seriesList: model.userProgressForMonthDataSeries), + baseViewModel: model, + body: Padding( + padding: EdgeInsets.all(8.0), + child: ListView( + children: [ + Center( + child: Text( + TranslationBase.of(context).waterConsumedInMonth, + textAlign: TextAlign.center, + style: TextStyle(fontSize: 20.0, color: Colors.black87), + ), + ), + SizedBox(height: 16), + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Container( + height: 10, + width: 40, + color: Colors.blue, + ), + SizedBox(width: 8), + Text( + TranslationBase.of(context).waterConsumedInMonth, + style: TextStyle(fontSize: 12.0), + ), + ], + ), + // SizedBox(height: 8), + AppBarChart(seriesList: model.userProgressForMonthDataSeries), + ], + ), ), ), ); diff --git a/lib/pages/AlHabibMedicalService/h2o/today_page.dart b/lib/pages/AlHabibMedicalService/h2o/today_page.dart index b92efc9e..8aacf15c 100644 --- a/lib/pages/AlHabibMedicalService/h2o/today_page.dart +++ b/lib/pages/AlHabibMedicalService/h2o/today_page.dart @@ -36,27 +36,21 @@ class TodayPage extends StatelessWidget { //, center: Center( child: Column( + mainAxisSize: MainAxisSize.min, children: [ - SizedBox( - height: 40, - ), + // SizedBox( + // height: 40, + // ), Text( "Consumed", - style: TextStyle(fontSize: 20.0), + style: TextStyle(fontSize: 16.0), ), SizedBox( height: 4, ), Text( - model.userProgressData == null - ? "0.0" - : model.userProgressData.quantityConsumed - .toString() + - 'ml', - style: TextStyle( - fontWeight: FontWeight.bold, - fontSize: 20.0, - color: HexColor("#60BCF9")), + model.userProgressData == null ? "0.0" : model.userProgressData.quantityConsumed.toString() + 'ml', + style: TextStyle(fontWeight: FontWeight.bold, fontSize: 14.0, color: HexColor("#60BCF9")), ), SizedBox( height: 4, @@ -71,7 +65,7 @@ class TodayPage extends StatelessWidget { ), Text( "Remaining", - style: TextStyle(fontSize: 20.0), + style: TextStyle(fontSize: 16.0), ), SizedBox( height: 4, @@ -79,18 +73,10 @@ class TodayPage extends StatelessWidget { Text( model.userProgressData == null ? "0.0" - : (model.userProgressData.quantityLimit - - model.userProgressData - .quantityConsumed) < - 0 + : (model.userProgressData.quantityLimit - model.userProgressData.quantityConsumed) < 0 ? "0 ml" - : (model.userProgressData.quantityLimit - - model.userProgressData - .quantityConsumed) - .toString() + - ' ml', - style: TextStyle( - fontWeight: FontWeight.bold, fontSize: 18.0), + : (model.userProgressData.quantityLimit - model.userProgressData.quantityConsumed).toString() + ' ml', + style: TextStyle(fontWeight: FontWeight.bold, fontSize: 14.0), ), ], ), @@ -104,42 +90,32 @@ class TodayPage extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.spaceAround, children: [ Column( - crossAxisAlignment: CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.center, children: [ - Center( - child: Container( - margin: EdgeInsets.only(left: 20), - height: 30, - width: 70, - decoration: BoxDecoration( - color: HexColor("#D1E3F6"), - borderRadius: - BorderRadius.all(Radius.circular(30))), - ), + Container( + margin: EdgeInsets.only(bottom: 16), + height: 30, + width: 70, + decoration: BoxDecoration(color: HexColor("#D1E3F6"), borderRadius: BorderRadius.all(Radius.circular(30))), ), Text( - "Remaining % ", - style: TextStyle(fontSize: 20.0), + "Remaining %", + style: TextStyle(fontSize: 16.0), ) ], ), Column( - crossAxisAlignment: CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.center, children: [ - Center( - child: Container( - margin: EdgeInsets.only(left: 20), - height: 30, - width: 70, - decoration: BoxDecoration( - color: HexColor("#60BCF9"), - borderRadius: - BorderRadius.all(Radius.circular(30))), - ), + Container( + margin: EdgeInsets.only(bottom: 16), + height: 30, + width: 70, + decoration: BoxDecoration(color: HexColor("#60BCF9"), borderRadius: BorderRadius.all(Radius.circular(30))), ), Text( - "Consumed % ", - style: TextStyle(fontSize: 20.0), + "Consumed %", + style: TextStyle(fontSize: 16.0), ) ], ) diff --git a/lib/pages/AlHabibMedicalService/h2o/week_page.dart b/lib/pages/AlHabibMedicalService/h2o/week_page.dart index e42eb19b..a9131199 100644 --- a/lib/pages/AlHabibMedicalService/h2o/week_page.dart +++ b/lib/pages/AlHabibMedicalService/h2o/week_page.dart @@ -1,6 +1,7 @@ import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/H2O_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/charts/app_bar_chart.dart'; import 'package:diplomaticquarterapp/widgets/errors/app_embedded_error.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; @@ -17,14 +18,39 @@ class WeekPage extends StatelessWidget { isShowAppBar: false, appBarTitle: "Water Tracker", baseViewModel: model, - body: SingleChildScrollView( - padding: EdgeInsets.symmetric(vertical: 12), - child: AppBarChart(seriesList: model.userProgressForWeekDataSeries), + body: Padding( + padding: EdgeInsets.all(8.0), + child: ListView( + children: [ + Center( + child: Text( + TranslationBase.of(context).waterConsumedInWeek, + textAlign: TextAlign.center, + style: TextStyle(fontSize: 20.0, color: Colors.black87), + ), + ), + SizedBox(height: 16), + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Container( + height: 10, + width: 40, + color: Colors.blue, + ), + SizedBox(width: 8), + Text( + TranslationBase.of(context).waterConsumedInWeek, + style: TextStyle(fontSize: 12.0), + ), + ], + ), + // SizedBox(height: 8), + AppBarChart(seriesList: model.userProgressForWeekDataSeries), + ], + ), ), ), ); } } - - - diff --git a/lib/pages/AlHabibMedicalService/h2o/widgets/h20_floating_action_button.dart b/lib/pages/AlHabibMedicalService/h2o/widgets/h20_floating_action_button.dart index 7eaed1a8..bc19e6e9 100644 --- a/lib/pages/AlHabibMedicalService/h2o/widgets/h20_floating_action_button.dart +++ b/lib/pages/AlHabibMedicalService/h2o/widgets/h20_floating_action_button.dart @@ -12,13 +12,7 @@ import 'package:flutter/material.dart'; import '../add_custom_amount.dart'; class H20FloatingActionButton extends StatefulWidget { - const H20FloatingActionButton({ - Key key, - @required AnimationController controller, - @required this.model - - }) : - super(key: key); + const H20FloatingActionButton({Key key, @required AnimationController controller, @required this.model}) : super(key: key); final H2OViewModel model; @@ -26,7 +20,7 @@ class H20FloatingActionButton extends StatefulWidget { _H20FloatingActionButtonState createState() => _H20FloatingActionButtonState(); } -class _H20FloatingActionButtonState extends State with TickerProviderStateMixin { +class _H20FloatingActionButtonState extends State with TickerProviderStateMixin { AnimationController _controller; @override void initState() { @@ -39,9 +33,13 @@ class _H20FloatingActionButtonState extends State with @override Widget build(BuildContext context) { - void showConfirmMessage(int amount, H2OViewModel model) { - showDialog(context: context, child: ConfirmAddAmountDialog(model: model,amount:amount,)); + showDialog( + context: context, + child: ConfirmAddAmountDialog( + model: model, + amount: amount, + )); } return Container( @@ -87,11 +85,9 @@ class _H20FloatingActionButtonState extends State with animation: _controller, builder: (BuildContext context, Widget child) { return new Transform( - transform: new Matrix4.rotationZ( - _controller.value * 0.5 * math.pi), + transform: new Matrix4.rotationZ(_controller.value * 0.5 * math.pi), alignment: FractionalOffset.center, - child: new Icon( - _controller.isDismissed ? Icons.add : Icons.close), + child: new Icon(_controller.isDismissed ? Icons.add : Icons.close), ); }, ), @@ -104,21 +100,21 @@ class _H20FloatingActionButtonState extends State with }, ), new Container( + margin: EdgeInsets.only(left: 8, bottom: 4), alignment: FractionalOffset.topCenter, child: new ScaleTransition( scale: new CurvedAnimation( parent: _controller, - curve: new Interval(0.0, 1.0 - 0 / 6 / 2.0, - curve: Curves.easeOut), + curve: new Interval(0.0, 1.0 - 0 / 6 / 2.0, curve: Curves.easeOut), ), child: new FloatingActionButton( backgroundColor: Colors.white, heroTag: null, - mini: true, + // mini: true, child: Text( "Custom", textAlign: TextAlign.center, - style: TextStyle(fontSize: 14.0, color: Colors.grey), + style: TextStyle(fontSize: 12, color: Colors.grey), ), onPressed: () { Navigator.push( @@ -134,21 +130,21 @@ class _H20FloatingActionButtonState extends State with ), ), new Container( + margin: EdgeInsets.only(left: 8, bottom: 4), alignment: FractionalOffset.topCenter, child: new ScaleTransition( scale: new CurvedAnimation( parent: _controller, - curve: new Interval(0.0, 1.0 - 0 / 6 / 2.0, - curve: Curves.easeOut), + curve: new Interval(0.0, 1.0 - 0 / 6 / 2.0, curve: Curves.easeOut), ), child: new FloatingActionButton( backgroundColor: Colors.white, heroTag: null, - mini: true, + //mini: true, child: Text( "Undo", textAlign: TextAlign.center, - style: TextStyle(fontSize: 14.0, color: Colors.grey), + style: TextStyle(fontSize: 12.0, color: Colors.grey), ), onPressed: () {}, ), @@ -162,11 +158,7 @@ class _H20FloatingActionButtonState extends State with } class ActionButton extends StatelessWidget { - const ActionButton( - {Key key, - @required AnimationController controller, - @required this.text, - this.onTap}) + const ActionButton({Key key, @required AnimationController controller, @required this.text, this.onTap}) : _controller = controller, super(key: key); @@ -177,6 +169,7 @@ class ActionButton extends StatelessWidget { @override Widget build(BuildContext context) { return Container( + margin: EdgeInsets.only(left: 4, bottom: 8), alignment: FractionalOffset.topCenter, child: new ScaleTransition( scale: new CurvedAnimation( @@ -184,16 +177,15 @@ class ActionButton extends StatelessWidget { curve: new Interval(0.0, 1.0 - 0 / 6 / 2.0, curve: Curves.easeOut), ), child: new FloatingActionButton( - heroTag: null, - backgroundColor: Colors.white, - mini: true, - child: Text( - text, - textAlign: TextAlign.center, - style: TextStyle(fontSize: 14.0, color: Colors.grey), - ), - onPressed: onTap - ), + heroTag: null, + backgroundColor: Colors.white, + //mini: true, + child: Text( + text, + textAlign: TextAlign.center, + style: TextStyle(fontSize: 12.0, color: Colors.grey), + ), + onPressed: onTap), ), ); } diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index 82d3d5c4..48dcb8eb 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -658,6 +658,8 @@ class TranslationBase { String get mobileNumber => localizedValues['MobileNumber'][locale.languageCode]; String get ok => localizedValues['Ok'][locale.languageCode]; + String get waterConsumedInWeek => localizedValues['WaterConsumedInWeek'][locale.languageCode]; + String get waterConsumedInMonth => localizedValues['WaterConsumedInMonth'][locale.languageCode]; String get theVerificationCodeExpiresIn => localizedValues['TheVerificationCodeExpiresIn'][locale.languageCode]; String get pleaseEnterTheVerificationCode => diff --git a/lib/widgets/charts/app_bar_chart.dart b/lib/widgets/charts/app_bar_chart.dart index 98ef3cfa..439d5ae9 100644 --- a/lib/widgets/charts/app_bar_chart.dart +++ b/lib/widgets/charts/app_bar_chart.dart @@ -13,30 +13,38 @@ class AppBarChart extends StatelessWidget { Widget build(BuildContext context) { return Container( height: 400, - margin: EdgeInsets.only(top: 60), + //margin: EdgeInsets.only(top: 60), child: charts.BarChart( seriesList, // animate: animate, + domainAxis: charts.OrdinalAxisSpec( + renderSpec: charts.GridlineRendererSpec( + labelAnchor: charts.TickLabelAnchor.after, + labelRotation: -30, + labelOffsetFromAxisPx: 30, + labelOffsetFromTickPx: 15, + labelJustification: charts.TickLabelJustification.inside, + ), + ), /// Customize the primary measure axis using a small tick renderer. /// Use String instead of num for ordinal domain axis /// (typically bar charts). primaryMeasureAxis: new charts.NumericAxisSpec( renderSpec: new charts.GridlineRendererSpec( - // Display the measure axis labels below the gridline. - // - // 'Before' & 'after' follow the axis value direction. - // Vertical axes draw 'before' below & 'after' above the tick. - // Horizontal axes draw 'before' left & 'after' right the tick. - labelAnchor: charts.TickLabelAnchor.before, + // Display the measure axis labels below the gridline. + // + // 'Before' & 'after' follow the axis value direction. + // Vertical axes draw 'before' below & 'after' above the tick. + // Horizontal axes draw 'before' left & 'after' right the tick. + labelAnchor: charts.TickLabelAnchor.before, - // Left justify the text in the axis. - // - // Note: outside means that the secondary measure axis would right - // justify. - labelJustification: - charts.TickLabelJustification.outside, - )), + // Left justify the text in the axis. + // + // Note: outside means that the secondary measure axis would right + // justify. + labelJustification: charts.TickLabelJustification.outside, + )), ), ); } diff --git a/lib/widgets/others/app_scaffold_widget.dart b/lib/widgets/others/app_scaffold_widget.dart index 3fce4b51..8103f081 100644 --- a/lib/widgets/others/app_scaffold_widget.dart +++ b/lib/widgets/others/app_scaffold_widget.dart @@ -96,6 +96,7 @@ class AppScaffold extends StatelessWidget { baseViewModel: baseViewModel, ) : body, + floatingActionButton: floatingActionButton, ); } From aef4c7bfac9ad383128918b2366fafd74a9fd58d Mon Sep 17 00:00:00 2001 From: Sikander Saleem Date: Mon, 8 Feb 2021 11:24:53 +0300 Subject: [PATCH 39/42] H2O feature improvement --- lib/config/config.dart | 3 + lib/config/localized_values.dart | 988 ++++---------- .../H2O/user_detail_model.dart | 104 ++ .../H2O/user_detail_request_model.dart | 124 ++ .../AlHabibMedicalService/H2O_service.dart | 131 +- .../AlHabibMedicalService/H2O_view_model.dart | 76 +- .../pharmacy_categorise_view_model.dart | 24 +- .../all_habib_medical_service_page.dart | 2 +- .../h2o/Dialog/confirm_add_amount_dialog.dart | 4 +- .../h2o/Dialog/select_amount_dialog.dart | 50 +- ...setting_page_radio_button_list_dialog.dart | 101 ++ .../h2o/add_custom_amount.dart | 9 +- .../AlHabibMedicalService/h2o/h2o_page.dart | 32 +- .../AlHabibMedicalService/h2o/month_page.dart | 2 +- .../AlHabibMedicalService/h2o/today_page.dart | 20 +- .../AlHabibMedicalService/h2o/week_page.dart | 2 +- .../widgets/h20_floating_action_button.dart | 40 +- lib/uitl/translations_delegate_base.dart | 1208 ++++++----------- lib/widgets/others/app_scaffold_widget.dart | 128 +- 19 files changed, 1358 insertions(+), 1690 deletions(-) create mode 100644 lib/core/model/AlHabibMedicalService/H2O/user_detail_model.dart create mode 100644 lib/core/model/AlHabibMedicalService/H2O/user_detail_request_model.dart create mode 100644 lib/pages/AlHabibMedicalService/h2o/Dialog/setting_page_radio_button_list_dialog.dart diff --git a/lib/config/config.dart b/lib/config/config.dart index 856ae36a..7a4ee764 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -306,8 +306,11 @@ const INSERT_CALL_INFO = 'Services/Doctors.svc/REST/InsertCallInfo'; const GET_PATIENT_ALLERGIES = 'Services/Patients.svc/REST/GetPatientAllergies'; // H2O +const H2O_GET_USER_DETAIL = "Services/H2ORemainder.svc/REST/H2O_GetUserDetails_New"; +const H2O_UPDATE_USER_DETAIL = "Services/H2ORemainder.svc/REST/H2O_UpdateUserDetails_New"; const H2O_GET_USER_PROGRESS = "Services/H2ORemainder.svc/REST/H2O_GetUserProgress"; const H2O_INSERT_USER_ACTIVITY = "Services/H2ORemainder.svc/REST/H2O_InsertUserActivity"; +const H2O_UNDO_USER_ACTIVITY = "Services/H2ORemainder.svc/REST/H2o_UndoUserActivity"; //E_Referral Services const GET_ALL_RELATIONSHIP_TYPES = "Services/Patients.svc/REST/GetAllRelationshipTypes"; diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 20b81d43..9ba405e7 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -2,45 +2,32 @@ // Used for Native through Platform Method Channel // --------- - -- - - - - - - - - ---------------- const Map platformLocalizedValues = { - "errorConnectingHmgNetwork": { - "en": "Sorry you are not connecting to HMG network", - "ar": "نعتذر لست متصل في شكبة مستشفى د.سليمان الحبيب" - }, + "errorConnectingHmgNetwork": {"en": "Sorry you are not connecting to HMG network", "ar": "نعتذر لست متصل في شكبة مستشفى د.سليمان الحبيب"}, "successConnectingHmgNetwork": { "en": "You connected to HMG network successfully, you can access the app", - "ar": - "تم التصال بشبكة د.سليمان الحبيب بنجاح, تستطيع الان استخدام تطبيق الحبيب" + "ar": "تم التصال بشبكة د.سليمان الحبيب بنجاح, تستطيع الان استخدام تطبيق الحبيب" }, "failedConnectingHmgNetwork": { - "en": - "Sorry the connection to HMG network had been failed, make sure you are in range of HMG network", - "ar": - "نعتذر لقد فشل الاتصال بشبكة د.سليمان الحبيب, تاكد من وجودك داخل نطاق الشبكة" + "en": "Sorry the connection to HMG network had been failed, make sure you are in range of HMG network", + "ar": "نعتذر لقد فشل الاتصال بشبكة د.سليمان الحبيب, تاكد من وجودك داخل نطاق الشبكة" }, "alreadyConnectedHmgNetwork": { "en": " You already connected to HMG network to access Alhabib app", "ar": "انت متصل مسبقاً بالشبكة تستطيع استخدام تطبيق الحبيب" }, - "somethingWentWrong": { - "en": "Sorry something went wrong please try again later", - "ar": "نعتذر لخدمتكم يرجى المحاولة لاحقا" - }, + "somethingWentWrong": {"en": "Sorry something went wrong please try again later", "ar": "نعتذر لخدمتكم يرجى المحاولة لاحقا"}, "enablingWifi": {"en": "Enabling wifi...", "ar": "Enabling wifi..."}, "connectedHmgNetworkWithInternet": { "en": "Successfully connected to the HMG network to access internet", "ar": "Successfully connected to the HMG network to access internet" }, "connectedToHmgNetworkWithNoInternet": { - "en": - "Successfully connected to the HMG network but it have no internet access", - "ar": - "Successfully connected to the HMG network but it have no internet access" + "en": "Successfully connected to the HMG network but it have no internet access", + "ar": "Successfully connected to the HMG network but it have no internet access" }, "notConnectedToHmgNetworkSecurityIssue": { - "en": - "We are not able to connect you to HMG network due to security reasons", - "ar": - "We are not able to connect you to HMG network due to security reasons" + "en": "We are not able to connect you to HMG network due to security reasons", + "ar": "We are not able to connect you to HMG network due to security reasons" } }; @@ -67,10 +54,7 @@ const Map localizedValues = { 'clinicName': {'en': 'Clinic Name', 'ar': 'اسم العيادة'}, 'doctorName': {'en': 'Doctor Name', 'ar': 'إسم الطبيب'}, 'nearestAppo': {'en': 'Nearest appointment', 'ar': 'أقرب موعد'}, - 'searchByDocText': { - 'en': 'Type the name of the doctor to help you find him', - 'ar': 'اكتب اسم الطبيب لمساعدتك في العثور عليه' - }, + 'searchByDocText': {'en': 'Type the name of the doctor to help you find him', 'ar': 'اكتب اسم الطبيب لمساعدتك في العثور عليه'}, 'enterDocName': {'en': 'Enter Doctor name', 'ar': 'أدخل إسم الطبيب'}, 'search': {'en': 'Search', 'ar': 'بحث'}, 'bookNow': {'en': 'BOOK NOW', 'ar': 'احجز الآن'}, @@ -80,17 +64,11 @@ const Map localizedValues = { 'gender': {'en': 'Gender', 'ar': 'الجنس'}, 'nationality': {'en': 'Nationality', 'ar': 'الجنسية'}, 'docQualifications': {'en': 'Doctor Qualifications', 'ar': 'مؤهلات الطبيب'}, - 'confirmAppoHeading': { - 'en': 'Kindly confirm your Appointment', - 'ar': 'يرجى تأكيد موعدك' - }, + 'confirmAppoHeading': {'en': 'Kindly confirm your Appointment', 'ar': 'يرجى تأكيد موعدك'}, 'patientInfo': {'en': 'Patient Information', 'ar': 'معلومات المريض'}, 'bookSuccess': {'en': 'Book Success', 'ar': 'تم حجز الموعد بنجاح'}, 'patientShare': {'en': 'Patient Share', 'ar': 'المبلغ المستحق'}, - 'patientShareWithTax': { - 'en': 'Patient Share with Tax', - 'ar': 'المبلغ الإجمالي المستحق' - }, + 'patientShareWithTax': {'en': 'Patient Share with Tax', 'ar': 'المبلغ الإجمالي المستحق'}, 'confirmAppo': {'en': 'Confirm Appointment', 'ar': 'تأكيد الموعد'}, 'confirm': {'en': 'Confirm', 'ar': 'تأكيد'}, 'confirmLiveCare': {'en': 'Confirm LiveCare', 'ar': 'تأكيد لايف كير'}, @@ -107,46 +85,25 @@ const Map localizedValues = { 'instruction': {'en': 'Instructions', 'ar': 'تعليمات'}, 'livecare': {'en': 'LiveCare', 'ar': 'لايف كير'}, 'livecareAppo': {'en': 'LiveCare Appointment', 'ar': 'الموعد لايف كير'}, - 'cancelAppoMsg': { - 'en': 'Are you sure you want to cancel this appointment?', - 'ar': 'هل أنت متأكد أنك تريد إلغاء هذا الموعد؟' - }, + 'cancelAppoMsg': {'en': 'Are you sure you want to cancel this appointment?', 'ar': 'هل أنت متأكد أنك تريد إلغاء هذا الموعد؟'}, - 'upcoming-noAction': { - 'en': 'No Action Required', - 'ar': 'لا يوجد إجراء مطلوب' - }, - 'upcoming-confirm': { - 'en': 'Please confirm the appointment to avoid cancellation', - 'ar': 'يرجى تأكيد الموعد لتفادي الإلغاء' - }, + 'upcoming-noAction': {'en': 'No Action Required', 'ar': 'لا يوجد إجراء مطلوب'}, + 'upcoming-confirm': {'en': 'Please confirm the appointment to avoid cancellation', 'ar': 'يرجى تأكيد الموعد لتفادي الإلغاء'}, "book-success-confirm-more-24-1-2": { - "en": - "The online payment process will be available 24 hours before the appointment.", + "en": "The online payment process will be available 24 hours before the appointment.", "ar": "- عملية الدفع الالكتروني ستكون متاحة قبل الموعد ب 24 ساعة." }, 'upcoming-payment-pending': { - 'en': - 'Online Payment will be Activated before 24 Hours of Appointment Time', + 'en': 'Online Payment will be Activated before 24 Hours of Appointment Time', 'ar': 'سيتم تفعيل خدمة الدفع الالكتروني قبل 24 ساعة من موعد الحجز' }, - 'upcoming-payment-now': { - 'en': 'Pay Online now to avoid long waiting queue', - 'ar': 'ادفع الآن لتفادي الانتظار' - }, - 'upcoming-QR': { - 'en': 'Use the QR Code to Check-In in hospital', - 'ar': 'استخدم الرمز لتسجيل الحضور في المستشفى' - }, + 'upcoming-payment-now': {'en': 'Pay Online now to avoid long waiting queue', 'ar': 'ادفع الآن لتفادي الانتظار'}, + 'upcoming-QR': {'en': 'Use the QR Code to Check-In in hospital', 'ar': 'استخدم الرمز لتسجيل الحضور في المستشفى'}, 'upcoming-virtual': { - 'en': - 'This is a virtual appointment, Please adhere to the instructions for a seamless experience.', + 'en': 'This is a virtual appointment, Please adhere to the instructions for a seamless experience.', 'ar': 'هذا موعد اتصال مرئي عن بعد ، يرجى اتباع تعليمات الخدمة.' }, - 'upcoming-livecare': { - 'en': 'This is a LiveCare appointment', - 'ar': 'هذا موعد لايف كير' - }, + 'upcoming-livecare': {'en': 'This is a LiveCare appointment', 'ar': 'هذا موعد لايف كير'}, 'upcoming-details': {'en': 'More Details', 'ar': 'المزيد'}, 'reschedule': {'en': 'Reschedule', 'ar': 'إعادة جدولة'}, 'raise': {'en': 'Raise', 'ar': 'رفع'}, @@ -163,42 +120,21 @@ const Map localizedValues = { 'loginregister': {'en': 'Login / Register', 'ar': 'تسجيل الدخول'}, 'poweredBy': {'en': 'Powered By', 'ar': 'مشغل بواسطة'}, "welcome": {"en": "Welcome", "ar": "مرحبا"}, - "welcome_text": { - "en": "Dr. Sulaiman Al Habib Mobile Application", - "ar": "الدكتور سليمان الحبيب لتطبيقات الهاتف المتحرك" - }, - 'welcome_text2': { - 'en': 'Have you visited AlHabib Medical Group before? ', - 'ar': 'هل قمت بزيارة مجموعة الحبيب الطبية من قبل؟' - }, + "welcome_text": {"en": "Dr. Sulaiman Al Habib Mobile Application", "ar": "الدكتور سليمان الحبيب لتطبيقات الهاتف المتحرك"}, + 'welcome_text2': {'en': 'Have you visited AlHabib Medical Group before? ', 'ar': 'هل قمت بزيارة مجموعة الحبيب الطبية من قبل؟'}, 'yes': {'en': 'Yes', 'ar': 'نعم'}, 'no': {'en': 'No', 'ar': 'لا'}, - "logintyperadio": { - "en": "Choose from below options to login to your medical file.", - "ar": "اختر من الخيارات أدناه لتسجيل الدخول إلى ملفك الطبي." - }, + "logintyperadio": {"en": "Choose from below options to login to your medical file.", "ar": "اختر من الخيارات أدناه لتسجيل الدخول إلى ملفك الطبي."}, "registernow": {"en": "Register Now", "ar": "تسجيل الان"}, - "nationalID": { - "en": "Enter the Identification Number", - "ar": "أدخل رقم الهوية الوطنية او الاقامة" - }, + "nationalID": {"en": "Enter the Identification Number", "ar": "أدخل رقم الهوية الوطنية او الاقامة"}, "national-id": {"en": "National ID", "ar": "رقم الهوية"}, "fileNo": {"en": "File Number", "ar": "رقم الملف"}, "fileno": {"en": "File No", "ar": "رقم الملف"}, "forgotFileNo": {"en": "Forgot file Number?", "ar": "نسيت رقم الملف الطبي؟"}, - "forgotFileNoTitle": { - "en": "Forgot medical file Number", - "ar": "نسيت رقم الملف" - }, + "forgotFileNoTitle": {"en": "Forgot medical file Number", "ar": "نسيت رقم الملف"}, - "enter-national-id": { - "en": "Please enter mobile number and identification number", - "ar": "الرجاء إدخال رقم الجوال ورقم الهوية" - }, - "profile-info": { - "en": "Please enter profile information", - "ar": "الرجاء إدخال معلومات الملف الشخصي" - }, + "enter-national-id": {"en": "Please enter mobile number and identification number", "ar": "الرجاء إدخال رقم الجوال ورقم الهوية"}, + "profile-info": {"en": "Please enter profile information", "ar": "الرجاء إدخال معلومات الملف الشخصي"}, "submit": {"en": "Submit", "ar": "ارسال"}, "forgot-desc": { "en": "Enter the mobile number to receive the Medical file Number via SMS", @@ -207,10 +143,7 @@ const Map localizedValues = { "dob": {"en": "Birth Date:", "ar": "تاريخ الميلاد"}, "hijri-date": {"en": "Hijri Date", "ar": "التاريخ الهجري"}, "gregorian-date": {"en": "Gregorian Date", "ar": "التاريخ الميلادي"}, - "verify-login-with": { - "en": "Please choose one of the following options to verify", - "ar": "الرجاء اختيار احدى الخيارات التالية للتحقق من البيانات" - }, + "verify-login-with": {"en": "Please choose one of the following options to verify", "ar": "الرجاء اختيار احدى الخيارات التالية للتحقق من البيانات"}, "register-user": {"en": "Register", "ar": "تسجيل"}, "verify-with-fingerprint": {"en": "Fingerprint", "ar": "بصمة"}, "verify-with-faceid": {"en": "Face ID", "ar": "معرف الوجه"}, @@ -219,33 +152,19 @@ const Map localizedValues = { "last-login": {"en": "LAST LOGIN AT:", "ar": "آخر تسجيل دخول"}, "last-login-with": {"en": "VERIFICATION TYPE:", "ar": "نوع التحقق:"}, "verify-fingerprint": { - "en": - "To activate the fingerprint login service, please verify data by using one of the following options.", - "ar": - "لتفعيل خدمة الدخول بالبصمة، يرجى اختيار احدى القنوات التالية للتحقق من البيانات" + "en": "To activate the fingerprint login service, please verify data by using one of the following options.", + "ar": "لتفعيل خدمة الدخول بالبصمة، يرجى اختيار احدى القنوات التالية للتحقق من البيانات" }, 'searchMedicine': {'en': 'Search Medicine', 'ar': 'البحث عن الدواء'}, 'pharmaciesList': {'en': 'Pharmacies List', 'ar': 'قائمة الصيدلايات'}, - 'searchMedicineHere': { - 'en': 'Search Medicine Here', - 'ar': 'ابحث عن الدواء هنا' - }, + 'searchMedicineHere': {'en': 'Search Medicine Here', 'ar': 'ابحث عن الدواء هنا'}, 'description': {'en': 'Description', 'ar': 'الوصف'}, 'howToUse': {'en': 'How to Use', 'ar': 'طريقة الأستخدام'}, 'price': {'en': 'Price', 'ar': 'السعر'}, 'youCanFindItIn': {'en': 'You can find it in', 'ar': 'يمكنكة ان تجده في'}, - 'pleaseEnterMedicineName': { - 'en': 'Please Enter Medicine Name', - 'ar': 'الرجائ ادخال اسم الدواء' - }, - "verification_message": { - "en": "Please enter the Verification Code sent to", - "ar": "الرجاء ادخال رمز التحقق الذي تم إرساله إلى" - }, - "validation_message": { - "en": "The verification code expires in", - "ar": "تنتهي صلاحية رمز التحقق خلال" - }, + 'pleaseEnterMedicineName': {'en': 'Please Enter Medicine Name', 'ar': 'الرجائ ادخال اسم الدواء'}, + "verification_message": {"en": "Please enter the Verification Code sent to", "ar": "الرجاء ادخال رمز التحقق الذي تم إرساله إلى"}, + "validation_message": {"en": "The verification code expires in", "ar": "تنتهي صلاحية رمز التحقق خلال"}, "arabic-change": {"en": "عربي", "ar": "English"}, "notification": {"en": "Notifications", "ar": "إشعارات"}, "app-settings": {"en": "App Settings", "ar": "إعدادات التطبيق"}, @@ -253,62 +172,32 @@ const Map localizedValues = { "before": {"en": "Before", "ar": "قبل"}, "minute": {"en": "Minutes", "ar": "دقيقة"}, "hour": {"en": "Hour", "ar": "ساعة"}, - "reminderSuccess": { - "en": "The reminder has been added successfully", - "ar": "يضاف التذكير بنجاح" - }, - "patientShareToDo": { - "en": "Amount before tax: ", - "ar": "المبلغ قبل الضريبة:" - }, + "reminderSuccess": {"en": "The reminder has been added successfully", "ar": "يضاف التذكير بنجاح"}, + "patientShareToDo": {"en": "Amount before tax: ", "ar": "المبلغ قبل الضريبة:"}, "patientTaxToDo": {"en": "Tax amount: ", "ar": "قيمة الضريبة:"}, - "patientShareTotalToDo": { - "en": "Total amount Due: ", - "ar": "المبلغ الإجمالي المستحق:" - }, + "patientShareTotalToDo": {"en": "Total amount Due: ", "ar": "المبلغ الإجمالي المستحق:"}, 'paymentMethod': {'en': 'Payment Method', 'ar': 'طريقة الدفع او السداد'}, - 'noNeedToWaitInLine': { - 'en': 'No need to stand in line.', - 'ar': 'لا داعي للوقوف في الطابور.' - }, - 'useQRAppoAttend': { - 'en': 'Use the QR code to register the appointment attendance.', - 'ar': 'استخدم الكود لتسجيل الحضور في المستشفى.' - }, + 'noNeedToWaitInLine': {'en': 'No need to stand in line.', 'ar': 'لا داعي للوقوف في الطابور.'}, + 'useQRAppoAttend': {'en': 'Use the QR code to register the appointment attendance.', 'ar': 'استخدم الكود لتسجيل الحضور في المستشفى.'}, 'passQRAppoAttend': { - 'en': - 'Pass the QR code through the attendance devices available in the Hospital.', + 'en': 'Pass the QR code through the attendance devices available in the Hospital.', 'ar': 'تمرير الكود من خلال اجهزة تسجيل الحضور المتوفرة في الفرع.' }, - 'sitWaitingQR': { - 'en': 'Sit in the waiting rooms until called by the nurse.', - 'ar': 'الجلوس في غرف الانتظار لحين منادتك من قبل الممرضة.' - }, - 'attendRegisterCode': { - 'en': 'Attendance registration code', - 'ar': 'رمز تسجيل الحضور' - }, + 'sitWaitingQR': {'en': 'Sit in the waiting rooms until called by the nurse.', 'ar': 'الجلوس في غرف الانتظار لحين منادتك من قبل الممرضة.'}, + 'attendRegisterCode': {'en': 'Attendance registration code', 'ar': 'رمز تسجيل الحضور'}, 'scanQRHospital': { 'en': 'Scan above QR Code to Check-In on the Machine in Hospital', 'ar': 'مسح فوق رمز الاستجابة السريعة للتحقق في الجهاز في المستشفى' }, "sendEmail": {"en": "Send Email", "ar": "ارسال نسخة"}, - "EmailSentSuccessfully": { - "en": "Email Sent Successfully", - "ar": "تم إرسال البريد الإلكتروني بنجاح" - }, - "EmailSentError": { - "en": "Error Sending Email", - "ar": "خطأ في إرسال البريد الإلكتروني" - }, + "success": {"en": "Done successfully", "ar": "تم تنفذ الطلب بنجاح"}, + "EmailSentSuccessfully": {"en": "Email Sent Successfully", "ar": "تم إرسال البريد الإلكتروني بنجاح"}, + "EmailSentError": {"en": "Error Sending Email", "ar": "خطأ في إرسال البريد الإلكتروني"}, "close": {"en": "Close", "ar": "مغلق"}, "booked": {"en": "Booked", "ar": "محجوز"}, "confirmed": {"en": "Confirmed", "ar": "مؤكد"}, "arrived": {"en": "Arrived", "ar": "تم الحضور"}, - "payNowBookSuccess": { - "en": "Pay now via Al Habib App", - "ar": "ادفع الآن عبر تطبيق الحبيب" - }, + "payNowBookSuccess": {"en": "Pay now via Al Habib App", "ar": "ادفع الآن عبر تطبيق الحبيب"}, "payNowBookSuccesstext1": { "en": "Pay Now using online payment service From secure payment gateways", "ar": "ادفع الآن باستخدام خدمة الدفع عبر الإنترنت من بوابات الدفع الآمنة" @@ -322,15 +211,9 @@ const Map localizedValues = { 'en': 'This service will be available for last 15 days doctor Visit only', 'ar': 'هذه الخدمة متاحة للزيارات خلال اخر 15 يوم فقط' }, - "more-verify": { - "en": "More Verification Options", - "ar": "المزيد من خيارات التحقق" - }, + "more-verify": {"en": "More Verification Options", "ar": "المزيد من خيارات التحقق"}, "welcome-back": {"en": "Welcome back!", "ar": "مرحبا بعودتك!"}, - "account-info": { - "en": "Would you like to login with current username?", - "ar": "هل ترغب في تسجيل الدخول باسم المستخدم الحالي؟" - }, + "account-info": {"en": "Would you like to login with current username?", "ar": "هل ترغب في تسجيل الدخول باسم المستخدم الحالي؟"}, "another-acc": {"en": "Use Another Account", "ar": "استخدم حسابا آخر"}, "next": {"en": "Next", "ar": 'التالى'}, "first-name": {"en": "First Name", "ar": "الاسم الأول"}, @@ -341,10 +224,7 @@ const Map localizedValues = { "preferred-language": {"en": "Preferred Language", "ar": "اللغة المفضلة"}, "english": {"en": "English", "ar": "الإنجليزية"}, "arabic": {"en": "Arabic", "ar": "العربية"}, - "locations-register": { - "en": "Where do you want to create this file?", - "ar": "أين تريد فتح هذا الملف؟" - }, + "locations-register": {"en": "Where do you want to create this file?", "ar": "أين تريد فتح هذا الملف؟"}, "ksa": {"en": "KSA", "ar": "السعودية"}, "dubai": {"en": "Dubai", "ar": "دبي"}, "enter-email": {"en": "Please Enter Email", "ar": "ادخل البريد الالكتروني"}, @@ -365,7 +245,8 @@ const Map localizedValues = { 'weight': {'en': 'Weight', 'ar': 'الوزن'}, 'height': {'en': 'Height', 'ar': 'الطول'}, 'heart': {'en': 'Heart', 'ar': 'قلب'}, - + "heightUnit": {"en": "height unit", "ar": "وحدة الطول"}, + "weightUnit": {"en": "Weight Unit", "ar": "وحدة الوزن"}, "request": {"en": "Request", "ar": "طلبات الاضافة"}, "member-name": {"en": "Member Name", "ar": "اسم العضو"}, "switch-login": {"en": "Switch User", "ar": "تغير المستخدم"}, @@ -383,10 +264,7 @@ const Map localizedValues = { "procedureStatus": {"en": "Procedure Status: ", "ar": "حالة الاجراء"}, "usageStatus": {"en": "Usage Status", "ar": "جالة الاستخدام"}, "unusedCount": {"en": "Unused Count: ", "ar": "غير مستخدم: "}, - "totalApproval": { - "en": "Total approval unused", - "ar": "اجمالي الموافقات الغير مستخدمة" - }, + "totalApproval": {"en": "Total approval unused", "ar": "اجمالي الموافقات الغير مستخدمة"}, "category": {"en": "Category: ", "ar": "الفئة"}, "expirationDate": {"en": "Expiration Date: ", "ar": "تاريخ الانتهاء"}, "patientCard": {"en": "Patient Card ID: ", "ar": "رقم الاشتراك"}, @@ -394,70 +272,35 @@ const Map localizedValues = { "seeDetails": {"en": "SEE DETAILS", "ar": "منافعك التامينية"}, "insuranceCards": {"en": "Insurance Cards", "ar": "بطاقات التأمين"}, "requestType": {"en": "Request Type", "ar": "نوع الاستفسار"}, - "register-info-family": { - "en": "How would like to add the new member?", - "ar": "كيف ترغب باضافة العضو الجديد؟" - }, - "remove-family-member": { - "en": "Remove this member?", - "ar": "إزالة ملف العضو؟" - }, + "register-info-family": {"en": "How would like to add the new member?", "ar": "كيف ترغب باضافة العضو الجديد؟"}, + "remove-family-member": {"en": "Remove this member?", "ar": "إزالة ملف العضو؟"}, "MyMedicalFile": {"en": "My Medical File", 'ar': 'ملف الطبي الالكتروني'}, - "myMedicalFileSubTitle": { - "en": "All your medical records", - 'ar': 'جميع سجلاتك الطبية' - }, + "myMedicalFileSubTitle": {"en": "All your medical records", 'ar': 'جميع سجلاتك الطبية'}, "viewMore": {"en": "View More", 'ar': 'عرض المزيد'}, - "homeHealthCareService": { - "en": "Home Health Care Service", - 'ar': 'الرعاية الصحية المنزلية' - }, + "homeHealthCareService": {"en": "Home Health Care Service", 'ar': 'الرعاية الصحية المنزلية'}, "OnlinePharmacy": {"en": "Online Pharmacy", 'ar': 'صيدليات الحبيب'}, "EmergencyService": {"en": "Emergency Service", 'ar': 'الفحص الطبي الشامل'}, - "OnlinePaymentService": { - "en": "Online Payment Service", - 'ar': 'خدمة الدفع الإلكتدوني' - }, - "OffersAndPackages": { - "en": "Online transfer request", - 'ar': 'طلب التحويل الالكتروني' - }, - "ComprehensiveMedicalCheckup": { - "en": "Comprehensive Medical Check up", - 'ar': 'فحص طبي شامل' - }, + "OnlinePaymentService": {"en": "Online Payment Service", 'ar': 'خدمة الدفع الإلكتدوني'}, + "OffersAndPackages": {"en": "Online transfer request", 'ar': 'طلب التحويل الالكتروني'}, + "ComprehensiveMedicalCheckup": {"en": "Comprehensive Medical Check up", 'ar': 'فحص طبي شامل'}, "HMGService": {"en": "HMG Service", 'ar': 'جميع خدمات الحبيب'}, - "ViewAllHabibMedicalService": { - "en": "View All Habib Medical Service", - 'ar': 'عرض خدمات الحبيب الطبية' - }, + "ViewAllHabibMedicalService": {"en": "View All Habib Medical Service", 'ar': 'عرض خدمات الحبيب الطبية'}, "viewAll": {"en": "View All", 'ar': 'عرض الكل'}, "view": {"en": "View", 'ar': 'عرض'}, "ContactUs": {"en": "Contact Us", 'ar': 'الوصول إلينا'}, - "ViewAllWaysReachUs": { - "en": "View All Ways Reach Us", - 'ar': 'جميع طرق الاتصال بنا' - }, + "ViewAllWaysReachUs": {"en": "View All Ways Reach Us", 'ar': 'جميع طرق الاتصال بنا'}, "medicalProfile": {"en": "Medical Profile", 'ar': 'الملف الطبي'}, "consultation": {"en": "Consultation", "ar": "استشارة"}, "logs": {"en": "Logs", "ar": "السجلات"}, "textToSpeech": {"en": "How May I Help You?", "ar": "كيف يمكنني مساعدتك؟"}, "locationDialogMessage": { - "en": - "Allow the HMG app to access your location will assist you in showing the hospitals according to the nearest to you.", - "ar": - "السماح لتطبيق مجموعة الحبيب الطبية بالوصول إلى موقعك سيساعدك في إظهار المستشفيات وفقًا للأقرب إليك." + "en": "Allow the HMG app to access your location will assist you in showing the hospitals according to the nearest to you.", + "ar": "السماح لتطبيق مجموعة الحبيب الطبية بالوصول إلى موقعك سيساعدك في إظهار المستشفيات وفقًا للأقرب إليك." }, - "user-view-requester": { - "en": "User Wants To View Your Medical File", - "ar": "أشخاص يرغبون الاطلاع على ملفك الطبي" - }, - "user-view": { - "en": "User Can View Your Medical File", - "ar": "أشخاص يمكنهم الاطلاع على ملفك الطبي" - }, + "user-view-requester": {"en": "User Wants To View Your Medical File", "ar": "أشخاص يرغبون الاطلاع على ملفك الطبي"}, + "user-view": {"en": "User Can View Your Medical File", "ar": "أشخاص يمكنهم الاطلاع على ملفك الطبي"}, "parking": {"en": "Parking", "ar": "مواقف"}, "alhabiServices": {"en": "HMG Service", "ar": "خدمات الحبيب"}, @@ -480,18 +323,9 @@ const Map localizedValues = { "ambulancerequest": {"en": "Ambulance :", "ar": "طلب نقل "}, "requestA": {"en": "Request:", "ar": "اسعاف"}, "MyAppointments": {"en": "Appointments", "ar": "مواعيدي"}, - "NoBookedAppointments": { - "en": "No Booked Appointments", - "ar": "لا توجد مواعيد محجوزة" - }, - "NoConfirmedAppointments": { - "en": "No Confirmed Appointments", - "ar": "لا توجد مواعيد مؤكدة" - }, - "noArrivedAppointments": { - "en": "No Arrived Appointments", - "ar": "لم تصل المواعيد" - }, + "NoBookedAppointments": {"en": "No Booked Appointments", "ar": "لا توجد مواعيد محجوزة"}, + "NoConfirmedAppointments": {"en": "No Confirmed Appointments", "ar": "لا توجد مواعيد مؤكدة"}, + "noArrivedAppointments": {"en": "No Arrived Appointments", "ar": "لم تصل المواعيد"}, "MyAppointmentsList": {"en": "List", "ar": "قائمة بمواعدي"}, "Radiology": {"en": "Radiology", "ar": "الأشعة"}, "RadiologySubtitle": {"en": "Result", "ar": "صور وتقارير"}, @@ -547,19 +381,10 @@ const Map localizedValues = { "VitalSign": {"en": "Vital Sign", "ar": "العلامة حيوية"}, "MonthlyReports": {"en": "Monthly Reports", "ar": "تقارير شهرية"}, "km": {"en": "KMs:", "ar": "كم"}, - "PatientHealthSummaryReport": { - "en": "Patient Health Summary Report", - "ar": " ملخص التقارير الشهرية" - }, - "ToViewTheTermsAndConditions": { - "en": "To View The Terms And Conditions Report", - "ar": " عرض الشروط والأحكام " - }, + "PatientHealthSummaryReport": {"en": "Patient Health Summary Report", "ar": " ملخص التقارير الشهرية"}, + "ToViewTheTermsAndConditions": {"en": "To View The Terms And Conditions Report", "ar": " عرض الشروط والأحكام "}, "ClickHere": {"en": "Click here", "ar": "أنقر هنا"}, - "IAgreeToTheTermsAndConditions": { - "en": "I agree to the terms and conditions ", - "ar": "أوافق على الشروط والاحكام " - }, + "IAgreeToTheTermsAndConditions": {"en": "I agree to the terms and conditions ", "ar": "أوافق على الشروط والاحكام "}, "IAgreeToTheTermsAndConditionsSubtitle": { "en": "I agree to the terms and conditions ", "ar": @@ -568,36 +393,23 @@ const Map localizedValues = { "Save": {"en": "Save", "ar": "حفظ "}, "UserAgreement": {"en": "User Agreement", "ar": "اتفاقية الخصوصية "}, "UpdateSuccessfully": {"en": "Update Successfully", "ar": "تم التحديث بنجاح"}, - "CHECK_VACCINE_AVAILABILITY": { - "en": "CHECK VACCINE AVAILABILITY", - "ar": "تحقق من توافر اللقاح" - }, - "MyVaccinesAvailability": { - "en": "MyVaccinesAvailability", - "ar": "توفر لقاحي" - }, + "CHECK_VACCINE_AVAILABILITY": {"en": "CHECK VACCINE AVAILABILITY", "ar": "تحقق من توافر اللقاح"}, + "MyVaccinesAvailability": {"en": "MyVaccinesAvailability", "ar": "توفر لقاحي"}, "PaymentService": {"en": "Payment Service", "ar": "خدمة المدفوعات"}, "PaymentOnline": {"en": "Service", "ar": "الالكتروني"}, "OnlineCheckIn": {"en": "Online Check-In", "ar": "مدفوعات معلقة"}, "MyBalances": {"en": "My Balances", "ar": "رصيدي"}, "BalanceAmount": {"en": "Balance Amount", "ar": "رصيدالحساب"}, "TotalBalance": {"en": "Total Balance", "ar": "الرصيد الكلي"}, - "CreateAdvancedPayment": { - "en": "Create Advanced Payment", - "ar": "إنشاء دفعة مقدمة" - }, + "CreateAdvancedPayment": {"en": "Create Advanced Payment", "ar": "إنشاء دفعة مقدمة"}, "AdvancePayment": {"en": "Advance Payment", "ar": "الدفع مقدما"}, "AdvancePaymentLabel": { - "en": - "You can create and add an Advanced Payment for you account or other accounts.", + "en": "You can create and add an Advanced Payment for you account or other accounts.", "ar": "يمكنك تحويل مبلغ لحسابك لدى المجموعة أو لحساب احد المراجعين" }, "FileNumber": {"en": "File Number", "ar": "رقم الملف"}, "Amount": {"en": "Amount *", "ar": "المبلغ *"}, - "DepositorEmail": { - "en": "Depositor Email *", - "ar": "البريد الإلكتروني للمودع *" - }, + "DepositorEmail": {"en": "Depositor Email *", "ar": "البريد الإلكتروني للمودع *"}, "Notes": {"en": "Notes", "ar": "ملاحظات"}, "SelectPatientName": {"en": "Select Patient Name", "ar": "اختر اسم المريض"}, "SelectFamilyPatientName": {"en": "Family Members", "ar": "أفراد الأسرة"}, @@ -612,14 +424,8 @@ const Map localizedValues = { "Ok": {"en": "Ok", "ar": "حسنا"}, "WaterConsumedInWeek": {"en": "Water consumed in a week", "ar": "معدل شرب الماء خلال الاسبوع"}, "WaterConsumedInMonth": {"en": "Water consumed in a month", "ar": "معدل شرب الماء خلال الشهر"}, - "TheVerificationCodeExpiresIn": { - "en": "The Verification Code Expires In", - "ar": "تنتهي صلاحية رمز التحقق في" - }, - "PleaseEnterTheVerificationCode": { - "en": "Please enter the verification code send to", - "ar": "الرجاء إدخال رمز التحقق المرسل إلى" - }, + "TheVerificationCodeExpiresIn": {"en": "The Verification Code Expires In", "ar": "تنتهي صلاحية رمز التحقق في"}, + "PleaseEnterTheVerificationCode": {"en": "Please enter the verification code send to", "ar": "الرجاء إدخال رمز التحقق المرسل إلى"}, "EyeMeasurements": {"en": "Eye Measurements", "ar": "قياسات النظر"}, "Measurements": {"en": "Measurements", "ar": "قياسات"}, "Classes": {"en": "Classes", "ar": "نظارات"}, @@ -642,10 +448,8 @@ const Map localizedValues = { "DailyQuantity": {"en": "Daily Quantity :", "ar": "جرعات يومية"}, "AddReminder": {"en": "Add Reminder", "ar": "إضافة تذكير"}, "reminderDes": { - "en": - "Please select treatment start day and time to be notified when it\'s time to take the medicine", - "ar": - " يرجى تحديد يوم بدء العلاج والوقت ليتم ارسال تنبيه عندما يحين الوقت لتناول الدواء" + "en": "Please select treatment start day and time to be notified when it\'s time to take the medicine", + "ar": " يرجى تحديد يوم بدء العلاج والوقت ليتم ارسال تنبيه عندما يحين الوقت لتناول الدواء" }, "StartDay": {"en": "Start Day", "ar": "يوم البداية"}, "EndDay": {"en": "End Day", "ar": "يوم الانتهاء"}, @@ -655,24 +459,12 @@ const Map localizedValues = { "DoctorResponses": {"en": "Doctor Responses", "ar": "ردود الأطباء"}, "New": {"en": "New", "ar": "جديد"}, "All": {"en": "All", "ar": "الكل"}, - "QuestionHere": { - "en": "Enter the question here...", - "ar": "اضف الاستفسار هنا" - }, - "ViewDoctorResponses": { - "en": "View Doctor Responses", - "ar": "الاطلاع على ردود الأطباء" - }, + "QuestionHere": {"en": "Enter the question here...", "ar": "اضف الاستفسار هنا"}, + "ViewDoctorResponses": {"en": "View Doctor Responses", "ar": "الاطلاع على ردود الأطباء"}, "ServiceInformationButton": {"en": "LOGIN / REGISTER", "ar": "دخول / تسجيل"}, - "ServiceInformationTitle": { - "en": "Service Information", - "ar": "معلومات الخدمة" - }, + "ServiceInformationTitle": {"en": "Service Information", "ar": "معلومات الخدمة"}, "ServiceInformation": {"en": "Service Information", "ar": "معلومات الخدمة"}, - "HomeHealthCare": { - "en": "Home Health Care", - "ar": " الرعاية الصحية المنزلية " - }, + "HomeHealthCare": {"en": "Home Health Care", "ar": " الرعاية الصحية المنزلية "}, "HomeHealthCareText": { "en": "This service provides a set of home health care services, continuous and comprehensive follow-up in their places of residence for those who cannot access health facilities, such as (laboratory analyzes - radiology - vaccinations - physical therapy), etc.", @@ -684,14 +476,11 @@ const Map localizedValues = { "info-lab": { "en": "This service allows you to view the results of all laboratory tests performed in Al Habib Medical Group as well as sending the report via e-mail.", - "ar": - "خدمة نتائج المختبر: هذه الخدمة تمكنك من الاطلاع على نتائج جميع الفحوصات المخبرية التي تمت في مجموعة الحبيب الطبية." + "ar": "خدمة نتائج المختبر: هذه الخدمة تمكنك من الاطلاع على نتائج جميع الفحوصات المخبرية التي تمت في مجموعة الحبيب الطبية." }, "info-radiology": { - "en": - "This service allows you to view the reports and photos of radiology in Al Habib Medical Group as well as send the report by e-mail.", - "ar": - "خدمة الاشعة: هذه الخدمة تمكنك من الاطلاع على تقارير وصور الاشعة التي تمت في مجموعة الحبيب الطبية وكذلك ارسال التقرير عن طريق الايميل." + "en": "This service allows you to view the reports and photos of radiology in Al Habib Medical Group as well as send the report by e-mail.", + "ar": "خدمة الاشعة: هذه الخدمة تمكنك من الاطلاع على تقارير وصور الاشعة التي تمت في مجموعة الحبيب الطبية وكذلك ارسال التقرير عن طريق الايميل." }, "orders": {"en": "Orders", "ar": "الطلبات"}, "lakum": {"en": "Lakum", "ar": "لكم"}, @@ -710,6 +499,7 @@ const Map localizedValues = { "order": {"en": "My Order", "ar": " طلباتي"}, "delivered": {"en": "Delivered", "ar": " تم التوصيل"}, "pending": {"en": "Pending", "ar": " معلقة "}, + "enterNameHere": {"en": "Enter the name here", "ar": " أدخل الاسم هنا "}, "processing": {"en": "Processing", "ar": " تحت المعالجة"}, "cancelled": {"en": "Cancelled", "ar": " ملغي"}, "writeReview": {"en": "Write Review", "ar": " اكتب تقييمك"}, @@ -724,19 +514,10 @@ const Map localizedValues = { "recommended": {"en": " Recommended For You", "ar": "موصى لك"}, "myPrescription": {"en": " My Prescriptions", "ar": "وصفاتي"}, "quantity": {"en": " QTY ", "ar": "الكمية"}, - "backMyAccount": { - "en": "BACK TO MY ACCOUNT ", - "ar": " الرجوع لحسابي الشخصي" - }, + "backMyAccount": {"en": "BACK TO MY ACCOUNT ", "ar": " الرجوع لحسابي الشخصي"}, "reviewSuccessful": {"en": "Review Successful", "ar": " تقييم ناجح"}, - "reviewShared": { - "en": "Your review has been shared on product review section", - "ar": " تمت مشاركة تقييمك في قسم تقييم المنتج" - }, - "reviewComment": { - "en": "Your reviews help other to choose better product", - "ar": " تقييمك سوف يساعد الأخرين في اختيار المنتج الأفضل" - }, + "reviewShared": {"en": "Your review has been shared on product review section", "ar": " تمت مشاركة تقييمك في قسم تقييم المنتج"}, + "reviewComment": {"en": "Your reviews help other to choose better product", "ar": " تقييمك سوف يساعد الأخرين في اختيار المنتج الأفضل"}, "shippedMethod": {"en": "SHIP BY:", "ar": " الشحن بواسطة:"}, "orderDetail": {"en": "Order Details", "ar": " تفاصيل الطلب"}, "orderSummary": {"en": "Order Summary", "ar": " تفاصيل المنتج"}, @@ -757,73 +538,38 @@ const Map localizedValues = { "confirmLocation": {"en": "CONFIRM LOCATION ", "ar": " تأكيد الموقع "}, "conditionsHMG": {"en": "Terms & Conditions ", "ar": "الشروط و الأحكام "}, "conditions": {"en": "Terms & Conditions of Lakum", "ar": "شروط و احكام لكم"}, - "confirmDeleteMsg": { - "en": "Are you sure! want to delete ", - "ar": "هل انت متأكد تريد الحذف " - }, + "confirmDeleteMsg": {"en": "Are you sure! want to delete ", "ar": "هل انت متأكد تريد الحذف "}, "confirmDelete": {"en": "DELETE", "ar": "حذف"}, - "confirmCancellation": { - "en": "Are you sure! want to cancel this order ", - "ar": "هل انت متأكد تريد حذف هذا المنتج " - }, + "confirmCancellation": {"en": "Are you sure! want to cancel this order ", "ar": "هل انت متأكد تريد حذف هذا المنتج "}, "orderNumber": {"en": "Order#: ", "ar": "الطلب: "}, "orderDate": {"en": "Date", "ar": "التاريخ:"}, "itemsNo": {"en": "items(s)", "ar": "عناصر"}, "noOrder": {"en": "You Don't have any orders.", "ar": "ليس لديك طلبات"}, "TermsService": {"en": "Terms of Service", "ar": "شروط الخدمه"}, - "Beforeusing": { - "en": "Before using the checkup, please read Terms of Service.", - "ar": "قبل استخدام الفحص ، يرجى قراءة شروط الخدمة" - }, - "accept": { - "en": "I read and accept Terms of Service and Privacy Policy", - "ar": "قرأت ووافقت على شروط الخدمة وسياسة الخصوصية" - }, + "Beforeusing": {"en": "Before using the checkup, please read Terms of Service.", "ar": "قبل استخدام الفحص ، يرجى قراءة شروط الخدمة"}, + "accept": {"en": "I read and accept Terms of Service and Privacy Policy", "ar": "قرأت ووافقت على شروط الخدمة وسياسة الخصوصية"}, "data-safe-info": { - "en": - "Information that you provide is anonymous and not shared with anyone.", + "en": "Information that you provide is anonymous and not shared with anyone.", "ar": "المعلومات التي تقدمها لا تتم مشاركتها مع أي شخص" }, "data-safe": {"en": " Your data is safe.", "ar": "بياناتك آمنة"}, "informational": { - "en": - "Checkup is for informational purposes and is not a qualified medical opinion", + "en": "Checkup is for informational purposes and is not a qualified medical opinion", "ar": "الفحص هو لأغراض معلوماتية وليس رأي طبي مؤهل" }, - "not-use-in-emerbency": { - "en": "Do not use in emergencies.", - "ar": "لا تستخدم في حالات الطوارئ" - }, - "not-use-in-emerbency-details": { - "en": "In case of health emergency, ", - "ar": "في حالة الطوارئ اتصل بأقرب رقم للطوارئ على الفور" - }, - "not-use-in-emerbency-details-call": { - "en": "call the nearest emergency number immediately", - "ar": " اتصل بأقرب رقم للطوارئ على الفور" - }, - "check-diagnosis": { - "en": "Checkup is not a diagnosis.", - "ar": "الفحص ليس تشخيص." - }, + "not-use-in-emerbency": {"en": "Do not use in emergencies.", "ar": "لا تستخدم في حالات الطوارئ"}, + "not-use-in-emerbency-details": {"en": "In case of health emergency, ", "ar": "في حالة الطوارئ اتصل بأقرب رقم للطوارئ على الفور"}, + "not-use-in-emerbency-details-call": {"en": "call the nearest emergency number immediately", "ar": " اتصل بأقرب رقم للطوارئ على الفور"}, + "check-diagnosis": {"en": "Checkup is not a diagnosis.", "ar": "الفحص ليس تشخيص."}, "remeberthat": {"en": "Remember that", "ar": "تذكر ذلك:"}, - "loginToUseService": { - "en": "You need to login to use this service", - "ar": "هذة الخدمة تتطلب تسجيل الدخول" - }, + "loginToUseService": {"en": "You need to login to use this service", "ar": "هذة الخدمة تتطلب تسجيل الدخول"}, // pharmacy module "medicationRefill": {"en": "MEDICATION REFILL", "ar": "إعادة تعبئة الدواء"}, - "offersAndPromotions": { - "en": "OFFERS & SPECIAL PROMOTIONS", - "ar": "العروض والترقيات الخاصة" - }, + "offersAndPromotions": {"en": "OFFERS & SPECIAL PROMOTIONS", "ar": "العروض والترقيات الخاصة"}, "myPrescriptions": {"en": "MY PRESCRIPTIONS", "ar": "وصفاتي"}, - "searchAndScanMedication": { - "en": "SEARCH & SCAN FOR MEDICATION", - "ar": "البحث والمسح للأدوية" - }, + "searchAndScanMedication": {"en": "SEARCH & SCAN FOR MEDICATION", "ar": "البحث والمسح للأدوية"}, "shopByBrands": {"en": "Shop By Brands", "ar": "تسوق حسب الماركات"}, "recentlyViewed": {"en": "Recently Viewed", "ar": "شوهدت مؤخرا"}, "bestSellers": {"en": "Best Sellers", "ar": "أفضل البائعين"}, @@ -832,10 +578,7 @@ const Map localizedValues = { "selectAddress": {"en": "Select Address", "ar": "حدد العنوان"}, "shippingAddress": {"en": "SHIPPING ADDRESS", "ar": "عنوان الشحن"}, "changeAddress": {"en": "Change Address", "ar": "تغيير العنوان"}, - "selectPaymentOption": { - "en": "Select Payment Option", - "ar": "حدد خيار الدفع" - }, + "selectPaymentOption": {"en": "Select Payment Option", "ar": "حدد خيار الدفع"}, "changeMethod": {"en": "Change Method", "ar": "تغيير خيار الدفع"}, "reviewOrder": {"en": "Review Order", "ar": "مراجعة الطلب"}, "active": {"en": "ACTIVE", "ar": "فعال"}, @@ -853,24 +596,17 @@ const Map localizedValues = { "select-age": {"en": "Select Your Age", "ar": "حدد العمر"}, "i-am": {"en": "I am", "ar": "أنا"}, "years-old": {"en": "years old", "ar": "سنة"}, - "drag-point": { - "en": "Drag point to change your age", - "ar": "اسحب لتغيير عمرك" - }, + "drag-point": {"en": "Drag point to change your age", "ar": "اسحب لتغيير عمرك"}, "categorise": {"en": "Categories", "ar": "التطبيقات"}, "wishList": {"en": "WishList", "ar": "الرغبات"}, "myAccount": {"en": "My Account", "ar": "حسابي"}, "cart": {"en": "Cart", "ar": "التسوق"}, - "searchProductHere": { - "en": "Search Product here", - "ar": "ابحث في الطلب الخاص بك" - }, + "searchProductHere": {"en": "Search Product here", "ar": "ابحث في الطلب الخاص بك"}, "HHCNotAuthMsg": { "en": "This service provides a set of home health care services, continuous and comprehensive follow-up in their places of residence for those who cannot access health facilities, such as (laboratory analyzes - radiology - vaccinations - physical therapy), etc.", - "ar": - "من خلال هذه الخدمة يمكنك طلب مجموعة من الفحوصات التي تساعدك وتساعد طبيبك في فهم حالتك الصحية الحالية ومن ثم تحديد المخاطر المحتملة" + "ar": "من خلال هذه الخدمة يمكنك طلب مجموعة من الفحوصات التي تساعدك وتساعد طبيبك في فهم حالتك الصحية الحالية ومن ثم تحديد المخاطر المحتملة" }, "email": {"en": "Email", "ar": "البريد الالكتروني"}, "Book": {"en": "Book", "ar": "احجز"}, @@ -881,10 +617,7 @@ const Map localizedValues = { "profile": {"en": "Profile", "ar": "ملفي"}, "notifications": {"en": "Notifications", "ar": "إشعارات"}, "notificationDetails": {"en": "Notification Details", "ar": "تفاصيل الاشعار"}, - "notificationDetailsa": { - "en": "Notification Details", - "ar": "تفاصيل الاشعار" - }, + "notificationDetailsa": {"en": "Notification Details", "ar": "تفاصيل الاشعار"}, "info-my-doctor-points": { "en": [ @@ -901,14 +634,11 @@ const Map localizedValues = { ] }, "info-my-doctor": { - "en": - "This service allows you to see all the doctors you have visited in Al Habib Medical Group, and through this service:", - "ar": - "خدمة اطبائي: هذه الخدمة تمكنك من الاطلاع على جميع الاطباء الذين قمت بزيارتهم في مجموعة الحبيب الطبية, كما تستطيع من خلال هذه الخدمة:" + "en": "This service allows you to see all the doctors you have visited in Al Habib Medical Group, and through this service:", + "ar": "خدمة اطبائي: هذه الخدمة تمكنك من الاطلاع على جميع الاطباء الذين قمت بزيارتهم في مجموعة الحبيب الطبية, كما تستطيع من خلال هذه الخدمة:" }, "info-prescriptions": { - "en": - "This service allows you to view all the medical prescriptions issued by Al Habib Medical Group, and through this service, you can:", + "en": "This service allows you to view all the medical prescriptions issued by Al Habib Medical Group, and through this service, you can:", "ar": "خدمة الوصفات الطبية: هذه الخدمة تمكنك من الاطلاع على جميع الوصفات الطبية التي تم اصدارها في مجموعة الحبيب الطبية، كما تستطيع من خلال هذه الخدمة:" }, @@ -934,8 +664,7 @@ const Map localizedValues = { }, "info-insurance-cards": { - "en": - "This service allows you to view all the insurance cards that recorded during your visits to Al Habib Medical Group in addition to:", + "en": "This service allows you to view all the insurance cards that recorded during your visits to Al Habib Medical Group in addition to:", "ar": "خدمة بطاقات التامين: هذه الخدمة تمكنك من الاطلاع على جميع بطاقات التامين والتي تم تسجيلها اثناء زياراتك لمجموعة الحبيب الطبية بالاضافة الى:" }, @@ -960,19 +689,15 @@ const Map localizedValues = { }, "info-allergies": { - "en": - "This service allows you to view all types of allergies recorded during your visits to Al Habib Medical Group.", - "ar": - "خدمة الحساسية: هذه الخدمة تمكنك من الاطلاع على جميع انواع الحساسية التي تم تسجيلها خلال زياراتك في مجموعة الحبيب الطبية." + "en": "This service allows you to view all types of allergies recorded during your visits to Al Habib Medical Group.", + "ar": "خدمة الحساسية: هذه الخدمة تمكنك من الاطلاع على جميع انواع الحساسية التي تم تسجيلها خلال زياراتك في مجموعة الحبيب الطبية." }, "sick-leaves": {"en": "Sick Leaves", "ar": "الاجازات المرضية"}, "info-sick-leaves": { - "en": - "This service allows you to view all sick leaves that were taken in Al Habib Medical Group in addition to:", - "ar": - "الاجازات المرضية: هذه الخدمة تمكنك من الاطلاع على جميع الاجازات المرضية والتي تم اصدارها في مجموعة الحبيب الطبية بالاضافة الى:" + "en": "This service allows you to view all sick leaves that were taken in Al Habib Medical Group in addition to:", + "ar": "الاجازات المرضية: هذه الخدمة تمكنك من الاطلاع على جميع الاجازات المرضية والتي تم اصدارها في مجموعة الحبيب الطبية بالاضافة الى:" }, "info-sick-leave-points": { "en": [ @@ -992,10 +717,8 @@ const Map localizedValues = { }, "info-approvals": { - "en": - "This service allows you to view all approvals requests that have been sent to the insurance companies in addition to:", - "ar": - "خدمة الموافقات: هذه الخدمة تمكنك من الاطلاع على جميع طلبات الموافقات والتي تم ارسالها الى شركات التامين بالاضافة الى:" + "en": "This service allows you to view all approvals requests that have been sent to the insurance companies in addition to:", + "ar": "خدمة الموافقات: هذه الخدمة تمكنك من الاطلاع على جميع طلبات الموافقات والتي تم ارسالها الى شركات التامين بالاضافة الى:" }, "info-approval-points": { @@ -1016,34 +739,16 @@ const Map localizedValues = { "ar": "خدمة التقارير الشهرية: عند تفعيل هذه الخدمة سيقوم النظام بارسال تقرير شهري بشكل آلي على الايميل المسجل والذي يسرد المؤشرات الحيوية ونتائج التحاليل لآخر زيارات تمت بمجموعة الحبيب الطبية." }, - "language-setting": { - "en": "SMS and Confirmation Calls Language", - "ar": "لغة الرسائل القصيرة و الاتصال الآلي" - }, + "language-setting": {"en": "SMS and Confirmation Calls Language", "ar": "لغة الرسائل القصيرة و الاتصال الآلي"}, "alert": {"en": "Alerts", "ar": "التنبيهات"}, - "email-alert": { - "en": "Alert By Email", - "ar": "استلام التنبيهات بالبريد الالكتروني" - }, - "sms-alert": { - "en": "Alert By SMS", - "ar": "استلام التنبيهات بالرسائل القصيرة" - }, + "email-alert": {"en": "Alert By Email", "ar": "استلام التنبيهات بالبريد الالكتروني"}, + "sms-alert": {"en": "Alert By SMS", "ar": "استلام التنبيهات بالرسائل القصيرة"}, "contact-info": {"en": "Contact Information", "ar": "معلومات التواصل"}, - "emrg-name": { - "en": "Emergency Contact Name", - "ar": "اسم للتواصل في حالة الطوارئ" - }, - "emrg-no": { - "en": "Emergency Contact Number", - "ar": "رقم للتواصل في حالة الطوارئ" - }, + "emrg-name": {"en": "Emergency Contact Name", "ar": "اسم للتواصل في حالة الطوارئ"}, + "emrg-no": {"en": "Emergency Contact Number", "ar": "رقم للتواصل في حالة الطوارئ"}, "modes": {"en": "Modes", "ar": "الاوضاع"}, "vibration": {"en": "Vibration Touch Feedback", "ar": "الاهتزاز عند اللمس"}, - "blind-modes": { - "en": "Modes for Partially Blind", - "ar": "تأثيرات لدعم ضعاف البصر" - }, + "blind-modes": {"en": "Modes for Partially Blind", "ar": "تأثيرات لدعم ضعاف البصر"}, "invert-theme": {"en": "Invert", "ar": "ألوان سلبية"}, "off-theme": {"en": "Off", "ar": "إيقاف"}, "dim-theme": {"en": "Dim", "ar": "ضوء خافت"}, @@ -1060,14 +765,8 @@ const Map localizedValues = { "LiveChat": {"en": "Live Chat", "ar": "محادثة مباشرة"}, "Service": {"en": "Service", "ar": "خدمة"}, "HMGServiceLabel": {"en": "HMG Service", 'ar': 'خدمات الحبيب'}, - "HealthWeatherIndicators": { - "en": "Health Weather Indicators", - 'ar': ' مؤشرات الطقس الصحية ' - }, - "HealthTipsBasedOnCurrentWeather": { - "en": "Health Tips Based On Current Weather", - 'ar': ' نصائح صحية على أساس الطقس الحالي ' - }, + "HealthWeatherIndicators": {"en": "Health Weather Indicators", 'ar': ' مؤشرات الطقس الصحية '}, + "HealthTipsBasedOnCurrentWeather": {"en": "Health Tips Based On Current Weather", 'ar': ' نصائح صحية على أساس الطقس الحالي '}, "MoreDetails": {"en": "More details", "ar": " المزيد من التفاصيل "}, "SendCopy": {"en": "Send Copy", "ar": "ارسال نسخة"}, "ResendOrder": {"en": "Resend order & deliver", "ar": "إعادة طلب و توصيل"}, @@ -1077,7 +776,10 @@ const Map localizedValues = { "DailyDoses": {"en": "Daily Doses", "ar": "جرعات يومية"}, "Period": {"en": "Period", "ar": "الفترة"}, "cm": {"en": "CM", "ar": "سم"}, + "ft": {"en": "ft", "ar": "قدم"}, "kg": {"en": "kg", "ar": "كجم"}, + "lb": {"en": "lb", "ar": "رطل"}, + "birth_date": {"en": "Birth Date", "ar": "تاريخ الميلاد"}, "mass": {"en": "Mass", "ar": "كتلة"}, "temp-c": {"en": "°C", "ar": "°س"}, "bpm": {"en": "bpm", "ar": "نبضة"}, @@ -1088,43 +790,26 @@ const Map localizedValues = { "send": {"en": "Send", "ar": "أرسل"}, "status": {"en": "Status", "ar": "الحالة"}, "like-to-hear": { - "en": - "We would love to hear the feedback, concerns on healthcare services and eServices experience. Please use the below form", - "ar": - "يسعدنا سماع ملاحظاتك حول خدمات الرعاية الصحية والخدمات الإلكترونية. يرجى تعبئة الحقول المطلوبة" + "en": "We would love to hear the feedback, concerns on healthcare services and eServices experience. Please use the below form", + "ar": "يسعدنا سماع ملاحظاتك حول خدمات الرعاية الصحية والخدمات الإلكترونية. يرجى تعبئة الحقول المطلوبة" }, "subject": {"en": "Subject", "ar": "الموضوع"}, "message": {"en": "Message", "ar": "رسالة"}, - "empty-subject": { - "en": "Please enter the subject", - "ar": "يرجى ادخال الموضوع" - }, + "empty-subject": {"en": "Please enter the subject", "ar": "يرجى ادخال الموضوع"}, "empty-message": {"en": "Please enter message", "ar": "يرجى ادخال الرسالة"}, "select-attachment": {"en": "Select Attachment", "ar": "إختر المرفق"}, "complain-appo": {"en": "Complaint for appointment", "ar": "شكوى على موعد"}, - "complain-without-appo": { - "en": "Complaint without appointment", - "ar": "شكوى بدون موعد" - }, + "complain-without-appo": {"en": "Complaint without appointment", "ar": "شكوى بدون موعد"}, "question": {"en": "Question", "ar": "سؤال"}, "message-type": {"en": "Message Type", "ar": "نوع الرسالة"}, "compliment": {"en": "compliment", "ar": "ثناء"}, "suggestion": {"en": "Suggestion", "ar": "إقتراح"}, - "your-feedback": { - "en": "Your feedback was sent", - "ar": "لقد تم ارسال اقراحك شكرا لك" - }, - "select-part": { - "en": "Please select the part that complain about", - "ar": "يرجى تحديد الجزء الذي تشكو منه" - }, + "your-feedback": {"en": "Your feedback was sent", "ar": "لقد تم ارسال اقراحك شكرا لك"}, + "select-part": {"en": "Please select the part that complain about", "ar": "يرجى تحديد الجزء الذي تشكو منه"}, "number": {"en": "Number", "ar": "الرقم"}, "not-classified": {"en": "Not classified", "ar": "غير محدد"}, "selectClinic": {"en": "Select Clinic", "ar": " بحث بالعيادة"}, - "searchItemError": { - "en": "Item name should be more than 3 character ", - "ar": "يجب أن يكون اسم العنصر أكثر من 3 أحرف" - }, + "searchItemError": {"en": "Item name should be more than 3 character ", "ar": "يجب أن يكون اسم العنصر أكثر من 3 أحرف"}, "YouCanFind": {"en": "You Can Find ", "ar": "باستطاعتك العثور على "}, "ItemInSearch": {"en": " Item In Search", "ar": " عنصر في البحث "}, "wantConnectHmgNetwork": { @@ -1168,31 +853,20 @@ const Map localizedValues = { "info-advance-payment": { "en": "This service designed so that you can deposit an amount in advance either in your account or in someone else's account with Al Habib Medical Group.", - "ar": - "تم تصميم هذه الخدمة حتى تتمكن من دفع مبلغ مقدما او تحت الحساب سواء في حسابك او في حساب شخص اخر لدى مجموعة الحبيب الطبية." - }, - "info-my-balance": { - "en": "This service allows you to check your balance in all branchs", - "ar": "هذه الخدمه تتيح لك الاطلاع رصيدك في كل الفروع" + "ar": "تم تصميم هذه الخدمة حتى تتمكن من دفع مبلغ مقدما او تحت الحساب سواء في حسابك او في حساب شخص اخر لدى مجموعة الحبيب الطبية." }, + "info-my-balance": {"en": "This service allows you to check your balance in all branchs", "ar": "هذه الخدمه تتيح لك الاطلاع رصيدك في كل الفروع"}, "er-contant": { - "en": - "This service displays nearest branch among all the branches of Al Habib Medical Group based on your current location.", - "ar": - "تعرض هذه الخدمة أقرب فرع من بين جميع فروع مجموعة الحبيب الطبية بناءً على موقعك الحالي." + "en": "This service displays nearest branch among all the branches of Al Habib Medical Group based on your current location.", + "ar": "تعرض هذه الخدمة أقرب فرع من بين جميع فروع مجموعة الحبيب الطبية بناءً على موقعك الحالي." }, "er": {"en": "ER", "ar": "الطوارىء"}, "transportation-Service": {"en": "Ambulance Request", "ar": "طلب نقل اسعاف"}, "info-ambulance": { - "en": - "Through this service, you can request evacuation by ambulance, whether from home or to home, in addition to a set of other services", - "ar": - "عن طريق هذه الخدمة يمكنك طلب اخلاء بواسطة سيارة اسعاف سواء من المزل او الى المنزل بالاضافة الى مجموعة من الخدمات الاخرى" - }, - "RRT-transport-heading": { - "en": "Select Transportation Method", - "ar": "حدد طريقة النقل" + "en": "Through this service, you can request evacuation by ambulance, whether from home or to home, in addition to a set of other services", + "ar": "عن طريق هذه الخدمة يمكنك طلب اخلاء بواسطة سيارة اسعاف سواء من المزل او الى المنزل بالاضافة الى مجموعة من الخدمات الاخرى" }, + "RRT-transport-heading": {"en": "Select Transportation Method", "ar": "حدد طريقة النقل"}, "RRT-direction-heading": {"en": "Select Direction", "ar": "حدد الاتجاه"}, "to-hospital": {"en": "To Hospital", "ar": "الى المستشفى"}, "from-hospital": {"en": "From Hospital", "ar": "من المستشفى"}, @@ -1203,21 +877,12 @@ const Map localizedValues = { "inside-home": {"en": "Inside Home", "ar": "داخل المنزل"}, "have-appo": {"en": "Do you have an appointment ?", "ar": "هل لديك موعد ؟"}, "dropoff-location": {"en": "Dropoff Location", "ar": "نقطة الوصول"}, - "select-all": { - "en": "Please select all fields", - "ar": "يرجى تحديد جميع الحقول" - }, + "select-all": {"en": "Please select all fields", "ar": "يرجى تحديد جميع الحقول"}, "select-map": {"en": "Select From Map", "ar": "حدد من الخريطة"}, - "no-appointment": { - "en": "You don't have any appointments yet", - "ar": "ليس لديك أي مواعيد حتى الآن" - }, + "no-appointment": {"en": "You don't have any appointments yet", "ar": "ليس لديك أي مواعيد حتى الآن"}, "patient-share": {"en": "Amount before tax: ", "ar": "المبلغ قبل الضريبة:"}, "patient-share-tax": {"en": "Tax amount: ", "ar": "قيمة الضريبة:"}, - "patient-share-total": { - "en": "Total amount payable: ", - "ar": "المبلغ الإجمالي المستحق:" - }, + "patient-share-total": {"en": "Total amount payable: ", "ar": "المبلغ الإجمالي المستحق:"}, "select-ambulate": {"en": "Select Ambulate", "ar": "بحاجة للتنقل بواسطة"}, "wheelchair": {"en": "Wheelchair", "ar": "كرسي متحرك"}, "walker": {"en": "Walker", "ar": "مشاية"}, @@ -1228,63 +893,35 @@ const Map localizedValues = { "transport-method": {"en": "Transportation Method", "ar": "طريقة النقل"}, "directions": {"en": "Directions", "ar": "الاتجاهات"}, "info-my-appointments": { - "en": - "This service allows you to see all the appointment you have visited in Al Habib Medical Group, and through this service:", - "ar": - "خدمة مواعيدي: هذه الخدمة تمكنك من الاطلاع على جميع المواعيد التي قمت بزيارتهم في مجموعة الحبيب الطبية, كما تستطيع من خلال هذه الخدمة:" + "en": "This service allows you to see all the appointment you have visited in Al Habib Medical Group, and through this service:", + "ar": "خدمة مواعيدي: هذه الخدمة تمكنك من الاطلاع على جميع المواعيد التي قمت بزيارتهم في مجموعة الحبيب الطبية, كما تستطيع من خلال هذه الخدمة:" }, "info-todo": { - "en": - "This service is designed to enable you to have a quick link to the list of tasks that need to be done", - "ar": - "هذه الخدمة تم تصميمها لتمكنك من الوصول الى رابط سريع لقائمة المهام التي يجب القيام بها" + "en": "This service is designed to enable you to have a quick link to the list of tasks that need to be done", + "ar": "هذه الخدمة تم تصميمها لتمكنك من الوصول الى رابط سريع لقائمة المهام التي يجب القيام بها" }, "family-info": { "en": "Through this service, you will be able to link your family medical files to your medical file so that you can manage their records by login to your medical file.", - "ar": - "هذه الخدمة تم تصميمها لتتمكن من ربط الملفات الطبية للعائلة بملفك الطبي حتى تتمكن من إدارة سجلاتهم عن طريق تسجيل الدخول إلى ملفك الطبي." - }, - "update-succ": { - "en": "Successfully updated profile", - "ar": "تم تحديث البيانات بنجاح" + "ar": "هذه الخدمة تم تصميمها لتتمكن من ربط الملفات الطبية للعائلة بملفك الطبي حتى تتمكن من إدارة سجلاتهم عن طريق تسجيل الدخول إلى ملفك الطبي." }, + "update-succ": {"en": "Successfully updated profile", "ar": "تم تحديث البيانات بنجاح"}, "dental-complains": {"en": "Symptoms", "ar": "الأعراض"}, - "empty-result": { - "en": "There is no search results found", - "ar": "لايوجد نتائج" - }, + "empty-result": {"en": "There is no search results found", "ar": "لايوجد نتائج"}, - "no-booked-appointment": { - "en": "No booked appointments", - "ar": "لا يوجد مواعيد محجوزة" - }, - "no-confirmed-appointment": { - "en": "No confirmed appointments", - "ar": "لا توجد مواعيد مؤكدة" - }, - "no-arrived-appointment": { - "en": "No arrived appointments", - "ar": "لا يوجد مواعيد" - }, - "upcoming-empty": { - "en": "You do not have any Todo actions yet.", - "ar": "ليس لديك أي إجراءات الآن." - }, - "upcoming-timeLeft": { - "en": "time left for appointment", - "ar": "الوقت المتبقي للموعد" - }, - "covid-test-all-services": { - "en": "Covid-19 Drive-Thru Test", - "ar": "فحص كورونا من داخل السيارة" - }, + "no-booked-appointment": {"en": "No booked appointments", "ar": "لا يوجد مواعيد محجوزة"}, + "no-confirmed-appointment": {"en": "No confirmed appointments", "ar": "لا توجد مواعيد مؤكدة"}, + "no-arrived-appointment": {"en": "No arrived appointments", "ar": "لا يوجد مواعيد"}, + "upcoming-empty": {"en": "You do not have any Todo actions yet.", "ar": "ليس لديك أي إجراءات الآن."}, + "upcoming-timeLeft": {"en": "time left for appointment", "ar": "الوقت المتبقي للموعد"}, + "covid-test-all-services": {"en": "Covid-19 Drive-Thru Test", "ar": "فحص كورونا من داخل السيارة"}, "pharmacy": {"en": "Pharmacy", "ar": "الصيدلية"}, "ereferral": {"en": "E-Referral", "ar": "طلب التحويل"}, "child-vaccine": {"en": "Child Vaccines", "ar": "تطعيمات الأطفال"}, "calculators": {"en": "Health Calculators", "ar": "الحاسبات الصحية"}, "converters": {"en": "Health Converter", "ar": "تحويل القياسات"}, - "h2o": {"en": "Water Tracker", "ar": "حساب كمية الماء"}, + "waterTracker": {"en": "Water Tracker", "ar": "حساب كمية الماء"}, + "h2o": {"en": "H2O", "ar": "استهلاك"}, "v-tour": {"en": "Virtual Tour", "ar": "جولة إفتراضية"}, "hmg-news": {"en": "HMG News", "ar": "أخبار المجموعة"}, "blood-d": {"en": "Blood Donation", "ar": "تبرع بالدم"}, @@ -1300,10 +937,7 @@ const Map localizedValues = { "ready": {"en": "Ready", "ar": "جاهز"}, "completed": {"en": "Completed", "ar": "مكتمل"}, - "request-medical-report": { - "en": "Request medical report", - "ar": "طلب تقرير طبي" - }, + "request-medical-report": {"en": "Request medical report", "ar": "طلب تقرير طبي"}, "insur-cards": {"en": "Insurance Cards", "ar": "بطاقات التأمين"}, 'labResult': {"en": "Lab results", "ar": "نتائج التحاليل المخبرية"}, 'details': {'en': 'Details', 'ar': 'التفاصيل'}, @@ -1313,76 +947,37 @@ const Map localizedValues = { "card-detail": {"en": "Insurance Details", "ar": "منافعك التامينية"}, "Dr": {"en": "Dr. ", "ar": "الدكتور."}, "empty": {"en": "You do not have any records.", "ar": "ليس لديك أي سجلات"}, - "last-visit": { - "en": "How was your last visit with doctor?", - "ar": "كيف تقيم زيارتك الأخيرة للطبيب؟" - }, + "last-visit": {"en": "How was your last visit with doctor?", "ar": "كيف تقيم زيارتك الأخيرة للطبيب؟"}, "tap-title": {"en": "Please rate the doctor", "ar": "يرجى تقييم الطبيب"}, "later": {"en": "Later", "ar": "لاحقاً"}, - "sendSuc": { - "en": "A copy has been sent to the email", - "ar": "تم إرسال نسخة إلى البريد الإلكتروني" - }, + "sendSuc": {"en": "A copy has been sent to the email", "ar": "تم إرسال نسخة إلى البريد الإلكتروني"}, "instructions": { - "en": - "You can now talk directly to the appointments department by chat or request a call back", - "ar": - "يمكنك الان التحدث مباشرة مع قسم المواعيد عن طريق خدمة المحادثة النصية أو طلب معاودة الاتصال" + "en": "You can now talk directly to the appointments department by chat or request a call back", + "ar": "يمكنك الان التحدث مباشرة مع قسم المواعيد عن طريق خدمة المحادثة النصية أو طلب معاودة الاتصال" }, "instructions-pharmacies": { - "en": - "You can now talk directly to the pharmacist by chat or request a call back", - "ar": - "يمكنك الآن التحدث مباشرة إلى الصيدلي عن طريق الدردشة أو طلب معاودة الاتصال" + "en": "You can now talk directly to the pharmacist by chat or request a call back", + "ar": "يمكنك الآن التحدث مباشرة إلى الصيدلي عن طريق الدردشة أو طلب معاودة الاتصال" }, "select-hospital": {"en": "Choose Hospital", "ar": "اختر المستشفى"}, "start": {"en": "Start", "ar": "ابدأ"}, "info-chat": { - "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": "كيف كان موعدك الطبي ؟" + "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": "يرجى تقييم العيادة"}, "fetch-data": {"en": "Fetch Data", "ar": "تحديث الان"}, "rate": {"en": "Rate", "ar": "تقييم"}, - "send-email": { - "en": "Send a copy of this report to the email", - "ar": "أرسل نسخة من هذا التقرير إلى البريد الإلكتروني" - }, - "update-email-msg": { - "en": "Email updated", - "ar": "تم تحديث البريد الالكتروني" - }, + "send-email": {"en": "Send a copy of this report to the email", "ar": "أرسل نسخة من هذا التقرير إلى البريد الإلكتروني"}, + "update-email-msg": {"en": "Email updated", "ar": "تم تحديث البريد الالكتروني"}, "update-email": {"en": "Update Email", "ar": "تحديث البريد الالكتروني"}, - "booked-success": { - "en": "The appointment has been successfully booked.", - "ar": "لقد تم حجز الموعد بنجاح" - }, - "appo-reminder-select-option-30": { - "en": "Before 30 Mins", - "ar": "قبل 30 دقيقة" - }, - "appo-reminder-select-option-60": { - "en": "Before 1 Hour", - "ar": "قبل ساعة واحدة" - }, - "appo-reminder-select-option-90": { - "en": "Before 1 Hour and 30 mins", - "ar": "قبل ساعة و 30 دقيقة" - }, - "appo-reminder-select-option-120": { - "en": "Before 2 Hours", - "ar": "قبل ساعتين" - }, - "noDataAvailable": { - "en": "No data available", - "ar": " لا يوجد بيانات متاحة " - }, + "booked-success": {"en": "The appointment has been successfully booked.", "ar": "لقد تم حجز الموعد بنجاح"}, + "appo-reminder-select-option-30": {"en": "Before 30 Mins", "ar": "قبل 30 دقيقة"}, + "appo-reminder-select-option-60": {"en": "Before 1 Hour", "ar": "قبل ساعة واحدة"}, + "appo-reminder-select-option-90": {"en": "Before 1 Hour and 30 mins", "ar": "قبل ساعة و 30 دقيقة"}, + "appo-reminder-select-option-120": {"en": "Before 2 Hours", "ar": "قبل ساعتين"}, + "noDataAvailable": {"en": "No data available", "ar": " لا يوجد بيانات متاحة "}, "thename": {"en": "The Name", "ar": "الاسم"}, "noSearchResult": {"en": "No Search Result", "ar": "لا توجد نتيجة بحث"}, "selectFileSouse": {"en": "Select file souse", "ar": "حدد الملف"}, @@ -1391,60 +986,35 @@ const Map localizedValues = { "med-report": {"en": "Medical Reports", "ar": "التقارير الطبية"}, "new-med-report": {"en": "Requests", "ar": "الطلبات"}, "requestReport": {"en": "Request a report", "ar": " طلب تقرير"}, - "confirm-msg-report": { - "en": "Request for medical report?", - "ar": "طلب تقرير طبي؟" - }, - "successSendReport": { - "en": "The request has been submitted successfully", - "ar": "تم تنفيذ طلبك بنجاح" - }, + "confirm-msg-report": {"en": "Request for medical report?", "ar": "طلب تقرير طبي؟"}, + "successSendReport": {"en": "The request has been submitted successfully", "ar": "تم تنفيذ طلبك بنجاح"}, "pulseTitle": {"en": "Heart rate", "ar": "معدل النبض بالدقيقة"}, "systolic-lng": {"en": "Systolic", "ar": "الإنقباض"}, "diastolic-lng": {"en": "Diastolic", "ar": "الإنبساط"}, "policy-holder": {"en": "Policy Holder", "ar": "حامل بطاقة التأمين"}, "policy-no": {"en": "Policy Number", "ar": "رقم سياسات"}, - "agree": { - "en": "I agree, this is the correct information", - "ar": "موافق، هذه المعلومات صحيحة" - }, - "disagree": { - "en": "No, this is not the correct information", - "ar": "غير موافق، هذه المعلومات غير الصحيحة" - }, + "agree": {"en": "I agree, this is the correct information", "ar": "موافق، هذه المعلومات صحيحة"}, + "disagree": {"en": "No, this is not the correct information", "ar": "غير موافق، هذه المعلومات غير الصحيحة"}, "expiry-date": {"en": "Expiry Date", "ar": "تاريخ انتهاء الصلاحية"}, "class": {"en": "Class", "ar": "فئة"}, "approval": {"en": "Approval", "ar": "موافقة"}, "no-data": {"en": "No data found", "ar": "لاتوجد بيانات"}, "insurance-details": {"en": "Insurance Details", "ar": "تفاصيل التأمين"}, "nearest-hospital": {"en": "Nearest Hospital", "ar": "أقرب مستشفى"}, - "request-sent": { - "en": "Request sent successfully", - "ar": "تم إرسال الطلب بنجاح" - }, - "message-sent": { - "en": "Message sent successfully", - "ar": "تم إرسال الرسالة بنجاح" - }, + "request-sent": {"en": "Request sent successfully", "ar": "تم إرسال الطلب بنجاح"}, + "message-sent": {"en": "Message sent successfully", "ar": "تم إرسال الرسالة بنجاح"}, "sent-on": {"en": "Sent on", "ar": "أرسلت في"}, - "attach-insurace-image": { - "en": "Attach insurance card image", - "ar": "إرفاق صورة بطاقة التأمين" - }, + "attach-insurace-image": {"en": "Attach insurance card image", "ar": "إرفاق صورة بطاقة التأمين"}, "upload-without-image": { "en": "You can still submit, if you don't have Insurance Image", "ar": "لا يزال بإمكانك الإرسال ، إذا لم يكن لديك صورة تأمين" }, "info-insur-cards": { - "en": - "This service allows you to view all the insurance cards that recorded during your visits to Al Habib Medical Group in addition to:", + "en": "This service allows you to view all the insurance cards that recorded during your visits to Al Habib Medical Group in addition to:", "ar": "خدمة بطاقات التامين: هذه الخدمة تمكنك من الاطلاع على جميع بطاقات التامين والتي تم تسجيلها اثناء زياراتك لمجموعة الحبيب الطبية بالاضافة الى:" }, - "scan-now": { - "en": "If you have a card / Document Scan now", - "ar": "إذا كانت لديك بطاقة / مستند ارفقها الان" - }, + "scan-now": {"en": "If you have a card / Document Scan now", "ar": "إذا كانت لديك بطاقة / مستند ارفقها الان"}, "liveCare": {"en": "Live Care", "ar": "لايف كير"}, "topBrands": {"en": "Top Brands", "ar": "اعلى العلامات التجارية"}, @@ -1459,8 +1029,7 @@ const Map localizedValues = { "quantityShortcut": {"en": "QTY", "ar": "كمية"}, "pharmacyServiceTermsCondition": { - "en": - "I agree with the terms of service and I adhere to them unconditionally", + "en": "I agree with the terms of service and I adhere to them unconditionally", "ar": " أوافق على شروط الخدمة وألتزم بها دون قيد أو شرط" }, "Year": {"en": "YEAR", "ar": "السنة"}, @@ -1481,62 +1050,32 @@ const Map localizedValues = { "orderLocation": {"en": "Location", "ar": "الموقع"}, "selectService": {"en": "Select Service", "ar": "حدد الخدمة"}, "coveredService": {"en": "Covered Service : ", "ar": " الخدمات المغطاة : "}, - "selectedService": { - "en": "Selected Service : ", - "ar": " الخدمات المختارة : " - }, - "cancelOrderMsg": { - "en": "Are you sure!! want to cancel this order", - "ar": "هل أنت واثق!! تريد إلغاء هذا الطلب" - }, - "processDoneSuccessfully": { - "en": "Process Done Successfully", - "ar": "تمت العملية بنجاح" - }, - "selectHomeHealthCareServices": { - "en": "Select Home Health Care Services", - "ar": " حدد خدمات الرعاية الصحية المنزلية" - }, + "selectedService": {"en": "Selected Service : ", "ar": " الخدمات المختارة : "}, + "cancelOrderMsg": {"en": "Are you sure!! want to cancel this order", "ar": "هل أنت واثق!! تريد إلغاء هذا الطلب"}, + "processDoneSuccessfully": {"en": "Process Done Successfully", "ar": "تمت العملية بنجاح"}, + "selectHomeHealthCareServices": {"en": "Select Home Health Care Services", "ar": " حدد خدمات الرعاية الصحية المنزلية"}, "description-vaccination": {"en": "Description", "ar": "وصف"}, "due-date": {"en": "Due date", "ar": "تاريخ الاستحقاق"}, - "valid-email": { - "en": "Please enter valid email", - "ar": "الرجاء إدخال عنوان بريد صحيح" - }, - "confirm-send": { - "en": "Send the child's schedule to the email?", - "ar": "ارسال جدول التطعيمات الى بريدك الالكتروني؟" - }, + "valid-email": {"en": "Please enter valid email", "ar": "الرجاء إدخال عنوان بريد صحيح"}, + "confirm-send": {"en": "Send the child's schedule to the email?", "ar": "ارسال جدول التطعيمات الى بريدك الالكتروني؟"}, "vaccination": {"en": "Vaccination", "ar": "جدول التطعيمات"}, "welcomeBack": {"en": "Welcome back", "ar": "مرحبا مرة أخرى"}, - "updated-email": { - "en": "Updated email successfully", - "ar": "تم تحديث البريد الالكتروني" - }, + "updated-email": {"en": "Updated email successfully", "ar": "تم تحديث البريد الالكتروني"}, - "view-list-children": { - "en": "View List of Children", - "ar": "عرض قائمة الأطفال" - }, - "trackDeliveryDriver": { - "en": "Track Delivery Driver", - "ar": "trackDeliveryDriver" - }, + "view-list-children": {"en": "View List of Children", "ar": "عرض قائمة الأطفال"}, + "trackDeliveryDriver": {"en": "Track Delivery Driver", "ar": "trackDeliveryDriver"}, "covidTest": {"en": "COVID-19 TEST", "ar": "فحص كورونا"}, "driveThru": {"en": "Drive-Thru", "ar": "من السيارة"}, "NearestErDesc": { - "en": - "\nThis service Displays nearest branch\n among all the branches of All Habib \n medical Group based on your current Location", - "ar": - "\nتعرض هذه الخدمة أقرب فرع\n من بين جميع فروع مجموعة \nالحبيب الطبية بناءً على موقعك الحالي." + "en": "\nThis service Displays nearest branch\n among all the branches of All Habib \n medical Group based on your current Location", + "ar": "\nتعرض هذه الخدمة أقرب فرع\n من بين جميع فروع مجموعة \nالحبيب الطبية بناءً على موقعك الحالي." }, "NearestEr": {"en": "Nearest ER", "ar": "أقرب ER"}, "infoCMC": { "en": "Through this service, you can request a set of tests that help you and your doctor to understand the current health condition and then identify potential risks.", - "ar": - "من خلال هذه الخدمة يمكنك طلب مجموعة من الفحوصات التي تساعدك وتساعد طبيبك في فهم حالتك الصحية الحالية ومن ثم تحديد المخاطر المحتملة" + "ar": "من خلال هذه الخدمة يمكنك طلب مجموعة من الفحوصات التي تساعدك وتساعد طبيبك في فهم حالتك الصحية الحالية ومن ثم تحديد المخاطر المحتملة" }, "instructionAgree": { "en": @@ -1548,34 +1087,22 @@ const Map localizedValues = { "RRT-orders-log": {"en": "Orders Log", "ar": "سجل الطلبات"}, "blood-sugar": {"en": "Blood Sugar", "ar": "سكر الدم"}, - "covid19_driveThrueTest": { - "en": "'Covid-19- Drive-Thru Test'", - "ar": "Covid-19- الفحص من خلال القيادة" - }, + "covid19_driveThrueTest": {"en": "'Covid-19- Drive-Thru Test'", "ar": "Covid-19- الفحص من خلال القيادة"}, "E-Referral": {"en": "'E-Referral'", "ar": "الإحالة الإلكترونية"}, "childName": {"en": "'CHILD NAME'", "ar": "إسم الطفل"}, "recordDeleted": {"en": "'Record Deleted'", "ar": "تم حذف السجل"}, "msg_email_address_up_to_date": { - "en": - "Please ensure that the email address is up-to-date and process to view the schedule", - "ar": - "يرجى التأكد من أن عنوان البريد الإلكتروني محدث وأن العملية لعرض الجدول الزمني" + "en": "Please ensure that the email address is up-to-date and process to view the schedule", + "ar": "يرجى التأكد من أن عنوان البريد الإلكتروني محدث وأن العملية لعرض الجدول الزمني" }, "add-new-child": {"en": "ADD NEW CHILD", "ar": "إضافة طفل جديد"}, "visit": {"en": "Visit", "ar": "الزيارة"}, - "send-child-email-msg": { - "en": "Send the child's schedule to the email", - "ar": "أرسل جدول الطفل إلى البريد الإلكتروني" - }, + "send-child-email-msg": {"en": "Send the child's schedule to the email", "ar": "أرسل جدول الطفل إلى البريد الإلكتروني"}, "vaccination-add-child-msg": { - "en": - "Add the child's information below to receive the schedule of vaccinations.", + "en": "Add the child's information below to receive the schedule of vaccinations.", "ar": "أضف معلومات الطفل أدناه للحصول على جدول التطعيمات." }, - "child_added_successfully": { - "en": "Child added successfully", - "ar": "تمت إضافة الطفل بنجاح" - }, + "child_added_successfully": {"en": "Child added successfully", "ar": "تمت إضافة الطفل بنجاح"}, "bloodSugar": {"en": "Blood", "ar": "السكر في الدم"}, "sugar": {"en": "Sugar", "ar": ""}, "bloodCholesterol": {"en": "Blood", "ar": " الكولسترول في الدم"}, @@ -1588,25 +1115,18 @@ const Map localizedValues = { "calculate": {"en": "calculate", "ar": "حساب"}, "enterReadingValue": {"en": "Enter the reading value", "ar": "ادخل القيمة"}, "result": {"en": "Result", "ar": "النتيجة"}, - "bloodSugarConversion": { - "en": "Blood Sugar Conversion", - "ar": "السكر في الدم" - }, + "bloodSugarConversion": {"en": "Blood Sugar Conversion", "ar": "السكر في الدم"}, "convertBloodSugarStatement": { - "en": - "Convert blood sugar/glucose from mmol/l (UK standard) to mg/dlt (US standard) and vice versa.", - "ar": - "تحويل مستوى السكر في الدم من مليمول/ لتر (مقياس المملكة المتحدة) الى ملغ/ ديسيلتر (مقياس الولايات المتحدة) والعكس" + "en": "Convert blood sugar/glucose from mmol/l (UK standard) to mg/dlt (US standard) and vice versa.", + "ar": "تحويل مستوى السكر في الدم من مليمول/ لتر (مقياس المملكة المتحدة) الى ملغ/ ديسيلتر (مقياس الولايات المتحدة) والعكس" }, "convertCholesterolStatement": { "en": "Convert blood cholesterol from\n mmol/l to mg/dlt and vice versa.", - "ar": - "تحويل مستوى الكولسترول في الدم من مليمول/ لتر (مقياس المملكة المتحدة) الى ملغ/ ديسيلتر (مقياس الولايات المتحدة) والعكس" + "ar": "تحويل مستوى الكولسترول في الدم من مليمول/ لتر (مقياس المملكة المتحدة) الى ملغ/ ديسيلتر (مقياس الولايات المتحدة) والعكس" }, "triglyceridesConvertStatement": { "en": "Convert Triglycerides from mmol/l to mg/dlt and vice versa.", - "ar": - "تحويل مستوى الدهون الثلاثية في الدم من مليمول/ لتر (مقياس المملكة المتحدة) الى ملغ/ ديسيلتر (مقياس الولايات المتحدة) والعكس" + "ar": "تحويل مستوى الدهون الثلاثية في الدم من مليمول/ لتر (مقياس المملكة المتحدة) الى ملغ/ ديسيلتر (مقياس الولايات المتحدة) والعكس" }, "my-tracker": {"en": "My Tracker", "ar": "قراءاتي"}, "weekly": {"en": "Weekly", "ar": "أسبوعي"}, @@ -1619,37 +1139,57 @@ const Map localizedValues = { "measure-time": {"en": "Measure time", "ar": "وقت القياس"}, "update": {"en": "Update", "ar": "تعديل"}, "bloodD-enter-desc": { - "en": - "Enter the required information, In order to register for Blood Donation Service", + "en": "Enter the required information, In order to register for Blood Donation Service", "ar": "أدخل المعلومات المطلوبة ، للتسجيل في خدمة التبرع بالدم" }, - "viewTermsConditions": { - "en": "To view the terms and conditions", - "ar": "لعرض الشروط والأحكام" - }, - "WalkinAppo": { - "en": "Hospital Visit Appointment", - "ar": "موعد زيارة للمستشفى" - }, - "videoAppo": { - "en": "Video Call Appointment", - "ar": "موعد اتصال فيديو" - }, + "viewTermsConditions": {"en": "To view the terms and conditions", "ar": "لعرض الشروط والأحكام"}, + "WalkinAppo": {"en": "Hospital Visit Appointment", "ar": "موعد زيارة للمستشفى"}, + "videoAppo": {"en": "Video Call Appointment", "ar": "موعد اتصال فيديو"}, // "visit": {"en" : "Visit", "ar": "الزيارة"}, - "weight-add": { - "en": "Enter Weight Value", - "ar": "أدخل الوزن " - }, - "systolic-add": { - "en": "Enter Systolic Value", - "ar": "أدخل قيمة الإنقباض " - }, - "diastolic-add": { - "en": "Enter Diastolic Value", - "ar": "أدخل قيمة الإنبساط " - }, - "cmc-heading": { - "en": "Comprehensive Medical Checkup", - "ar": "فحص طبي شامل" - }, + "weight-add": {"en": "Enter Weight Value", "ar": "أدخل الوزن "}, + "systolic-add": {"en": "Enter Systolic Value", "ar": "أدخل قيمة الإنقباض "}, + "diastolic-add": {"en": "Enter Diastolic Value", "ar": "أدخل قيمة الإنبساط "}, + "cmc-heading": {"en": "Comprehensive Medical Checkup", "ar": "فحص طبي شامل"}, + "today": {"en": "Today", "ar": "اليوم"}, + "week": {"en": "Week", "ar": "أسبوع"}, + "month": {"en": "Month", "ar": "شهر"}, + "h2o-amount-of-water": {"en": "Enter the amount of water:", "ar": "ادخل كمية الماء:"}, + "update-user": {"en": "Update Information", "ar": "تحديث بيانات"}, + "editname": {"en": "Enter the name here", "ar": "أدخل الاسم هنا"}, + "activity-level": {"en": "Activity Level", "ar": "مستوى النشاط"}, + "light-active": {"en": "Lightly Active", "ar": " قليل النشاط"}, + "mod-active": {"en": "Moderately Active", "ar": "متوسط النشاط"}, + "reminder-label": {"en": "Activate the reminder of drink water?", "ar": "تفعيل خاصية تذكير شرب الماء؟"}, + "reminder-times-label": {"en": "How many times do you want to be reminded?", "ar": "عدد مرات التذكير"}, + "times": {"en": "Times", "ar": "مرات"}, + "WaterCalculate": {"en": "Save", "ar": "حفظ"}, + "notif-title": {"en": "Water Reminder", "ar": "تذكير"}, + "notif-text": {"en": " Don't forget to drink water.", "ar": "لا تنسى شرب الماء"}, + "custom": {"en": "Custom", "ar": "خاص"}, + "undo": {"en": "Undo", "ar": "تراجع"}, + "drinking": {"en": "Drinkning", "ar": "الشرب"}, + "remaining": {"en": "Remaining", "ar": "المتبقي"}, + "taken": {"en": "Taken", "ar": " مأخوذ"}, + "ml": {"en": "ml", "ar": "مل"}, + "l": {"en": "L", "ar": "لتر"}, + "custom-label": {"en": "Enter amount", "ar": "أدخل كمية الماء"}, + "custom-label-in-litres": {"en": "Enter amount in liters", "ar": "أدخل الكمية باللتر"}, + "custom-label-in-mililitres": {"en": "Enter amount in millilitres", "ar": "أدخل الكمية بالملليتر"}, + "amount": {"en": "Amount", "ar": "الكمية"}, + "target-reach": {"en": "You have reached the target for the day!", "ar": "لقد حققت هدفك اليومي! مبروك"}, + "week-header": {"en": "Water consumed in a week", "ar": "معدل شرب الماء خلال الاسبوع"}, + "month-header": {"en": "Water consumed in a month", "ar": "معدل شرب الماء خلال الشهر"}, + "notif-permission-title": {"en": "Could not set the water reminders", "ar": "لا يمكن ضبط اشعار شرب الماء"}, + "notif-permission-msg": { + "en": "To recieve water reminders, please turn on notifications in the system settings", + "ar": "الرجاء تفعيل الاشعارات في الاعدادات" + }, + "verification_message_code": {"en": "Please enter verification code", "ar": "الرجاء إدخال رمز التحقق"}, + "sms_code": {"en": "Enter SMS Code here", "ar": "أدخل رمز التحقق هنا"}, + "code_failure": {"en": "Didn’t received the code", "ar": "لم أستلم رمز التحقق"}, + "resend": {"en": "Resend", "ar": "إعادة إرسال"}, + "submitncontinue": {"en": "Submit and continue", "ar": "إرسال ومتابعة"}, + "areyousure": {"en": "Are you sure you want to Add", "ar": "هل أنت متأكد أنك تريد إضافة"}, + "preferredunit": {"en": "Select the preferred unit", "ar": "اختر الوحدة المفضلة"}, + "select-unit": {"en": "Select unit", "ar": "اختر وحدة القياس"} }; diff --git a/lib/core/model/AlHabibMedicalService/H2O/user_detail_model.dart b/lib/core/model/AlHabibMedicalService/H2O/user_detail_model.dart new file mode 100644 index 00000000..bb100219 --- /dev/null +++ b/lib/core/model/AlHabibMedicalService/H2O/user_detail_model.dart @@ -0,0 +1,104 @@ +class UserDetailModel { + int userID; + int patientID; + int patientType; + bool patientOutSA; + String firstName; + String middleName; + String lastName; + String firstNameN; + String middleNameN; + String lastNameN; + String identificationNo; + String mobile; + String emailID; + String zipCode; + String dOB; + String gender; + int activityID; + String createdDate; + double height; + double weight; + bool isHeightInCM; + bool isWeightInKG; + bool isNotificationON; + + UserDetailModel( + {this.userID, + this.patientID, + this.patientType, + this.patientOutSA, + this.firstName, + this.middleName, + this.lastName, + this.firstNameN, + this.middleNameN, + this.lastNameN, + this.identificationNo, + this.mobile, + this.emailID, + this.zipCode, + this.dOB, + this.gender, + this.activityID, + this.createdDate, + this.height, + this.weight, + this.isHeightInCM, + this.isWeightInKG, + this.isNotificationON}); + + UserDetailModel.fromJson(Map json) { + userID = json['UserID']; + patientID = json['PatientID']; + patientType = json['PatientType']; + patientOutSA = json['PatientOutSA']; + firstName = json['FirstName']; + middleName = json['MiddleName']; + lastName = json['LastName']; + firstNameN = json['FirstNameN']; + middleNameN = json['MiddleNameN']; + lastNameN = json['LastNameN']; + identificationNo = json['IdentificationNo']; + mobile = json['Mobile']; + emailID = json['EmailID']; + zipCode = json['ZipCode']; + dOB = json['DOB']; + gender = json['Gender']; + activityID = json['ActivityID']; + createdDate = json['CreatedDate']; + height = json['Height']; + weight = json['Weight']; + isHeightInCM = json['IsHeightInCM']; + isWeightInKG = json['IsWeightInKG']; + isNotificationON = json['IsNotificationON']; + } + + Map toJson() { + final Map data = new Map(); + data['UserID'] = this.userID; + data['PatientID'] = this.patientID; + data['PatientType'] = this.patientType; + data['PatientOutSA'] = this.patientOutSA; + data['FirstName'] = this.firstName; + data['MiddleName'] = this.middleName; + data['LastName'] = this.lastName; + data['FirstNameN'] = this.firstNameN; + data['MiddleNameN'] = this.middleNameN; + data['LastNameN'] = this.lastNameN; + data['IdentificationNo'] = this.identificationNo; + data['Mobile'] = this.mobile; + data['EmailID'] = this.emailID; + data['ZipCode'] = this.zipCode; + data['DOB'] = this.dOB; + data['Gender'] = this.gender; + data['ActivityID'] = this.activityID; + data['CreatedDate'] = this.createdDate; + data['Height'] = this.height; + data['Weight'] = this.weight; + data['IsHeightInCM'] = this.isHeightInCM; + data['IsWeightInKG'] = this.isWeightInKG; + data['IsNotificationON'] = this.isNotificationON; + return data; + } +} diff --git a/lib/core/model/AlHabibMedicalService/H2O/user_detail_request_model.dart b/lib/core/model/AlHabibMedicalService/H2O/user_detail_request_model.dart new file mode 100644 index 00000000..9d23d383 --- /dev/null +++ b/lib/core/model/AlHabibMedicalService/H2O/user_detail_request_model.dart @@ -0,0 +1,124 @@ +class UserDetailRequestModel { + String activityID; + int channel; + int deviceTypeID; + String dOB; + String email; + String firstName; + String gender; + String generalid; + double height; + String identificationNo; + String iPAdress; + bool isDentalAllowedBackend; + bool isHeightInCM; + bool isNotificationOn; + bool isWeightInKG; + int languageID; + String lastName; + String middleName; + String mobileNumber; + int patientID; + int patientOutSA; + int patientType; + int patientTypeID; + String sessionID; + String tokenID; + double versionID; + double weight; + String zipCode; + + UserDetailRequestModel( + {this.activityID, + this.channel, + this.deviceTypeID, + this.dOB, + this.email, + this.firstName, + this.gender, + this.generalid, + this.height, + this.identificationNo, + this.iPAdress, + this.isDentalAllowedBackend, + this.isHeightInCM, + this.isNotificationOn, + this.isWeightInKG, + this.languageID, + this.lastName, + this.middleName, + this.mobileNumber, + this.patientID, + this.patientOutSA, + this.patientType, + this.patientTypeID, + this.sessionID, + this.tokenID, + this.versionID, + this.weight, + this.zipCode}); + + UserDetailRequestModel.fromJson(Map json) { + activityID = json['ActivityID']; + channel = json['Channel']; + deviceTypeID = json['DeviceTypeID']; + dOB = json['DOB']; + email = json['Email']; + firstName = json['FirstName']; + gender = json['Gender']; + generalid = json['generalid']; + height = json['Height']; + identificationNo = json['IdentificationNo']; + iPAdress = json['IPAdress']; + isDentalAllowedBackend = json['isDentalAllowedBackend']; + isHeightInCM = json['IsHeightInCM']; + isNotificationOn = json['isNotificationOn']; + isWeightInKG = json['IsWeightInKG']; + languageID = json['LanguageID']; + lastName = json['LastName']; + middleName = json['MiddleName']; + mobileNumber = json['MobileNumber']; + patientID = json['PatientID']; + patientOutSA = json['PatientOutSA']; + patientType = json['PatientType']; + patientTypeID = json['PatientTypeID']; + sessionID = json['SessionID']; + tokenID = json['TokenID']; + versionID = json['VersionID']; + weight = json['Weight']; + zipCode = json['ZipCode']; + } + + Map toJson() { + final Map data = new Map(); + data['ActivityID'] = this.activityID; + data['Channel'] = this.channel; + data['DeviceTypeID'] = this.deviceTypeID; + data['DOB'] = this.dOB; + data['Email'] = this.email; + data['FirstName'] = this.firstName; + data['Gender'] = this.gender; + data['generalid'] = this.generalid; + data['Height'] = this.height; + data['IdentificationNo'] = this.identificationNo; + data['IPAdress'] = this.iPAdress; + data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; + data['IsHeightInCM'] = this.isHeightInCM; + data['isNotificationOn'] = this.isNotificationOn; + data['IsWeightInKG'] = this.isWeightInKG; + data['LanguageID'] = this.languageID; + data['LastName'] = this.lastName; + data['MiddleName'] = this.middleName; + data['MobileNumber'] = this.mobileNumber; + data['PatientID'] = this.patientID; + data['PatientOutSA'] = this.patientOutSA; + data['PatientType'] = this.patientType; + data['PatientTypeID'] = this.patientTypeID; + data['SessionID'] = this.sessionID; + data['TokenID'] = this.tokenID; + data['VersionID'] = this.versionID; + data['Weight'] = this.weight; + data['ZipCode'] = this.zipCode; + return data; + } +} \ No newline at end of file diff --git a/lib/core/service/AlHabibMedicalService/H2O_service.dart b/lib/core/service/AlHabibMedicalService/H2O_service.dart index c65221c5..9483bc31 100644 --- a/lib/core/service/AlHabibMedicalService/H2O_service.dart +++ b/lib/core/service/AlHabibMedicalService/H2O_service.dart @@ -1,5 +1,7 @@ import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/H2O/insert_user_activity_request_model.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/H2O/user_detail_model.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/H2O/user_detail_request_model.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/H2O/user_progress_for_month_data_model.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/H2O/user_progress_for_today_data_model.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/H2O/user_progress_for_week_data_model.dart'; @@ -10,8 +12,66 @@ class H2OService extends BaseService { List userProgressForTodayDataList = List(); List userProgressForWeekDataList = List(); List userProgressForMonthDataList = List(); - UserProgressRequestModel userProgressRequestModel = - UserProgressRequestModel(); + UserProgressRequestModel userProgressRequestModel = UserProgressRequestModel(); + + UserDetailModel userDetailModel = UserDetailModel(); + + Future getUserDetail() async { + userProgressRequestModel.progress = 1; + userProgressRequestModel.mobileNumber = user.mobileNumber.substring(1); + userProgressRequestModel.identificationNo = user.patientIdentificationNo; + + hasError = false; + await baseAppClient.post(H2O_GET_USER_DETAIL, onSuccess: (dynamic response, int statusCode) { + userDetailModel = UserDetailModel.fromJson(response["UserDetailData_New"]); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: userProgressRequestModel.toJson()); + } + + Future updateUserDetail(UserDetailModel userDetail) async { + userProgressRequestModel.progress = 1; + userProgressRequestModel.mobileNumber = user.mobileNumber.substring(1); + userProgressRequestModel.identificationNo = user.patientIdentificationNo; + + UserDetailRequestModel _requestModel = UserDetailRequestModel(); + + _requestModel.activityID = userDetail.activityID.toString(); + _requestModel.channel = userProgressRequestModel.channel; + _requestModel.dOB = userDetail.dOB; + _requestModel.deviceTypeID = userProgressRequestModel.deviceTypeID; + _requestModel.email = userDetail.emailID; + _requestModel.firstName = userDetail.firstName; + _requestModel.gender = userDetail.gender; + _requestModel.height = userDetail.height; + _requestModel.iPAdress = userProgressRequestModel.iPAdress; + _requestModel.identificationNo = userProgressRequestModel.identificationNo; + _requestModel.isHeightInCM = userDetail.isHeightInCM; + _requestModel.isWeightInKG = userDetail.isWeightInKG; + _requestModel.languageID = userProgressRequestModel.languageID; + _requestModel.mobileNumber = userProgressRequestModel.mobileNumber; + _requestModel.patientID = userProgressRequestModel.patientID; + _requestModel.patientOutSA = userProgressRequestModel.patientOutSA; + _requestModel.patientType = userProgressRequestModel.patientType; + _requestModel.patientTypeID = userProgressRequestModel.patientOutSA; + _requestModel.sessionID = userProgressRequestModel.sessionID; + _requestModel.tokenID = userProgressRequestModel.tokenID; + _requestModel.versionID = userProgressRequestModel.versionID; + _requestModel.zipCode = userDetail.zipCode; + _requestModel.weight = userDetail.weight; + _requestModel.generalid = userProgressRequestModel.generalid; + _requestModel.isDentalAllowedBackend = userProgressRequestModel.isDentalAllowedBackend; + _requestModel.isNotificationOn = userDetail.isNotificationON; + + hasError = false; + await baseAppClient.post(H2O_UPDATE_USER_DETAIL, onSuccess: (dynamic response, int statusCode) { + userDetailModel = userDetail; + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: _requestModel.toJson()); + } Future getUserProgressForTodayData() async { userProgressRequestModel.progress = 1; @@ -19,12 +79,10 @@ class H2OService extends BaseService { userProgressRequestModel.identificationNo = user.patientIdentificationNo; hasError = false; - await baseAppClient.post(H2O_GET_USER_PROGRESS, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(H2O_GET_USER_PROGRESS, onSuccess: (dynamic response, int statusCode) { userProgressForTodayDataList.clear(); response['UserProgressForTodayData'].forEach((progressData) { - userProgressForTodayDataList - .add(UserProgressForTodayDataModel.fromJson(progressData)); + userProgressForTodayDataList.add(UserProgressForTodayDataModel.fromJson(progressData)); }); }, onFailure: (String error, int statusCode) { hasError = true; @@ -38,16 +96,15 @@ class H2OService extends BaseService { userProgressRequestModel.identificationNo = super.user.patientIdentificationNo; hasError = false; - await baseAppClient.post(H2O_GET_USER_PROGRESS, - onSuccess: (dynamic response, int statusCode) { - userProgressForTodayDataList.clear(); - response['UserProgressForWeekData'].forEach((hospital) { - userProgressForWeekDataList.add(UserProgressForWeekDataModel.fromJson(hospital)); - }); - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, body: userProgressRequestModel.toJson()); + await baseAppClient.post(H2O_GET_USER_PROGRESS, onSuccess: (dynamic response, int statusCode) { + userProgressForWeekDataList.clear(); + response['UserProgressForWeekData'].forEach((hospital) { + userProgressForWeekDataList.add(UserProgressForWeekDataModel.fromJson(hospital)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: userProgressRequestModel.toJson()); } Future getUserProgressForMonthData() async { @@ -56,8 +113,7 @@ class H2OService extends BaseService { userProgressRequestModel.identificationNo = super.user.patientIdentificationNo; hasError = false; - await baseAppClient.post(H2O_GET_USER_PROGRESS, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(H2O_GET_USER_PROGRESS, onSuccess: (dynamic response, int statusCode) { userProgressForMonthDataList.clear(); response['UserProgressForMonthData'].forEach((hospital) { userProgressForMonthDataList.add(UserProgressForMonthDataModel.fromJson(hospital)); @@ -68,22 +124,33 @@ class H2OService extends BaseService { }, body: userProgressRequestModel.toJson()); } - - - Future insertUserActivity(InsertUserActivityRequestModel insertUserActivityRequestModel) async { + hasError = false; + await baseAppClient.post(H2O_INSERT_USER_ACTIVITY, onSuccess: (dynamic response, int statusCode) { + userProgressForTodayDataList.clear(); + response['UserProgressForTodayData'].forEach((progressData) { + userProgressForTodayDataList.add(UserProgressForTodayDataModel.fromJson(progressData)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: insertUserActivityRequestModel.toJson()); + } + + Future undoUserActivity() async { + userProgressRequestModel.progress = 1; + userProgressRequestModel.mobileNumber = user.mobileNumber.substring(1); + userProgressRequestModel.identificationNo = user.patientIdentificationNo; hasError = false; - await baseAppClient.post(H2O_INSERT_USER_ACTIVITY, - onSuccess: (dynamic response, int statusCode) { - userProgressForTodayDataList.clear(); - response['UserProgressForTodayData'].forEach((progressData) { - userProgressForTodayDataList - .add(UserProgressForTodayDataModel.fromJson(progressData)); - }); - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, body: insertUserActivityRequestModel.toJson()); + await baseAppClient.post(H2O_UNDO_USER_ACTIVITY, onSuccess: (dynamic response, int statusCode) { + userProgressForTodayDataList.clear(); + response['UserProgressForTodayData'].forEach((progressData) { + userProgressForTodayDataList.add(UserProgressForTodayDataModel.fromJson(progressData)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: userProgressRequestModel.toJson()); } } diff --git a/lib/core/viewModels/AlHabibMedicalService/H2O_view_model.dart b/lib/core/viewModels/AlHabibMedicalService/H2O_view_model.dart index 15b00e37..a89ec799 100644 --- a/lib/core/viewModels/AlHabibMedicalService/H2O_view_model.dart +++ b/lib/core/viewModels/AlHabibMedicalService/H2O_view_model.dart @@ -1,26 +1,54 @@ import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/H2O/insert_user_activity_request_model.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/H2O/user_detail_model.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/H2O/user_progress_for_month_data_model.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/H2O/user_progress_for_today_data_model.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/H2O/user_progress_for_week_data_model.dart'; import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/H2O_service.dart'; import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; import 'package:charts_flutter/flutter.dart' as charts; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import '../../../locator.dart'; class H2OViewModel extends BaseViewModel { - H2OService _h2OService = locator(); List userProgressForWeekDataSeries; List userProgressForMonthDataSeries; + UserDetailModel get userDetail => _h2OService.userDetailModel; + UserProgressForTodayDataModel get userProgressData { - if (_h2OService.userProgressForTodayDataList.length != 0) - return _h2OService.userProgressForTodayDataList[0]; - return null; + if (_h2OService.userProgressForTodayDataList.length != 0) return _h2OService.userProgressForTodayDataList[0]; + return null; } + Future getUserDetail() async { + // if(_h2OService.userProgressForTodayDataList.length==0){ + setState(ViewState.Busy); + await _h2OService.getUserDetail(); + if (_h2OService.hasError) { + error = _h2OService.error; + setState(ViewState.Error); + } else { + setState(ViewState.Idle); + } + } + + Future updateUserDetail(UserDetailModel userDetailModel, Function(bool) onResponse) async { + setState(ViewState.Busy); + + await _h2OService.updateUserDetail(userDetailModel); + if (_h2OService.hasError) { + error = _h2OService.error; + setState(ViewState.Error); + onResponse(false); + } else { + _h2OService.userDetailModel = userDetailModel; + setState(ViewState.Idle); + onResponse(true); + } + } Future getUserProgressForTodayData() async { // if(_h2OService.userProgressForTodayDataList.length==0){ @@ -58,13 +86,9 @@ class H2OViewModel extends BaseViewModel { } } - - List> createUserProgressForWeekDataSeries() { - List globalData = [ - ]; - _h2OService.userProgressForWeekDataList.forEach(( - UserProgressForWeekDataModel data) { + List> createUserProgressForWeekDataSeries() { + List globalData = []; + _h2OService.userProgressForWeekDataList.forEach((UserProgressForWeekDataModel data) { globalData.add(new ChartSeries(data.dayName, data.percentageConsumed)); }); return [ @@ -77,12 +101,9 @@ class H2OViewModel extends BaseViewModel { ]; } - List> createUserProgressForMonthDataSeries() { - List globalData = [ - ]; - _h2OService.userProgressForMonthDataList.forEach(( - UserProgressForMonthDataModel data) { + List> createUserProgressForMonthDataSeries() { + List globalData = []; + _h2OService.userProgressForMonthDataList.forEach((UserProgressForMonthDataModel data) { globalData.add(new ChartSeries(data.monthName, data.percentageConsumed)); }); return [ @@ -95,14 +116,10 @@ class H2OViewModel extends BaseViewModel { ]; } - - Future insertUserActivity( - InsertUserActivityRequestModel insertUserActivityRequestModel) async { + Future insertUserActivity(InsertUserActivityRequestModel insertUserActivityRequestModel) async { setState(ViewState.BusyLocal); - insertUserActivityRequestModel.mobileNumber = - user.mobileNumber.substring(1); - insertUserActivityRequestModel.identificationNo = - user.patientIdentificationNo; + insertUserActivityRequestModel.mobileNumber = user.mobileNumber.substring(1); + insertUserActivityRequestModel.identificationNo = user.patientIdentificationNo; await _h2OService.insertUserActivity(insertUserActivityRequestModel); if (_h2OService.hasError) { @@ -113,9 +130,18 @@ class H2OViewModel extends BaseViewModel { } } + Future undoUserActivity() async { + setState(ViewState.BusyLocal); + await _h2OService.undoUserActivity(); + if (_h2OService.hasError) { + error = _h2OService.error; + setState(ViewState.ErrorLocal); + } else { + setState(ViewState.Idle); + } + } } - /// Sample ordinal data type. class ChartSeries { final String y; diff --git a/lib/core/viewModels/pharmacy_categorise_view_model.dart b/lib/core/viewModels/pharmacy_categorise_view_model.dart index 5e1f4f9f..d26d860d 100644 --- a/lib/core/viewModels/pharmacy_categorise_view_model.dart +++ b/lib/core/viewModels/pharmacy_categorise_view_model.dart @@ -16,30 +16,22 @@ import 'base_view_model.dart'; class PharmacyCategoriseViewModel extends BaseViewModel { bool hasError = false; - PharmacyCategoriseService _pharmacyCategoriseService = - locator(); + PharmacyCategoriseService _pharmacyCategoriseService = locator(); - List get categorise => - _pharmacyCategoriseService.categoriseList; + List get categorise => _pharmacyCategoriseService.categoriseList; - List get categoriseParent => - _pharmacyCategoriseService.parentCategoriseList; + List get categoriseParent => _pharmacyCategoriseService.parentCategoriseList; - List get parentProducts => - _pharmacyCategoriseService.parentProductsList; + List get parentProducts => _pharmacyCategoriseService.parentProductsList; - List get subCategorise => - _pharmacyCategoriseService.subCategoriseList; + List get subCategorise => _pharmacyCategoriseService.subCategoriseList; - List get subProducts => - _pharmacyCategoriseService.subProductsList; + List get subProducts => _pharmacyCategoriseService.subProductsList; - List get finalProducts => - _pharmacyCategoriseService.finalProducts; + List get finalProducts => _pharmacyCategoriseService.finalProducts; List get brandsList => _pharmacyCategoriseService.brandsList; - List get searchList => - _pharmacyCategoriseService.searchList; + List get searchList => _pharmacyCategoriseService.searchList; List get scanList => _pharmacyCategoriseService.scanList; diff --git a/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart b/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart index dfb53471..d81fe78f 100644 --- a/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart +++ b/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart @@ -311,7 +311,7 @@ class _AllHabibMedicalServiceState extends State { // ), // ), imageLocation: 'assets/images/new-design/water_icon.png', - title: 'H2O', + title: TranslationBase.of(context).h2o, ), if (projectViewModel.havePrivilege(41)) ServicesContainer( diff --git a/lib/pages/AlHabibMedicalService/h2o/Dialog/confirm_add_amount_dialog.dart b/lib/pages/AlHabibMedicalService/h2o/Dialog/confirm_add_amount_dialog.dart index 9ca557af..1558b8c7 100644 --- a/lib/pages/AlHabibMedicalService/h2o/Dialog/confirm_add_amount_dialog.dart +++ b/lib/pages/AlHabibMedicalService/h2o/Dialog/confirm_add_amount_dialog.dart @@ -31,7 +31,7 @@ class _ConfirmAddAmountDialogState extends State { titlePadding: EdgeInsets.fromLTRB(24.0, 16.0, 24.0, 8.0), title: Center( child: Texts( - "Confirm", + TranslationBase.of(context).confirm, textAlign: TextAlign.center, color: Colors.black, ), @@ -42,7 +42,7 @@ class _ConfirmAddAmountDialogState extends State { Divider(), Center( child: Texts( - "Are you sure you want to Add ${widget.amount} ${widget.unit} ?", + "${TranslationBase.of(context).areyousure} ${widget.amount} ${widget.unit} ?", textAlign: TextAlign.center, color: Colors.grey, ), diff --git a/lib/pages/AlHabibMedicalService/h2o/Dialog/select_amount_dialog.dart b/lib/pages/AlHabibMedicalService/h2o/Dialog/select_amount_dialog.dart index d70aec4e..dd67d098 100644 --- a/lib/pages/AlHabibMedicalService/h2o/Dialog/select_amount_dialog.dart +++ b/lib/pages/AlHabibMedicalService/h2o/Dialog/select_amount_dialog.dart @@ -1,3 +1,5 @@ +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:flutter/cupertino.dart'; @@ -5,25 +7,33 @@ import 'package:flutter/material.dart'; // ignore: must_be_immutable class SelectAmountDialog extends StatefulWidget { - List searchAmount = [ - AmountModel(name: "l",nameAr:"لتر",value: 1), - AmountModel(name: "ml",nameAr:"مم لتر",value: 2), - ]; final Function(AmountModel) onValueSelected; AmountModel selectedAmount; - SelectAmountDialog( - {Key key, this.onValueSelected, this.selectedAmount}); + SelectAmountDialog({Key key, this.onValueSelected, this.selectedAmount}); @override _SelectAmountDialogState createState() => _SelectAmountDialogState(); } class _SelectAmountDialogState extends State { + + List searchAmount = [ + AmountModel(name: "l", nameAr: "لتر", value: 1), + AmountModel(name: "ml", nameAr: "مم لتر", value: 2), + ]; @override void initState() { super.initState(); - widget.selectedAmount = widget.selectedAmount ?? widget.searchAmount[0]; + widget.selectedAmount = widget.selectedAmount ?? searchAmount[0]; + } + + String languageID = "en"; + + void getLanguage() async { + languageID = await sharedPref.getString(APP_LANGUAGE); + print(languageID); + setState(() {}); } @override @@ -32,11 +42,14 @@ class _SelectAmountDialogState extends State { children: [ Column( children: [ - Texts("Select the preferred unit", fontSize: 20,), + Texts( + TranslationBase.of(context).preferredunit, + fontSize: 20, + ), Divider(), ...List.generate( - widget.searchAmount.length, - (index) => Column( + searchAmount.length, + (index) => Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ SizedBox( @@ -49,13 +62,13 @@ class _SelectAmountDialogState extends State { child: InkWell( onTap: () { setState(() { - widget.selectedAmount = widget.searchAmount[index]; + widget.selectedAmount = searchAmount[index]; }); }, child: ListTile( - title: Text(widget.searchAmount[index].name), + title: Text(languageID == "ar" ? searchAmount[index].nameAr : searchAmount[index].name), leading: Radio( - value: widget.searchAmount[index], + value: searchAmount[index], groupValue: widget.selectedAmount, activeColor: Colors.red[800], onChanged: (value) { @@ -116,9 +129,9 @@ class _SelectAmountDialogState extends State { padding: const EdgeInsets.all(8.0), child: Center( child: Texts( - TranslationBase.of(context).ok, - fontWeight: FontWeight.w400, - )), + TranslationBase.of(context).ok, + fontWeight: FontWeight.w400, + )), ), ), ), @@ -130,6 +143,7 @@ class _SelectAmountDialogState extends State { ); } } + class AmountModel { String name; String nameAr; @@ -151,7 +165,3 @@ class AmountModel { return data; } } - - - - diff --git a/lib/pages/AlHabibMedicalService/h2o/Dialog/setting_page_radio_button_list_dialog.dart b/lib/pages/AlHabibMedicalService/h2o/Dialog/setting_page_radio_button_list_dialog.dart new file mode 100644 index 00000000..580207d8 --- /dev/null +++ b/lib/pages/AlHabibMedicalService/h2o/Dialog/setting_page_radio_button_list_dialog.dart @@ -0,0 +1,101 @@ +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:flutter/material.dart'; + +class CommonRadioButtonDialog extends StatefulWidget { + final List list; + final String title; + final int selectedIndex; + final Function(int) onSelect; + CommonRadioButtonDialog({Key key, this.title = "", this.selectedIndex = 0, this.list, this.onSelect}) : super(key: key); + + @override + _CommonRadioButtonDialogState createState() { + return _CommonRadioButtonDialogState(); + } +} + +class _CommonRadioButtonDialogState extends State { + int _selectedIndex = 0; + + @override + void initState() { + super.initState(); + _selectedIndex = widget.selectedIndex; + } + + @override + void dispose() { + super.dispose(); + } + + @override + Widget build(BuildContext context) { + return Dialog( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(4), + ), + elevation: 0, + backgroundColor: Colors.white, + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Container( + height: widget.title == "" ? 24 : 50, + alignment: Alignment.center, + child: Text( + widget.title, + style: TextStyle(color: Colors.black87, fontSize: 18, fontWeight: FontWeight.w500), + ), + ), + Divider(height: 1, color: Colors.black38), + ListView.builder( + shrinkWrap: true, + padding: EdgeInsets.only(top: 4, bottom: 4), + physics: NeverScrollableScrollPhysics(), + itemBuilder: (context, index) { + return RadioListTile( + value: index, + dense: true, + activeColor: Colors.black54, + groupValue: _selectedIndex, + onChanged: (_index) => setState(() => _selectedIndex = _index), + title: Text( + widget.list[index], + style: TextStyle(fontWeight: FontWeight.w500), + ), + ); + }, + itemCount: widget.list?.length ?? 0, + ), + Divider(height: 1, color: Colors.black38), + Container( + height: 50, + alignment: Alignment.center, + child: Row( + children: [ + Expanded( + child: FlatButton( + child: Text( + TranslationBase.of(context).cancel, + style: TextStyle(color: Colors.redAccent, fontSize: 16, fontWeight: FontWeight.w500), + ), + onPressed: () => Navigator.pop(context), + ), + ), + Expanded( + child: FlatButton( + child: Text( + TranslationBase.of(context).ok, + style: TextStyle(color: Colors.black87, fontSize: 16, fontWeight: FontWeight.w500), + ), + onPressed: () => widget.onSelect(_selectedIndex), + ), + ) + ], + ), + ), + ], + ), + ); + } +} diff --git a/lib/pages/AlHabibMedicalService/h2o/add_custom_amount.dart b/lib/pages/AlHabibMedicalService/h2o/add_custom_amount.dart index 036ed186..2b22a100 100644 --- a/lib/pages/AlHabibMedicalService/h2o/add_custom_amount.dart +++ b/lib/pages/AlHabibMedicalService/h2o/add_custom_amount.dart @@ -1,6 +1,7 @@ import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/H2O_view_model.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/h2o/Dialog/confirm_add_amount_dialog.dart'; import 'package:diplomaticquarterapp/pages/medical/balance/new_text_Field.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; @@ -36,7 +37,7 @@ class _AddCustomAmountState extends State { Widget build(BuildContext context) { return AppScaffold( isShowAppBar: true, - appBarTitle: "Enter amount", + appBarTitle:TranslationBase.of(context).customLabel, body: SingleChildScrollView( physics: ScrollPhysics(), child: Container( @@ -51,7 +52,7 @@ class _AddCustomAmountState extends State { height: 12, ), NewTextFields( - hintText: "Enter the amount of water:", + hintText: TranslationBase.of(context).h2oAmountOfWater, // type: "Number", controller: _nameTextController, ), @@ -81,7 +82,7 @@ class _AddCustomAmountState extends State { ), SecondaryButton( textColor: Colors.white, - label: "OK", + label: TranslationBase.of(context).ok, onTap: () async { Navigator.of(context).pop(); showConfirmMessage (int.parse(_nameTextController.text), widget.model); @@ -120,7 +121,7 @@ void confirmAmountTypeDialog() { if (selectedAmount != null) return selectedAmount.name; else - return "Select unit"; + return TranslationBase.of(context).selectUnit; } diff --git a/lib/pages/AlHabibMedicalService/h2o/h2o_page.dart b/lib/pages/AlHabibMedicalService/h2o/h2o_page.dart index 89e4b774..b4d39682 100644 --- a/lib/pages/AlHabibMedicalService/h2o/h2o_page.dart +++ b/lib/pages/AlHabibMedicalService/h2o/h2o_page.dart @@ -1,12 +1,15 @@ import 'dart:ui'; import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/H2O_view_model.dart'; +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/h2o/h20_setting.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/h2o/month_page.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/h2o/today_page.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/h2o/week_page.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -34,9 +37,26 @@ class _H2OPageState extends State @override Widget build(BuildContext context) { return BaseView( + onModelReady: (model) => model.getUserDetail(), builder: (_, model, widget) => AppScaffold( isShowAppBar: true, - appBarTitle: "Water Tracker", + appBarTitle: TranslationBase.of(context).waterTracker, + showHomeAppBarIcon: false, + baseViewModel: model, + appBarIcons: [ + IconButton( + icon: Image.asset("assets/images/new-design/setting_gear_icon.png"), + color: Colors.white, + onPressed: () { + Navigator.push( + context, + FadePage( + page: H2oSetting(userDetailModel: model.userDetail, viewModel: model), + ), + ); + }, + ), + ], body: Scaffold( extendBodyBehindAppBar: true, appBar: PreferredSize( @@ -50,9 +70,7 @@ class _H2OPageState extends State child: BackdropFilter( filter: ImageFilter.blur(sigmaX: 10, sigmaY: 10), child: Container( - color: Theme.of(context) - .scaffoldBackgroundColor - .withOpacity(0.8), + color: Theme.of(context).scaffoldBackgroundColor.withOpacity(0.8), height: 70.0, ), ), @@ -77,19 +95,19 @@ class _H2OPageState extends State Container( width: MediaQuery.of(context).size.width * 0.28, child: Center( - child: Texts("Today"), + child: Texts(TranslationBase.of(context).today), ), ), Container( width: MediaQuery.of(context).size.width * 0.28, child: Center( - child: Texts("Week"), + child: Texts(TranslationBase.of(context).week), ), ), Container( width: MediaQuery.of(context).size.width * 0.28, child: Center( - child: Texts("Month"), + child: Texts(TranslationBase.of(context).month), ), ), ], diff --git a/lib/pages/AlHabibMedicalService/h2o/month_page.dart b/lib/pages/AlHabibMedicalService/h2o/month_page.dart index 9b255d9e..e0118495 100644 --- a/lib/pages/AlHabibMedicalService/h2o/month_page.dart +++ b/lib/pages/AlHabibMedicalService/h2o/month_page.dart @@ -16,7 +16,7 @@ class MonthPage extends StatelessWidget { onModelReady: (model) => model.getUserProgressForMonthData(), builder: (_, model, widget) => AppScaffold( isShowAppBar: false, - appBarTitle: "Water Tracker", + appBarTitle: TranslationBase.of(context).h2o, baseViewModel: model, body: Padding( padding: EdgeInsets.all(8.0), diff --git a/lib/pages/AlHabibMedicalService/h2o/today_page.dart b/lib/pages/AlHabibMedicalService/h2o/today_page.dart index 8aacf15c..33383287 100644 --- a/lib/pages/AlHabibMedicalService/h2o/today_page.dart +++ b/lib/pages/AlHabibMedicalService/h2o/today_page.dart @@ -1,6 +1,7 @@ import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/H2O_view_model.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/h2o/widgets/h20_floating_action_button.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -14,7 +15,7 @@ class TodayPage extends StatelessWidget { onModelReady: (model) => model.getUserProgressForTodayData(), builder: (_, model, widget) => AppScaffold( isShowAppBar: false, - appBarTitle: "Water Tracker", + appBarTitle: TranslationBase.of(context).h2o, baseViewModel: model, body: SingleChildScrollView( padding: EdgeInsets.symmetric(vertical: 12), @@ -42,14 +43,16 @@ class TodayPage extends StatelessWidget { // height: 40, // ), Text( - "Consumed", + TranslationBase.of(context).consumed, style: TextStyle(fontSize: 16.0), ), SizedBox( height: 4, ), Text( - model.userProgressData == null ? "0.0" : model.userProgressData.quantityConsumed.toString() + 'ml', + model.userProgressData == null + ? "0.0" + : model.userProgressData.quantityConsumed.toString() + TranslationBase.of(context).ml, style: TextStyle(fontWeight: FontWeight.bold, fontSize: 14.0, color: HexColor("#60BCF9")), ), SizedBox( @@ -64,7 +67,7 @@ class TodayPage extends StatelessWidget { height: 4, ), Text( - "Remaining", + TranslationBase.of(context).remaining, style: TextStyle(fontSize: 16.0), ), SizedBox( @@ -74,8 +77,9 @@ class TodayPage extends StatelessWidget { model.userProgressData == null ? "0.0" : (model.userProgressData.quantityLimit - model.userProgressData.quantityConsumed) < 0 - ? "0 ml" - : (model.userProgressData.quantityLimit - model.userProgressData.quantityConsumed).toString() + ' ml', + ? "0 ${TranslationBase.of(context).ml}" + : (model.userProgressData.quantityLimit - model.userProgressData.quantityConsumed).toString() + + ' ${TranslationBase.of(context).ml}', style: TextStyle(fontWeight: FontWeight.bold, fontSize: 14.0), ), ], @@ -99,7 +103,7 @@ class TodayPage extends StatelessWidget { decoration: BoxDecoration(color: HexColor("#D1E3F6"), borderRadius: BorderRadius.all(Radius.circular(30))), ), Text( - "Remaining %", + "${TranslationBase.of(context).remaining} %", style: TextStyle(fontSize: 16.0), ) ], @@ -114,7 +118,7 @@ class TodayPage extends StatelessWidget { decoration: BoxDecoration(color: HexColor("#60BCF9"), borderRadius: BorderRadius.all(Radius.circular(30))), ), Text( - "Consumed %", + "${TranslationBase.of(context).consumed} %", style: TextStyle(fontSize: 16.0), ) ], diff --git a/lib/pages/AlHabibMedicalService/h2o/week_page.dart b/lib/pages/AlHabibMedicalService/h2o/week_page.dart index a9131199..34e365e6 100644 --- a/lib/pages/AlHabibMedicalService/h2o/week_page.dart +++ b/lib/pages/AlHabibMedicalService/h2o/week_page.dart @@ -16,7 +16,7 @@ class WeekPage extends StatelessWidget { onModelReady: (model) => model.getUserProgressForWeekData(), builder: (_, model, widget) => AppScaffold( isShowAppBar: false, - appBarTitle: "Water Tracker", + appBarTitle: TranslationBase.of(context).h2o, baseViewModel: model, body: Padding( padding: EdgeInsets.all(8.0), diff --git a/lib/pages/AlHabibMedicalService/h2o/widgets/h20_floating_action_button.dart b/lib/pages/AlHabibMedicalService/h2o/widgets/h20_floating_action_button.dart index bc19e6e9..b692e6ba 100644 --- a/lib/pages/AlHabibMedicalService/h2o/widgets/h20_floating_action_button.dart +++ b/lib/pages/AlHabibMedicalService/h2o/widgets/h20_floating_action_button.dart @@ -4,6 +4,7 @@ import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/H2O/insert import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/H2O_view_model.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/h2o/Dialog/confirm_add_amount_dialog.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; @@ -31,19 +32,20 @@ class _H20FloatingActionButtonState extends State with super.initState(); } + void showConfirmMessage(int amount, H2OViewModel model) { + showDialog( + context: context, + child: ConfirmAddAmountDialog( + model: model, + amount: amount, + ), + ); + } + @override Widget build(BuildContext context) { - void showConfirmMessage(int amount, H2OViewModel model) { - showDialog( - context: context, - child: ConfirmAddAmountDialog( - model: model, - amount: amount, - )); - } - return Container( - margin: EdgeInsets.only(left: 20), + margin: EdgeInsets.only(left: 20, right: 20), child: new Column(mainAxisSize: MainAxisSize.min, children: [ Row( mainAxisAlignment: MainAxisAlignment.start, @@ -53,21 +55,21 @@ class _H20FloatingActionButtonState extends State with children: [ ActionButton( controller: _controller, - text: "600ml", + text: "600${TranslationBase.of(context).ml}", onTap: () { showConfirmMessage(600, widget.model); }, ), ActionButton( controller: _controller, - text: "330ml", + text: "330${TranslationBase.of(context).ml}", onTap: () { showConfirmMessage(330, widget.model); }, ), ActionButton( controller: _controller, - text: "200ml", + text: "200${TranslationBase.of(context).ml}", onTap: () { showConfirmMessage(200, widget.model); }, @@ -112,7 +114,7 @@ class _H20FloatingActionButtonState extends State with heroTag: null, // mini: true, child: Text( - "Custom", + TranslationBase.of(context).custom, textAlign: TextAlign.center, style: TextStyle(fontSize: 12, color: Colors.grey), ), @@ -142,11 +144,11 @@ class _H20FloatingActionButtonState extends State with heroTag: null, //mini: true, child: Text( - "Undo", + TranslationBase.of(context).undo, textAlign: TextAlign.center, style: TextStyle(fontSize: 12.0, color: Colors.grey), ), - onPressed: () {}, + onPressed: undoVolume, ), ), ), @@ -155,6 +157,12 @@ class _H20FloatingActionButtonState extends State with ]), ); } + + void undoVolume() async { + GifLoaderDialogUtils.showMyDialog(context); + await widget.model.undoUserActivity(); + GifLoaderDialogUtils.hideDialog(context); + } } class ActionButton extends StatelessWidget { diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index 48dcb8eb..c3acb5fd 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -18,8 +18,7 @@ class TranslationBase { return localizedValues[key][locale.languageCode]; } - String get dashboardScreenToolbarTitle => - localizedValues['dashboardScreenToolbarTitle'][locale.languageCode]; + String get dashboardScreenToolbarTitle => localizedValues['dashboardScreenToolbarTitle'][locale.languageCode]; String get settings => localizedValues['settings'][locale.languageCode]; @@ -59,11 +58,9 @@ class TranslationBase { String get nearestAppo => localizedValues['nearestAppo'][locale.languageCode]; - String get searchByDocText => - localizedValues['searchByDocText'][locale.languageCode]; + String get searchByDocText => localizedValues['searchByDocText'][locale.languageCode]; - String get enterDocName => - localizedValues['enterDocName'][locale.languageCode]; + String get enterDocName => localizedValues['enterDocName'][locale.languageCode]; String get search => localizedValues['search'][locale.languageCode]; @@ -73,41 +70,33 @@ class TranslationBase { String get appoInfo => localizedValues['appoInfo'][locale.languageCode]; - String get availableAppo => - localizedValues['availableAppo'][locale.languageCode]; + String get availableAppo => localizedValues['availableAppo'][locale.languageCode]; String get gender => localizedValues['gender'][locale.languageCode]; String get nationality => localizedValues['nationality'][locale.languageCode]; - String get docQualifications => - localizedValues['docQualifications'][locale.languageCode]; + String get docQualifications => localizedValues['docQualifications'][locale.languageCode]; - String get confirmAppoHeading => - localizedValues['confirmAppoHeading'][locale.languageCode]; + String get confirmAppoHeading => localizedValues['confirmAppoHeading'][locale.languageCode]; String get patientInfo => localizedValues['patientInfo'][locale.languageCode]; String get bookSuccess => localizedValues['bookSuccess'][locale.languageCode]; - String get patientShare => - localizedValues['patientShare'][locale.languageCode]; + String get patientShare => localizedValues['patientShare'][locale.languageCode]; - String get patientShareWithTax => - localizedValues['patientShareWithTax'][locale.languageCode]; + String get patientShareWithTax => localizedValues['patientShareWithTax'][locale.languageCode]; String get confirmAppo => localizedValues['confirmAppo'][locale.languageCode]; String get confirm => localizedValues['confirm'][locale.languageCode]; - String get confirmLiveCare => - localizedValues['confirmLiveCare'][locale.languageCode]; + String get confirmLiveCare => localizedValues['confirmLiveCare'][locale.languageCode]; - String get waitingForDoctor => - localizedValues['waitingForDoctor'][locale.languageCode]; + String get waitingForDoctor => localizedValues['waitingForDoctor'][locale.languageCode]; - String get confirmLater => - localizedValues['confirmLater'][locale.languageCode]; + String get confirmLater => localizedValues['confirmLater'][locale.languageCode]; String get todoList => localizedValues['todoList'][locale.languageCode]; @@ -123,27 +112,22 @@ class TranslationBase { String get login => localizedValues['login'][locale.languageCode]; - String get loginregister => - localizedValues['loginregister'][locale.languageCode]; + String get loginregister => localizedValues['loginregister'][locale.languageCode]; String get poweredBy => localizedValues['poweredBy'][locale.languageCode]; String get welcome => localizedValues['welcome'][locale.languageCode]; - String get welcomeText => - localizedValues['welcome_text'][locale.languageCode]; + String get welcomeText => localizedValues['welcome_text'][locale.languageCode]; - String get welcomeText2 => - localizedValues['welcome_text2'][locale.languageCode]; + String get welcomeText2 => localizedValues['welcome_text2'][locale.languageCode]; String get yes => localizedValues['yes'][locale.languageCode]; String get no => localizedValues['no'][locale.languageCode]; - String get logintypeRadio => - localizedValues['logintyperadio'][locale.languageCode]; - String get registerInfoFamily => - localizedValues['register-info-family'][locale.languageCode]; + String get logintypeRadio => localizedValues['logintyperadio'][locale.languageCode]; + String get registerInfoFamily => localizedValues['register-info-family'][locale.languageCode]; String get registerNow => localizedValues['registernow'][locale.languageCode]; @@ -153,17 +137,13 @@ class TranslationBase { String get fileNo => localizedValues['fileNo'][locale.languageCode]; String get fileno => localizedValues['fileno'][locale.languageCode]; - String get forgotPassword => - localizedValues['forgotFileNo'][locale.languageCode]; + String get forgotPassword => localizedValues['forgotFileNo'][locale.languageCode]; - String get forgotFileNoTitle => - localizedValues['forgotFileNoTitle'][locale.languageCode]; + String get forgotFileNoTitle => localizedValues['forgotFileNoTitle'][locale.languageCode]; - String get enterNationalId => - localizedValues['enter-national-id'][locale.languageCode]; + String get enterNationalId => localizedValues['enter-national-id'][locale.languageCode]; - String get profileInfo => - localizedValues['profile-info'][locale.languageCode]; + String get profileInfo => localizedValues['profile-info'][locale.languageCode]; String get submit => localizedValues['submit'][locale.languageCode]; @@ -173,42 +153,31 @@ class TranslationBase { String get hijriDate => localizedValues['hijri-date'][locale.languageCode]; - String get gregorianDate => - localizedValues['gregorian-date'][locale.languageCode]; + String get gregorianDate => localizedValues['gregorian-date'][locale.languageCode]; - String get verifyLoginWith => - localizedValues['verify-login-with'][locale.languageCode]; + String get verifyLoginWith => localizedValues['verify-login-with'][locale.languageCode]; String get register => localizedValues['register-user'][locale.languageCode]; - String get verifyFingerprint => - localizedValues['verify-with-fingerprint'][locale.languageCode]; + String get verifyFingerprint => localizedValues['verify-with-fingerprint'][locale.languageCode]; - String get verifyFaceID => - localizedValues['verify-with-faceid'][locale.languageCode]; + String get verifyFaceID => localizedValues['verify-with-faceid'][locale.languageCode]; - String get verifySMS => - localizedValues['verify-with-sms'][locale.languageCode]; + String get verifySMS => localizedValues['verify-with-sms'][locale.languageCode]; - String get verifyWhatsApp => - localizedValues['verify-with-whatsapp'][locale.languageCode]; + String get verifyWhatsApp => localizedValues['verify-with-whatsapp'][locale.languageCode]; String get lastLoginAt => localizedValues['last-login'][locale.languageCode]; - String get lastLoginWith => - localizedValues['last-login-with'][locale.languageCode]; + String get lastLoginWith => localizedValues['last-login-with'][locale.languageCode]; - String get verifyFingerprint2 => - localizedValues['verify-fingerprint'][locale.languageCode]; + String get verifyFingerprint2 => localizedValues['verify-fingerprint'][locale.languageCode]; - String get searchMedicine => - localizedValues['searchMedicine'][locale.languageCode]; + String get searchMedicine => localizedValues['searchMedicine'][locale.languageCode]; - String get searchMedicineHere => - localizedValues['searchMedicineHere'][locale.languageCode]; + String get searchMedicineHere => localizedValues['searchMedicineHere'][locale.languageCode]; - String get pendingPayment => - localizedValues['pendingPayment'][locale.languageCode]; + String get pendingPayment => localizedValues['pendingPayment'][locale.languageCode]; String get payNow => localizedValues['payNow'][locale.languageCode]; @@ -218,33 +187,24 @@ class TranslationBase { String get livecare => localizedValues['livecare'][locale.languageCode]; - String get upcomingNoAction => - localizedValues['upcoming-noAction'][locale.languageCode]; + String get upcomingNoAction => localizedValues['upcoming-noAction'][locale.languageCode]; - String get upcomingConfirm => - localizedValues['upcoming-confirm'][locale.languageCode]; + String get upcomingConfirm => localizedValues['upcoming-confirm'][locale.languageCode]; - String get upcomingPaymentPending => - localizedValues['upcoming-payment-pending'][locale.languageCode]; - String get upcomingConfirmMore => - localizedValues['book-success-confirm-more-24-1-2'][locale.languageCode]; + String get upcomingPaymentPending => localizedValues['upcoming-payment-pending'][locale.languageCode]; + String get upcomingConfirmMore => localizedValues['book-success-confirm-more-24-1-2'][locale.languageCode]; - String get upcomingPaymentNow => - localizedValues['upcoming-payment-now'][locale.languageCode]; + String get upcomingPaymentNow => localizedValues['upcoming-payment-now'][locale.languageCode]; String get upcomingQR => localizedValues['upcoming-QR'][locale.languageCode]; - String get upcomingVirtual => - localizedValues['upcoming-virtual'][locale.languageCode]; + String get upcomingVirtual => localizedValues['upcoming-virtual'][locale.languageCode]; - String get upcomingLivecare => - localizedValues['upcoming-livecare'][locale.languageCode]; + String get upcomingLivecare => localizedValues['upcoming-livecare'][locale.languageCode]; - String get liveCareAppo => - localizedValues['livecareAppo'][locale.languageCode]; + String get liveCareAppo => localizedValues['livecareAppo'][locale.languageCode]; - String get upcomingDetails => - localizedValues['upcoming-details'][locale.languageCode]; + String get upcomingDetails => localizedValues['upcoming-details'][locale.languageCode]; String get reschedule => localizedValues['reschedule'][locale.languageCode]; @@ -262,97 +222,68 @@ class TranslationBase { String get payment => localizedValues['payment'][locale.languageCode]; - String get cancel_nocaps => - localizedValues['cancel-nocaps'][locale.languageCode]; + String get cancel_nocaps => localizedValues['cancel-nocaps'][locale.languageCode]; - String get cancelAppoMsg => - localizedValues['cancelAppoMsg'][locale.languageCode]; + String get cancelAppoMsg => localizedValues['cancelAppoMsg'][locale.languageCode]; - String get pharmaciesList => - localizedValues['pharmaciesList'][locale.languageCode]; + String get pharmaciesList => localizedValues['pharmaciesList'][locale.languageCode]; String get description => localizedValues['description'][locale.languageCode]; String get howToUse => localizedValues['howToUse'][locale.languageCode]; String get price => localizedValues['price'][locale.languageCode]; - String get youCanFindItIn => - localizedValues['youCanFindItIn'][locale.languageCode]; + String get youCanFindItIn => localizedValues['youCanFindItIn'][locale.languageCode]; - String get pleaseEnterMedicineName => - localizedValues['pleaseEnterMedicineName'][locale.languageCode]; + String get pleaseEnterMedicineName => localizedValues['pleaseEnterMedicineName'][locale.languageCode]; - String get verificationMessage => - localizedValues['verification_message'][locale.languageCode]; + String get verificationMessage => localizedValues['verification_message'][locale.languageCode]; - String get validationMessage => - localizedValues['validation_message'][locale.languageCode]; + String get validationMessage => localizedValues['validation_message'][locale.languageCode]; - String get arabicChange => - localizedValues['arabic-change'][locale.languageCode]; + String get arabicChange => localizedValues['arabic-change'][locale.languageCode]; - String get notification => - localizedValues['notification'][locale.languageCode]; + String get notification => localizedValues['notification'][locale.languageCode]; String get appsetting => localizedValues['app-settings'][locale.languageCode]; String get rateApp => localizedValues['rate-app'][locale.languageCode]; - String get setReminder => - localizedValues['set-reminder'][locale.languageCode]; + String get setReminder => localizedValues['set-reminder'][locale.languageCode]; String get before => localizedValues['before'][locale.languageCode]; String get minute => localizedValues['minute'][locale.languageCode]; String get hour => localizedValues['hour'][locale.languageCode]; - String get reminderSuccess => - localizedValues['reminderSuccess'][locale.languageCode]; - String get patientShareToDo => - localizedValues['patientShareToDo'][locale.languageCode]; - String get patientTaxToDo => - localizedValues['patientTaxToDo'][locale.languageCode]; - String get patientShareTotalToDo => - localizedValues['patientShareTotalToDo'][locale.languageCode]; - String get paymentMethod => - localizedValues['paymentMethod'][locale.languageCode]; + String get reminderSuccess => localizedValues['reminderSuccess'][locale.languageCode]; + String get patientShareToDo => localizedValues['patientShareToDo'][locale.languageCode]; + String get patientTaxToDo => localizedValues['patientTaxToDo'][locale.languageCode]; + String get patientShareTotalToDo => localizedValues['patientShareTotalToDo'][locale.languageCode]; + String get paymentMethod => localizedValues['paymentMethod'][locale.languageCode]; - String get moreVerification => - localizedValues['more-verify'][locale.languageCode]; + String get moreVerification => localizedValues['more-verify'][locale.languageCode]; - String get welcomeBack => - localizedValues['welcome-back'][locale.languageCode]; + String get welcomeBack => localizedValues['welcome-back'][locale.languageCode]; - String get accountInfo => - localizedValues['account-info'][locale.languageCode]; + String get accountInfo => localizedValues['account-info'][locale.languageCode]; - String get useAnotherAccount => - localizedValues['another-acc'][locale.languageCode]; + String get useAnotherAccount => localizedValues['another-acc'][locale.languageCode]; String get next => localizedValues['next'][locale.languageCode]; - String get noNeedToWaitInLine => - localizedValues['noNeedToWaitInLine'][locale.languageCode]; - String get useQRAppoAttend => - localizedValues['useQRAppoAttend'][locale.languageCode]; - String get passQRAppoAttend => - localizedValues['passQRAppoAttend'][locale.languageCode]; - String get sitWaitingQR => - localizedValues['sitWaitingQR'][locale.languageCode]; - String get attendRegisterCode => - localizedValues['attendRegisterCode'][locale.languageCode]; - String get scanQRHospital => - localizedValues['scanQRHospital'][locale.languageCode]; + String get noNeedToWaitInLine => localizedValues['noNeedToWaitInLine'][locale.languageCode]; + String get useQRAppoAttend => localizedValues['useQRAppoAttend'][locale.languageCode]; + String get passQRAppoAttend => localizedValues['passQRAppoAttend'][locale.languageCode]; + String get sitWaitingQR => localizedValues['sitWaitingQR'][locale.languageCode]; + String get attendRegisterCode => localizedValues['attendRegisterCode'][locale.languageCode]; + String get scanQRHospital => localizedValues['scanQRHospital'][locale.languageCode]; String get sendEmail => localizedValues['sendEmail'][locale.languageCode]; String get close => localizedValues['close'][locale.languageCode]; String get booked => localizedValues['booked'][locale.languageCode]; String get confirmed => localizedValues['confirmed'][locale.languageCode]; String get arrived => localizedValues['arrived'][locale.languageCode]; - String get payNowBookSuccess => - localizedValues['payNowBookSuccess'][locale.languageCode]; - String get payNowBookSuccesstext1 => - localizedValues['payNowBookSuccesstext1'][locale.languageCode]; - String get payNowBookSuccesstext2 => - localizedValues['payNowBookSuccesstext2'][locale.languageCode]; + String get payNowBookSuccess => localizedValues['payNowBookSuccess'][locale.languageCode]; + String get payNowBookSuccesstext1 => localizedValues['payNowBookSuccesstext1'][locale.languageCode]; + String get payNowBookSuccesstext2 => localizedValues['payNowBookSuccesstext2'][locale.languageCode]; String get payLater => localizedValues['payLater'][locale.languageCode]; - String get askDocNotAllowed => - localizedValues['askDocNotAllowed'][locale.languageCode]; + String get askDocNotAllowed => localizedValues['askDocNotAllowed'][locale.languageCode]; String get firstName => localizedValues['first-name'][locale.languageCode]; String get middleName => localizedValues['middle-name'][locale.languageCode]; @@ -363,15 +294,13 @@ class TranslationBase { String get female => localizedValues['female'][locale.languageCode]; - String get prefferedLanguage => - localizedValues['preferred-language'][locale.languageCode]; + String get prefferedLanguage => localizedValues['preferred-language'][locale.languageCode]; String get english => localizedValues['english'][locale.languageCode]; String get arabic => localizedValues['arabic'][locale.languageCode]; - String get registrLocation => - localizedValues['locations-register'][locale.languageCode]; + String get registrLocation => localizedValues['locations-register'][locale.languageCode]; String get ksa => localizedValues['ksa'][locale.languageCode]; @@ -381,26 +310,23 @@ class TranslationBase { String get family => localizedValues['family'][locale.languageCode]; - String get myFamilyFiles => - localizedValues['family-title'][locale.languageCode]; + String get myFamilyFiles => localizedValues['family-title'][locale.languageCode]; String get myFamily => localizedValues['myFamily'][locale.languageCode]; String get oxygenation => localizedValues['oxygenation'][locale.languageCode]; - String get respirationRate => - localizedValues['respirationRate'][locale.languageCode]; + String get respirationRate => localizedValues['respirationRate'][locale.languageCode]; - String get bodyMeasurements => - localizedValues['bodyMeasurements'][locale.languageCode]; + String get bodyMeasurements => localizedValues['bodyMeasurements'][locale.languageCode]; String get height => localizedValues['height'][locale.languageCode]; - + String get heightUnit => localizedValues['heightUnit'][locale.languageCode]; + String get weightUnit => localizedValues['weightUnit'][locale.languageCode]; String get temperature => localizedValues['temperature'][locale.languageCode]; String get pulse => localizedValues['pulse'][locale.languageCode]; String get respiration => localizedValues['respiration'][locale.languageCode]; - String get bloodPressure => - localizedValues['bloodPressure'][locale.languageCode]; + String get bloodPressure => localizedValues['bloodPressure'][locale.languageCode]; String get painScale => localizedValues['painScale'][locale.languageCode]; String get heart => localizedValues['heart'][locale.languageCode]; @@ -409,8 +335,7 @@ class TranslationBase { String get request => localizedValues['request'][locale.languageCode]; String get memberName => localizedValues['member-name'][locale.languageCode]; String get switchUser => localizedValues['switch-login'][locale.languageCode]; - String get removeMember => - localizedValues['remove-membe'][locale.languageCode]; + String get removeMember => localizedValues['remove-membe'][locale.languageCode]; String get allowView => localizedValues['allow-view'][locale.languageCode]; String get rejectView => localizedValues['reject-view'][locale.languageCode]; String get deleteView => localizedValues['delete-view'][locale.languageCode]; @@ -419,61 +344,40 @@ class TranslationBase { String get companyName => localizedValues['companyName'][locale.languageCode]; String get receiptOn => localizedValues['receiptOn'][locale.languageCode]; String get expiryDate => localizedValues['expiryDate'][locale.languageCode]; - String get procedureName => - localizedValues['procedureName'][locale.languageCode]; - String get procedureStatus => - localizedValues['procedureStatus'][locale.languageCode]; + String get procedureName => localizedValues['procedureName'][locale.languageCode]; + String get procedureStatus => localizedValues['procedureStatus'][locale.languageCode]; String get usageStatus => localizedValues['usageStatus'][locale.languageCode]; String get unusedCount => localizedValues['unusedCount'][locale.languageCode]; - String get totalApproval => - localizedValues['totalApproval'][locale.languageCode]; + String get totalApproval => localizedValues['totalApproval'][locale.languageCode]; String get category => localizedValues['category'][locale.languageCode]; - String get expirationDate => - localizedValues['expirationDate'][locale.languageCode]; + String get expirationDate => localizedValues['expirationDate'][locale.languageCode]; String get patientCard => localizedValues['patientCard'][locale.languageCode]; - String get policyNumber => - localizedValues['policyNumber'][locale.languageCode]; + String get policyNumber => localizedValues['policyNumber'][locale.languageCode]; String get seeDetails => localizedValues['seeDetails'][locale.languageCode]; - String get insuranceCards => - localizedValues['insuranceCards'][locale.languageCode]; + String get insuranceCards => localizedValues['insuranceCards'][locale.languageCode]; String get requestType => localizedValues['requestType'][locale.languageCode]; - String get addFamilyMember => - localizedValues['add-new-member'][locale.languageCode]; - String get removeFamilyMember => - localizedValues['remove-family-member'][locale.languageCode]; - - String get myMedicalFile => - localizedValues['MyMedicalFile'][locale.languageCode]; - String get myMedicalFileSubTitle => - localizedValues['myMedicalFileSubTitle'][locale.languageCode]; + String get addFamilyMember => localizedValues['add-new-member'][locale.languageCode]; + String get removeFamilyMember => localizedValues['remove-family-member'][locale.languageCode]; + + String get myMedicalFile => localizedValues['MyMedicalFile'][locale.languageCode]; + String get myMedicalFileSubTitle => localizedValues['myMedicalFileSubTitle'][locale.languageCode]; String get viewMore => localizedValues['viewMore'][locale.languageCode]; - String get homeHealthCareService => - localizedValues['homeHealthCareService'][locale.languageCode]; - String get onlinePharmacy => - localizedValues['OnlinePharmacy'][locale.languageCode]; - String get emergencyService => - localizedValues['EmergencyService'][locale.languageCode]; - String get onlinePaymentService => - localizedValues['OnlinePaymentService'][locale.languageCode]; - String get offersAndPackages => - localizedValues['OffersAndPackages'][locale.languageCode]; - String get comprehensiveMedicalCheckup => - localizedValues['ComprehensiveMedicalCheckup'][locale.languageCode]; + String get homeHealthCareService => localizedValues['homeHealthCareService'][locale.languageCode]; + String get onlinePharmacy => localizedValues['OnlinePharmacy'][locale.languageCode]; + String get emergencyService => localizedValues['EmergencyService'][locale.languageCode]; + String get onlinePaymentService => localizedValues['OnlinePaymentService'][locale.languageCode]; + String get offersAndPackages => localizedValues['OffersAndPackages'][locale.languageCode]; + String get comprehensiveMedicalCheckup => localizedValues['ComprehensiveMedicalCheckup'][locale.languageCode]; String get hMGService => localizedValues['HMGService'][locale.languageCode]; - String get viewAllHabibMedicalService => - localizedValues['ViewAllHabibMedicalService'][locale.languageCode]; + String get viewAllHabibMedicalService => localizedValues['ViewAllHabibMedicalService'][locale.languageCode]; String get viewAll => localizedValues['viewAll'][locale.languageCode]; String get view => localizedValues['view'][locale.languageCode]; String get contactUs => localizedValues['ContactUs'][locale.languageCode]; - String get viewAllWaysReachUs => - localizedValues['ViewAllWaysReachUs'][locale.languageCode]; - String get medicalProfile => - localizedValues['medicalProfile'][locale.languageCode]; + String get viewAllWaysReachUs => localizedValues['ViewAllWaysReachUs'][locale.languageCode]; + String get medicalProfile => localizedValues['medicalProfile'][locale.languageCode]; String get parking => localizedValues['parking'][locale.languageCode]; - String get alhabiServices => - localizedValues['alhabiServices'][locale.languageCode]; - String get parkingTitle => - localizedValues['parkingTitle'][locale.languageCode]; + String get alhabiServices => localizedValues['alhabiServices'][locale.languageCode]; + String get parkingTitle => localizedValues['parkingTitle'][locale.languageCode]; String get readBarcode => localizedValues['readBarcode'][locale.languageCode]; String get showMyPark => localizedValues['showMyPark'][locale.languageCode]; String get clearMyData => localizedValues['clearMyData'][locale.languageCode]; @@ -481,193 +385,122 @@ class TranslationBase { String get gate => localizedValues['gate'][locale.languageCode]; String get building => localizedValues['building'][locale.languageCode]; String get branch => localizedValues['branch'][locale.languageCode]; - String get emergencyServices => - localizedValues['emergencyServices'][locale.languageCode]; + String get emergencyServices => localizedValues['emergencyServices'][locale.languageCode]; String get nearester => localizedValues['nearester'][locale.languageCode]; String get locationa => localizedValues['locationa'][locale.languageCode]; - String get ambulancerequest => - localizedValues['ambulancerequest'][locale.languageCode]; + String get ambulancerequest => localizedValues['ambulancerequest'][locale.languageCode]; String get requestA => localizedValues['requestA'][locale.languageCode]; - String get consultation => - localizedValues['consultation'][locale.languageCode]; + String get consultation => localizedValues['consultation'][locale.languageCode]; String get logs => localizedValues['logs'][locale.languageCode]; - String get textToSpeech => - localizedValues['textToSpeech'][locale.languageCode]; - - String get myAppointments => - localizedValues['MyAppointments'][locale.languageCode]; - String get noBookedAppointments => - localizedValues['NoBookedAppointments'][locale.languageCode]; - String get noConfirmedAppointments => - localizedValues['NoConfirmedAppointments'][locale.languageCode]; - String get noArrivedAppointments => - localizedValues['noArrivedAppointments'][locale.languageCode]; - String get myAppointmentsList => - localizedValues['MyAppointmentsList'][locale.languageCode]; + String get textToSpeech => localizedValues['textToSpeech'][locale.languageCode]; + + String get myAppointments => localizedValues['MyAppointments'][locale.languageCode]; + String get noBookedAppointments => localizedValues['NoBookedAppointments'][locale.languageCode]; + String get noConfirmedAppointments => localizedValues['NoConfirmedAppointments'][locale.languageCode]; + String get noArrivedAppointments => localizedValues['noArrivedAppointments'][locale.languageCode]; + String get myAppointmentsList => localizedValues['MyAppointmentsList'][locale.languageCode]; String get radiology => localizedValues['Radiology'][locale.languageCode]; - String get radiologySubtitle => - localizedValues['RadiologySubtitle'][locale.languageCode]; + String get radiologySubtitle => localizedValues['RadiologySubtitle'][locale.languageCode]; String get lab => localizedValues['Lab'][locale.languageCode]; String get labSubtitle => localizedValues['LabSubtitle'][locale.languageCode]; String get medicines => localizedValues['Medicines'][locale.languageCode]; - String get medicinesSubtitle => - localizedValues['MedicinesSubtitle'][locale.languageCode]; + String get medicinesSubtitle => localizedValues['MedicinesSubtitle'][locale.languageCode]; String get vitalSigns => localizedValues['VitalSigns'][locale.languageCode]; - String get vitalSignsSubtitle => - localizedValues['VitalSignsSubTitle'][locale.languageCode]; + String get vitalSignsSubtitle => localizedValues['VitalSignsSubTitle'][locale.languageCode]; String get myMedical => localizedValues['MyMedical'][locale.languageCode]; - String get myMedicalSubtitle => - localizedValues['MyMedicalSubtitle'][locale.languageCode]; + String get myMedicalSubtitle => localizedValues['MyMedicalSubtitle'][locale.languageCode]; String get myDoctor => localizedValues['MyDoctor'][locale.languageCode]; - String get myDoctorSubtitle => - localizedValues['MyDoctorSubtitle'][locale.languageCode]; + String get myDoctorSubtitle => localizedValues['MyDoctorSubtitle'][locale.languageCode]; String get eye => localizedValues['Eye'][locale.languageCode]; String get eyeSubtitle => localizedValues['EyeSubtitle'][locale.languageCode]; String get insurance => localizedValues['Insurance'][locale.languageCode]; - String get insuranceSubtitle => - localizedValues['InsuranceSubtitle'][locale.languageCode]; - String get updateInsurance => - localizedValues['UpdateInsurance'][locale.languageCode]; - String get updateInsuranceSubtitle => - localizedValues['UpdateInsuranceSubtitle'][locale.languageCode]; - String get insuranceApproval => - localizedValues['InsuranceApproval'][locale.languageCode]; - String get insuranceApprovalSubtitle => - localizedValues['InsuranceApprovalSubtitle'][locale.languageCode]; + String get insuranceSubtitle => localizedValues['InsuranceSubtitle'][locale.languageCode]; + String get updateInsurance => localizedValues['UpdateInsurance'][locale.languageCode]; + String get updateInsuranceSubtitle => localizedValues['UpdateInsuranceSubtitle'][locale.languageCode]; + String get insuranceApproval => localizedValues['InsuranceApproval'][locale.languageCode]; + String get insuranceApprovalSubtitle => localizedValues['InsuranceApprovalSubtitle'][locale.languageCode]; String get allergies => localizedValues['Allergies'][locale.languageCode]; - String get allergiesSubtitle => - localizedValues['AllergiesSubtitle'][locale.languageCode]; + String get allergiesSubtitle => localizedValues['AllergiesSubtitle'][locale.languageCode]; String get myVaccines => localizedValues['MyVaccines'][locale.languageCode]; - String get myVaccinesSubtitle => - localizedValues['MyVaccinesSubtitle'][locale.languageCode]; + String get myVaccinesSubtitle => localizedValues['MyVaccinesSubtitle'][locale.languageCode]; String get medical => localizedValues['Medical'][locale.languageCode]; - String get medicalSubtitle => - localizedValues['MedicalSubtitle'][locale.languageCode]; + String get medicalSubtitle => localizedValues['MedicalSubtitle'][locale.languageCode]; String get monthly => localizedValues['Monthly'][locale.languageCode]; - String get monthlySubtitle => - localizedValues['MonthlySubtitle'][locale.languageCode]; + String get monthlySubtitle => localizedValues['MonthlySubtitle'][locale.languageCode]; String get sick => localizedValues['Sick'][locale.languageCode]; - String get sickSubtitle => - localizedValues['SickSubtitle'][locale.languageCode]; + String get sickSubtitle => localizedValues['SickSubtitle'][locale.languageCode]; String get myBalance => localizedValues['MyBalance'][locale.languageCode]; - String get myBalanceSubtitle => - localizedValues['MyBalanceSubtitle'][locale.languageCode]; + String get myBalanceSubtitle => localizedValues['MyBalanceSubtitle'][locale.languageCode]; String get patientCall => localizedValues['PatientCall'][locale.languageCode]; - String get patientCallSubtitle => - localizedValues['PatientCallSubtitle'][locale.languageCode]; - String get smartWatches => - localizedValues['SmartWatches'][locale.languageCode]; - String get smartWatchesSubtitle => - localizedValues['SmartWatchesSubtitle'][locale.languageCode]; + String get patientCallSubtitle => localizedValues['PatientCallSubtitle'][locale.languageCode]; + String get smartWatches => localizedValues['SmartWatches'][locale.languageCode]; + String get smartWatchesSubtitle => localizedValues['SmartWatchesSubtitle'][locale.languageCode]; String get myTrackers => localizedValues['MyTrackers'][locale.languageCode]; - String get myTrackersSubtitle => - localizedValues['MyTrackersSubtitle'][locale.languageCode]; + String get myTrackersSubtitle => localizedValues['MyTrackersSubtitle'][locale.languageCode]; String get askYour => localizedValues['AskYour'][locale.languageCode]; - String get askYourSubtitle => - localizedValues['AskYourSubtitle'][locale.languageCode]; + String get askYourSubtitle => localizedValues['AskYourSubtitle'][locale.languageCode]; String get internet => localizedValues['Internet'][locale.languageCode]; - String get internetSubtitle => - localizedValues['InternetSubtitle'][locale.languageCode]; + String get internetSubtitle => localizedValues['InternetSubtitle'][locale.languageCode]; String get chatbot => localizedValues['Chatbot'][locale.languageCode]; - String get chatbotSubtitle => - localizedValues['ChatbotSubtitle'][locale.languageCode]; + String get chatbotSubtitle => localizedValues['ChatbotSubtitle'][locale.languageCode]; String get timeLine => localizedValues['TimeLine'][locale.languageCode]; String get labOrders => localizedValues['LabOrders'][locale.languageCode]; String get billNo => localizedValues['BillNo'][locale.languageCode]; - String get prescriptions => - localizedValues['Prescriptions'][locale.languageCode]; + String get prescriptions => localizedValues['Prescriptions'][locale.languageCode]; String get history => localizedValues['History'][locale.languageCode]; String get orderNo => localizedValues['OrderNo'][locale.languageCode]; - String get trackDeliveryDriver => - localizedValues['trackDeliveryDriver'][locale.languageCode]; - String get orderDetails => - localizedValues['OrderDetails'][locale.languageCode]; + String get trackDeliveryDriver => localizedValues['trackDeliveryDriver'][locale.languageCode]; + String get orderDetails => localizedValues['OrderDetails'][locale.languageCode]; String get vitalSign => localizedValues['VitalSign'][locale.languageCode]; - String get monthlyReports => - localizedValues['MonthlyReports'][locale.languageCode]; + String get monthlyReports => localizedValues['MonthlyReports'][locale.languageCode]; - String get locationDialogMessage => - localizedValues['locationDialogMessage'][locale.languageCode]; - String get userViewRequest => - localizedValues['user-view-requester'][locale.languageCode]; + String get locationDialogMessage => localizedValues['locationDialogMessage'][locale.languageCode]; + String get userViewRequest => localizedValues['user-view-requester'][locale.languageCode]; String get userView => localizedValues['user-view'][locale.languageCode]; - String get sentRequest => - localizedValues['sent-requests'][locale.languageCode]; + String get sentRequest => localizedValues['sent-requests'][locale.languageCode]; String get km => localizedValues['km'][locale.languageCode]; - String get patientHealthSummaryReport => - localizedValues['PatientHealthSummaryReport'][locale.languageCode]; - String get toViewTheTermsAndConditions => - localizedValues['ToViewTheTermsAndConditions'][locale.languageCode]; + String get patientHealthSummaryReport => localizedValues['PatientHealthSummaryReport'][locale.languageCode]; + String get toViewTheTermsAndConditions => localizedValues['ToViewTheTermsAndConditions'][locale.languageCode]; String get clickHere => localizedValues['ClickHere'][locale.languageCode]; - String get iAgreeToTheTermsAndConditions => - localizedValues['IAgreeToTheTermsAndConditions'][locale.languageCode]; - String get iAgreeToTheTermsAndConditionsSubtitle => - localizedValues['IAgreeToTheTermsAndConditionsSubtitle'] - [locale.languageCode]; + String get iAgreeToTheTermsAndConditions => localizedValues['IAgreeToTheTermsAndConditions'][locale.languageCode]; + String get iAgreeToTheTermsAndConditionsSubtitle => localizedValues['IAgreeToTheTermsAndConditionsSubtitle'][locale.languageCode]; String get save => localizedValues['Save'][locale.languageCode]; - String get userAgreement => - localizedValues['UserAgreement'][locale.languageCode]; - String get updateSuccessfully => - localizedValues['UpdateSuccessfully'][locale.languageCode]; - String get emailSentSuccessfully => - localizedValues['EmailSentSuccessfully'][locale.languageCode]; - String get EmailSentError => - localizedValues['EmailSentError'][locale.languageCode]; - String get checkVaccineAvailability => - localizedValues['CHECK_VACCINE_AVAILABILITY'][locale.languageCode]; - String get myVaccinesAvailability => - localizedValues['MyVaccinesAvailability'][locale.languageCode]; - String get paymentService => - localizedValues['PaymentService'][locale.languageCode]; - String get paymentOnline => - localizedValues['PaymentOnline'][locale.languageCode]; - String get onlineCheckIn => - localizedValues['OnlineCheckIn'][locale.languageCode]; + String get userAgreement => localizedValues['UserAgreement'][locale.languageCode]; + String get updateSuccessfully => localizedValues['UpdateSuccessfully'][locale.languageCode]; + String get emailSentSuccessfully => localizedValues['EmailSentSuccessfully'][locale.languageCode]; + String get EmailSentError => localizedValues['EmailSentError'][locale.languageCode]; + String get checkVaccineAvailability => localizedValues['CHECK_VACCINE_AVAILABILITY'][locale.languageCode]; + String get myVaccinesAvailability => localizedValues['MyVaccinesAvailability'][locale.languageCode]; + String get paymentService => localizedValues['PaymentService'][locale.languageCode]; + String get paymentOnline => localizedValues['PaymentOnline'][locale.languageCode]; + String get onlineCheckIn => localizedValues['OnlineCheckIn'][locale.languageCode]; String get myBalances => localizedValues['MyBalances'][locale.languageCode]; - String get balanceAmount => - localizedValues['BalanceAmount'][locale.languageCode]; - String get totalBalance => - localizedValues['TotalBalance'][locale.languageCode]; - String get createAdvancedPayment => - localizedValues['CreateAdvancedPayment'][locale.languageCode]; - String get advancePayment => - localizedValues['AdvancePayment'][locale.languageCode]; - String get advancePaymentLabel => - localizedValues['AdvancePaymentLabel'][locale.languageCode]; + String get balanceAmount => localizedValues['BalanceAmount'][locale.languageCode]; + String get totalBalance => localizedValues['TotalBalance'][locale.languageCode]; + String get createAdvancedPayment => localizedValues['CreateAdvancedPayment'][locale.languageCode]; + String get advancePayment => localizedValues['AdvancePayment'][locale.languageCode]; + String get advancePaymentLabel => localizedValues['AdvancePaymentLabel'][locale.languageCode]; String get fileNumber => localizedValues['FileNumber'][locale.languageCode]; String get amount => localizedValues['Amount'][locale.languageCode]; - String get depositorEmail => - localizedValues['DepositorEmail'][locale.languageCode]; + String get depositorEmail => localizedValues['DepositorEmail'][locale.languageCode]; String get notes => localizedValues['Notes'][locale.languageCode]; - String get selectPatientName => - localizedValues['SelectPatientName'][locale.languageCode]; - String get selectFamilyPatientName => - localizedValues['SelectFamilyPatientName'][locale.languageCode]; - String get selectHospital => - localizedValues['SelectHospital'][locale.languageCode]; + String get selectPatientName => localizedValues['SelectPatientName'][locale.languageCode]; + String get selectFamilyPatientName => localizedValues['SelectFamilyPatientName'][locale.languageCode]; + String get selectHospital => localizedValues['SelectHospital'][locale.languageCode]; String get selectCity => localizedValues['selectCity'][locale.languageCode]; String get myAccount => localizedValues['MyAccount'][locale.languageCode]; - String get otherAccount => - localizedValues['OtherAccount'][locale.languageCode]; - String get selectBeneficiary => - localizedValues['SelectBeneficiary'][locale.languageCode]; - String get confirmThePayment => - localizedValues['ConfirmThePayment'][locale.languageCode]; - String get depositorName => - localizedValues['DepositorName'][locale.languageCode]; - String get mobileNumber => - localizedValues['MobileNumber'][locale.languageCode]; + String get otherAccount => localizedValues['OtherAccount'][locale.languageCode]; + String get selectBeneficiary => localizedValues['SelectBeneficiary'][locale.languageCode]; + String get confirmThePayment => localizedValues['ConfirmThePayment'][locale.languageCode]; + String get depositorName => localizedValues['DepositorName'][locale.languageCode]; + String get mobileNumber => localizedValues['MobileNumber'][locale.languageCode]; String get ok => localizedValues['Ok'][locale.languageCode]; String get waterConsumedInWeek => localizedValues['WaterConsumedInWeek'][locale.languageCode]; String get waterConsumedInMonth => localizedValues['WaterConsumedInMonth'][locale.languageCode]; - String get theVerificationCodeExpiresIn => - localizedValues['TheVerificationCodeExpiresIn'][locale.languageCode]; - String get pleaseEnterTheVerificationCode => - localizedValues['PleaseEnterTheVerificationCode'][locale.languageCode]; - String get eyeMeasurements => - localizedValues['EyeMeasurements'][locale.languageCode]; - String get measurements => - localizedValues['Measurements'][locale.languageCode]; + String get theVerificationCodeExpiresIn => localizedValues['TheVerificationCodeExpiresIn'][locale.languageCode]; + String get pleaseEnterTheVerificationCode => localizedValues['PleaseEnterTheVerificationCode'][locale.languageCode]; + String get eyeMeasurements => localizedValues['EyeMeasurements'][locale.languageCode]; + String get measurements => localizedValues['Measurements'][locale.languageCode]; String get classes => localizedValues['Classes'][locale.languageCode]; String get contactLens => localizedValues['ContactLens'][locale.languageCode]; String get rightEye => localizedValues['RightEye'][locale.languageCode]; @@ -681,56 +514,41 @@ class TranslationBase { String get power => localizedValues['Power'][locale.languageCode]; String get diameter => localizedValues['Diameter'][locale.languageCode]; String get remarks => localizedValues['Remarks'][locale.languageCode]; - String get activeMedications => - localizedValues['ActiveMedications'][locale.languageCode]; + String get activeMedications => localizedValues['ActiveMedications'][locale.languageCode]; String get expDate => localizedValues['ExpDate'][locale.languageCode]; String get route => localizedValues['Route'][locale.languageCode]; String get frequency => localizedValues['Frequency'][locale.languageCode]; - String get dailyQuantity => - localizedValues['DailyQuantity'][locale.languageCode]; + String get dailyQuantity => localizedValues['DailyQuantity'][locale.languageCode]; String get addReminder => localizedValues['AddReminder'][locale.languageCode]; String get reminderDes => localizedValues['reminderDes'][locale.languageCode]; String get startDay => localizedValues['StartDay'][locale.languageCode]; String get endDay => localizedValues['EndDay'][locale.languageCode]; String get days => localizedValues['Days'][locale.languageCode]; - String get scheduleTime => - localizedValues['ScheduleTime'][locale.languageCode]; + String get scheduleTime => localizedValues['ScheduleTime'][locale.languageCode]; String get askDoctor => localizedValues['AskDoctor'][locale.languageCode]; - String get doctorResponses => - localizedValues['DoctorResponses'][locale.languageCode]; + String get doctorResponses => localizedValues['DoctorResponses'][locale.languageCode]; String get newDes => localizedValues['New'][locale.languageCode]; String get all => localizedValues['All'][locale.languageCode]; - String get questionHere => - localizedValues['QuestionHere'][locale.languageCode]; - String get viewDoctorResponses => - localizedValues['ViewDoctorResponses'][locale.languageCode]; - String get serviceInformationButton => - localizedValues['ServiceInformationButton'][locale.languageCode]; - String get serviceInformationTitle => - localizedValues['ServiceInformationTitle'][locale.languageCode]; + String get questionHere => localizedValues['QuestionHere'][locale.languageCode]; + String get viewDoctorResponses => localizedValues['ViewDoctorResponses'][locale.languageCode]; + String get serviceInformationButton => localizedValues['ServiceInformationButton'][locale.languageCode]; + String get serviceInformationTitle => localizedValues['ServiceInformationTitle'][locale.languageCode]; String get infoLab => localizedValues['info-lab'][locale.languageCode]; - String get infoRadiology => - localizedValues['info-radiology'][locale.languageCode]; + String get infoRadiology => localizedValues['info-radiology'][locale.languageCode]; String get orders => localizedValues['orders'][locale.languageCode]; String get lakum => localizedValues['lakum'][locale.languageCode]; String get wishlist => localizedValues['wishlist'][locale.languageCode]; String get reviews => localizedValues['reviews'][locale.languageCode]; - String get myPrescriptions => - localizedValues['myPrescriptions'][locale.languageCode]; - String get medicationRefill => - localizedValues['medicationRefill'][locale.languageCode]; - String get pillReminder => - localizedValues['pillReminder'][locale.languageCode]; - String get shippingAddresses => - localizedValues['shippingAddresses'][locale.languageCode]; + String get myPrescriptions => localizedValues['myPrescriptions'][locale.languageCode]; + String get medicationRefill => localizedValues['medicationRefill'][locale.languageCode]; + String get pillReminder => localizedValues['pillReminder'][locale.languageCode]; + String get shippingAddresses => localizedValues['shippingAddresses'][locale.languageCode]; String get reachUs => localizedValues['reachUs'][locale.languageCode]; - String get ourLocations => - localizedValues['ourLocations'][locale.languageCode]; + String get ourLocations => localizedValues['ourLocations'][locale.languageCode]; String get edit => localizedValues['edit'][locale.languageCode]; String get delete => localizedValues['delete'][locale.languageCode]; String get addAddress => localizedValues['addAddress'][locale.languageCode]; - String get addNewAddress => - localizedValues['addNewAddress'][locale.languageCode]; + String get addNewAddress => localizedValues['addNewAddress'][locale.languageCode]; String get order => localizedValues['order'][locale.languageCode]; String get delivered => localizedValues['delivered'][locale.languageCode]; String get processing => localizedValues['processing'][locale.languageCode]; @@ -738,16 +556,11 @@ class TranslationBase { String get cancelled => localizedValues['cancelled'][locale.languageCode]; String get writeReview => localizedValues['writeReview'][locale.languageCode]; String get shareReview => localizedValues['shareReview'][locale.languageCode]; - String get backMyAccount => - localizedValues['backMyAccount'][locale.languageCode]; - String get reviewSuccessful => - localizedValues['reviewSuccessful'][locale.languageCode]; - String get reviewShared => - localizedValues['reviewShared'][locale.languageCode]; - String get reviewComment => - localizedValues['reviewComment'][locale.languageCode]; - String get shippedMethod => - localizedValues['shippedMethod'][locale.languageCode]; + String get backMyAccount => localizedValues['backMyAccount'][locale.languageCode]; + String get reviewSuccessful => localizedValues['reviewSuccessful'][locale.languageCode]; + String get reviewShared => localizedValues['reviewShared'][locale.languageCode]; + String get reviewComment => localizedValues['reviewComment'][locale.languageCode]; + String get shippedMethod => localizedValues['shippedMethod'][locale.languageCode]; String get orderDetail => localizedValues['orderDetail'][locale.languageCode]; String get subtotal => localizedValues['subtotal'][locale.languageCode]; String get shipping => localizedValues['shipping'][locale.languageCode]; @@ -756,34 +569,23 @@ class TranslationBase { String get use => localizedValues['use'][locale.languageCode]; String get proceedPay => localizedValues['proceedPay'][locale.languageCode]; String get vat => localizedValues['vat'][locale.languageCode]; - String get inclusiveVat => - localizedValues['inclusiveVat'][locale.languageCode]; + String get inclusiveVat => localizedValues['inclusiveVat'][locale.languageCode]; String get items => localizedValues['items'][locale.languageCode]; String get checkOut => localizedValues['checkOut'][locale.languageCode]; String get total => localizedValues['total'][locale.languageCode]; String get sar => localizedValues['sar'][locale.languageCode]; String get payOnline => localizedValues['payOnline'][locale.languageCode]; String get cancelOrder => localizedValues['cancelOrder'][locale.languageCode]; - String get confirmAddress => - localizedValues['confirmAddress'][locale.languageCode]; - String get confirmLocation => - localizedValues['confirmLocation'][locale.languageCode]; - String get confirmDeleteMsg => - localizedValues['confirmDeleteMsg'][locale.languageCode]; - String get confirmDelete => - localizedValues['confirmDelete'][locale.languageCode]; - String get confirmCancellation => - localizedValues['confirmCancellation'][locale.languageCode]; - String get serviceInformation => - localizedValues['ServiceInformation'][locale.languageCode]; - String get homeHealthCare => - localizedValues['HomeHealthCare'][locale.languageCode]; - String get HHCNotAuthMsg => - localizedValues['HHCNotAuthMsg'][locale.languageCode]; - String get homeHealthCareText => - localizedValues['HomeHealthCareText'][locale.languageCode]; - String get loginRegister => - localizedValues['LoginRegister'][locale.languageCode]; + String get confirmAddress => localizedValues['confirmAddress'][locale.languageCode]; + String get confirmLocation => localizedValues['confirmLocation'][locale.languageCode]; + String get confirmDeleteMsg => localizedValues['confirmDeleteMsg'][locale.languageCode]; + String get confirmDelete => localizedValues['confirmDelete'][locale.languageCode]; + String get confirmCancellation => localizedValues['confirmCancellation'][locale.languageCode]; + String get serviceInformation => localizedValues['ServiceInformation'][locale.languageCode]; + String get homeHealthCare => localizedValues['HomeHealthCare'][locale.languageCode]; + String get HHCNotAuthMsg => localizedValues['HHCNotAuthMsg'][locale.languageCode]; + String get homeHealthCareText => localizedValues['HomeHealthCareText'][locale.languageCode]; + String get loginRegister => localizedValues['LoginRegister'][locale.languageCode]; String get orderLog => localizedValues['OrderLog'][locale.languageCode]; // String get infoLab => localizedValues['info-lab'][locale.languageCode]; // String get infoRadiology => @@ -793,86 +595,57 @@ class TranslationBase { String get itemsNo => localizedValues['itemsNo'][locale.languageCode]; String get noOrder => localizedValues['noOrder'][locale.languageCode]; String get review => localizedValues['review'][locale.languageCode]; - String get deliveredOrder => - localizedValues['deliveredOrder'][locale.languageCode]; - String get pendingOrder => - localizedValues['pendingOrder'][locale.languageCode]; - String get processingOrder => - localizedValues['processingOrder'][locale.languageCode]; - String get cancelledOrder => - localizedValues['cancelledOrder'][locale.languageCode]; + String get deliveredOrder => localizedValues['deliveredOrder'][locale.languageCode]; + String get pendingOrder => localizedValues['pendingOrder'][locale.languageCode]; + String get processingOrder => localizedValues['processingOrder'][locale.languageCode]; + String get cancelledOrder => localizedValues['cancelledOrder'][locale.languageCode]; String get compare => localizedValues['compare'][locale.languageCode]; - String get medicationsRefill => - localizedValues['medicationsRefill'][locale.languageCode]; - String get myPrescription => - localizedValues['myPrescription'][locale.languageCode]; + String get medicationsRefill => localizedValues['medicationsRefill'][locale.languageCode]; + String get myPrescription => localizedValues['myPrescription'][locale.languageCode]; String get quantity => localizedValues['quantity'][locale.languageCode]; - String get conditionsHMG => - localizedValues['conditionsHMG'][locale.languageCode]; + String get conditionsHMG => localizedValues['conditionsHMG'][locale.languageCode]; String get conditions => localizedValues['conditions'][locale.languageCode]; // pharmacy module - String get offersAndPromotions => - localizedValues['offersAndPromotions'][locale.languageCode]; + String get offersAndPromotions => localizedValues['offersAndPromotions'][locale.languageCode]; - String get searchAndScanMedication => - localizedValues['searchAndScanMedication'][locale.languageCode]; - String get shopByBrands => - localizedValues['shopByBrands'][locale.languageCode]; - String get recentlyViewed => - localizedValues['recentlyViewed'][locale.languageCode]; + String get searchAndScanMedication => localizedValues['searchAndScanMedication'][locale.languageCode]; + String get shopByBrands => localizedValues['shopByBrands'][locale.languageCode]; + String get recentlyViewed => localizedValues['recentlyViewed'][locale.languageCode]; String get bestSellers => localizedValues['bestSellers'][locale.languageCode]; String get recommended => localizedValues['recommended'][locale.languageCode]; - String get deleteAllItems => - localizedValues['deleteAllItems'][locale.languageCode]; - String get selectAddress => - localizedValues['selectAddress'][locale.languageCode]; - String get shippingAddress => - localizedValues['shippingAddress'][locale.languageCode]; - String get changeAddress => - localizedValues['changeAddress'][locale.languageCode]; - String get selectPaymentOption => - localizedValues['selectPaymentOption'][locale.languageCode]; - String get changeMethod => - localizedValues['changeMethod'][locale.languageCode]; + String get deleteAllItems => localizedValues['deleteAllItems'][locale.languageCode]; + String get selectAddress => localizedValues['selectAddress'][locale.languageCode]; + String get shippingAddress => localizedValues['shippingAddress'][locale.languageCode]; + String get changeAddress => localizedValues['changeAddress'][locale.languageCode]; + String get selectPaymentOption => localizedValues['selectPaymentOption'][locale.languageCode]; + String get changeMethod => localizedValues['changeMethod'][locale.languageCode]; String get reviewOrder => localizedValues['reviewOrder'][locale.languageCode]; - String get orderSummary => - localizedValues['orderSummary'][locale.languageCode]; + String get orderSummary => localizedValues['orderSummary'][locale.languageCode]; String get active => localizedValues['active'][locale.languageCode]; String get inactive => localizedValues['inactive'][locale.languageCode]; String get balance => localizedValues['balance'][locale.languageCode]; String get gained => localizedValues['gained'][locale.languageCode]; String get consumed => localizedValues['consumed'][locale.languageCode]; String get transferred => localizedValues['transferred'][locale.languageCode]; - String get checkBeneficiary => - localizedValues['checkBeneficiary'][locale.languageCode]; - String get beneficiaryName => - localizedValues['beneficiaryName'][locale.languageCode]; - String get accountActivation => - localizedValues['accountActivation'][locale.languageCode]; + String get checkBeneficiary => localizedValues['checkBeneficiary'][locale.languageCode]; + String get beneficiaryName => localizedValues['beneficiaryName'][locale.languageCode]; + String get accountActivation => localizedValues['accountActivation'][locale.languageCode]; String get acceptLbl => localizedValues['acceptLbl'][locale.languageCode]; - String get termsService => - localizedValues['TermsService'][locale.languageCode]; + String get termsService => localizedValues['TermsService'][locale.languageCode]; String get beforeUsing => localizedValues['Beforeusing'][locale.languageCode]; String get accept => localizedValues['accept'][locale.languageCode]; - String get dataSafeInfo => - localizedValues['data-safe-info'][locale.languageCode]; + String get dataSafeInfo => localizedValues['data-safe-info'][locale.languageCode]; String get dataSafe => localizedValues['data-safe'][locale.languageCode]; - String get informational => - localizedValues['informational'][locale.languageCode]; - String get checkDiagnosis => - localizedValues['check-diagnosis'][locale.languageCode]; + String get informational => localizedValues['informational'][locale.languageCode]; + String get checkDiagnosis => localizedValues['check-diagnosis'][locale.languageCode]; String get remeberthat => localizedValues['remeberthat'][locale.languageCode]; - String get notUseInEmbergency => - localizedValues['not-use-in-emerbency'][locale.languageCode]; - String get notUseInEmbergencyDetails => - localizedValues['not-use-in-emerbency-details'][locale.languageCode]; - String get notUseInEmbergencyCall => - localizedValues['not-use-in-emerbency-details-call'][locale.languageCode]; - String get selectGender => - localizedValues['select-gender'][locale.languageCode]; + String get notUseInEmbergency => localizedValues['not-use-in-emerbency'][locale.languageCode]; + String get notUseInEmbergencyDetails => localizedValues['not-use-in-emerbency-details'][locale.languageCode]; + String get notUseInEmbergencyCall => localizedValues['not-use-in-emerbency-details-call'][locale.languageCode]; + String get selectGender => localizedValues['select-gender'][locale.languageCode]; String get iAma => localizedValues['i-am-a'][locale.languageCode]; String get selectAge => localizedValues['select-age'][locale.languageCode]; String get iAm => localizedValues['i-am'][locale.languageCode]; @@ -880,96 +653,66 @@ class TranslationBase { String get categorise => localizedValues['categorise'][locale.languageCode]; String get cart => localizedValues['cart'][locale.languageCode]; String get wishList => localizedValues['wishList'][locale.languageCode]; - String get searchProductHere => - localizedValues['searchProductHere'][locale.languageCode]; + String get searchProductHere => localizedValues['searchProductHere'][locale.languageCode]; String get email => localizedValues['email'][locale.languageCode]; String get book => localizedValues['Book'][locale.languageCode]; - String get appointmentLabel => - localizedValues['AppointmentLabel'][locale.languageCode]; + String get appointmentLabel => localizedValues['AppointmentLabel'][locale.languageCode]; String get bloodType => localizedValues['BloodType'][locale.languageCode]; - String get loginToUseService => - localizedValues['loginToUseService'][locale.languageCode]; - String get maritalStatus => - localizedValues['marital-status'][locale.languageCode]; + String get loginToUseService => localizedValues['loginToUseService'][locale.languageCode]; + String get maritalStatus => localizedValues['marital-status'][locale.languageCode]; String get general => localizedValues['general'][locale.languageCode]; String get profile => localizedValues['profile'][locale.languageCode]; - String get notifications => - localizedValues['notifications'][locale.languageCode]; - String get notificationDetails => - localizedValues['notificationDetails'][locale.languageCode]; - List get infoMyDoctorPoints => - localizedValues['info-my-doctor-points'][locale.languageCode]; - String get infoMyDoctor => - localizedValues['info-my-doctor'][locale.languageCode]; - String get infoPrescriptions => - localizedValues['info-prescriptions'][locale.languageCode]; - List get infoPrescriptionsPoints => - localizedValues['info-my-prescription-points'][locale.languageCode]; - - String get infoInsuranceCards => - localizedValues['info-insurance-cards'][locale.languageCode]; - List get infoInsuranceCardsPoints => - localizedValues['info-insurance-cards-points'][locale.languageCode]; - - String get infoAllergies => - localizedValues['info-allergies'][locale.languageCode]; + String get notifications => localizedValues['notifications'][locale.languageCode]; + String get notificationDetails => localizedValues['notificationDetails'][locale.languageCode]; + List get infoMyDoctorPoints => localizedValues['info-my-doctor-points'][locale.languageCode]; + String get infoMyDoctor => localizedValues['info-my-doctor'][locale.languageCode]; + String get infoPrescriptions => localizedValues['info-prescriptions'][locale.languageCode]; + List get infoPrescriptionsPoints => localizedValues['info-my-prescription-points'][locale.languageCode]; + + String get infoInsuranceCards => localizedValues['info-insurance-cards'][locale.languageCode]; + List get infoInsuranceCardsPoints => localizedValues['info-insurance-cards-points'][locale.languageCode]; + + String get infoAllergies => localizedValues['info-allergies'][locale.languageCode]; String get sickLeaves => localizedValues['sick-leaves'][locale.languageCode]; - String get infoSickLeaves => - localizedValues['info-sick-leaves'][locale.languageCode]; - List get infoSickLeavePoints => - localizedValues['info-sick-leave-points'][locale.languageCode]; - - String get infoApprovals => - localizedValues['info-approvals'][locale.languageCode]; - List get infoApprovalPoints => - localizedValues['info-approval-points'][locale.languageCode]; - - String get monthReport => - localizedValues['month-report'][locale.languageCode]; - String get infoMonthReport => - localizedValues['info-month-report'][locale.languageCode]; - String get languageSetting => - localizedValues['language-setting'][locale.languageCode]; + String get infoSickLeaves => localizedValues['info-sick-leaves'][locale.languageCode]; + List get infoSickLeavePoints => localizedValues['info-sick-leave-points'][locale.languageCode]; + + String get infoApprovals => localizedValues['info-approvals'][locale.languageCode]; + List get infoApprovalPoints => localizedValues['info-approval-points'][locale.languageCode]; + + String get monthReport => localizedValues['month-report'][locale.languageCode]; + String get infoMonthReport => localizedValues['info-month-report'][locale.languageCode]; + String get languageSetting => localizedValues['language-setting'][locale.languageCode]; String get alert => localizedValues['alert'][locale.languageCode]; String get emailAlert => localizedValues['email-alert'][locale.languageCode]; String get smsAlert => localizedValues['sms-alert'][locale.languageCode]; - String get contactInfo => - localizedValues['contact-info'][locale.languageCode]; + String get contactInfo => localizedValues['contact-info'][locale.languageCode]; String get emergencyName => localizedValues['emrg-name'][locale.languageCode]; - String get emergencyContact => - localizedValues['emrg-no'][locale.languageCode]; + String get emergencyContact => localizedValues['emrg-no'][locale.languageCode]; String get modes => localizedValues['modes'][locale.languageCode]; String get vibration => localizedValues['vibration'][locale.languageCode]; String get blindMode => localizedValues['blind-modes'][locale.languageCode]; - String get invertTheme => - localizedValues['invert-theme'][locale.languageCode]; + String get invertTheme => localizedValues['invert-theme'][locale.languageCode]; String get offTheme => localizedValues['off-theme'][locale.languageCode]; String get dimTheme => localizedValues['dim-theme'][locale.languageCode]; String get bwTheme => localizedValues['bw-theme'][locale.languageCode]; String get permissions => localizedValues['permissions'][locale.languageCode]; - String get cameraPermission => - localizedValues['camera-permission'][locale.languageCode]; - String get locationPermission => - localizedValues['location-permission'][locale.languageCode]; - String get accessibility => - localizedValues['accessibility'][locale.languageCode]; - String get selectClinic => - localizedValues['selectClinic'][locale.languageCode]; + String get cameraPermission => localizedValues['camera-permission'][locale.languageCode]; + String get locationPermission => localizedValues['location-permission'][locale.languageCode]; + String get accessibility => localizedValues['accessibility'][locale.languageCode]; + String get selectClinic => localizedValues['selectClinic'][locale.languageCode]; String get orderStatus => localizedValues['orderStatus'][locale.languageCode]; String get findUs => localizedValues['FindUs'][locale.languageCode]; String get feedback => localizedValues['Feedback'][locale.languageCode]; String get liveChat => localizedValues['LiveChat'][locale.languageCode]; String get service => localizedValues['Service'][locale.languageCode]; - String get hMGServiceLabel => - localizedValues['HMGServiceLabel'][locale.languageCode]; - String get healthWeatherIndicators => - localizedValues['HealthWeatherIndicators'][locale.languageCode]; - String get healthTipsBasedOnCurrentWeather => - localizedValues['HealthTipsBasedOnCurrentWeather'][locale.languageCode]; + String get hMGServiceLabel => localizedValues['HMGServiceLabel'][locale.languageCode]; + String get healthWeatherIndicators => localizedValues['HealthWeatherIndicators'][locale.languageCode]; + String get healthTipsBasedOnCurrentWeather => localizedValues['HealthTipsBasedOnCurrentWeather'][locale.languageCode]; String get moreDetails => localizedValues['MoreDetails'][locale.languageCode]; String get sendCopy => localizedValues['SendCopy'][locale.languageCode]; String get resendOrder => localizedValues['ResendOrder'][locale.languageCode]; @@ -980,11 +723,12 @@ class TranslationBase { String get period => localizedValues['Period'][locale.languageCode]; String get cm => localizedValues['cm'][locale.languageCode]; String get kg => localizedValues['kg'][locale.languageCode]; + String get lb => localizedValues['lb'][locale.languageCode]; + String get birth_date => localizedValues['birth_date'][locale.languageCode]; String get mass => localizedValues['mass'][locale.languageCode]; String get tempC => localizedValues['temp-c'][locale.languageCode]; String get bpm => localizedValues['bpm'][locale.languageCode]; - String get respirationSigns => - localizedValues['respiration-signs'][locale.languageCode]; + String get respirationSigns => localizedValues['respiration-signs'][locale.languageCode]; String get sysDias => localizedValues['sys-dias'][locale.languageCode]; String get body => localizedValues['body'][locale.languageCode]; String get feedbackTitle => localizedValues['feedback'][locale.languageCode]; @@ -993,47 +737,30 @@ class TranslationBase { String get likeToHear => localizedValues['like-to-hear'][locale.languageCode]; String get subject => localizedValues['subject'][locale.languageCode]; String get message => localizedValues['message'][locale.languageCode]; - String get emptySubject => - localizedValues['empty-subject'][locale.languageCode]; - String get emptyMessage => - localizedValues['empty-message'][locale.languageCode]; - String get selectAttachment => - localizedValues['select-attachment'][locale.languageCode]; - String get complainAppo => - localizedValues['complain-appo'][locale.languageCode]; - String get complainWithoutAppo => - localizedValues['complain-without-appo'][locale.languageCode]; + String get emptySubject => localizedValues['empty-subject'][locale.languageCode]; + String get emptyMessage => localizedValues['empty-message'][locale.languageCode]; + String get selectAttachment => localizedValues['select-attachment'][locale.languageCode]; + String get complainAppo => localizedValues['complain-appo'][locale.languageCode]; + String get complainWithoutAppo => localizedValues['complain-without-appo'][locale.languageCode]; String get question => localizedValues['question'][locale.languageCode]; - String get messageType => - localizedValues['message-type'][locale.languageCode]; + String get messageType => localizedValues['message-type'][locale.languageCode]; String get compliment => localizedValues['compliment'][locale.languageCode]; String get suggestion => localizedValues['suggestion'][locale.languageCode]; - String get yourFeedback => - localizedValues['your-feedback'][locale.languageCode]; + String get yourFeedback => localizedValues['your-feedback'][locale.languageCode]; String get selectPart => localizedValues['select-part'][locale.languageCode]; String get number => localizedValues['number'][locale.languageCode]; - String get notClassified => - localizedValues['not-classified'][locale.languageCode]; - String get searchItemError => - localizedValues['searchItemError'][locale.languageCode]; + String get notClassified => localizedValues['not-classified'][locale.languageCode]; + String get searchItemError => localizedValues['searchItemError'][locale.languageCode]; String get youCanFind => localizedValues['YouCanFind'][locale.languageCode]; - String get itemInSearch => - localizedValues['ItemInSearch'][locale.languageCode]; - String get wantToConnectWithHmgNetwork => - localizedValues['wantConnectHmgNetwork'][locale.languageCode]; - String get failedToAccessHmgServices => - localizedValues['failedToAccessHmgServices'][locale.languageCode]; - String get enablingWifi => - localizedValues['enablingWifi'][locale.languageCode]; - String get offerAndPackages => - localizedValues['offerAndPackages'][locale.languageCode]; + String get itemInSearch => localizedValues['ItemInSearch'][locale.languageCode]; + String get wantToConnectWithHmgNetwork => localizedValues['wantConnectHmgNetwork'][locale.languageCode]; + String get failedToAccessHmgServices => localizedValues['failedToAccessHmgServices'][locale.languageCode]; + String get enablingWifi => localizedValues['enablingWifi'][locale.languageCode]; + String get offerAndPackages => localizedValues['offerAndPackages'][locale.languageCode]; String get invoiceNo => localizedValues['InvoiceNo'][locale.languageCode]; - String get specialResult => - localizedValues['SpecialResult'][locale.languageCode]; - String get generalResult => - localizedValues['GeneralResult'][locale.languageCode]; - String get showMoreBtn => - localizedValues['show-more-btn'][locale.languageCode]; + String get specialResult => localizedValues['SpecialResult'][locale.languageCode]; + String get generalResult => localizedValues['GeneralResult'][locale.languageCode]; + String get showMoreBtn => localizedValues['show-more-btn'][locale.languageCode]; String get value => localizedValues['value'][locale.languageCode]; String get range => localizedValues['range'][locale.languageCode]; String get outpatient => localizedValues['out-patient'][locale.languageCode]; @@ -1044,101 +771,73 @@ class TranslationBase { String get sendCopyRad => localizedValues['send-copy'][locale.languageCode]; String get appoSurvey => localizedValues['appoSurvey'][locale.languageCode]; String get labResults => localizedValues['labResults'][locale.languageCode]; - String get doctorRating => - localizedValues['doctorRating'][locale.languageCode]; + String get doctorRating => localizedValues['doctorRating'][locale.languageCode]; String get good => localizedValues['good'][locale.languageCode]; String get v_good => localizedValues['v-good'][locale.languageCode]; String get excellent => localizedValues['excellent'][locale.languageCode]; - String get below_average => - localizedValues['below-average'][locale.languageCode]; + String get below_average => localizedValues['below-average'][locale.languageCode]; String get infoSigns => localizedValues['info-signs'][locale.languageCode]; - String get infoAdvancePayment => - localizedValues['info-advance-payment'][locale.languageCode]; - String get infoMyBalance => - localizedValues['info-my-balance'][locale.languageCode]; + String get infoAdvancePayment => localizedValues['info-advance-payment'][locale.languageCode]; + String get infoMyBalance => localizedValues['info-my-balance'][locale.languageCode]; String get erContant => localizedValues['er-contant'][locale.languageCode]; String get er => localizedValues['er'][locale.languageCode]; - String get transportationService => - localizedValues['transportation-Service'][locale.languageCode]; - String get infoAmbulance => - localizedValues['info-ambulance'][locale.languageCode]; - String get transportHeading => - localizedValues['RRT-transport-heading'][locale.languageCode]; - String get directionHeading => - localizedValues['RRT-direction-heading'][locale.languageCode]; + String get transportationService => localizedValues['transportation-Service'][locale.languageCode]; + String get infoAmbulance => localizedValues['info-ambulance'][locale.languageCode]; + String get transportHeading => localizedValues['RRT-transport-heading'][locale.languageCode]; + String get directionHeading => localizedValues['RRT-direction-heading'][locale.languageCode]; String get toHospital => localizedValues['to-hospital'][locale.languageCode]; - String get fromHospital => - localizedValues['from-hospital'][locale.languageCode]; + String get fromHospital => localizedValues['from-hospital'][locale.languageCode]; String get oneDirec => localizedValues['one-direc'][locale.languageCode]; String get twoDirec => localizedValues['two-direc'][locale.languageCode]; - String get pickupLocation => - localizedValues['pickup-location'][locale.languageCode]; + String get pickupLocation => localizedValues['pickup-location'][locale.languageCode]; String get pickupSpot => localizedValues['pickup-spot'][locale.languageCode]; String get insideHome => localizedValues['inside-home'][locale.languageCode]; String get haveAppo => localizedValues['have-appo'][locale.languageCode]; - String get dropoffLocation => - localizedValues['dropoff-location'][locale.languageCode]; + String get dropoffLocation => localizedValues['dropoff-location'][locale.languageCode]; String get selectAll => localizedValues['select-all'][locale.languageCode]; String get selectMap => localizedValues['select-map'][locale.languageCode]; - String get noAppointment => - localizedValues['no-appointment'][locale.languageCode]; - String get patientShareB => - localizedValues['patient-share'][locale.languageCode]; - String get patientShareTax => - localizedValues['patient-share-tax'][locale.languageCode]; - String get patientShareTotal => - localizedValues['patient-share-total'][locale.languageCode]; - String get selectAmbulate => - localizedValues['select-ambulate'][locale.languageCode]; + String get noAppointment => localizedValues['no-appointment'][locale.languageCode]; + String get patientShareB => localizedValues['patient-share'][locale.languageCode]; + String get patientShareTax => localizedValues['patient-share-tax'][locale.languageCode]; + String get patientShareTotal => localizedValues['patient-share-total'][locale.languageCode]; + String get selectAmbulate => localizedValues['select-ambulate'][locale.languageCode]; String get wheelchair => localizedValues['wheelchair'][locale.languageCode]; String get walker => localizedValues['walker'][locale.languageCode]; String get stretcher => localizedValues['stretcher'][locale.languageCode]; String get none => localizedValues['none'][locale.languageCode]; String get RRTSummary => localizedValues['RRT-Summary'][locale.languageCode]; String get billAmount => localizedValues['bill-amount'][locale.languageCode]; - String get transportMethod => - localizedValues['transport-method'][locale.languageCode]; + String get transportMethod => localizedValues['transport-method'][locale.languageCode]; String get directions => localizedValues['directions'][locale.languageCode]; - String get infoMyAppointments => - localizedValues['info-my-appointments'][locale.languageCode]; + String get infoMyAppointments => localizedValues['info-my-appointments'][locale.languageCode]; String get infoTodo => localizedValues['info-todo'][locale.languageCode]; String get familyInfo => localizedValues['family-info'][locale.languageCode]; - String get profileUpdate => - localizedValues['update-succ'][locale.languageCode]; - String get dentalComplaints => - localizedValues['dental-complains'][locale.languageCode]; - String get emptyResult => - localizedValues['empty-result'][locale.languageCode]; - - String get noBookedAppo => - localizedValues['no-booked-appointment'][locale.languageCode]; - String get noConfirmedAppo => - localizedValues['no-confirmed-appointment'][locale.languageCode]; - String get noArrivedAppo => - localizedValues['no-arrived-appointment'][locale.languageCode]; - String get upcomingEmpty => - localizedValues['upcoming-empty'][locale.languageCode]; - String get upcomingTimeLeft => - localizedValues['upcoming-timeLeft'][locale.languageCode]; - - String get covidTestAllServices => - localizedValues['covid-test-all-services'][locale.languageCode]; + String get profileUpdate => localizedValues['update-succ'][locale.languageCode]; + String get dentalComplaints => localizedValues['dental-complains'][locale.languageCode]; + String get emptyResult => localizedValues['empty-result'][locale.languageCode]; + + String get noBookedAppo => localizedValues['no-booked-appointment'][locale.languageCode]; + String get noConfirmedAppo => localizedValues['no-confirmed-appointment'][locale.languageCode]; + String get noArrivedAppo => localizedValues['no-arrived-appointment'][locale.languageCode]; + String get upcomingEmpty => localizedValues['upcoming-empty'][locale.languageCode]; + String get upcomingTimeLeft => localizedValues['upcoming-timeLeft'][locale.languageCode]; + + String get covidTestAllServices => localizedValues['covid-test-all-services'][locale.languageCode]; String get pharmacy => localizedValues['pharmacy'][locale.languageCode]; String get ereferral => localizedValues['ereferral'][locale.languageCode]; - String get childVaccine => - localizedValues['child-vaccine'][locale.languageCode]; + String get childVaccine => localizedValues['child-vaccine'][locale.languageCode]; String get calculators => localizedValues['calculators'][locale.languageCode]; String get converters => localizedValues['converters'][locale.languageCode]; String get h2o => localizedValues['h2o'][locale.languageCode]; + String get waterTracker => localizedValues['waterTracker'][locale.languageCode]; + String get ft => localizedValues['ft'][locale.languageCode]; String get vTour => localizedValues['v-tour'][locale.languageCode]; String get hmgNews => localizedValues['hmg-news'][locale.languageCode]; String get bloodD => localizedValues['blood-d'][locale.languageCode]; - String get symptomCheckerTitle => - localizedValues['symptomCheckerTitle'][locale.languageCode]; + String get symptomCheckerTitle => localizedValues['symptomCheckerTitle'][locale.languageCode]; String get latestNews => localizedValues['latest-news'][locale.languageCode]; - String get ourLocation => - localizedValues['our-location'][locale.languageCode]; + String get ourLocation => localizedValues['our-location'][locale.languageCode]; String get pharmacies => localizedValues['pharmacies'][locale.languageCode]; String get hospitals => localizedValues['hospitals'][locale.languageCode]; String get wallet => localizedValues['wallet'][locale.languageCode]; @@ -1146,24 +845,19 @@ class TranslationBase { String get requested => localizedValues['requested'][locale.languageCode]; String get ready => localizedValues['ready'][locale.languageCode]; String get completed => localizedValues['completed'][locale.languageCode]; - String get requestMedicalReport => - localizedValues['request-medical-report'][locale.languageCode]; + String get requestMedicalReport => localizedValues['request-medical-report'][locale.languageCode]; String get insurCards => localizedValues['insur-cards'][locale.languageCode]; String get labResult => localizedValues['labResult'][locale.languageCode]; String get details => localizedValues['details'][locale.languageCode]; String get age => localizedValues['age'][locale.languageCode]; - String get activeInsurence => - localizedValues['active-insurence'][locale.languageCode]; + String get activeInsurence => localizedValues['active-insurence'][locale.languageCode]; String get notActive => localizedValues['not-active'][locale.languageCode]; String get cardDetail => localizedValues['card-detail'][locale.languageCode]; String get dr => localizedValues['Dr'][locale.languageCode]; String get sendSuc => localizedValues['sendSuc'][locale.languageCode]; - String get instructions => - localizedValues['instructions'][locale.languageCode]; - String get instructionsPharmacies => - localizedValues['instructions-pharmacies'][locale.languageCode]; - String get selectHospitalDec => - localizedValues['select-hospital'][locale.languageCode]; + String get instructions => localizedValues['instructions'][locale.languageCode]; + String get instructionsPharmacies => localizedValues['instructions-pharmacies'][locale.languageCode]; + String get selectHospitalDec => localizedValues['select-hospital'][locale.languageCode]; String get start => localizedValues['start'][locale.languageCode]; String get infoChat => localizedValues['info-chat'][locale.languageCode]; @@ -1172,154 +866,102 @@ class TranslationBase { 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 lastAppointment => localizedValues['last-appointment'][locale.languageCode]; String get rateClinic => localizedValues['rate-clinic'][locale.languageCode]; String get fetchData => localizedValues['fetch-data'][locale.languageCode]; - String get sendConfEmail => - localizedValues['send-email'][locale.languageCode]; - String get updateEmail => - localizedValues['update-email'][locale.languageCode]; - String get noDataAvailable => - localizedValues['noDataAvailable'][locale.languageCode]; + String get sendConfEmail => localizedValues['send-email'][locale.languageCode]; + String get updateEmail => localizedValues['update-email'][locale.languageCode]; + String get noDataAvailable => localizedValues['noDataAvailable'][locale.languageCode]; String get theName => localizedValues['thename'][locale.languageCode]; - String get noSearchResult => - localizedValues['noSearchResult'][locale.languageCode]; - String get selectFileSouse => - localizedValues['selectFileSouse'][locale.languageCode]; + String get noSearchResult => localizedValues['noSearchResult'][locale.languageCode]; + String get selectFileSouse => localizedValues['selectFileSouse'][locale.languageCode]; String get rate => localizedValues['rate'][locale.languageCode]; - String get bookedSuccess => - localizedValues['booked-success'][locale.languageCode]; - String get appoReminder30 => - localizedValues['appo-reminder-select-option-30'][locale.languageCode]; - String get appoReminder60 => - localizedValues['appo-reminder-select-option-60'][locale.languageCode]; - String get appoReminder90 => - localizedValues['appo-reminder-select-option-90'][locale.languageCode]; - String get appoReminder120 => - localizedValues['appo-reminder-select-option-120'][locale.languageCode]; + String get bookedSuccess => localizedValues['booked-success'][locale.languageCode]; + String get appoReminder30 => localizedValues['appo-reminder-select-option-30'][locale.languageCode]; + String get appoReminder60 => localizedValues['appo-reminder-select-option-60'][locale.languageCode]; + String get appoReminder90 => localizedValues['appo-reminder-select-option-90'][locale.languageCode]; + String get appoReminder120 => localizedValues['appo-reminder-select-option-120'][locale.languageCode]; String get gallery => localizedValues['gallery'][locale.languageCode]; String get camera => localizedValues['camera'][locale.languageCode]; String get medReport => localizedValues['med-report'][locale.languageCode]; - String get newMedReport => - localizedValues['new-med-report'][locale.languageCode]; - String get requestReport => - localizedValues['requestReport'][locale.languageCode]; - String get confirmMsgReport => - localizedValues['confirm-msg-report'][locale.languageCode]; - String get successSendReport => - localizedValues['successSendReport'][locale.languageCode]; + String get newMedReport => localizedValues['new-med-report'][locale.languageCode]; + String get requestReport => localizedValues['requestReport'][locale.languageCode]; + String get confirmMsgReport => localizedValues['confirm-msg-report'][locale.languageCode]; + String get successSendReport => localizedValues['successSendReport'][locale.languageCode]; String get pulseTitle => localizedValues['pulseTitle'][locale.languageCode]; - String get systolicLng => - localizedValues['systolic-lng'][locale.languageCode]; - String get diastolicLng => - localizedValues['diastolic-lng'][locale.languageCode]; - String get policyHolder => - localizedValues['policy-holder'][locale.languageCode]; + String get systolicLng => localizedValues['systolic-lng'][locale.languageCode]; + String get diastolicLng => localizedValues['diastolic-lng'][locale.languageCode]; + String get policyHolder => localizedValues['policy-holder'][locale.languageCode]; String get policyNo => localizedValues['policy-no'][locale.languageCode]; - String get expiryDateTitle => - localizedValues['expiry-date'][locale.languageCode]; + String get expiryDateTitle => localizedValues['expiry-date'][locale.languageCode]; String get classTitle => localizedValues['class'][locale.languageCode]; String get approval => localizedValues['approval'][locale.languageCode]; String get agree => localizedValues['agree'][locale.languageCode]; String get disagree => localizedValues['disagree'][locale.languageCode]; - String get requestSent => - localizedValues['request-sent'][locale.languageCode]; - String get attachInsuraceImage => - localizedValues['attach-insurace-image'][locale.languageCode]; - String get infoInsurCards => - localizedValues['info-insur-cards'][locale.languageCode]; + String get requestSent => localizedValues['request-sent'][locale.languageCode]; + String get attachInsuraceImage => localizedValues['attach-insurace-image'][locale.languageCode]; + String get infoInsurCards => localizedValues['info-insur-cards'][locale.languageCode]; String get scanNow => localizedValues['scan-now'][locale.languageCode]; - String get pharmacyServiceTermsCondition => - localizedValues['pharmacyServiceTermsCondition'][locale.languageCode]; - String get recordDeleted => - localizedValues['recordDeleted'][locale.languageCode]; - - String get referralStatus => - localizedValues['referralStatus'][locale.languageCode]; - String get referralDate => - localizedValues['referralDate'][locale.languageCode]; + String get pharmacyServiceTermsCondition => localizedValues['pharmacyServiceTermsCondition'][locale.languageCode]; + String get recordDeleted => localizedValues['recordDeleted'][locale.languageCode]; + + String get referralStatus => localizedValues['referralStatus'][locale.languageCode]; + String get referralDate => localizedValues['referralDate'][locale.languageCode]; String get patientName => localizedValues['patientName'][locale.languageCode]; - String get referralNumber => - localizedValues['referralNumber'][locale.languageCode]; + String get referralNumber => localizedValues['referralNumber'][locale.languageCode]; String get requestID => localizedValues['requestID'][locale.languageCode]; String get OrderStatus => localizedValues['OrderStatus'][locale.languageCode]; String get pickupDate => localizedValues['pickupDate'][locale.languageCode]; String get serviceName => localizedValues['serviceName'][locale.languageCode]; - String get orderLocation => - localizedValues['orderLocation'][locale.languageCode]; - String get selectService => - localizedValues['selectService'][locale.languageCode]; - String get coveredService => - localizedValues['coveredService'][locale.languageCode]; - String get selectedService => - localizedValues['selectedService'][locale.languageCode]; - String get cancelOrderMsg => - localizedValues['cancelOrderMsg'][locale.languageCode]; - String get processDoneSuccessfully => - localizedValues['processDoneSuccessfully'][locale.languageCode]; - String get selectHomeHealthCareServices => - localizedValues['selectHomeHealthCareServices'][locale.languageCode]; + String get orderLocation => localizedValues['orderLocation'][locale.languageCode]; + String get selectService => localizedValues['selectService'][locale.languageCode]; + String get coveredService => localizedValues['coveredService'][locale.languageCode]; + String get selectedService => localizedValues['selectedService'][locale.languageCode]; + String get cancelOrderMsg => localizedValues['cancelOrderMsg'][locale.languageCode]; + String get processDoneSuccessfully => localizedValues['processDoneSuccessfully'][locale.languageCode]; + String get selectHomeHealthCareServices => localizedValues['selectHomeHealthCareServices'][locale.languageCode]; String get topBrands => localizedValues['topBrands'][locale.languageCode]; String get notifyMe => localizedValues['notifyMe'][locale.languageCode]; - String get specification => - localizedValues['specification'][locale.languageCode]; - String get availability => - localizedValues['availability'][locale.languageCode]; - String get quantitySize => - localizedValues['quantitySize'][locale.languageCode]; + String get specification => localizedValues['specification'][locale.languageCode]; + String get availability => localizedValues['availability'][locale.languageCode]; + String get quantitySize => localizedValues['quantitySize'][locale.languageCode]; String get addToCart => localizedValues['addToCart'][locale.languageCode]; String get buyNow => localizedValues['buyNow'][locale.languageCode]; - String get quantityShortcut => - localizedValues['quantityShortcut'][locale.languageCode]; + String get quantityShortcut => localizedValues['quantityShortcut'][locale.languageCode]; - String get updatedEmail => - localizedValues['updated-email'][locale.languageCode]; - String get viewListChildren => - localizedValues['view-list-children'][locale.languageCode]; + String get updatedEmail => localizedValues['updated-email'][locale.languageCode]; + String get viewListChildren => localizedValues['view-list-children'][locale.languageCode]; String get addChild => localizedValues['add-child'][locale.languageCode]; String get childDob => localizedValues['childDob'][locale.languageCode]; - String get deletedChildMes => - localizedValues['deleted-child-mes'][locale.languageCode]; + String get deletedChildMes => localizedValues['deleted-child-mes'][locale.languageCode]; String get visit => localizedValues['visit'][locale.languageCode]; - String get descriptionVaccination => - localizedValues['description-vaccination'][locale.languageCode]; + String get descriptionVaccination => localizedValues['description-vaccination'][locale.languageCode]; String get dueDate => localizedValues['due-date'][locale.languageCode]; String get validEmail => localizedValues['valid-email'][locale.languageCode]; - String get confirmSend => - localizedValues['confirm-send'][locale.languageCode]; - String get emailSuccess => - localizedValues['email-success'][locale.languageCode]; - String get deletedChild => - localizedValues['deleted-child'][locale.languageCode]; - String get addInstructions => - localizedValues['add-instructions'][locale.languageCode]; + String get confirmSend => localizedValues['confirm-send'][locale.languageCode]; + String get emailSuccess => localizedValues['email-success'][locale.languageCode]; + String get deletedChild => localizedValues['deleted-child'][locale.languageCode]; + String get addInstructions => localizedValues['add-instructions'][locale.languageCode]; String get addedChild => localizedValues['added-child'][locale.languageCode]; String get appUpdate => localizedValues['appUpdate'][locale.languageCode]; - String get ereferralSaveSuccess => - localizedValues['ereferralSaveSuccess'][locale.languageCode]; + String get ereferralSaveSuccess => localizedValues['ereferralSaveSuccess'][locale.languageCode]; String get year => localizedValues['Year'][locale.languageCode]; String get month => localizedValues['Month'][locale.languageCode]; String get point => localizedValues['point'][locale.languageCode]; String get riyal => localizedValues['riyal'][locale.languageCode]; - String get termOfService => - localizedValues['termOfService'][locale.languageCode]; - String get shoppingCart => - localizedValues['shoppingCart'][locale.languageCode]; + String get termOfService => localizedValues['termOfService'][locale.languageCode]; + String get shoppingCart => localizedValues['shoppingCart'][locale.languageCode]; String get covidTest => localizedValues['covidTest'][locale.languageCode]; String get driveThru => localizedValues['driveThru'][locale.languageCode]; - String get NearestErDesc => - localizedValues['NearestErDesc'][locale.languageCode]; + String get NearestErDesc => localizedValues['NearestErDesc'][locale.languageCode]; String get NearestEr => localizedValues['NearestEr'][locale.languageCode]; String get infoCMC => localizedValues['infoCMC'][locale.languageCode]; - String get instructionAgree => - localizedValues['instructionAgree'][locale.languageCode]; + String get instructionAgree => localizedValues['instructionAgree'][locale.languageCode]; String get reqId => localizedValues['reqId'][locale.languageCode]; - String get ordersLog => - localizedValues['RRT-orders-log'][locale.languageCode]; + String get ordersLog => localizedValues['RRT-orders-log'][locale.languageCode]; String get bloodSugar => localizedValues['blood-sugar'][locale.languageCode]; String get myTracker => localizedValues['my-tracker'][locale.languageCode]; String get weekly => localizedValues['weekly'][locale.languageCode]; @@ -1328,55 +970,37 @@ class TranslationBase { String get measured => localizedValues['measured'][locale.languageCode]; String get sugarAdd => localizedValues['sugar-add'][locale.languageCode]; String get other => localizedValues['other'][locale.languageCode]; - String get measureUnit => - localizedValues['measure-unit'][locale.languageCode]; - String get measureTime => - localizedValues['measure-time'][locale.languageCode]; + String get measureUnit => localizedValues['measure-unit'][locale.languageCode]; + String get measureTime => localizedValues['measure-time'][locale.languageCode]; String get update => localizedValues['update'][locale.languageCode]; - String get covid19_driveThrueTest => - localizedValues['covid19_driveThrueTest'][locale.languageCode]; + String get covid19_driveThrueTest => localizedValues['covid19_driveThrueTest'][locale.languageCode]; String get eReferral => localizedValues['E-Referral'][locale.languageCode]; String get vaccination => localizedValues["vaccination"][locale.languageCode]; - String get msg_email_address_up_to_date => - localizedValues["msg_email_address_up_to_date"][locale.languageCode]; - String get updateEmailMsg => - localizedValues["update-email-msg"][locale.languageCode]; + String get msg_email_address_up_to_date => localizedValues["msg_email_address_up_to_date"][locale.languageCode]; + String get updateEmailMsg => localizedValues["update-email-msg"][locale.languageCode]; String get childName => localizedValues["childName"][locale.languageCode]; - String get addNewChild => - localizedValues["add-new-child"][locale.languageCode]; - String get sendChildEmailMsg => - localizedValues["send-child-email-msg"][locale.languageCode]; - String get vaccinationAddChildMsg => - localizedValues["vaccination-add-child-msg"][locale.languageCode]; - String get childAddedSuccessfully => - localizedValues["child_added_successfully"][locale.languageCode]; + String get addNewChild => localizedValues["add-new-child"][locale.languageCode]; + String get sendChildEmailMsg => localizedValues["send-child-email-msg"][locale.languageCode]; + String get vaccinationAddChildMsg => localizedValues["vaccination-add-child-msg"][locale.languageCode]; + String get childAddedSuccessfully => localizedValues["child_added_successfully"][locale.languageCode]; String get sugar => localizedValues["sugar"][locale.languageCode]; - String get bloodCholesterol => - localizedValues["bloodCholesterol"][locale.languageCode]; + String get bloodCholesterol => localizedValues["bloodCholesterol"][locale.languageCode]; String get cholesterol => localizedValues["cholesterol"][locale.languageCode]; - String get triglycerides => - localizedValues["triglycerides"][locale.languageCode]; + String get triglycerides => localizedValues["triglycerides"][locale.languageCode]; String get fatInBlood => localizedValues["fatInBlood"][locale.languageCode]; String get calculate => localizedValues["calculate"][locale.languageCode]; - String get enterReadingValue => - localizedValues["enterReadingValue"][locale.languageCode]; - String get convertBloodSugarStatement => - localizedValues["convertBloodSugarStatement"][locale.languageCode]; + String get enterReadingValue => localizedValues["enterReadingValue"][locale.languageCode]; + String get convertBloodSugarStatement => localizedValues["convertBloodSugarStatement"][locale.languageCode]; String get convertFrom => localizedValues["convertFrom"][locale.languageCode]; String get result => localizedValues["result"][locale.languageCode]; - String get bloodSugarConversion => - localizedValues["bloodSugarConversion"][locale.languageCode]; - String get convertCholesterolStatement => - localizedValues["convertCholesterolStatement"][locale.languageCode]; - String get triglyceridesConvertStatement => - localizedValues["triglyceridesConvertStatement"][locale.languageCode]; - - String get bloodDEnterDesc => - localizedValues["bloodD-enter-desc"][locale.languageCode]; - String get viewTermsConditions => - localizedValues["viewTermsConditions"][locale.languageCode]; + String get bloodSugarConversion => localizedValues["bloodSugarConversion"][locale.languageCode]; + String get convertCholesterolStatement => localizedValues["convertCholesterolStatement"][locale.languageCode]; + String get triglyceridesConvertStatement => localizedValues["triglyceridesConvertStatement"][locale.languageCode]; + + String get bloodDEnterDesc => localizedValues["bloodD-enter-desc"][locale.languageCode]; + String get viewTermsConditions => localizedValues["viewTermsConditions"][locale.languageCode]; String get walkinAppo => localizedValues["WalkinAppo"][locale.languageCode]; String get videoAppo => localizedValues["videoAppo"][locale.languageCode]; String get weightAdd => localizedValues["weight-add"][locale.languageCode]; @@ -1384,6 +1008,46 @@ class TranslationBase { String get diastolicAdd => localizedValues["systolic-add"][locale.languageCode]; String get cmcHeading => localizedValues["cmc-heading"][locale.languageCode]; + String get today => localizedValues["today"][locale.languageCode]; + String get week => localizedValues["week"][locale.languageCode]; + String get h2oAmountOfWater => localizedValues["h2o-amount-of-water"][locale.languageCode]; + String get updateUser => localizedValues["update-user"][locale.languageCode]; + String get editname => localizedValues["editname"][locale.languageCode]; + String get activityLevel => localizedValues["activity-level"][locale.languageCode]; + String get success => localizedValues["success"][locale.languageCode]; + String get enterNameHere => localizedValues["enterNameHere"][locale.languageCode]; + String get lightActive => localizedValues["light-active"][locale.languageCode]; + String get modActive => localizedValues["mod-active"][locale.languageCode]; + String get reminderLabel => localizedValues["reminder-label"][locale.languageCode]; + String get reminderTimesLabel => localizedValues["reminder-times-label"][locale.languageCode]; + String get times => localizedValues["times"][locale.languageCode]; + String get WaterCalculate => localizedValues["WaterCalculate"][locale.languageCode]; + String get notifTitle => localizedValues["notif-title"][locale.languageCode]; + String get notifText => localizedValues["notif-text"][locale.languageCode]; + String get custom => localizedValues["custom"][locale.languageCode]; + String get undo => localizedValues["undo"][locale.languageCode]; + String get drinking => localizedValues["drinking"][locale.languageCode]; + String get remaining => localizedValues["remaining"][locale.languageCode]; + String get taken => localizedValues["taken"][locale.languageCode]; + String get ml => localizedValues["ml"][locale.languageCode]; + String get l => localizedValues["l"][locale.languageCode]; + String get customLabel => localizedValues["custom-label"][locale.languageCode]; + String get selectUnit => localizedValues["select-unit"][locale.languageCode]; + String get customLabelInLitres => localizedValues["custom-label-in-litres"][locale.languageCode]; + String get customLabelInMililitres => localizedValues["custom-label-in-mililitres"][locale.languageCode]; + String get amount_ => localizedValues["amount"][locale.languageCode]; + String get targetReach => localizedValues["target-reach"][locale.languageCode]; + String get weekHeader => localizedValues["week-header"][locale.languageCode]; + String get monthHeader => localizedValues["month-header"][locale.languageCode]; + String get notifPermissionTitle => localizedValues["notif-permission-title"][locale.languageCode]; + String get notifPermissionMsg => localizedValues["notif-permission-msg"][locale.languageCode]; + String get verification_message_code => localizedValues["verification_message_code"][locale.languageCode]; + String get sms_code => localizedValues["sms_code"][locale.languageCode]; + String get code_failure => localizedValues["code_failure"][locale.languageCode]; + String get resend => localizedValues["resend"][locale.languageCode]; + String get submitncontinue => localizedValues["submitncontinue"][locale.languageCode]; + String get areyousure => localizedValues["areyousure"][locale.languageCode]; + String get preferredunit => localizedValues["preferredunit"][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/widgets/others/app_scaffold_widget.dart b/lib/widgets/others/app_scaffold_widget.dart index 8103f081..e5381ccb 100644 --- a/lib/widgets/others/app_scaffold_widget.dart +++ b/lib/widgets/others/app_scaffold_widget.dart @@ -44,58 +44,64 @@ class AppScaffold extends StatelessWidget { final List infoList; final Color backgroundColor; final double preferredSize; + final bool showHomeAppBarIcon; final List appBarIcons; final List imagesInfo; AuthenticatedUserObject authenticatedUserObject = - locator(); + locator(); AppScaffold( {@required this.body, - this.appBarTitle = '', - this.isLoading = false, - this.isShowAppBar = false, - this.hasAppBarParam, - this.bottomSheet, - this.baseViewModel, - this.floatingActionButton, - this.isPharmacy = false, - this.title, - this.description, - this.isShowDecPage = true, - this.isBottomBar, - this.backgroundColor, - this.preferredSize = 0.0, - this.appBarIcons, - this.infoList, this.imagesInfo}); + this.appBarTitle = '', + this.isLoading = false, + this.isShowAppBar = false, + this.hasAppBarParam, + this.bottomSheet, + this.baseViewModel, + this.floatingActionButton, + this.isPharmacy = false, + this.title, + this.description, + this.isShowDecPage = true, + this.isBottomBar, + this.backgroundColor, + this.preferredSize = 0.0, + this.showHomeAppBarIcon = true, + this.appBarIcons, + this.infoList, + this.imagesInfo}); @override Widget build(BuildContext context) { AppGlobal.context = context; return Scaffold( backgroundColor: - backgroundColor ?? Theme.of(context).scaffoldBackgroundColor, - appBar: isShowAppBar? AppBarWidget( - appBarTitle:appBarTitle, - appBarIcons:appBarIcons, - isPharmacy: isPharmacy, - isShowDecPage: isShowDecPage, - ):null, + backgroundColor ?? Theme.of(context).scaffoldBackgroundColor, + appBar: isShowAppBar + ? AppBarWidget( + appBarTitle: appBarTitle, + appBarIcons: appBarIcons, + showHomeAppBarIcon: showHomeAppBarIcon, + isPharmacy: isPharmacy, + isShowDecPage: isShowDecPage, + ) + : null, bottomSheet: bottomSheet, body: (!Provider.of(context, listen: false).isLogin && - isShowDecPage) + isShowDecPage) ? NotAutPage( - title: title ?? appBarTitle, - description: description, - infoList: infoList, - imagesInfo: imagesInfo, - ) + title: title ?? appBarTitle, + description: description, + infoList: infoList, + imagesInfo: imagesInfo, + ) : baseViewModel != null - ? NetworkBaseView( - child: body, - baseViewModel: baseViewModel, - ) - : body, + ? NetworkBaseView( + child: body, + baseViewModel: baseViewModel, + ) + : body, floatingActionButton: floatingActionButton, ); } @@ -103,20 +109,24 @@ class AppScaffold extends StatelessWidget { buildAppLoaderWidget(bool isLoading) { return isLoading ? AppLoaderWidget() : Container(); } - } class AppBarWidget extends StatelessWidget with PreferredSizeWidget { final AuthenticatedUserObject authenticatedUserObject = - locator(); + locator(); final String appBarTitle; + final bool showHomeAppBarIcon; final List appBarIcons; final bool isPharmacy; final bool isShowDecPage; - AppBarWidget({this.appBarTitle, this.appBarIcons, - this.isPharmacy = true, this.isShowDecPage = true}); + AppBarWidget( + {this.appBarTitle, + this.showHomeAppBarIcon, + this.appBarIcons, + this.isPharmacy = true, + this.isShowDecPage = true}); @override Widget build(BuildContext context) { @@ -128,10 +138,9 @@ class AppBarWidget extends StatelessWidget with PreferredSizeWidget { return AppBar( elevation: 0, backgroundColor: - isPharmacy ? Colors.green : Theme.of(context).appBarTheme.color, + isPharmacy ? Colors.green : Theme.of(context).appBarTheme.color, textTheme: TextTheme( - headline6: - TextStyle(color: Colors.white, fontWeight: FontWeight.bold), + headline6: TextStyle(color: Colors.white, fontWeight: FontWeight.bold), ), title: Text( authenticatedUserObject.isLogin || !isShowDecPage @@ -140,8 +149,7 @@ class AppBarWidget extends StatelessWidget with PreferredSizeWidget { style: TextStyle( fontWeight: FontWeight.bold, color: Colors.white, - fontFamily: - projectViewModel.isArabic ? 'Cairo' : 'WorkSans')), + fontFamily: projectViewModel.isArabic ? 'Cairo' : 'WorkSans')), leading: Builder( builder: (BuildContext context) { return ArrowBack(); @@ -151,27 +159,25 @@ class AppBarWidget extends StatelessWidget with PreferredSizeWidget { actions: [ isPharmacy ? IconButton( - icon: Icon(Icons.shopping_cart), + icon: Icon(Icons.shopping_cart), + color: Colors.white, + onPressed: () { + Navigator.of(context).popUntil(ModalRoute.withName('/')); + }) + : Container(), + if (showHomeAppBarIcon) + IconButton( + icon: Icon(FontAwesomeIcons.home), color: Colors.white, onPressed: () { - Navigator.of(context) - .popUntil(ModalRoute.withName('/')); - }) - : Container(), - IconButton( - icon: Icon(FontAwesomeIcons.home), - color: Colors.white, - onPressed: () { - Navigator.pushAndRemoveUntil( - context, - MaterialPageRoute( - builder: (context) => LandingPage()), - (Route r) => false); - }, - ), + Navigator.pushAndRemoveUntil( + context, + MaterialPageRoute(builder: (context) => LandingPage()), + (Route r) => false); + }, + ), if (appBarIcons != null) ...appBarIcons ], - ); } From bd062150c12d19bfd8091305a95881867332abd8 Mon Sep 17 00:00:00 2001 From: Sikander Saleem Date: Mon, 8 Feb 2021 11:26:56 +0300 Subject: [PATCH 40/42] H2O feature improvement --- .../AlHabibMedicalService/h2o/Dialog/select_amount_dialog.dart | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/pages/AlHabibMedicalService/h2o/Dialog/select_amount_dialog.dart b/lib/pages/AlHabibMedicalService/h2o/Dialog/select_amount_dialog.dart index dd67d098..2df90419 100644 --- a/lib/pages/AlHabibMedicalService/h2o/Dialog/select_amount_dialog.dart +++ b/lib/pages/AlHabibMedicalService/h2o/Dialog/select_amount_dialog.dart @@ -17,7 +17,6 @@ class SelectAmountDialog extends StatefulWidget { } class _SelectAmountDialogState extends State { - List searchAmount = [ AmountModel(name: "l", nameAr: "لتر", value: 1), AmountModel(name: "ml", nameAr: "مم لتر", value: 2), @@ -26,13 +25,13 @@ class _SelectAmountDialogState extends State { void initState() { super.initState(); widget.selectedAmount = widget.selectedAmount ?? searchAmount[0]; + getLanguage(); } String languageID = "en"; void getLanguage() async { languageID = await sharedPref.getString(APP_LANGUAGE); - print(languageID); setState(() {}); } From e40ad85d61232096f667fdd8d40d08e2caa5d308 Mon Sep 17 00:00:00 2001 From: Sikander Saleem Date: Mon, 8 Feb 2021 15:32:46 +0300 Subject: [PATCH 41/42] H2O feature, setting page added --- .../h2o/h20_setting.dart | 463 ++++++++++++++++++ 1 file changed, 463 insertions(+) create mode 100644 lib/pages/AlHabibMedicalService/h2o/h20_setting.dart diff --git a/lib/pages/AlHabibMedicalService/h2o/h20_setting.dart b/lib/pages/AlHabibMedicalService/h2o/h20_setting.dart new file mode 100644 index 00000000..4295558a --- /dev/null +++ b/lib/pages/AlHabibMedicalService/h2o/h20_setting.dart @@ -0,0 +1,463 @@ +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/H2O/user_detail_model.dart'; +import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/H2O_service.dart'; +import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/H2O_view_model.dart'; +import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/BranchView.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.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'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/painting.dart'; +import 'package:flutter/services.dart'; +import 'package:flutter/widgets.dart'; + +import 'Dialog/setting_page_radio_button_list_dialog.dart'; + +class H2oSetting extends StatefulWidget { + final UserDetailModel userDetailModel; + final H2OViewModel viewModel; + H2oSetting({Key key, this.userDetailModel, this.viewModel}) : super(key: key); + + @override + _H2oSettingState createState() { + return _H2oSettingState(); + } +} + +class _H2oSettingState extends State { + TextEditingController _nameController = TextEditingController(); + TextEditingController _heightController = TextEditingController(); + TextEditingController _weightController = TextEditingController(); + bool _isUnitML = false; + bool _isGenderMale = false; + bool _isHeightCM = false; + bool _isWeightKG = false; + double _heightValue = 1; + double _weightValue = 1; + + List _activityLevelListEng = []; + List _remindedTimeListEng = []; + int _selectedActiveLevel = 1; + int _selectedRemindedTime = 0; + DateTime _dobDate = DateTime.now(); + DateTime _tempDate = DateTime.now(); + + UserDetailModel _userDetailModel; + + @override + void initState() { + super.initState(); + _userDetailModel = widget.userDetailModel; + _heightValue = _userDetailModel.height; + _weightValue = _userDetailModel.weight; + _heightController.text = _heightValue.toStringAsFixed(0); + _weightController.text = _weightValue.toStringAsFixed(0); + _nameController.text = _userDetailModel.firstName; + _isWeightKG = _userDetailModel.isWeightInKG; + _isHeightCM = _userDetailModel.isHeightInCM; + _isGenderMale = _userDetailModel.gender == "M" ? true : false; + _dobDate = DateUtil.convertStringToDate(_userDetailModel.dOB); + _selectedActiveLevel = _userDetailModel.activityID ?? 1; + } + + @override + void didChangeDependencies() { + // TODO: implement didChangeDependencies + super.didChangeDependencies(); + + _activityLevelListEng = [ + TranslationBase.of(context).notActive, + TranslationBase.of(context).lightActive, + TranslationBase.of(context).modActive, + TranslationBase.of(context).active + ]; + + _remindedTimeListEng = [ + "1 ${TranslationBase.of(context).time}", + "2 ${TranslationBase.of(context).times}", + "3 ${TranslationBase.of(context).times}", + "4 ${TranslationBase.of(context).times}" + ]; + } + + @override + void dispose() { + super.dispose(); + } + + @override + Widget build(BuildContext context) { + return AppScaffold( + isShowAppBar: true, + appBarTitle: TranslationBase.of(context).h2o, + showHomeAppBarIcon: false, + body: SingleChildScrollView( + padding: EdgeInsets.fromLTRB(8, 8, 8, 80), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + TextField( + controller: _nameController, + decoration: InputDecoration( + labelText: TranslationBase.of(context).enterNameHere, + labelStyle: TextStyle(color: Colors.black87), + fillColor: Colors.white, + filled: true, + border: UnderlineInputBorder( + borderSide: BorderSide( + width: 0, + style: BorderStyle.none, + ), + borderRadius: BorderRadius.circular(6.0), + ), + ), + ), + SizedBox(height: 8), + Text(TranslationBase.of(context).preferredunit), + SizedBox(height: 8), + _commonButtonsRow(TranslationBase.of(context).ml, TranslationBase.of(context).l, _isUnitML, (value) { + if (_isUnitML != value) { + setState(() { + _isUnitML = value; + }); + } + }), + Padding( + padding: EdgeInsets.only(top: 8.0, bottom: 8.0), + child: Divider(height: 1.5, color: Colors.black54), + ), + Text(TranslationBase.of(context).gender), + SizedBox(height: 8), + _commonButtonsRow(TranslationBase.of(context).male, TranslationBase.of(context).female, _isGenderMale, (value) { + if (_isGenderMale != value) { + setState(() { + _isGenderMale = value; + }); + } + }), + Padding( + padding: EdgeInsets.only(top: 8.0, bottom: 8.0), + child: Divider(height: 1.5, color: Colors.black54), + ), + Text(TranslationBase.of(context).height), + _commonSlidersRow(_heightController, 1, 270, _heightValue, (text) { + _heightController.text = text; + }, (value) { + setState(() { + _heightValue = value; + }); + }), + SizedBox(height: 8), + Text(TranslationBase.of(context).heightUnit), + SizedBox(height: 8), + _commonButtonsRow(TranslationBase.of(context).cm, TranslationBase.of(context).ft, _isHeightCM, (value) { + if (_isHeightCM != value) { + setState(() { + _isHeightCM = value; + }); + } + }), + SizedBox(height: 8), + _commonSlidersRow(_weightController, 1, 250, _weightValue, (text) { + _weightController.text = text; + }, (value) { + setState(() { + _weightValue = value; + }); + }), + SizedBox(height: 8), + Text(TranslationBase.of(context).weightUnit), + SizedBox(height: 8), + _commonButtonsRow(TranslationBase.of(context).kg, TranslationBase.of(context).lb, _isWeightKG, (value) { + if (_isWeightKG != value) { + setState(() { + _isWeightKG = value; + }); + } + }), + Padding( + padding: EdgeInsets.only(top: 8.0, bottom: 8.0), + child: Divider(height: 1.5, color: Colors.black54), + ), + Container( + padding: EdgeInsets.all(8), + width: MediaQuery.of(context).size.width, + decoration: BoxDecoration(borderRadius: BorderRadius.circular(8), color: Colors.white), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text("${TranslationBase.of(context).birth_date}:"), + SizedBox(height: 8), + InkWell( + onTap: () { + showModalBottomSheet( + context: context, + builder: (context) { + return Container( + height: 250, + padding: EdgeInsets.all(8), + child: Column(children: [ + Container( + height: 40, + alignment: Alignment.centerRight, + child: Row(mainAxisSize: MainAxisSize.min, children: [ + InkWell( + onTap: () => Navigator.pop(context), + child: Container( + alignment: Alignment.center, + padding: EdgeInsets.fromLTRB(8, 4, 8, 4), + child: Text(TranslationBase.of(context).cancel), + ), + ), + SizedBox(width: 8), + InkWell( + onTap: () { + Navigator.pop(context); + setState(() { + _dobDate = _tempDate; + }); + }, + child: Container( + alignment: Alignment.center, + padding: EdgeInsets.fromLTRB(8, 4, 8, 4), + child: Text(TranslationBase.of(context).ok), + ), + ) + ]), + ), + Expanded( + child: Container( + width: MediaQuery.of(context).size.width, + child: CupertinoDatePicker( + initialDateTime: _dobDate, + mode: CupertinoDatePickerMode.date, + onDateTimeChanged: (_date) { + _tempDate = _date; + }, + ), + ), + ) + ]), + ); + }); + }, // implement cupertino dialog to select date + child: Row( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [Text(DateUtil.getFormattedDate(_dobDate, "yyyy-MM-dd")), Icon(Icons.arrow_drop_down_outlined)]), + ) + ], + ), + ), + SizedBox(height: 8), + _commonDialogSelectorRow(TranslationBase.of(context).activityLevel, _activityLevelListEng[_selectedActiveLevel - 1], () { + showDialog( + context: context, + child: CommonRadioButtonDialog( + list: _activityLevelListEng, + title: TranslationBase.of(context).activityLevel, + onSelect: (index) { + Navigator.pop(context); + setState(() { + _selectedActiveLevel = index + 1; + }); + }, + selectedIndex: _selectedActiveLevel - 1, + ), + ); + }), + SizedBox(height: 8), + _commonDialogSelectorRow(TranslationBase.of(context).reminderLabel, _remindedTimeListEng[_selectedRemindedTime], () { + showDialog( + context: context, + child: CommonRadioButtonDialog( + list: _remindedTimeListEng, + onSelect: (index) { + Navigator.pop(context); + setState(() { + _selectedRemindedTime = index; + }); + }, + selectedIndex: _selectedRemindedTime, + ), + ); + }), + SizedBox(height: 16), + SizedBox( + height: 50, + width: MediaQuery.of(context).size.width, + child: FlatButton( + color: Theme.of(context).appBarTheme.color, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(8.0), + ), + onPressed: _updateUserDetails, + child: Text( + TranslationBase.of(context).save, + style: TextStyle(color: Colors.white, fontSize: 18, fontWeight: FontWeight.w600), + ), + ), + ) + ], + ), + ), + ); + } + + Widget _commonButtonsRow(String rightText, String leftText, bool checkParam, Function(bool) callBack) { + return Row(children: [ + Expanded( + child: SizedBox( + height: 40, + child: RaisedButton( + color: checkParam ? Theme.of(context).appBarTheme.color : Colors.white, + child: Text( + rightText, + style: TextStyle(color: checkParam ? Colors.white : Theme.of(context).appBarTheme.color, fontWeight: FontWeight.w600), + ), + onPressed: () => callBack(true), + ), + ), + ), + SizedBox(width: 12), + Expanded( + child: SizedBox( + height: 40, + child: RaisedButton( + color: !checkParam ? Theme.of(context).appBarTheme.color : Colors.white, + child: Text( + leftText, + style: TextStyle(color: !checkParam ? Colors.white : Theme.of(context).appBarTheme.color, fontWeight: FontWeight.w600), + ), + onPressed: () => callBack(false), + ), + ), + ), + ]); + } + + Widget _commonSlidersRow( + _controller, double _minValue, double _maxValue, double _valueOrg, Function(String) onTextValueChange, Function(double) onValueChange) { + return Container( + margin: EdgeInsets.only(top: 6), + padding: EdgeInsets.all(6), + color: Colors.white, + height: 50, + child: Row( + children: [ + SizedBox( + width: 75, + child: TextField( + controller: _controller, + textAlign: TextAlign.center, + keyboardType: TextInputType.number, + onChanged: (value) { + double _value = double.parse(value); + if (_value > _maxValue) { + onTextValueChange(_maxValue.toStringAsFixed(0)); + onValueChange(_maxValue); + return; + } else if (_value < _minValue) { + onTextValueChange(_minValue.toStringAsFixed(0)); + onValueChange(_minValue); + return; + } else if (_value >= _minValue && _value <= _maxValue) { + onValueChange(_value); + return; + } + }, + inputFormatters: [ + FilteringTextInputFormatter.allow(RegExp(r'[0-9]')), + ], + decoration: InputDecoration( + contentPadding: EdgeInsets.only(left: 4, right: 4), + fillColor: Colors.white, + filled: true, + focusedBorder: OutlineInputBorder( + borderSide: BorderSide( + width: 1, + color: Colors.grey, + style: BorderStyle.solid, + ), + borderRadius: BorderRadius.circular(6.0), + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide( + width: 1, + color: Colors.grey, + style: BorderStyle.solid, + ), + borderRadius: BorderRadius.circular(6.0), + ), + ), + ), + ), + Expanded( + flex: 6, + child: Slider( + min: _minValue, + max: _maxValue, + activeColor: Colors.redAccent, + inactiveColor: Colors.redAccent.withOpacity(.3), + value: _valueOrg, + onChanged: (value) { + onTextValueChange(value.toStringAsFixed(0)); + onValueChange(value); + }, + ), + ) + ], + ), + ); + } + + Widget _commonDialogSelectorRow(String title, String selectedText, VoidCallback onPressed) { + return Column(crossAxisAlignment: CrossAxisAlignment.start, mainAxisSize: MainAxisSize.min, children: [ + Text(title), + SizedBox(height: 8), + InkWell( + onTap: onPressed, + child: Container( + height: 50, + padding: EdgeInsets.all(8), + width: MediaQuery.of(context).size.width, + decoration: BoxDecoration(borderRadius: BorderRadius.circular(8), color: Colors.white), + child: Row( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [Text(selectedText), Icon(Icons.arrow_drop_down_outlined)], + ), + ), + ) + ]); + } + + void _updateUserDetails() async { + _userDetailModel.height = _heightValue; + _userDetailModel.weight = _weightValue; + _userDetailModel.firstName = _nameController.text; + _userDetailModel.isWeightInKG = _isWeightKG; + _userDetailModel.isHeightInCM = _isHeightCM; + _userDetailModel.gender = _isGenderMale ? "M" : "F"; + + var tempDate = DateUtil.convertDateToString(_dobDate); + if (!tempDate.endsWith("/")) { + tempDate = tempDate + "/"; + } + + _userDetailModel.dOB = tempDate; + _userDetailModel.activityID = _selectedActiveLevel; + GifLoaderDialogUtils.showMyDialog(context); + await widget.viewModel.updateUserDetail(_userDetailModel, (tag) { + if (tag) { + AppToast.showSuccessToast(message: TranslationBase.of(context).success); + } + GifLoaderDialogUtils.hideDialog(context); + }); + + Navigator.pop(context); + } +} From d477481856665ff6854cb367ee8a19e8b1066a4e Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Mon, 8 Feb 2021 16:05:47 +0200 Subject: [PATCH 42/42] fix security issues in pharmacy --- ios/Podfile.lock | 440 +----------------- ios/Runner.xcodeproj/project.pbxproj | 36 +- lib/config/config.dart | 47 +- lib/config/shared_pref_kay.dart | 1 + .../customer_addresses_service.dart | 4 +- lib/core/service/client/base_app_client.dart | 30 +- lib/core/service/offers_service.dart | 4 +- .../parmacyModule/order-preview-service.dart | 8 +- .../parmacyModule/parmacy_module_service.dart | 33 +- .../parmacyModule/prescription_service.dart | 2 +- .../service/pharmacy_categorise_service.dart | 18 +- .../pharmacy_module_view_model.dart | 21 + lib/pages/DrawerPages/family/my-family.dart | 9 + lib/pages/landing/landing_page_pharmcy.dart | 2 +- lib/pages/login/confirm-login.dart | 9 + lib/pages/login/login.dart | 8 + .../pharmacyAddress_service.dart | 4 +- .../product_detail_service.dart | 2 +- lib/widgets/drawer/app_drawer_widget.dart | 7 + 19 files changed, 165 insertions(+), 520 deletions(-) diff --git a/ios/Podfile.lock b/ios/Podfile.lock index fdb971fd..1df50aa4 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -1,461 +1,25 @@ PODS: - - android_intent (0.0.1): - - Flutter - - barcode_scan_fix (0.0.1): - - Flutter - - MTBBarcodeScanner - - connectivity (0.0.1): - - Flutter - - Reachability - - connectivity_for_web (0.1.0): - - Flutter - - connectivity_macos (0.0.1): - - Flutter - - device_calendar (0.0.1): - - Flutter - - device_info (0.0.1): - - Flutter - - Firebase/CoreOnly (6.33.0): - - FirebaseCore (= 6.10.3) - - Firebase/Messaging (6.33.0): - - Firebase/CoreOnly - - FirebaseMessaging (~> 4.7.0) - - firebase_core (0.5.3): - - Firebase/CoreOnly (~> 6.33.0) - - Flutter - - firebase_core_web (0.1.0): - - Flutter - - firebase_messaging (7.0.3): - - Firebase/CoreOnly (~> 6.33.0) - - Firebase/Messaging (~> 6.33.0) - - firebase_core - - Flutter - - FirebaseCore (6.10.3): - - FirebaseCoreDiagnostics (~> 1.6) - - GoogleUtilities/Environment (~> 6.7) - - GoogleUtilities/Logger (~> 6.7) - - FirebaseCoreDiagnostics (1.7.0): - - GoogleDataTransport (~> 7.4) - - GoogleUtilities/Environment (~> 6.7) - - GoogleUtilities/Logger (~> 6.7) - - nanopb (~> 1.30906.0) - - FirebaseInstallations (1.7.0): - - FirebaseCore (~> 6.10) - - GoogleUtilities/Environment (~> 6.7) - - GoogleUtilities/UserDefaults (~> 6.7) - - PromisesObjC (~> 1.2) - - FirebaseInstanceID (4.8.0): - - FirebaseCore (~> 6.10) - - FirebaseInstallations (~> 1.6) - - GoogleUtilities/Environment (~> 6.7) - - GoogleUtilities/UserDefaults (~> 6.7) - - FirebaseMessaging (4.7.1): - - FirebaseCore (~> 6.10) - - FirebaseInstanceID (~> 4.7) - - GoogleUtilities/AppDelegateSwizzler (~> 6.7) - - GoogleUtilities/Environment (~> 6.7) - - GoogleUtilities/Reachability (~> 6.7) - - GoogleUtilities/UserDefaults (~> 6.7) - - Protobuf (>= 3.9.2, ~> 3.9) - Flutter (1.0.0) - - flutter_email_sender (0.0.1): - - Flutter - - flutter_flexible_toast (0.0.1): - - Flutter - - flutter_inappwebview (0.0.1): - - Flutter - - flutter_local_notifications (0.0.1): - - Flutter - - flutter_plugin_android_lifecycle (0.0.1): - - Flutter - - flutter_tts (0.0.1): - - Flutter - - geolocator (6.1.9): - - Flutter - - google_maps_flutter (0.0.1): - - Flutter - - GoogleMaps (< 3.10) - - GoogleDataTransport (7.5.1): - - nanopb (~> 1.30906.0) - - GoogleMaps (3.9.0): - - GoogleMaps/Maps (= 3.9.0) - - GoogleMaps/Base (3.9.0) - - GoogleMaps/Maps (3.9.0): - - GoogleMaps/Base - - GoogleUtilities/AppDelegateSwizzler (6.7.2): - - GoogleUtilities/Environment - - GoogleUtilities/Logger - - GoogleUtilities/Network - - GoogleUtilities/Environment (6.7.2): - - PromisesObjC (~> 1.2) - - GoogleUtilities/Logger (6.7.2): - - GoogleUtilities/Environment - - GoogleUtilities/Network (6.7.2): - - GoogleUtilities/Logger - - "GoogleUtilities/NSData+zlib" - - GoogleUtilities/Reachability - - "GoogleUtilities/NSData+zlib (6.7.2)" - - GoogleUtilities/Reachability (6.7.2): - - GoogleUtilities/Logger - - GoogleUtilities/UserDefaults (6.7.2): - - GoogleUtilities/Logger - - hexcolor (0.0.1): - - Flutter - - image_cropper (0.0.3): - - Flutter - - TOCropViewController (~> 2.5.4) - - image_picker (0.0.1): - - Flutter - - just_audio (0.0.1): - - Flutter - - local_auth (0.0.1): - - Flutter - - location (0.0.1): - - Flutter - - manage_calendar_events (0.0.1): - - Flutter - - map_launcher (0.0.1): - - Flutter - - maps_launcher (0.0.1): - - Flutter - - MTBBarcodeScanner (5.0.11) - - nanopb (1.30906.0): - - nanopb/decode (= 1.30906.0) - - nanopb/encode (= 1.30906.0) - - nanopb/decode (1.30906.0) - - nanopb/encode (1.30906.0) - - native_device_orientation (0.0.1): - - Flutter - - native_progress_hud (0.0.1): - - Flutter - NVActivityIndicatorView (5.1.1): - NVActivityIndicatorView/Base (= 5.1.1) - NVActivityIndicatorView/Base (5.1.1) - - path_provider (0.0.1): - - Flutter - - path_provider_linux (0.0.1): - - Flutter - - path_provider_macos (0.0.1): - - Flutter - - path_provider_windows (0.0.1): - - Flutter - - "permission_handler (5.0.1+1)": - - Flutter - - PromisesObjC (1.2.11) - - Protobuf (3.13.0) - - Reachability (3.2) - - screen (0.0.1): - - Flutter - - shared_preferences (0.0.1): - - Flutter - - shared_preferences_linux (0.0.1): - - Flutter - - shared_preferences_macos (0.0.1): - - Flutter - - shared_preferences_web (0.0.1): - - Flutter - - shared_preferences_windows (0.0.1): - - Flutter - - speech_to_text (0.0.1): - - Flutter - - Try - - TOCropViewController (2.5.5) - - Try (2.1.1) - - "twilio_programmable_video (0.5.0+4)": - - Flutter - - TwilioVideo (~> 3.4) - - TwilioVideo (3.8.0) - - url_launcher (0.0.1): - - Flutter - - url_launcher_linux (0.0.1): - - Flutter - - url_launcher_macos (0.0.1): - - Flutter - - url_launcher_web (0.0.1): - - Flutter - - url_launcher_windows (0.0.1): - - Flutter - - vibration (1.7.3): - - Flutter - - vibration_web (1.6.2): - - Flutter - - video_player (0.0.1): - - Flutter - - video_player_web (0.0.1): - - Flutter - - wakelock (0.0.1): - - Flutter - - webview_flutter (0.0.1): - - Flutter - - wifi (0.0.1): - - Flutter DEPENDENCIES: - - android_intent (from `.symlinks/plugins/android_intent/ios`) - - barcode_scan_fix (from `.symlinks/plugins/barcode_scan_fix/ios`) - - connectivity (from `.symlinks/plugins/connectivity/ios`) - - connectivity_for_web (from `.symlinks/plugins/connectivity_for_web/ios`) - - connectivity_macos (from `.symlinks/plugins/connectivity_macos/ios`) - - device_calendar (from `.symlinks/plugins/device_calendar/ios`) - - device_info (from `.symlinks/plugins/device_info/ios`) - - firebase_core (from `.symlinks/plugins/firebase_core/ios`) - - firebase_core_web (from `.symlinks/plugins/firebase_core_web/ios`) - - firebase_messaging (from `.symlinks/plugins/firebase_messaging/ios`) - Flutter (from `Flutter`) - - flutter_email_sender (from `.symlinks/plugins/flutter_email_sender/ios`) - - flutter_flexible_toast (from `.symlinks/plugins/flutter_flexible_toast/ios`) - - flutter_inappwebview (from `.symlinks/plugins/flutter_inappwebview/ios`) - - flutter_local_notifications (from `.symlinks/plugins/flutter_local_notifications/ios`) - - flutter_plugin_android_lifecycle (from `.symlinks/plugins/flutter_plugin_android_lifecycle/ios`) - - flutter_tts (from `.symlinks/plugins/flutter_tts/ios`) - - geolocator (from `.symlinks/plugins/geolocator/ios`) - - google_maps_flutter (from `.symlinks/plugins/google_maps_flutter/ios`) - - hexcolor (from `.symlinks/plugins/hexcolor/ios`) - - image_cropper (from `.symlinks/plugins/image_cropper/ios`) - - image_picker (from `.symlinks/plugins/image_picker/ios`) - - just_audio (from `.symlinks/plugins/just_audio/ios`) - - local_auth (from `.symlinks/plugins/local_auth/ios`) - - location (from `.symlinks/plugins/location/ios`) - - manage_calendar_events (from `.symlinks/plugins/manage_calendar_events/ios`) - - map_launcher (from `.symlinks/plugins/map_launcher/ios`) - - maps_launcher (from `.symlinks/plugins/maps_launcher/ios`) - - native_device_orientation (from `.symlinks/plugins/native_device_orientation/ios`) - - native_progress_hud (from `.symlinks/plugins/native_progress_hud/ios`) - NVActivityIndicatorView - - path_provider (from `.symlinks/plugins/path_provider/ios`) - - path_provider_linux (from `.symlinks/plugins/path_provider_linux/ios`) - - path_provider_macos (from `.symlinks/plugins/path_provider_macos/ios`) - - path_provider_windows (from `.symlinks/plugins/path_provider_windows/ios`) - - permission_handler (from `.symlinks/plugins/permission_handler/ios`) - - screen (from `.symlinks/plugins/screen/ios`) - - shared_preferences (from `.symlinks/plugins/shared_preferences/ios`) - - shared_preferences_linux (from `.symlinks/plugins/shared_preferences_linux/ios`) - - shared_preferences_macos (from `.symlinks/plugins/shared_preferences_macos/ios`) - - shared_preferences_web (from `.symlinks/plugins/shared_preferences_web/ios`) - - shared_preferences_windows (from `.symlinks/plugins/shared_preferences_windows/ios`) - - speech_to_text (from `.symlinks/plugins/speech_to_text/ios`) - - twilio_programmable_video (from `.symlinks/plugins/twilio_programmable_video/ios`) - - url_launcher (from `.symlinks/plugins/url_launcher/ios`) - - url_launcher_linux (from `.symlinks/plugins/url_launcher_linux/ios`) - - url_launcher_macos (from `.symlinks/plugins/url_launcher_macos/ios`) - - url_launcher_web (from `.symlinks/plugins/url_launcher_web/ios`) - - url_launcher_windows (from `.symlinks/plugins/url_launcher_windows/ios`) - - vibration (from `.symlinks/plugins/vibration/ios`) - - vibration_web (from `.symlinks/plugins/vibration_web/ios`) - - video_player (from `.symlinks/plugins/video_player/ios`) - - video_player_web (from `.symlinks/plugins/video_player_web/ios`) - - wakelock (from `.symlinks/plugins/wakelock/ios`) - - webview_flutter (from `.symlinks/plugins/webview_flutter/ios`) - - wifi (from `.symlinks/plugins/wifi/ios`) SPEC REPOS: trunk: - - Firebase - - FirebaseCore - - FirebaseCoreDiagnostics - - FirebaseInstallations - - FirebaseInstanceID - - FirebaseMessaging - - GoogleDataTransport - - GoogleMaps - - GoogleUtilities - - MTBBarcodeScanner - - nanopb - NVActivityIndicatorView - - PromisesObjC - - Protobuf - - Reachability - - TOCropViewController - - Try - - TwilioVideo EXTERNAL SOURCES: - android_intent: - :path: ".symlinks/plugins/android_intent/ios" - barcode_scan_fix: - :path: ".symlinks/plugins/barcode_scan_fix/ios" - connectivity: - :path: ".symlinks/plugins/connectivity/ios" - connectivity_for_web: - :path: ".symlinks/plugins/connectivity_for_web/ios" - connectivity_macos: - :path: ".symlinks/plugins/connectivity_macos/ios" - device_calendar: - :path: ".symlinks/plugins/device_calendar/ios" - device_info: - :path: ".symlinks/plugins/device_info/ios" - firebase_core: - :path: ".symlinks/plugins/firebase_core/ios" - firebase_core_web: - :path: ".symlinks/plugins/firebase_core_web/ios" - firebase_messaging: - :path: ".symlinks/plugins/firebase_messaging/ios" Flutter: :path: Flutter - flutter_email_sender: - :path: ".symlinks/plugins/flutter_email_sender/ios" - flutter_flexible_toast: - :path: ".symlinks/plugins/flutter_flexible_toast/ios" - flutter_inappwebview: - :path: ".symlinks/plugins/flutter_inappwebview/ios" - flutter_local_notifications: - :path: ".symlinks/plugins/flutter_local_notifications/ios" - flutter_plugin_android_lifecycle: - :path: ".symlinks/plugins/flutter_plugin_android_lifecycle/ios" - flutter_tts: - :path: ".symlinks/plugins/flutter_tts/ios" - geolocator: - :path: ".symlinks/plugins/geolocator/ios" - google_maps_flutter: - :path: ".symlinks/plugins/google_maps_flutter/ios" - hexcolor: - :path: ".symlinks/plugins/hexcolor/ios" - image_cropper: - :path: ".symlinks/plugins/image_cropper/ios" - image_picker: - :path: ".symlinks/plugins/image_picker/ios" - just_audio: - :path: ".symlinks/plugins/just_audio/ios" - local_auth: - :path: ".symlinks/plugins/local_auth/ios" - location: - :path: ".symlinks/plugins/location/ios" - manage_calendar_events: - :path: ".symlinks/plugins/manage_calendar_events/ios" - map_launcher: - :path: ".symlinks/plugins/map_launcher/ios" - maps_launcher: - :path: ".symlinks/plugins/maps_launcher/ios" - native_device_orientation: - :path: ".symlinks/plugins/native_device_orientation/ios" - native_progress_hud: - :path: ".symlinks/plugins/native_progress_hud/ios" - path_provider: - :path: ".symlinks/plugins/path_provider/ios" - path_provider_linux: - :path: ".symlinks/plugins/path_provider_linux/ios" - path_provider_macos: - :path: ".symlinks/plugins/path_provider_macos/ios" - path_provider_windows: - :path: ".symlinks/plugins/path_provider_windows/ios" - permission_handler: - :path: ".symlinks/plugins/permission_handler/ios" - screen: - :path: ".symlinks/plugins/screen/ios" - shared_preferences: - :path: ".symlinks/plugins/shared_preferences/ios" - shared_preferences_linux: - :path: ".symlinks/plugins/shared_preferences_linux/ios" - shared_preferences_macos: - :path: ".symlinks/plugins/shared_preferences_macos/ios" - shared_preferences_web: - :path: ".symlinks/plugins/shared_preferences_web/ios" - shared_preferences_windows: - :path: ".symlinks/plugins/shared_preferences_windows/ios" - speech_to_text: - :path: ".symlinks/plugins/speech_to_text/ios" - twilio_programmable_video: - :path: ".symlinks/plugins/twilio_programmable_video/ios" - url_launcher: - :path: ".symlinks/plugins/url_launcher/ios" - url_launcher_linux: - :path: ".symlinks/plugins/url_launcher_linux/ios" - url_launcher_macos: - :path: ".symlinks/plugins/url_launcher_macos/ios" - url_launcher_web: - :path: ".symlinks/plugins/url_launcher_web/ios" - url_launcher_windows: - :path: ".symlinks/plugins/url_launcher_windows/ios" - vibration: - :path: ".symlinks/plugins/vibration/ios" - vibration_web: - :path: ".symlinks/plugins/vibration_web/ios" - video_player: - :path: ".symlinks/plugins/video_player/ios" - video_player_web: - :path: ".symlinks/plugins/video_player_web/ios" - wakelock: - :path: ".symlinks/plugins/wakelock/ios" - webview_flutter: - :path: ".symlinks/plugins/webview_flutter/ios" - wifi: - :path: ".symlinks/plugins/wifi/ios" SPEC CHECKSUMS: - android_intent: 367df2f1277a74e4a90e14a8ab3df3112d087052 - barcode_scan_fix: 80dd65de55f27eec6591dd077c8b85f2b79e31f1 - connectivity: c4130b2985d4ef6fd26f9702e886bd5260681467 - connectivity_for_web: 2b8584556930d4bd490d82b836bcf45067ce345b - connectivity_macos: e2e9731b6b22dda39eb1b128f6969d574460e191 - device_calendar: 23b28a5f1ab3bf77e34542fb1167e1b8b29a98f5 - device_info: d7d233b645a32c40dfdc212de5cf646ca482f175 - Firebase: 8db6f2d1b2c5e2984efba4949a145875a8f65fe5 - firebase_core: 5d6a02f3d85acd5f8321c2d6d62877626a670659 - firebase_core_web: d501d8b946b60c8af265428ce483b0fff5ad52d1 - firebase_messaging: 0aea2cd5885b65e19ede58ee3507f485c992cc75 - FirebaseCore: d889d9e12535b7f36ac8bfbf1713a0836a3012cd - FirebaseCoreDiagnostics: 770ac5958e1372ce67959ae4b4f31d8e127c3ac1 - FirebaseInstallations: 466c7b4d1f58fe16707693091da253726a731ed2 - FirebaseInstanceID: bd3ffc24367f901a43c063b36c640b345a4a5dd1 - FirebaseMessaging: 5eca4ef173de76253352511aafef774caa1cba2a Flutter: 0e3d915762c693b495b44d77113d4970485de6ec - flutter_email_sender: f787522d0e82f50e5766c1213dbffff22fdcf009 - flutter_flexible_toast: 0547e740cae0c33bb7c51bcd931233f4584e1143 - flutter_inappwebview: 69dfbac46157b336ffbec19ca6dfd4638c7bf189 - flutter_local_notifications: 9e4738ce2471c5af910d961a6b7eadcf57c50186 - flutter_plugin_android_lifecycle: dc0b544e129eebb77a6bfb1239d4d1c673a60a35 - flutter_tts: 0f492aab6accf87059b72354fcb4ba934304771d - geolocator: 057a0c63a43e9c5296d8ad845a3ac8e6df23d899 - google_maps_flutter: c7f9c73576de1fbe152a227bfd6e6c4ae8088619 - GoogleDataTransport: f56af7caa4ed338dc8e138a5d7c5973e66440833 - GoogleMaps: 4b5346bddfe6911bb89155d43c903020170523ac - GoogleUtilities: 7f2f5a07f888cdb145101d6042bc4422f57e70b3 - hexcolor: fdfb9c4258ad96e949c2dbcdf790a62194b8aa89 - image_cropper: c8f9b4157933c7bb965a66d1c5e6c8fd408c6eb4 - image_picker: 9c3312491f862b28d21ecd8fdf0ee14e601b3f09 - just_audio: baa7252489dbcf47a4c7cc9ca663e9661c99aafa - local_auth: 25938960984c3a7f6e3253e3f8d962fdd16852bd - location: 3a2eed4dd2fab25e7b7baf2a9efefe82b512d740 - manage_calendar_events: 0338d505ea26cdfd20cd883279bc28afa11eca34 - map_launcher: e325db1261d029ff33e08e03baccffe09593ffea - maps_launcher: eae38ee13a9c3f210fa04e04bb4c073fa4c6ed92 - MTBBarcodeScanner: f453b33c4b7dfe545d8c6484ed744d55671788cb - nanopb: 59317e09cf1f1a0af72f12af412d54edf52603fc - native_device_orientation: e24d00be281de72996640885d80e706142707660 - native_progress_hud: f95f5529742b36a3c7fdecfa88dc018319e39bf9 NVActivityIndicatorView: 1f6c5687f1171810aa27a3296814dc2d7dec3667 - path_provider: abfe2b5c733d04e238b0d8691db0cfd63a27a93c - path_provider_linux: 4d630dc393e1f20364f3e3b4a2ff41d9674a84e4 - path_provider_macos: f760a3c5b04357c380e2fddb6f9db6f3015897e0 - path_provider_windows: a2b81600c677ac1959367280991971cb9a1edb3b - permission_handler: eac8e15b4a1a3fba55b761d19f3f4e6b005d15b6 - PromisesObjC: 8c196f5a328c2cba3e74624585467a557dcb482f - Protobuf: 3dac39b34a08151c6d949560efe3f86134a3f748 - Reachability: 33e18b67625424e47b6cde6d202dce689ad7af96 - screen: abd91ca7bf3426e1cc3646d27e9b2358d6bf07b0 - shared_preferences: af6bfa751691cdc24be3045c43ec037377ada40d - shared_preferences_linux: afefbfe8d921e207f01ede8b60373d9e3b566b78 - shared_preferences_macos: f3f29b71ccbb56bf40c9dd6396c9acf15e214087 - shared_preferences_web: 141cce0c3ed1a1c5bf2a0e44f52d31eeb66e5ea9 - shared_preferences_windows: 36b76d6f54e76ead957e60b49e2f124b4cd3e6ae - speech_to_text: b43a7d99aef037bd758ed8e45d79bbac035d2dfe - TOCropViewController: da59f531f8ac8a94ef6d6c0fc34009350f9e8bfe - Try: 5ef669ae832617b3cee58cb2c6f99fb767a4ff96 - twilio_programmable_video: 6a41593640f3d86af60b22541fd457b22deaae7f - TwilioVideo: c13a51ceca375e91620eb7578d2573c90cf53b46 - url_launcher: 6fef411d543ceb26efce54b05a0a40bfd74cbbef - url_launcher_linux: ac237cb7a8058736e4aae38bdbcc748a4b394cc0 - url_launcher_macos: fd7894421cd39320dce5f292fc99ea9270b2a313 - url_launcher_web: e5527357f037c87560776e36436bf2b0288b965c - url_launcher_windows: 683d7c283894db8d1914d3ab2223b20cc1ad95d5 - vibration: b5a33e764c3f609a975b9dca73dce20fdde627dc - vibration_web: 0ba303d92469ba34d71c612a228b315908d7fcd9 - video_player: 9cc823b1d9da7e8427ee591e8438bfbcde500e6e - video_player_web: da8cadb8274ed4f8dbee8d7171b420dedd437ce7 - wakelock: 0d4a70faf8950410735e3f61fb15d517c8a6efc4 - webview_flutter: d2b4d6c66968ad042ad94cbb791f5b72b4678a96 - wifi: d7d77c94109e36c4175d845f0a5964eadba71060 -PODFILE CHECKSUM: 5a17be3f8af73a757fa4439c77cf6ab2db29a6e7 +PODFILE CHECKSUM: d94bd40f28772938199c67fcced06ffe96096c14 -COCOAPODS: 1.10.0 +COCOAPODS: 1.10.1 diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index ade2e0aa..366647c0 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -219,8 +219,7 @@ 97C146EC1CF9000F007C117D /* Resources */, 9705A1C41CF9048500538489 /* Embed Frameworks */, 3B06AD1E1E4923F5004D2608 /* Thin Binary */, - 125A739F71A29FBAE7B4D5AC /* [CP] Embed Pods Frameworks */, - CBB18A5CEEEB971DCFC36E00 /* [CP] Copy Pods Resources */, + EFDAD5E1235DCA1DB6187148 /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -284,23 +283,6 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ - 125A739F71A29FBAE7B4D5AC /* [CP] Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist", - ); - name = "[CP] Embed Pods Frameworks"; - outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; 299B8FE131E5BAE7FA7E2FC9 /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -351,21 +333,21 @@ shellPath = /bin/sh; shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; }; - CBB18A5CEEEB971DCFC36E00 /* [CP] Copy Pods Resources */ = { + EFDAD5E1235DCA1DB6187148 /* [CP] Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-input-files.xcfilelist", + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist", ); - name = "[CP] Copy Pods Resources"; + name = "[CP] Embed Pods Frameworks"; outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-output-files.xcfilelist", + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n"; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; /* End PBXShellScriptBuildPhase section */ @@ -496,7 +478,7 @@ "$(inherited)", "$(PROJECT_DIR)/Flutter", ); - PRODUCT_BUNDLE_IDENTIFIER = "com.HMG.HMG-Smartphone"; + PRODUCT_BUNDLE_IDENTIFIER = com.hmg.smartphone; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_VERSION = 5.0; @@ -635,7 +617,7 @@ "$(inherited)", "$(PROJECT_DIR)/Flutter", ); - PRODUCT_BUNDLE_IDENTIFIER = "com.HMG.HMG-Smartphone"; + PRODUCT_BUNDLE_IDENTIFIER = com.hmg.smartphone; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; @@ -668,7 +650,7 @@ "$(inherited)", "$(PROJECT_DIR)/Flutter", ); - PRODUCT_BUNDLE_IDENTIFIER = "com.HMG.HMG-Smartphone"; + PRODUCT_BUNDLE_IDENTIFIER = com.hmg.smartphone; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_VERSION = 5.0; diff --git a/lib/config/config.dart b/lib/config/config.dart index 856ae36a..393b8f9e 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -321,16 +321,17 @@ const GET_E_REFERRALS = "Services/Patients.svc/REST/GetEReferrals"; // const GET_WISHLIST = "http://swd-pharapp-01:7200/api/shopping_cart_items/"; // pharmacy -const PHARMACY_VERIFY_CUSTOMER = "epharmacy/api/VerifyCustomer"; -const PHARMACY_GET_COUNTRY = "epharmacy/api/countries"; +const PHARMACY_AUTORZIE_CUSTOMER = "epharmacy/api/AutorizeCustomer"; +const PHARMACY_VERIFY_CUSTOMER = "VerifyCustomer"; +const PHARMACY_GET_COUNTRY = "countries"; const PHARMACY_CREATE_CUSTOMER = "epharmacy/api/CreateCustomer"; -const GET_PHARMACY_BANNER = "epharmacy/api/promotionbanners"; -const GET_PHARMACY_TOP_MANUFACTURER = "epharmacy/api/topmanufacturer"; -const GET_PHARMACY_BEST_SELLER_PRODUCT = "epharmacy/api/bestsellerproducts"; -const GET_PHARMACY_PRODUCTs_BY_IDS = "epharmacy/api/productsbyids/"; -const GET_PHARMACY_PRODUCTs_BY_SKU = "epharmacy/api/productbysku/"; -const GET_CUSTOMERS_ADDRESSES = "epharmacy/api/Customers/"; -const SUBSCRIBE_PRODUCT = "epharmacy/api/subscribe?"; +const GET_PHARMACY_BANNER = "promotionbanners"; +const GET_PHARMACY_TOP_MANUFACTURER = "topmanufacturer"; +const GET_PHARMACY_BEST_SELLER_PRODUCT = "bestsellerproducts"; +const GET_PHARMACY_PRODUCTs_BY_IDS = "productsbyids/"; +const GET_PHARMACY_PRODUCTs_BY_SKU = "productbysku/"; +const GET_CUSTOMERS_ADDRESSES = "Customers/"; +const SUBSCRIBE_PRODUCT = "subscribe?"; const GET_ORDER = "orders?"; const GET_ORDER_DETAILS = "orders/"; const ADD_CUSTOMER_ADDRESS = "epharmacy/api/addcustomeraddress"; @@ -339,10 +340,10 @@ const DELETE_CUSTOMER_ADDRESS = "epharmacy/api/deletecustomeraddress"; const GET_ADDRESS = "Customers/"; const GET_Cancel_ORDER = "cancelorder/"; const WRITE_REVIEW = "Content-Type" + "text/plain; charset=utf-8"; -const GET_SHOPPING_CART = "epharmacy/api/shopping_cart_items/"; -const GET_SHIPPING_OPTIONS = "epharmacy/api/get_shipping_option/"; +const GET_SHOPPING_CART = "shopping_cart_items/"; +const GET_SHIPPING_OPTIONS = "get_shipping_option/"; const DELETE_SHOPPING_CART = "epharmacy/api/delete_shopping_cart_items/"; -const DELETE_SHOPPING_CART_ALL = "epharmacy/api/delete_shopping_cart_item_by_customer/"; +const DELETE_SHOPPING_CART_ALL = "delete_shopping_cart_item_by_customer/"; const ORDER_SHOPPING_CART = "epharmacy/api/orders"; const GET_LACUM_ACCOUNT_INFORMATION = "Services/Patients.svc/REST/GetLakumAccountInformation"; const GET_LACUM_GROUP_INFORMATION = "Services/Patients.svc/REST/GetlakumInQueryInfoGrouping"; @@ -386,26 +387,26 @@ const GET_CUSTOMER_INFO = "https://mdlaboratories.com/exacartapi/api/VerifyCusto //Pharmacy -const GET_PHARMACY_CATEGORISE = 'epharmacy/api/categories?fields=id,name,namen,description,image,localized_names,display_order,parent_category_id,is_leaf&parent_id=0'; -const GET_OFFERS_CATEGORISE = 'epharmacy/api/discountcategories'; -const GET_OFFERS_PRODUCTS = 'epharmacy/api/offerproducts/'; -const GET_CATEGORISE_PARENT = 'epharmacy/api/categories?fields=id,name,namen,description,image,localized_names,display_order,parent_category_id,is_leaf&parent_id='; -const GET_PARENT_PRODUCTS = 'epharmacy/api/products?categoryid='; -const GET_SUB_CATEGORISE = 'epharmacy/api/categories?fields=id,name,namen,description,image,localized_names,display_order,parent_category_id,is_leaf&parent_id='; -const GET_SUB_PRODUCTS = 'epharmacy/api/products?categoryid='; +const GET_PHARMACY_CATEGORISE = 'categories?fields=id,name,namen,description,image,localized_names,display_order,parent_category_id,is_leaf&parent_id=0'; +const GET_OFFERS_CATEGORISE = 'discountcategories'; +const GET_OFFERS_PRODUCTS = 'offerproducts/'; +const GET_CATEGORISE_PARENT = 'categories?fields=id,name,namen,description,image,localized_names,display_order,parent_category_id,is_leaf&parent_id='; +const GET_PARENT_PRODUCTS = 'products?categoryid='; +const GET_SUB_CATEGORISE = 'categories?fields=id,name,namen,description,image,localized_names,display_order,parent_category_id,is_leaf&parent_id='; +const GET_SUB_PRODUCTS = 'products?categoryid='; const GET_FINAL_PRODUCTS = - 'epharmacy/api/products?fields=id,reviews,discount_ids,name,namen,localized_names,display_order,short_description,full_description,full_descriptionn,sku,order_minimum_quantity,order_maximum_quantity,price,old_price,images,is_rx,rx_message,rx_messagen,discount_name,discount_namen,approved_rating_sum,approved_total_reviews,allow_back_in_stock_subscriptions,stock_quantity,stock_availability,stock_availabilityn,discount_percentage&CategoryId='; + 'products?fields=id,reviews,discount_ids,name,namen,localized_names,display_order,short_description,full_description,full_descriptionn,sku,order_minimum_quantity,order_maximum_quantity,price,old_price,images,is_rx,rx_message,rx_messagen,discount_name,discount_namen,approved_rating_sum,approved_total_reviews,allow_back_in_stock_subscriptions,stock_quantity,stock_availability,stock_availabilityn,discount_percentage&CategoryId='; const TIMER_MIN = 10; const GOOGLE_API_KEY = "AIzaSyCmevVlr2Bh-c8W1VUzo8gt8JRY7n5PANw"; -const GET_BRANDS_LIST = 'epharmacy/api/categoryManufacturer?categoryids='; +const GET_BRANDS_LIST = 'categoryManufacturer?categoryids='; const GET_SEARCH_PRODUCTS = - 'epharmacy/api/searchproducts?fields=id,discount_ids,reviews,name,namen,localized_names,display_order,short_description,full_description,full_descriptionn,sku,order_minimum_quantity,order_maximum_quantity,price,old_price,images,is_rx,rx_message,rx_messagen,discount_name,discount_namen,approved_rating_sum,approved_total_reviews,allow_back_in_stock_subscriptions,stock_quantity,stock_availability,stock_availabilityn,discount_percentage&search_key='; + 'searchproducts?fields=id,discount_ids,reviews,name,namen,localized_names,display_order,short_description,full_description,full_descriptionn,sku,order_minimum_quantity,order_maximum_quantity,price,old_price,images,is_rx,rx_message,rx_messagen,discount_name,discount_namen,approved_rating_sum,approved_total_reviews,allow_back_in_stock_subscriptions,stock_quantity,stock_availability,stock_availabilityn,discount_percentage&search_key='; -const SCAN_QR_CODE = 'epharmacy/api/productbysku/'; +const SCAN_QR_CODE = 'productbysku/'; class AppGlobal { static var context; diff --git a/lib/config/shared_pref_kay.dart b/lib/config/shared_pref_kay.dart index 458040bb..0e56e30b 100644 --- a/lib/config/shared_pref_kay.dart +++ b/lib/config/shared_pref_kay.dart @@ -26,3 +26,4 @@ const WEATHER = 'weather'; const BLOOD_TYPE = 'blood-type'; const NOTIFICATION_COUNT = 'notification-count'; const PHARMACY_SELECTED_ADDRESS = 'selected-address'; +const PHARMACY_AUTORZIE_TOKEN = 'PHARMACY_AUTORZIE_TOKEN'; diff --git a/lib/core/service/AlHabibMedicalService/customer_addresses_service.dart b/lib/core/service/AlHabibMedicalService/customer_addresses_service.dart index da12b48b..803a80f0 100644 --- a/lib/core/service/AlHabibMedicalService/customer_addresses_service.dart +++ b/lib/core/service/AlHabibMedicalService/customer_addresses_service.dart @@ -43,7 +43,7 @@ class CustomerAddressesService extends BaseService { 'fields':'addresses' }; hasError = false; - await baseAppClient.get("$GET_CUSTOMER_ADDRESSES${customerInfo.customerId}", + await baseAppClient.getPharmacy("$GET_CUSTOMER_ADDRESSES${customerInfo.customerId}", onSuccess: (dynamic response, int statusCode) { addressesList.clear(); response["customers"][0]["addresses"].forEach((data) { @@ -63,7 +63,7 @@ class CustomerAddressesService extends BaseService { }; hasError = false; - await baseAppClient.get(GET_CUSTOMER_INFO, + await baseAppClient.getPharmacy(GET_CUSTOMER_INFO, onSuccess: (dynamic response, int statusCode) { customerInfo= CustomerInfo.fromJson(response); }, onFailure: (String error, int statusCode) { diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index cbe2410d..a11f9169 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -195,7 +195,7 @@ class BaseAppClient { get(String endPoint, {Function(dynamic response, int statusCode) onSuccess, Function(String error, int statusCode) onFailure, - Map queryParams, + Map queryParams, bool isExternal = false}) async { String url; if (isExternal) { @@ -236,19 +236,41 @@ class BaseAppClient { {Function(dynamic response, int statusCode) onSuccess, Function(String error, int statusCode) onFailure, bool isAllowAny = false, - Map queryParams}) async { - String url = PHARMACY_BASE_URL + endPoint; + bool isExternal = false, + Map queryParams}) async { + + String url; + if (isExternal) { + url = endPoint; + } else { + url = PHARMACY_BASE_URL + endPoint; + } if (queryParams != null) { String queryString = Uri(queryParameters: queryParams).query; url += '?' + queryString; } print("URL : $url"); + var token = await sharedPref.getString(PHARMACY_AUTORZIE_TOKEN); + var user = await sharedPref.getObject(USER_PROFILE); + + Map test = { + 'Content-Type': 'application/json', + 'Accept': 'application/json', + 'Authorization': token, + 'Mobilenumber': user['MobileNumber'].toString(), + 'Statictoken': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9', + 'Username': user['PatientID'].toString(), + }; if (await Utils.checkConnection()) { final response = await http.get(url.trim(), headers: { 'Content-Type': 'application/json', - 'Accept': 'application/json' + 'Accept': 'application/json', + 'Authorization': token, + 'Mobilenumber': user['MobileNumber'].toString(), + 'Statictoken': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9', + 'Username': user['PatientID'].toString(), }); final int statusCode = response.statusCode; print("statusCode :$statusCode"); diff --git a/lib/core/service/offers_service.dart b/lib/core/service/offers_service.dart index 2247c833..8007007b 100644 --- a/lib/core/service/offers_service.dart +++ b/lib/core/service/offers_service.dart @@ -21,7 +21,7 @@ class OffersCategoriseService extends BaseService { Future getOffersCategorise() async { hasError = false; _offersList.clear(); - await baseAppClient.get( + await baseAppClient.getPharmacy( GET_OFFERS_CATEGORISE, onSuccess: (dynamic response, int statusCode) { response['categories'].forEach((item) { @@ -40,7 +40,7 @@ class OffersCategoriseService extends BaseService { _offerProducts.clear(); String endPoint = id != null ? GET_OFFERS_PRODUCTS + "$id" : GET_OFFERS_PRODUCTS + "1"; - await baseAppClient.get( + await baseAppClient.getPharmacy( endPoint, onSuccess: (dynamic response, int statusCode) { response['products'].forEach((item) { diff --git a/lib/core/service/parmacyModule/order-preview-service.dart b/lib/core/service/parmacyModule/order-preview-service.dart index 5648ff6d..18cfa87e 100644 --- a/lib/core/service/parmacyModule/order-preview-service.dart +++ b/lib/core/service/parmacyModule/order-preview-service.dart @@ -21,7 +21,7 @@ class OrderPreviewService extends BaseService { Map queryParams = {'fields': 'addresses'}; hasError = false; try { - await baseAppClient.get("$GET_CUSTOMERS_ADDRESSES$customerId", + await baseAppClient.getPharmacy("$GET_CUSTOMERS_ADDRESSES$customerId", onSuccess: (dynamic response, int statusCode) { addresses.clear(); response['customers'][0]['addresses'].forEach((item) { @@ -42,7 +42,7 @@ class OrderPreviewService extends BaseService { dynamic localRes; hasError = false; try { - await baseAppClient.get("$GET_SHIPPING_OPTIONS$customerId/${selectedAddress.id}", + await baseAppClient.getPharmacy("$GET_SHIPPING_OPTIONS$customerId/${selectedAddress.id}", onSuccess: (dynamic response, int statusCode) { localRes = response['shipping_option'][0]; }, onFailure: (String error, int statusCode) { @@ -61,7 +61,7 @@ class OrderPreviewService extends BaseService { dynamic localRes; hasError = false; try { - await baseAppClient.get("$GET_SHOPPING_CART$customerId", + await baseAppClient.getPharmacy("$GET_SHOPPING_CART$customerId", onSuccess: (dynamic response, int statusCode) { localRes = response; }, onFailure: (String error, int statusCode) { @@ -125,7 +125,7 @@ class OrderPreviewService extends BaseService { super.error = ""; dynamic localRes; - await baseAppClient.get("$DELETE_SHOPPING_CART_ALL$customerId/ShoppingCart", + await baseAppClient.getPharmacy("$DELETE_SHOPPING_CART_ALL$customerId/ShoppingCart", onSuccess: (response, statusCode) async { localRes = response; }, onFailure: (String error, int statusCode) { diff --git a/lib/core/service/parmacyModule/parmacy_module_service.dart b/lib/core/service/parmacyModule/parmacy_module_service.dart index 264af2c2..c400d788 100644 --- a/lib/core/service/parmacyModule/parmacy_module_service.dart +++ b/lib/core/service/parmacyModule/parmacy_module_service.dart @@ -22,7 +22,7 @@ class PharmacyModuleService extends BaseService { Map queryParams = {'FileNumber': data['PatientID'].toString()}; hasError = false; try { - await baseAppClient.get(PHARMACY_VERIFY_CUSTOMER, onSuccess: (dynamic response, int statusCode) { + await baseAppClient.getPharmacy(PHARMACY_VERIFY_CUSTOMER, onSuccess: (dynamic response, int statusCode) { if (response['UserName'] != null) { sharedPref.setString(PHARMACY_CUSTOMER_ID, response['CustomerId'].toString()); print(response); @@ -54,8 +54,29 @@ class PharmacyModuleService extends BaseService { }; hasError = false; try { - await baseAppClient.get(PHARMACY_CREATE_CUSTOMER, onSuccess: (dynamic response, int statusCode) { + await baseAppClient.get(PHARMACY_CREATE_CUSTOMER, onSuccess: (dynamic response, int statusCode) async{ if (!response['IsRegistered']) {} + await generatePharmacyToken(); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, queryParams: queryParams); + } catch (error) { + throw error; + } + } + + Future generatePharmacyToken() async { + Map queryParams = { + 'Filenumber':user.patientID.toString(), + 'MobileNumber':user.mobileNumber, + }; + hasError = false; + try { + await baseAppClient.get(PHARMACY_AUTORZIE_CUSTOMER, onSuccess: (dynamic response, int statusCode) async{ + if (response['Status'] == 200) { + await sharedPref.setString(PHARMACY_AUTORZIE_TOKEN, response['token'].toString()); + } }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; @@ -68,7 +89,7 @@ class PharmacyModuleService extends BaseService { Future getBannerListList() async { hasError = false; try { - await baseAppClient.get(GET_PHARMACY_BANNER, onSuccess: (dynamic response, int statusCode) { + await baseAppClient.getPharmacy(GET_PHARMACY_BANNER, onSuccess: (dynamic response, int statusCode) { bannerItems.clear(); response['images'].forEach((item) { bannerItems.add(PharmacyImageObject.fromJson(item)); @@ -85,7 +106,7 @@ class PharmacyModuleService extends BaseService { Future getTopManufacturerList() async { Map queryParams = {'page': '1', 'limit': '8'}; try { - await baseAppClient.get(GET_PHARMACY_TOP_MANUFACTURER, onSuccess: (dynamic response, int statusCode) { + await baseAppClient.getPharmacy(GET_PHARMACY_TOP_MANUFACTURER, onSuccess: (dynamic response, int statusCode) { manufacturerList.clear(); response['manufacturer'].forEach((item) { Manufacturer manufacturer = Manufacturer.fromJson(item); @@ -108,7 +129,7 @@ class PharmacyModuleService extends BaseService { 'id,discount_ids,name,namen,localized_names,display_order,short_description,full_description,full_descriptionn,sku,order_minimum_quantity,order_maximum_quantity,price,old_price,images,is_rx,rx_message,rx_messagen,discount_name,discount_namen,approved_rating_sum,approved_total_reviews,allow_back_in_stock_subscriptions,stock_quantity,stock_availability,stock_availabilityn,discount_percentage,reviews', }; try { - await baseAppClient.get(GET_PHARMACY_BEST_SELLER_PRODUCT, onSuccess: (dynamic response, int statusCode) { + await baseAppClient.getPharmacy(GET_PHARMACY_BEST_SELLER_PRODUCT, onSuccess: (dynamic response, int statusCode) { bestSellerProducts.clear(); response['products'].forEach((item) { bestSellerProducts.add(PharmacyProduct.fromJson(item)); @@ -127,7 +148,7 @@ class PharmacyModuleService extends BaseService { if (await this.sharedPref.getString(PHARMACY_LAST_VISITED_PRODUCTS) != null) { lastVisited = await this.sharedPref.getString(PHARMACY_LAST_VISITED_PRODUCTS); try { - await baseAppClient.get("$GET_PHARMACY_PRODUCTs_BY_IDS$lastVisited", onSuccess: (dynamic response, int statusCode) { + await baseAppClient.getPharmacy("$GET_PHARMACY_PRODUCTs_BY_IDS$lastVisited", onSuccess: (dynamic response, int statusCode) { lastVisitedProducts.clear(); response['products'].forEach((item) { lastVisitedProducts.add(PharmacyProduct.fromJson(item)); diff --git a/lib/core/service/parmacyModule/prescription_service.dart b/lib/core/service/parmacyModule/prescription_service.dart index 7aafc9d3..33c2cfd7 100644 --- a/lib/core/service/parmacyModule/prescription_service.dart +++ b/lib/core/service/parmacyModule/prescription_service.dart @@ -21,7 +21,7 @@ class PrescriptionService extends BaseService { hasError = false; url = PRESCRIPTION; print("Print PRESCRIPTION url" + url); - await baseAppClient.get(url, + await baseAppClient.post(url, onSuccess: (dynamic response, int statusCode) { _prescriptionsList.clear(); response['PatientPrescriptionList'].forEach((item) { diff --git a/lib/core/service/pharmacy_categorise_service.dart b/lib/core/service/pharmacy_categorise_service.dart index b55a755d..0082cc49 100644 --- a/lib/core/service/pharmacy_categorise_service.dart +++ b/lib/core/service/pharmacy_categorise_service.dart @@ -56,7 +56,7 @@ class PharmacyCategoriseService extends BaseService { Future getCategorise() async { hasError = false; _categoriseList.clear(); - await baseAppClient.get( + await baseAppClient.getPharmacy( GET_PHARMACY_CATEGORISE, onSuccess: (dynamic response, int statusCode) { response['categories'].forEach((item) { @@ -74,7 +74,7 @@ class PharmacyCategoriseService extends BaseService { hasError = false; _scanList.clear(); String endPoint = id != null ? SCAN_QR_CODE + "$id" : SCAN_QR_CODE + ""; - await baseAppClient.get( + await baseAppClient.getPharmacy( endPoint, onSuccess: (dynamic response, int statusCode) { response['products'].forEach((item) { @@ -94,7 +94,7 @@ class PharmacyCategoriseService extends BaseService { String endPoint = productName != null ? GET_SEARCH_PRODUCTS + "$productName" + '&language_id=1' : GET_SEARCH_PRODUCTS + ""; - await baseAppClient.get( + await baseAppClient.getPharmacy( endPoint, onSuccess: (dynamic response, int statusCode) { response['products'].forEach((item) { @@ -111,7 +111,7 @@ class PharmacyCategoriseService extends BaseService { Future getBrands() async { hasError = false; _brandsList.clear(); - await baseAppClient.get( + await baseAppClient.getPharmacy( GET_BRANDS_LIST, onSuccess: (dynamic response, int statusCode) { response['manufacturer'].forEach((item) { @@ -130,7 +130,7 @@ class PharmacyCategoriseService extends BaseService { _parentCategoriseList.clear(); String endPoint = id != null ? GET_CATEGORISE_PARENT + "$id" : GET_CATEGORISE_PARENT + ""; - await baseAppClient.get( + await baseAppClient.getPharmacy( endPoint, onSuccess: (dynamic response, int statusCode) { response['categories'].forEach((item) { @@ -150,7 +150,7 @@ class PharmacyCategoriseService extends BaseService { String endPoint = id != null ? GET_PARENT_PRODUCTS + "$id" + '&page=1&limit=50' : GET_PARENT_PRODUCTS + ""; - await baseAppClient.get( + await baseAppClient.getPharmacy( endPoint, onSuccess: (dynamic response, int statusCode) { response['products'].forEach((item) { @@ -170,7 +170,7 @@ class PharmacyCategoriseService extends BaseService { String endPoint = id != null ? GET_SUB_CATEGORISE + "$id" : GET_SUB_CATEGORISE + ""; - await baseAppClient.get( + await baseAppClient.getPharmacy( endPoint, onSuccess: (dynamic response, int statusCode) { response['categories'].forEach((item) { @@ -190,7 +190,7 @@ class PharmacyCategoriseService extends BaseService { String endPoint = id != null ? GET_SUB_PRODUCTS + "$id" + '&page=1&limit=50' : GET_SUB_PRODUCTS + ""; - await baseAppClient.get( + await baseAppClient.getPharmacy( endPoint, onSuccess: (dynamic response, int statusCode) { response['products'].forEach((item) { @@ -209,7 +209,7 @@ class PharmacyCategoriseService extends BaseService { _finalProducts.clear(); String endPoint = id != null ? GET_FINAL_PRODUCTS + "$id" : GET_FINAL_PRODUCTS + ""; - await baseAppClient.get( + await baseAppClient.getPharmacy( endPoint, onSuccess: (dynamic response, int statusCode) { response['products'].forEach((item) { diff --git a/lib/core/viewModels/pharmacyModule/pharmacy_module_view_model.dart b/lib/core/viewModels/pharmacyModule/pharmacy_module_view_model.dart index bee7f654..303dab9e 100644 --- a/lib/core/viewModels/pharmacyModule/pharmacy_module_view_model.dart +++ b/lib/core/viewModels/pharmacyModule/pharmacy_module_view_model.dart @@ -51,6 +51,27 @@ class PharmacyModuleViewModel extends BaseViewModel { } } + Future createUser() async { + setState(ViewState.Busy); + await _pharmacyService.createUser(); + if (_pharmacyService.hasError) { + error = _pharmacyService.error; + setState(ViewState.ErrorLocal); + } else { + setState(ViewState.Idle); + } + } + Future generatePharmacyToken() async { + setState(ViewState.Busy); + await _pharmacyService.generatePharmacyToken(); + if (_pharmacyService.hasError) { + error = _pharmacyService.error; + setState(ViewState.ErrorLocal); + } else { + setState(ViewState.Idle); + } + } + Future getBannerList() async { setState(ViewState.Busy); await _pharmacyService.getBannerListList(); diff --git a/lib/pages/DrawerPages/family/my-family.dart b/lib/pages/DrawerPages/family/my-family.dart index 2d7e4270..5a2247e5 100644 --- a/lib/pages/DrawerPages/family/my-family.dart +++ b/lib/pages/DrawerPages/family/my-family.dart @@ -5,6 +5,7 @@ import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart'; import 'package:diplomaticquarterapp/core/service/medical/vital_sign_service.dart'; import 'package:diplomaticquarterapp/core/viewModels/appointment_rate_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/pharmacy_module_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/locator.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; @@ -58,6 +59,8 @@ class _MyFamily extends State with TickerProviderStateMixin { ProjectViewModel projectViewModel; AuthenticatedUser user; VitalSignService _vitalSignService = locator(); + PharmacyModuleViewModel pharmacyModuleViewModel = locator(); + var isVaiable = false; @override void initState() { @@ -728,6 +731,12 @@ class _MyFamily extends State with TickerProviderStateMixin { authenticatedUserObject.user; Provider.of(context, listen: false) .setUser(authenticatedUserObject.user); + + await pharmacyModuleViewModel.generatePharmacyToken().then((value) async { + if(pharmacyModuleViewModel.error.isNotEmpty) + await pharmacyModuleViewModel.createUser(); + }); + appointmentRateViewModel .getIsLastAppointmentRatedList() .then((value) => { diff --git a/lib/pages/landing/landing_page_pharmcy.dart b/lib/pages/landing/landing_page_pharmcy.dart index a41c263f..3a46f45c 100644 --- a/lib/pages/landing/landing_page_pharmcy.dart +++ b/lib/pages/landing/landing_page_pharmcy.dart @@ -180,7 +180,7 @@ class _LandingPagePharmacyState extends State { try { String barcode = result; GifLoaderDialogUtils.showMyDialog(context); - await BaseAppClient().get("$GET_PHARMACY_PRODUCTs_BY_SKU$barcode", + await BaseAppClient().getPharmacy("$GET_PHARMACY_PRODUCTs_BY_SKU$barcode", onSuccess: (dynamic response, int statusCode) { print(response); var product = PharmacyProduct.fromJson(response["products"][0]); diff --git a/lib/pages/login/confirm-login.dart b/lib/pages/login/confirm-login.dart index 444ce9cd..58efff71 100644 --- a/lib/pages/login/confirm-login.dart +++ b/lib/pages/login/confirm-login.dart @@ -2,6 +2,7 @@ import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/config/size_config.dart'; import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart'; import 'package:diplomaticquarterapp/core/viewModels/appointment_rate_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/pharmacy_module_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/locator.dart'; import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart'; @@ -45,6 +46,7 @@ class _ConfirmLogin extends State { var sharedPref = new AppSharedPreferences(); bool authenticated; final authService = new AuthProvider(); + PharmacyModuleViewModel pharmacyModuleViewModel = locator(); int mobileNumber; String errorMsg = ''; SelectDeviceIMEIRES user; @@ -592,6 +594,13 @@ class _ConfirmLogin extends State { Provider.of(context, listen: false) .setUser(authenticatedUserObject.user); getToDoCount(); + + await pharmacyModuleViewModel.generatePharmacyToken().then((value) async { + if(pharmacyModuleViewModel.error.isNotEmpty) + await pharmacyModuleViewModel.createUser(); + }); + + appointmentRateViewModel .getIsLastAppointmentRatedList() .then((value) => { diff --git a/lib/pages/login/login.dart b/lib/pages/login/login.dart index 9ac2b845..44be9a6d 100644 --- a/lib/pages/login/login.dart +++ b/lib/pages/login/login.dart @@ -2,6 +2,7 @@ import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/config/size_config.dart'; import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart'; import 'package:diplomaticquarterapp/core/viewModels/appointment_rate_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/pharmacy_module_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/locator.dart'; import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart'; @@ -48,6 +49,7 @@ class _Login extends State { var sharedPref = new AppSharedPreferences(); bool isLoading = false; AppointmentRateViewModel appointmentRateViewModel = locator(); + PharmacyModuleViewModel pharmacyModuleViewModel = locator(); AuthenticatedUserObject authenticatedUserObject = locator(); @@ -256,6 +258,12 @@ class _Login extends State { appointmentRateViewModel.isLogin = true; projectViewModel.isLogin = true; projectViewModel.user = authenticatedUserObject.user; + + await pharmacyModuleViewModel.generatePharmacyToken().then((value) async { + if(pharmacyModuleViewModel.error.isNotEmpty) + await pharmacyModuleViewModel.createUser(); + }); + appointmentRateViewModel .getIsLastAppointmentRatedList() .then((value) => { diff --git a/lib/services/pharmacy_services/pharmacyAddress_service.dart b/lib/services/pharmacy_services/pharmacyAddress_service.dart index 1bb6571c..592359ca 100644 --- a/lib/services/pharmacy_services/pharmacyAddress_service.dart +++ b/lib/services/pharmacy_services/pharmacyAddress_service.dart @@ -16,7 +16,7 @@ class PharmacyAddressService extends BaseService { hasError = false; Addresses selectedAddress; try { - await baseAppClient.get("$GET_CUSTOMERS_ADDRESSES$customerId", + await baseAppClient.getPharmacy("$GET_CUSTOMERS_ADDRESSES$customerId", onSuccess: (dynamic response, int statusCode) async { addresses.clear(); var savedAddress = @@ -45,7 +45,7 @@ class PharmacyAddressService extends BaseService { Future getCountries(String countryName) async { hasError = false; try { - await baseAppClient.get("$PHARMACY_GET_COUNTRY", + await baseAppClient.getPharmacy("$PHARMACY_GET_COUNTRY", onSuccess: (dynamic response, int statusCode) { // countries.clear(); response['countries'].forEach((item) { diff --git a/lib/services/pharmacy_services/product_detail_service.dart b/lib/services/pharmacy_services/product_detail_service.dart index b974e1b1..e3e8403e 100644 --- a/lib/services/pharmacy_services/product_detail_service.dart +++ b/lib/services/pharmacy_services/product_detail_service.dart @@ -104,7 +104,7 @@ class ProductDetailService extends BaseService { Future notifyMe(customerId, itemID) async { hasError = false; - await baseAppClient.get(SUBSCRIBE_PRODUCT + "SinceId=$customerId&ProductId=$itemID", onSuccess: (dynamic response, int statusCode) { + await baseAppClient.getPharmacy(SUBSCRIBE_PRODUCT + "SinceId=$customerId&ProductId=$itemID", onSuccess: (dynamic response, int statusCode) { AppToast.showSuccessToast(message: 'You will be notified when product available'); }, onFailure: (String error, int statusCode) { hasError = true; diff --git a/lib/widgets/drawer/app_drawer_widget.dart b/lib/widgets/drawer/app_drawer_widget.dart index 7d856113..d46d9eba 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/appointment_rate_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/pharmacy_module_view_model.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'; @@ -43,6 +44,7 @@ class _AppDrawerState extends State { ProjectViewModel projectProvider; var sharedPref = new AppSharedPreferences(); var familyFileProvider = FamilyFilesProvider(); + PharmacyModuleViewModel pharmacyModuleViewModel = locator(); AuthenticatedUser user; AuthenticatedUser mainUser; AuthenticatedUserObject authenticatedUserObject = @@ -593,6 +595,11 @@ class _AppDrawerState extends State { authenticatedUserObject.user; Provider.of(context, listen: false) .setUser(authenticatedUserObject.user); + await pharmacyModuleViewModel.generatePharmacyToken().then((value) async { + if(pharmacyModuleViewModel.error.isNotEmpty) + await pharmacyModuleViewModel.createUser(); + }); + appointmentRateViewModel .getIsLastAppointmentRatedList() .then((value) => {