From ff0d66ccdbb9c6df99504dbd05c1b7cb446ca6e2 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Thu, 3 Dec 2020 14:04:11 +0300 Subject: [PATCH 1/5] 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 2/5] 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 3/5] 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 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 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 dde10cd27b6f81fff15376aab8b389379f274e8f Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Sun, 24 Jan 2021 09:29:57 +0300 Subject: [PATCH 4/5] 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 7c538b350f71db321ebb78ed3ea45c66ed99b13a Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Sun, 24 Jan 2021 14:49:55 +0300 Subject: [PATCH 5/5] 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 {