From 7a8392a97ea3182faffff461daf003fda325ad3b Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Mon, 31 Aug 2020 15:43:31 +0300 Subject: [PATCH 01/45] updates --- CustomFlutterFirebaseMessagingService.java | 17 +++++ ...CustomFlutterFirebaseMessagingService.java | 17 +++++ .../conference/conference_button_bar.dart | 10 +-- lib/pages/conference/conference_page.dart | 30 ++++----- lib/pages/landing/landing_page.dart | 63 +++++++++++++++++++ lib/pages/login/login.dart | 40 ++++++------ 6 files changed, 136 insertions(+), 41 deletions(-) create mode 100644 CustomFlutterFirebaseMessagingService.java create mode 100644 android/CustomFlutterFirebaseMessagingService.java diff --git a/CustomFlutterFirebaseMessagingService.java b/CustomFlutterFirebaseMessagingService.java new file mode 100644 index 00000000..0a4d83be --- /dev/null +++ b/CustomFlutterFirebaseMessagingService.java @@ -0,0 +1,17 @@ +package io.flutter.plugins.firebasemessaging; + +import android.content.Intent; + +import com.google.firebase.messaging.RemoteMessage; + +public class CustomFlutterFirebaseMessagingService extends FlutterFirebaseMessagingService { + @Override + public void onMessageReceived(RemoteMessage remoteMessage) { + if (remoteMessage.getData().containsKey("is_call")) { + Intent intent = getPackageManager().getLaunchIntentForPackage(getPackageName()); + startActivity(intent); + super.onMessageReceived(remoteMessage); + } else + super.onMessageReceived(remoteMessage); + } +} \ No newline at end of file diff --git a/android/CustomFlutterFirebaseMessagingService.java b/android/CustomFlutterFirebaseMessagingService.java new file mode 100644 index 00000000..0a4d83be --- /dev/null +++ b/android/CustomFlutterFirebaseMessagingService.java @@ -0,0 +1,17 @@ +package io.flutter.plugins.firebasemessaging; + +import android.content.Intent; + +import com.google.firebase.messaging.RemoteMessage; + +public class CustomFlutterFirebaseMessagingService extends FlutterFirebaseMessagingService { + @Override + public void onMessageReceived(RemoteMessage remoteMessage) { + if (remoteMessage.getData().containsKey("is_call")) { + Intent intent = getPackageManager().getLaunchIntentForPackage(getPackageName()); + startActivity(intent); + super.onMessageReceived(remoteMessage); + } else + super.onMessageReceived(remoteMessage); + } +} \ No newline at end of file diff --git a/lib/pages/conference/conference_button_bar.dart b/lib/pages/conference/conference_button_bar.dart index d9abd212..d49c4e4a 100644 --- a/lib/pages/conference/conference_button_bar.dart +++ b/lib/pages/conference/conference_button_bar.dart @@ -212,6 +212,11 @@ class _ConferenceButtonBarState extends State with AfterLay key: Key('microphone-button'), onPressed: () => _onPressed(widget.onAudioEnabled), ), + CircleButton( + child: const Icon(Icons.switch_camera, color: Colors.white), + key: Key('switch-camera-button'), + onPressed: () => _onPressed(widget.onSwitchCamera), + ), CircleButton( radius: 35, child: const RotationTransition( @@ -226,11 +231,6 @@ class _ConferenceButtonBarState extends State with AfterLay key: Key('hangup-button'), onPressed: () => _onPressed(widget.onHangup), ), - CircleButton( - child: const Icon(Icons.switch_camera, color: Colors.white), - key: Key('switch-camera-button'), - onPressed: () => _onPressed(widget.onSwitchCamera), - ), ], ), ); diff --git a/lib/pages/conference/conference_page.dart b/lib/pages/conference/conference_page.dart index 60ffb0d5..7848d4f7 100644 --- a/lib/pages/conference/conference_page.dart +++ b/lib/pages/conference/conference_page.dart @@ -217,21 +217,21 @@ class _ConferencePageState extends State { ); } - if (length <= 3) { - buildInCols(true, false, 1); - } else if (length == 5) { - buildInCols(false, true, 2); - } else if (length <= 6 || length == 8) { - buildInCols(false, false, 2); - } else if (length == 7 || length == 9) { - buildInCols(true, false, 2); - } else if (length == 10) { - buildInCols(false, true, 3); - } else if (length == 13 || length == 16) { - buildInCols(true, false, 3); - } else if (length <= 18) { - buildInCols(false, false, 3); - } +// if (length <= 3) { +// buildInCols(true, false, 1); +// } else if (length == 5) { +// buildInCols(false, true, 2); +// } else if (length <= 6 || length == 8) { +// buildInCols(false, false, 2); +// } else if (length == 7 || length == 9) { +// buildInCols(true, false, 2); +// } else if (length == 10) { +// buildInCols(false, true, 3); +// } else if (length == 13 || length == 16) { +// buildInCols(true, false, 3); +// } else if (length <= 18) { +// buildInCols(false, false, 3); +// } return Column( children: children, diff --git a/lib/pages/landing/landing_page.dart b/lib/pages/landing/landing_page.dart index 80c65128..7c32b212 100644 --- a/lib/pages/landing/landing_page.dart +++ b/lib/pages/landing/landing_page.dart @@ -13,6 +13,7 @@ import 'package:diplomaticquarterapp/pages/medical/my_admissions_page.dart'; import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/bottom_navigation/bottom_nav_bar.dart'; +import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; import 'package:diplomaticquarterapp/widgets/drawer/app_drawer_widget.dart'; import 'package:firebase_messaging/firebase_messaging.dart'; import 'package:flutter/cupertino.dart'; @@ -101,6 +102,18 @@ class _LandingPageState extends State with WidgetsBindingObserver { }); pageController = PageController(keepPage: true); _firebaseMessaging.setAutoInitEnabled(true); + + if (Platform.isIOS) { + _firebaseMessaging.requestNotificationPermissions( +// const IosNotificationSettings( +// sound: true, +// badge: true, +// alert: true, +// provisional: true, +// ), + ); + } + _firebaseMessaging.getToken().then((String token) { sharedPref.setString(PUSH_TOKEN, token); if (token != null) { @@ -112,6 +125,7 @@ class _LandingPageState extends State with WidgetsBindingObserver { //_firebase Background message handler _firebaseMessaging.configure( onMessage: (Map message) async { + showDialog("onMessage: $message"); print("onMessage: $message"); print(message); print(message['name']); @@ -182,19 +196,68 @@ class _LandingPageState extends State with WidgetsBindingObserver { onBackgroundMessage: Platform.isIOS ? null : myBackgroundMessageHandler, onLaunch: (Map message) async { print("onLaunch: $message"); + showDialog("onLaunch: $message"); }, onResume: (Map message) async { print("onResume: $message"); + print(message); + print(message['name']); + print(message['appointmentdate']); + + showDialog("onResume: $message"); + + if (Platform.isIOS) { + if (message['is_call'] == "true") { + var route = ModalRoute.of(context); + + if (route != null) { + print(route.settings.name); + } + + Map myMap = + new Map.from(message); + print(myMap); + LandingPage.isOpenCallPage = true; + LandingPage.incomingCallData = IncomingCallData.fromJson(myMap); + if (!isPageNavigated) { + isPageNavigated = true; + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => IncomingCall( + incomingCallData: LandingPage.incomingCallData))) + .then((value) { + isPageNavigated = false; + }); + } + } else { + print("Is Call Not Found iOS"); + } + } else { + print("Is Call Not Found iOS"); + } }, ); } + showDialog(String message) { + ConfirmDialog dialog = new ConfirmDialog( + context: context, + confirmMessage: message, + okText: TranslationBase.of(context).confirm, + cancelText: TranslationBase.of(context).cancel_nocaps, + okFunction: () => {}, + cancelFunction: () => {}); + dialog.showAlertDialog(context); + } + void requestPermissions() async { await [ Permission.location, Permission.storage, Permission.camera, Permission.photos, + Permission.notification, Permission.accessMediaLocation ].request(); } diff --git a/lib/pages/login/login.dart b/lib/pages/login/login.dart index 83d10fe6..f72c7c6a 100644 --- a/lib/pages/login/login.dart +++ b/lib/pages/login/login.dart @@ -1,19 +1,14 @@ import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/config/size_config.dart'; -import 'package:diplomaticquarterapp/models/Authentication/check_activation_code_request.dart'; import 'package:diplomaticquarterapp/models/Authentication/check_activation_code_response.dart'; import 'package:diplomaticquarterapp/models/Authentication/check_paitent_authentication_req.dart'; -import 'package:diplomaticquarterapp/core/service/client/base_app_client.dart'; -import 'package:diplomaticquarterapp/models/Authentication/select_device_imei_res.dart'; import 'package:diplomaticquarterapp/pages/login/login-type.dart'; -import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; import 'package:diplomaticquarterapp/routes.dart'; +import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart'; -import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; -import 'package:diplomaticquarterapp/widgets/card/rounded_container.dart'; import 'package:diplomaticquarterapp/widgets/input/text_field.dart'; import 'package:diplomaticquarterapp/widgets/mobile-no/mobile_no.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; @@ -21,7 +16,6 @@ import 'package:diplomaticquarterapp/widgets/progress_indicator/app_circular_pro import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; class Login extends StatefulWidget { @override @@ -41,9 +35,16 @@ class _Login extends State { @override void initState() { +// getDeviceToken(); super.initState(); } + getDeviceToken() async { + setState(() async { + nationalIDorFile.text = await sharedPref.getString(PUSH_TOKEN); + }); + } + @override Widget build(BuildContext context) { return AppScaffold( @@ -184,20 +185,17 @@ class _Login extends State { request['PatientID'] = int.parse(nationalIDorFile.text); } // request.isRegister = false; - this - .authService - .checkActivationCode(request, code) - .then((result) => { - result = CheckActivationCode.fromJson(result), - this.sharedPref.setObject(USER_PROFILE, result.list), - this.sharedPref.setObject(LOGIN_TOKEN_ID, result.logInTokenID), - this.sharedPref.setString(TOKEN, result.authenticationTokenID), - //this.checkIfUserAgreedBefore(result), - Navigator.of(context).pushNamed( - HOME, - ) - // SMSOTP.showLoadingDialog(context, false), - }); + this.authService.checkActivationCode(request, code).then((result) => { + result = CheckActivationCode.fromJson(result), + this.sharedPref.setObject(USER_PROFILE, result.list), + this.sharedPref.setObject(LOGIN_TOKEN_ID, result.logInTokenID), + this.sharedPref.setString(TOKEN, result.authenticationTokenID), + //this.checkIfUserAgreedBefore(result), + Navigator.of(context).pushNamed( + HOME, + ) + // SMSOTP.showLoadingDialog(context, false), + }); } showLoader(bool isTrue) { From 823eda0d5ccaeb5331208f7c9d020ef7e3fc5359 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Mon, 31 Aug 2020 16:49:37 +0300 Subject: [PATCH 02/45] updates --- lib/core/viewModels/project_view_model.dart | 2 +- lib/main.dart | 3 --- .../components/SearchByClinic.dart | 3 ++- lib/pages/login/login.dart | 21 +++++++++++-------- 4 files changed, 15 insertions(+), 14 deletions(-) diff --git a/lib/core/viewModels/project_view_model.dart b/lib/core/viewModels/project_view_model.dart index ed752b50..c231d455 100644 --- a/lib/core/viewModels/project_view_model.dart +++ b/lib/core/viewModels/project_view_model.dart @@ -8,7 +8,7 @@ import 'package:flutter/cupertino.dart'; class ProjectViewModel with ChangeNotifier { AppSharedPreferences sharedPref = AppSharedPreferences(); Locale _appLocale; - String currentLanguage = 'ar'; + String currentLanguage = 'en'; bool _isArabic = false; bool isInternetConnection = true; bool isLoading = false; diff --git a/lib/main.dart b/lib/main.dart index ca2e7a82..a1944fd0 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,7 +1,4 @@ -import 'package:diplomaticquarterapp/pages/livecare/livecare_home.dart'; -import 'package:diplomaticquarterapp/pages/login/login.dart'; import 'package:diplomaticquarterapp/routes.dart'; -import 'package:diplomaticquarterapp/uitl/navigation_service.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:flutter/material.dart'; import 'package:flutter_localizations/flutter_localizations.dart'; diff --git a/lib/pages/BookAppointment/components/SearchByClinic.dart b/lib/pages/BookAppointment/components/SearchByClinic.dart index 03370d82..9dc97373 100644 --- a/lib/pages/BookAppointment/components/SearchByClinic.dart +++ b/lib/pages/BookAppointment/components/SearchByClinic.dart @@ -148,7 +148,8 @@ class _SearchByClinicState extends State { context, MaterialPageRoute( builder: (context) => - BranchView(doctorsList: docList, result: result, num: numAll), +// BranchView(doctorsList: docList, result: result, num: numAll), + SearchResults(doctorsList: docList), ), ); //builder: (context) => SearchResults(doctorsList: docList))); diff --git a/lib/pages/login/login.dart b/lib/pages/login/login.dart index f223f91f..7510987c 100644 --- a/lib/pages/login/login.dart +++ b/lib/pages/login/login.dart @@ -2,22 +2,17 @@ import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/config/size_config.dart'; import 'package:diplomaticquarterapp/core/viewModels/appointment_rate_view_model.dart'; import 'package:diplomaticquarterapp/locator.dart'; -import 'package:diplomaticquarterapp/models/Authentication/check_activation_code_request.dart'; import 'package:diplomaticquarterapp/models/Authentication/check_activation_code_response.dart'; import 'package:diplomaticquarterapp/models/Authentication/check_paitent_authentication_req.dart'; -import 'package:diplomaticquarterapp/core/service/client/base_app_client.dart'; -import 'package:diplomaticquarterapp/models/Authentication/select_device_imei_res.dart'; import 'package:diplomaticquarterapp/pages/landing/landing_page.dart'; import 'package:diplomaticquarterapp/pages/login/login-type.dart'; import 'package:diplomaticquarterapp/pages/rateAppointment/rate_appointment_doctor.dart'; -import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; import 'package:diplomaticquarterapp/routes.dart'; +import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart'; -import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; -import 'package:diplomaticquarterapp/widgets/card/rounded_container.dart'; import 'package:diplomaticquarterapp/widgets/input/text_field.dart'; import 'package:diplomaticquarterapp/widgets/mobile-no/mobile_no.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; @@ -26,7 +21,6 @@ import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; class Login extends StatefulWidget { @override @@ -48,9 +42,16 @@ class _Login extends State { @override void initState() { +// getDeviceToken(); super.initState(); } + getDeviceToken() async { + setState(() async { + nationalIDorFile.text = await sharedPref.getString(PUSH_TOKEN); + }); + } + @override Widget build(BuildContext context) { return AppScaffold( @@ -196,7 +197,10 @@ class _Login extends State { this.sharedPref.setObject(USER_PROFILE, result.list), this.sharedPref.setObject(LOGIN_TOKEN_ID, result.logInTokenID), this.sharedPref.setString(TOKEN, result.authenticationTokenID), - + //this.checkIfUserAgreedBefore(result), + Navigator.of(context).pushNamed( + HOME, + ), appointmentRateViewModel .getIsLastAppointmentRatedList() .then((value) => { @@ -219,7 +223,6 @@ class _Login extends State { ) } }) - // SMSOTP.showLoadingDialog(context, false), }); } From 84e92cb0401eaee4490d955ffb2b7cfbc6c15ac7 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Mon, 31 Aug 2020 17:41:57 +0300 Subject: [PATCH 03/45] updates & fixes --- Certs/APNSDevPushCert.p12 | Bin 0 -> 3249 bytes Certs/APNSProdCert.certSigningRequest | 16 ++++++++ Certs/APNSProdCert.p12 | Bin 0 -> 3417 bytes ...pplePushServicesSandbox.certSigningRequest | 16 ++++++++ Certs/aps.cer | Bin 1649 -> 1649 bytes Certs/aps_development.cer | Bin 0 -> 1445 bytes .../components/SearchByClinic.dart | 3 +- .../BookAppointment/widgets/BranchView.dart | 35 ++++++++---------- .../BookAppointment/widgets/DoctorView.dart | 2 +- 9 files changed, 49 insertions(+), 23 deletions(-) create mode 100644 Certs/APNSDevPushCert.p12 create mode 100644 Certs/APNSProdCert.certSigningRequest create mode 100644 Certs/APNSProdCert.p12 create mode 100644 Certs/ApplePushServicesSandbox.certSigningRequest create mode 100644 Certs/aps_development.cer diff --git a/Certs/APNSDevPushCert.p12 b/Certs/APNSDevPushCert.p12 new file mode 100644 index 0000000000000000000000000000000000000000..dba27aecd2549bf8a8aef99be837f25796d10be9 GIT binary patch literal 3249 zcmY+FXHXLew}ul)LP?M=T?ok1A#~|YM1jzoC?YK&kwl6#K_Gw>#n6!+2wB91KXdHxatF=A+#$OydnC{bPJ2tcLR>6k77N^Fwoy6E$hutevVoH>R+&huxuiI?p z#N%o#u|B}ejI@3^r3j7bu7q{w>I*^-Tp*8NG zc=ck~8c&}w%iI<^I468X_@*#2PP)-%iJsMkqvZ=O!XcG=F9}a54fM4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YC8T)@NnafdQh{;7?YKxxycGR;iRr4 z0D4A2AG6MArzq#QnX9(HIPykIez56a?7nwFF!JWkPco9LZf@J=9#E{sO;}*F#)|f> zt&9tH#6C95kPl%DNoS?CN?vUWn5t;=YBW*)L*BV(3G?!u@tZ)t%3VF2gz>9|aqj>T zHDR5R{lTkk1PAC}uAwz2=NM#PSFFio_h`A?{Al`U4pSM8S6A#nhhUSHzWMu}qi-+$#u$EbE+k4<$vbIfmUMk!Gu6KT*BerLKnOKB* zJm5%dw16a?E1oIZAY}gcJ2G)8Ub-X*KmxD;AAlRc58wsx1c?0BUI6rO9RdhLi2Xav zt#}c{wbyqPtu-^4YFd;0SwZCPy6cR=Ap(JbBbXpynG5uE{9pix%X5X?wM=igd}F;q a2FfE-=cWZ11u^#OOP7v5iIk@U0{;WD2?4_Z literal 0 HcmV?d00001 diff --git a/Certs/APNSProdCert.certSigningRequest b/Certs/APNSProdCert.certSigningRequest new file mode 100644 index 00000000..3f13a387 --- /dev/null +++ b/Certs/APNSProdCert.certSigningRequest @@ -0,0 +1,16 @@ +-----BEGIN CERTIFICATE REQUEST----- +MIICkDCCAXgCAQAwSzEjMCEGCSqGSIb3DQEJARYUaGFyb29uNjEzOEBnbWFpbC5j +b20xFzAVBgNVBAMMDk1vaGFtZWQgTWVrYXd5MQswCQYDVQQGEwJBRTCCASIwDQYJ +KoZIhvcNAQEBBQADggEPADCCAQoCggEBALcPrk09MmhQhRNe8LYdaeN4mYtoKJg3 +SndMLgpxnaRqP7a6f4sp118wCFZsTXnwhPVP4DzmXWc2AzZtsusmhdw1tzNFtme0 +PtEjDXIPI2lHU3Zhi2zukZdAVxF+uNi3pcp0axina60ZQciIfb/7Fx6hNbqpk90E +O8a2Ob17Wq/ZTYIP4H7ZGydUe2ra9QyDtjmGj9vpEv+xXYWX685sgEylTG14DSOP +ozGsQmaf+QCMbCT3osq7idWc1IQ+3Oed0kUTx1jmRtZwPzQkJJ1Bx3vYSXN/EOlb +u+ei1Nqtc14aVCYvmcuvGDtMyRtw6w+syCw2CpJCPGNkxNz+EH9h+EUCAwEAAaAA +MA0GCSqGSIb3DQEBCwUAA4IBAQBYdu2AaZY6kReuT1Xp8ktlyPfjBRKhPPChuaeR +tFnYMsJtG0aIA/xOu4/RYDgmL92seimULXd9DIPvkJ2DuaB+bdfGTw0qXUlihkm8 +ui5O0L2F9OZbQxJogvTmrMsKnkoR27O5vyfCn9VMOLk3x1nyEzAXIj/5GHWw9T6t +r65jPUOfm6ikiZtICBzSaTPBtyfZB8mrbwG2dpOvVNSa1dj3xip4L8CL6TxH+qM3 ++N90QFYjvjphJkpn2Kt0ow9IyIyeqJbIYJmsWoV9pXddOHCjKdTWUjq7D2Jn3eUA +DAKjKgVqF4/dU10k7EtSfrw01aHLXjj5FxsD5YhVrgTA5xSq +-----END CERTIFICATE REQUEST----- diff --git a/Certs/APNSProdCert.p12 b/Certs/APNSProdCert.p12 new file mode 100644 index 0000000000000000000000000000000000000000..b0ada4531c7cf19e65b097056fd0e7d80c71d563 GIT binary patch literal 3417 zcmY+FXEYp&x5cMvVMYlfS4K;sWd<{%chN;J5w1jpLG&^thAWH`y+vnqf@sk@6J4UW z=p{(h2+?A~%YUu+-hJ=GS!eCN&pIFX4^4oYfPi2$0g9lcxf`kxdI|+n0dojYD1-o| z`D0U{2~@HFMwB@Os(?S19|#Eev%LOIfM^8ewg3J=2c$&9Ak+{0^IwIoEsTRe)PMj2 zm4@UBtZe>FR?mCe)iiTNtBsrI*hFX*Oq;$=ea;pjNkhe z(%@K-`4iKwyO}nIg&xOt!MbD=xW)K>RNNAdMYR&d=YD~0swE1V}B zYm<+arFD{m2Yg5y#`S7tm8Am(tqeF=LKd3lc2bs`;JprsoHQuIeJHiMrqvyI;K%s40% z9An?P6?7mWq$x9zQDZFUjH!t9e6+kLDBre}b#B2Lx#ryd#@9mK46BcPWmA|UDjL{q zH=3jn`}RDIfmza%I$4pa2YDjhRZC7H8~BYh?v&;j4+NFUSG{PXnB$olZXfFp!v%)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|1IWvj-hiKrTPL8H;!Xc|fiBn%8byu9ILa6bRZPhrbk!27N_+K8gSn2=( literal 0 HcmV?d00001 diff --git a/Certs/ApplePushServicesSandbox.certSigningRequest b/Certs/ApplePushServicesSandbox.certSigningRequest new file mode 100644 index 00000000..7d509a0a --- /dev/null +++ b/Certs/ApplePushServicesSandbox.certSigningRequest @@ -0,0 +1,16 @@ +-----BEGIN CERTIFICATE REQUEST----- +MIICkDCCAXgCAQAwSzEjMCEGCSqGSIb3DQEJARYUaGFyb29uNjEzOEBnbWFpbC5j +b20xFzAVBgNVBAMMDk1vaGFtZWQgTWVrYXd5MQswCQYDVQQGEwJBRTCCASIwDQYJ +KoZIhvcNAQEBBQADggEPADCCAQoCggEBAJnHqsyE7WfiVcE1Lpa4t4OVO6qlll2q +1djs0XG06R/dlDtIqv4940/XLj+hU93mzAcVvFW4DSIEdD3InM3+T6oMTjPu6meU +69h9ryaVkluQRrT/tdGI1EKO4MWGMe4MDIt7DqMhMfAcxTwekwdxdKaCEhaw3qnA +l/64AelY6URW1pHHJMA0VV7j+pE3jVNai+muMXPrhQ1VrOrV8FftpY3bEeRJR2Cl +T0tv0LhEMu4SfLnVWCzGQQC82hilDw3rH3ZDs8DFxF9agNVdwKlYamarh1dQXwRq +Yx2+sjY1/51r9L4VS+GAh9ECxz0e+43NpzfZ/N+mTeDYKDepaBwPQ6kCAwEAAaAA +MA0GCSqGSIb3DQEBCwUAA4IBAQB89OyLfywKT7ftmpEqCmgsmaJexb580q9w8wOk +1JhJkNV5ec+p1dnge2NZeJ4LGII/5wmPj1vANNW0GZdmJDgnC+2gg9toq1QLCAsF +rW7/LMpgAoEH+P5bhrHV9RRv6BQi0ZmN0apBHjp/pqZfm2Cl5jQPEWjUEf2tIF4l +LSKdok6IPO9n4Fgyk0XdUNSEhgVhsLtZkGiXnkI1YovKDnupTFYPXMLp103bc9zP +xDxwscvOysNDijlzZAkJPg2z8NrJIRDrKvLRHzxQwZ/1LHVB/51bp/1iyks3vOjh +qw5XVsrtGAjCjU9md7q3XkPSyKzhK9UqPdOxdvl1OY0KKIIY +-----END CERTIFICATE REQUEST----- diff --git a/Certs/aps.cer b/Certs/aps.cer index fb46df86ede33f276e4356445e82b29065fe162c..d95bac402ce2fd89a3be82eddb4e63848532dabc 100644 GIT binary patch delta 605 zcmV-j0;2u#4Dk#XFoFhcFoFeDpaTK{0s;se>+1ncusUav7qAvHFfchXGcz$-7Y#Bo zFgY?gFgY?aGm+iof42{=O+7MbP=ym-@U|Uk<9L~iXegLBN_R{y3UQsJYCpERe~T&C zUoZ$(Y)yIag!ND0Jmy_zHUll|MYdyLhnPc3DZVP-}VNgS}!Zj*xq?tdBfY=s|Z{fd}c zC)L)0$w|U&%7zEbl+8fh8_k~%n_nwxaYKWgQ0!ZQ{;eRCb$@9re}y_AjtOFk?@0(6Y<$p7ym10PZ{if&1!U7zB{f--Q delta 605 zcmV-j0;2u#4Dk#XFoFhcFoFeDpaTK{0s;sNY?vm;s{TFW zPuDI#p;O)F%m)>`Rk#fz1av*foX!4Estisu?&@ch>)3s-CY6#~kVdrswb6*wLXP0Y zhB59842ydXqaiWy9K}2ylLv8hrh*a{u->V_m;Sf`=~(GRe^%C!$0WcsRbJ!zkvEM~ zT8rtfF>~vM4OOh_)$mvCrH$JW)nk7^M#l>mPPQ zv%tl~Us{0GUBIbWYG$j4S5RLBYGWO~vNkpUoon>I6-(iOhtUGZJs$gw&8Iin{NJWc z;MgcPsc0Mz0z;{@!2+%U6!XdYfIHgEkV>$M<1Zj!=wI4F`ICbL?thl)|6;xS)=J4j znAkO0s(-jV<<$)c7~h-c?{&?`%wN=;G)N;4u!478+SDCvvm~gB_|h0KK@MMz?|H{d(e2^-j1Xtd67O8%72v0(;b!8RpEdi`nv7sgSt65Dib(X>FsFPIKN~!&SZlvi z3x2SIpC@wtxD0yd^{m^EK)J-=(*ckm>o;qAp$(OH%MN&$|;Anh4bj&Z$KunQ58HV9g4Sr6n2pMVTd)26E!OMg|5J z#s&tKMuvu_Q9!OC64#({fuWv(4jUKeB(=`TpL9|f8F}QA^KX79|!G82T7^K^*1`aTwI`xv6<23ZDMK3IV0X84AIvMP-@Esl`?b1Wbd5 z6gLl-v7@o6rK^Qmlp9i520I!wF)ASkHzO+pa}y&!15licsfm%1Vdn8wXIkE-KMFl) zsyA)N_U5V9tCmiSU3K-wn~Q~8UdrE{V(qc&pY3D+>w5MJgYP~&!!EifbO)~zONs4? zIcNX*uj27De)lSU%Ih1o>(!=Cik{%M<^R@;9ao(C9vp2me8T;+gCXx!sp6U}>rqq<+NGc11H${V`o)zuH- zZGT#R`G|X3K$nZO_ zWMXDyU|ih9_!Jl-55b90R+xp!fWbf>7)`RuED{D{4I&-t;+!kDNhEZ?dA;kKd*soe zkj2}9>iI!R6j+)V*?=4-gU0{RWSyMC%4pE|(V+1#8;3R0cE%GG;Rha(9FcV z$HF*!N4pah~P4X7s-g!2@D zNht@IUXy^iqZlZgl30|Y08C-IKn-~*z*Li$k_pZT3i)XYrNyZ_C>9mu1NDL|1FD4E z56m_S1x1O;z~l-xvm_OiCX4k9G~u3L6qC&;DJihh*Do(G*8@2rRS%dz^}(#Os6UUE^6 zfh@>4J{B<+kcgQWRcSeTjE8w>>4xWMI1ata$W zBMTF-s6j1xfLVc&!CXjf{w|$m(u)HR-cs|jk*L|T?bd9eF3FzlCoX#zKYV;|$8Q(8 zkn{7LtIqz5`zx`Xsj4O}iWjL@T;`}My83fy&@{#K$qWCS)j2+A z?yID4{c%l8ZBTt1Bv;JfVZ|(F`fvZKT}_(|dLQrF zaWFGrfy>wLr;~T|Tu|kVTb?m7FC_l_24m|IBfW<#Npp-7k?WvtlMsdL^*x zrG7%KK-s~wTP)cRS6?#c$-L(M(lVo|?(e@(M_z?#vhG$+ROac crFP{c3V7V}$h`SRdzzP)WYF4ei@tjS08HK-ApigX literal 0 HcmV?d00001 diff --git a/lib/pages/BookAppointment/components/SearchByClinic.dart b/lib/pages/BookAppointment/components/SearchByClinic.dart index 33828171..bfadd3b0 100644 --- a/lib/pages/BookAppointment/components/SearchByClinic.dart +++ b/lib/pages/BookAppointment/components/SearchByClinic.dart @@ -162,8 +162,7 @@ class _SearchByClinicState extends State { context, MaterialPageRoute( builder: (context) => -// BranchView(doctorsList: docList, result: result, num: numAll), - SearchResults(doctorsList: docList), + BranchView(doctorsList: docList, result: result, num: numAll), ), ); //builder: (context) => SearchResults(doctorsList: docList))); diff --git a/lib/pages/BookAppointment/widgets/BranchView.dart b/lib/pages/BookAppointment/widgets/BranchView.dart index 82c38cb2..ecf2bfd6 100644 --- a/lib/pages/BookAppointment/widgets/BranchView.dart +++ b/lib/pages/BookAppointment/widgets/BranchView.dart @@ -1,8 +1,6 @@ import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; -import 'package:flutter/material.dart'; - import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; @@ -30,7 +28,6 @@ class _BranchViewState extends State { body: new ListView.builder( itemBuilder: (BuildContext context, int index) { return new ExpandableListView( - result2: widget.result, val: index, doctorsList2: widget.doctorsList); @@ -42,13 +39,11 @@ class _BranchViewState extends State { } class ExpandableListView extends StatefulWidget { - final List result2; final List doctorsList2; final val; - const ExpandableListView( - {Key key, this.result2, this.val, this.doctorsList2}) + const ExpandableListView({Key key, this.result2, this.val, this.doctorsList2}) : super(key: key); @override @@ -61,11 +56,9 @@ class _ExpandableListViewState extends State { @override Widget build(BuildContext context) { return new Container( - // margin: new EdgeInsets.symmetric(vertical: 1.0), width: MediaQuery.of(context).size.width * 0.6, - margin: EdgeInsets.fromLTRB(20.0, 10.0, 10.0, 0.0), + margin: EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 0.0), child: Card( - // margin: EdgeInsets.fromLTRB(20.0, 16.0, 20.0, 8.0), color: Colors.white, shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(10), @@ -77,19 +70,19 @@ class _ExpandableListViewState extends State { child: new Column( children: [ new Container( + margin: EdgeInsets.only(left: 5.0, right: 5.0), color: Colors.white, - // padding: new EdgeInsets.symmetric(horizontal: 5.0), child: new Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ new Text( - widget.result2[widget.val].toString()+" "+ "22 كم", + widget.result2[widget.val].toString() + " " + " - 22 KM", style: new TextStyle( fontWeight: FontWeight.bold, color: Colors.black), ), new IconButton( icon: new Container( - height: 30.0, + height: 28.0, width: 30.0, decoration: new BoxDecoration( color: Colors.red, @@ -124,13 +117,14 @@ class _ExpandableListViewState extends State { itemCount: widget.doctorsList2.length, itemBuilder: (context, index) { return widget.result2[widget.val].toString() == - widget.doctorsList2[index].projectName.toString()? DoctorView( - //AJ note - doctor: - widget.doctorsList2[index] - - // widget.doctorsList2[index] - ):Container(); + widget.doctorsList2[index].projectName.toString() + ? DoctorView( + //AJ note + doctor: widget.doctorsList2[index] + + // widget.doctorsList2[index] + ) + : Container(); }, ), ) @@ -162,7 +156,8 @@ class ExpandableContainer extends StatelessWidget { duration: new Duration(milliseconds: 500), curve: Curves.easeInOut, width: screenWidth, - height: expanded ? expandedHeight : collapsedHeight, + height: + expanded ? expandedHeight : collapsedHeight, child: new Container( child: child, decoration: new BoxDecoration( diff --git a/lib/pages/BookAppointment/widgets/DoctorView.dart b/lib/pages/BookAppointment/widgets/DoctorView.dart index 3d69a93d..39e4ab36 100644 --- a/lib/pages/BookAppointment/widgets/DoctorView.dart +++ b/lib/pages/BookAppointment/widgets/DoctorView.dart @@ -39,7 +39,7 @@ class DoctorView extends StatelessWidget { fit: BoxFit.fill, height: 60.0, width: 60.0), ), Container( - width: MediaQuery.of(context).size.width * 0.6, + width: MediaQuery.of(context).size.width * 0.52, margin: EdgeInsets.fromLTRB(20.0, 10.0, 10.0, 0.0), child: Column( crossAxisAlignment: CrossAxisAlignment.start, From f669adcb9dc6c49c040fed27963487c4f7800910 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Tue, 1 Sep 2020 16:38:04 +0300 Subject: [PATCH 04/45] Location service implemented --- lib/config/localized_values.dart | 3 +- lib/config/shared_pref_kay.dart | 2 + .../Appointments/DoctorListResponse.dart | 2 +- lib/pages/BookAppointment/BookingOptions.dart | 27 ++- lib/pages/BookAppointment/Search.dart | 6 +- lib/pages/BookAppointment/SearchResults.dart | 60 +++++-- .../components/SearchByClinic.dart | 49 +++-- .../BookAppointment/widgets/BranchView.dart | 18 +- .../BookAppointment/widgets/DoctorView.dart | 4 +- lib/pages/livecare/widgets/clinic_list.dart | 169 +++++++++--------- .../appointment_services/GetDoctorsList.dart | 12 +- lib/uitl/location_util.dart | 69 +++++++ lib/uitl/translations_delegate_base.dart | 2 + 13 files changed, 287 insertions(+), 136 deletions(-) create mode 100644 lib/uitl/location_util.dart diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 35d24cc7..c6c109f3 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -362,5 +362,6 @@ const Map> localizedValues = { "medicalProfile": {"en": "Medical Profile", 'ar': 'الملف الطبي'}, "consultation": {"en": "Consultation", "ar": "استشارة"}, "logs": {"en": "Logs", "ar": "السجلات"}, - "textToSpeech": {"en": "How May I Help You?", "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": "السماح لتطبيق مجموعة الحبيب الطبية بالوصول إلى موقعك سيساعدك في إظهار المستشفيات وفقًا للأقرب إليك."} }; diff --git a/lib/config/shared_pref_kay.dart b/lib/config/shared_pref_kay.dart index 414c6a80..68df4e75 100644 --- a/lib/config/shared_pref_kay.dart +++ b/lib/config/shared_pref_kay.dart @@ -11,3 +11,5 @@ const AUTH_DATA = 'auth-data'; const IMEI_USER_DATA = 'imei-user-data'; const NHIC_DATA = 'nhic-data'; const FAMILY_FILE = 'family-file'; +const USER_LAT = 'user-lat'; +const USER_LONG = 'user-long'; \ No newline at end of file diff --git a/lib/models/Appointments/DoctorListResponse.dart b/lib/models/Appointments/DoctorListResponse.dart index 2f4ee2a0..07563a25 100644 --- a/lib/models/Appointments/DoctorListResponse.dart +++ b/lib/models/Appointments/DoctorListResponse.dart @@ -30,7 +30,7 @@ class DoctorList { int noOfPatientsRate; int originalClinicID; int personRate; - int projectDistanceInKiloMeters; + dynamic projectDistanceInKiloMeters; String qR; dynamic qRString; int rateNumber; diff --git a/lib/pages/BookAppointment/BookingOptions.dart b/lib/pages/BookAppointment/BookingOptions.dart index dacb25e9..b6dc5500 100644 --- a/lib/pages/BookAppointment/BookingOptions.dart +++ b/lib/pages/BookAppointment/BookingOptions.dart @@ -1,19 +1,36 @@ import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/CardCommon.dart'; -import 'package:diplomaticquarterapp/services/robo_search/search_provider.dart'; +import 'package:diplomaticquarterapp/uitl/location_util.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/material.dart'; -import 'package:provider/provider.dart'; import '../../uitl/translations_delegate_base.dart'; -class BookingOptions extends StatelessWidget { +class BookingOptions extends StatefulWidget { final bool isAppbar; + BookingOptions({this.isAppbar = false}); + + @override + _BookingOptionsState createState() => _BookingOptionsState(); +} + +class _BookingOptionsState extends State { + LocationUtils locationUtils; + + @override + void initState() { + locationUtils = + new LocationUtils(isShowConfirmDialog: true, context: context); + WidgetsBinding.instance + .addPostFrameCallback((_) => locationUtils.getCurrentLocation()); + + super.initState(); + } + @override Widget build(BuildContext context) { - final searchValue = Provider.of(context); return AppScaffold( - isShowAppBar: isAppbar, + isShowAppBar: widget.isAppbar, appBarTitle: TranslationBase.of(context).bookAppo, body: Container( margin: EdgeInsets.fromLTRB(10.0, 20.0, 10.0, 10.0), diff --git a/lib/pages/BookAppointment/Search.dart b/lib/pages/BookAppointment/Search.dart index 9af6b449..08b49462 100644 --- a/lib/pages/BookAppointment/Search.dart +++ b/lib/pages/BookAppointment/Search.dart @@ -1,13 +1,17 @@ import 'package:diplomaticquarterapp/pages/BookAppointment/components/SearchByClinic.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/components/SearchByDoctor.dart'; +import 'package:diplomaticquarterapp/uitl/location_util.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; import 'package:diplomaticquarterapp/widgets/others/bottom_bar.dart'; -import 'package:diplomaticquarterapp/widgets/others/floating_button_search.dart'; import 'package:flutter/material.dart'; +import 'package:geolocator/geolocator.dart'; class Search extends StatefulWidget { final int type; + Search({this.type = 0}); + @override _SearchState createState() => _SearchState(); } diff --git a/lib/pages/BookAppointment/SearchResults.dart b/lib/pages/BookAppointment/SearchResults.dart index 7da5112b..5d74cc59 100644 --- a/lib/pages/BookAppointment/SearchResults.dart +++ b/lib/pages/BookAppointment/SearchResults.dart @@ -1,11 +1,11 @@ import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; +import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/DoctorView.dart'; import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/material.dart'; -import 'widgets/DoctorView.dart'; - class SearchResults extends StatefulWidget { List doctorsList = []; @@ -49,19 +49,51 @@ class _SearchResultsState extends State { body: Container( margin: EdgeInsets.only(bottom: 10.0), child: SingleChildScrollView( - child: ListView.builder( - scrollDirection: Axis.vertical, - shrinkWrap: true, - physics: ScrollPhysics(), - padding: EdgeInsets.all(0.0), - itemCount: widget.doctorsList.length, - itemBuilder: (context, index) { - return DoctorView( - //AJ note - doctor: widget.doctorsList[index], - ); - }, + physics: BouncingScrollPhysics(), + child: FractionallySizedBox( + widthFactor: 1.0, + child: Column( + children: [ + ...List.generate( + widget.doctorsList.length, + (index) => AppExpandableNotifier( + title: widget.doctorsList[index].projectName, + bodyWidget: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: widget.doctorsList.map((doctorObj) { + return DoctorView( + doctor: doctorObj, + ); + }).toList(), + ), + ), + ) + ], + ), ), + +// ListView.builder( +// scrollDirection: Axis.vertical, +// shrinkWrap: true, +// physics: ScrollPhysics(), +// padding: EdgeInsets.all(0.0), +// itemCount: widget.doctorsList.length, +// itemBuilder: (context, index) { +// return AppExpandableNotifier( +// title: widget.doctorsList[index].projectName, +// bodyWidget: Column( +// crossAxisAlignment: CrossAxisAlignment.start, +// mainAxisAlignment: MainAxisAlignment.spaceBetween, +// children: widget.doctorsList.map((labOrder) { +// return DoctorView( +// doctor: widget.doctorsList[index], +// ); +// }).toList(), +// ), +// ); +// }, +// ), ), ), ); diff --git a/lib/pages/BookAppointment/components/SearchByClinic.dart b/lib/pages/BookAppointment/components/SearchByClinic.dart index bfadd3b0..2188d296 100644 --- a/lib/pages/BookAppointment/components/SearchByClinic.dart +++ b/lib/pages/BookAppointment/components/SearchByClinic.dart @@ -1,4 +1,4 @@ -import 'dart:convert'; +import "dart:collection"; import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; import 'package:diplomaticquarterapp/models/Clinics/ClinicListResponse.dart'; @@ -6,16 +6,11 @@ import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/BranchView.da import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart'; import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart'; -import 'package:diplomaticquarterapp/services/robo_search/search_provider.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:flutter/material.dart'; -import 'package:provider/provider.dart'; import 'package:smart_progress_bar/smart_progress_bar.dart'; -import '../SearchResults.dart'; -import "dart:collection"; - class SearchByClinic extends StatefulWidget { @override _SearchByClinicState createState() => _SearchByClinicState(); @@ -30,14 +25,6 @@ class _SearchByClinicState extends State { @override void initState() { WidgetsBinding.instance.addPostFrameCallback((_) => getClinicsList()); - // event.controller.stream.listen((p) { - // if (p['clinic_id'] != null) { - // // setState(() { - // dropdownValue = p['clinic_id'].toString(); - // //}); - // getDoctorsList(context); - // } - // }); super.initState(); } @@ -118,36 +105,43 @@ class _SearchByClinicState extends State { getDoctorsList(BuildContext context) { List doctorsList = []; - //======================== List arr = []; + List arrDistance = []; var distinctIds; List result; int numAll; - //========================= DoctorsListService service = new DoctorsListService(); service.getDoctorsList(int.parse(dropdownValue), 0, context).then((res) { if (res['MessageStatus'] == 1) { setState(() { if (res['DoctorList'].length != 0) { + print(res['DoctorList']); doctorsList.clear(); res['DoctorList'].forEach((v) { doctorsList.add(new DoctorList.fromJson(v)); arr.add(new DoctorList.fromJson(v).projectName); - // print(DoctorList.fromJson(v).projectName); - // print(DoctorList.fromJson(v).projectDistanceInKiloMeters); - // distinctIds = result.toSet().toList(); + arrDistance.add(new DoctorList.fromJson(v) + .projectDistanceInKiloMeters + .toString()); + +// print(DoctorList +// .fromJson(v) +// .projectName); +// print(DoctorList +// .fromJson(v) +// .projectDistanceInKiloMeters); +// distinctIds = result.toSet().toList(); }); } else {} }); result = LinkedHashSet.from(arr).toList(); numAll = result.length; - // print(result); - print("numAll=" + numAll.toString()); - navigateToSearchResults(context, doctorsList, result, numAll); + navigateToSearchResults( + context, doctorsList, result, numAll, arrDistance); } else { AppToast.showErrorToast(message: res['ErrorEndUserMessage']); } @@ -157,12 +151,17 @@ class _SearchByClinicState extends State { text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); } - Future navigateToSearchResults(context, docList, result, numAll) async { + Future navigateToSearchResults( + context, docList, result, numAll, resultDistance) async { Navigator.push( context, MaterialPageRoute( - builder: (context) => - BranchView(doctorsList: docList, result: result, num: numAll), +// builder: (context) => SearchResults(doctorsList: docList) + builder: (context) => BranchView( + doctorsList: docList, + result: result, + num: numAll, + resultDistance: resultDistance), ), ); //builder: (context) => SearchResults(doctorsList: docList))); diff --git a/lib/pages/BookAppointment/widgets/BranchView.dart b/lib/pages/BookAppointment/widgets/BranchView.dart index ecf2bfd6..da069b75 100644 --- a/lib/pages/BookAppointment/widgets/BranchView.dart +++ b/lib/pages/BookAppointment/widgets/BranchView.dart @@ -10,9 +10,11 @@ class BranchView extends StatefulWidget { final List doctorsList; final List result; + final List resultDistance; final int num; - const BranchView({Key key, this.doctorsList, this.result, this.num}) + const BranchView( + {Key key, this.doctorsList, this.result, this.resultDistance, this.num}) : super(key: key); @override @@ -29,6 +31,7 @@ class _BranchViewState extends State { itemBuilder: (BuildContext context, int index) { return new ExpandableListView( result2: widget.result, + resultDistance: widget.resultDistance, val: index, doctorsList2: widget.doctorsList); }, @@ -40,10 +43,12 @@ class _BranchViewState extends State { class ExpandableListView extends StatefulWidget { final List result2; + final List resultDistance; final List doctorsList2; final val; - const ExpandableListView({Key key, this.result2, this.val, this.doctorsList2}) + const ExpandableListView( + {Key key, this.result2, this.resultDistance, this.val, this.doctorsList2}) : super(key: key); @override @@ -76,7 +81,11 @@ class _ExpandableListViewState extends State { mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ new Text( - widget.result2[widget.val].toString() + " " + " - 22 KM", + widget.result2[widget.val].toString() + + " " + + " - " + + widget.resultDistance[widget.val].toString() + + " KM", style: new TextStyle( fontWeight: FontWeight.bold, color: Colors.black), ), @@ -156,8 +165,7 @@ class ExpandableContainer extends StatelessWidget { duration: new Duration(milliseconds: 500), curve: Curves.easeInOut, width: screenWidth, - height: - expanded ? expandedHeight : collapsedHeight, + height: expanded ? MediaQuery.of(context).size.height : collapsedHeight, child: new Container( child: child, decoration: new BoxDecoration( diff --git a/lib/pages/BookAppointment/widgets/DoctorView.dart b/lib/pages/BookAppointment/widgets/DoctorView.dart index 39e4ab36..e8f08af5 100644 --- a/lib/pages/BookAppointment/widgets/DoctorView.dart +++ b/lib/pages/BookAppointment/widgets/DoctorView.dart @@ -21,7 +21,7 @@ class DoctorView extends StatelessWidget { getDoctorsProfile(context, doctor); }, child: Card( - margin: EdgeInsets.fromLTRB(20.0, 16.0, 20.0, 8.0), + margin: EdgeInsets.fromLTRB(10.0, 16.0, 10.0, 8.0), color: Colors.white, shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(10), @@ -39,7 +39,7 @@ class DoctorView extends StatelessWidget { fit: BoxFit.fill, height: 60.0, width: 60.0), ), Container( - width: MediaQuery.of(context).size.width * 0.52, + width: MediaQuery.of(context).size.width * 0.5, margin: EdgeInsets.fromLTRB(20.0, 10.0, 10.0, 0.0), child: Column( crossAxisAlignment: CrossAxisAlignment.start, diff --git a/lib/pages/livecare/widgets/clinic_list.dart b/lib/pages/livecare/widgets/clinic_list.dart index 77c3e741..9100a64e 100644 --- a/lib/pages/livecare/widgets/clinic_list.dart +++ b/lib/pages/livecare/widgets/clinic_list.dart @@ -14,7 +14,6 @@ import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart'; -import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/material.dart'; import 'package:smart_progress_bar/smart_progress_bar.dart'; @@ -49,7 +48,7 @@ class _clinic_listState extends State { liveCareClinicsListResponse = new LiveCareClinicsListResponse(); WidgetsBinding.instance.addPostFrameCallback((_) { // Future.delayed(new Duration(milliseconds: 1200), () { - getLiveCareClinicsList(); + getLiveCareClinicsList(); // }); }); getLanguageID(); @@ -58,79 +57,82 @@ class _clinic_listState extends State { @override Widget build(BuildContext context) { - return AppScaffold( - isShowAppBar: false, - body: SingleChildScrollView( - child: isDataLoaded - ? Container( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - margin: EdgeInsets.all(15.0), - child: Text("Online Clinics: ", - style: TextStyle( - fontSize: 20.0, fontWeight: FontWeight.bold)), - ), - ListView.builder( - scrollDirection: Axis.vertical, - shrinkWrap: true, - physics: ScrollPhysics(), - padding: EdgeInsets.all(0.0), - itemCount: liveCareClinicsListResponse - .patientERGetClinicsList.length, - itemBuilder: (context, index) { - return InkWell( - onTap: () { - updateSelectedIndex(liveCareClinicsListResponse - .patientERGetClinicsList[index]); - }, - child: ClinicCard( - isSelected: selectedClinicID == - liveCareClinicsListResponse - .patientERGetClinicsList[index] - .serviceID - ? true - : false, - patientERGetClinicsList: liveCareClinicsListResponse - .patientERGetClinicsList[index], - languageID: languageID, - ), - ); - }, - ), - Container( - height: 80.0, - ), - ], - ), - ) - : Container(), - ), - bottomSheet: Container( - width: MediaQuery.of(context).size.width, - height: 50.0, - margin: EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 10.0), - child: ButtonTheme( - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(10.0), - ), - minWidth: MediaQuery.of(context).size.width * 0.7, - height: 45.0, - child: RaisedButton( - color: new Color(0xFF60686b), - textColor: Colors.white, - disabledTextColor: Colors.white, - disabledColor: new Color(0xFFbcc2c4), - onPressed: startLiveCare, - child: Text("Start", style: TextStyle(fontSize: 18.0)), - ), - ), + return SingleChildScrollView( + child: Column( + children: [ + isDataLoaded + ? Container( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + margin: EdgeInsets.all(15.0), + child: Text("Online Clinics: ", + style: TextStyle( + fontSize: 20.0, fontWeight: FontWeight.bold)), + ), + ListView.builder( + scrollDirection: Axis.vertical, + shrinkWrap: true, + physics: ScrollPhysics(), + padding: EdgeInsets.all(0.0), + itemCount: liveCareClinicsListResponse + .patientERGetClinicsList.length, + itemBuilder: (context, index) { + return InkWell( + onTap: () { + updateSelectedIndex(liveCareClinicsListResponse + .patientERGetClinicsList[index]); + }, + child: ClinicCard( + isSelected: selectedClinicID == + liveCareClinicsListResponse + .patientERGetClinicsList[index] + .serviceID + ? true + : false, + patientERGetClinicsList: + liveCareClinicsListResponse + .patientERGetClinicsList[index], + languageID: languageID, + ), + ); + }, + ), + Container( + height: 10.0, + ), + ], + ), + ) + : Container(), + isDataLoaded ? Container( + width: MediaQuery.of(context).size.width, + height: 50.0, + margin: EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 10.0), + child: ButtonTheme( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10.0), + ), + minWidth: MediaQuery.of(context).size.width * 0.7, + height: 45.0, + child: RaisedButton( + color: new Color(0xFF60686b), + textColor: Colors.white, + disabledTextColor: Colors.white, + disabledColor: new Color(0xFFbcc2c4), + onPressed: startLiveCare, + child: Text("Start", style: TextStyle(fontSize: 18.0)), + ), + ), + ) : Container(), + ], ), ); } void startLiveCare() { + bool isError = false; LiveCareService service = new LiveCareService(); ERAppointmentFeesResponse erAppointmentFeesResponse = new ERAppointmentFeesResponse(); @@ -141,12 +143,15 @@ class _clinic_listState extends State { }) .catchError((err) { print(err); + isError = true; + AppToast.showErrorToast(message: err); }) .showProgressBar( text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)) .then((value) { - getERAppointmentTime( - erAppointmentFeesResponse.getERAppointmentFeesList); + if (!isError) + getERAppointmentTime( + erAppointmentFeesResponse.getERAppointmentFeesList); }); } @@ -158,6 +163,7 @@ class _clinic_listState extends State { getERAppointmentFeesList, res['WatingtimeInteger']); }).catchError((err) { print(err); + AppToast.showErrorToast(message: err); }).showProgressBar( text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); } @@ -339,14 +345,17 @@ class _clinic_listState extends State { service .addNewCallForPatientER(selectedClinicID, clientRequestID, context) .then((res) { - AppToast.showSuccessToast( - message: "New Call has been added successfully"); - }).catchError((err) { - print(err); - }).showProgressBar( - text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)).then((value) { - widget.getLiveCareHistory(); - }); + AppToast.showSuccessToast( + message: "New Call has been added successfully"); + }) + .catchError((err) { + print(err); + }) + .showProgressBar( + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)) + .then((value) { + widget.getLiveCareHistory(); + }); } getLanguageID() async { diff --git a/lib/services/appointment_services/GetDoctorsList.dart b/lib/services/appointment_services/GetDoctorsList.dart index ba3ad56e..27a66d43 100644 --- a/lib/services/appointment_services/GetDoctorsList.dart +++ b/lib/services/appointment_services/GetDoctorsList.dart @@ -20,6 +20,9 @@ class DoctorsListService extends BaseService { AuthenticatedUser authUser = new AuthenticatedUser(); AuthProvider authProvider = new AuthProvider(); + double lat; + double long; + Future getDoctorsList(int clinicID, int projectID, BuildContext context, {doctorId}) async { //Utils.showProgressDialog(context); @@ -31,6 +34,11 @@ class DoctorsListService extends BaseService { 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); + } + var languageID = await sharedPref.getString(APP_LANGUAGE); Request req = appGlobal.getPublicRequest(); request = { @@ -52,8 +60,8 @@ class DoctorsListService extends BaseService { "gender": authUser.gender != null ? authUser.gender : 0, "age": authUser.age != null ? authUser.age : 0, "IsGetNearAppointment": false, - "Latitude": 0, - "Longitude": 0, + "Latitude": lat.toString(), + "Longitude": long.toString(), "License": true }; diff --git a/lib/uitl/location_util.dart b/lib/uitl/location_util.dart new file mode 100644 index 00000000..e3012734 --- /dev/null +++ b/lib/uitl/location_util.dart @@ -0,0 +1,69 @@ +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:geolocator/geolocator.dart'; + +class LocationUtils { + AppSharedPreferences sharedPref = new AppSharedPreferences(); + + bool isShowConfirmDialog; + BuildContext context; + + LocationUtils({@required this.isShowConfirmDialog, @required this.context}); + + void getCurrentLocation() async { + print("current location"); + isLocationServiceEnabled().then((value) { + if (value) { + checkPermission().then((permission) { + if (permission == LocationPermission.always || + permission == LocationPermission.whileInUse) { + getLastKnownPosition().then((value) => setLocation(value)); + } + + if (permission == LocationPermission.denied || + permission == LocationPermission.deniedForever) { + setZeroLocation(); + if (isShowConfirmDialog) showErrorLocationDialog(false); + } + }).catchError((err) { + print(err); + }); + } else { + if (isShowConfirmDialog) showErrorLocationDialog(false); + } + }).catchError((err) { + print(err); + }); + } + + showErrorLocationDialog(bool isPermissionError) { + ConfirmDialog dialog = new ConfirmDialog( + context: context, + confirmMessage: TranslationBase.of(context).locationDialogMessage, + okText: TranslationBase.of(context).confirm, + cancelText: TranslationBase.of(context).cancel_nocaps, + okFunction: () => { + ConfirmDialog.closeAlertDialog(context), + if (isPermissionError) + openAppSettings() + else + openLocationSettings() + }, + cancelFunction: () => {}); + return dialog.showAlertDialog(context); + } + + void setLocation(Position position) { + print(position); + this.sharedPref.setDouble(USER_LAT, position.latitude); + this.sharedPref.setDouble(USER_LONG, position.longitude); + } + + void setZeroLocation() { + this.sharedPref.setDouble(USER_LAT, 0.0); + this.sharedPref.setDouble(USER_LONG, 0.0); + } +} diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index df1999bb..fc1bd800 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -449,6 +449,8 @@ class TranslationBase { String get logs => localizedValues['logs'][locale.languageCode]; String get textToSpeech => localizedValues['textToSpeech'][locale.languageCode]; + String get locationDialogMessage => + localizedValues['locationDialogMessage'][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { From 6ea1ed3eaa0971b337b52f4c31b5a344a8275609 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Tue, 1 Sep 2020 17:13:21 +0300 Subject: [PATCH 05/45] added geolocation dependency in pubspec --- pubspec.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pubspec.yaml b/pubspec.yaml index 657f7b78..f4c5e5c2 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -99,6 +99,9 @@ dependencies: #hijri hijri: ^2.0.3 + #Handle Geolocation + geolocator: ^6.0.0+1 + #Dependencies for video call implementation native_device_orientation: ^0.3.0 enum_to_string: ^1.0.9 From e29c6a892ece5c25522e1e01ffbd23fc8c24cac7 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Wed, 2 Sep 2020 10:02:06 +0300 Subject: [PATCH 06/45] updates --- lib/pages/BookAppointment/BookConfirm.dart | 2 -- lib/pages/BookAppointment/widgets/BranchView.dart | 15 +++++++++++---- lib/uitl/utils.dart | 1 - 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/lib/pages/BookAppointment/BookConfirm.dart b/lib/pages/BookAppointment/BookConfirm.dart index 8c1d781c..88ecdb6b 100644 --- a/lib/pages/BookAppointment/BookConfirm.dart +++ b/lib/pages/BookAppointment/BookConfirm.dart @@ -502,8 +502,6 @@ class _BookConfirmState extends State { Future navigateToBookSuccess(context, DoctorList docObject, PatientShareResponse patientShareResponse) async { - print(widget.appoDateFormatted); -// print(widget.appoTimeFormatted); Navigator.push( context, diff --git a/lib/pages/BookAppointment/widgets/BranchView.dart b/lib/pages/BookAppointment/widgets/BranchView.dart index da069b75..8ec0bbd5 100644 --- a/lib/pages/BookAppointment/widgets/BranchView.dart +++ b/lib/pages/BookAppointment/widgets/BranchView.dart @@ -82,10 +82,13 @@ class _ExpandableListViewState extends State { children: [ new Text( widget.result2[widget.val].toString() + - " " + - " - " + - widget.resultDistance[widget.val].toString() + - " KM", + " " + + widget.resultDistance[widget.val] + .toString() != + "0" + ? getProjectDistance( + widget.resultDistance[widget.val].toString()) + : "", style: new TextStyle( fontWeight: FontWeight.bold, color: Colors.black), ), @@ -143,6 +146,10 @@ class _ExpandableListViewState extends State { ), ); } + + String getProjectDistance(String distance) { + return " - " + distance + " KM"; + } } class ExpandableContainer extends StatelessWidget { diff --git a/lib/uitl/utils.dart b/lib/uitl/utils.dart index 526c0f5b..6958e67f 100644 --- a/lib/uitl/utils.dart +++ b/lib/uitl/utils.dart @@ -1,5 +1,4 @@ import 'package:connectivity/connectivity.dart'; -import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; From 35cd02494c93e24a4eb909bbb9e6bb4725691ee1 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Wed, 2 Sep 2020 12:10:40 +0300 Subject: [PATCH 07/45] implemented search by doctor list --- lib/config/localized_values.dart | 5 +- .../Appointments/DoctorListResponse.dart | 86 +++++++++++-------- lib/pages/BookAppointment/SearchResults.dart | 74 ++++------------ .../components/SearchByClinic.dart | 8 -- .../components/SearchByDoctor.dart | 44 +++++++++- .../BookAppointment/widgets/BranchView.dart | 16 ++-- 6 files changed, 117 insertions(+), 116 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index ea14b71f..95398e23 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -363,7 +363,7 @@ const Map> localizedValues = { "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": "السماح لتطبيق مجموعة الحبيب الطبية بالوصول إلى موقعك سيساعدك في إظهار المستشفيات وفقًا للأقرب إليك."} + "locationDialogMessage": {"en": "Allow the HMG app to access your location will assist you in showing the hospitals according to the nearest to you.", "ar": "السماح لتطبيق مجموعة الحبيب الطبية بالوصول إلى موقعك سيساعدك في إظهار المستشفيات وفقًا للأقرب إليك."}, "parking":{"en":"Parking","ar":"مواقف"}, "alhabiServices":{"en":"HMG Service","ar":"خدمات الحبيب"}, "parkingTitle":{"en":"Car service, car service, service to save parking information, return to it later, 1- By clicking on (Read the code), save the parking data. 2- By clicking on the button (view my car park), it shows you the car’s location in Google Maps. 3- Read another position by pressing the Clear Position Data button.","ar":" خدمة المواقف، تتيح هذه الخدمة للمستخدم معلومات عن موقف السيارة ليسهل عليه العودة لها لاحقاً ، 1- بالضغط على زر(قراءة الكود) تستطيع حفظ البيانات الخاصة بالموقف. 2-بالضغط على زر(عرض موقف سيارتي) يعرض لك موقع السيارة في خرائط قوقل. 3- لإعادة قراءة موقف آخرعن طريق الضغط على زر(مسح بيانات الموقف). "}, @@ -374,6 +374,5 @@ const Map> localizedValues = { "gate":{"en":"Gate:","ar":"بوابة"}, "building":{"en":"Building:","ar":"المبنى"}, "branch":{"en":"Branch:","ar":"الفرع"}, - "emergencyServices":{"en":"Emergency Services:","ar":"خدمات الطوارئ"}, - "textToSpeech": {"en": "How May I Help You?", "ar": "كيف يمكنني مساعدتك؟"} + "emergencyServices":{"en":"Emergency Services:","ar":"خدمات الطوارئ"} }; diff --git a/lib/models/Appointments/DoctorListResponse.dart b/lib/models/Appointments/DoctorListResponse.dart index 07563a25..8e1f0b35 100644 --- a/lib/models/Appointments/DoctorListResponse.dart +++ b/lib/models/Appointments/DoctorListResponse.dart @@ -41,44 +41,44 @@ class DoctorList { DoctorList( {this.clinicID, - this.clinicName, - this.doctorTitle, - this.iD, - this.name, - this.projectID, - this.projectName, - this.actualDoctorRate, - this.clinicRoomNo, - this.date, - this.dayName, - this.doctorID, - this.doctorImageURL, - this.doctorProfile, - this.doctorProfileInfo, - this.doctorRate, - this.gender, - this.genderDescription, - this.isAppointmentAllowed, - this.isDoctorAllowVedioCall, - this.isDoctorDummy, - this.isLiveCare, - this.latitude, - this.longitude, - this.nationalityFlagURL, - this.nationalityID, - this.nationalityName, - this.nearestFreeSlot, - this.noOfPatientsRate, - this.originalClinicID, - this.personRate, - this.projectDistanceInKiloMeters, - this.qR, - this.qRString, - this.rateNumber, - this.serviceID, - this.setupID, - this.speciality, - this.workingHours}); + this.clinicName, + this.doctorTitle, + this.iD, + this.name, + this.projectID, + this.projectName, + this.actualDoctorRate, + this.clinicRoomNo, + this.date, + this.dayName, + this.doctorID, + this.doctorImageURL, + this.doctorProfile, + this.doctorProfileInfo, + this.doctorRate, + this.gender, + this.genderDescription, + this.isAppointmentAllowed, + this.isDoctorAllowVedioCall, + this.isDoctorDummy, + this.isLiveCare, + this.latitude, + this.longitude, + this.nationalityFlagURL, + this.nationalityID, + this.nationalityName, + this.nearestFreeSlot, + this.noOfPatientsRate, + this.originalClinicID, + this.personRate, + this.projectDistanceInKiloMeters, + this.qR, + this.qRString, + this.rateNumber, + this.serviceID, + this.setupID, + this.speciality, + this.workingHours}); DoctorList.fromJson(Map json) { clinicID = json['ClinicID']; @@ -166,3 +166,13 @@ class DoctorList { return data; } } + +class PatientDoctorAppointmentList { + String filterName = ""; + List patientDoctorAppointmentList = List(); + + PatientDoctorAppointmentList( + {this.filterName, DoctorList patientDoctorAppointment}) { + patientDoctorAppointmentList.add(patientDoctorAppointment); + } +} diff --git a/lib/pages/BookAppointment/SearchResults.dart b/lib/pages/BookAppointment/SearchResults.dart index 5d74cc59..8b9dd984 100644 --- a/lib/pages/BookAppointment/SearchResults.dart +++ b/lib/pages/BookAppointment/SearchResults.dart @@ -8,8 +8,10 @@ import 'package:flutter/material.dart'; class SearchResults extends StatefulWidget { List doctorsList = []; + List patientDoctorAppointmentListHospital; - SearchResults({@required this.doctorsList}); + SearchResults( + {@required this.doctorsList, this.patientDoctorAppointmentListHospital}); @override _SearchResultsState createState() => _SearchResultsState(); @@ -21,23 +23,7 @@ class _SearchResultsState extends State { @override void initState() { - event.controller.stream.listen((p) { - // if (p['project_id'] != null) { - // tempList = []; - // widget.doctorsList.forEach((e) => { - // if (e.projectID == int.parse(p['project_id'])) {tempList.add(e)} - // }); - // } else if (p['doctor_id'] != null) { - // tempList = []; - // widget.doctorsList.forEach((e) => { - // if (e.doctorID == int.parse(p['doctor_id'])) {tempList.add(e)} - // }); - // DoctorView().getDoctorsProfile(context, tempList[0], isAppo: true); - // } - // setState(() { - // widget.doctorsList = tempList; - // }); - }); + event.controller.stream.listen((p) {}); super.initState(); } @@ -50,50 +36,28 @@ class _SearchResultsState extends State { margin: EdgeInsets.only(bottom: 10.0), child: SingleChildScrollView( physics: BouncingScrollPhysics(), - child: FractionallySizedBox( - widthFactor: 1.0, - child: Column( - children: [ - ...List.generate( - widget.doctorsList.length, - (index) => AppExpandableNotifier( - title: widget.doctorsList[index].projectName, + child: Column( + children: [ + ...List.generate( + widget.patientDoctorAppointmentListHospital.length, + (index) => AppExpandableNotifier( + title: widget + .patientDoctorAppointmentListHospital[index].filterName, bodyWidget: Column( crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: widget.doctorsList.map((doctorObj) { + children: widget + .patientDoctorAppointmentListHospital[index] + .patientDoctorAppointmentList + .map((doctor) { return DoctorView( - doctor: doctorObj, + doctor: doctor, ); }).toList(), - ), - ), - ) - ], - ), + )), + ) + ], ), - -// ListView.builder( -// scrollDirection: Axis.vertical, -// shrinkWrap: true, -// physics: ScrollPhysics(), -// padding: EdgeInsets.all(0.0), -// itemCount: widget.doctorsList.length, -// itemBuilder: (context, index) { -// return AppExpandableNotifier( -// title: widget.doctorsList[index].projectName, -// bodyWidget: Column( -// crossAxisAlignment: CrossAxisAlignment.start, -// mainAxisAlignment: MainAxisAlignment.spaceBetween, -// children: widget.doctorsList.map((labOrder) { -// return DoctorView( -// doctor: widget.doctorsList[index], -// ); -// }).toList(), -// ), -// ); -// }, -// ), ), ), ); diff --git a/lib/pages/BookAppointment/components/SearchByClinic.dart b/lib/pages/BookAppointment/components/SearchByClinic.dart index 2188d296..35fcf593 100644 --- a/lib/pages/BookAppointment/components/SearchByClinic.dart +++ b/lib/pages/BookAppointment/components/SearchByClinic.dart @@ -125,14 +125,6 @@ class _SearchByClinicState extends State { arrDistance.add(new DoctorList.fromJson(v) .projectDistanceInKiloMeters .toString()); - -// print(DoctorList -// .fromJson(v) -// .projectName); -// print(DoctorList -// .fromJson(v) -// .projectDistanceInKiloMeters); -// distinctIds = result.toSet().toList(); }); } else {} }); diff --git a/lib/pages/BookAppointment/components/SearchByDoctor.dart b/lib/pages/BookAppointment/components/SearchByDoctor.dart index 3e817878..4fb55c7c 100644 --- a/lib/pages/BookAppointment/components/SearchByDoctor.dart +++ b/lib/pages/BookAppointment/components/SearchByDoctor.dart @@ -84,6 +84,10 @@ class _SearchByDoctorState extends State { getDoctorsList(BuildContext context) { List doctorsList = []; DoctorsListService service = new DoctorsListService(); + + List _patientDoctorAppointmentListHospital = + List(); + service .getDoctorsListByName(doctorNameController.text, context) .then((res) { @@ -93,9 +97,34 @@ class _SearchByDoctorState extends State { res['DoctorList'].forEach((v) { doctorsList.add(new DoctorList.fromJson(v)); }); + + doctorsList.forEach((element) { + List doctorByHospital = + _patientDoctorAppointmentListHospital + .where( + (elementClinic) => + elementClinic.filterName == element.projectName, + ) + .toList(); + + if (doctorByHospital.length != 0) { + _patientDoctorAppointmentListHospital[ + _patientDoctorAppointmentListHospital + .indexOf(doctorByHospital[0])] + .patientDoctorAppointmentList + .add(element); + } else { + _patientDoctorAppointmentListHospital.add( + PatientDoctorAppointmentList( + filterName: element.projectName, + patientDoctorAppointment: element)); + } + }); } else {} }); - navigateToSearchResults(context, doctorsList); + + navigateToSearchResults( + context, doctorsList, _patientDoctorAppointmentListHospital); } else { AppToast.showErrorToast(message: res['ErrorEndUserMessage']); } @@ -107,7 +136,7 @@ class _SearchByDoctorState extends State { _onDocTextChanged(content) { print(content); - if (content.length >= 4) { + if (content.length >= 3) { setState(() { _isButtonDisabled = false; }); @@ -123,10 +152,17 @@ class _SearchByDoctorState extends State { getDoctorsList(context); } - Future navigateToSearchResults(context, List docList) async { + Future navigateToSearchResults( + context, + List docList, + List + patientDoctorAppointmentListHospital) async { Navigator.push( context, MaterialPageRoute( - builder: (context) => SearchResults(doctorsList: docList))); + builder: (context) => SearchResults( + doctorsList: docList, + patientDoctorAppointmentListHospital: + patientDoctorAppointmentListHospital))); } } diff --git a/lib/pages/BookAppointment/widgets/BranchView.dart b/lib/pages/BookAppointment/widgets/BranchView.dart index 8ec0bbd5..6819c54b 100644 --- a/lib/pages/BookAppointment/widgets/BranchView.dart +++ b/lib/pages/BookAppointment/widgets/BranchView.dart @@ -82,13 +82,9 @@ class _ExpandableListViewState extends State { children: [ new Text( widget.result2[widget.val].toString() + - " " + - widget.resultDistance[widget.val] - .toString() != - "0" - ? getProjectDistance( - widget.resultDistance[widget.val].toString()) - : "", + " " + + getProjectDistance( + widget.resultDistance[widget.val].toString()), style: new TextStyle( fontWeight: FontWeight.bold, color: Colors.black), ), @@ -148,7 +144,11 @@ class _ExpandableListViewState extends State { } String getProjectDistance(String distance) { - return " - " + distance + " KM"; + if (distance != "0") + return " - " + distance + " KMs"; + else { + return ""; + } } } From a7f5dfab5c5f972a90f12fa46d45652dc4206ff5 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Wed, 2 Sep 2020 12:22:05 +0300 Subject: [PATCH 08/45] fixes --- lib/models/Appointments/DoctorListResponse.dart | 3 ++- lib/pages/BookAppointment/SearchResults.dart | 5 +++-- .../BookAppointment/components/SearchByDoctor.dart | 1 + .../appointment_services/GetDoctorsList.dart | 12 ++++++++++-- 4 files changed, 16 insertions(+), 5 deletions(-) diff --git a/lib/models/Appointments/DoctorListResponse.dart b/lib/models/Appointments/DoctorListResponse.dart index 8e1f0b35..66c0c855 100644 --- a/lib/models/Appointments/DoctorListResponse.dart +++ b/lib/models/Appointments/DoctorListResponse.dart @@ -169,10 +169,11 @@ class DoctorList { class PatientDoctorAppointmentList { String filterName = ""; + String distanceInKMs = ""; List patientDoctorAppointmentList = List(); PatientDoctorAppointmentList( - {this.filterName, DoctorList patientDoctorAppointment}) { + {this.filterName, this.distanceInKMs, DoctorList patientDoctorAppointment}) { patientDoctorAppointmentList.add(patientDoctorAppointment); } } diff --git a/lib/pages/BookAppointment/SearchResults.dart b/lib/pages/BookAppointment/SearchResults.dart index 8b9dd984..c52002b4 100644 --- a/lib/pages/BookAppointment/SearchResults.dart +++ b/lib/pages/BookAppointment/SearchResults.dart @@ -33,7 +33,7 @@ class _SearchResultsState extends State { appBarTitle: TranslationBase.of(context).bookAppo, isShowAppBar: true, body: Container( - margin: EdgeInsets.only(bottom: 10.0), + margin: EdgeInsets.all(10.0), child: SingleChildScrollView( physics: BouncingScrollPhysics(), child: Column( @@ -42,7 +42,8 @@ class _SearchResultsState extends State { widget.patientDoctorAppointmentListHospital.length, (index) => AppExpandableNotifier( title: widget - .patientDoctorAppointmentListHospital[index].filterName, + .patientDoctorAppointmentListHospital[index].filterName + " - " +widget + .patientDoctorAppointmentListHospital[index].distanceInKMs + " KMs" , bodyWidget: Column( crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.spaceBetween, diff --git a/lib/pages/BookAppointment/components/SearchByDoctor.dart b/lib/pages/BookAppointment/components/SearchByDoctor.dart index 4fb55c7c..1e7deb38 100644 --- a/lib/pages/BookAppointment/components/SearchByDoctor.dart +++ b/lib/pages/BookAppointment/components/SearchByDoctor.dart @@ -117,6 +117,7 @@ class _SearchByDoctorState extends State { _patientDoctorAppointmentListHospital.add( PatientDoctorAppointmentList( filterName: element.projectName, + distanceInKMs: element.projectDistanceInKiloMeters.toString(), patientDoctorAppointment: element)); } }); diff --git a/lib/services/appointment_services/GetDoctorsList.dart b/lib/services/appointment_services/GetDoctorsList.dart index 27a66d43..61845095 100644 --- a/lib/services/appointment_services/GetDoctorsList.dart +++ b/lib/services/appointment_services/GetDoctorsList.dart @@ -79,12 +79,20 @@ class DoctorsListService extends BaseService { Future getDoctorsListByName(String docName, BuildContext context) async { Map request; + double lat; + double long; + if (await this.sharedPref.getObject(USER_PROFILE) != null) { var data = AuthenticatedUser.fromJson( 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); + } + var languageID = await sharedPref.getString(APP_LANGUAGE); Request req = appGlobal.getPublicRequest(); request = { @@ -106,8 +114,8 @@ class DoctorsListService extends BaseService { "gender": authUser.gender != null ? authUser.gender : 0, "age": authUser.age != null ? authUser.age : 0, "IsGetNearAppointment": false, - "Latitude": 0, - "Longitude": 0, + "Latitude": lat, + "Longitude": long, "License": true }; From 5ec3935c6890612a1cb5c8718f93e54b579d1b43 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Wed, 2 Sep 2020 16:17:22 +0300 Subject: [PATCH 09/45] ER --- lib/config/localized_values.dart | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index ea14b71f..ca6ec86d 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -363,7 +363,7 @@ const Map> localizedValues = { "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": "السماح لتطبيق مجموعة الحبيب الطبية بالوصول إلى موقعك سيساعدك في إظهار المستشفيات وفقًا للأقرب إليك."} + "locationDialogMessage": {"en": "Allow the HMG app to access your location will assist you in showing the hospitals according to the nearest to you.", "ar": "السماح لتطبيق مجموعة الحبيب الطبية بالوصول إلى موقعك سيساعدك في إظهار المستشفيات وفقًا للأقرب إليك."}, "parking":{"en":"Parking","ar":"مواقف"}, "alhabiServices":{"en":"HMG Service","ar":"خدمات الحبيب"}, "parkingTitle":{"en":"Car service, car service, service to save parking information, return to it later, 1- By clicking on (Read the code), save the parking data. 2- By clicking on the button (view my car park), it shows you the car’s location in Google Maps. 3- Read another position by pressing the Clear Position Data button.","ar":" خدمة المواقف، تتيح هذه الخدمة للمستخدم معلومات عن موقف السيارة ليسهل عليه العودة لها لاحقاً ، 1- بالضغط على زر(قراءة الكود) تستطيع حفظ البيانات الخاصة بالموقف. 2-بالضغط على زر(عرض موقف سيارتي) يعرض لك موقع السيارة في خرائط قوقل. 3- لإعادة قراءة موقف آخرعن طريق الضغط على زر(مسح بيانات الموقف). "}, @@ -375,5 +375,8 @@ const Map> localizedValues = { "building":{"en":"Building:","ar":"المبنى"}, "branch":{"en":"Branch:","ar":"الفرع"}, "emergencyServices":{"en":"Emergency Services:","ar":"خدمات الطوارئ"}, - "textToSpeech": {"en": "How May I Help You?", "ar": "كيف يمكنني مساعدتك؟"} + "nearester":{"en":"Nearest ER:","ar":"أقرب طوارى"}, + "locationa":{"en":"location:","ar":"الموقع"}, + "ambulancerequest":{"en":"Ambulance :","ar":"طلب نقل "}, + "requestA":{"en":"Request:","ar":"اسعاف"}, }; From 4ffbb80f3d4c830e978f2d425a5c356867ce7712 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Wed, 2 Sep 2020 16:17:37 +0300 Subject: [PATCH 10/45] ER --- .../er_service/projectavgerwaitingtime.dart | 52 +++++++++++++ lib/pages/ErService/ErOptions.dart | 76 +++++++++++++++++++ lib/pages/ErService/widgets/card_common.dart | 64 ++++++++++++++++ lib/pages/landing/home_page.dart | 47 +++++++----- lib/uitl/translations_delegate_base.dart | 8 ++ 5 files changed, 226 insertions(+), 21 deletions(-) create mode 100644 lib/core/model/er_service/projectavgerwaitingtime.dart create mode 100644 lib/pages/ErService/ErOptions.dart create mode 100644 lib/pages/ErService/widgets/card_common.dart diff --git a/lib/core/model/er_service/projectavgerwaitingtime.dart b/lib/core/model/er_service/projectavgerwaitingtime.dart new file mode 100644 index 00000000..7d5f8ca4 --- /dev/null +++ b/lib/core/model/er_service/projectavgerwaitingtime.dart @@ -0,0 +1,52 @@ +class ProjectAvgERWaitingTime { + int iD; + int projectID; + int avgTimeInMinutes; + String avgTimeInHHMM; + double distanceInKilometers; + String latitude; + String longitude; + String phoneNumber; + String projectImageURL; + String projectName; + + ProjectAvgERWaitingTime( + {this.iD, + this.projectID, + this.avgTimeInMinutes, + this.avgTimeInHHMM, + this.distanceInKilometers, + this.latitude, + this.longitude, + this.phoneNumber, + this.projectImageURL, + this.projectName}); + + ProjectAvgERWaitingTime.fromJson(Map json) { + iD = json['ID']; + projectID = json['ProjectID']; + avgTimeInMinutes = json['AvgTimeInMinutes']; + avgTimeInHHMM = json['AvgTimeInHHMM']; + distanceInKilometers = json['DistanceInKilometers']; + latitude = json['Latitude']; + longitude = json['Longitude']; + phoneNumber = json['PhoneNumber']; + projectImageURL = json['ProjectImageURL']; + projectName = json['ProjectName']; + } + + Map toJson() { + final Map data = new Map(); + data['ID'] = this.iD; + data['ProjectID'] = this.projectID; + data['AvgTimeInMinutes'] = this.avgTimeInMinutes; + data['AvgTimeInHHMM'] = this.avgTimeInHHMM; + data['DistanceInKilometers'] = this.distanceInKilometers; + data['Latitude'] = this.latitude; + data['Longitude'] = this.longitude; + data['PhoneNumber'] = this.phoneNumber; + data['ProjectImageURL'] = this.projectImageURL; + data['ProjectName'] = this.projectName; + return data; + } +} \ No newline at end of file diff --git a/lib/pages/ErService/ErOptions.dart b/lib/pages/ErService/ErOptions.dart new file mode 100644 index 00000000..33de54b9 --- /dev/null +++ b/lib/pages/ErService/ErOptions.dart @@ -0,0 +1,76 @@ +import 'package:diplomaticquarterapp/uitl/location_util.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +//import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/material.dart'; +import '../../uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/pages/ErService/widgets/card_common.dart'; + +class ErOptions extends StatefulWidget { + final bool isAppbar; + + const ErOptions({Key key, this.isAppbar}) : super(key: key); + + + @override + _ErOptionsState createState() => _ErOptionsState(); +} + +class _ErOptionsState extends State { + LocationUtils locationUtils; + + @override + void initState() { + locationUtils = + new LocationUtils(isShowConfirmDialog: true, context: context); + WidgetsBinding.instance + .addPostFrameCallback((_) => locationUtils.getCurrentLocation()); + + super.initState(); + } + @override + Widget build(BuildContext context) { + return AppScaffold( + isShowAppBar: widget.isAppbar, + appBarTitle: TranslationBase.of(context).bookAppo, + body: Container( + margin: EdgeInsets.fromLTRB(10.0, 20.0, 10.0, 10.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text(TranslationBase.of(context).searchBy, + style: TextStyle( + fontSize: 24.0, + letterSpacing: 1.0, + fontWeight: FontWeight.bold, + color: new Color(0xFF60686b))), + Container( + margin: EdgeInsets.fromLTRB(0.0, 10.0, 0.0, 10.0), + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Expanded( + child: CardCommonEr( + image: 'assets/images/new-design/AM.PNG', + text: TranslationBase.of(context).ambulancerequest, + subText: TranslationBase.of(context).requestA, + type: 0, + ), + ), + Expanded( + child: CardCommonEr( + image: 'assets/images/new-design/emergency_icon.png', + text: TranslationBase.of(context).nearester, + subText: TranslationBase.of(context).locationa, + type: 1), + ) + ], + ), + ), + ], + ), + ), + ); + } +} + diff --git a/lib/pages/ErService/widgets/card_common.dart b/lib/pages/ErService/widgets/card_common.dart new file mode 100644 index 00000000..124c73c4 --- /dev/null +++ b/lib/pages/ErService/widgets/card_common.dart @@ -0,0 +1,64 @@ +//import 'package:diplomaticquarterapp/pages/BookAppointment/Search.dart'; +import 'package:flutter/material.dart'; + +class CardCommonEr extends StatelessWidget { + final image; + final text; + final subText; + final type; + const CardCommonEr( + {@required this.image, + @required this.text, + @required this.subText, + @required this.type}); + + @override + Widget build(BuildContext context) { + return GestureDetector( + onTap: () { + navigateToSearch(context, this.type); + }, + child: Container( + margin: EdgeInsets.fromLTRB(9.0, 9.0, 9.0, 9.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.start, + children: [ + Container( + margin: EdgeInsets.fromLTRB(10.0, 10.0, 10.0, 0.0), + child: Text(this.text, + overflow: TextOverflow.clip, + style: TextStyle( + color: new Color(0xFFc5272d), + letterSpacing: 1.0, + fontSize: 20.0)), + ), + Container( + margin: EdgeInsets.fromLTRB(10.0, 0.0, 10.0, 0.0), + child: Text(this.subText, + overflow: TextOverflow.clip, + style: TextStyle( + color: Colors.black, letterSpacing: 1.0, fontSize: 15.0)), + ), + Container( + alignment: Alignment.bottomRight, + margin: EdgeInsets.fromLTRB(0.0, 0.0, 10.0, 8.0), + child: Image.asset(this.image, width: 60.0, height: 60.0), + ), + ], + ), + ), + ); + } + + Future navigateToSearch(context, type) async { +// Navigator.push( +// context, +// MaterialPageRoute( +// builder: (context) => Search( +// type: type, +// ))); + } +} diff --git a/lib/pages/landing/home_page.dart b/lib/pages/landing/home_page.dart index 06a2f9ca..de1670e6 100644 --- a/lib/pages/landing/home_page.dart +++ b/lib/pages/landing/home_page.dart @@ -2,6 +2,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/all_habib_medical_service_page.dart'; +import 'package:diplomaticquarterapp/pages/ErService/ErOptions.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; @@ -512,27 +513,31 @@ class _HomePageState extends State { )), Container( width: MediaQuery.of(context).size.width * 0.29, - child: Center( - child: Padding( - padding: const EdgeInsets.all(15.0), - child: Column( - children: [ - Image.asset( - 'assets/images/Dr_Schedule_report.png', - width: 50, - height: 50, - ), - SizedBox( - height: 15, - ), - Texts( - TranslationBase.of(context).emergencyServices, - textAlign: TextAlign.center, - color: Colors.black87, - bold: false, - fontSize: SizeConfig.textMultiplier * 2.0, - ) - ], + child: InkWell( + onTap: ()=>Navigator.push(context, + FadePage(page: ErOptions(isAppbar: true,))), + child: Center( + child: Padding( + padding: const EdgeInsets.all(15.0), + child: Column( + children: [ + Image.asset( + 'assets/images/Dr_Schedule_report.png', + width: 50, + height: 50, + ), + SizedBox( + height: 15, + ), + Texts( + TranslationBase.of(context).emergencyServices, + textAlign: TextAlign.center, + color: Colors.black87, + bold: false, + fontSize: SizeConfig.textMultiplier * 2.0, + ) + ], + ), ), ), ), diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index d9fc04bc..ba4e7ad7 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -444,6 +444,14 @@ class TranslationBase { String get branch =>localizedValues['branch'][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 requestA=> localizedValues['requestA'][locale.languageCode]; + + + + String get consultation => localizedValues['consultation'][locale.languageCode]; From 1886f3a763a1e3444cb32d49b3f653fa6bfdc967 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Thu, 3 Sep 2020 10:12:05 +0300 Subject: [PATCH 11/45] implementing Dental Appointment flow --- lib/config/config.dart | 3 + lib/models/Appointments/SearchInfoModel.dart | 10 + .../BookAppointment/DentalComplaints.dart | 49 +++++ .../components/SearchByClinic.dart | 172 ++++++++++++++---- .../clinic_services/get_clinic_service.dart | 87 +++++++++ 5 files changed, 281 insertions(+), 40 deletions(-) create mode 100644 lib/models/Appointments/SearchInfoModel.dart create mode 100644 lib/pages/BookAppointment/DentalComplaints.dart diff --git a/lib/config/config.dart b/lib/config/config.dart index 91cc2eda..f3b05b6a 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -69,6 +69,9 @@ const GET_QR_PARKING = '/Services/SWP.svc/REST/GetQRParkingByID'; //URL to get clinic list const GET_CLINICS_LIST_URL = "Services/lists.svc/REST/GetClinicCentralized"; +//URL to get projects list +const GET_PROJECTS_LIST = 'Services/Lists.svc/REST/GetProject'; + //URL to get doctors list const GET_DOCTORS_LIST_URL = "Services/Doctors.svc/REST/SearchDoctorsByTime"; diff --git a/lib/models/Appointments/SearchInfoModel.dart b/lib/models/Appointments/SearchInfoModel.dart new file mode 100644 index 00000000..f5500bca --- /dev/null +++ b/lib/models/Appointments/SearchInfoModel.dart @@ -0,0 +1,10 @@ +class SearchInfo { + int ProjectID; + int ClinicID; + String DoctorName; + String SelectedDate; + String SelectedTime; + String currentLat; + String currentLong; + DateTime date; +} diff --git a/lib/pages/BookAppointment/DentalComplaints.dart b/lib/pages/BookAppointment/DentalComplaints.dart new file mode 100644 index 00000000..756aa8bf --- /dev/null +++ b/lib/pages/BookAppointment/DentalComplaints.dart @@ -0,0 +1,49 @@ +import 'package:diplomaticquarterapp/models/Appointments/SearchInfoModel.dart'; +import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/material.dart'; +import 'package:smart_progress_bar/smart_progress_bar.dart'; + +class DentalComplaints extends StatefulWidget { + SearchInfo searchInfo; + + DentalComplaints({@required this.searchInfo}); + + @override + _DentalComplaintsState createState() => _DentalComplaintsState(); +} + +class _DentalComplaintsState extends State { + @override + void initState() { + WidgetsBinding.instance + .addPostFrameCallback((_) => getChiefComplaintsList()); + super.initState(); + } + + @override + Widget build(BuildContext context) { + return AppScaffold( + isShowAppBar: true, + appBarTitle: "Symptoms", + body: Container(), + ); + } + + getChiefComplaintsList() { + ClinicListService service = new ClinicListService(); + service + .getChiefComplaintsList( + widget.searchInfo.ClinicID, widget.searchInfo.ProjectID, context) + .then((res) { + if (res['MessageStatus'] == 1) { +// setState(() { +// res['List_DentalChiefComplain'].forEach((v) {}); +// }); + } else {} + }).catchError((err) { + print(err); + }).showProgressBar( + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + } +} diff --git a/lib/pages/BookAppointment/components/SearchByClinic.dart b/lib/pages/BookAppointment/components/SearchByClinic.dart index 35fcf593..6ff05204 100644 --- a/lib/pages/BookAppointment/components/SearchByClinic.dart +++ b/lib/pages/BookAppointment/components/SearchByClinic.dart @@ -1,7 +1,10 @@ import "dart:collection"; +import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart'; import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; +import 'package:diplomaticquarterapp/models/Appointments/SearchInfoModel.dart'; import 'package:diplomaticquarterapp/models/Clinics/ClinicListResponse.dart'; +import 'package:diplomaticquarterapp/pages/BookAppointment/DentalComplaints.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/BranchView.dart'; import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart'; @@ -19,8 +22,11 @@ class SearchByClinic extends StatefulWidget { class _SearchByClinicState extends State { bool nearestAppo = false; String dropdownValue; + String projectDropdownValue; var event = RobotProvider(); List clinicsList = []; + List projectsList = []; + bool isMobileAppDentalAllow = false; @override void initState() { @@ -76,25 +82,91 @@ class _SearchByClinicState extends State { onChanged: (newValue) { setState(() { dropdownValue = newValue; - - getDoctorsList(context); + if (!isDentalSelectedAndSupported()) { + projectDropdownValue = ""; + getDoctorsList(context); + } }); }, ), )), + isDentalSelectedAndSupported() == true || nearestAppo + ? Container( + height: 60.0, + decoration: BoxDecoration( + color: Colors.white, + border: Border.all( + color: Colors.grey[400], + width: 1.0, + ), + borderRadius: BorderRadius.circular(10), + ), + padding: EdgeInsets.all(8.0), + width: MediaQuery.of(context).size.width, + margin: EdgeInsets.only(top: 15.0), + child: DropdownButtonHideUnderline( + child: DropdownButton( + hint: new Text("Select Project"), + value: projectDropdownValue, + items: projectsList.map((item) { + return new DropdownMenuItem( + value: item.mainProjectID.toString(), + child: new Text(item.name), + ); + }).toList(), + onChanged: (newValue) { + setState(() { + projectDropdownValue = newValue; + getDoctorsList(context); + }); + }, + ), + )) + : Container(), ], ), ); } + bool isDentalSelectedAndSupported() { + return dropdownValue != "" && + (dropdownValue == "17") && + isMobileAppDentalAllow; + } + getClinicsList() { ClinicListService service = new ClinicListService(); - service.getClinicsList(context).then((res) { + service + .getClinicsList(context) + .then((res) { + if (res['MessageStatus'] == 1) { + setState(() { + isMobileAppDentalAllow = res['ISMobileAppDentalAllow']; + res['ListClinicCentralized'].forEach((v) { + clinicsList.add(new ListClinicCentralized.fromJson(v)); + }); + }); + } else {} + }) + .catchError((err) { + print(err); + }) + .showProgressBar( + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)) + .then((value) { + getProjectsList(); + }); + } + + getProjectsList() { + ClinicListService service = new ClinicListService(); + service.getProjectsList(context).then((res) { if (res['MessageStatus'] == 1) { setState(() { - res['ListClinicCentralized'].forEach((v) { - clinicsList.add(new ListClinicCentralized.fromJson(v)); + res['ListProject'].forEach((v) { + projectsList.add(new HospitalsModel.fromJson(v)); }); + print(projectsList.length); }); } else {} }).catchError((err) { @@ -104,43 +176,65 @@ class _SearchByClinicState extends State { } getDoctorsList(BuildContext context) { - List doctorsList = []; + SearchInfo searchInfo = new SearchInfo(); + if (dropdownValue == "17") { + searchInfo.ProjectID = int.parse(projectDropdownValue); + searchInfo.ClinicID = int.parse(dropdownValue); + searchInfo.date = DateTime.now(); - List arr = []; - List arrDistance = []; - var distinctIds; - List result; - int numAll; - DoctorsListService service = new DoctorsListService(); - service.getDoctorsList(int.parse(dropdownValue), 0, context).then((res) { - if (res['MessageStatus'] == 1) { - setState(() { - if (res['DoctorList'].length != 0) { - print(res['DoctorList']); - doctorsList.clear(); - res['DoctorList'].forEach((v) { - doctorsList.add(new DoctorList.fromJson(v)); + navigateToDentalComplaints(context, searchInfo); + } else { + List doctorsList = []; + List arr = []; + List arrDistance = []; + List result; + int numAll; + DoctorsListService service = new DoctorsListService(); + service + .getDoctorsList( + int.parse(dropdownValue), + projectDropdownValue != "" ? int.parse(projectDropdownValue) : 0, + context) + .then((res) { + if (res['MessageStatus'] == 1) { + setState(() { + if (res['DoctorList'].length != 0) { + print(res['DoctorList']); + doctorsList.clear(); + res['DoctorList'].forEach((v) { + doctorsList.add(new DoctorList.fromJson(v)); - arr.add(new DoctorList.fromJson(v).projectName); - arrDistance.add(new DoctorList.fromJson(v) - .projectDistanceInKiloMeters - .toString()); - }); - } else {} - }); + arr.add(new DoctorList.fromJson(v).projectName); + arrDistance.add(new DoctorList.fromJson(v) + .projectDistanceInKiloMeters + .toString()); + }); + } else {} + }); - result = LinkedHashSet.from(arr).toList(); - numAll = result.length; + result = LinkedHashSet.from(arr).toList(); + numAll = result.length; - navigateToSearchResults( - context, doctorsList, result, numAll, arrDistance); - } else { - AppToast.showErrorToast(message: res['ErrorEndUserMessage']); - } - }).catchError((err) { - print(err); - }).showProgressBar( - text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + navigateToSearchResults( + context, doctorsList, result, numAll, arrDistance); + } else { + AppToast.showErrorToast(message: res['ErrorEndUserMessage']); + } + }).catchError((err) { + print(err); + }).showProgressBar( + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + } + } + + Future navigateToDentalComplaints( + BuildContext context, SearchInfo searchInfo) async { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => DentalComplaints(searchInfo: searchInfo), + ), + ); } Future navigateToSearchResults( @@ -148,7 +242,6 @@ class _SearchByClinicState extends State { Navigator.push( context, MaterialPageRoute( -// builder: (context) => SearchResults(doctorsList: docList) builder: (context) => BranchView( doctorsList: docList, result: result, @@ -156,6 +249,5 @@ class _SearchByClinicState extends State { resultDistance: resultDistance), ), ); - //builder: (context) => SearchResults(doctorsList: docList))); } } diff --git a/lib/services/clinic_services/get_clinic_service.dart b/lib/services/clinic_services/get_clinic_service.dart index 42c9754c..cb486762 100644 --- a/lib/services/clinic_services/get_clinic_service.dart +++ b/lib/services/clinic_services/get_clinic_service.dart @@ -1,13 +1,22 @@ 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/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/models/Request.dart'; +import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; +import 'package:flutter/material.dart'; class ClinicListService extends BaseService { AppSharedPreferences sharedPref = AppSharedPreferences(); AppGlobal appGlobal = new AppGlobal(); + AuthenticatedUser authUser = new AuthenticatedUser(); + AuthProvider authProvider = new AuthProvider(); + + double lat; + double long; + Future getClinicsList(context) async { Map request; var languageID = await sharedPref.getString(APP_LANGUAGE); @@ -34,4 +43,82 @@ class ClinicListService extends BaseService { }, body: request); return Future.value(localRes); } + + Future getProjectsList(context) async { + Map request; + var languageID = await sharedPref.getString(APP_LANGUAGE); + Request req = appGlobal.getPublicRequest(); + request = { + "LanguageID": languageID == 'ar' ? 1 : 2, + "IPAdress": "10.20.10.20", + "VersionID": req.VersionID, + "Channel": req.Channel, + "generalid": 'Cs2020@2016\$2958', + "PatientOutSA": 0, + "TokenID": "", + "DeviceTypeID": req.DeviceTypeID, + "SessionID": null + }; + + dynamic localRes; + + await baseAppClient.post(GET_PROJECTS_LIST, + onSuccess: (response, statusCode) async { + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: request); + return Future.value(localRes); + } + + Future getChiefComplaintsList(int clinicID, int projectID, BuildContext context, + {doctorId}) async { + //Utils.showProgressDialog(context); + Map request; + + if (await this.sharedPref.getObject(USER_PROFILE) != null) { + var data = AuthenticatedUser.fromJson( + 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); + } + + var languageID = await sharedPref.getString(APP_LANGUAGE); + Request req = appGlobal.getPublicRequest(); + request = { + "ClinicID": clinicID, + "ProjectID": projectID, + "SelectedDate": "", + "SelectedTime": "", + "License": true, + "VersionID": 5.6, + "Channel": 3, + "LanguageID": languageID == 'ar' ? 1 : 2, + "IPAdress": "10.20.10.20", + "generalid": "Cs2020@2016\$2958", + "PatientOutSA": 0, + "SessionID": null, + "isDentalAllowedBackend": true, + "DeviceTypeID": 1, + "PatientID": 1, + "ContinueDentalPlan": true, + "IsSearchAppointmnetByClinicID": false + }; + + dynamic localRes; + + await baseAppClient.post(GET_DOCTORS_LIST_URL, + onSuccess: (response, statusCode) async { + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: request); + return Future.value(localRes); + } + } From 51078227ab9f0e3e423a50c324f327bdf2074707 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Thu, 3 Sep 2020 11:51:40 +0300 Subject: [PATCH 12/45] Dental appointment flow implemented --- lib/config/config.dart | 3 + lib/config/localized_values.dart | 3 +- lib/core/service/client/base_app_client.dart | 42 ++++-- .../DentalChiefComplaintsModel.dart | 48 +++++++ .../BookAppointment/DentalComplaints.dart | 41 +++++- lib/pages/BookAppointment/SearchResults.dart | 2 +- .../BookAppointment/widgets/BranchView.dart | 2 +- .../widgets/DentalComplaintCard.dart | 135 ++++++++++++++++++ .../clinic_services/get_clinic_service.dart | 78 +++++++--- lib/uitl/translations_delegate_base.dart | 2 + 10 files changed, 315 insertions(+), 41 deletions(-) create mode 100644 lib/models/Appointments/DentalChiefComplaintsModel.dart create mode 100644 lib/pages/BookAppointment/widgets/DentalComplaintCard.dart diff --git a/lib/config/config.dart b/lib/config/config.dart index f3b05b6a..8cdd118b 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -75,6 +75,9 @@ const GET_PROJECTS_LIST = 'Services/Lists.svc/REST/GetProject'; //URL to get doctors list const GET_DOCTORS_LIST_URL = "Services/Doctors.svc/REST/SearchDoctorsByTime"; +//URL to dental doctors list +const GET_DENTAL_DOCTORS_LIST_URL = "Services/Doctors.svc/REST/Dental_DoctorChiefComplaintMapping"; + //URL to get doctor free slots const GET_DOCTOR_FREE_SLOTS = "Services/Doctors.svc/REST/GetDoctorFreeSlots"; diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 95398e23..d950f05d 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -374,5 +374,6 @@ const Map> localizedValues = { "gate":{"en":"Gate:","ar":"بوابة"}, "building":{"en":"Building:","ar":"المبنى"}, "branch":{"en":"Branch:","ar":"الفرع"}, - "emergencyServices":{"en":"Emergency Services:","ar":"خدمات الطوارئ"} + "emergencyServices":{"en":"Emergency Services:","ar":"خدمات الطوارئ"}, + "km":{"en":"KMs:","ar":"كم"}, }; diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index f45fe22b..bc5c8a3f 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -2,14 +2,11 @@ import 'dart:convert'; import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; -import 'package:diplomaticquarterapp/pages/login/login-type.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart'; -import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:http/http.dart' as http; -import '../../../locator.dart'; import '../../../routes.dart'; AppSharedPreferences sharedPref = new AppSharedPreferences(); @@ -33,9 +30,11 @@ class BaseAppClient { var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'en'); var user = await sharedPref.getObject(USER_PROFILE); - body['SetupID'] = body.containsKey('SetupID') - ? body['SetupID'] != null ? body['SetupID'] : SETUP_ID - : SETUP_ID; + if (body.containsKey('SetupID')) { + body['SetupID'] = body.containsKey('SetupID') + ? body['SetupID'] != null ? body['SetupID'] : SETUP_ID + : SETUP_ID; + } body['VersionID'] = body.containsKey('VersionID') ? body['VersionID'] != null ? body['VersionID'] : VERSION_ID : VERSION_ID; @@ -46,16 +45,29 @@ class BaseAppClient { body['PatientOutSA'] = body.containsKey('PatientOutSA') ? body['PatientOutSA'] != null ? body['PatientOutSA'] : PATIENT_OUT_SA : PATIENT_OUT_SA; - body['isDentalAllowedBackend'] = IS_DENTAL_ALLOWED_BACKEND; + + if (body.containsKey('isDentalAllowedBackend')) { + body['isDentalAllowedBackend'] = body.containsKey('isDentalAllowedBackend') + ? body['isDentalAllowedBackend'] != null ? body['isDentalAllowedBackend'] : IS_DENTAL_ALLOWED_BACKEND + : IS_DENTAL_ALLOWED_BACKEND; + } + body['DeviceTypeID'] = DeviceTypeID; - body['PatientType'] = body.containsKey('PatientType') - ? body['PatientType'] != null ? body['PatientType'] : PATIENT_TYPE - : PATIENT_TYPE; - body['PatientTypeID'] = body.containsKey('PatientTypeID') - ? body['PatientTypeID'] != null - ? body['PatientTypeID'] - : PATIENT_TYPE_ID - : PATIENT_TYPE_ID; + + if (body.containsKey('PatientType')) { + body['PatientType'] = body.containsKey('PatientType') + ? body['PatientType'] != null ? body['PatientType'] : PATIENT_TYPE + : PATIENT_TYPE; + } + + if (body.containsKey('PatientTypeID')) { + body['PatientTypeID'] = body.containsKey('PatientTypeID') + ? body['PatientTypeID'] != null + ? body['PatientTypeID'] + : PATIENT_TYPE_ID + : PATIENT_TYPE_ID; + } + if (user != null) { body['TokenID'] = token; body['PatientID'] = diff --git a/lib/models/Appointments/DentalChiefComplaintsModel.dart b/lib/models/Appointments/DentalChiefComplaintsModel.dart new file mode 100644 index 00000000..c15b828a --- /dev/null +++ b/lib/models/Appointments/DentalChiefComplaintsModel.dart @@ -0,0 +1,48 @@ +class DentalChiefComplaintsModel { + List listDentalChiefComplain; + + DentalChiefComplaintsModel({this.listDentalChiefComplain}); + + DentalChiefComplaintsModel.fromJson(Map json) { + if (json['List_DentalChiefComplain'] != null) { + listDentalChiefComplain = new List(); + json['List_DentalChiefComplain'].forEach((v) { + listDentalChiefComplain.add(new ListDentalChiefComplain.fromJson(v)); + }); + } + } + + Map toJson() { + final Map data = new Map(); + if (this.listDentalChiefComplain != null) { + data['List_DentalChiefComplain'] = + this.listDentalChiefComplain.map((v) => v.toJson()).toList(); + } + return data; + } +} + +class ListDentalChiefComplain { + int projectID; + int iD; + String name; + String nameN; + + ListDentalChiefComplain({this.projectID, this.iD, this.name, this.nameN}); + + ListDentalChiefComplain.fromJson(Map json) { + projectID = json['ProjectID']; + iD = json['ID']; + name = json['Name']; + nameN = json['NameN']; + } + + Map toJson() { + final Map data = new Map(); + data['ProjectID'] = this.projectID; + data['ID'] = this.iD; + data['Name'] = this.name; + data['NameN'] = this.nameN; + return data; + } +} diff --git a/lib/pages/BookAppointment/DentalComplaints.dart b/lib/pages/BookAppointment/DentalComplaints.dart index 756aa8bf..9d3da450 100644 --- a/lib/pages/BookAppointment/DentalComplaints.dart +++ b/lib/pages/BookAppointment/DentalComplaints.dart @@ -1,5 +1,10 @@ +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/models/Appointments/DentalChiefComplaintsModel.dart'; import 'package:diplomaticquarterapp/models/Appointments/SearchInfoModel.dart'; +import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/DentalComplaintCard.dart'; +import 'package:diplomaticquarterapp/pages/livecare/widgets/clinic_card.dart'; import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart'; +import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/material.dart'; import 'package:smart_progress_bar/smart_progress_bar.dart'; @@ -14,6 +19,11 @@ class DentalComplaints extends StatefulWidget { } class _DentalComplaintsState extends State { + List complaintsList = []; + AppSharedPreferences sharedPref = AppSharedPreferences(); + bool isDataLoaded = false; + var languageID; + @override void initState() { WidgetsBinding.instance @@ -26,20 +36,43 @@ class _DentalComplaintsState extends State { return AppScaffold( isShowAppBar: true, appBarTitle: "Symptoms", - body: Container(), + body: Container( + margin: EdgeInsets.fromLTRB(10.0, 10.0, 10.0, 0.0), + child: ListView.builder( + itemCount: complaintsList.length, + itemBuilder: (BuildContext context, int index) { + return Container( + margin: EdgeInsets.only(bottom: 10.0), + child: DentalComplaintCard( + listDentalChiefComplain: complaintsList[index], + languageID: languageID, + ), + ); + }, + ), + ), ); } + getLanguageID() async { + languageID = await sharedPref.getString(APP_LANGUAGE); + } + getChiefComplaintsList() { + getLanguageID(); ClinicListService service = new ClinicListService(); service .getChiefComplaintsList( widget.searchInfo.ClinicID, widget.searchInfo.ProjectID, context) .then((res) { if (res['MessageStatus'] == 1) { -// setState(() { -// res['List_DentalChiefComplain'].forEach((v) {}); -// }); + print(res['List_DentalChiefComplain']); + setState(() { + res['List_DentalChiefComplain'].forEach((v) { + complaintsList.add(new ListDentalChiefComplain.fromJson(v)); + }); + print(complaintsList.length); + }); } else {} }).catchError((err) { print(err); diff --git a/lib/pages/BookAppointment/SearchResults.dart b/lib/pages/BookAppointment/SearchResults.dart index c52002b4..2b5fac17 100644 --- a/lib/pages/BookAppointment/SearchResults.dart +++ b/lib/pages/BookAppointment/SearchResults.dart @@ -43,7 +43,7 @@ class _SearchResultsState extends State { (index) => AppExpandableNotifier( title: widget .patientDoctorAppointmentListHospital[index].filterName + " - " +widget - .patientDoctorAppointmentListHospital[index].distanceInKMs + " KMs" , + .patientDoctorAppointmentListHospital[index].distanceInKMs + " " + TranslationBase.of(context).km, bodyWidget: Column( crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.spaceBetween, diff --git a/lib/pages/BookAppointment/widgets/BranchView.dart b/lib/pages/BookAppointment/widgets/BranchView.dart index 6819c54b..88912a3f 100644 --- a/lib/pages/BookAppointment/widgets/BranchView.dart +++ b/lib/pages/BookAppointment/widgets/BranchView.dart @@ -145,7 +145,7 @@ class _ExpandableListViewState extends State { String getProjectDistance(String distance) { if (distance != "0") - return " - " + distance + " KMs"; + return " - " + distance + " " + TranslationBase.of(context).km; else { return ""; } diff --git a/lib/pages/BookAppointment/widgets/DentalComplaintCard.dart b/lib/pages/BookAppointment/widgets/DentalComplaintCard.dart new file mode 100644 index 00000000..27f37d0a --- /dev/null +++ b/lib/pages/BookAppointment/widgets/DentalComplaintCard.dart @@ -0,0 +1,135 @@ +import 'package:diplomaticquarterapp/models/Appointments/DentalChiefComplaintsModel.dart'; +import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; +import 'package:diplomaticquarterapp/pages/BookAppointment/SearchResults.dart'; +import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:flutter/material.dart'; +import 'package:smart_progress_bar/smart_progress_bar.dart'; + +// ignore: must_be_immutable +class DentalComplaintCard extends StatefulWidget { + final ListDentalChiefComplain listDentalChiefComplain; + var languageID; + + DentalComplaintCard( + {@required this.listDentalChiefComplain, this.languageID}); + + @override + _DentalComplaintCardState createState() => _DentalComplaintCardState(); +} + +class _DentalComplaintCardState extends State { + @override + Widget build(BuildContext context) { + return Container( + child: InkWell( + onTap: () { + getChiefComplaintsList(); + }, + child: Card( + color: Colors.white, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10), + ), + child: Row( + children: [ + Container( + width: MediaQuery.of(context).size.width * 0.85, + padding: EdgeInsets.all(12.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.max, + children: [ + Container( + child: Text(widget.listDentalChiefComplain.name, + style: + TextStyle(fontSize: 16.0, color: Colors.black)), + ), + ], + ), + ), + Container( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.max, + children: [ + Icon(Icons.arrow_forward_ios, + size: 20.0, color: Colors.black54), + ], + ), + ), + ], + ), + ), + ), + ); + } + + getChiefComplaintsList() { + List doctorsList = []; + List _patientDoctorAppointmentListHospital = + List(); + + ClinicListService service = new ClinicListService(); + service + .getChiefComplaintDoctorList(widget.listDentalChiefComplain.iD, + widget.listDentalChiefComplain.projectID, context) + .then((res) { + if (res['MessageStatus'] == 1) { + print(res['List_DentalDoctorChiefComplaintMapping']); + setState(() { + doctorsList.clear(); + res['List_DentalDoctorChiefComplaintMapping'].forEach((v) { + doctorsList.add(new DoctorList.fromJson(v)); + }); + + doctorsList.forEach((element) { + List doctorByHospital = + _patientDoctorAppointmentListHospital + .where( + (elementClinic) => + elementClinic.filterName == element.projectName, + ) + .toList(); + + if (doctorByHospital.length != 0) { + _patientDoctorAppointmentListHospital[ + _patientDoctorAppointmentListHospital + .indexOf(doctorByHospital[0])] + .patientDoctorAppointmentList + .add(element); + } else { + _patientDoctorAppointmentListHospital.add( + PatientDoctorAppointmentList( + filterName: element.projectName, + distanceInKMs: + element.projectDistanceInKiloMeters.toString(), + patientDoctorAppointment: element)); + } + }); + navigateToSearchResults( + context, doctorsList, _patientDoctorAppointmentListHospital); + }); + } else { + AppToast.showErrorToast(message: res['ErrorEndUserMessage']); + } + }).catchError((err) { + print(err); + }).showProgressBar( + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + } + + Future navigateToSearchResults( + context, + List docList, + List + patientDoctorAppointmentListHospital) async { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => SearchResults( + doctorsList: docList, + patientDoctorAppointmentListHospital: + patientDoctorAppointmentListHospital))); + } +} diff --git a/lib/services/clinic_services/get_clinic_service.dart b/lib/services/clinic_services/get_clinic_service.dart index cb486762..8cc1e469 100644 --- a/lib/services/clinic_services/get_clinic_service.dart +++ b/lib/services/clinic_services/get_clinic_service.dart @@ -37,10 +37,10 @@ class ClinicListService extends BaseService { await baseAppClient.post(GET_CLINICS_LIST_URL, 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); } @@ -64,14 +64,15 @@ class ClinicListService extends BaseService { await baseAppClient.post(GET_PROJECTS_LIST, 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 getChiefComplaintsList(int clinicID, int projectID, BuildContext context, + Future getChiefComplaintsList( + int clinicID, int projectID, BuildContext context, {doctorId}) async { //Utils.showProgressDialog(context); Map request; @@ -82,12 +83,6 @@ class ClinicListService extends BaseService { 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); - } - var languageID = await sharedPref.getString(APP_LANGUAGE); Request req = appGlobal.getPublicRequest(); request = { @@ -114,11 +109,56 @@ class ClinicListService extends BaseService { await baseAppClient.post(GET_DOCTORS_LIST_URL, 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 getChiefComplaintDoctorList( + int chiefComplaintID, int projectID, BuildContext context, + {doctorId}) async { + Map request; + + if (await this.sharedPref.getObject(USER_PROFILE) != null) { + var data = AuthenticatedUser.fromJson( + 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); + } + + var languageID = await sharedPref.getString(APP_LANGUAGE); + Request req = appGlobal.getPublicRequest(); + request = { + "ChiefComplaintID": chiefComplaintID, + "ProjectID": projectID, + "VersionID": 5.6, + "Channel": 3, + "LanguageID": languageID == 'ar' ? 1 : 2, + "IPAdress": req.IPAdress, + "generalid": req.generalid, + "PatientOutSA": 0, + "SessionID": null, + "isDentalAllowedBackend": true, + "Latitude": lat.toString(), + "Longitude": long.toString(), + "DeviceTypeID": 1 + }; + + dynamic localRes; + + await baseAppClient.post(GET_DENTAL_DOCTORS_LIST_URL, + 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 d9fc04bc..3b3e581d 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -452,6 +452,8 @@ class TranslationBase { localizedValues['textToSpeech'][locale.languageCode]; String get locationDialogMessage => localizedValues['locationDialogMessage'][locale.languageCode]; + String get km => + localizedValues['km'][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { From ce9903fd13f427671ee29c4916b16c84707bea11 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Thu, 3 Sep 2020 12:13:15 +0300 Subject: [PATCH 13/45] nearest appointment flow implemented --- .../components/SearchByClinic.dart | 7 ++-- .../BookAppointment/widgets/DoctorView.dart | 36 ++++++++++++++++++- .../appointment_services/GetDoctorsList.dart | 13 ++++--- lib/widgets/others/bottom_bar.dart | 2 +- 4 files changed, 50 insertions(+), 8 deletions(-) diff --git a/lib/pages/BookAppointment/components/SearchByClinic.dart b/lib/pages/BookAppointment/components/SearchByClinic.dart index 6ff05204..6b3eff38 100644 --- a/lib/pages/BookAppointment/components/SearchByClinic.dart +++ b/lib/pages/BookAppointment/components/SearchByClinic.dart @@ -82,7 +82,7 @@ class _SearchByClinicState extends State { onChanged: (newValue) { setState(() { dropdownValue = newValue; - if (!isDentalSelectedAndSupported()) { + if (!isDentalSelectedAndSupported() && !nearestAppo) { projectDropdownValue = ""; getDoctorsList(context); } @@ -194,6 +194,7 @@ class _SearchByClinicState extends State { .getDoctorsList( int.parse(dropdownValue), projectDropdownValue != "" ? int.parse(projectDropdownValue) : 0, + nearestAppo, context) .then((res) { if (res['MessageStatus'] == 1) { @@ -248,6 +249,8 @@ class _SearchByClinicState extends State { num: numAll, resultDistance: resultDistance), ), - ); + ).then((value) { + getProjectsList(); + }); } } diff --git a/lib/pages/BookAppointment/widgets/DoctorView.dart b/lib/pages/BookAppointment/widgets/DoctorView.dart index e8f08af5..67c536c4 100644 --- a/lib/pages/BookAppointment/widgets/DoctorView.dart +++ b/lib/pages/BookAppointment/widgets/DoctorView.dart @@ -2,6 +2,7 @@ import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart import 'package:diplomaticquarterapp/models/Appointments/DoctorProfile.dart'; import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:flutter/material.dart'; import 'package:rating_bar/rating_bar.dart'; import 'package:smart_progress_bar/smart_progress_bar.dart'; @@ -39,7 +40,7 @@ class DoctorView extends StatelessWidget { fit: BoxFit.fill, height: 60.0, width: 60.0), ), Container( - width: MediaQuery.of(context).size.width * 0.5, + width: MediaQuery.of(context).size.width * 0.55, margin: EdgeInsets.fromLTRB(20.0, 10.0, 10.0, 0.0), child: Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -74,6 +75,16 @@ class DoctorView extends StatelessWidget { color: Colors.grey[600], letterSpacing: 1.0)), ), + this.doctor.nearestFreeSlot != null ? Container( + margin: EdgeInsets.only(top: 3.0, bottom: 3.0), + child: Text( + getDate(this.doctor.nearestFreeSlot), + style: TextStyle( + fontSize: 14.0, + fontWeight: FontWeight.bold, + color: Colors.green[600], + letterSpacing: 1.0)), + ) : Container(), Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisSize: MainAxisSize.max, @@ -136,6 +147,29 @@ class DoctorView extends StatelessWidget { }).showProgressBar(text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); } + String getDate(String date) { + DateTime dateObj = DateUtil.convertStringToDate(date); + return DateUtil.getWeekDay(dateObj.weekday) + + ", " + + dateObj.day.toString() + + " " + + DateUtil.getMonth(dateObj.month) + + " " + + dateObj.year.toString() + + " " + + dateObj.hour.toString() + + ":" + + getMinute(dateObj); + } + + String getMinute(DateTime dateObj) { + if(dateObj.minute == 0) { + return dateObj.minute.toString() + "0"; + } else { + return dateObj.minute.toString(); + } + } + Future navigateToDoctorProfile(context, docObject, docProfile, {isAppo}) async { Navigator.push( diff --git a/lib/services/appointment_services/GetDoctorsList.dart b/lib/services/appointment_services/GetDoctorsList.dart index 61845095..c992e8e9 100644 --- a/lib/services/appointment_services/GetDoctorsList.dart +++ b/lib/services/appointment_services/GetDoctorsList.dart @@ -10,7 +10,6 @@ import 'package:diplomaticquarterapp/models/Request.dart'; import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; -import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:flutter/cupertino.dart'; class DoctorsListService extends BaseService { @@ -23,7 +22,8 @@ class DoctorsListService extends BaseService { double lat; double long; - Future getDoctorsList(int clinicID, int projectID, BuildContext context, + Future getDoctorsList( + int clinicID, int projectID, bool isNearest, BuildContext context, {doctorId}) async { //Utils.showProgressDialog(context); Map request; @@ -34,7 +34,8 @@ class DoctorsListService extends BaseService { authUser = data; } - if (await this.sharedPref.getDouble(USER_LAT) != null && await this.sharedPref.getDouble(USER_LONG) != null) { + 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); } @@ -62,6 +63,9 @@ class DoctorsListService extends BaseService { "IsGetNearAppointment": false, "Latitude": lat.toString(), "Longitude": long.toString(), + "IsGetNearAppointment": isNearest, + if (isNearest) + "SelectedDate": DateUtil.convertDateToString(DateTime.now()), "License": true }; @@ -88,7 +92,8 @@ class DoctorsListService extends BaseService { authUser = data; } - if (await this.sharedPref.getDouble(USER_LAT) != null && await this.sharedPref.getDouble(USER_LONG) != null) { + 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); } diff --git a/lib/widgets/others/bottom_bar.dart b/lib/widgets/others/bottom_bar.dart index 32df2dfc..d0fc01f6 100644 --- a/lib/widgets/others/bottom_bar.dart +++ b/lib/widgets/others/bottom_bar.dart @@ -312,7 +312,7 @@ class _SearchBot extends State { List doctorsList = []; DoctorsListService service = new DoctorsListService(); service - .getDoctorsList(clinicId, projectId, context, doctorId: doctorName) + .getDoctorsList(clinicId, projectId, false, context, doctorId: doctorName) .then((res) { if (res['MessageStatus'] == 1) { setState(() { From 3e5ef26b29225e83fd4a651c7a72f62bd6bc3695 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Thu, 3 Sep 2020 14:03:31 +0300 Subject: [PATCH 14/45] my appointment sorting implemented --- .../AppoimentAllHistoryResultList.dart | 10 + lib/pages/MyAppointments/MyAppointments.dart | 239 ++++++++++++++---- .../widgets/AppointmentCardView.dart | 4 +- 3 files changed, 207 insertions(+), 46 deletions(-) diff --git a/lib/models/Appointments/AppoimentAllHistoryResultList.dart b/lib/models/Appointments/AppoimentAllHistoryResultList.dart index a935542a..9ba1fb8e 100644 --- a/lib/models/Appointments/AppoimentAllHistoryResultList.dart +++ b/lib/models/Appointments/AppoimentAllHistoryResultList.dart @@ -272,3 +272,13 @@ class AppoitmentAllHistoryResultList { return data; } } + +class PatientAppointmentList { + String filterName = ""; + List patientDoctorAppointmentList = List(); + + PatientAppointmentList( + {this.filterName, AppoitmentAllHistoryResultList patientDoctorAppointment}) { + patientDoctorAppointmentList.add(patientDoctorAppointment); + } +} diff --git a/lib/pages/MyAppointments/MyAppointments.dart b/lib/pages/MyAppointments/MyAppointments.dart index 63034373..699990ac 100644 --- a/lib/pages/MyAppointments/MyAppointments.dart +++ b/lib/pages/MyAppointments/MyAppointments.dart @@ -4,6 +4,7 @@ import 'package:diplomaticquarterapp/pages/MyAppointments/widgets/AppointmentCar import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/material.dart'; import 'package:smart_progress_bar/smart_progress_bar.dart'; @@ -15,6 +16,13 @@ class MyAppointments extends StatefulWidget { List confirmedAppoList = []; List arrivedAppoList = []; + List _patientBookedAppointmentListHospital = List(); + + List _patientConfirmedAppointmentListHospital = + List(); + + List _patientArrivedAppointmentListHospital = List(); + @override _MyAppointmentsState createState() => _MyAppointmentsState(); } @@ -40,7 +48,6 @@ class _MyAppointmentsState extends State isShowAppBar: true, body: Container( child: Column(children: [ - /// this is will not colored with theme data TabBar( tabs: [ Tab(text: TranslationBase.of(context).booked), @@ -94,7 +101,8 @@ class _MyAppointmentsState extends State } }).catchError((err) { print(err); - }).showProgressBar(text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + }).showProgressBar( + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); } bool isConfirmed(AppoitmentAllHistoryResultList appo) { @@ -123,64 +131,176 @@ class _MyAppointmentsState extends State widget.arrivedAppoList.add(v); } }); + + widget.bookedAppoList.forEach((element) { + List doctorByHospital = + widget._patientBookedAppointmentListHospital + .where( + (elementClinic) => + elementClinic.filterName == element.clinicName, + ) + .toList(); + + if (doctorByHospital.length != 0) { + widget + ._patientBookedAppointmentListHospital[widget + ._patientBookedAppointmentListHospital + .indexOf(doctorByHospital[0])] + .patientDoctorAppointmentList + .add(element); + } else { + widget._patientBookedAppointmentListHospital.add(PatientAppointmentList( + filterName: element.clinicName, patientDoctorAppointment: element)); + } + }); + + widget.confirmedAppoList.forEach((element) { + List doctorByHospital = + widget._patientConfirmedAppointmentListHospital + .where( + (elementClinic) => + elementClinic.filterName == element.clinicName, + ) + .toList(); + + if (doctorByHospital.length != 0) { + widget + ._patientConfirmedAppointmentListHospital[widget + ._patientConfirmedAppointmentListHospital + .indexOf(doctorByHospital[0])] + .patientDoctorAppointmentList + .add(element); + } else { + widget._patientConfirmedAppointmentListHospital.add( + PatientAppointmentList( + filterName: element.clinicName, + patientDoctorAppointment: element)); + } + }); + + widget.arrivedAppoList.forEach((element) { + List doctorByHospital = + widget._patientArrivedAppointmentListHospital + .where( + (elementClinic) => + elementClinic.filterName == element.clinicName, + ) + .toList(); + + if (doctorByHospital.length != 0) { + widget + ._patientArrivedAppointmentListHospital[widget + ._patientArrivedAppointmentListHospital + .indexOf(doctorByHospital[0])] + .patientDoctorAppointmentList + .add(element); + } else { + widget._patientArrivedAppointmentListHospital.add( + PatientAppointmentList( + filterName: element.clinicName, + patientDoctorAppointment: element)); + } + }); } openAppointmentsTab() { if (widget.bookedAppoList.length != 0) { - _tabController.animateTo((_tabController.index + 1) % 1); + _tabController.index = 0; } else if (widget.confirmedAppoList.length != 0) { - _tabController.animateTo((_tabController.index + 1) % 2); + _tabController.index = 1; } else if (widget.arrivedAppoList.length != 0) { - _tabController.animateTo((_tabController.index + 1) % 3); + _tabController.index = 2; return; } } Widget getBookedAppointments() { return Container( - child: widget.bookedAppoList.length != 0 - ? new ListView.builder( - itemCount: widget.bookedAppoList.length, - itemBuilder: (context, i) { - return AppointmentCard( - appo: widget.bookedAppoList[i], - onReloadAppointmentHistory: getPatientAppointmentHistory, - ); - }, - ) - : Container( - child: Center( + margin: EdgeInsets.only(top: 10.0), + child: Container( + child: widget.bookedAppoList.length != 0 + ? SingleChildScrollView( + physics: BouncingScrollPhysics(), child: Column( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.center, children: [ - Image.asset( - "assets/images/new-design/noAppointmentIcon.png"), - Container( - margin: EdgeInsets.only(top: 10.0), - child: Text("No Booked Appointments", - style: TextStyle( - fontSize: 16.0, + ...List.generate( + widget._patientBookedAppointmentListHospital.length, + (index) => AppExpandableNotifier( + title: widget + ._patientBookedAppointmentListHospital[index] + .filterName, + bodyWidget: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: widget + ._patientBookedAppointmentListHospital[index] + .patientDoctorAppointmentList + .map((doctor) { + return AppointmentCard( + appo: doctor, + onReloadAppointmentHistory: + getPatientAppointmentHistory, + ); + }).toList(), )), - ), + ) ], ), + ) + : Container( + child: Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Image.asset( + "assets/images/new-design/noAppointmentIcon.png"), + Container( + margin: EdgeInsets.only(top: 10.0), + child: Text("No Booked Appointments", + style: TextStyle( + fontSize: 16.0, + )), + ), + ], + ), + ), ), - ), + ), ); } Widget getConfirmedAppointments() { return widget.confirmedAppoList.length != 0 ? Container( - child: new ListView.builder( - itemCount: widget.confirmedAppoList.length, - itemBuilder: (context, i) { - return AppointmentCard( - appo: widget.confirmedAppoList[i], - onReloadAppointmentHistory: getPatientAppointmentHistory, - ); - }, + margin: EdgeInsets.only(top: 10.0), + child: SingleChildScrollView( + physics: BouncingScrollPhysics(), + child: Column( + children: [ + ...List.generate( + widget._patientConfirmedAppointmentListHospital.length, + (index) => AppExpandableNotifier( + title: widget + ._patientConfirmedAppointmentListHospital[index] + .filterName, + bodyWidget: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: widget + ._patientConfirmedAppointmentListHospital[index] + .patientDoctorAppointmentList + .map((doctor) { + return AppointmentCard( + appo: doctor, + onReloadAppointmentHistory: + getPatientAppointmentHistory, + ); + }).toList(), + )), + ) + ], + ), ), ) : Container( @@ -206,16 +326,47 @@ class _MyAppointmentsState extends State Widget getArrivedAppointments() { return widget.arrivedAppoList.length != 0 ? Container( - child: new ListView.builder( - itemCount: widget.arrivedAppoList.length, - itemBuilder: (context, i) { - return AppointmentCard( - appo: widget.arrivedAppoList[i], - onReloadAppointmentHistory: getPatientAppointmentHistory, - ); - }, + margin: EdgeInsets.only(top: 10.0), + child: SingleChildScrollView( + physics: BouncingScrollPhysics(), + child: Column( + children: [ + ...List.generate( + widget._patientArrivedAppointmentListHospital.length, + (index) => AppExpandableNotifier( + title: widget + ._patientArrivedAppointmentListHospital[index] + .filterName, + bodyWidget: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: widget + ._patientArrivedAppointmentListHospital[index] + .patientDoctorAppointmentList + .map((doctor) { + return AppointmentCard( + appo: doctor, + onReloadAppointmentHistory: + getPatientAppointmentHistory, + ); + }).toList(), + )), + ) + ], + ), ), ) +// Container( +// child: new ListView.builder( +// itemCount: widget.arrivedAppoList.length, +// itemBuilder: (context, i) { +// return AppointmentCard( +// appo: widget.arrivedAppoList[i], +// onReloadAppointmentHistory: getPatientAppointmentHistory, +// ); +// }, +// ), +// ) : Container( child: Center( child: Column( diff --git a/lib/pages/MyAppointments/widgets/AppointmentCardView.dart b/lib/pages/MyAppointments/widgets/AppointmentCardView.dart index e2f6f706..b64bd232 100644 --- a/lib/pages/MyAppointments/widgets/AppointmentCardView.dart +++ b/lib/pages/MyAppointments/widgets/AppointmentCardView.dart @@ -42,7 +42,7 @@ class _ApointmentCardState extends State { fit: BoxFit.fill, height: 60.0, width: 60.0), ), Container( - width: MediaQuery.of(context).size.width * 0.6, + width: MediaQuery.of(context).size.width * 0.57, margin: EdgeInsets.fromLTRB(20.0, 10.0, 10.0, 0.0), child: Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -95,7 +95,7 @@ class _ApointmentCardState extends State { emptyIcon: Icons.star, ), Container( - transform: Matrix4.translationValues(0.0, -40.0, 0.0), + transform: Matrix4.translationValues(15.0, -40.0, 0.0), child: Image.asset( "assets/images/new-design/arrow.png", width: 25.0, From e909c16b805f8c5dada92fb55d486c341e383595 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Thu, 3 Sep 2020 15:10:25 +0300 Subject: [PATCH 15/45] ER --- lib/pages/ErService/NearestEr.dart | 144 +++++++++++++++++++++++++++++ 1 file changed, 144 insertions(+) create mode 100644 lib/pages/ErService/NearestEr.dart diff --git a/lib/pages/ErService/NearestEr.dart b/lib/pages/ErService/NearestEr.dart new file mode 100644 index 00000000..eba0dd4f --- /dev/null +++ b/lib/pages/ErService/NearestEr.dart @@ -0,0 +1,144 @@ +import 'package:diplomaticquarterapp/uitl/location_util.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import '../../uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/pages/ErService/widgets/card_common.dart'; +class NearestEr extends StatefulWidget { + final bool isAppbar; + + const NearestEr({Key key, this.isAppbar}) : super(key: key); + @override + _NearestErState createState() => _NearestErState(); +} + +class _NearestErState extends State { + LocationUtils locationUtils; + @override + void initState() { + locationUtils = + new LocationUtils(isShowConfirmDialog: true, context: context); + WidgetsBinding.instance + .addPostFrameCallback((_) => locationUtils.getCurrentLocation()); + + super.initState(); + } + @override + Widget build(BuildContext context) { + return AppScaffold( + isShowAppBar: widget.isAppbar, + appBarTitle: TranslationBase.of(context).bookAppo, + body: Container( + margin: EdgeInsets.fromLTRB(10.0, 20.0, 10.0, 10.0), + child: ListView( + + children: [ + Text(TranslationBase.of(context).searchBy, + style: TextStyle( + fontSize: 24.0, + letterSpacing: 1.0, + fontWeight: FontWeight.bold, + color: new Color(0xFF60686b))), + 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: CardCommonEr( + image: 'assets/images/new-design/find_us_icon.png', + text: TranslationBase.of(context).ambulancerequest, + subText: TranslationBase.of(context).requestA, + type: 0, + ), + flex: 0, + ), + Expanded( + child: CardCommonEr( + image: 'assets/images/new-design/find_us_icon.png', + text: TranslationBase.of(context).nearester, + subText: TranslationBase.of(context).locationa, + type: 1), + flex: 0, + + ) + ], + ), + Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Expanded( + child: CardCommonEr( + image: 'assets/images/new-design/find_us_icon.png', + text: TranslationBase.of(context).ambulancerequest, + subText: TranslationBase.of(context).requestA, + type: 0, + ), + flex: 0, + ), + Expanded( + child: CardCommonEr( + image: 'assets/images/new-design/find_us_icon.png', + text: TranslationBase.of(context).nearester, + subText: TranslationBase.of(context).locationa, + type: 1), + flex: 0, + ) + ], + ), + Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Expanded( + child: CardCommonEr( + image: 'assets/images/new-design/find_us_icon.png', + text: TranslationBase.of(context).ambulancerequest, + subText: TranslationBase.of(context).requestA, + type: 0, + ), + flex: 0, + ), + Expanded( + child: CardCommonEr( + image: 'assets/images/new-design/find_us_icon.png', + text: TranslationBase.of(context).nearester, + subText: TranslationBase.of(context).locationa, + type: 1), + flex: 0, + + ) + ], + ), + Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Expanded( + child: CardCommonEr( + image: 'assets/images/new-design/find_us_icon.png', + text: TranslationBase.of(context).ambulancerequest, + subText: TranslationBase.of(context).requestA, + type: 0, + + ), + flex: 0, + ), + + ], + ), + ], + ) + ), + ], + ), + ), + ); + } +} From e254261ef91ebec6c9ea58d43f9b94bc18894b4c Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Sun, 6 Sep 2020 09:48:55 +0300 Subject: [PATCH 16/45] ER --- lib/pages/ErService/AmbulanceReq.dart | 0 lib/pages/ErService/ErOptions.dart | 15 ++-- lib/pages/ErService/NearestEr.dart | 19 +++-- lib/pages/ErService/widgets/card_common.dart | 16 ++++ .../ErService/widgets/card_position.dart | 83 +++++++++++++++++++ 5 files changed, 118 insertions(+), 15 deletions(-) create mode 100644 lib/pages/ErService/AmbulanceReq.dart create mode 100644 lib/pages/ErService/widgets/card_position.dart diff --git a/lib/pages/ErService/AmbulanceReq.dart b/lib/pages/ErService/AmbulanceReq.dart new file mode 100644 index 00000000..e69de29b diff --git a/lib/pages/ErService/ErOptions.dart b/lib/pages/ErService/ErOptions.dart index 33de54b9..2d22f262 100644 --- a/lib/pages/ErService/ErOptions.dart +++ b/lib/pages/ErService/ErOptions.dart @@ -1,6 +1,6 @@ import 'package:diplomaticquarterapp/uitl/location_util.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; -//import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; + import 'package:flutter/material.dart'; import '../../uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/pages/ErService/widgets/card_common.dart'; @@ -37,12 +37,12 @@ class _ErOptionsState extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Text(TranslationBase.of(context).searchBy, - style: TextStyle( - fontSize: 24.0, - letterSpacing: 1.0, - fontWeight: FontWeight.bold, - color: new Color(0xFF60686b))), +// Text(TranslationBase.of(context).searchBy, +// style: TextStyle( +// fontSize: 24.0, +// letterSpacing: 1.0, +// fontWeight: FontWeight.bold, +// color: new Color(0xFF60686b))), Container( margin: EdgeInsets.fromLTRB(0.0, 10.0, 0.0, 10.0), child: Row( @@ -63,6 +63,7 @@ class _ErOptionsState extends State { text: TranslationBase.of(context).nearester, subText: TranslationBase.of(context).locationa, type: 1), + ) ], ), diff --git a/lib/pages/ErService/NearestEr.dart b/lib/pages/ErService/NearestEr.dart index eba0dd4f..ddd3d74d 100644 --- a/lib/pages/ErService/NearestEr.dart +++ b/lib/pages/ErService/NearestEr.dart @@ -4,6 +4,8 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import '../../uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/pages/ErService/widgets/card_common.dart'; +import 'widgets/card_position.dart'; + class NearestEr extends StatefulWidget { final bool isAppbar; @@ -50,16 +52,17 @@ class _NearestErState extends State { mainAxisAlignment: MainAxisAlignment.center, children: [ Expanded( - child: CardCommonEr( - image: 'assets/images/new-design/find_us_icon.png', + child: CardPosition( text: TranslationBase.of(context).ambulancerequest, + image: 'assets/images/new-design/find_us_icon.png', + subText: TranslationBase.of(context).requestA, type: 0, ), flex: 0, ), Expanded( - child: CardCommonEr( + child: CardPosition( image: 'assets/images/new-design/find_us_icon.png', text: TranslationBase.of(context).nearester, subText: TranslationBase.of(context).locationa, @@ -74,7 +77,7 @@ class _NearestErState extends State { mainAxisAlignment: MainAxisAlignment.center, children: [ Expanded( - child: CardCommonEr( + child: CardPosition( image: 'assets/images/new-design/find_us_icon.png', text: TranslationBase.of(context).ambulancerequest, subText: TranslationBase.of(context).requestA, @@ -83,7 +86,7 @@ class _NearestErState extends State { flex: 0, ), Expanded( - child: CardCommonEr( + child: CardPosition( image: 'assets/images/new-design/find_us_icon.png', text: TranslationBase.of(context).nearester, subText: TranslationBase.of(context).locationa, @@ -97,7 +100,7 @@ class _NearestErState extends State { mainAxisAlignment: MainAxisAlignment.center, children: [ Expanded( - child: CardCommonEr( + child: CardPosition( image: 'assets/images/new-design/find_us_icon.png', text: TranslationBase.of(context).ambulancerequest, subText: TranslationBase.of(context).requestA, @@ -106,7 +109,7 @@ class _NearestErState extends State { flex: 0, ), Expanded( - child: CardCommonEr( + child: CardPosition( image: 'assets/images/new-design/find_us_icon.png', text: TranslationBase.of(context).nearester, subText: TranslationBase.of(context).locationa, @@ -121,7 +124,7 @@ class _NearestErState extends State { mainAxisAlignment: MainAxisAlignment.center, children: [ Expanded( - child: CardCommonEr( + child: CardPosition( image: 'assets/images/new-design/find_us_icon.png', text: TranslationBase.of(context).ambulancerequest, subText: TranslationBase.of(context).requestA, diff --git a/lib/pages/ErService/widgets/card_common.dart b/lib/pages/ErService/widgets/card_common.dart index 124c73c4..4d652542 100644 --- a/lib/pages/ErService/widgets/card_common.dart +++ b/lib/pages/ErService/widgets/card_common.dart @@ -1,6 +1,9 @@ //import 'package:diplomaticquarterapp/pages/BookAppointment/Search.dart'; +import 'package:diplomaticquarterapp/pages/BookAppointment/Search.dart'; import 'package:flutter/material.dart'; +import '../NearestEr.dart'; + class CardCommonEr extends StatelessWidget { final image; final text; @@ -17,6 +20,7 @@ class CardCommonEr extends StatelessWidget { return GestureDetector( onTap: () { navigateToSearch(context, this.type); + print("=============this.type============="+this.type); }, child: Container( margin: EdgeInsets.fromLTRB(9.0, 9.0, 9.0, 9.0), @@ -54,6 +58,18 @@ class CardCommonEr extends StatelessWidget { } Future navigateToSearch(context, type) async { +//===Switch case=== + if(type==0) + {print("========Ambalunce=========");} + else{ + print("=========Nearest ER==========="); + + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => NearestEr(isAppbar: true,))); + + } // Navigator.push( // context, // MaterialPageRoute( diff --git a/lib/pages/ErService/widgets/card_position.dart b/lib/pages/ErService/widgets/card_position.dart new file mode 100644 index 00000000..37766467 --- /dev/null +++ b/lib/pages/ErService/widgets/card_position.dart @@ -0,0 +1,83 @@ +//import 'package:diplomaticquarterapp/pages/BookAppointment/Search.dart'; +import 'package:diplomaticquarterapp/pages/BookAppointment/Search.dart'; +import 'package:flutter/material.dart'; + +import '../NearestEr.dart'; + +class CardPosition extends StatelessWidget { + final image; + final text; + final subText; + final type; + const CardPosition( + { + @required this.image, + @required this.text, + @required this.subText, + @required this.type}); + + @override + Widget build(BuildContext context) { + return GestureDetector( + onTap: () { + navigateToSearch(context, this.type); + print("=============this.type============="+this.type); + }, + child: Container( + margin: EdgeInsets.fromLTRB(9.0, 9.0, 9.0, 9.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), + child: Text(this.text, + overflow: TextOverflow.clip, + style: TextStyle( + color: new Color(0xFFc5272d), + letterSpacing: 1.0, + fontSize: 20.0)), + ), + Container( + 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), + ), + Container( + margin: EdgeInsets.fromLTRB(10.0, 0.0, 10.0, 0.0), + child: Text(this.subText, + overflow: TextOverflow.clip, + style: TextStyle( + color: Colors.black, letterSpacing: 1.0, fontSize: 15.0)), + ), + + ], + ), + ), + ); + } + + Future navigateToSearch(context, type) async { +//===Switch case=== + if(type==0) + {print("========Ambalunce=========");} + else{ + print("=========Nearest ER==========="); + + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => NearestEr(isAppbar: true,))); + + } +// Navigator.push( +// context, +// MaterialPageRoute( +// builder: (context) => Search( +// type: type, +// ))); + } +} + From db79f299b6ec043b8f37ef0d37c9105cfe08cdcf Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Sun, 6 Sep 2020 10:49:39 +0300 Subject: [PATCH 17/45] ER --- lib/pages/ErService/NearestEr.dart | 28 +++++++++---------- lib/pages/ErService/widgets/card_common.dart | 12 +++++--- .../ErService/widgets/card_position.dart | 16 +++++++---- 3 files changed, 32 insertions(+), 24 deletions(-) diff --git a/lib/pages/ErService/NearestEr.dart b/lib/pages/ErService/NearestEr.dart index ddd3d74d..16eb0f4c 100644 --- a/lib/pages/ErService/NearestEr.dart +++ b/lib/pages/ErService/NearestEr.dart @@ -53,20 +53,20 @@ class _NearestErState extends State { children: [ Expanded( child: CardPosition( - text: TranslationBase.of(context).ambulancerequest, + text: "Olaya Hospital", image: 'assets/images/new-design/find_us_icon.png', subText: TranslationBase.of(context).requestA, - type: 0, + type: 3, ), flex: 0, ), Expanded( child: CardPosition( image: 'assets/images/new-design/find_us_icon.png', - text: TranslationBase.of(context).nearester, + text: "Takhassusi Hospital", subText: TranslationBase.of(context).locationa, - type: 1), + type: 5), flex: 0, ) @@ -79,18 +79,18 @@ class _NearestErState extends State { Expanded( child: CardPosition( image: 'assets/images/new-design/find_us_icon.png', - text: TranslationBase.of(context).ambulancerequest, + text: "Arryan Hospital", subText: TranslationBase.of(context).requestA, - type: 0, + type: 4, ), flex: 0, ), Expanded( child: CardPosition( image: 'assets/images/new-design/find_us_icon.png', - text: TranslationBase.of(context).nearester, + text: "Suwaidi Hospital", subText: TranslationBase.of(context).locationa, - type: 1), + type: 6), flex: 0, ) ], @@ -102,18 +102,18 @@ class _NearestErState extends State { Expanded( child: CardPosition( image: 'assets/images/new-design/find_us_icon.png', - text: TranslationBase.of(context).ambulancerequest, + text: "Al Qassim Hospital", subText: TranslationBase.of(context).requestA, - type: 0, + type: 7, ), flex: 0, ), Expanded( child: CardPosition( image: 'assets/images/new-design/find_us_icon.png', - text: TranslationBase.of(context).nearester, + text: "Khobar Hospital", subText: TranslationBase.of(context).locationa, - type: 1), + type: 8), flex: 0, ) @@ -126,9 +126,9 @@ class _NearestErState extends State { Expanded( child: CardPosition( image: 'assets/images/new-design/find_us_icon.png', - text: TranslationBase.of(context).ambulancerequest, + text: "Dubai Hospital", subText: TranslationBase.of(context).requestA, - type: 0, + type: 1, ), flex: 0, diff --git a/lib/pages/ErService/widgets/card_common.dart b/lib/pages/ErService/widgets/card_common.dart index 4d652542..f59df83c 100644 --- a/lib/pages/ErService/widgets/card_common.dart +++ b/lib/pages/ErService/widgets/card_common.dart @@ -1,5 +1,6 @@ //import 'package:diplomaticquarterapp/pages/BookAppointment/Search.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/Search.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; import '../NearestEr.dart'; @@ -64,12 +65,15 @@ class CardCommonEr extends StatelessWidget { else{ print("=========Nearest ER==========="); - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => NearestEr(isAppbar: true,))); + Navigator.push( + context, + + FadePage( + page: NearestEr(isAppbar: true,))); } + + // Navigator.push( // context, // MaterialPageRoute( diff --git a/lib/pages/ErService/widgets/card_position.dart b/lib/pages/ErService/widgets/card_position.dart index 37766467..e5241772 100644 --- a/lib/pages/ErService/widgets/card_position.dart +++ b/lib/pages/ErService/widgets/card_position.dart @@ -1,5 +1,7 @@ //import 'package:diplomaticquarterapp/pages/BookAppointment/Search.dart'; +import 'package:diplomaticquarterapp/config/size_config.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/Search.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; import '../NearestEr.dart'; @@ -24,7 +26,7 @@ class CardPosition extends StatelessWidget { print("=============this.type============="+this.type); }, child: Container( - margin: EdgeInsets.fromLTRB(9.0, 9.0, 9.0, 9.0), + margin: EdgeInsets.fromLTRB(7.0, 7.0, 7.0, 7.0), decoration: BoxDecoration(boxShadow: [ BoxShadow(color: Colors.grey[400], blurRadius: 2.0, spreadRadius: 0.0) ], borderRadius: BorderRadius.circular(10), color: Colors.white), @@ -36,9 +38,9 @@ class CardPosition extends StatelessWidget { child: Text(this.text, overflow: TextOverflow.clip, style: TextStyle( - color: new Color(0xFFc5272d), + color: Colors.black, letterSpacing: 1.0, - fontSize: 20.0)), + fontSize: 2 * SizeConfig.textMultiplier)), ), Container( alignment: Alignment.center, @@ -50,7 +52,7 @@ class CardPosition extends StatelessWidget { child: Text(this.subText, overflow: TextOverflow.clip, style: TextStyle( - color: Colors.black, letterSpacing: 1.0, fontSize: 15.0)), + color: Color(0xFFc5272d), letterSpacing: 1.0, fontSize: 15.0)), ), ], @@ -68,10 +70,12 @@ class CardPosition extends StatelessWidget { Navigator.push( context, - MaterialPageRoute( - builder: (context) => NearestEr(isAppbar: true,))); + + FadePage( + page: NearestEr(isAppbar: true,))); } + //NearestEr(isAppbar: true,) // Navigator.push( // context, // MaterialPageRoute( From fe66ee59937cc3a1bd55f33c14977866e998e5f1 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Mon, 7 Sep 2020 09:27:34 +0300 Subject: [PATCH 18/45] fix lab result issues --- android/build.gradle | 2 +- .../gradle/wrapper/gradle-wrapper.properties | 4 +- assets/images/report.jpg | Bin 0 -> 37509 bytes lib/config/config.dart | 4 +- lib/config/localized_values.dart | 1 + lib/core/model/labs/lab_result.dart | 88 +++++++ lib/core/service/client/base_app_client.dart | 2 +- lib/core/service/insurance_service.dart | 41 +++- lib/core/service/medical/labs_service.dart | 23 ++ .../medical/reports_monthly_service.dart | 83 +++++++ .../viewModels/insurance_card_View_model.dart | 15 +- .../viewModels/medical/labs_view_model.dart | 23 +- .../medical/reports_monthly_view_model.dart | 84 +++++++ lib/locator.dart | 4 + .../insurance/insurance_update_screen.dart | 130 +++++----- lib/pages/landing/landing_page.dart | 15 +- .../medical/labs/laboratory_result_page.dart | 4 +- lib/pages/medical/medical_profile_page.dart | 2 +- .../medical/reports/monthly_reports.dart | 18 ++ lib/uitl/translations_delegate_base.dart | 1 + .../medical/laboratory_result_widget.dart | 228 +++++++++++++++++- lib/widgets/others/app_scaffold_widget.dart | 2 +- pubspec.yaml | 2 +- 23 files changed, 679 insertions(+), 97 deletions(-) create mode 100644 assets/images/report.jpg create mode 100644 lib/core/model/labs/lab_result.dart create mode 100644 lib/core/service/medical/reports_monthly_service.dart create mode 100644 lib/core/viewModels/medical/reports_monthly_view_model.dart create mode 100644 lib/pages/medical/reports/monthly_reports.dart diff --git a/android/build.gradle b/android/build.gradle index e2e8a05f..8e56476b 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -6,7 +6,7 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:3.4.2' + classpath 'com.android.tools.build:gradle:4.0.1' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath 'com.google.gms:google-services:4.3.2' } diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties index 296b146b..5660070d 100644 --- a/android/gradle/wrapper/gradle-wrapper.properties +++ b/android/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Fri Jun 23 08:50:38 CEST 2017 +#Thu Sep 03 16:26:30 EEST 2020 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip diff --git a/assets/images/report.jpg b/assets/images/report.jpg new file mode 100644 index 0000000000000000000000000000000000000000..5846cd538dec27f12011b3de3ecfbdae4d411f29 GIT binary patch literal 37509 zcmdpdWmH^EwrJx{Xj}s{(6}_N!QI^hbT{tq3GVJ5f+e_X2*I_H;GWgVj{Z0%)5 z=jZI?;wkDU0s0fU=wtnlW^NGOpIy8hB|y@DP^B|c*P@ek^{}QB;1cA7@dygh35jq) z1cZe6g*fPVc_0GZJbc`IJe<6IqWnCf{JeC3FQ7+i9&j5`9XW-+(|UZ80R3GkUteD? zUp_8Z4_j`Ch=>R`4=*<_FXv+qPEUUqFDpMz7f*)2FvwYZ!aVHVyzE_F=>EWH1$FiI zk^nt&`Zp1r-Ts00-|Fh0I;yMx&t09J|4_i6Xg$4jtpAJOe~Z{t&)?0OTgTed)!PGR z{n(x14`4S@Sr2O~FINveS68RMw5Vn0>gDQb=jui$EBmL`=vWNxUEr?1o~(busH=-A zyLft8xxlQI>uXf?Dj}m&f3G?#~QBS;p$BHr`V$Q|B)A2`TvOT@38Ry z$cwDPe}v_JWQO~X!TqPf{;TQHg8r!f!*m}X{$c#qE{_)P@o3r)X8`;^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cRpD5Qb zu}3wOo0arJU>^jZs(twMu`+}$(Nf&6e*pV+`Z=1c6fP~Z`?Bs0i8`nj9&{N=XSwCk z)j8WxY*=GA899bZ9fnKLZHq?|6hRX45t@GQsg*07g42d5-U32Su1k}4InrrxsOuv; z;Jc5g?7=*#dZI{g>507fE&?-^6>{n(MWMV!XW$!7TJ0U07%knc%1+yh;9D`xAdUuavxGv>iq!gsw2n35DcTzx$G&@=-IH_uUsL4QdQWz~n*gd1H6ri6Ys znPA~>!%Mw1&ts_?FkJ35cMPkSkCoN>kb&(VM?oZSxms?W@SY}WLYlkAVsY(wm7pHZD(>${Y)VK z$%|*}B-l!yU&Iz*`sqZ$^t@9)Au>mCBQMrbA}elq^kbm|gh$LY>qnnH%^9m@%(NA7 zwt4+}-w9taxVbJqs0$;TAjMPe(d8}QFo`E5Oh*$ma}sCH_#T3l?$DUUV9s4@t@G~J zHAJ~ueyNl?oxK20CWU1gI|7OaP`0dFrxnT~3?fMpeC%Qg%hJ(RFoo&1$ck#v?-F9` z*R^ZzYnx^dPu2;Bd69MG;REc56JIG-D%>=V=VvxDZxY37&zVFl_)yz4eaDp4t$iI~ zN1hx39aO>I<)YRqn$4fgJt?SY=kdW`yv%Tz>4K$FC^}*rF@O{nxM&jy20wm#KS8(_ z(YCt5A(+XP%d(ReG7!Mh?t-x-(-78!@_%i=exB|k_U_uWwn literal 0 HcmV?d00001 diff --git a/lib/config/config.dart b/lib/config/config.dart index 956a2315..fc636ceb 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -28,8 +28,8 @@ const GET_PRESCRIPTION_REPORT_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 GET_Patient_LAB_SPECIAL_RESULT = 'Services/Patients.svc/REST/GetPatientLabSpecialResults'; +const GET_Patient_LAB_RESULT = '/Services/Patients.svc/REST/GetPatientLabResults'; /// const GET_PATIENT_ORDERS = 'Services/Patients.svc/REST/GetPatientRadOrders'; diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 903943ef..ddd98917 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -448,4 +448,5 @@ const Map> localizedValues = { "OrderNo": {"en": "Order No", "ar": "رقم الطلب"}, "OrderDetails": {"en": "Order Details", "ar": "تفاصيل الطلب"}, "VitalSign": {"en": "Vital Sign", "ar": "العلامة حيوية"}, + "MonthlyReports": {"en": "Monthly Reports", "ar": "تقارير شهرية"}, }; diff --git a/lib/core/model/labs/lab_result.dart b/lib/core/model/labs/lab_result.dart new file mode 100644 index 00000000..23b3363d --- /dev/null +++ b/lib/core/model/labs/lab_result.dart @@ -0,0 +1,88 @@ +class LabResult { + String description; + Null femaleInterpretativeData; + int gender; + int lineItemNo; + Null maleInterpretativeData; + String notes; + String packageID; + int patientID; + String projectID; + String referanceRange; + String resultValue; + String sampleCollectedOn; + String sampleReceivedOn; + String setupID; + Null superVerifiedOn; + String testCode; + String uOM; + String verifiedOn; + Null verifiedOnDateTime; + + LabResult( + {this.description, + this.femaleInterpretativeData, + this.gender, + this.lineItemNo, + this.maleInterpretativeData, + this.notes, + this.packageID, + this.patientID, + this.projectID, + this.referanceRange, + this.resultValue, + this.sampleCollectedOn, + this.sampleReceivedOn, + this.setupID, + this.superVerifiedOn, + this.testCode, + this.uOM, + this.verifiedOn, + this.verifiedOnDateTime}); + + LabResult.fromJson(Map json) { + description = json['Description']; + femaleInterpretativeData = json['FemaleInterpretativeData']; + gender = json['Gender']; + lineItemNo = json['LineItemNo']; + maleInterpretativeData = json['MaleInterpretativeData']; + notes = json['Notes']; + packageID = json['PackageID']; + patientID = json['PatientID']; + projectID = json['ProjectID']; + referanceRange = json['ReferanceRange']; + resultValue = json['ResultValue']; + sampleCollectedOn = json['SampleCollectedOn']; + sampleReceivedOn = json['SampleReceivedOn']; + setupID = json['SetupID']; + superVerifiedOn = json['SuperVerifiedOn']; + testCode = json['TestCode']; + uOM = json['UOM']; + verifiedOn = json['VerifiedOn']; + verifiedOnDateTime = json['VerifiedOnDateTime']; + } + + Map toJson() { + final Map data = new Map(); + data['Description'] = this.description; + data['FemaleInterpretativeData'] = this.femaleInterpretativeData; + data['Gender'] = this.gender; + data['LineItemNo'] = this.lineItemNo; + data['MaleInterpretativeData'] = this.maleInterpretativeData; + data['Notes'] = this.notes; + data['PackageID'] = this.packageID; + data['PatientID'] = this.patientID; + data['ProjectID'] = this.projectID; + data['ReferanceRange'] = this.referanceRange; + data['ResultValue'] = this.resultValue; + data['SampleCollectedOn'] = this.sampleCollectedOn; + data['SampleReceivedOn'] = this.sampleReceivedOn; + data['SetupID'] = this.setupID; + data['SuperVerifiedOn'] = this.superVerifiedOn; + data['TestCode'] = this.testCode; + data['UOM'] = this.uOM; + data['VerifiedOn'] = this.verifiedOn; + data['VerifiedOnDateTime'] = this.verifiedOnDateTime; + return data; + } +} diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index efb168c8..aa48c49d 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -31,7 +31,7 @@ class BaseAppClient { //Map profile = await sharedPref.getObj(DOCTOR_PROFILE); String token = await sharedPref.getString(TOKEN); var languageID = - await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'en'); var user = await sharedPref.getObject(USER_PROFILE); body['SetupID'] = body.containsKey('SetupID') ? body['SetupID'] != null ? body['SetupID'] : SETUP_ID diff --git a/lib/core/service/insurance_service.dart b/lib/core/service/insurance_service.dart index 8850e953..7fee6615 100644 --- a/lib/core/service/insurance_service.dart +++ b/lib/core/service/insurance_service.dart @@ -1,8 +1,13 @@ import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/core/model/insurance/insurance_approval.dart'; import 'package:diplomaticquarterapp/core/model/insurance/insurance_card.dart'; import 'package:diplomaticquarterapp/core/model/insurance/insurance_card_update.dart'; import 'package:diplomaticquarterapp/core/service/base_service.dart'; +import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart'; +import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordsByStatusReq.dart'; +import 'package:diplomaticquarterapp/services/family_files/family_files_provider.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; class InsuranceCardService extends BaseService { List _cardList = List(); @@ -15,6 +20,9 @@ class InsuranceCardService extends BaseService { List get insuranceApproval => _insuranceApproval; + GetAllSharedRecordsByStatusResponse getAllSharedRecordsByStatusResponse = + GetAllSharedRecordsByStatusResponse(); + clearInsuranceCard() { _cardList.clear(); } @@ -101,7 +109,7 @@ class InsuranceCardService extends BaseService { Future getInsuranceApproval({int appointmentNo}) async { hasError = false; // _cardList.clear(); - if(appointmentNo != null) { + if (appointmentNo != null) { _insuranceApprovalModel.appointmentNo = appointmentNo; _insuranceApprovalModel.eXuldAPPNO = null; _insuranceApprovalModel.projectID = null; @@ -124,4 +132,35 @@ class InsuranceCardService extends BaseService { super.error = error; }, body: _insuranceApprovalModel.toJson()); } + + Future getFamilyFiles() async { + var myFamily = await sharedPref.getObject(FAMILY_FILE); + if (myFamily != null) { + getAllSharedRecordsByStatusResponse = + GetAllSharedRecordsByStatusResponse.fromJson(myFamily); + } else { + getSharedRecordByStatus(); + } + } + + Future getSharedRecordByStatus() async { + try { + dynamic localRes; + var request = GetAllSharedRecordsByStatusReq(); + request.status = 0; + await baseAppClient.post(GET_SHARED_RECORD_BY_STATUS, + onSuccess: (dynamic response, int statusCode) { + localRes = response; + }, onFailure: (String error, int statusCode) { + AppToast.showErrorToast(message: error); + throw error; + }, body: request.toJson()); + sharedPref.setObject(FAMILY_FILE, localRes); + getAllSharedRecordsByStatusResponse = + GetAllSharedRecordsByStatusResponse.fromJson(localRes); + } catch (error) { + print(error); + throw error; + } + } } diff --git a/lib/core/service/medical/labs_service.dart b/lib/core/service/medical/labs_service.dart index 98f8110e..c1ad65f3 100644 --- a/lib/core/service/medical/labs_service.dart +++ b/lib/core/service/medical/labs_service.dart @@ -1,4 +1,5 @@ import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/core/model/labs/lab_result.dart'; import 'package:diplomaticquarterapp/core/model/labs/patient_lab_orders.dart'; import 'package:diplomaticquarterapp/core/model/labs/patient_lab_special_result.dart'; import 'package:diplomaticquarterapp/core/model/labs/request_patient_lab_orders.dart'; @@ -28,6 +29,7 @@ class LabsService extends BaseService { RequestPatientLabSpecialResult(); List patientLabSpecialResult = List(); + List labResultList = List(); Future getLaboratoryResult( {String projectID, @@ -52,6 +54,27 @@ class LabsService extends BaseService { }, body: _requestPatientLabSpecialResult.toJson()); } + Future getPatientLabResult({PatientLabOrders patientLabOrder}) async { + hasError = false; + Map body = Map(); + body['InvoiceNo'] = patientLabOrder.invoiceNo; + body['OrderNo'] = patientLabOrder.orderNo; + body['Procedure'] = "U/A"; + body['ProjectID'] = patientLabOrder.projectID; + body['ClinicID'] = patientLabOrder.clinicID; + //TODO Check the res + await baseAppClient.post(GET_Patient_LAB_RESULT, + onSuccess: (dynamic response, int statusCode) { + patientLabSpecialResult.clear(); + response['ListPLR'].forEach((lab) { + labResultList.add(LabResult.fromJson(lab)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } + RequestSendLabReportEmail _requestSendLabReportEmail = RequestSendLabReportEmail(); diff --git a/lib/core/service/medical/reports_monthly_service.dart b/lib/core/service/medical/reports_monthly_service.dart new file mode 100644 index 00000000..5e643669 --- /dev/null +++ b/lib/core/service/medical/reports_monthly_service.dart @@ -0,0 +1,83 @@ +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/core/model/reports/Reports.dart'; +import 'package:diplomaticquarterapp/core/model/reports/request_reports.dart'; +import 'package:diplomaticquarterapp/core/service/base_service.dart'; +import 'package:diplomaticquarterapp/pages/feedback/appointment_history.dart'; + +class ReportsMonthlyService extends BaseService { + List reportsList = List(); + List appointHistoryList = List(); + + RequestReports _requestReports = RequestReports( + isReport: true, + encounterType: 1, + requestType: 1, + versionID: 5.5, + channel: 3, + languageID: 2, + iPAdress: "10.20.10.20", + generalid: 'Cs2020@2016\$2958', + patientOutSA: 0, + sessionID: 'KIbLoqkytuKJEWECHQ', + isDentalAllowedBackend: false, + deviceTypeID: 2, + patientID: 1231755, + tokenID: '@dm!n', + patientTypeID: 1, + patientType: 1); + + Future getReports() async { + hasError = false; + await baseAppClient.post(REPORTS, + onSuccess: (dynamic response, int statusCode) { + reportsList.clear(); + response['GetPatientMedicalStatus'].forEach((reports) { + reportsList.add(Reports.fromJson(reports)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: _requestReports.toJson()); + } + + Future getPatentAppointmentHistory() async { + hasError = false; + Map body = new Map(); + body['IsForMedicalReport'] = true; + await baseAppClient.post(GET_PATIENT_AppointmentHistory, + onSuccess: (dynamic response, int statusCode) { + appointHistoryList = []; + response['AppoimentAllHistoryResultList'].forEach((appoint) { + appointHistoryList.add(AppointmentHistory.fromJson(appoint)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } + + Future insertRequestForMedicalReport( + AppointmentHistory appointmentHistory) async { + Map body = new Map(); + body['ClinicID'] = appointmentHistory.clinicID; + body['DoctorID'] = appointmentHistory.doctorID; + body['SetupID'] = appointmentHistory.setupID; + body['EncounterNo'] = appointmentHistory.appointmentNo; + body['EncounterType'] = 1;// appointmentHistory.appointmentType; + body['IsActive'] = appointmentHistory.isActiveDoctor; + body['ProjectID'] = appointmentHistory.projectID; + body['Remarks'] = ""; + body['ProcedureId'] = ""; + body['RequestType'] = 1; + body['Source'] = 2; + body['Status'] = 1; + body['CreatedBy'] = 102; + hasError = false; + await baseAppClient.post(INSERT_REQUEST_FOR_MEDICAL_REPORT, + onSuccess: (dynamic response, int statusCode) {}, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } +} diff --git a/lib/core/viewModels/insurance_card_View_model.dart b/lib/core/viewModels/insurance_card_View_model.dart index a6975360..e99a53f6 100644 --- a/lib/core/viewModels/insurance_card_View_model.dart +++ b/lib/core/viewModels/insurance_card_View_model.dart @@ -3,6 +3,7 @@ import 'package:diplomaticquarterapp/core/model/insurance/insurance_approval.dar import 'package:diplomaticquarterapp/core/model/insurance/insurance_card.dart'; import 'package:diplomaticquarterapp/core/model/insurance/insurance_card_update.dart'; import 'package:diplomaticquarterapp/core/service/insurance_service.dart'; +import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart'; import '../../locator.dart'; import 'base_view_model.dart'; @@ -20,6 +21,9 @@ class InsuranceViewModel extends BaseViewModel { List get insuranceApproval => _insuranceCardService.insuranceApproval; + GetAllSharedRecordsByStatusResponse get getAllSharedRecordsByStatusResponse => + _insuranceCardService.getAllSharedRecordsByStatusResponse; + Future getInsurance() async { hasError = false; _insuranceCardService.clearInsuranceCard(); @@ -41,7 +45,7 @@ class InsuranceViewModel extends BaseViewModel { error = _insuranceCardService.error; setState(ViewState.ErrorLocal); } else - setState(ViewState.Idle); + getFamilyFiles(); } Future getInsuranceApproval({int appointmentNo}) async { @@ -59,4 +63,13 @@ class InsuranceViewModel extends BaseViewModel { } else setState(ViewState.Idle); } + + Future getFamilyFiles() async { + await _insuranceCardService.getFamilyFiles(); + if (_insuranceCardService.hasError) { + error = _insuranceCardService.error; + setState(ViewState.Error); + } else + setState(ViewState.Idle); + } } diff --git a/lib/core/viewModels/medical/labs_view_model.dart b/lib/core/viewModels/medical/labs_view_model.dart index 1efdfb7c..032aeb1e 100644 --- a/lib/core/viewModels/medical/labs_view_model.dart +++ b/lib/core/viewModels/medical/labs_view_model.dart @@ -1,6 +1,6 @@ - import 'package:diplomaticquarterapp/core/enum/filter_type.dart'; import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/labs/lab_result.dart'; import 'package:diplomaticquarterapp/core/model/labs/patient_lab_orders.dart'; import 'package:diplomaticquarterapp/core/model/labs/patient_lab_special_result.dart'; import 'package:diplomaticquarterapp/core/service/medical/labs_service.dart'; @@ -78,13 +78,32 @@ class LabsViewModel extends BaseViewModel { List get patientLabSpecialResult => _labsService.patientLabSpecialResult; + List get labResultList => _labsService.labResultList; + getLaboratoryResult( {String projectID, int clinicID, String invoiceNo, String orderNo}) async { setState(ViewState.Busy); - await _labsService.getLaboratoryResult(invoiceNo: invoiceNo,orderNo: orderNo,projectID: projectID,clinicID: clinicID); + await _labsService.getLaboratoryResult( + invoiceNo: invoiceNo, + orderNo: orderNo, + projectID: projectID, + clinicID: clinicID); + if (_labsService.hasError) { + error = _labsService.error; + setState(ViewState.Error); + } else { + setState(ViewState.Idle); + } + } + + getPatientLabResult({PatientLabOrders patientLabOrder}) async { + setState(ViewState.Busy); + await _labsService.getPatientLabResult( + patientLabOrder: patientLabOrder + ); if (_labsService.hasError) { error = _labsService.error; setState(ViewState.Error); diff --git a/lib/core/viewModels/medical/reports_monthly_view_model.dart b/lib/core/viewModels/medical/reports_monthly_view_model.dart new file mode 100644 index 00000000..2e5952ae --- /dev/null +++ b/lib/core/viewModels/medical/reports_monthly_view_model.dart @@ -0,0 +1,84 @@ +import 'package:diplomaticquarterapp/pages/feedback/appointment_history.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; + +import '../../../core/enum/reportfilter_type.dart'; +import '../../../core/enum/viewstate.dart'; +import '../../../core/model/reports/Reports.dart'; +import '../../../core/service/medical/reports_service.dart'; +import '../../../locator.dart'; +import '../base_view_model.dart'; + +class ReportsMonthlyViewModel extends BaseViewModel { + ReportFilterType filterType = ReportFilterType.Requested; + + ReportsService _reportsService = locator(); + + List reportsOrderRequestList = List(); + List reportsOrderReadyList = List(); + List reportsOrderCompletedList = List(); + List reportsOrderCanceledList = List(); + + List get appointHistoryList => + _reportsService.appointHistoryList; + + getReports() async { + setState(ViewState.Busy); + reportsOrderRequestList.clear(); + reportsOrderReadyList.clear(); + reportsOrderCompletedList.clear(); + reportsOrderCanceledList.clear(); + await _reportsService.getReports(); + if (_reportsService.hasError) { + error = _reportsService.error; + setState(ViewState.Error); + } else { + _filterList(); + setState(ViewState.Idle); + } + } + + getPatentAppointmentHistory() async { + setState(ViewState.Busy); + await _reportsService.getPatentAppointmentHistory(); + if (_reportsService.hasError) { + error = _reportsService.error; + setState(ViewState.Error); + } else { + setState(ViewState.Idle); + } + } + + void _filterList() { + _reportsService.reportsList.forEach((report) { + switch (report.status) { + case 1: + reportsOrderRequestList.add(report); + break; + case 2: + reportsOrderReadyList.add(report); + break; + case 3: + reportsOrderCompletedList.add(report); + break; + case 4: + reportsOrderCanceledList.add(report); + break; + default: + } + }); + } + + + insertRequestForMedicalReport(AppointmentHistory appointmentHistory)async{ + setState(ViewState.Busy); + await _reportsService.insertRequestForMedicalReport(appointmentHistory); + if (_reportsService.hasError) { + error = _reportsService.error; + AppToast.showErrorToast(message: error); + setState(ViewState.ErrorLocal); + } else { + AppToast.showSuccessToast(message: 'The order was send '); + setState(ViewState.Idle); + } + } +} diff --git a/lib/locator.dart b/lib/locator.dart index b2e974a8..6839fbc2 100644 --- a/lib/locator.dart +++ b/lib/locator.dart @@ -12,6 +12,7 @@ import 'core/service/medical/medical_service.dart'; import 'core/service/medical/my_doctor_service.dart'; import 'core/service/medical/prescriptions_service.dart'; import 'core/service/medical/radiology_service.dart'; +import 'core/service/medical/reports_monthly_service.dart'; import 'core/service/medical/vital_sign_service.dart'; import 'core/viewModels/appointment_rate_view_model.dart'; import 'core/viewModels/feedback/feedback_view_model.dart'; @@ -22,6 +23,7 @@ import 'core/viewModels/medical/medical_view_model.dart'; import 'core/viewModels/medical/my_doctor_view_model.dart'; import 'core/viewModels/medical/prescriptions_view_model.dart'; import 'core/viewModels/medical/radiology_view_model.dart'; +import 'core/viewModels/medical/reports_monthly_view_model.dart'; import 'core/viewModels/medical/vital_sign_view_model.dart'; import 'core/viewModels/medical/reports_view_model.dart'; import 'core/viewModels/pharmacies_view_model.dart'; @@ -53,6 +55,7 @@ void setupLocator() { locator.registerLazySingleton(() => AppointmentRateService()); locator.registerLazySingleton(() => QrService()); locator.registerFactory(() => VaccineService()); + locator.registerLazySingleton(() => ReportsMonthlyService()); /// View Model locator.registerFactory(() => HospitalViewModel()); @@ -70,5 +73,6 @@ void setupLocator() { locator.registerFactory(() => DashboardViewModel()); locator.registerFactory(() => AppointmentRateViewModel()); locator.registerFactory(() => QrViewModel()); + locator.registerFactory(() => ReportsMonthlyViewModel()); } diff --git a/lib/pages/insurance/insurance_update_screen.dart b/lib/pages/insurance/insurance_update_screen.dart index 9cfa41a9..2fa291df 100644 --- a/lib/pages/insurance/insurance_update_screen.dart +++ b/lib/pages/insurance/insurance_update_screen.dart @@ -1,3 +1,4 @@ +import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:flutter/material.dart'; import 'package:diplomaticquarterapp/config/size_config.dart'; import 'package:flutter/cupertino.dart'; @@ -97,9 +98,12 @@ class _InsuranceUpdateState extends State children: [ Container( child: ListView.builder( - itemCount: model.insuranceUpdate == null + itemCount: model.getAllSharedRecordsByStatusResponse + .getAllSharedRecordsByStatusList == + null ? 0 - : model.insuranceUpdate.length, + : model.getAllSharedRecordsByStatusResponse + .getAllSharedRecordsByStatusList.length, itemBuilder: (BuildContext context, int index) { return Container( margin: EdgeInsets.all(10.0), @@ -112,81 +116,63 @@ class _InsuranceUpdateState extends State child: Container( width: MediaQuery.of(context).size.width, padding: EdgeInsets.all(10.0), - child: Column( + child: Row( crossAxisAlignment: CrossAxisAlignment.start, mainAxisSize: MainAxisSize.max, children: [ - Flex( - direction: Axis.horizontal, - children: [ - Expanded( - flex: 3, - child: Container( - margin: EdgeInsets.only( - top: 2.0, - left: 10.0, - right: 20.0), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Text("TAMER FANASHEH ", - style: TextStyle( - fontSize: 14.0, - color: Colors.black, - fontWeight: - FontWeight.w500, - letterSpacing: 1.0)), - Text( - 'File No.' + - model - .insuranceUpdate[ - index] - .patientID - .toString(), - style: TextStyle( - fontSize: 14.0, - color: Colors.black, - fontWeight: - FontWeight.w500, - letterSpacing: 1.0)), - Text( - model.insuranceUpdate[index] - .createdOn, - style: TextStyle( - fontSize: 14.0, - color: Colors.black, - fontWeight: - FontWeight.w500, - letterSpacing: 1.0)), - ], - ), - ), + Expanded( + flex: 3, + child: Container( + margin: EdgeInsets.only( + top: 2.0, left: 10.0, right: 20.0), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Text( + model.getAllSharedRecordsByStatusResponse + .getAllSharedRecordsByStatusList[ + index].patientName, + style: TextStyle( + fontSize: 14.0, + color: Colors.black, + fontWeight: FontWeight.w500, + letterSpacing: 1.0)), + Text( + 'File No.' + + model.getAllSharedRecordsByStatusResponse + .getAllSharedRecordsByStatusList[ + index].patientID.toString(), + style: TextStyle( + fontSize: 14.0, + color: Colors.black, + fontWeight: FontWeight.w500, + letterSpacing: 1.0)), + ], ), - Expanded( - flex: 1, - child: Container( -// height: MediaQuery.of(context).size.height * 0.12, - margin: EdgeInsets.only(top: 20.0), - child: Column( - children: [ - Container( - child: Button( - label: 'Fetch', - ), - height: SizeConfig - .heightMultiplier * - 3.8, - width: - SizeConfig.screenWidth * - 4.2, - ), - ], - ), - ), - ) - ], + ), ), + Expanded( + flex: 2, + child: Container( + // height: MediaQuery.of(context).size.height * 0.12, + margin: EdgeInsets.only(top: 2.0), + child: Column( + children: [ + Container( + child: SecondaryButton( + label: 'Update', + small: true, + textColor: Colors.white, + // color: Colors.grey, + ), + //height: 45, + // width:90 + ), + ], + ), + ), + ) ], ), ), diff --git a/lib/pages/landing/landing_page.dart b/lib/pages/landing/landing_page.dart index 8eea389f..073a1d52 100644 --- a/lib/pages/landing/landing_page.dart +++ b/lib/pages/landing/landing_page.dart @@ -235,16 +235,21 @@ class _LandingPageState extends State with WidgetsBindingObserver { physics: NeverScrollableScrollPhysics(), controller: pageController, children: [ - HomePage(goToMyProfile: (){ - _changeCurrentTab(1); - },), + HomePage( + goToMyProfile: () { + _changeCurrentTab(1); + }, + ), MedicalProfilePage(), MyAdmissionsPage(), ToDo(), BookingOptions() ], // Please do not remove the BookingOptions from this array ), - bottomNavigationBar: BottomNavBar(changeIndex: _changeCurrentTab,index: currentTab,), + bottomNavigationBar: BottomNavBar( + changeIndex: _changeCurrentTab, + index: currentTab, + ), ); } @@ -307,6 +312,4 @@ class _LandingPageState extends State with WidgetsBindingObserver { _changeCurrentTab(2); } } - - } diff --git a/lib/pages/medical/labs/laboratory_result_page.dart b/lib/pages/medical/labs/laboratory_result_page.dart index 216b8adb..01cb6725 100644 --- a/lib/pages/medical/labs/laboratory_result_page.dart +++ b/lib/pages/medical/labs/laboratory_result_page.dart @@ -27,8 +27,10 @@ class LaboratoryResultPage extends StatelessWidget { body: ListView.builder( itemBuilder: (context, index) => LaboratoryResultWidget( onTap: () => model.sendLabReportEmail(patientLabOrder: patientLabOrders), - billNo: model.patientLabSpecialResult[index].invoiceNo, + billNo: patientLabOrders.invoiceNo, details: model.patientLabSpecialResult[index].resultDataHTML, + orderNo: patientLabOrders.orderNo, + patientLabOrder: patientLabOrders, ), itemCount: model.patientLabSpecialResult.length, ), diff --git a/lib/pages/medical/medical_profile_page.dart b/lib/pages/medical/medical_profile_page.dart index 83628076..5dccb514 100644 --- a/lib/pages/medical/medical_profile_page.dart +++ b/lib/pages/medical/medical_profile_page.dart @@ -73,7 +73,7 @@ class _MedicalProfilePageState extends State { itemCount: model.appoitmentAllHistoryResultList.length, scrollDirection: Axis.horizontal, - reverse: true, + reverse: !projectViewModel.isArabic, ), ], ), diff --git a/lib/pages/medical/reports/monthly_reports.dart b/lib/pages/medical/reports/monthly_reports.dart new file mode 100644 index 00000000..9c913705 --- /dev/null +++ b/lib/pages/medical/reports/monthly_reports.dart @@ -0,0 +1,18 @@ +import 'package:diplomaticquarterapp/core/viewModels/medical/reports_monthly_view_model.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'; + +class MonthlyReportsPage extends StatelessWidget { + @override + Widget build(BuildContext context) { + return BaseView( + builder: (_, model, w) => AppScaffold( + isShowAppBar: true, + appBarTitle: TranslationBase.of(context).monthlyReports, + body: Container(), + ), + ); + } +} diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index 114f3a1b..22e39c39 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -508,6 +508,7 @@ class TranslationBase { String get orderNo => localizedValues['OrderNo'][locale.languageCode]; String get orderDetails => localizedValues['OrderDetails'][locale.languageCode]; String get vitalSign => localizedValues['VitalSign'][locale.languageCode]; + String get monthlyReports => localizedValues['MonthlyReports'][locale.languageCode]; } diff --git a/lib/widgets/data_display/medical/laboratory_result_widget.dart b/lib/widgets/data_display/medical/laboratory_result_widget.dart index b84b1076..53356095 100644 --- a/lib/widgets/data_display/medical/laboratory_result_widget.dart +++ b/lib/widgets/data_display/medical/laboratory_result_widget.dart @@ -1,5 +1,13 @@ +import 'package:diplomaticquarterapp/core/model/labs/lab_result.dart'; +import 'package:diplomaticquarterapp/core/model/labs/patient_lab_orders.dart'; +import 'package:diplomaticquarterapp/core/viewModels/medical/labs_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/widgets/others/network_base_view.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:hexcolor/hexcolor.dart'; +import 'package:provider/provider.dart'; import '../text.dart'; @@ -7,8 +15,16 @@ class LaboratoryResultWidget extends StatefulWidget { final GestureTapCallback onTap; final String billNo; final String details; + final String orderNo; + final PatientLabOrders patientLabOrder; - const LaboratoryResultWidget({Key key, this.onTap, this.billNo, this.details}) + const LaboratoryResultWidget( + {Key key, + this.onTap, + this.billNo, + this.details, + this.orderNo, + this.patientLabOrder}) : super(key: key); @override @@ -17,9 +33,12 @@ class LaboratoryResultWidget extends StatefulWidget { class _LaboratoryResultWidgetState extends State { bool _isShowMore = false; + bool _isShowMoreGeneral = false; + ProjectViewModel projectViewModel; @override Widget build(BuildContext context) { + projectViewModel = Provider.of(context); return Container( margin: EdgeInsets.all(15), child: Column( @@ -45,7 +64,7 @@ class _LaboratoryResultWidgetState extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Texts('Bill No'), + Texts('Invoice No'), Texts(widget.billNo), ], ), @@ -102,7 +121,7 @@ class _LaboratoryResultWidgetState extends State { )), child: Row( children: [ - Expanded(child: Texts('Result')), + Expanded(child: Texts('Special Result')), Container( width: 25, height: 25, @@ -132,12 +151,211 @@ class _LaboratoryResultWidgetState extends State { bottomRight: Radius.circular(5.0), )), duration: Duration(milliseconds: 7000), - child: Text(widget.details?? 'No Data'), - ) + child: Container( + width: double.infinity, + child: Text(widget.details ?? 'No Data')), + ), + SizedBox(height: 12,), + BaseView( + onModelReady: (model) => model.getPatientLabResult( + patientLabOrder: widget.patientLabOrder), + builder: (_, model, w) => NetworkBaseView( + baseViewModel: model, + child: Container( + child: Column( + children: [ + InkWell( + onTap: () { + setState(() { + _isShowMoreGeneral = !_isShowMoreGeneral; + }, + ); + }, + child: Container( + padding: EdgeInsets.all(10.0), + margin: EdgeInsets.only(left: 5, right: 5), + decoration: BoxDecoration( + shape: BoxShape.rectangle, + color: Colors.white, + borderRadius: BorderRadius.all( + Radius.circular(5.0), + )), + child: Row( + children: [ + Expanded(child: Texts('General Result')), + Container( + width: 25, + height: 25, + decoration: BoxDecoration( + shape: BoxShape.circle, + color: Colors.red[900]), + child: Icon( + _isShowMoreGeneral + ? Icons.keyboard_arrow_up + : Icons.keyboard_arrow_down, + color: Colors.white, + size: 22, + ), + ) + ], + ), + ), + ), + if (_isShowMoreGeneral) + AnimatedContainer( + padding: EdgeInsets.all(10.0), + margin: EdgeInsets.only(left: 5, right: 5), + decoration: BoxDecoration( + shape: BoxShape.rectangle, + color: Colors.white, + borderRadius: BorderRadius.only( + bottomLeft: Radius.circular(5.0), + bottomRight: Radius.circular(5.0), + ), + ), + duration: Duration(milliseconds: 7000), + child: Container( + width: double.infinity, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Texts('U/A'), + InkWell( + onTap: () { + model.getPatientLabResult( + patientLabOrder: + widget.patientLabOrder); + }, + child: Texts( + 'Flow Chart', + decoration: TextDecoration.underline, + color: Colors.blue, + ), + ), + ], + ), + Table( + border: TableBorder.symmetric( + inside: BorderSide( + width: 2.0, color: Colors.grey[300]), + ), + children: fullData(model.labResultList), + ), + ], + ), + ), + ), + ], + ), + ), + ), + ) ], ), ], ), ); } + + List fullData(List labResultList) { + List tableRow = []; + tableRow.add( + TableRow( + children: [ + Container( + child: Container( + decoration: BoxDecoration( + color: Hexcolor('#515B5D'), + 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), + ), + ), + child: Center( + child: Texts( + 'Description', + color: Colors.white, + ), + ), + height: 60, + ), + ), + Container( + child: Container( + decoration: BoxDecoration( + color: Hexcolor('#515B5D'), + + ), + child: Center( + child: Texts('Value', color: Colors.white), + ), + height: 60), + ), + Container( + child: Container( + decoration: BoxDecoration( + color: Hexcolor('#515B5D'), + 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('Range', color: Colors.white), + ), + height: 60), + ), + ], + ), + ); + labResultList.forEach((lab) { + tableRow.add( + TableRow( + children: [ + Container( + child: Container( + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + lab.description, + textAlign: TextAlign.center, + ), + ), + ), + ), + Container( + child: Container( + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + lab.resultValue, + textAlign: TextAlign.center, + ), + ), + ), + ), + Container( + child: Container( + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + lab.referanceRange, + textAlign: TextAlign.center, + ), + ), + ), + ), + ], + ), + ); + }); + return tableRow; + } } diff --git a/lib/widgets/others/app_scaffold_widget.dart b/lib/widgets/others/app_scaffold_widget.dart index b18a5fd9..56e06939 100644 --- a/lib/widgets/others/app_scaffold_widget.dart +++ b/lib/widgets/others/app_scaffold_widget.dart @@ -74,7 +74,7 @@ class AppScaffold extends StatelessWidget { ) : buildBodyWidget(), bottomSheet: bottomSheet, - bottomNavigationBar: BottomBarSearch() + // bottomNavigationBar: BottomBarSearch() //floatingActionButton: FloatingSearchButton(), ); } diff --git a/pubspec.yaml b/pubspec.yaml index b5b359a9..4a87b43a 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -38,7 +38,7 @@ dependencies: url_launcher: ^5.5.0 shared_preferences: ^0.5.8 flutter_flexible_toast: ^0.1.4 - firebase_messaging: 6.0.12 + firebase_messaging: ^7.0.0 # Progress bar progress_hud_v2: ^2.0.0 From c5794e5c709944692a1a2c889d377b66ec157f3f Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Mon, 7 Sep 2020 10:26:05 +0300 Subject: [PATCH 19/45] Dental flow in my appointments --- lib/core/service/client/base_app_client.dart | 29 +++++++------- lib/pages/MyAppointments/MyAppointments.dart | 21 +++------- .../MyAppointments/models/ArrivedButtons.dart | 2 +- .../widgets/AppointmentActions.dart | 39 ++++++++++++++----- 4 files changed, 50 insertions(+), 41 deletions(-) diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index bc5c8a3f..70883ccc 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -47,26 +47,25 @@ class BaseAppClient { : PATIENT_OUT_SA; if (body.containsKey('isDentalAllowedBackend')) { - body['isDentalAllowedBackend'] = body.containsKey('isDentalAllowedBackend') - ? body['isDentalAllowedBackend'] != null ? body['isDentalAllowedBackend'] : IS_DENTAL_ALLOWED_BACKEND - : IS_DENTAL_ALLOWED_BACKEND; + body['isDentalAllowedBackend'] = + body.containsKey('isDentalAllowedBackend') + ? body['isDentalAllowedBackend'] != null + ? body['isDentalAllowedBackend'] + : IS_DENTAL_ALLOWED_BACKEND + : IS_DENTAL_ALLOWED_BACKEND; } body['DeviceTypeID'] = DeviceTypeID; - if (body.containsKey('PatientType')) { - body['PatientType'] = body.containsKey('PatientType') - ? body['PatientType'] != null ? body['PatientType'] : PATIENT_TYPE - : PATIENT_TYPE; - } + body['PatientType'] = body.containsKey('PatientType') + ? body['PatientType'] != null ? body['PatientType'] : PATIENT_TYPE + : PATIENT_TYPE; - if (body.containsKey('PatientTypeID')) { - body['PatientTypeID'] = body.containsKey('PatientTypeID') - ? body['PatientTypeID'] != null - ? body['PatientTypeID'] - : PATIENT_TYPE_ID - : PATIENT_TYPE_ID; - } + body['PatientTypeID'] = body.containsKey('PatientTypeID') + ? body['PatientTypeID'] != null + ? body['PatientTypeID'] + : PATIENT_TYPE_ID + : PATIENT_TYPE_ID; if (user != null) { body['TokenID'] = token; diff --git a/lib/pages/MyAppointments/MyAppointments.dart b/lib/pages/MyAppointments/MyAppointments.dart index 699990ac..26bdd21c 100644 --- a/lib/pages/MyAppointments/MyAppointments.dart +++ b/lib/pages/MyAppointments/MyAppointments.dart @@ -17,10 +17,8 @@ class MyAppointments extends StatefulWidget { List arrivedAppoList = []; List _patientBookedAppointmentListHospital = List(); - List _patientConfirmedAppointmentListHospital = List(); - List _patientArrivedAppointmentListHospital = List(); @override @@ -101,6 +99,8 @@ class _MyAppointmentsState extends State } }).catchError((err) { print(err); + AppToast.showErrorToast(message: err); + Navigator.of(context).pop(); }).showProgressBar( text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); } @@ -204,11 +204,11 @@ class _MyAppointmentsState extends State } openAppointmentsTab() { - if (widget.bookedAppoList.length != 0) { + if (widget._patientBookedAppointmentListHospital.length != 0) { _tabController.index = 0; - } else if (widget.confirmedAppoList.length != 0) { + } else if (widget._patientConfirmedAppointmentListHospital.length != 0) { _tabController.index = 1; - } else if (widget.arrivedAppoList.length != 0) { + } else if (widget._patientArrivedAppointmentListHospital.length != 0) { _tabController.index = 2; return; } @@ -356,17 +356,6 @@ class _MyAppointmentsState extends State ), ), ) -// Container( -// child: new ListView.builder( -// itemCount: widget.arrivedAppoList.length, -// itemBuilder: (context, i) { -// return AppointmentCard( -// appo: widget.arrivedAppoList[i], -// onReloadAppointmentHistory: getPatientAppointmentHistory, -// ); -// }, -// ), -// ) : Container( child: Center( child: Column( diff --git a/lib/pages/MyAppointments/models/ArrivedButtons.dart b/lib/pages/MyAppointments/models/ArrivedButtons.dart index 4a288730..a89253c6 100644 --- a/lib/pages/MyAppointments/models/ArrivedButtons.dart +++ b/lib/pages/MyAppointments/models/ArrivedButtons.dart @@ -25,7 +25,7 @@ class ArrivedButtons { "title": "Lab", "subtitle": "Result", "icon": "assets/images/new-design/lab_result_icon.png", - "caller": "addReminder" + "caller": "labResult" }, { "title": "Vital Signs", diff --git a/lib/pages/MyAppointments/widgets/AppointmentActions.dart b/lib/pages/MyAppointments/widgets/AppointmentActions.dart index a876160f..19e82086 100644 --- a/lib/pages/MyAppointments/widgets/AppointmentActions.dart +++ b/lib/pages/MyAppointments/widgets/AppointmentActions.dart @@ -12,17 +12,18 @@ import 'package:diplomaticquarterapp/pages/MyAppointments/models/ConfirmedButton import 'package:diplomaticquarterapp/pages/MyAppointments/widgets/PrescriptionReport.dart'; import 'package:diplomaticquarterapp/pages/MyAppointments/widgets/askDocDialog.dart'; import 'package:diplomaticquarterapp/pages/MyAppointments/widgets/reminder_dialog.dart'; +import 'package:diplomaticquarterapp/pages/feedback/feedback_home_page.dart'; import 'package:diplomaticquarterapp/pages/insurance/insurance_approval_screen.dart'; import 'package:diplomaticquarterapp/pages/medical/radiology/radiology_details_page.dart'; import 'package:diplomaticquarterapp/pages/medical/vital_sign/vital_sign_details_screen.dart'; import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; -import 'package:smart_progress_bar/smart_progress_bar.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; +import 'package:smart_progress_bar/smart_progress_bar.dart'; import 'package:url_launcher/url_launcher.dart'; class AppointmentActions extends StatefulWidget { @@ -189,6 +190,10 @@ class _AppointmentActionsState extends State { case "VitalSigns": navigateToVitalSigns(widget.appo.appointmentNo, widget.appo.projectID); break; + + case "insertComplaint": + navigateToInsertComplaint(); + break; } } @@ -357,7 +362,8 @@ class _AppointmentActionsState extends State { } }).catchError((err) { print(err); - }).showProgressBar(text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + }).showProgressBar( + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); } openAppointmentRadiology() { @@ -374,7 +380,8 @@ class _AppointmentActionsState extends State { }).catchError((err) { print(err); AppToast.showErrorToast(message: err); - }).showProgressBar(text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + }).showProgressBar( + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); } openPrescriptionReport() { @@ -394,7 +401,8 @@ class _AppointmentActionsState extends State { }).catchError((err) { print(err); AppToast.showErrorToast(message: err); - }).showProgressBar(text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + }).showProgressBar( + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); } Future navigateToMedicinePrescriptionReport( @@ -460,7 +468,10 @@ class _AppointmentActionsState extends State { } }).catchError((err) { print(err); - }).showProgressBar(text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + AppToast.showErrorToast( + message: err); + }).showProgressBar( + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); } getCallRequestType() { @@ -475,7 +486,8 @@ class _AppointmentActionsState extends State { }); }).catchError((err) { print(err); - }).showProgressBar(text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + }).showProgressBar( + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); } showAskDocRequestDialog(List requestData) { @@ -520,7 +532,8 @@ class _AppointmentActionsState extends State { }).catchError((err) { print(err); AppToast.showErrorToast(message: err); - }).showProgressBar(text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + }).showProgressBar( + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); } confirmAppointment() { @@ -537,7 +550,8 @@ class _AppointmentActionsState extends State { } }).catchError((err) { print(err); - }).showProgressBar(text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + }).showProgressBar( + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); } navigateToInsuranceApprovals(int appoNo) { @@ -547,7 +561,14 @@ class _AppointmentActionsState extends State { navigateToVitalSigns(int appoNo, int projectID) { Navigator.push( - context, FadePage(page: VitalSignDetailsScreen(appointmentNo: appoNo, projectID: projectID))); + context, + FadePage( + page: VitalSignDetailsScreen( + appointmentNo: appoNo, projectID: projectID))); + } + + navigateToInsertComplaint() { + Navigator.push(context, FadePage(page: FeedbackHomePage())); } rateAppointment() { From b0f0b8734515fe7dfa53467bae344e4b25a626d6 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Mon, 7 Sep 2020 11:43:13 +0300 Subject: [PATCH 20/45] fix merge issues --- lib/config/config.dart | 3 +- lib/config/localized_values.dart | 12 - lib/core/service/client/base_app_client.dart | 12 +- .../service/medical/my_doctor_service.dart | 5 +- .../medical/my_doctor_view_model.dart | 5 +- lib/core/viewModels/project_view_model.dart | 4 +- .../Appointments/DoctorListResponse.dart | 4 +- lib/pages/MyAppointments/MyAppointments.dart | 105 ++++---- lib/pages/landing/landing_page.dart | 226 +++++++++--------- .../medical/doctor/doctor_home_page.dart | 2 +- 10 files changed, 183 insertions(+), 195 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index c9a37d70..0165cb1b 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -43,7 +43,8 @@ const SEND_RAD_REPORT_EMAIL = const SEND_FEEDBACK = 'Services/COCWS.svc/REST/InsertCOCItemInSPList'; const GET_STATUS_FOR_COCO = 'Services/COCWS.svc/REST/GetStatusforCOC'; const GET_PATIENT_AppointmentHistory = - 'Services/Doctors.svc/REST/PateintHasAppoimentHistory'; + 'Services' + '/Doctors.svc/REST/PateintHasAppoimentHistory'; ///VITAL SIGN const GET_PATIENT_VITAL_SIGN = diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index bc50d61c..696e2665 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -449,18 +449,6 @@ const Map> localizedValues = { "OrderDetails": {"en": "Order Details", "ar": "تفاصيل الطلب"}, "VitalSign": {"en": "Vital Sign", "ar": "العلامة حيوية"}, "MonthlyReports": {"en": "Monthly Reports", "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": "السماح لتطبيق مجموعة الحبيب الطبية بالوصول إلى موقعك سيساعدك في إظهار المستشفيات وفقًا للأقرب إليك."}, - "parking":{"en":"Parking","ar":"مواقف"}, - "alhabiServices":{"en":"HMG Service","ar":"خدمات الحبيب"}, - "parkingTitle":{"en":"Car service, car service, service to save parking information, return to it later, 1- By clicking on (Read the code), save the parking data. 2- By clicking on the button (view my car park), it shows you the car’s location in Google Maps. 3- Read another position by pressing the Clear Position Data button.","ar":" خدمة المواقف، تتيح هذه الخدمة للمستخدم معلومات عن موقف السيارة ليسهل عليه العودة لها لاحقاً ، 1- بالضغط على زر(قراءة الكود) تستطيع حفظ البيانات الخاصة بالموقف. 2-بالضغط على زر(عرض موقف سيارتي) يعرض لك موقع السيارة في خرائط قوقل. 3- لإعادة قراءة موقف آخرعن طريق الضغط على زر(مسح بيانات الموقف). "}, - "readBarcode":{"en":"Read Barcode","ar":"قراءة الكود"}, - "showMyPark":{"en":"Show My Park","ar":"عرض بارك"}, - "clearMyData":{"en":"clear My Data","ar":"امسح البيانات"}, - "floor":{"en":"Floor:","ar":"الطابق"}, - "gate":{"en":"Gate:","ar":"بوابة"}, - "building":{"en":"Building:","ar":"المبنى"}, - "branch":{"en":"Branch:","ar":"الفرع"}, - "emergencyServices":{"en":"Emergency Services:","ar":"خدمات الطوارئ"}, "km":{"en":"KMs:","ar":"كم"}, }; diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index 04bc88d6..e80d1e83 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -44,27 +44,27 @@ class BaseAppClient { ? body['PatientOutSA'] != null ? body['PatientOutSA'] : PATIENT_OUT_SA : PATIENT_OUT_SA; - if (body.containsKey('isDentalAllowedBackend')) { + // if (body.containsKey('isDentalAllowedBackend')) { body['isDentalAllowedBackend'] = body.containsKey('isDentalAllowedBackend') ? body['isDentalAllowedBackend'] != null ? body['isDentalAllowedBackend'] : IS_DENTAL_ALLOWED_BACKEND : IS_DENTAL_ALLOWED_BACKEND; - } + // } body['DeviceTypeID'] = DeviceTypeID; - if (body.containsKey('PatientType')) { + // if (body.containsKey('PatientType')) { body['PatientType'] = body.containsKey('PatientType') ? body['PatientType'] != null ? body['PatientType'] : PATIENT_TYPE : PATIENT_TYPE; - } + // } - if (body.containsKey('PatientTypeID')) { + // if (body.containsKey('PatientTypeID')) { body['PatientTypeID'] = body.containsKey('PatientTypeID') ? body['PatientTypeID'] != null ? body['PatientTypeID'] : PATIENT_TYPE_ID : PATIENT_TYPE_ID; - } + // } if (user != null) { body['TokenID'] = token; diff --git a/lib/core/service/medical/my_doctor_service.dart b/lib/core/service/medical/my_doctor_service.dart index d688c7e7..4df3ce8a 100644 --- a/lib/core/service/medical/my_doctor_service.dart +++ b/lib/core/service/medical/my_doctor_service.dart @@ -1,7 +1,6 @@ import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/core/model/doctor/doctor_profile.dart'; import 'package:diplomaticquarterapp/core/model/doctor/doctor_rating.dart'; -import 'package:diplomaticquarterapp/core/model/doctor/patient_doctor_appointment.dart'; import 'package:diplomaticquarterapp/core/model/doctor/reques_patient_doctor_appointmentt.dart'; import 'package:diplomaticquarterapp/core/model/doctor/request_doctor_profile.dart'; import 'package:diplomaticquarterapp/core/model/doctor/request_doctor_rating.dart'; @@ -9,7 +8,7 @@ import 'package:diplomaticquarterapp/core/service/base_service.dart'; import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; class MyDoctorService extends BaseService { - List patientDoctorAppointmentList = List(); + List patientDoctorAppointmentList = List(); DoctorProfile doctorProfile; DoctorList doctorList; DoctorRating doctorRating = DoctorRating(); @@ -51,7 +50,7 @@ class MyDoctorService extends BaseService { patientDoctorAppointmentList.clear(); response['PatientDoctorAppointmentResultList'].forEach((hospital) { patientDoctorAppointmentList - .add(PatientDoctorAppointment.fromJson(hospital)); + .add(DoctorList.fromJson(hospital)); }); }, onFailure: (String error, int statusCode) { hasError = true; diff --git a/lib/core/viewModels/medical/my_doctor_view_model.dart b/lib/core/viewModels/medical/my_doctor_view_model.dart index f1db7804..266157ff 100644 --- a/lib/core/viewModels/medical/my_doctor_view_model.dart +++ b/lib/core/viewModels/medical/my_doctor_view_model.dart @@ -2,7 +2,6 @@ import 'package:diplomaticquarterapp/core/enum/filter_type.dart'; import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/model/doctor/doctor_profile.dart'; import 'package:diplomaticquarterapp/core/model/doctor/doctor_rating.dart'; -import 'package:diplomaticquarterapp/core/model/doctor/patient_doctor_appointment.dart'; import 'package:diplomaticquarterapp/core/service/medical/my_doctor_service.dart'; import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; @@ -65,9 +64,7 @@ class MyDoctorViewModel extends BaseViewModel { .toList(); if (doctorByHospital.length != 0) { - _patientDoctorAppointmentListHospital[ - _patientDoctorAppointmentListHospital - .indexOf(doctorByHospital[0])] + _patientDoctorAppointmentListHospital[_patientDoctorAppointmentListHospital.indexOf(doctorByHospital[0])] .patientDoctorAppointmentList .add(element); } else { diff --git a/lib/core/viewModels/project_view_model.dart b/lib/core/viewModels/project_view_model.dart index 40cdd432..5975daf2 100644 --- a/lib/core/viewModels/project_view_model.dart +++ b/lib/core/viewModels/project_view_model.dart @@ -9,7 +9,7 @@ import 'package:flutter/cupertino.dart'; class ProjectViewModel extends BaseViewModel { AppSharedPreferences sharedPref = AppSharedPreferences(); Locale _appLocale; - String currentLanguage = 'ar'; + String currentLanguage = 'en'; bool _isArabic = false; bool isInternetConnection = true; bool isLoading = false; @@ -45,7 +45,7 @@ class ProjectViewModel extends BaseViewModel { void loadSharedPrefLanguage() async { currentLanguage = await sharedPref.getString(APP_LANGUAGE); - _appLocale = Locale(currentLanguage ?? 'ar'); + _appLocale = Locale(currentLanguage ?? 'en'); _isArabic = currentLanguage != null ? currentLanguage == 'ar' ? true : false : true; diff --git a/lib/models/Appointments/DoctorListResponse.dart b/lib/models/Appointments/DoctorListResponse.dart index 3b5557bc..65d28910 100644 --- a/lib/models/Appointments/DoctorListResponse.dart +++ b/lib/models/Appointments/DoctorListResponse.dart @@ -85,7 +85,7 @@ class DoctorList { clinicName = json['ClinicName']; doctorTitle = json['DoctorTitle']; iD = json['ID']; - name = json['Name']; + name = json['DoctorName']??json['Name']; projectID = json['ProjectID']; projectName = json['ProjectName']; actualDoctorRate = json['ActualDoctorRate']; @@ -118,7 +118,7 @@ class DoctorList { rateNumber = json['RateNumber']; serviceID = json['ServiceID']; setupID = json['SetupID']; - if (json.containsKey('Speciality')) + if (json.containsKey('Speciality') && json['Speciality']!=null) speciality = json['Speciality'].cast(); workingHours = json['WorkingHours']; } diff --git a/lib/pages/MyAppointments/MyAppointments.dart b/lib/pages/MyAppointments/MyAppointments.dart index 782b5012..8076554e 100644 --- a/lib/pages/MyAppointments/MyAppointments.dart +++ b/lib/pages/MyAppointments/MyAppointments.dart @@ -241,59 +241,62 @@ class _MyAppointmentsState extends State fontSize: 16.0, )), ), - ], - margin: EdgeInsets.only(top: 10.0), - child: Container( - child: widget.bookedAppoList.length != 0 - ? SingleChildScrollView( - physics: BouncingScrollPhysics(), - child: Column( - children: [ - ...List.generate( - widget._patientBookedAppointmentListHospital.length, - (index) => AppExpandableNotifier( - title: widget - ._patientBookedAppointmentListHospital[index] - .filterName, - bodyWidget: Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: widget - ._patientBookedAppointmentListHospital[index] - .patientDoctorAppointmentList - .map((doctor) { - return AppointmentCard( - appo: doctor, - onReloadAppointmentHistory: - getPatientAppointmentHistory, - ); - }).toList(), - )), + Container( + margin: EdgeInsets.only(top: 10.0), + child: Container( + child: widget.bookedAppoList.length != 0 + ? SingleChildScrollView( + physics: BouncingScrollPhysics(), + child: Column( + children: [ + ...List.generate( + widget._patientBookedAppointmentListHospital.length, + (index) => AppExpandableNotifier( + title: widget + ._patientBookedAppointmentListHospital[index] + .filterName, + bodyWidget: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: widget + ._patientBookedAppointmentListHospital[index] + .patientDoctorAppointmentList + .map((doctor) { + return AppointmentCard( + appo: doctor, + onReloadAppointmentHistory: + getPatientAppointmentHistory, + ); + }).toList(), + )), + ) + ], + ), + ) + : Container( + child: Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Image.asset( + "assets/images/new-design/noAppointmentIcon.png"), + Container( + margin: EdgeInsets.only(top: 10.0), + child: Text("No Booked Appointments", + style: TextStyle( + fontSize: 16.0, + )), + ), + ], + ), + ), + ), + ), ) ], - ), - ) - : Container( - child: Center( - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Image.asset( - "assets/images/new-design/noAppointmentIcon.png"), - Container( - margin: EdgeInsets.only(top: 10.0), - child: Text("No Booked Appointments", - style: TextStyle( - fontSize: 16.0, - )), - ), - ], - ), - ), - ), - ), - ); + + )))); } Widget getConfirmedAppointments() { diff --git a/lib/pages/landing/landing_page.dart b/lib/pages/landing/landing_page.dart index 8cfbbbcd..d892be83 100644 --- a/lib/pages/landing/landing_page.dart +++ b/lib/pages/landing/landing_page.dart @@ -130,119 +130,119 @@ class _LandingPageState extends State with WidgetsBindingObserver { //_firebase Background message handler _firebaseMessaging.configure( - onMessage: (Map message) async { - showDialog("onMessage: $message"); - print("onMessage: $message"); - print(message); - print(message['name']); - print(message['appointmentdate']); - - if (Platform.isIOS) { - if (message['is_call'] == "true") { - var route = ModalRoute.of(context); - - if (route != null) { - print(route.settings.name); - } - - Map myMap = new Map.from(message); - print(myMap); - LandingPage.isOpenCallPage = true; - LandingPage.incomingCallData = IncomingCallData.fromJson(myMap); - if (!isPageNavigated) { - isPageNavigated = true; - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => IncomingCall( - incomingCallData: LandingPage.incomingCallData))) - .then((value) { - isPageNavigated = false; - }); - } - } else { - print("Is Call Not Found iOS"); - } - } else { - print("Is Call Not Found iOS"); - } - - if (Platform.isAndroid) { - if (message['data'].containsKey("is_call")) { - var route = ModalRoute.of(context); - - if (route != null) { - print(route.settings.name); - } - - Map myMap = - new Map.from(message['data']); - print(myMap); - LandingPage.isOpenCallPage = true; - LandingPage.incomingCallData = IncomingCallData.fromJson(myMap); - if (!isPageNavigated) { - isPageNavigated = true; - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => IncomingCall( - incomingCallData: LandingPage.incomingCallData))) - .then((value) { - isPageNavigated = false; - }); - } - } else { - print("Is Call Not Found Android"); - } - } else { - print("Is Call Not Found Android"); - } - }, - onBackgroundMessage: Platform.isIOS ? null : myBackgroundMessageHandler, - onLaunch: (Map message) async { - print("onLaunch: $message"); - showDialog("onLaunch: $message"); - }, - onResume: (Map message) async { - print("onResume: $message"); - print(message); - print(message['name']); - print(message['appointmentdate']); - - showDialog("onResume: $message"); - - if (Platform.isIOS) { - if (message['is_call'] == "true") { - var route = ModalRoute.of(context); - - if (route != null) { - print(route.settings.name); - } - - Map myMap = - new Map.from(message); - print(myMap); - LandingPage.isOpenCallPage = true; - LandingPage.incomingCallData = IncomingCallData.fromJson(myMap); - if (!isPageNavigated) { - isPageNavigated = true; - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => IncomingCall( - incomingCallData: LandingPage.incomingCallData))) - .then((value) { - isPageNavigated = false; - }); - } - } else { - print("Is Call Not Found iOS"); - } - } else { - print("Is Call Not Found iOS"); - } - }, - ); + // onMessage: (Map message) async { + // showDialog("onMessage: $message"); + // print("onMessage: $message"); + // print(message); + // print(message['name']); + // print(message['appointmentdate']); + // + // if (Platform.isIOS) { + // if (message['is_call'] == "true") { + // var route = ModalRoute.of(context); + // + // if (route != null) { + // print(route.settings.name); + // } + // + // Map myMap = new Map.from(message); + // print(myMap); + // LandingPage.isOpenCallPage = true; + // LandingPage.incomingCallData = IncomingCallData.fromJson(myMap); + // if (!isPageNavigated) { + // isPageNavigated = true; + // Navigator.push( + // context, + // MaterialPageRoute( + // builder: (context) => IncomingCall( + // incomingCallData: LandingPage.incomingCallData))) + // .then((value) { + // isPageNavigated = false; + // }); + // } + // } else { + // print("Is Call Not Found iOS"); + // } + // } else { + // print("Is Call Not Found iOS"); + // } + // + // if (Platform.isAndroid) { + // if (message['data'].containsKey("is_call")) { + // var route = ModalRoute.of(context); + // + // if (route != null) { + // print(route.settings.name); + // } + // + // Map myMap = + // new Map.from(message['data']); + // print(myMap); + // LandingPage.isOpenCallPage = true; + // LandingPage.incomingCallData = IncomingCallData.fromJson(myMap); + // if (!isPageNavigated) { + // isPageNavigated = true; + // Navigator.push( + // context, + // MaterialPageRoute( + // builder: (context) => IncomingCall( + // incomingCallData: LandingPage.incomingCallData))) + // .then((value) { + // isPageNavigated = false; + // }); + // } + // } else { + // print("Is Call Not Found Android"); + // } + // } else { + // print("Is Call Not Found Android"); + // } + // }, + // onBackgroundMessage: Platform.isIOS ? null : myBackgroundMessageHandler, + // onLaunch: (Map message) async { + // print("onLaunch: $message"); + // showDialog("onLaunch: $message"); + // }, + // onResume: (Map message) async { + // print("onResume: $message"); + // print(message); + // print(message['name']); + // print(message['appointmentdate']); + // + // showDialog("onResume: $message"); + // + // if (Platform.isIOS) { + // if (message['is_call'] == "true") { + // var route = ModalRoute.of(context); + // + // if (route != null) { + // print(route.settings.name); + // } + // + // Map myMap = + // new Map.from(message); + // print(myMap); + // LandingPage.isOpenCallPage = true; + // LandingPage.incomingCallData = IncomingCallData.fromJson(myMap); + // if (!isPageNavigated) { + // isPageNavigated = true; + // Navigator.push( + // context, + // MaterialPageRoute( + // builder: (context) => IncomingCall( + // incomingCallData: LandingPage.incomingCallData))) + // .then((value) { + // isPageNavigated = false; + // }); + // } + // } else { + // print("Is Call Not Found iOS"); + // } + // } else { + // print("Is Call Not Found iOS"); + // } + // }, + ); } showDialog(String message) { diff --git a/lib/pages/medical/doctor/doctor_home_page.dart b/lib/pages/medical/doctor/doctor_home_page.dart index 456b0bcb..7a01ef90 100644 --- a/lib/pages/medical/doctor/doctor_home_page.dart +++ b/lib/pages/medical/doctor/doctor_home_page.dart @@ -89,7 +89,7 @@ class DoctorHomePage extends StatelessWidget { doctorRate: doctor.doctorRate, gender: doctor.gender, doctorTitle: doctor.doctorTitle, - name: doctor.doctorName, + name: doctor.name, doctorImageURL: doctor.doctorImageURL, nationalityFlagURL: doctor.nationalityFlagURL); return DoctorView( From 20f9f6f06c20fc922977cfbcadeb72667d57d922 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Mon, 7 Sep 2020 14:49:25 +0300 Subject: [PATCH 21/45] ER --- lib/config/config.dart | 7 + .../projectavgerwaitingtime.dart | 2 +- lib/core/service/er/er_service.dart | 39 ++ .../er/near_hospital_view_model.dart | 34 ++ lib/locator.dart | 4 + lib/pages/ErService/NearestEr.dart | 436 +++++++++++++----- lib/pages/ErService/widgets/card_common.dart | 9 +- .../ErService/widgets/card_position.dart | 20 +- 8 files changed, 412 insertions(+), 139 deletions(-) rename lib/core/model/{er_service => er}/projectavgerwaitingtime.dart (97%) create mode 100644 lib/core/service/er/er_service.dart create mode 100644 lib/core/viewModels/er/near_hospital_view_model.dart diff --git a/lib/config/config.dart b/lib/config/config.dart index 91cc2eda..8ce2bdf2 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -49,6 +49,13 @@ const GET_PATIENT_AppointmentHistory = const GET_PATIENT_VITAL_SIGN = 'Services/Doctors.svc/REST/Doctor_GetPatientVitalSign'; +///Er Nearest +const GET_NEAREST_HOSPITAL= + 'Services/Patients.svc/REST/Patient_GetProjectAvgERWaitingTime'; + + + + ///Reports const REPORTS = 'Services/Doctors.svc/REST/GetPatientMedicalReportStatusInfo'; const INSERT_REQUEST_FOR_MEDICAL_REPORT = diff --git a/lib/core/model/er_service/projectavgerwaitingtime.dart b/lib/core/model/er/projectavgerwaitingtime.dart similarity index 97% rename from lib/core/model/er_service/projectavgerwaitingtime.dart rename to lib/core/model/er/projectavgerwaitingtime.dart index 7d5f8ca4..f999d46f 100644 --- a/lib/core/model/er_service/projectavgerwaitingtime.dart +++ b/lib/core/model/er/projectavgerwaitingtime.dart @@ -3,7 +3,7 @@ class ProjectAvgERWaitingTime { int projectID; int avgTimeInMinutes; String avgTimeInHHMM; - double distanceInKilometers; + int distanceInKilometers; String latitude; String longitude; String phoneNumber; diff --git a/lib/core/service/er/er_service.dart b/lib/core/service/er/er_service.dart new file mode 100644 index 00000000..779efdc1 --- /dev/null +++ b/lib/core/service/er/er_service.dart @@ -0,0 +1,39 @@ +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/core/model/er/projectavgerwaitingtime.dart'; +import '../base_service.dart'; + +class ErService extends BaseService { + List projectAvgERWaitingTimeModelList = List(); + Map body = Map(); + String Latitude = ""; + String Longitude = ""; + String PhoneNumber = ""; + + Future getProjectAvgERWaitingTimeOrders({int id, int projectID}) async { + hasError = false; + + if (id != null && projectID != null) { + body['ID'] = id; + body['ProjectID'] = projectID; + } + + await baseAppClient.post(GET_NEAREST_HOSPITAL, + onSuccess: (dynamic response, int statusCode) { + projectAvgERWaitingTimeModelList.clear(); + response['List_ProjectAvgERWaitingTime'].forEach((vital) { + projectAvgERWaitingTimeModelList + .add(ProjectAvgERWaitingTime.fromJson(vital)); + }); + projectAvgERWaitingTimeModelList.forEach((element) { + Latitude = '${element.latitude}'; + Longitude = '${element.longitude}'; + PhoneNumber = '${element.phoneNumber}'; + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } + + +} diff --git a/lib/core/viewModels/er/near_hospital_view_model.dart b/lib/core/viewModels/er/near_hospital_view_model.dart new file mode 100644 index 00000000..f1d1c350 --- /dev/null +++ b/lib/core/viewModels/er/near_hospital_view_model.dart @@ -0,0 +1,34 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/er/projectavgerwaitingtime.dart'; + +import 'package:diplomaticquarterapp/core/service/er/er_service.dart'; +import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; +import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/BranchView.dart'; + +import '../../../locator.dart'; + +class NearHospitalViewModel extends BaseViewModel { + + + ErService _erService = locator(); + List get ProjectAvgERWaitingTimeModeList => + _erService.projectAvgERWaitingTimeModelList; + + getProjectAvgERWaitingTimeOrders({int id, int projectID}) async { + setState(ViewState.Busy); + + if (id != null && projectID != null) { + + await _erService.getProjectAvgERWaitingTimeOrders(id: id,projectID: projectID); + } else { + await _erService.getProjectAvgERWaitingTimeOrders(); + } + if (_erService.hasError) { + error = _erService.error; + setState(ViewState.Error); + } else + setState(ViewState.Idle); + } + + +} diff --git a/lib/locator.dart b/lib/locator.dart index be35b5ab..71035955 100644 --- a/lib/locator.dart +++ b/lib/locator.dart @@ -5,6 +5,7 @@ import 'package:get_it/get_it.dart'; import 'core/service/appointment_rate_service.dart'; import 'core/service/dashboard_service.dart'; +import 'core/service/er/er_service.dart'; import 'core/service/feedback/feedback_service.dart'; import 'core/service/hospital_service.dart'; import 'core/service/medical/labs_service.dart'; @@ -14,6 +15,7 @@ import 'core/service/medical/prescriptions_service.dart'; import 'core/service/medical/radiology_service.dart'; import 'core/service/medical/vital_sign_service.dart'; import 'core/viewModels/appointment_rate_view_model.dart'; +import 'core/viewModels/er/near_hospital_view_model.dart'; import 'core/viewModels/feedback/feedback_view_model.dart'; import 'core/service/medical/reports_service.dart'; import 'core/viewModels/hospital_view_model.dart'; @@ -50,6 +52,7 @@ void setupLocator() { locator.registerLazySingleton(() => DashboardService()); locator.registerLazySingleton(() => AppointmentRateService()); locator.registerLazySingleton(() => QrService()); + locator.registerLazySingleton(() => ErService()); /// View Model locator.registerFactory(() => HospitalViewModel()); @@ -66,5 +69,6 @@ void setupLocator() { locator.registerFactory(() => DashboardViewModel()); locator.registerFactory(() => AppointmentRateViewModel()); locator.registerFactory(() => QrViewModel()); + locator.registerFactory(() => NearHospitalViewModel()); } diff --git a/lib/pages/ErService/NearestEr.dart b/lib/pages/ErService/NearestEr.dart index 16eb0f4c..787e66ac 100644 --- a/lib/pages/ErService/NearestEr.dart +++ b/lib/pages/ErService/NearestEr.dart @@ -1,147 +1,339 @@ +import 'package:diplomaticquarterapp/core/viewModels/er/near_hospital_view_model.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/uitl/location_util.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 '../../uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/pages/ErService/widgets/card_common.dart'; import 'widgets/card_position.dart'; -class NearestEr extends StatefulWidget { - final bool isAppbar; - const NearestEr({Key key, this.isAppbar}) : super(key: key); - @override - _NearestErState createState() => _NearestErState(); -} +class NearestEr extends StatelessWidget { -class _NearestErState extends State { - LocationUtils locationUtils; - @override - void initState() { - locationUtils = - new LocationUtils(isShowConfirmDialog: true, context: context); - WidgetsBinding.instance - .addPostFrameCallback((_) => locationUtils.getCurrentLocation()); + static const String url = "assets/images/"; - super.initState(); - } + int appointmentNo; + int projectID; + NearestEr({this.appointmentNo, this.projectID}); @override Widget build(BuildContext context) { - return AppScaffold( - isShowAppBar: widget.isAppbar, - appBarTitle: TranslationBase.of(context).bookAppo, - body: Container( - margin: EdgeInsets.fromLTRB(10.0, 20.0, 10.0, 10.0), - child: ListView( - - children: [ - Text(TranslationBase.of(context).searchBy, - style: TextStyle( - fontSize: 24.0, - letterSpacing: 1.0, - fontWeight: FontWeight.bold, - color: new Color(0xFF60686b))), - 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: CardPosition( - text: "Olaya Hospital", - image: 'assets/images/new-design/find_us_icon.png', - - subText: TranslationBase.of(context).requestA, - type: 3, - ), - flex: 0, - ), - Expanded( - child: CardPosition( - image: 'assets/images/new-design/find_us_icon.png', - text: "Takhassusi Hospital", - subText: TranslationBase.of(context).locationa, - type: 5), - flex: 0, - - ) - ], - ), - Row( - mainAxisSize: MainAxisSize.max, + return BaseView( + onModelReady: appointmentNo != null && projectID != null + ? (model) => model.getProjectAvgERWaitingTimeOrders( + id: appointmentNo, projectID: projectID) + : (model) => model.getProjectAvgERWaitingTimeOrders(), + builder: (_, mode, widget) => AppScaffold( + isShowAppBar: true, + appBarTitle: 'Nearest ER', + baseViewModel: mode, + + body: mode.ProjectAvgERWaitingTimeModeList.length > 0 + ? Container( + child: ListView( + + children: [ + Text(TranslationBase.of(context).searchBy, + style: TextStyle( + fontSize: 24.0, + letterSpacing: 1.0, + fontWeight: FontWeight.bold, + color: new Color(0xFF60686b))), + Container( + margin: EdgeInsets.fromLTRB(0.0, 10.0, 0.0, 10.0), + + child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ - Expanded( - child: CardPosition( - image: 'assets/images/new-design/find_us_icon.png', - text: "Arryan Hospital", - subText: TranslationBase.of(context).requestA, - type: 4, - ), - flex: 0, + Row( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Expanded( + child: CardPosition( + + + text: mode.ProjectAvgERWaitingTimeModeList[mode.ProjectAvgERWaitingTimeModeList.length-1].projectName, + image: 'assets/images/new-design/find_us_icon.png', + + subText: mode.ProjectAvgERWaitingTimeModeList[mode.ProjectAvgERWaitingTimeModeList.length-1].distanceInKilometers, + type: mode.ProjectAvgERWaitingTimeModeList[mode.ProjectAvgERWaitingTimeModeList.length-1].iD, + ), + flex: 0, + + ), + Expanded( + child: CardPosition( + +// mode +// .vitalSignResModelList[ +// mode.vitalSignResModelList.length - 1] +// .heightCm +// .toString() + text: mode.ProjectAvgERWaitingTimeModeList[mode.ProjectAvgERWaitingTimeModeList.length-1].projectName, + image: 'assets/images/new-design/find_us_icon.png', + + subText: mode.ProjectAvgERWaitingTimeModeList[mode.ProjectAvgERWaitingTimeModeList.length-1].distanceInKilometers, + type: mode.ProjectAvgERWaitingTimeModeList[mode.ProjectAvgERWaitingTimeModeList.length-1].iD, + ), + flex: 0, + + ) + ], ), - Expanded( - child: CardPosition( - image: 'assets/images/new-design/find_us_icon.png', - text: "Suwaidi Hospital", - subText: TranslationBase.of(context).locationa, - type: 6), - flex: 0, - ) - ], - ), - Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Expanded( - child: CardPosition( - image: 'assets/images/new-design/find_us_icon.png', - text: "Al Qassim Hospital", - subText: TranslationBase.of(context).requestA, - type: 7, - ), - flex: 0, + Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Expanded( + child: CardPosition( + +// mode +// .vitalSignResModelList[ +// mode.vitalSignResModelList.length - 1] +// .heightCm +// .toString() + text: mode.ProjectAvgERWaitingTimeModeList[mode.ProjectAvgERWaitingTimeModeList.length-1].projectName, + image: 'assets/images/new-design/find_us_icon.png', + + subText: mode.ProjectAvgERWaitingTimeModeList[mode.ProjectAvgERWaitingTimeModeList.length-1].distanceInKilometers, + type: mode.ProjectAvgERWaitingTimeModeList[mode.ProjectAvgERWaitingTimeModeList.length-1].iD, + ), + flex: 0, + ), + Expanded( + child: CardPosition( + +// mode +// .vitalSignResModelList[ +// mode.vitalSignResModelList.length - 1] +// .heightCm +// .toString() + text: mode.ProjectAvgERWaitingTimeModeList[mode.ProjectAvgERWaitingTimeModeList.length-1].projectName, + image: 'assets/images/new-design/find_us_icon.png', + + subText: mode.ProjectAvgERWaitingTimeModeList[mode.ProjectAvgERWaitingTimeModeList.length-1].distanceInKilometers, + type: mode.ProjectAvgERWaitingTimeModeList[mode.ProjectAvgERWaitingTimeModeList.length-1].iD, + ), + flex: 0, + ) + ], ), - Expanded( - child: CardPosition( - image: 'assets/images/new-design/find_us_icon.png', - text: "Khobar Hospital", - subText: TranslationBase.of(context).locationa, - type: 8), - flex: 0, - - ) - ], - ), - Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Expanded( - child: CardPosition( - image: 'assets/images/new-design/find_us_icon.png', - text: "Dubai Hospital", - subText: TranslationBase.of(context).requestA, - type: 1, - - ), - flex: 0, + Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Expanded( + child: CardPosition( + +// mode +// .vitalSignResModelList[ +// mode.vitalSignResModelList.length - 1] +// .heightCm +// .toString() + text: mode.ProjectAvgERWaitingTimeModeList[mode.ProjectAvgERWaitingTimeModeList.length-1].projectName, + image: 'assets/images/new-design/find_us_icon.png', + + subText: mode.ProjectAvgERWaitingTimeModeList[mode.ProjectAvgERWaitingTimeModeList.length-1].distanceInKilometers, + type: mode.ProjectAvgERWaitingTimeModeList[mode.ProjectAvgERWaitingTimeModeList.length-1].iD, + ), + flex: 0, + ), + Expanded( + child: CardPosition( + +// mode +// .vitalSignResModelList[ +// mode.vitalSignResModelList.length - 1] +// .heightCm +// .toString() + text: mode.ProjectAvgERWaitingTimeModeList[mode.ProjectAvgERWaitingTimeModeList.length-1].projectName, + image: 'assets/images/new-design/find_us_icon.png', + + subText: mode.ProjectAvgERWaitingTimeModeList[mode.ProjectAvgERWaitingTimeModeList.length-1].distanceInKilometers, + type: mode.ProjectAvgERWaitingTimeModeList[mode.ProjectAvgERWaitingTimeModeList.length-1].iD, + ), + flex: 0, + + ) + ], ), + Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Expanded( + child: CardPosition( + + + text: mode.ProjectAvgERWaitingTimeModeList[mode.ProjectAvgERWaitingTimeModeList.length-1].projectName, + image: 'assets/images/new-design/find_us_icon.png', + subText: mode.ProjectAvgERWaitingTimeModeList[mode.ProjectAvgERWaitingTimeModeList.length-1].distanceInKilometers.toString(), + type: mode.ProjectAvgERWaitingTimeModeList[mode.ProjectAvgERWaitingTimeModeList.length-1].iD.toString(), + ), + flex: 0, + ), + + ], + ), ], - ), - ], - ) - ), - ], + ) + ), + ], + ), + ) + : Center( + child: Texts('No Data'), ), ), ); } } + + + +//class NearestEr extends StatefulWidget { +// static const String url = "assets/images/"; +// final bool isAppbar; +// +// +// const NearestEr({Key key, this.isAppbar}) : super(key: key); +// @override +// _NearestErState createState() => _NearestErState(); +//} +// +//class _NearestErState extends State { +// LocationUtils locationUtils; +// @override +// void initState() { +// locationUtils = +// new LocationUtils(isShowConfirmDialog: true, context: context); +// WidgetsBinding.instance +// .addPostFrameCallback((_) => locationUtils.getCurrentLocation()); +// +// super.initState(); +// } +// @override +// Widget build(BuildContext context) { +// return AppScaffold( +// isShowAppBar: widget.isAppbar, +// appBarTitle: TranslationBase.of(context).bookAppo, +// body: Container( +// margin: EdgeInsets.fromLTRB(10.0, 20.0, 10.0, 10.0), +// child: ListView( +// +// children: [ +// Text(TranslationBase.of(context).searchBy, +// style: TextStyle( +// fontSize: 24.0, +// letterSpacing: 1.0, +// fontWeight: FontWeight.bold, +// color: new Color(0xFF60686b))), +// 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: CardPosition( +// text: "Olaya Hospital", +// image: 'assets/images/new-design/find_us_icon.png', +// +// subText: TranslationBase.of(context).requestA, +// type: 3, +// ), +// flex: 0, +// +// ), +// Expanded( +// child: CardPosition( +// image: 'assets/images/new-design/find_us_icon.png', +// text: "Takhassusi Hospital", +// subText: TranslationBase.of(context).locationa, +// type: 5), +// flex: 0, +// +// ) +// ], +// ), +// Row( +// mainAxisSize: MainAxisSize.max, +// mainAxisAlignment: MainAxisAlignment.center, +// children: [ +// Expanded( +// child: CardPosition( +// image: 'assets/images/new-design/find_us_icon.png', +// text: "Arryan Hospital", +// subText: TranslationBase.of(context).requestA, +// type: 4, +// ), +// flex: 0, +// ), +// Expanded( +// child: CardPosition( +// image: 'assets/images/new-design/find_us_icon.png', +// text: "Suwaidi Hospital", +// subText: TranslationBase.of(context).locationa, +// type: 6), +// flex: 0, +// ) +// ], +// ), +// Row( +// mainAxisSize: MainAxisSize.max, +// mainAxisAlignment: MainAxisAlignment.center, +// children: [ +// Expanded( +// child: CardPosition( +// image: 'assets/images/new-design/find_us_icon.png', +// text: "Al Qassim Hospital", +// subText: TranslationBase.of(context).requestA, +// type: 7, +// ), +// flex: 0, +// ), +// Expanded( +// child: CardPosition( +// image: 'assets/images/new-design/find_us_icon.png', +// text: "Khobar Hospital", +// subText: TranslationBase.of(context).locationa, +// type: 8), +// flex: 0, +// +// ) +// ], +// ), +// Row( +// mainAxisSize: MainAxisSize.max, +// mainAxisAlignment: MainAxisAlignment.center, +// children: [ +// Expanded( +// child: CardPosition( +// image: 'assets/images/new-design/find_us_icon.png', +// text: "Dubai Hospital", +// subText: TranslationBase.of(context).requestA, +// type: 1, +// +// ), +// flex: 0, +// ), +// +// ], +// ), +// ], +// ) +// ), +// ], +// ), +// ), +// ); +// } +//} diff --git a/lib/pages/ErService/widgets/card_common.dart b/lib/pages/ErService/widgets/card_common.dart index f59df83c..c65789c5 100644 --- a/lib/pages/ErService/widgets/card_common.dart +++ b/lib/pages/ErService/widgets/card_common.dart @@ -65,11 +65,16 @@ class CardCommonEr extends StatelessWidget { else{ print("=========Nearest ER==========="); +// Navigator.push( +// context, +// +// FadePage( +// // page: NearestEr(isAppbar: true,))); +// page: NearestEr())); Navigator.push( context, - FadePage( - page: NearestEr(isAppbar: true,))); + page: NearestEr())); } diff --git a/lib/pages/ErService/widgets/card_position.dart b/lib/pages/ErService/widgets/card_position.dart index e5241772..35e875fc 100644 --- a/lib/pages/ErService/widgets/card_position.dart +++ b/lib/pages/ErService/widgets/card_position.dart @@ -1,7 +1,6 @@ //import 'package:diplomaticquarterapp/pages/BookAppointment/Search.dart'; import 'package:diplomaticquarterapp/config/size_config.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/Search.dart'; -import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; import '../NearestEr.dart'; @@ -68,20 +67,13 @@ class CardPosition extends StatelessWidget { else{ print("=========Nearest ER==========="); - Navigator.push( - context, - - FadePage( - page: NearestEr(isAppbar: true,))); +// Navigator.push( +// context, +// MaterialPageRoute( +// builder: (context) => NearestEr(isAppbar: true,))); +// + } - } - //NearestEr(isAppbar: true,) -// Navigator.push( -// context, -// MaterialPageRoute( -// builder: (context) => Search( -// type: type, -// ))); } } From f534f8a348a949bf8d05b80ab3fc17567bd887a5 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Mon, 7 Sep 2020 15:11:05 +0300 Subject: [PATCH 22/45] ER --- lib/pages/ErService/NearestEr.dart | 48 +++++++++---------- .../ErService/widgets/card_position.dart | 9 ++-- 2 files changed, 26 insertions(+), 31 deletions(-) diff --git a/lib/pages/ErService/NearestEr.dart b/lib/pages/ErService/NearestEr.dart index 787e66ac..623871f6 100644 --- a/lib/pages/ErService/NearestEr.dart +++ b/lib/pages/ErService/NearestEr.dart @@ -55,11 +55,11 @@ class NearestEr extends StatelessWidget { child: CardPosition( - text: mode.ProjectAvgERWaitingTimeModeList[mode.ProjectAvgERWaitingTimeModeList.length-1].projectName, + text: mode.ProjectAvgERWaitingTimeModeList[0].projectName.toString(), image: 'assets/images/new-design/find_us_icon.png', - subText: mode.ProjectAvgERWaitingTimeModeList[mode.ProjectAvgERWaitingTimeModeList.length-1].distanceInKilometers, - type: mode.ProjectAvgERWaitingTimeModeList[mode.ProjectAvgERWaitingTimeModeList.length-1].iD, + subText: mode.ProjectAvgERWaitingTimeModeList[0].distanceInKilometers.toString(), + type: mode.ProjectAvgERWaitingTimeModeList[0].iD.toString(), ), flex: 0, @@ -67,16 +67,12 @@ class NearestEr extends StatelessWidget { Expanded( child: CardPosition( -// mode -// .vitalSignResModelList[ -// mode.vitalSignResModelList.length - 1] -// .heightCm -// .toString() - text: mode.ProjectAvgERWaitingTimeModeList[mode.ProjectAvgERWaitingTimeModeList.length-1].projectName, + + text: mode.ProjectAvgERWaitingTimeModeList[1].projectName.toString(), image: 'assets/images/new-design/find_us_icon.png', - subText: mode.ProjectAvgERWaitingTimeModeList[mode.ProjectAvgERWaitingTimeModeList.length-1].distanceInKilometers, - type: mode.ProjectAvgERWaitingTimeModeList[mode.ProjectAvgERWaitingTimeModeList.length-1].iD, + subText: mode.ProjectAvgERWaitingTimeModeList[1].distanceInKilometers.toString(), + type: mode.ProjectAvgERWaitingTimeModeList[1].iD.toString(), ), flex: 0, @@ -95,11 +91,11 @@ class NearestEr extends StatelessWidget { // mode.vitalSignResModelList.length - 1] // .heightCm // .toString() - text: mode.ProjectAvgERWaitingTimeModeList[mode.ProjectAvgERWaitingTimeModeList.length-1].projectName, + text: mode.ProjectAvgERWaitingTimeModeList[2].projectName.toString(), image: 'assets/images/new-design/find_us_icon.png', - subText: mode.ProjectAvgERWaitingTimeModeList[mode.ProjectAvgERWaitingTimeModeList.length-1].distanceInKilometers, - type: mode.ProjectAvgERWaitingTimeModeList[mode.ProjectAvgERWaitingTimeModeList.length-1].iD, + subText: mode.ProjectAvgERWaitingTimeModeList[2].distanceInKilometers.toString(), + type: mode.ProjectAvgERWaitingTimeModeList[2].iD.toString(), ), flex: 0, ), @@ -111,11 +107,11 @@ class NearestEr extends StatelessWidget { // mode.vitalSignResModelList.length - 1] // .heightCm // .toString() - text: mode.ProjectAvgERWaitingTimeModeList[mode.ProjectAvgERWaitingTimeModeList.length-1].projectName, + text: mode.ProjectAvgERWaitingTimeModeList[3].projectName.toString(), image: 'assets/images/new-design/find_us_icon.png', - subText: mode.ProjectAvgERWaitingTimeModeList[mode.ProjectAvgERWaitingTimeModeList.length-1].distanceInKilometers, - type: mode.ProjectAvgERWaitingTimeModeList[mode.ProjectAvgERWaitingTimeModeList.length-1].iD, + subText: mode.ProjectAvgERWaitingTimeModeList[3].distanceInKilometers.toString(), + type: mode.ProjectAvgERWaitingTimeModeList[3].iD.toString(), ), flex: 0, ) @@ -133,11 +129,11 @@ class NearestEr extends StatelessWidget { // mode.vitalSignResModelList.length - 1] // .heightCm // .toString() - text: mode.ProjectAvgERWaitingTimeModeList[mode.ProjectAvgERWaitingTimeModeList.length-1].projectName, + text: mode.ProjectAvgERWaitingTimeModeList[4].projectName.toString(), image: 'assets/images/new-design/find_us_icon.png', - subText: mode.ProjectAvgERWaitingTimeModeList[mode.ProjectAvgERWaitingTimeModeList.length-1].distanceInKilometers, - type: mode.ProjectAvgERWaitingTimeModeList[mode.ProjectAvgERWaitingTimeModeList.length-1].iD, + subText: mode.ProjectAvgERWaitingTimeModeList[4].distanceInKilometers.toString(), + type: mode.ProjectAvgERWaitingTimeModeList[4].iD.toString(), ), flex: 0, ), @@ -149,11 +145,11 @@ class NearestEr extends StatelessWidget { // mode.vitalSignResModelList.length - 1] // .heightCm // .toString() - text: mode.ProjectAvgERWaitingTimeModeList[mode.ProjectAvgERWaitingTimeModeList.length-1].projectName, + text: mode.ProjectAvgERWaitingTimeModeList[5].projectName.toString(), image: 'assets/images/new-design/find_us_icon.png', - subText: mode.ProjectAvgERWaitingTimeModeList[mode.ProjectAvgERWaitingTimeModeList.length-1].distanceInKilometers, - type: mode.ProjectAvgERWaitingTimeModeList[mode.ProjectAvgERWaitingTimeModeList.length-1].iD, + subText: mode.ProjectAvgERWaitingTimeModeList[5].distanceInKilometers.toString(), + type: mode.ProjectAvgERWaitingTimeModeList[5].iD.toString(), ), flex: 0, @@ -168,11 +164,11 @@ class NearestEr extends StatelessWidget { child: CardPosition( - text: mode.ProjectAvgERWaitingTimeModeList[mode.ProjectAvgERWaitingTimeModeList.length-1].projectName, + text: mode.ProjectAvgERWaitingTimeModeList[6].projectName.toString(), image: 'assets/images/new-design/find_us_icon.png', - subText: mode.ProjectAvgERWaitingTimeModeList[mode.ProjectAvgERWaitingTimeModeList.length-1].distanceInKilometers.toString(), - type: mode.ProjectAvgERWaitingTimeModeList[mode.ProjectAvgERWaitingTimeModeList.length-1].iD.toString(), + subText: mode.ProjectAvgERWaitingTimeModeList[6].distanceInKilometers.toString(), + type: mode.ProjectAvgERWaitingTimeModeList[6].iD.toString(), ), flex: 0, ), diff --git a/lib/pages/ErService/widgets/card_position.dart b/lib/pages/ErService/widgets/card_position.dart index 35e875fc..73ab318a 100644 --- a/lib/pages/ErService/widgets/card_position.dart +++ b/lib/pages/ErService/widgets/card_position.dart @@ -25,11 +25,13 @@ class CardPosition extends StatelessWidget { print("=============this.type============="+this.type); }, child: Container( + width:190, margin: EdgeInsets.fromLTRB(7.0, 7.0, 7.0, 7.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( @@ -62,10 +64,7 @@ class CardPosition extends StatelessWidget { Future navigateToSearch(context, type) async { //===Switch case=== - if(type==0) - {print("========Ambalunce=========");} - else{ - print("=========Nearest ER==========="); + print("================"+type); // Navigator.push( // context, @@ -75,5 +74,5 @@ class CardPosition extends StatelessWidget { } } -} + From 2ef36d3d8a44faa60db359657d0aa37e17a25cac Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Mon, 7 Sep 2020 16:41:53 +0300 Subject: [PATCH 23/45] ER --- lib/pages/ErService/ErOptions.dart | 1 + lib/pages/ErService/NearestEr.dart | 15 +++++++++++++++ lib/pages/ErService/widgets/card_position.dart | 11 ++++++++--- 3 files changed, 24 insertions(+), 3 deletions(-) diff --git a/lib/pages/ErService/ErOptions.dart b/lib/pages/ErService/ErOptions.dart index 2d22f262..6b6166bb 100644 --- a/lib/pages/ErService/ErOptions.dart +++ b/lib/pages/ErService/ErOptions.dart @@ -55,6 +55,7 @@ class _ErOptionsState extends State { text: TranslationBase.of(context).ambulancerequest, subText: TranslationBase.of(context).requestA, type: 0, + ), ), Expanded( diff --git a/lib/pages/ErService/NearestEr.dart b/lib/pages/ErService/NearestEr.dart index 623871f6..eb6e6981 100644 --- a/lib/pages/ErService/NearestEr.dart +++ b/lib/pages/ErService/NearestEr.dart @@ -60,6 +60,8 @@ class NearestEr extends StatelessWidget { subText: mode.ProjectAvgERWaitingTimeModeList[0].distanceInKilometers.toString(), type: mode.ProjectAvgERWaitingTimeModeList[0].iD.toString(), + telephone: mode.ProjectAvgERWaitingTimeModeList[0].phoneNumber.toString(), + networkImage: mode.ProjectAvgERWaitingTimeModeList[0].projectImageURL.toString(), ), flex: 0, @@ -73,6 +75,8 @@ class NearestEr extends StatelessWidget { subText: mode.ProjectAvgERWaitingTimeModeList[1].distanceInKilometers.toString(), type: mode.ProjectAvgERWaitingTimeModeList[1].iD.toString(), + telephone: mode.ProjectAvgERWaitingTimeModeList[1].phoneNumber.toString(), + networkImage: mode.ProjectAvgERWaitingTimeModeList[1].projectImageURL.toString(), ), flex: 0, @@ -96,6 +100,9 @@ class NearestEr extends StatelessWidget { subText: mode.ProjectAvgERWaitingTimeModeList[2].distanceInKilometers.toString(), type: mode.ProjectAvgERWaitingTimeModeList[2].iD.toString(), + telephone: mode.ProjectAvgERWaitingTimeModeList[2].phoneNumber.toString(), + networkImage: mode.ProjectAvgERWaitingTimeModeList[2].projectImageURL.toString(), + ), flex: 0, ), @@ -112,6 +119,8 @@ class NearestEr extends StatelessWidget { subText: mode.ProjectAvgERWaitingTimeModeList[3].distanceInKilometers.toString(), type: mode.ProjectAvgERWaitingTimeModeList[3].iD.toString(), + telephone: mode.ProjectAvgERWaitingTimeModeList[3].phoneNumber.toString(), + networkImage: mode.ProjectAvgERWaitingTimeModeList[3].projectImageURL.toString(), ), flex: 0, ) @@ -134,6 +143,8 @@ class NearestEr extends StatelessWidget { subText: mode.ProjectAvgERWaitingTimeModeList[4].distanceInKilometers.toString(), type: mode.ProjectAvgERWaitingTimeModeList[4].iD.toString(), + telephone: mode.ProjectAvgERWaitingTimeModeList[4].phoneNumber.toString(), + networkImage: mode.ProjectAvgERWaitingTimeModeList[4].projectImageURL.toString(), ), flex: 0, ), @@ -150,6 +161,8 @@ class NearestEr extends StatelessWidget { subText: mode.ProjectAvgERWaitingTimeModeList[5].distanceInKilometers.toString(), type: mode.ProjectAvgERWaitingTimeModeList[5].iD.toString(), + telephone: mode.ProjectAvgERWaitingTimeModeList[5].phoneNumber.toString(), + networkImage: mode.ProjectAvgERWaitingTimeModeList[5].projectImageURL.toString(), ), flex: 0, @@ -169,6 +182,8 @@ class NearestEr extends StatelessWidget { subText: mode.ProjectAvgERWaitingTimeModeList[6].distanceInKilometers.toString(), type: mode.ProjectAvgERWaitingTimeModeList[6].iD.toString(), + telephone: mode.ProjectAvgERWaitingTimeModeList[6].phoneNumber.toString(), + networkImage: mode.ProjectAvgERWaitingTimeModeList[6].projectImageURL.toString(), ), flex: 0, ), diff --git a/lib/pages/ErService/widgets/card_position.dart b/lib/pages/ErService/widgets/card_position.dart index 73ab318a..4088c8c7 100644 --- a/lib/pages/ErService/widgets/card_position.dart +++ b/lib/pages/ErService/widgets/card_position.dart @@ -10,18 +10,22 @@ class CardPosition extends StatelessWidget { final text; final subText; final type; + final telephone; + final networkImage; const CardPosition( { @required this.image, @required this.text, @required this.subText, - @required this.type}); + @required this.type, + @required this.telephone, + @required this.networkImage }); @override Widget build(BuildContext context) { return GestureDetector( onTap: () { - navigateToSearch(context, this.type); + navigateToSearch(context, this.type,this.telephone,this.networkImage); print("=============this.type============="+this.type); }, child: Container( @@ -62,9 +66,10 @@ class CardPosition extends StatelessWidget { ); } - Future navigateToSearch(context, type) async { + Future navigateToSearch(context, type,telephone,networkImage) async { //===Switch case=== print("================"+type); + print("================"+telephone); // Navigator.push( // context, From 5485cbab36b7930065f522a89bd8063db59ea2dc Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Mon, 7 Sep 2020 16:58:59 +0300 Subject: [PATCH 24/45] ER --- .../ErService/widgets/card_position.dart | 20 ++++++++++++++----- pubspec.yaml | 3 ++- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/lib/pages/ErService/widgets/card_position.dart b/lib/pages/ErService/widgets/card_position.dart index 4088c8c7..88b0fe42 100644 --- a/lib/pages/ErService/widgets/card_position.dart +++ b/lib/pages/ErService/widgets/card_position.dart @@ -2,6 +2,7 @@ import 'package:diplomaticquarterapp/config/size_config.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/Search.dart'; import 'package:flutter/material.dart'; +import 'package:giffy_dialog/giffy_dialog.dart'; import '../NearestEr.dart'; @@ -70,12 +71,21 @@ class CardPosition extends StatelessWidget { //===Switch case=== print("================"+type); print("================"+telephone); + print("================"+networkImage); + + showDialog( + context: context,builder: (_) => AssetGiffyDialog(image:Image.network(networkImage, fit: BoxFit.cover,), + title: Text('Men Wearing Jackets', + style: TextStyle( + fontSize: 22.0, fontWeight: FontWeight.w600), + ), + description: Text('This is a men wearing jackets dialog box.This library helps you easily create fancy giffy dialog.', + textAlign: TextAlign.center, + style: TextStyle(), + ), + onOkButtonPressed: () {}, + ) ); -// Navigator.push( -// context, -// MaterialPageRoute( -// builder: (context) => NearestEr(isAppbar: true,))); -// } } diff --git a/pubspec.yaml b/pubspec.yaml index f4c5e5c2..814f1fac 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -31,7 +31,8 @@ dependencies: # Permissions permission_handler: ^5.0.0+hotfix.3 device_info: ^0.4.2+4 - +#popub + giffy_dialog: ^1.8.0 # Native flutter_device_type: ^0.2.0 local_auth: ^0.6.2+3 From 153335538a3a8d52153e08efbafa76004c45a393 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Mon, 7 Sep 2020 17:59:58 +0300 Subject: [PATCH 25/45] done monthly reports --- lib/config/config.dart | 4 + lib/config/localized_values.dart | 8 + lib/core/service/medical/reports_service.dart | 35 +++- .../medical/reports_monthly_view_model.dart | 58 ++----- lib/main.dart | 2 +- lib/pages/medical/medical_profile_page.dart | 17 +- .../medical/reports/monthly_reports.dart | 153 +++++++++++++++++- .../medical/reports/user_agreement_page.dart | 25 +++ lib/uitl/translations_delegate_base.dart | 11 +- lib/widgets/buttons/secondary_button.dart | 2 +- lib/widgets/input/custom_switch.dart | 2 +- pubspec.yaml | 5 +- 12 files changed, 257 insertions(+), 65 deletions(-) create mode 100644 lib/pages/medical/reports/user_agreement_page.dart diff --git a/lib/config/config.dart b/lib/config/config.dart index 0165cb1b..a0bf52be 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -148,6 +148,10 @@ const CANCEL_LIVECARE_REQUEST = 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'; + //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 696e2665..f50ea02c 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -451,4 +451,12 @@ const Map> localizedValues = { "MonthlyReports": {"en": "Monthly Reports", "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": "السماح لتطبيق مجموعة الحبيب الطبية بالوصول إلى موقعك سيساعدك في إظهار المستشفيات وفقًا للأقرب إليك."}, "km":{"en":"KMs:","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":"أوافق على الشروط والاحكام "}, + "IAgreeToTheTermsAndConditionsSubtitle":{"en":"I agree to the terms and conditions ","ar":"هذا ملخص التقرير الصحي الشهري و الذي يسرد المؤشرات الصحية و نتائج التحاليل لأخر الزيارات. يرجى ملاحظة أن هذا التقرير هو تقرير يتم ارساله بشكل آلي من النظام و لا يعتبر رسمي و لا تؤخذ عليه أي قرارات طبية"}, + "Save":{"en":"Save","ar":"حفظ "}, + "UserAgreement":{"en":"User Agreement","ar":"اتفاقية الخصوصية "}, + "UpdateSuccessfully":{"en":"Update Successfully","ar":"تم التحديث بنجاح"}, }; diff --git a/lib/core/service/medical/reports_service.dart b/lib/core/service/medical/reports_service.dart index b8e5f426..316872ed 100644 --- a/lib/core/service/medical/reports_service.dart +++ b/lib/core/service/medical/reports_service.dart @@ -7,7 +7,7 @@ import 'package:diplomaticquarterapp/pages/feedback/appointment_history.dart'; class ReportsService extends BaseService { List reportsList = List(); List appointHistoryList = List(); - + String userAgreementContent = ""; RequestReports _requestReports = RequestReports( isReport: true, encounterType: 1, @@ -44,7 +44,7 @@ class ReportsService extends BaseService { hasError = false; Map body = new Map(); body['IsForMedicalReport'] = true; - await baseAppClient.post(GET_PATIENT_AppointmentHistory, + await baseAppClient.post(GET_PATIENT_AppointmentHistory, onSuccess: (dynamic response, int statusCode) { appointHistoryList = []; response['AppoimentAllHistoryResultList'].forEach((appoint) { @@ -56,6 +56,33 @@ class ReportsService extends BaseService { }, body: body); } + 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()); + } + + + Future updatePatientHealthSummaryReport({bool isSummary}) async { + Map body = Map(); + body['RSummaryReport'] = isSummary; + hasError = false; + await baseAppClient.post(UPDATE_HEALTH_TERMS, + onSuccess: (dynamic response, int statusCode) { + + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } + + + Future insertRequestForMedicalReport( AppointmentHistory appointmentHistory) async { Map body = new Map(); @@ -63,7 +90,7 @@ class ReportsService extends BaseService { body['DoctorID'] = appointmentHistory.doctorID; body['SetupID'] = appointmentHistory.setupID; body['EncounterNo'] = appointmentHistory.appointmentNo; - body['EncounterType'] = 1;// appointmentHistory.appointmentType; + body['EncounterType'] = 1; // appointmentHistory.appointmentType; body['IsActive'] = appointmentHistory.isActiveDoctor; body['ProjectID'] = appointmentHistory.projectID; body['Remarks'] = ""; @@ -73,7 +100,7 @@ class ReportsService extends BaseService { body['Status'] = 1; body['CreatedBy'] = 102; hasError = false; - await baseAppClient.post(INSERT_REQUEST_FOR_MEDICAL_REPORT, + await baseAppClient.post(INSERT_REQUEST_FOR_MEDICAL_REPORT, onSuccess: (dynamic response, int statusCode) {}, onFailure: (String error, int statusCode) { hasError = true; diff --git a/lib/core/viewModels/medical/reports_monthly_view_model.dart b/lib/core/viewModels/medical/reports_monthly_view_model.dart index 2e5952ae..3ae196f5 100644 --- a/lib/core/viewModels/medical/reports_monthly_view_model.dart +++ b/lib/core/viewModels/medical/reports_monthly_view_model.dart @@ -13,72 +13,34 @@ class ReportsMonthlyViewModel extends BaseViewModel { ReportsService _reportsService = locator(); - List reportsOrderRequestList = List(); - List reportsOrderReadyList = List(); - List reportsOrderCompletedList = List(); - List reportsOrderCanceledList = List(); - List get appointHistoryList => - _reportsService.appointHistoryList; - getReports() async { + String get userAgreementContent => _reportsService.userAgreementContent; + + getUserTermsAndConditions() async{ setState(ViewState.Busy); - reportsOrderRequestList.clear(); - reportsOrderReadyList.clear(); - reportsOrderCompletedList.clear(); - reportsOrderCanceledList.clear(); - await _reportsService.getReports(); + await _reportsService.getUserTermsAndConditions(); if (_reportsService.hasError) { error = _reportsService.error; setState(ViewState.Error); } else { - _filterList(); setState(ViewState.Idle); } } - getPatentAppointmentHistory() async { - setState(ViewState.Busy); - await _reportsService.getPatentAppointmentHistory(); + updatePatientHealthSummaryReport({String message, bool isSummary})async{ + setState(ViewState.BusyLocal); + await _reportsService.updatePatientHealthSummaryReport(isSummary: isSummary); if (_reportsService.hasError) { error = _reportsService.error; - setState(ViewState.Error); + AppToast.showErrorToast(message: error); + setState(ViewState.ErrorLocal); } else { + AppToast.showSuccessToast(message: message); setState(ViewState.Idle); } } - void _filterList() { - _reportsService.reportsList.forEach((report) { - switch (report.status) { - case 1: - reportsOrderRequestList.add(report); - break; - case 2: - reportsOrderReadyList.add(report); - break; - case 3: - reportsOrderCompletedList.add(report); - break; - case 4: - reportsOrderCanceledList.add(report); - break; - default: - } - }); - } - insertRequestForMedicalReport(AppointmentHistory appointmentHistory)async{ - setState(ViewState.Busy); - await _reportsService.insertRequestForMedicalReport(appointmentHistory); - if (_reportsService.hasError) { - error = _reportsService.error; - AppToast.showErrorToast(message: error); - setState(ViewState.ErrorLocal); - } else { - AppToast.showSuccessToast(message: 'The order was send '); - setState(ViewState.Idle); - } - } } diff --git a/lib/main.dart b/lib/main.dart index f641f22e..0c6b2760 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -66,7 +66,7 @@ class MyApp extends StatelessWidget { hintColor: Colors.grey[400], disabledColor: Colors.grey[300], errorColor: Color.fromRGBO(235, 80, 60, 1.0), - scaffoldBackgroundColor:Hexcolor('#E0E0E0'),// Colors.grey[100], + scaffoldBackgroundColor:Hexcolor('#E9E9E9'),// Colors.grey[100], textSelectionColor: Color.fromRGBO(80, 100, 253, 0.5), textSelectionHandleColor: Color.fromRGBO(80, 100, 253, 1.0), canvasColor: Colors.white, diff --git a/lib/pages/medical/medical_profile_page.dart b/lib/pages/medical/medical_profile_page.dart index 5dccb514..e78e18a9 100644 --- a/lib/pages/medical/medical_profile_page.dart +++ b/lib/pages/medical/medical_profile_page.dart @@ -5,6 +5,7 @@ import 'package:diplomaticquarterapp/core/viewModels/medical/medical_view_model. import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/MyAppointments/MyAppointments.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/pages/medical/reports/monthly_reports.dart'; import 'package:diplomaticquarterapp/pages/vaccine/my_vaccines_screen.dart'; import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescriptions_home_page.dart'; import 'package:diplomaticquarterapp/pages/medical/radiology/radiology_home_page.dart'; @@ -329,11 +330,17 @@ class _MedicalProfilePageState extends State { ), Expanded( flex: 1, - child: MedicalProfileItem( - title: TranslationBase.of(context).monthly, - imagePath: 'medical_history_icon.png', - subTitle: TranslationBase.of(context) - .monthlySubtitle, + child: InkWell( + onTap: (){ + Navigator.push(context, + FadePage(page: MonthlyReportsPage())); + }, + child: MedicalProfileItem( + title: TranslationBase.of(context).monthly, + imagePath: 'medical_history_icon.png', + subTitle: TranslationBase.of(context) + .monthlySubtitle, + ), ), ), ]), diff --git a/lib/pages/medical/reports/monthly_reports.dart b/lib/pages/medical/reports/monthly_reports.dart index 9c913705..ae9cc295 100644 --- a/lib/pages/medical/reports/monthly_reports.dart +++ b/lib/pages/medical/reports/monthly_reports.dart @@ -1,17 +1,166 @@ +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/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/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +class MonthlyReportsPage extends StatefulWidget { + @override + _MonthlyReportsPageState createState() => _MonthlyReportsPageState(); +} + +class _MonthlyReportsPageState extends State { + bool isAgree = false; + bool isSummary = false; -class MonthlyReportsPage extends StatelessWidget { @override Widget build(BuildContext context) { return BaseView( builder: (_, model, w) => AppScaffold( isShowAppBar: true, appBarTitle: TranslationBase.of(context).monthlyReports, - body: Container(), + 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; + }); + }, + ) + ], + ), + ), + SizedBox( + height: 15, + ), + Container( + margin: EdgeInsets.all(8), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Texts( + model.user.emailAddress, + bold: true, + ), + ], + ), + ), + 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: [ + Checkbox( + value: isAgree, + onChanged: (value) { + setState(() { + isAgree = !isAgree; + }); + }, + 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, + ), + ), + SizedBox( + height: 12, + ), + Center(child: Image.asset('assets/images/report.jpg')) + ], + ), + ), + ), ), ); } diff --git a/lib/pages/medical/reports/user_agreement_page.dart b/lib/pages/medical/reports/user_agreement_page.dart new file mode 100644 index 00000000..9bb886e3 --- /dev/null +++ b/lib/pages/medical/reports/user_agreement_page.dart @@ -0,0 +1,25 @@ +import 'package:diplomaticquarterapp/core/viewModels/medical/reports_monthly_view_model.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 UserAgreementContent extends StatelessWidget { + @override + Widget build(BuildContext context) { + return BaseView( + onModelReady: (model) => model.getUserTermsAndConditions(), + builder: (_, model, w) => AppScaffold( + isShowAppBar: true, + baseViewModel: model, + appBarTitle: TranslationBase.of(context).userAgreement, + body: SingleChildScrollView( + child: Html( + data: model.userAgreementContent, + ), + ), + ), + ); + } +} diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index 6f069e9c..41a5a537 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -512,8 +512,15 @@ class TranslationBase { String get locationDialogMessage => localizedValues['locationDialogMessage'][locale.languageCode]; - String get km => - localizedValues['km'][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 clickHere => localizedValues['ClickHere'][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]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/widgets/buttons/secondary_button.dart b/lib/widgets/buttons/secondary_button.dart index d805fc94..65bb8d36 100644 --- a/lib/widgets/buttons/secondary_button.dart +++ b/lib/widgets/buttons/secondary_button.dart @@ -171,7 +171,7 @@ class _SecondaryButtonState extends State width: MediaQuery.of(context).size.width, height: 100, decoration: BoxDecoration( - color: Theme.of(context).disabledColor, + color: Theme.of(context).primaryColor, ), ), ), diff --git a/lib/widgets/input/custom_switch.dart b/lib/widgets/input/custom_switch.dart index 338bdcf2..ddd1d77b 100644 --- a/lib/widgets/input/custom_switch.dart +++ b/lib/widgets/input/custom_switch.dart @@ -34,7 +34,7 @@ class _CustomSwitchState extends State void initState() { super.initState(); _animationController = - AnimationController(vsync: this, duration: Duration(milliseconds: 800)); + AnimationController(vsync: this, duration: Duration(milliseconds: 500)); _circleAnimation = Tween(begin: 0.0, end: 30.0).animate(CurvedAnimation( parent: _animationController, curve: Curves.easeOutQuint, diff --git a/pubspec.yaml b/pubspec.yaml index 918bca3a..ea73a56b 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -32,6 +32,9 @@ dependencies: permission_handler: ^5.0.0+hotfix.3 device_info: ^0.4.2+4 + # Flutter Html View + flutter_html: ^1.0.2 + # Native flutter_device_type: ^0.2.0 local_auth: ^0.6.2+3 @@ -77,7 +80,7 @@ dependencies: table_calendar: ^2.2.3 # SVG Images - flutter_svg: ^0.17.4 + flutter_svg: ^0.18.0 # Location Helper map_launcher: ^0.8.1 From 629251d2167e9b743c291bc5b9e18ed95adf07d2 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Mon, 7 Sep 2020 18:10:21 +0300 Subject: [PATCH 26/45] ER --- lib/pages/ErService/NearestEr.dart | 26 ++++++++-- .../ErService/widgets/card_position.dart | 48 +++++++++++++++---- 2 files changed, 61 insertions(+), 13 deletions(-) diff --git a/lib/pages/ErService/NearestEr.dart b/lib/pages/ErService/NearestEr.dart index eb6e6981..64ca8682 100644 --- a/lib/pages/ErService/NearestEr.dart +++ b/lib/pages/ErService/NearestEr.dart @@ -62,6 +62,9 @@ class NearestEr extends StatelessWidget { 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 , ), flex: 0, @@ -77,6 +80,9 @@ class NearestEr extends StatelessWidget { 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 , ), flex: 0, @@ -102,6 +108,9 @@ class NearestEr extends StatelessWidget { 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 , ), flex: 0, @@ -121,6 +130,9 @@ class NearestEr extends StatelessWidget { 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, ) @@ -145,17 +157,15 @@ class NearestEr extends StatelessWidget { 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 , ), flex: 0, ), Expanded( child: CardPosition( -// mode -// .vitalSignResModelList[ -// mode.vitalSignResModelList.length - 1] -// .heightCm -// .toString() text: mode.ProjectAvgERWaitingTimeModeList[5].projectName.toString(), image: 'assets/images/new-design/find_us_icon.png', @@ -163,6 +173,9 @@ class NearestEr extends StatelessWidget { 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 , ), flex: 0, @@ -184,6 +197,9 @@ class NearestEr extends StatelessWidget { 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 88b0fe42..05141351 100644 --- a/lib/pages/ErService/widgets/card_position.dart +++ b/lib/pages/ErService/widgets/card_position.dart @@ -3,6 +3,9 @@ import 'package:diplomaticquarterapp/config/size_config.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/Search.dart'; import 'package:flutter/material.dart'; import 'package:giffy_dialog/giffy_dialog.dart'; +import 'package:url_launcher/url_launcher.dart'; +import 'package:maps_launcher/maps_launcher.dart'; + import '../NearestEr.dart'; @@ -13,6 +16,9 @@ class CardPosition extends StatelessWidget { final type; final telephone; final networkImage; + final latitude; + final longitude; + final projectname; const CardPosition( { @required this.image, @@ -20,13 +26,17 @@ class CardPosition extends StatelessWidget { @required this.subText, @required this.type, @required this.telephone, - @required this.networkImage }); + @required this.networkImage , + @required this.latitude, + @required this.longitude, + @required this.projectname , + }); @override Widget build(BuildContext context) { return GestureDetector( onTap: () { - navigateToSearch(context, this.type,this.telephone,this.networkImage); + navigateToSearch(context, this.type,this.telephone,this.networkImage,this.latitude,this.longitude,this.projectname); print("=============this.type============="+this.type); }, child: Container( @@ -67,23 +77,45 @@ class CardPosition extends StatelessWidget { ); } - Future navigateToSearch(context, type,telephone,networkImage) async { + Future navigateToSearch(context, type,telephone,networkImage,latitude,longitude,projectname) async { + //===Switch case=== print("================"+type); print("================"+telephone); print("================"+networkImage); showDialog( - context: context,builder: (_) => AssetGiffyDialog(image:Image.network(networkImage, fit: BoxFit.cover,), - title: Text('Men Wearing Jackets', + context: context,builder: (_) => AssetGiffyDialog( + title: Text(projectname, style: TextStyle( fontSize: 22.0, fontWeight: FontWeight.w600), - ), - description: Text('This is a men wearing jackets dialog box.This library helps you easily create fancy giffy dialog.', + ),image:Image.network(networkImage, fit: BoxFit.cover,), + description: Text('projectname', textAlign: TextAlign.center, style: TextStyle(), ), - onOkButtonPressed: () {}, + onOkButtonPressed: () { MapsLauncher.launchCoordinates(double.parse(latitude),double.parse(longitude),projectname);}, + onCancelButtonPressed :() {launch("tel://" +telephone);} + +// double.parse( +// _medicineProvider.pharmaciesList[index]["Latitude"]), +// double.parse( +// _medicineProvider.pharmaciesList[index]["Longitude"]), +// _medicineProvider.pharmaciesList[index] +// ["LocationDescription"]); + //launch("tel://" +telephone); +//================ +// MapsLauncher.launchCoordinates( +// double.parse( +// _medicineProvider.pharmaciesList[index]["Latitude"]), +// double.parse( +// _medicineProvider.pharmaciesList[index]["Longitude"]), +// _medicineProvider.pharmaciesList[index] +// ["LocationDescription"]); +//================= + + + ) ); } From 294a7523384fb94871bb190dae1338e8fe943efe Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Tue, 8 Sep 2020 10:55:20 +0300 Subject: [PATCH 27/45] ER --- lib/core/service/er/er_service.dart | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/core/service/er/er_service.dart b/lib/core/service/er/er_service.dart index 779efdc1..87367f62 100644 --- a/lib/core/service/er/er_service.dart +++ b/lib/core/service/er/er_service.dart @@ -1,9 +1,11 @@ import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/core/model/er/projectavgerwaitingtime.dart'; import '../base_service.dart'; class ErService extends BaseService { List projectAvgERWaitingTimeModelList = List(); + Map body = Map(); String Latitude = ""; String Longitude = ""; @@ -16,6 +18,10 @@ class ErService extends BaseService { body['ID'] = id; body['ProjectID'] = projectID; } + var lat = await sharedPref.getDouble(USER_LAT); + var long = await sharedPref.getDouble(USER_LONG); + body['Latitude'] = lat; + body['Longitude'] = long; await baseAppClient.post(GET_NEAREST_HOSPITAL, onSuccess: (dynamic response, int statusCode) { @@ -34,6 +40,4 @@ class ErService extends BaseService { super.error = error; }, body: body); } - - } From ed1c04ab2569147abb098aba5477aa9936745da1 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Tue, 8 Sep 2020 10:57:46 +0300 Subject: [PATCH 28/45] ER --- lib/config/config.dart | 2 +- .../model/er/projectavgerwaitingtime.dart | 56 ++++++++++++++++++- .../ErService/widgets/card_position.dart | 2 +- 3 files changed, 56 insertions(+), 4 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 8ce2bdf2..a5210914 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -56,6 +56,7 @@ const GET_NEAREST_HOSPITAL= + ///Reports const REPORTS = 'Services/Doctors.svc/REST/GetPatientMedicalReportStatusInfo'; const INSERT_REQUEST_FOR_MEDICAL_REPORT = @@ -160,7 +161,6 @@ const SESSION_ID = 'TMRhVmkGhOsvamErw'; const IS_DENTAL_ALLOWED_BACKEND = false; const PATIENT_TYPE = 1; const PATIENT_TYPE_ID = 1; - var DeviceTypeID = Platform.isIOS ? 1 : 2; const LANGUAGE_ID = 2; const GET_PHARMCY_ITEMS = "Services/Lists.svc/REST/GetPharmcyItems_Region"; diff --git a/lib/core/model/er/projectavgerwaitingtime.dart b/lib/core/model/er/projectavgerwaitingtime.dart index f999d46f..9b21ec66 100644 --- a/lib/core/model/er/projectavgerwaitingtime.dart +++ b/lib/core/model/er/projectavgerwaitingtime.dart @@ -3,7 +3,7 @@ class ProjectAvgERWaitingTime { int projectID; int avgTimeInMinutes; String avgTimeInHHMM; - int distanceInKilometers; + dynamic distanceInKilometers; String latitude; String longitude; String phoneNumber; @@ -49,4 +49,56 @@ class ProjectAvgERWaitingTime { data['ProjectName'] = this.projectName; return data; } -} \ No newline at end of file +} +//class ProjectAvgERWaitingTime { +// int iD; +// int projectID; +// int avgTimeInMinutes; +// String avgTimeInHHMM; +// String distanceInKilometers; +// String latitude; +// String longitude; +// String phoneNumber; +// String projectImageURL; +// String projectName; +// +// ProjectAvgERWaitingTime( +// {this.iD, +// this.projectID, +// this.avgTimeInMinutes, +// this.avgTimeInHHMM, +// this.distanceInKilometers, +// this.latitude, +// this.longitude, +// this.phoneNumber, +// this.projectImageURL, +// this.projectName}); +// +// ProjectAvgERWaitingTime.fromJson(Map json) { +// iD = json['ID']; +// projectID = json['ProjectID']; +// avgTimeInMinutes = json['AvgTimeInMinutes']; +// avgTimeInHHMM = json['AvgTimeInHHMM']; +// distanceInKilometers = json['DistanceInKilometers']; +// latitude = json['Latitude']; +// longitude = json['Longitude']; +// phoneNumber = json['PhoneNumber']; +// projectImageURL = json['ProjectImageURL']; +// projectName = json['ProjectName']; +// } +// +// Map toJson() { +// final Map data = new Map(); +// data['ID'] = this.iD; +// data['ProjectID'] = this.projectID; +// data['AvgTimeInMinutes'] = this.avgTimeInMinutes; +// data['AvgTimeInHHMM'] = this.avgTimeInHHMM; +// data['DistanceInKilometers'] = this.distanceInKilometers; +// data['Latitude'] = this.latitude; +// data['Longitude'] = this.longitude; +// data['PhoneNumber'] = this.phoneNumber; +// data['ProjectImageURL'] = this.projectImageURL; +// data['ProjectName'] = this.projectName; +// return data; +// } +//} \ No newline at end of file diff --git a/lib/pages/ErService/widgets/card_position.dart b/lib/pages/ErService/widgets/card_position.dart index 05141351..572d52f0 100644 --- a/lib/pages/ErService/widgets/card_position.dart +++ b/lib/pages/ErService/widgets/card_position.dart @@ -37,7 +37,7 @@ class CardPosition extends StatelessWidget { return GestureDetector( onTap: () { navigateToSearch(context, this.type,this.telephone,this.networkImage,this.latitude,this.longitude,this.projectname); - print("=============this.type============="+this.type); + }, child: Container( width:190, From 50d1e50df47c8b0be63f01c8c425ff53d1d4ae8b Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Tue, 8 Sep 2020 12:57:31 +0300 Subject: [PATCH 29/45] ER --- lib/pages/ErService/NearestEr.dart | 7 ++++--- lib/pages/ErService/widgets/card_position.dart | 5 +++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/pages/ErService/NearestEr.dart b/lib/pages/ErService/NearestEr.dart index 64ca8682..1cc741ff 100644 --- a/lib/pages/ErService/NearestEr.dart +++ b/lib/pages/ErService/NearestEr.dart @@ -35,11 +35,12 @@ class NearestEr extends StatelessWidget { child: ListView( children: [ - Text(TranslationBase.of(context).searchBy, + Text("\nThis service Displays nearest branch\n among all the branches of All Habib \n medical Group based on your current Location",textAlign: TextAlign.center, style: TextStyle( - fontSize: 24.0, + fontSize: 18.0, letterSpacing: 1.0, - fontWeight: FontWeight.bold, + fontWeight: FontWeight.w900, + color: new Color(0xFF60686b))), Container( margin: EdgeInsets.fromLTRB(0.0, 10.0, 0.0, 10.0), diff --git a/lib/pages/ErService/widgets/card_position.dart b/lib/pages/ErService/widgets/card_position.dart index 572d52f0..28184103 100644 --- a/lib/pages/ErService/widgets/card_position.dart +++ b/lib/pages/ErService/widgets/card_position.dart @@ -93,7 +93,12 @@ class CardPosition extends StatelessWidget { description: Text('projectname', textAlign: TextAlign.center, style: TextStyle(), + ), + buttonOkText:Text("LOCATION"), + buttonOkColor: Colors.grey, + buttonCancelText:Text('CAll') , + buttonCancelColor: Colors.grey, onOkButtonPressed: () { MapsLauncher.launchCoordinates(double.parse(latitude),double.parse(longitude),projectname);}, onCancelButtonPressed :() {launch("tel://" +telephone);} From ddf53ce999063f6876c44f24d32e30c4d87daf60 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Tue, 8 Sep 2020 13:44:13 +0300 Subject: [PATCH 30/45] ER --- lib/pages/ErService/widgets/card_position.dart | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/lib/pages/ErService/widgets/card_position.dart b/lib/pages/ErService/widgets/card_position.dart index 28184103..f8077fe0 100644 --- a/lib/pages/ErService/widgets/card_position.dart +++ b/lib/pages/ErService/widgets/card_position.dart @@ -90,11 +90,7 @@ class CardPosition extends StatelessWidget { style: TextStyle( fontSize: 22.0, fontWeight: FontWeight.w600), ),image:Image.network(networkImage, fit: BoxFit.cover,), - description: Text('projectname', - textAlign: TextAlign.center, - style: TextStyle(), - - ), + buttonOkText:Text("LOCATION"), buttonOkColor: Colors.grey, buttonCancelText:Text('CAll') , From e6384646570028ccc1520cbe5ce8ed07f2ef1777 Mon Sep 17 00:00:00 2001 From: Amjad amireh Date: Tue, 8 Sep 2020 14:21:28 +0300 Subject: [PATCH 31/45] edit card_position.dart --- lib/pages/ErService/widgets/card_position.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/pages/ErService/widgets/card_position.dart b/lib/pages/ErService/widgets/card_position.dart index f8077fe0..4c649fc5 100644 --- a/lib/pages/ErService/widgets/card_position.dart +++ b/lib/pages/ErService/widgets/card_position.dart @@ -90,7 +90,7 @@ class CardPosition extends StatelessWidget { style: TextStyle( fontSize: 22.0, fontWeight: FontWeight.w600), ),image:Image.network(networkImage, fit: BoxFit.cover,), - + buttonOkText:Text("LOCATION"), buttonOkColor: Colors.grey, buttonCancelText:Text('CAll') , From 9159928e27480404d6e91a7c83667da71f8dcebd Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Tue, 8 Sep 2020 15:08:13 +0300 Subject: [PATCH 32/45] edit on vaccine service --- lib/config/localized_values.dart | 2 +- lib/core/model/vaccine/my_vaccine.dart | 203 +++++--- lib/core/service/vaccine_service.dart | 45 +- lib/core/viewModels/vaccine_view_model.dart | 16 + .../insurance/insurance_card_screen.dart | 191 ++++---- lib/pages/landing/home_page.dart | 5 + lib/pages/vaccine/my_vaccines_screen.dart | 459 +++++++----------- 7 files changed, 456 insertions(+), 465 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index f50ea02c..c0693161 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -421,7 +421,7 @@ const Map> localizedValues = { "MyVaccines": {"en": "My Vaccines", "ar": "تطعيماتي"}, "MyVaccinesSubtitle": {"en": "List", "ar": "قائمة"}, "Medical": {"en": "Medical", "ar": "التقارير"}, - "MedicalSubtitle": {"Report": "List", "ar": "الطبية"}, + "MedicalSubtitle": {"en": "Report", "ar": "الطبية"}, "Monthly": {"en": "Monthly", "ar": "تقارير"}, "MonthlySubtitle": {"en": "Report", "ar": "الشهرية"}, "Sick": {"en": "Sick", "ar": "الإجازات"}, diff --git a/lib/core/model/vaccine/my_vaccine.dart b/lib/core/model/vaccine/my_vaccine.dart index ac6e2e19..dc921c12 100644 --- a/lib/core/model/vaccine/my_vaccine.dart +++ b/lib/core/model/vaccine/my_vaccine.dart @@ -1,91 +1,152 @@ class VaccineModel { - String to; - String from; - double versionID; - int channel; - int languageID; - String iPAdress; - String generalid; - int patientOutSA; - String sessionID; - bool isDentalAllowedBackend; - int deviceTypeID; + String setupID; + int projectID; int patientID; - String tokenID; - int patientTypeID; - int patientType; + int invoiceNo; + String procedureID; + String vaccineName; + Null vaccineNameN; String invoiceDate; + int doctorID; + int clinicID; + String firstName; + String middleName; + String lastName; + Null firstNameN; + Null middleNameN; + Null lastNameN; + String dateofBirth; + int actualDoctorRate; + String age; + String clinicName; String doctorImageURL; String doctorName; + int doctorRate; String doctorTitle; + int gender; + String genderDescription; + bool isActiveDoctorProfile; + bool isDoctorAllowVedioCall; + bool isExecludeDoctor; + int noOfPatientsRate; + String patientName; String projectName; - String vaccineName; + String qR; + List speciality; + String vaccinationDate; - VaccineModel({ - this.to, - this.from, - this.versionID, - this.channel, - this.languageID, - this.iPAdress, - this.generalid, - this.patientOutSA, - this.sessionID, - this.isDentalAllowedBackend, - this.deviceTypeID, - this.patientID, - this.tokenID, - this.patientTypeID, - this.patientType, - this.invoiceDate, - this.doctorImageURL, - this.doctorName, - this.doctorTitle, - this.projectName, - this.vaccineName, - }); + VaccineModel( + {this.setupID, + this.projectID, + this.patientID, + this.invoiceNo, + this.procedureID, + this.vaccineName, + this.vaccineNameN, + this.invoiceDate, + this.doctorID, + this.clinicID, + this.firstName, + this.middleName, + this.lastName, + this.firstNameN, + this.middleNameN, + this.lastNameN, + this.dateofBirth, + this.actualDoctorRate, + this.age, + this.clinicName, + this.doctorImageURL, + this.doctorName, + this.doctorRate, + this.doctorTitle, + this.gender, + this.genderDescription, + this.isActiveDoctorProfile, + this.isDoctorAllowVedioCall, + this.isExecludeDoctor, + this.noOfPatientsRate, + this.patientName, + this.projectName, + this.qR, + this.speciality, + this.vaccinationDate}); VaccineModel.fromJson(Map json) { + setupID = json['SetupID']; + projectID = json['ProjectID']; + patientID = json['PatientID']; + invoiceNo = json['InvoiceNo']; + procedureID = json['ProcedureID']; vaccineName = json['VaccineName']; - projectName = json['ProjectName']; - doctorTitle = json['DoctorTitle']; - doctorName = json['DoctorName']; - doctorImageURL = json['DoctorImageURL']; + vaccineNameN = json['VaccineNameN']; invoiceDate = json['InvoiceDate']; - to = json['To']; - from = json['From']; - versionID = json['VersionID']; - channel = json['Channel']; - languageID = json['LanguageID']; - iPAdress = json['IPAdress']; - generalid = json['generalid']; - patientOutSA = json['PatientOutSA']; - sessionID = json['SessionID']; - isDentalAllowedBackend = json['isDentalAllowedBackend']; - deviceTypeID = json['DeviceTypeID']; - patientID = json['PatientID']; - tokenID = json['TokenID']; - patientTypeID = json['PatientTypeID']; - patientType = json['PatientType']; + doctorID = json['DoctorID']; + clinicID = json['ClinicID']; + firstName = json['FirstName']; + middleName = json['MiddleName']; + lastName = json['LastName']; + firstNameN = json['FirstNameN']; + middleNameN = json['MiddleNameN']; + lastNameN = json['LastNameN']; + dateofBirth = json['DateofBirth']; + actualDoctorRate = json['ActualDoctorRate']; + age = json['Age']; + clinicName = json['ClinicName']; + doctorImageURL = json['DoctorImageURL']; + doctorName = json['DoctorName']; + doctorRate = json['DoctorRate']; + doctorTitle = json['DoctorTitle']; + gender = json['Gender']; + genderDescription = json['GenderDescription']; + isActiveDoctorProfile = json['IsActiveDoctorProfile']; + isDoctorAllowVedioCall = json['IsDoctorAllowVedioCall']; + isExecludeDoctor = json['IsExecludeDoctor']; + noOfPatientsRate = json['NoOfPatientsRate']; + patientName = json['PatientName']; + projectName = json['ProjectName']; + qR = json['QR']; + speciality = json['Speciality'].cast(); + vaccinationDate = json['VaccinationDate']; } Map toJson() { final Map data = new Map(); - data['To'] = this.to; - data['From'] = this.from; - data['VersionID'] = this.versionID; - data['Channel'] = this.channel; - data['LanguageID'] = this.languageID; - data['IPAdress'] = this.iPAdress; - data['generalid'] = this.generalid; - data['PatientOutSA'] = this.patientOutSA; - data['SessionID'] = this.sessionID; - data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; - data['DeviceTypeID'] = this.deviceTypeID; + data['SetupID'] = this.setupID; + data['ProjectID'] = this.projectID; data['PatientID'] = this.patientID; - data['TokenID'] = this.tokenID; - data['PatientTypeID'] = this.patientTypeID; - data['PatientType'] = this.patientType; + data['InvoiceNo'] = this.invoiceNo; + data['ProcedureID'] = this.procedureID; + data['VaccineName'] = this.vaccineName; + data['VaccineNameN'] = this.vaccineNameN; + data['InvoiceDate'] = this.invoiceDate; + data['DoctorID'] = this.doctorID; + data['ClinicID'] = this.clinicID; + 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['DateofBirth'] = this.dateofBirth; + data['ActualDoctorRate'] = this.actualDoctorRate; + data['Age'] = this.age; + data['ClinicName'] = this.clinicName; + data['DoctorImageURL'] = this.doctorImageURL; + data['DoctorName'] = this.doctorName; + 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['NoOfPatientsRate'] = this.noOfPatientsRate; + data['PatientName'] = this.patientName; + data['ProjectName'] = this.projectName; + data['QR'] = this.qR; + data['Speciality'] = this.speciality; + data['VaccinationDate'] = this.vaccinationDate; return data; } } diff --git a/lib/core/service/vaccine_service.dart b/lib/core/service/vaccine_service.dart index 189e26d8..9904b838 100644 --- a/lib/core/service/vaccine_service.dart +++ b/lib/core/service/vaccine_service.dart @@ -7,25 +7,10 @@ class VaccineService extends BaseService { List get vaccineList => _vaccineList; - VaccineModel _vaccineModel = VaccineModel( - to: "0", - from: "0", - channel: 3, - deviceTypeID: 2, - generalid: "Cs2020@2016\$2958", - iPAdress: "10.20.10.20", - isDentalAllowedBackend: false, - languageID: 2, - patientID: 1231755, - patientOutSA: 0, - patientType: 1, - patientTypeID: 1, - sessionID: "uoKFXSLUwEaHYPwKZNA", - tokenID: "@dm!n", - versionID: 5.5, - ); - Future getMyVaccine() async { + Map body = Map(); + body['To'] = "0"; + body['From'] = "0"; hasError = false; _vaccineList.clear(); await baseAppClient.post(GET_VACCINES, @@ -36,8 +21,28 @@ class VaccineService extends BaseService { }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; - }, body: _vaccineModel.toJson()); + }, body: body); } - Future sendEmail() async {} + Future sendEmail() async { + + Map body = Map(); + body['ListVaccines'] = vaccineList.map((v) => v.toJson()).toList(); + body['ListVaccines'] = user.emailAddress; + body['DateofBirth'] = user.dateofBirth; + body['PatientIditificationNum'] = user.patientIdentificationNo; + body['PatientMobileNumber'] = user.mobileNumber; + body['PatientName'] = user.firstName + " "+ user.lastName; + + hasError = false; + + await baseAppClient.post(GET_VACCINES, + onSuccess: (dynamic response, int statusCode) { + + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + + } } diff --git a/lib/core/viewModels/vaccine_view_model.dart b/lib/core/viewModels/vaccine_view_model.dart index a3b6c057..233a945f 100644 --- a/lib/core/viewModels/vaccine_view_model.dart +++ b/lib/core/viewModels/vaccine_view_model.dart @@ -1,3 +1,5 @@ +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; + import 'base_view_model.dart'; import '../../locator.dart'; import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; @@ -22,4 +24,18 @@ class VaccineViewModel extends BaseViewModel { } else setState(ViewState.Idle); } + + Future sendEmail({String message}) async { + hasError = false; + setState(ViewState.BusyLocal); + await _vaccineService.sendEmail(); + if (_vaccineService.hasError) { + error = _vaccineService.error; + setState(ViewState.ErrorLocal); + AppToast.showErrorToast(message: error); + } else { + AppToast.showSuccessToast(message: message); + setState(ViewState.Idle); + } + } } diff --git a/lib/pages/insurance/insurance_card_screen.dart b/lib/pages/insurance/insurance_card_screen.dart index 70d164ff..6483b6b2 100644 --- a/lib/pages/insurance/insurance_card_screen.dart +++ b/lib/pages/insurance/insurance_card_screen.dart @@ -2,6 +2,7 @@ import 'package:diplomaticquarterapp/config/size_config.dart'; import 'package:diplomaticquarterapp/core/viewModels/insurance_card_View_model.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.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:diplomaticquarterapp/widgets/others/rounded_container.dart'; @@ -39,95 +40,117 @@ class _InsuranceCardState extends State { itemBuilder: (BuildContext context, int index) { return RoundedContainer( backgroundColor: Colors.white, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - ExpansionTile( - title: Container( - height: 65.0, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Padding( - padding: EdgeInsets.symmetric(vertical: 15.0), - child: Texts( - model.insurance[index].groupName, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + ExpansionTile( + title: Container( + height: 65.0, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: EdgeInsets.symmetric(vertical: 15.0), + child: Texts( + model.insurance[index].groupName, + ), ), - ), - ], - ), - ), - children: [ - Divider( - color: Colors.black, - height: 25.0, - thickness: 0.5, - ), - Texts( - TranslationBase.of(context).companyName + - model.insurance[index].companyName, - fontSize: 20.0, - ), - Divider( - color: Colors.black, - height: 25.0, - thickness: 0.5, - ), - Column( - crossAxisAlignment: CrossAxisAlignment.stretch, - children: [ - Text( - TranslationBase.of(context).category + - model.insurance[index].subCategoryDesc, - style: TextStyle(fontSize: 18.5), - ), - Text( - TranslationBase.of(context).expirationDate + - convertDateFormat( - model.insurance[index].cardValidTo), - style: TextStyle(fontSize: 18.5), - ), - Text( - TranslationBase.of(context).patientCard + - model.insurance[index].patientCardID, - style: TextStyle(fontSize: 18.5), - ), - Text( - TranslationBase.of(context).policyNumber + - model - .insurance[index].insurancePolicyNumber, - style: TextStyle(fontSize: 18.5), - ), - ], - ), - Column( - children: [ - model.insurance[index].isActive == true - ? Text('Active', - style: TextStyle( - color: Colors.green, - fontWeight: FontWeight.w900, - fontSize: 17.9)) - : Text('Not Active', - style: TextStyle( - color: Colors.red, - fontWeight: FontWeight.w900, - fontSize: 17.9)) - ], - ), - SizedBox( - height: 14.5, + ], + ), ), - if (model.insurance[index].isActive == true) + children: [ Container( - child: Button( - label: TranslationBase.of(context).seeDetails, + padding: EdgeInsets.all(14), + width: double.infinity, + decoration: BoxDecoration( + shape: BoxShape.rectangle, + border: Border.all(color: Colors.grey,width: 0.2), + borderRadius: BorderRadius.all(Radius.circular(2)), + boxShadow: [ + BoxShadow( + color: Colors.white70, + ), + + ] + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts( + TranslationBase.of(context).companyName + + model.insurance[index].companyName, + fontSize: 20.0, + ), + Divider( + color: Colors.black, + height: 25.0, + thickness: 0.5, + ), + Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + Text( + TranslationBase.of(context).category + + model.insurance[index].subCategoryDesc, + style: TextStyle(fontSize: 18.5), + ), + Text( + TranslationBase.of(context).expirationDate + + convertDateFormat( + model.insurance[index].cardValidTo), + style: TextStyle(fontSize: 18.5), + ), + Text( + TranslationBase.of(context).patientCard + + model.insurance[index].patientCardID, + style: TextStyle(fontSize: 18.5), + ), + Text( + TranslationBase.of(context).policyNumber + + model + .insurance[index].insurancePolicyNumber, + style: TextStyle(fontSize: 18.5), + ), + ], + ), + Column( + children: [ + model.insurance[index].isActive == true + ? Text('Active', + style: TextStyle( + color: Colors.green, + fontWeight: FontWeight.w900, + fontSize: 17.9)) + : Text('Not Active', + style: TextStyle( + color: Colors.red, + fontWeight: FontWeight.w900, + fontSize: 17.9)) + ], + ), + SizedBox( + height: 14.5, + ), + if (model.insurance[index].isActive == true) + Container( + color: Colors.transparent, + child: SecondaryButton( + label: TranslationBase.of(context).seeDetails, + textColor: Colors.white, + ), + width: double.infinity, + ), + ], ), - width: 400.0, ), - ], - ), - ], + + + ], + ), + ], + ), ), ); }), diff --git a/lib/pages/landing/home_page.dart b/lib/pages/landing/home_page.dart index d0c8d382..d7afab94 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/all_habib_medical_service_page.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/pages/feedback/feedback_home_page.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/pages/livecare/livecare_home.dart'; @@ -592,6 +593,10 @@ class _HomePageState extends State { context, FadePage(page: AllHabibMedicalService())), ), DashboardItem( + onTap: (){ + Navigator.push(context, FadePage(page: FeedbackHomePage())); + + }, child: Container( width: double.infinity, padding: EdgeInsets.all(10), diff --git a/lib/pages/vaccine/my_vaccines_screen.dart b/lib/pages/vaccine/my_vaccines_screen.dart index cfb0415f..c825884c 100644 --- a/lib/pages/vaccine/my_vaccines_screen.dart +++ b/lib/pages/vaccine/my_vaccines_screen.dart @@ -1,15 +1,12 @@ -import 'dart:typed_data'; -import 'dart:convert'; import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:flutter/material.dart'; import 'package:diplomaticquarterapp/config/size_config.dart'; import 'package:flutter/cupertino.dart'; import '../base/base_view.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; -import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/core/viewModels/vaccine_view_model.dart'; import 'package:diplomaticquarterapp/widgets/others/rounded_container.dart'; -import 'package:flutter_email_sender/flutter_email_sender.dart'; import 'package:popup_box/popup_box.dart'; class MyVaccines extends StatefulWidget { @@ -24,297 +21,193 @@ class _MyVaccinesState extends State { onModelReady: (model) => model.getVaccine(), builder: (BuildContext context, VaccineViewModel model, Widget child) => AppScaffold( - isShowAppBar: true, - appBarTitle: 'My Vaccines', - baseViewModel: model, - body: Container( - margin: EdgeInsets.only( - left: SizeConfig.screenWidth * 0.004, - right: SizeConfig.screenWidth * 0.004, - top: SizeConfig.screenWidth * 0.04, - ), - child: Column( - children: [ - RoundedContainer( - backgroundColor: Colors.white, - child: ExpansionTile( - title: Container( - height: 65.0, - child: Text('2018'), - ), - children: [ - Container( - child: ListView.builder( - scrollDirection: Axis.vertical, - shrinkWrap: true, - itemCount: model.vaccineList == null - ? 0 - : model.vaccineList.length, - itemBuilder: (BuildContext context, int index) { - return Column( - children: [ - RoundedContainer( - child: Column( - children: [ - Row( + isShowAppBar: true, + appBarTitle: 'My Vaccines', + baseViewModel: model, + body: Container( + margin: EdgeInsets.only( + left: SizeConfig.screenWidth * 0.004, + right: SizeConfig.screenWidth * 0.004, + top: SizeConfig.screenWidth * 0.04, + ), + child: Column( + children: [ + RoundedContainer( + backgroundColor: Colors.white, + child: ExpansionTile( + title: Container( + height: 65.0, + child: Text('2018'), + ), + children: [ + Container( + child: ListView.builder( + scrollDirection: Axis.vertical, + shrinkWrap: true, + itemCount: model.vaccineList == null + ? 0 + : model.vaccineList.length, + itemBuilder: (BuildContext context, int index) { + return Column( + children: [ + RoundedContainer( + child: Column( children: [ - Column( + Row( children: [ - Padding( - padding: EdgeInsets.symmetric( - horizontal: 20.0, - vertical: 20.0), - child: Image.network( - model.vaccineList[index] - .doctorImageURL, - height: SizeConfig - .imageSizeMultiplier * - 23, - width: SizeConfig - .imageSizeMultiplier * - 20, - fit: BoxFit.fill, + Expanded( + child: Column( + children: [ + Padding( + padding: EdgeInsets.symmetric( + horizontal: 20.0, + vertical: 20.0), + child: Image.network( + model.vaccineList[index] + .doctorImageURL, + height: SizeConfig + .imageSizeMultiplier * + 23, + width: SizeConfig + .imageSizeMultiplier * + 20, + fit: BoxFit.fill, + ), + ), + ], ), + flex: 2, ), - ], - ), - Container( - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Text( - model.vaccineList[index] - .doctorTitle + - model.vaccineList[index] - .doctorName, - style: TextStyle( - fontWeight: FontWeight.w900, - fontSize: 16.6, - ), - ), - SpaceBetweenTexts(space: 7.0), - Text( - model.vaccineList[index] - .projectName, - style: TextStyle( - fontSize: 17.0, - letterSpacing: 0.5, + Expanded( + child: Container( + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Text( + model.vaccineList[index] + .doctorTitle + + model.vaccineList[index] + .doctorName, + style: TextStyle( + fontWeight: FontWeight.w900, + fontSize: 16.6, + ), + ), + SpaceBetweenTexts(space: 7.0), + Text( + model.vaccineList[index] + .projectName, + style: TextStyle( + fontSize: 17.0, + letterSpacing: 0.5, + ), + ), + SpaceBetweenTexts(space: 7.0), + Text( + model.vaccineList[index] + .vaccineName, + style: TextStyle( + fontSize: 17.0, + ), + ), + SpaceBetweenTexts(space: 7.0), + Text( + 'Date Taken ' + + convertDateFormat(model + .vaccineList[index] + .invoiceDate), + style: + TextStyle(fontSize: 17.0), + ), + ], ), ), - SpaceBetweenTexts(space: 7.0), - Text( - model.vaccineList[index] - .vaccineName, - style: TextStyle( - fontSize: 17.0, - ), - ), - SpaceBetweenTexts(space: 7.0), - Text( - 'Date Taken ' + - convertDateFormat(model - .vaccineList[index] - .invoiceDate), - style: - TextStyle(fontSize: 17.0), - ), - ], - ), + flex: 5, + ), + ], ), ], ), - ], - ), - ), - ], - ); - }), - ) - ], - ), - ), - SpaceBetweenTexts(space: 165.0), - Flexible( - child: Container( - width: 350.0, - height: 80.0, - child: Button( - label: 'CHECK VACCINE AVAILABILITY', - backgroundColor: Color(0xff9EA3A4), + ), + ], + ); + }), + ) + ], + ), ), - ), + // SpaceBetweenTexts(space: 165.0), + + ], ), - Flexible( - child: Container( - width: 350.0, - height: 80.0, - child: Button( - label: 'SEND EMAIL', - backgroundColor: Color(0xffF62426), - onTap: () async { - await PopupBox.showPopupBox( - context: context, - button: MaterialButton( - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(20), - ), - color: Colors.white, - child: Text( - 'CANCEL', - style: TextStyle(fontSize: 16.5), - ), - onPressed: () { - Navigator.of(context).pop(); - }, - ), - willDisplayWidget: Column( - children: [ - Text( - 'Conform \nSend a copy of this report to the email' + - model.vaccineList[0].doctorName, - style: TextStyle( - fontSize: 20, - color: Colors.black26, - fontWeight: FontWeight.w900), + + ), + bottomSheet: Container( + color: Theme.of(context).scaffoldBackgroundColor, + padding: EdgeInsets.all(12), + height: MediaQuery.of(context).size.height *0.25, + width: double.infinity, + child: Column( + children: [ + Divider(height: 2,thickness: 1,), + SizedBox(height: 6,), + Container( + width: double.infinity, + // height: 80.0, + child: Button( + label: 'CHECK VACCINE AVAILABILITY', + backgroundColor: Color(0xff9EA3A4), + ), + ), + Container( + width: double.infinity, + // height: 80.0, + child: SecondaryButton( + label: 'SEND EMAIL', + color: Color(0xffF62426), + textColor: Colors.white, + disabled: model.vaccineList.length==0, + onTap: () async { + await PopupBox.showPopupBox( + context: context, + button: MaterialButton( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(3), ), - SizedBox( - height: 30.0, + color: Colors.white, + child: Text( + 'CANCEL', + style: TextStyle(fontSize: 16.5), ), - ], - )); - }, + onPressed: () { + Navigator.of(context).pop(); + }, + ), + willDisplayWidget: Column( + children: [ + Text( + 'Conform \nSend a copy of this report to the email' + + model.vaccineList[0].doctorName, + style: TextStyle( + fontSize: 20, + color: Colors.black26, + fontWeight: FontWeight.w900), + ), + SizedBox( + height: 30.0, + ), + ], + )); + }, + ), ), - ), + ], ), - ], + ), ), - -// child: ListView.builder( -// itemCount: model.vaccineList == null ? 0 : model.vaccineList.length, -// itemBuilder: (BuildContext context, int index) { -// return Column( -// children: [ -// RoundedContainer( -// backgroundColor: Colors.white, -// child: Column( -// children: [ -// ExpansionTile( -// title: Container( -// height: 60.0, -// child: Column( -// crossAxisAlignment: CrossAxisAlignment.start, -// children: [ -// Texts('2018'), -// ], -// ), -// ), -// children: [ -// Column( -// children: [ -// Row( -// children: [ -// Column( -// children: [ -// Padding( -// padding: EdgeInsets.symmetric( -// horizontal: 20.0, vertical: 20.0), -// child: Container( -// child: Image.network( -// model.vaccineList[index] -// .doctorImageURL, -// height: SizeConfig -// .imageSizeMultiplier * -// 23, -// width: SizeConfig -// .imageSizeMultiplier * -// 20, -// fit: BoxFit.fill, -// colorBlendMode: -// BlendMode.hardLight, -// ), -// ), -// ) -// ], -// ), -// Container( -// child: Column( -// mainAxisAlignment: -// MainAxisAlignment.start, -// crossAxisAlignment: -// CrossAxisAlignment.start, -// children: [ -// Text( -// model.vaccineList[index] -// .doctorTitle + -// model.vaccineList[index] -// .doctorName, -// style: TextStyle( -// fontWeight: FontWeight.w900, -// fontSize: 17.5), -// ), -// Text( -// model -// .vaccineList[index].projectName, -// style: TextStyle( -// fontSize: 19.0, -// letterSpacing: 0.3, -// color: Colors.grey, -// fontWeight: FontWeight.bold), -// ), -// Text( -// model -// .vaccineList[index].vaccineName, -// style: TextStyle( -// fontSize: 19.0, -// color: Colors.grey, -// fontWeight: FontWeight.bold), -// ), -// Text( -// 'Date Taken ' + -// convertDateFormat(model -// .vaccineList[index] -// .invoiceDate), -// style: TextStyle( -// fontSize: 19.0, -// color: Colors.grey, -// fontWeight: FontWeight.bold), -// ), -// ], -// ), -// ), -// ], -// ), -// ], -// ), -// ], -// ), -// ], -// ), -// ), -// Container( -// width: 300, -// child: Button( -// label: 'CHECK VACCINE AVAILABILITY', -// backgroundColor: Color(0xff9EA3A4), -// ), -// ), -// Container( -// width: 300, -// child: Button( -// label: 'SEND EMAIL', -// backgroundColor: Color(0xff9EA3A4), -// ), -// ), -// ], -// ); -// }, -// ), - ), - ), ); } - convertDateFormat(String Date) { const start = "/Date("; const end = "+0300)"; @@ -333,19 +226,7 @@ class _MyVaccinesState extends State { return newDate.toString(); } - emailSender() async { - final Email email = Email( - body: 'Email body', - subject: 'Email subject', - recipients: ['example@example.com'], - cc: ['cc@example.com'], - bcc: ['bcc@example.com'], - attachmentPaths: ['/path/to/attachment.zip'], - isHTML: false, - ); - await FlutterEmailSender.send(email); - } } class SpaceBetweenTexts extends StatelessWidget { From 62d96a3f1ccfa8396aa20f12704e41f1d9e2e493 Mon Sep 17 00:00:00 2001 From: Amjad amireh Date: Wed, 9 Sep 2020 10:17:16 +0300 Subject: [PATCH 33/45] edit card_position.dart --- lib/core/service/er/er_service.dart | 4 +- .../er/near_hospital_view_model.dart | 35 +- lib/pages/ErService/NearestEr.dart | 607 +++++++++--------- 3 files changed, 312 insertions(+), 334 deletions(-) diff --git a/lib/core/service/er/er_service.dart b/lib/core/service/er/er_service.dart index 87367f62..bd3b6116 100644 --- a/lib/core/service/er/er_service.dart +++ b/lib/core/service/er/er_service.dart @@ -20,8 +20,8 @@ class ErService extends BaseService { } var lat = await sharedPref.getDouble(USER_LAT); var long = await sharedPref.getDouble(USER_LONG); - body['Latitude'] = lat; - body['Longitude'] = long; + body['Latitude'] = lat ?? 0; + body['Longitude'] = long ?? 0; await baseAppClient.post(GET_NEAREST_HOSPITAL, onSuccess: (dynamic response, int statusCode) { diff --git a/lib/core/viewModels/er/near_hospital_view_model.dart b/lib/core/viewModels/er/near_hospital_view_model.dart index f1d1c350..f12aa28f 100644 --- a/lib/core/viewModels/er/near_hospital_view_model.dart +++ b/lib/core/viewModels/er/near_hospital_view_model.dart @@ -8,27 +8,24 @@ import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/BranchView.da import '../../../locator.dart'; class NearHospitalViewModel extends BaseViewModel { - - ErService _erService = locator(); + List get ProjectAvgERWaitingTimeModeList => _erService.projectAvgERWaitingTimeModelList; - getProjectAvgERWaitingTimeOrders({int id, int projectID}) async { - setState(ViewState.Busy); - - if (id != null && projectID != null) { - - await _erService.getProjectAvgERWaitingTimeOrders(id: id,projectID: projectID); - } else { - await _erService.getProjectAvgERWaitingTimeOrders(); - } - if (_erService.hasError) { - error = _erService.error; - setState(ViewState.Error); - } else - setState(ViewState.Idle); - } - - + getProjectAvgERWaitingTimeOrders({int id, int projectID}) async { + setState(ViewState.Busy); + + if (id != null && projectID != null) { + await _erService.getProjectAvgERWaitingTimeOrders( + id: id, projectID: projectID); + } else { + await _erService.getProjectAvgERWaitingTimeOrders(); + } + if (_erService.hasError) { + error = _erService.error; + setState(ViewState.Error); + } else + setState(ViewState.Idle); + } } diff --git a/lib/pages/ErService/NearestEr.dart b/lib/pages/ErService/NearestEr.dart index 1cc741ff..e167770b 100644 --- a/lib/pages/ErService/NearestEr.dart +++ b/lib/pages/ErService/NearestEr.dart @@ -10,358 +10,339 @@ import '../../uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/pages/ErService/widgets/card_common.dart'; import 'widgets/card_position.dart'; - class NearestEr extends StatelessWidget { - - static const String url = "assets/images/"; + static const String _url = "assets/images/"; int appointmentNo; int projectID; + NearestEr({this.appointmentNo, this.projectID}); + @override Widget build(BuildContext context) { return BaseView( onModelReady: appointmentNo != null && projectID != null ? (model) => model.getProjectAvgERWaitingTimeOrders( - id: appointmentNo, projectID: projectID) + id: appointmentNo, projectID: projectID) : (model) => model.getProjectAvgERWaitingTimeOrders(), builder: (_, mode, widget) => AppScaffold( isShowAppBar: true, appBarTitle: 'Nearest ER', 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",textAlign: TextAlign.center, - style: TextStyle( - fontSize: 18.0, - letterSpacing: 1.0, - fontWeight: FontWeight.w900, - - color: new Color(0xFF60686b))), - 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: 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 , + 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", + textAlign: TextAlign.center, + style: TextStyle( + fontSize: 18.0, + letterSpacing: 1.0, + fontWeight: FontWeight.w900, + color: new Color(0xFF60686b))), + 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: 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, + ), + flex: 0, + ), + Expanded( + 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, + ), + flex: 0, + ) + ], ), - flex: 0, - - ), - Expanded( - 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 , - ), - flex: 0, - - ) - ], - ), - Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Expanded( - child: CardPosition( - + Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Expanded( + child: CardPosition( // mode // .vitalSignResModelList[ // mode.vitalSignResModelList.length - 1] // .heightCm // .toString() - 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 , - - ), - flex: 0, - ), - Expanded( - 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, + ), + flex: 0, + ), + Expanded( + child: CardPosition( // mode // .vitalSignResModelList[ // mode.vitalSignResModelList.length - 1] // .heightCm // .toString() - 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 , + 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, + ) + ], ), - flex: 0, - ) - ], - ), - Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Expanded( - child: CardPosition( - + Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Expanded( + child: CardPosition( // mode // .vitalSignResModelList[ // mode.vitalSignResModelList.length - 1] // .heightCm // .toString() - 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 , - ), - flex: 0, - ), - Expanded( - 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 , + 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, + ), + flex: 0, + ), + Expanded( + 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, + ), + flex: 0, + ) + ], ), - flex: 0, - - ) - ], - ), - Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Expanded( - 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 , + Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Expanded( + 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, + ), + ], ), - flex: 0, - ), - - ], - ), - ], - ) - ), - ], - ), - ) + ], + )), + ], + ), + ) : Center( - child: Texts('No Data'), - ), + child: Texts('No Data'), + ), ), ); } } - - -//class NearestEr extends StatefulWidget { -// static const String url = "assets/images/"; -// final bool isAppbar; -// -// -// const NearestEr({Key key, this.isAppbar}) : super(key: key); -// @override -// _NearestErState createState() => _NearestErState(); -//} -// -//class _NearestErState extends State { -// LocationUtils locationUtils; -// @override -// void initState() { -// locationUtils = -// new LocationUtils(isShowConfirmDialog: true, context: context); -// WidgetsBinding.instance -// .addPostFrameCallback((_) => locationUtils.getCurrentLocation()); -// -// super.initState(); -// } -// @override -// Widget build(BuildContext context) { -// return AppScaffold( -// isShowAppBar: widget.isAppbar, -// appBarTitle: TranslationBase.of(context).bookAppo, -// body: Container( -// margin: EdgeInsets.fromLTRB(10.0, 20.0, 10.0, 10.0), -// child: ListView( -// -// children: [ -// Text(TranslationBase.of(context).searchBy, -// style: TextStyle( -// fontSize: 24.0, -// letterSpacing: 1.0, -// fontWeight: FontWeight.bold, -// color: new Color(0xFF60686b))), -// 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: CardPosition( -// text: "Olaya Hospital", -// image: 'assets/images/new-design/find_us_icon.png', -// -// subText: TranslationBase.of(context).requestA, -// type: 3, -// ), -// flex: 0, -// -// ), -// Expanded( -// child: CardPosition( -// image: 'assets/images/new-design/find_us_icon.png', -// text: "Takhassusi Hospital", -// subText: TranslationBase.of(context).locationa, -// type: 5), -// flex: 0, -// -// ) -// ], -// ), -// Row( -// mainAxisSize: MainAxisSize.max, -// mainAxisAlignment: MainAxisAlignment.center, -// children: [ -// Expanded( -// child: CardPosition( -// image: 'assets/images/new-design/find_us_icon.png', -// text: "Arryan Hospital", -// subText: TranslationBase.of(context).requestA, -// type: 4, -// ), -// flex: 0, -// ), -// Expanded( -// child: CardPosition( -// image: 'assets/images/new-design/find_us_icon.png', -// text: "Suwaidi Hospital", -// subText: TranslationBase.of(context).locationa, -// type: 6), -// flex: 0, -// ) -// ], -// ), -// Row( -// mainAxisSize: MainAxisSize.max, -// mainAxisAlignment: MainAxisAlignment.center, -// children: [ -// Expanded( -// child: CardPosition( -// image: 'assets/images/new-design/find_us_icon.png', -// text: "Al Qassim Hospital", -// subText: TranslationBase.of(context).requestA, -// type: 7, -// ), -// flex: 0, -// ), -// Expanded( -// child: CardPosition( -// image: 'assets/images/new-design/find_us_icon.png', -// text: "Khobar Hospital", -// subText: TranslationBase.of(context).locationa, -// type: 8), -// flex: 0, -// -// ) -// ], -// ), -// Row( -// mainAxisSize: MainAxisSize.max, -// mainAxisAlignment: MainAxisAlignment.center, -// children: [ -// Expanded( -// child: CardPosition( -// image: 'assets/images/new-design/find_us_icon.png', -// text: "Dubai Hospital", -// subText: TranslationBase.of(context).requestA, -// type: 1, -// -// ), -// flex: 0, -// ), -// -// ], -// ), -// ], -// ) -// ), -// ], -// ), -// ), -// ); -// } -//} From 33bd97298425b0a187ae74d7ae89f60ae93bc119 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Wed, 9 Sep 2020 10:33:45 +0300 Subject: [PATCH 34/45] add my vaccines item screen --- lib/config/config.dart | 3 + lib/config/localized_values.dart | 3 + lib/core/model/vaccine/vaccination_item.dart | 18 + .../model/vaccine/vaccination_on_hand.dart | 44 +++ lib/core/service/vaccine_service.dart | 45 ++- lib/core/viewModels/vaccine_view_model.dart | 26 +- .../vaccine/my_vaccines_item_screen.dart | 78 ++++ lib/pages/vaccine/my_vaccines_screen.dart | 338 ++++++++---------- lib/uitl/translations_delegate_base.dart | 3 + 9 files changed, 365 insertions(+), 193 deletions(-) create mode 100644 lib/core/model/vaccine/vaccination_item.dart create mode 100644 lib/core/model/vaccine/vaccination_on_hand.dart create mode 100644 lib/pages/vaccine/my_vaccines_item_screen.dart diff --git a/lib/config/config.dart b/lib/config/config.dart index a0bf52be..4296ec04 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -179,6 +179,9 @@ const GET_PAtIENTS_INSURANCE_APPROVALS = "Services/Patients.svc/REST/GetApprovalStatus"; const SEARCH_BOT = 'HabibiChatBotApi/BotInterface/GetVoiceCommandResponse'; +const GET_VACCINATIONS_ITEMS = "/Services/ERP.svc/REST/GET_VACCINATIONS_ITEMS"; +const GET_VACCINATION_ONHAND = "/Services/ERP.svc/REST/GET_VACCINATION_ONHAND"; + class AppGlobal { static var context; diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index c0693161..1a7e5e01 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -227,6 +227,7 @@ const Map> localizedValues = { 'ar': 'مسح فوق رمز الاستجابة السريعة للتحقق في الجهاز في المستشفى' }, "sendEmail": {"en": "Send Email", "ar": "ارسال نسخة"}, + "EmailSentSuccessfully": {"en": "Email Sent Successfully", "ar": "تم إرسال البريد الإلكتروني بنجاح"}, "close": {"en": "Close", "ar": "مغلق"}, "booked": {"en": "Booked", "ar": "محجوز"}, "confirmed": {"en": "Confirmed", "ar": "مؤكد"}, @@ -459,4 +460,6 @@ 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":"توفر لقاحي"}, }; diff --git a/lib/core/model/vaccine/vaccination_item.dart b/lib/core/model/vaccine/vaccination_item.dart new file mode 100644 index 00000000..0009ea7d --- /dev/null +++ b/lib/core/model/vaccine/vaccination_item.dart @@ -0,0 +1,18 @@ +class VaccinationItem { + String dESCRIPTION; + String iTEMCODE; + + VaccinationItem({this.dESCRIPTION, this.iTEMCODE}); + + VaccinationItem.fromJson(Map json) { + dESCRIPTION = json['DESCRIPTION']; + iTEMCODE = json['ITEM_CODE']; + } + + Map toJson() { + final Map data = new Map(); + data['DESCRIPTION'] = this.dESCRIPTION; + data['ITEM_CODE'] = this.iTEMCODE; + return data; + } +} diff --git a/lib/core/model/vaccine/vaccination_on_hand.dart b/lib/core/model/vaccine/vaccination_on_hand.dart new file mode 100644 index 00000000..daf3e886 --- /dev/null +++ b/lib/core/model/vaccine/vaccination_on_hand.dart @@ -0,0 +1,44 @@ +class VaccinationOnHand { + int distanceInKilometers; + int iTEMONHAND; + bool isThereItems; + String oRGANIZATIONCODE; + String oRGANIZATIONNAME; + String projectAlias; + int projectID; + String projectName; + + VaccinationOnHand( + {this.distanceInKilometers, + this.iTEMONHAND, + this.isThereItems, + this.oRGANIZATIONCODE, + this.oRGANIZATIONNAME, + this.projectAlias, + this.projectID, + this.projectName}); + + VaccinationOnHand.fromJson(Map json) { + distanceInKilometers = json['DistanceInKilometers']; + iTEMONHAND = json['ITEM_ONHAND']; + isThereItems = json['IsThereItems']; + oRGANIZATIONCODE = json['ORGANIZATION_CODE']; + oRGANIZATIONNAME = json['ORGANIZATION_NAME']; + projectAlias = json['ProjectAlias']; + projectID = json['ProjectID']; + projectName = json['ProjectName']; + } + + Map toJson() { + final Map data = new Map(); + data['DistanceInKilometers'] = this.distanceInKilometers; + data['ITEM_ONHAND'] = this.iTEMONHAND; + data['IsThereItems'] = this.isThereItems; + data['ORGANIZATION_CODE'] = this.oRGANIZATIONCODE; + data['ORGANIZATION_NAME'] = this.oRGANIZATIONNAME; + data['ProjectAlias'] = this.projectAlias; + data['ProjectID'] = this.projectID; + data['ProjectName'] = this.projectName; + return data; + } +} diff --git a/lib/core/service/vaccine_service.dart b/lib/core/service/vaccine_service.dart index 9904b838..297909a4 100644 --- a/lib/core/service/vaccine_service.dart +++ b/lib/core/service/vaccine_service.dart @@ -1,9 +1,13 @@ import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/core/model/vaccine/vaccination_item.dart'; +import 'package:diplomaticquarterapp/core/model/vaccine/vaccination_on_hand.dart'; import 'package:diplomaticquarterapp/core/service/base_service.dart'; import 'package:diplomaticquarterapp/core/model/vaccine/my_vaccine.dart'; class VaccineService extends BaseService { List _vaccineList = List(); + List vaccinationItemList = List(); + List vaccinationOnHandList = List(); List get vaccineList => _vaccineList; @@ -25,24 +29,47 @@ class VaccineService extends BaseService { } Future sendEmail() async { - Map body = Map(); body['ListVaccines'] = vaccineList.map((v) => v.toJson()).toList(); - body['ListVaccines'] = user.emailAddress; + body['To'] = user.emailAddress; body['DateofBirth'] = user.dateofBirth; body['PatientIditificationNum'] = user.patientIdentificationNo; body['PatientMobileNumber'] = user.mobileNumber; - body['PatientName'] = user.firstName + " "+ user.lastName; + body['PatientName'] = user.firstName + " " + user.lastName; hasError = false; - await baseAppClient.post(GET_VACCINES, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(GET_VACCINES_EMAIL, + onSuccess: (dynamic response, int statusCode) {}, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, body: body); + Future getMyVaccinationItem() async { + await baseAppClient.post(GET_VACCINATIONS_ITEMS, + onSuccess: (dynamic response, int statusCode) { + response['GetVaccinationsList'].forEach((item) { + vaccinationItemList.add(VaccinationItem.fromJson(item)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: Map()); + } + Future getMyVaccinationOnHand({String pItemCode}) async { + Map body = Map(); + body['P_ITEM_CODE'] = pItemCode; + await baseAppClient.post(GET_VACCINATION_ONHAND, + onSuccess: (dynamic response, int statusCode) { + response['GetVaccinationOnHandList'].forEach((item) { + vaccinationOnHandList.add(VaccinationOnHand.fromJson(item)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); } } diff --git a/lib/core/viewModels/vaccine_view_model.dart b/lib/core/viewModels/vaccine_view_model.dart index 233a945f..9f8dfecf 100644 --- a/lib/core/viewModels/vaccine_view_model.dart +++ b/lib/core/viewModels/vaccine_view_model.dart @@ -1,3 +1,4 @@ +import 'package:diplomaticquarterapp/core/model/vaccine/vaccination_item.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'base_view_model.dart'; @@ -12,10 +13,11 @@ class VaccineViewModel extends BaseViewModel { VaccineService _vaccineService = locator(); List get vaccineList => _vaccineService.vaccineList; + List get vaccinationItemList => _vaccineService.vaccinationItemList; + Future getVaccine() async { hasError = false; - //_insuranceCardService.clearInsuranceCard(); setState(ViewState.Busy); await _vaccineService.getMyVaccine(); if (_vaccineService.hasError) { @@ -25,6 +27,28 @@ class VaccineViewModel extends BaseViewModel { setState(ViewState.Idle); } + Future getMyVaccinationItem() async { + hasError = false; + setState(ViewState.Busy); + await _vaccineService.getMyVaccinationItem(); + if (_vaccineService.hasError) { + error = _vaccineService.error; + setState(ViewState.Error); + } else + setState(ViewState.Idle); + } + + Future getMyVaccinationOnHand({String pItemCode}) async { + hasError = false; + setState(ViewState.Busy); + await _vaccineService.getMyVaccinationOnHand(pItemCode: pItemCode); + if (_vaccineService.hasError) { + error = _vaccineService.error; + setState(ViewState.ErrorLocal); + } else + setState(ViewState.Idle); + } + Future sendEmail({String message}) async { hasError = false; setState(ViewState.BusyLocal); diff --git a/lib/pages/vaccine/my_vaccines_item_screen.dart b/lib/pages/vaccine/my_vaccines_item_screen.dart new file mode 100644 index 00000000..33ef5975 --- /dev/null +++ b/lib/pages/vaccine/my_vaccines_item_screen.dart @@ -0,0 +1,78 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.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:flutter/material.dart'; +import 'package:diplomaticquarterapp/config/size_config.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:provider/provider.dart'; +import '../base/base_view.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/core/viewModels/vaccine_view_model.dart'; +import 'package:diplomaticquarterapp/widgets/others/rounded_container.dart'; +import 'package:popup_box/popup_box.dart'; + +class MyVaccinesItemPage extends StatefulWidget { + @override + _MyVaccinesItemPageState createState() => _MyVaccinesItemPageState(); +} + +class _MyVaccinesItemPageState extends State { + @override + Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + return BaseView( + onModelReady: (model) => model.getMyVaccinationItem(), + builder: (BuildContext context, VaccineViewModel model, Widget child) => + AppScaffold( + isShowAppBar: true, + appBarTitle: TranslationBase.of(context).myVaccinesAvailability, + baseViewModel: model, + body: Container( + margin: EdgeInsets.only( + left: SizeConfig.screenWidth * 0.004, + right: SizeConfig.screenWidth * 0.004, + top: SizeConfig.screenWidth * 0.04, + ), + child: ListView.builder( + itemCount: model.vaccinationItemList.length, + itemBuilder: (context, index) => InkWell( + onTap: () async { + await model.getMyVaccinationOnHand( + pItemCode: model.vaccinationItemList[index].iTEMCODE); + if (model.hasError) { + AppToast.showErrorToast(message: model.error); + } else { + //TODO show dialog + + } + }, + child: Container( + margin: EdgeInsets.all(5), + padding: EdgeInsets.all(10), + decoration: BoxDecoration( + shape: BoxShape.rectangle, + borderRadius: BorderRadius.circular(7), + color: Colors.white, + ), + child: Row( + children: [ + Expanded( + child: Texts( + model.vaccinationItemList[index].dESCRIPTION)), + Icon(projectViewModel.isArabic + ? Icons.arrow_forward_ios + : Icons.arrow_back_ios) + ], + ), + ), + ), + ), + ), + ), + ); + } +} diff --git a/lib/pages/vaccine/my_vaccines_screen.dart b/lib/pages/vaccine/my_vaccines_screen.dart index c825884c..02d67cac 100644 --- a/lib/pages/vaccine/my_vaccines_screen.dart +++ b/lib/pages/vaccine/my_vaccines_screen.dart @@ -1,5 +1,8 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; import 'package:diplomaticquarterapp/config/size_config.dart'; import 'package:flutter/cupertino.dart'; @@ -9,6 +12,8 @@ import 'package:diplomaticquarterapp/core/viewModels/vaccine_view_model.dart'; import 'package:diplomaticquarterapp/widgets/others/rounded_container.dart'; import 'package:popup_box/popup_box.dart'; +import 'my_vaccines_item_screen.dart'; + class MyVaccines extends StatefulWidget { @override _MyVaccinesState createState() => _MyVaccinesState(); @@ -21,193 +26,174 @@ class _MyVaccinesState extends State { onModelReady: (model) => model.getVaccine(), builder: (BuildContext context, VaccineViewModel model, Widget child) => AppScaffold( - isShowAppBar: true, - appBarTitle: 'My Vaccines', - baseViewModel: model, - body: Container( - margin: EdgeInsets.only( - left: SizeConfig.screenWidth * 0.004, - right: SizeConfig.screenWidth * 0.004, - top: SizeConfig.screenWidth * 0.04, - ), - child: Column( - children: [ - RoundedContainer( - backgroundColor: Colors.white, - child: ExpansionTile( - title: Container( - height: 65.0, - child: Text('2018'), - ), - children: [ - Container( - child: ListView.builder( - scrollDirection: Axis.vertical, - shrinkWrap: true, - itemCount: model.vaccineList == null - ? 0 - : model.vaccineList.length, - itemBuilder: (BuildContext context, int index) { - return Column( - children: [ - RoundedContainer( - child: Column( + isShowAppBar: true, + appBarTitle: TranslationBase.of(context).myVaccines, + baseViewModel: model, + body: Container( + margin: EdgeInsets.only( + left: SizeConfig.screenWidth * 0.004, + right: SizeConfig.screenWidth * 0.004, + top: SizeConfig.screenWidth * 0.04, + ), + child: Column( + children: [ + RoundedContainer( + backgroundColor: Colors.white, + child: ExpansionTile( + title: Container( + height: 65.0, + child: Text('2018'), + ), + children: [ + Container( + child: ListView.builder( + scrollDirection: Axis.vertical, + shrinkWrap: true, + itemCount: model.vaccineList == null + ? 0 + : model.vaccineList.length, + itemBuilder: (BuildContext context, int index) { + return Column( + children: [ + RoundedContainer( + child: Column( + children: [ + Row( children: [ - Row( - children: [ - Expanded( - child: Column( - children: [ - Padding( - padding: EdgeInsets.symmetric( - horizontal: 20.0, - vertical: 20.0), - child: Image.network( - model.vaccineList[index] - .doctorImageURL, - height: SizeConfig + Expanded( + child: Column( + children: [ + Padding( + padding: EdgeInsets.symmetric( + horizontal: 20.0, + vertical: 20.0), + child: Image.network( + model.vaccineList[index] + .doctorImageURL, + height: SizeConfig .imageSizeMultiplier * - 23, - width: SizeConfig + 23, + width: SizeConfig .imageSizeMultiplier * - 20, - fit: BoxFit.fill, - ), - ), - ], + 20, + fit: BoxFit.fill, + ), ), - flex: 2, - ), - Expanded( - child: Container( - child: Column( - crossAxisAlignment: + ], + ), + flex: 2, + ), + Expanded( + child: Container( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - model.vaccineList[index] + children: [ + Text( + model.vaccineList[index] .doctorTitle + - model.vaccineList[index] - .doctorName, - style: TextStyle( - fontWeight: FontWeight.w900, - fontSize: 16.6, - ), - ), - SpaceBetweenTexts(space: 7.0), - Text( model.vaccineList[index] - .projectName, - style: TextStyle( - fontSize: 17.0, - letterSpacing: 0.5, - ), - ), - SpaceBetweenTexts(space: 7.0), - Text( - model.vaccineList[index] - .vaccineName, - style: TextStyle( - fontSize: 17.0, - ), - ), - SpaceBetweenTexts(space: 7.0), - Text( - 'Date Taken ' + - convertDateFormat(model - .vaccineList[index] - .invoiceDate), - style: - TextStyle(fontSize: 17.0), - ), - ], + .doctorName, + style: TextStyle( + fontWeight: + FontWeight.w900, + fontSize: 16.6, + ), ), - ), - flex: 5, + SizedBox(height: 7.0), + Text( + model.vaccineList[index] + .projectName, + style: TextStyle( + fontSize: 17.0, + letterSpacing: 0.5, + ), + ), + SizedBox(height: 7.0), + Text( + model.vaccineList[index] + .vaccineName, + style: TextStyle( + fontSize: 17.0, + ), + ), + SizedBox(height: 7.0), + Text( + 'Date Taken ' + + convertDateFormat(model + .vaccineList[index] + .invoiceDate), + style: TextStyle( + fontSize: 17.0), + ), + ], ), - ], + ), + flex: 5, ), ], ), - ), - ], - ); - }), - ) - ], - ), - ), - // SpaceBetweenTexts(space: 165.0), - - ], - ), - - ), - bottomSheet: Container( - color: Theme.of(context).scaffoldBackgroundColor, - padding: EdgeInsets.all(12), - height: MediaQuery.of(context).size.height *0.25, - width: double.infinity, - child: Column( - children: [ - Divider(height: 2,thickness: 1,), - SizedBox(height: 6,), - Container( - width: double.infinity, - // height: 80.0, - child: Button( - label: 'CHECK VACCINE AVAILABILITY', - backgroundColor: Color(0xff9EA3A4), - ), - ), - Container( - width: double.infinity, - // height: 80.0, - child: SecondaryButton( - label: 'SEND EMAIL', - color: Color(0xffF62426), - textColor: Colors.white, - disabled: model.vaccineList.length==0, - onTap: () async { - await PopupBox.showPopupBox( - context: context, - button: MaterialButton( - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(3), - ), - color: Colors.white, - child: Text( - 'CANCEL', - style: TextStyle(fontSize: 16.5), - ), - onPressed: () { - Navigator.of(context).pop(); - }, - ), - willDisplayWidget: Column( - children: [ - Text( - 'Conform \nSend a copy of this report to the email' + - model.vaccineList[0].doctorName, - style: TextStyle( - fontSize: 20, - color: Colors.black26, - fontWeight: FontWeight.w900), - ), - SizedBox( - height: 30.0, + ], + ), ), ], - )); - }, - ), - ), - ], + ); + }), + ) + ], + ), + ), + // SpaceBetweenTexts(space: 165.0), + ], + ), + ), + bottomSheet: Container( + color: Theme.of(context).scaffoldBackgroundColor, + padding: EdgeInsets.all(12), + height: MediaQuery.of(context).size.height * 0.25, + width: double.infinity, + child: Column( + children: [ + Divider( + height: 2, + thickness: 1, + ), + SizedBox( + height: 6, + ), + Container( + width: double.infinity, + // height: 80.0, + child: Button( + label: TranslationBase.of(context).checkVaccineAvailability, + backgroundColor: Color(0xff9EA3A4), + onTap: () => + Navigator.push(context, FadePage(page: MyVaccinesItemPage())), + ), + ), + Container( + width: double.infinity, + // height: 80.0, + child: SecondaryButton( + label: TranslationBase.of(context).sendEmail, + color: Color(0xffF62426), + textColor: Colors.white, + disabled: model.vaccineList.length == 0, + loading: model.state == ViewState.BusyLocal, + onTap: () async { + model.sendEmail( + message: + TranslationBase.of(context).emailSentSuccessfully); + }, + ), ), - ), + ], ), + ), + ), ); } + convertDateFormat(String Date) { const start = "/Date("; const end = "+0300)"; @@ -225,18 +211,4 @@ class _MyVaccinesState extends State { return newDate.toString(); } - - -} - -class SpaceBetweenTexts extends StatelessWidget { - final double space; - SpaceBetweenTexts({this.space}); - - @override - Widget build(BuildContext context) { - return SizedBox( - height: space, - ); - } } diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index 41a5a537..5695d3f5 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -521,6 +521,9 @@ class TranslationBase { 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 checkVaccineAvailability => localizedValues['CHECK_VACCINE_AVAILABILITY'][locale.languageCode]; + String get myVaccinesAvailability => localizedValues['MyVaccinesAvailability'][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { From ea02622977beebb09a97106c2115e0a8f53f945a Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Wed, 9 Sep 2020 11:00:37 +0300 Subject: [PATCH 35/45] fix merge issues --- android/app/src/main/AndroidManifest.xml | 1 + assets/images/new-design/AM.PNG | Bin 0 -> 1554 bytes lib/config/localized_values.dart | 18 ------------------ 3 files changed, 1 insertion(+), 18 deletions(-) create mode 100644 assets/images/new-design/AM.PNG diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 30575eb9..884c7e09 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -6,6 +6,7 @@ additional functionality it is fine to subclass or reimplement FlutterApplication and put your custom class here. --> + diff --git a/assets/images/new-design/AM.PNG b/assets/images/new-design/AM.PNG new file mode 100644 index 0000000000000000000000000000000000000000..212ca0b154ff8a2826dcc331cc1e4bed16185c93 GIT binary patch literal 1554 zcmV+t2JQKYP)$r1p>+9ah+gb-0jwQ2w; zxmI_rFit{<$BvJF0Kj&JA{lAJwO}7n0R|%l7>vXkhLmzArR*}qKFg4(a`<=_TNqNx zR0#1RggDIw1idol47^}@NW~HcR{RxO(wP>u;xtFpjPJB-bs*_pyp;S1DyZan$?@05L(4CTa1LOH#_%B7E^Dy02wj1fZn@onG=EBi4S#@pMQ z_M9kMQZ(L70C3a{93OEyVv;7gwrQF|UDr^SC7eztsH*DDO)ZMza=seSsq=@V?$LIK z=XPy-+}%jy?!uI`Q>ENhMb*o1tAW)8V!PdvzIZAa_~N#jXQ?hN8atoSx6j6CrD-aj zpLH4hzl9m*zV+GR^Hg{AH1PR%05HxzaT+MBs>I9 zPYOtRo!Agy%&P}%A@4u}jQRD@%p{V*IG@jV-c&Q@2)dKO-fYc^wm>z&Qg<-U= z%^*kB_hGbCr(v?Q6%1E4@ocAmQsTzt{pU5!q6=wt?`_u+!3z(Hd!*^WbcqEm7*H7k#5F_ zFPEavchV{*!2q*;m}aYx=P%Oe6|K%;fZOd?NxP?xa!>u?ldf*fsg1L#RD>gMn+o+t zd6@%o4#En?RmBby0%$dr8#|)h+le-W>T8z> localizedValues = { "locationa":{"en":"location:","ar":"الموقع"}, "ambulancerequest":{"en":"Ambulance :","ar":"طلب نقل "}, "requestA":{"en":"Request:","ar":"اسعاف"}, - "parking": {"en": "Parking", "ar": "مواقف"}, - "alhabiServices": {"en": "HMG Service", "ar": "خدمات الحبيب"}, - "parkingTitle": { - "en": - "Car service, car service, service to save parking information, return to it later, 1- By clicking on (Read the code), save the parking data. 2- By clicking on the button (view my car park), it shows you the car’s location in Google Maps. 3- Read another position by pressing the Clear Position Data button.", - "ar": - " خدمة المواقف، تتيح هذه الخدمة للمستخدم معلومات عن موقف السيارة ليسهل عليه العودة لها لاحقاً ، 1- بالضغط على زر(قراءة الكود) تستطيع حفظ البيانات الخاصة بالموقف. 2-بالضغط على زر(عرض موقف سيارتي) يعرض لك موقع السيارة في خرائط قوقل. 3- لإعادة قراءة موقف آخرعن طريق الضغط على زر(مسح بيانات الموقف). " - }, - "readBarcode": {"en": "Read Barcode", "ar": "قراءة الكود"}, - "showMyPark": {"en": "Show My Park", "ar": "عرض بارك"}, - "clearMyData": {"en": "clear My Data", "ar": "امسح البيانات"}, - "floor": {"en": "Floor:", "ar": "الطابق"}, - "gate": {"en": "Gate:", "ar": "بوابة"}, - "building": {"en": "Building:", "ar": "المبنى"}, - "branch": {"en": "Branch:", "ar": "الفرع"}, - "emergencyServices": {"en": "Emergency Services:", "ar": "خدمات الطوارئ"}, - "textToSpeech": {"en": "How May I Help You?", "ar": "كيف يمكنني مساعدتك؟"}, "MyAppointments": {"en": "My Appointments", "ar": "مواعيدي"}, "NoBookedAppointments": { "en": "No Booked Appointments", @@ -466,7 +449,6 @@ const Map> localizedValues = { "OrderDetails": {"en": "Order Details", "ar": "تفاصيل الطلب"}, "VitalSign": {"en": "Vital Sign", "ar": "العلامة حيوية"}, "MonthlyReports": {"en": "Monthly Reports", "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": "السماح لتطبيق مجموعة الحبيب الطبية بالوصول إلى موقعك سيساعدك في إظهار المستشفيات وفقًا للأقرب إليك."}, "km":{"en":"KMs:","ar":"كم"}, "PatientHealthSummaryReport":{"en":"Patient Health Summary Report","ar":" ملخص التقارير الشهرية"}, "ToViewTheTermsAndConditions":{"en":"To View The Terms And Conditions Report","ar":" عرض الشروط والأحكام "}, From 11f9daa3ff9236e892e01e9e310fb257bb045d6e Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Wed, 9 Sep 2020 11:50:47 +0300 Subject: [PATCH 36/45] add PatientSickLeave --- lib/config/config.dart | 4 + lib/core/model/sick_leave/sick_leave.dart | 138 ++++++++++++++++++ .../medical/PatientSickLeaveService.dart | 43 ++++++ .../patient_sick_leave_view_model.dart | 42 ++++++ lib/locator.dart | 4 + .../medical/patient_sick_leave_page.dart | 44 ++++++ .../data_display/medical/doctor_card.dart | 16 +- 7 files changed, 289 insertions(+), 2 deletions(-) create mode 100644 lib/core/model/sick_leave/sick_leave.dart create mode 100644 lib/core/service/medical/PatientSickLeaveService.dart create mode 100644 lib/core/viewModels/medical/patient_sick_leave_view_model.dart create mode 100644 lib/pages/medical/patient_sick_leave_page.dart diff --git a/lib/config/config.dart b/lib/config/config.dart index 63ff8954..355e58eb 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -186,6 +186,10 @@ const GET_PAtIENTS_INSURANCE_APPROVALS = "Services/Patients.svc/REST/GetApprovalStatus"; const SEARCH_BOT = 'HabibiChatBotApi/BotInterface/GetVoiceCommandResponse'; +const GET_PATIENT_SICK_LEAVE = 'Services/Patients.svc/REST/GetPatientSickLeave'; + +const SendSickLeaveEmail = 'Services/Notifications.svc/REST/SendSickLeaveEmail'; + class AppGlobal { static var context; diff --git a/lib/core/model/sick_leave/sick_leave.dart b/lib/core/model/sick_leave/sick_leave.dart new file mode 100644 index 00000000..d5e6e76c --- /dev/null +++ b/lib/core/model/sick_leave/sick_leave.dart @@ -0,0 +1,138 @@ +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; + +class SickLeave { + String setupID; + int projectID; + int patientID; + int patientType; + int clinicID; + int doctorID; + int requestNo; + DateTime requestDate; + int sickLeaveDays; + int appointmentNo; + int admissionNo; + int actualDoctorRate; + String appointmentDate; + String clinicName; + String doctorImageURL; + String doctorName; + int doctorRate; + String doctorTitle; + int gender; + String genderDescription; + bool isActiveDoctorProfile; + bool isDoctorAllowVedioCall; + bool isExecludeDoctor; + bool isInOutPatient; + String isInOutPatientDescription; + String isInOutPatientDescriptionN; + int noOfPatientsRate; + Null patientName; + String projectName; + String qR; + List speciality; + + SickLeave( + {this.setupID, + this.projectID, + this.patientID, + this.patientType, + this.clinicID, + this.doctorID, + this.requestNo, + this.requestDate, + this.sickLeaveDays, + this.appointmentNo, + this.admissionNo, + this.actualDoctorRate, + this.appointmentDate, + this.clinicName, + this.doctorImageURL, + this.doctorName, + this.doctorRate, + this.doctorTitle, + this.gender, + this.genderDescription, + this.isActiveDoctorProfile, + this.isDoctorAllowVedioCall, + this.isExecludeDoctor, + this.isInOutPatient, + this.isInOutPatientDescription, + this.isInOutPatientDescriptionN, + this.noOfPatientsRate, + this.patientName, + this.projectName, + this.qR, + this.speciality}); + + SickLeave.fromJson(Map json) { + setupID = json['SetupID']; + projectID = json['ProjectID']; + patientID = json['PatientID']; + patientType = json['PatientType']; + clinicID = json['ClinicID']; + doctorID = json['DoctorID']; + requestNo = json['RequestNo']; + requestDate = DateUtil.convertStringToDate(json['RequestDate']); + sickLeaveDays = json['SickLeaveDays']; + appointmentNo = json['AppointmentNo']; + admissionNo = json['AdmissionNo']; + actualDoctorRate = json['ActualDoctorRate']; + appointmentDate = json['AppointmentDate']; + clinicName = json['ClinicName']; + doctorImageURL = json['DoctorImageURL']; + doctorName = json['DoctorName']; + 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']; + noOfPatientsRate = json['NoOfPatientsRate']; + patientName = json['PatientName']; + projectName = json['ProjectName']; + 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['PatientType'] = this.patientType; + data['ClinicID'] = this.clinicID; + data['DoctorID'] = this.doctorID; + data['RequestNo'] = this.requestNo; + data['RequestDate'] = DateUtil.convertDateToString(requestDate); + data['SickLeaveDays'] = this.sickLeaveDays; + data['AppointmentNo'] = this.appointmentNo; + data['AdmissionNo'] = this.admissionNo; + data['ActualDoctorRate'] = this.actualDoctorRate; + data['AppointmentDate'] = this.appointmentDate; + data['ClinicName'] = this.clinicName; + data['DoctorImageURL'] = this.doctorImageURL; + data['DoctorName'] = this.doctorName; + 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['NoOfPatientsRate'] = this.noOfPatientsRate; + data['PatientName'] = this.patientName; + data['ProjectName'] = this.projectName; + data['QR'] = this.qR; + data['Speciality'] = this.speciality; + return data; + } +} diff --git a/lib/core/service/medical/PatientSickLeaveService.dart b/lib/core/service/medical/PatientSickLeaveService.dart new file mode 100644 index 00000000..4801d8b0 --- /dev/null +++ b/lib/core/service/medical/PatientSickLeaveService.dart @@ -0,0 +1,43 @@ +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/core/model/sick_leave/sick_leave.dart'; +import 'package:diplomaticquarterapp/core/service/base_service.dart'; + +class PatientSickLeaveService extends BaseService { + List sickLeaveList = List(); + + getSickLeave() async { + hasError = false; + super.error = ""; + await baseAppClient.post(GET_PATIENT_SICK_LEAVE, + onSuccess: (response, statusCode) async { + sickLeaveList.clear(); + response['List_SickLeave'].forEach((sickLeave) { + sickLeaveList.add(SickLeave.fromJson(sickLeave)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: Map()); + } + + sendSickLeaveEmail( + {int requestNo, String projectName, String doctorName}) async { + hasError = false; + super.error = ""; + Map body = Map(); + body['RequestNo'] = requestNo; + body['To'] = user.emailAddress; + body['DateofBirth'] = user.dateofBirth; + body['PatientIditificationNum'] = user.patientIdentificationNo; + body['PatientMobileNumber'] = user.mobileNumber; + body['PatientName'] = user.firstName + " " + user.firstName; + body['ProjectName'] = projectName; + body['DoctorName'] = doctorName; + await baseAppClient + .post(SendSickLeaveEmail, onSuccess: (response, statusCode) async {}, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } +} diff --git a/lib/core/viewModels/medical/patient_sick_leave_view_model.dart b/lib/core/viewModels/medical/patient_sick_leave_view_model.dart new file mode 100644 index 00000000..9ed25b01 --- /dev/null +++ b/lib/core/viewModels/medical/patient_sick_leave_view_model.dart @@ -0,0 +1,42 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/sick_leave/sick_leave.dart'; +import 'package:diplomaticquarterapp/core/service/medical/PatientSickLeaveService.dart'; +import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; +import 'package:diplomaticquarterapp/locator.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; + +class PatientSickLeaveViewMode extends BaseViewModel { + PatientSickLeaveService _patientSickLeaveService = + locator(); + + List get sickLeaveList => _patientSickLeaveService.sickLeaveList; + + getSickLeave() async { + setState(ViewState.Busy); + await _patientSickLeaveService.getSickLeave(); + if (_patientSickLeaveService.hasError) { + error = _patientSickLeaveService.error; + setState(ViewState.Error); + } else { + setState(ViewState.Idle); + } + } + + Future sendSickLeaveEmail( + {String message, + int requestNo, + String projectName, + String doctorName}) async { + setState(ViewState.BusyLocal); + await _patientSickLeaveService.sendSickLeaveEmail( + requestNo: requestNo, projectName: projectName, doctorName: doctorName); + if (_patientSickLeaveService.hasError) { + error = _patientSickLeaveService.error; + setState(ViewState.ErrorLocal); + AppToast.showErrorToast(message: error); + } else { + AppToast.showSuccessToast(message: message); + setState(ViewState.Idle); + } + } +} diff --git a/lib/locator.dart b/lib/locator.dart index f676717d..8f347f42 100644 --- a/lib/locator.dart +++ b/lib/locator.dart @@ -8,6 +8,7 @@ import 'core/service/dashboard_service.dart'; import 'core/service/er/er_service.dart'; import 'core/service/feedback/feedback_service.dart'; import 'core/service/hospital_service.dart'; +import 'core/service/medical/PatientSickLeaveService.dart'; import 'core/service/medical/labs_service.dart'; import 'core/service/medical/medical_service.dart'; import 'core/service/medical/my_doctor_service.dart'; @@ -23,6 +24,7 @@ import 'core/viewModels/hospital_view_model.dart'; import 'core/viewModels/medical/labs_view_model.dart'; import 'core/viewModels/medical/medical_view_model.dart'; import 'core/viewModels/medical/my_doctor_view_model.dart'; +import 'core/viewModels/medical/patient_sick_leave_view_model.dart'; import 'core/viewModels/medical/prescriptions_view_model.dart'; import 'core/viewModels/medical/radiology_view_model.dart'; import 'core/viewModels/medical/reports_monthly_view_model.dart'; @@ -59,6 +61,7 @@ void setupLocator() { locator.registerFactory(() => VaccineService()); locator.registerLazySingleton(() => ReportsMonthlyService()); locator.registerLazySingleton(() => ErService()); + locator.registerLazySingleton(() => PatientSickLeaveService()); /// View Model locator.registerFactory(() => HospitalViewModel()); @@ -78,5 +81,6 @@ void setupLocator() { locator.registerFactory(() => QrViewModel()); locator.registerFactory(() => ReportsMonthlyViewModel()); locator.registerFactory(() => NearHospitalViewModel()); + locator.registerFactory(() => PatientSickLeaveViewMode()); } diff --git a/lib/pages/medical/patient_sick_leave_page.dart b/lib/pages/medical/patient_sick_leave_page.dart new file mode 100644 index 00000000..06604c99 --- /dev/null +++ b/lib/pages/medical/patient_sick_leave_page.dart @@ -0,0 +1,44 @@ +import 'package:diplomaticquarterapp/core/viewModels/medical/patient_sick_leave_view_model.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/medical/doctor_card.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/cupertino.dart'; + +class PatientSickLeavePage extends StatefulWidget { + @override + _PatientSickLeavePageState createState() => _PatientSickLeavePageState(); +} + +class _PatientSickLeavePageState extends State { + @override + Widget build(BuildContext context) { + return BaseView( + onModelReady: (model) => model.getSickLeave(), + builder: (_, model, w) => AppScaffold( + isShowAppBar: true, + appBarTitle: 'Sick Leave', + baseViewModel: model, + body: SingleChildScrollView( + child: Container( + margin: EdgeInsets.all(12), + child: ListView.builder( + itemCount: model.sickLeaveList.length, + itemBuilder: (context, index) => DoctorCard( + name: model.sickLeaveList[index].doctorName, + date: DateUtil.getMonthDayYearDateFormatted(model.sickLeaveList[index].requestDate), + profileUrl:model.sickLeaveList[index].doctorImageURL, + rat: model.sickLeaveList[index].doctorRate.toDouble(), + subName: model.sickLeaveList[index].projectName, + isInOutPatientDescription: model.sickLeaveList[index].isInOutPatientDescription, + onEmailTap: (){ + model.sendSickLeaveEmail(); + }, + ), + ), + ), + ), + ), + ); + } +} diff --git a/lib/widgets/data_display/medical/doctor_card.dart b/lib/widgets/data_display/medical/doctor_card.dart index 47095cf7..0432dc90 100644 --- a/lib/widgets/data_display/medical/doctor_card.dart +++ b/lib/widgets/data_display/medical/doctor_card.dart @@ -14,6 +14,9 @@ class DoctorCard extends StatelessWidget { final String profileUrl; final String billNo; final Function onTap; + final Function onEmailTap; + + final String isInOutPatientDescription; DoctorCard( {this.name, @@ -22,7 +25,9 @@ class DoctorCard extends StatelessWidget { this.date, this.profileUrl, this.billNo, - this.onTap}); + this.onTap, + this.onEmailTap, + this.isInOutPatientDescription}); @override Widget build(BuildContext context) { @@ -56,7 +61,7 @@ class DoctorCard extends StatelessWidget { quarterTurns: 3, child: Center( child: Text( - "Calendar", + isInOutPatientDescription ?? "Calendar", style: TextStyle(color: Colors.white), ), )), @@ -111,6 +116,13 @@ class DoctorCard extends StatelessWidget { ), ), ), + InkWell( + onTap: onEmailTap, + child: Icon( + Icons.email, + color: Colors.red, + ), + ) ], ), ), From 525080c09e10746d5807b20e354309e3226e9356 Mon Sep 17 00:00:00 2001 From: Amjad amireh Date: Wed, 9 Sep 2020 11:57:11 +0300 Subject: [PATCH 37/45] edit card_position.dart --- lib/pages/ErService/NearestEr.dart | 478 +++++++++--------- .../ErService/widgets/card_position.dart | 2 +- 2 files changed, 241 insertions(+), 239 deletions(-) diff --git a/lib/pages/ErService/NearestEr.dart b/lib/pages/ErService/NearestEr.dart index e167770b..227cfb3b 100644 --- a/lib/pages/ErService/NearestEr.dart +++ b/lib/pages/ErService/NearestEr.dart @@ -51,160 +51,160 @@ class NearestEr extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.center, children: [ Expanded( - 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, + 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, + ), ), - flex: 0, + ), Expanded( - 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, + 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, + ), ), - flex: 0, + ) ], ), Row( - mainAxisSize: MainAxisSize.max, + mainAxisSize: MainAxisSize.min, mainAxisAlignment: MainAxisAlignment.center, children: [ Expanded( - child: CardPosition( -// mode -// .vitalSignResModelList[ -// mode.vitalSignResModelList.length - 1] -// .heightCm -// .toString() - text: mode - .ProjectAvgERWaitingTimeModeList[2] - .projectName - .toString(), - image: - 'assets/images/new-design/find_us_icon.png', + child: Container( + child: CardPosition( - 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, + 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, + ), ), - flex: 0, + ), Expanded( - child: CardPosition( -// mode -// .vitalSignResModelList[ -// mode.vitalSignResModelList.length - 1] -// .heightCm -// .toString() - text: mode - .ProjectAvgERWaitingTimeModeList[3] - .projectName - .toString(), - image: - 'assets/images/new-design/find_us_icon.png', + 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, + 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, ) @@ -215,80 +215,80 @@ class NearestEr extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.center, children: [ Expanded( - child: CardPosition( -// mode -// .vitalSignResModelList[ -// mode.vitalSignResModelList.length - 1] -// .heightCm -// .toString() - text: mode - .ProjectAvgERWaitingTimeModeList[4] - .projectName - .toString(), - image: - 'assets/images/new-design/find_us_icon.png', + child: Container( + child: CardPosition( - 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, + 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, + ), ), - flex: 0, + ), Expanded( - 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, + 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, + ), ), - flex: 0, + ) ], ), @@ -297,37 +297,39 @@ class NearestEr extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.center, children: [ Expanded( - 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, + 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 4c649fc5..457f646d 100644 --- a/lib/pages/ErService/widgets/card_position.dart +++ b/lib/pages/ErService/widgets/card_position.dart @@ -40,7 +40,7 @@ class CardPosition extends StatelessWidget { }, child: Container( - width:190, + width:170, margin: EdgeInsets.fromLTRB(7.0, 7.0, 7.0, 7.0), decoration: BoxDecoration(boxShadow: [ BoxShadow(color: Colors.grey[400], blurRadius: 2.0, spreadRadius: 0.0) From e5bdaaa551764e66ff2aefb29e140e8add6ebcbd Mon Sep 17 00:00:00 2001 From: Amjad amireh Date: Wed, 9 Sep 2020 12:00:34 +0300 Subject: [PATCH 38/45] edit card_position.dart --- assets/images/new-design/AM.PNG | Bin 0 -> 1554 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 assets/images/new-design/AM.PNG diff --git a/assets/images/new-design/AM.PNG b/assets/images/new-design/AM.PNG new file mode 100644 index 0000000000000000000000000000000000000000..212ca0b154ff8a2826dcc331cc1e4bed16185c93 GIT binary patch literal 1554 zcmV+t2JQKYP)$r1p>+9ah+gb-0jwQ2w; zxmI_rFit{<$BvJF0Kj&JA{lAJwO}7n0R|%l7>vXkhLmzArR*}qKFg4(a`<=_TNqNx zR0#1RggDIw1idol47^}@NW~HcR{RxO(wP>u;xtFpjPJB-bs*_pyp;S1DyZan$?@05L(4CTa1LOH#_%B7E^Dy02wj1fZn@onG=EBi4S#@pMQ z_M9kMQZ(L70C3a{93OEyVv;7gwrQF|UDr^SC7eztsH*DDO)ZMza=seSsq=@V?$LIK z=XPy-+}%jy?!uI`Q>ENhMb*o1tAW)8V!PdvzIZAa_~N#jXQ?hN8atoSx6j6CrD-aj zpLH4hzl9m*zV+GR^Hg{AH1PR%05HxzaT+MBs>I9 zPYOtRo!Agy%&P}%A@4u}jQRD@%p{V*IG@jV-c&Q@2)dKO-fYc^wm>z&Qg<-U= z%^*kB_hGbCr(v?Q6%1E4@ocAmQsTzt{pU5!q6=wt?`_u+!3z(Hd!*^WbcqEm7*H7k#5F_ zFPEavchV{*!2q*;m}aYx=P%Oe6|K%;fZOd?NxP?xa!>u?ldf*fsg1L#RD>gMn+o+t zd6@%o4#En?RmBby0%$dr8#|)h+le-W>T8z Date: Wed, 9 Sep 2020 12:05:09 +0300 Subject: [PATCH 39/45] done Patient Sick Leave --- .../medical/PatientSickLeaveService.dart | 4 +- .../patient_sick_leave_view_model.dart | 6 +-- lib/pages/medical/medical_profile_page.dart | 16 +++++--- .../medical/patient_sick_leave_page.dart | 39 +++++++++++-------- 4 files changed, 39 insertions(+), 26 deletions(-) diff --git a/lib/core/service/medical/PatientSickLeaveService.dart b/lib/core/service/medical/PatientSickLeaveService.dart index 4801d8b0..b2bb16ef 100644 --- a/lib/core/service/medical/PatientSickLeaveService.dart +++ b/lib/core/service/medical/PatientSickLeaveService.dart @@ -21,7 +21,7 @@ class PatientSickLeaveService extends BaseService { } sendSickLeaveEmail( - {int requestNo, String projectName, String doctorName}) async { + {int requestNo, String projectName, String doctorName, int projectID,String setupID}) async { hasError = false; super.error = ""; Map body = Map(); @@ -33,6 +33,8 @@ class PatientSickLeaveService extends BaseService { body['PatientName'] = user.firstName + " " + user.firstName; body['ProjectName'] = projectName; body['DoctorName'] = doctorName; + body['ProjectID'] = 12; + body['SetupID'] = 12; await baseAppClient .post(SendSickLeaveEmail, onSuccess: (response, statusCode) async {}, onFailure: (String error, int statusCode) { diff --git a/lib/core/viewModels/medical/patient_sick_leave_view_model.dart b/lib/core/viewModels/medical/patient_sick_leave_view_model.dart index 9ed25b01..6addf833 100644 --- a/lib/core/viewModels/medical/patient_sick_leave_view_model.dart +++ b/lib/core/viewModels/medical/patient_sick_leave_view_model.dart @@ -26,10 +26,10 @@ class PatientSickLeaveViewMode extends BaseViewModel { {String message, int requestNo, String projectName, - String doctorName}) async { - setState(ViewState.BusyLocal); + String doctorName,int projectID,String setupID}) async { + setState(ViewState.Busy); await _patientSickLeaveService.sendSickLeaveEmail( - requestNo: requestNo, projectName: projectName, doctorName: doctorName); + requestNo: requestNo, projectName: projectName, doctorName: doctorName,projectID: projectID,setupID: setupID); if (_patientSickLeaveService.hasError) { error = _patientSickLeaveService.error; setState(ViewState.ErrorLocal); diff --git a/lib/pages/medical/medical_profile_page.dart b/lib/pages/medical/medical_profile_page.dart index e78e18a9..7abd724d 100644 --- a/lib/pages/medical/medical_profile_page.dart +++ b/lib/pages/medical/medical_profile_page.dart @@ -5,6 +5,7 @@ import 'package:diplomaticquarterapp/core/viewModels/medical/medical_view_model. import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/MyAppointments/MyAppointments.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/pages/medical/patient_sick_leave_page.dart'; import 'package:diplomaticquarterapp/pages/medical/reports/monthly_reports.dart'; import 'package:diplomaticquarterapp/pages/vaccine/my_vaccines_screen.dart'; import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescriptions_home_page.dart'; @@ -331,12 +332,13 @@ class _MedicalProfilePageState extends State { Expanded( flex: 1, child: InkWell( - onTap: (){ + onTap: () { Navigator.push(context, FadePage(page: MonthlyReportsPage())); }, child: MedicalProfileItem( - title: TranslationBase.of(context).monthly, + title: + TranslationBase.of(context).monthly, imagePath: 'medical_history_icon.png', subTitle: TranslationBase.of(context) .monthlySubtitle, @@ -349,10 +351,12 @@ class _MedicalProfilePageState extends State { flex: 1, child: InkWell( //TODO -// onTap: () { -// Navigator.push( -// context, FadePage(page: DoctorHomePage())); -// }, + onTap: () { + Navigator.push( + context, + FadePage( + page: PatientSickLeavePage())); + }, child: MedicalProfileItem( title: TranslationBase.of(context).sick, imagePath: 'insurance_card_icon.png', diff --git a/lib/pages/medical/patient_sick_leave_page.dart b/lib/pages/medical/patient_sick_leave_page.dart index 06604c99..dab3d6cf 100644 --- a/lib/pages/medical/patient_sick_leave_page.dart +++ b/lib/pages/medical/patient_sick_leave_page.dart @@ -1,6 +1,7 @@ import 'package:diplomaticquarterapp/core/viewModels/medical/patient_sick_leave_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/data_display/medical/doctor_card.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; @@ -19,22 +20,28 @@ class _PatientSickLeavePageState extends State { isShowAppBar: true, appBarTitle: 'Sick Leave', baseViewModel: model, - body: SingleChildScrollView( - child: Container( - margin: EdgeInsets.all(12), - child: ListView.builder( - itemCount: model.sickLeaveList.length, - itemBuilder: (context, index) => DoctorCard( - name: model.sickLeaveList[index].doctorName, - date: DateUtil.getMonthDayYearDateFormatted(model.sickLeaveList[index].requestDate), - profileUrl:model.sickLeaveList[index].doctorImageURL, - rat: model.sickLeaveList[index].doctorRate.toDouble(), - subName: model.sickLeaveList[index].projectName, - isInOutPatientDescription: model.sickLeaveList[index].isInOutPatientDescription, - onEmailTap: (){ - model.sendSickLeaveEmail(); - }, - ), + body: Container( + margin: EdgeInsets.all(12), + child: ListView.builder( + itemCount: model.sickLeaveList.length, + itemBuilder: (context, index) => DoctorCard( + name: model.sickLeaveList[index].doctorName, + date: DateUtil.getMonthDayYearDateFormatted( + model.sickLeaveList[index].requestDate), + profileUrl: model.sickLeaveList[index].doctorImageURL, + rat: model.sickLeaveList[index].actualDoctorRate.toDouble(), + subName: model.sickLeaveList[index].projectName, + isInOutPatientDescription: + model.sickLeaveList[index].isInOutPatientDescription, + onEmailTap: () { + model.sendSickLeaveEmail( + message: TranslationBase.of(context).emailSentSuccessfully, + requestNo: model.sickLeaveList[index].requestNo, + doctorName: model.sickLeaveList[index].doctorName, + projectName: model.sickLeaveList[index].projectName, + setupID: model.sickLeaveList[index].setupID, + projectID: model.sickLeaveList[index].projectID); + }, ), ), ), From c0c175651fbdf2225468eee9587436611289a741 Mon Sep 17 00:00:00 2001 From: Amjad amireh Date: Wed, 9 Sep 2020 13:11:30 +0300 Subject: [PATCH 40/45] edit card_position.dart --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index 64b3ac1f..9b9588fd 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -35,7 +35,7 @@ dependencies: giffy_dialog: ^1.8.0 # Flutter Html View - flutter_html: ^1.0.2 + flutter_html: 1.0.2 # Native flutter_device_type: ^0.2.0 From d1a01f5afa083c7f2b8da3c6fe126518cd0a500a Mon Sep 17 00:00:00 2001 From: Amjad amireh Date: Wed, 9 Sep 2020 15:55:02 +0300 Subject: [PATCH 41/45] edit card_position.dart --- lib/pages/ErService/ErOptions.dart | 7 +----- lib/pages/ErService/widgets/card_common.dart | 15 +----------- .../ErService/widgets/card_position.dart | 24 +++---------------- 3 files changed, 5 insertions(+), 41 deletions(-) diff --git a/lib/pages/ErService/ErOptions.dart b/lib/pages/ErService/ErOptions.dart index 6b6166bb..886d47d2 100644 --- a/lib/pages/ErService/ErOptions.dart +++ b/lib/pages/ErService/ErOptions.dart @@ -37,12 +37,7 @@ class _ErOptionsState extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ -// Text(TranslationBase.of(context).searchBy, -// style: TextStyle( -// fontSize: 24.0, -// letterSpacing: 1.0, -// fontWeight: FontWeight.bold, -// color: new Color(0xFF60686b))), + Container( margin: EdgeInsets.fromLTRB(0.0, 10.0, 0.0, 10.0), child: Row( diff --git a/lib/pages/ErService/widgets/card_common.dart b/lib/pages/ErService/widgets/card_common.dart index c65789c5..b5fd205a 100644 --- a/lib/pages/ErService/widgets/card_common.dart +++ b/lib/pages/ErService/widgets/card_common.dart @@ -21,7 +21,7 @@ class CardCommonEr extends StatelessWidget { return GestureDetector( onTap: () { navigateToSearch(context, this.type); - print("=============this.type============="+this.type); + }, child: Container( margin: EdgeInsets.fromLTRB(9.0, 9.0, 9.0, 9.0), @@ -63,14 +63,7 @@ class CardCommonEr extends StatelessWidget { if(type==0) {print("========Ambalunce=========");} else{ - print("=========Nearest ER==========="); -// Navigator.push( -// context, -// -// FadePage( -// // page: NearestEr(isAppbar: true,))); -// page: NearestEr())); Navigator.push( context, FadePage( @@ -79,11 +72,5 @@ class CardCommonEr extends StatelessWidget { } -// Navigator.push( -// context, -// MaterialPageRoute( -// builder: (context) => Search( -// type: type, -// ))); } } diff --git a/lib/pages/ErService/widgets/card_position.dart b/lib/pages/ErService/widgets/card_position.dart index 457f646d..b957ec42 100644 --- a/lib/pages/ErService/widgets/card_position.dart +++ b/lib/pages/ErService/widgets/card_position.dart @@ -40,7 +40,7 @@ class CardPosition extends StatelessWidget { }, child: Container( - width:170, + width:165, margin: EdgeInsets.fromLTRB(7.0, 7.0, 7.0, 7.0), decoration: BoxDecoration(boxShadow: [ BoxShadow(color: Colors.grey[400], blurRadius: 2.0, spreadRadius: 0.0) @@ -79,10 +79,8 @@ class CardPosition extends StatelessWidget { Future navigateToSearch(context, type,telephone,networkImage,latitude,longitude,projectname) async { -//===Switch case=== - print("================"+type); - print("================"+telephone); - print("================"+networkImage); + + showDialog( context: context,builder: (_) => AssetGiffyDialog( @@ -98,22 +96,6 @@ class CardPosition extends StatelessWidget { onOkButtonPressed: () { MapsLauncher.launchCoordinates(double.parse(latitude),double.parse(longitude),projectname);}, onCancelButtonPressed :() {launch("tel://" +telephone);} -// double.parse( -// _medicineProvider.pharmaciesList[index]["Latitude"]), -// double.parse( -// _medicineProvider.pharmaciesList[index]["Longitude"]), -// _medicineProvider.pharmaciesList[index] -// ["LocationDescription"]); - //launch("tel://" +telephone); -//================ -// MapsLauncher.launchCoordinates( -// double.parse( -// _medicineProvider.pharmaciesList[index]["Latitude"]), -// double.parse( -// _medicineProvider.pharmaciesList[index]["Longitude"]), -// _medicineProvider.pharmaciesList[index] -// ["LocationDescription"]); -//================= From a41dd736c4ba0bff69cfa79b5543b05d2d748390 Mon Sep 17 00:00:00 2001 From: Amjad amireh Date: Thu, 10 Sep 2020 15:03:13 +0300 Subject: [PATCH 42/45] edit card_position.dart --- lib/pages/ErService/AmbulanceReq.dart | 125 ++++++++++++++++++++++++++ 1 file changed, 125 insertions(+) diff --git a/lib/pages/ErService/AmbulanceReq.dart b/lib/pages/ErService/AmbulanceReq.dart index e69de29b..9c4dfa29 100644 --- a/lib/pages/ErService/AmbulanceReq.dart +++ b/lib/pages/ErService/AmbulanceReq.dart @@ -0,0 +1,125 @@ +import 'package:diplomaticquarterapp/core/viewModels/medical/prescriptions_view_model.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescriptions_history_page.dart'; +import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescriptions_page.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'dart:ui'; +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'; + +class AmbulanceReq extends StatefulWidget { + @override + _AmbulanceReqState createState() => _AmbulanceReqState(); +} + +class _AmbulanceReqState extends State + with SingleTickerProviderStateMixin { + TabController _tabController; + + @override + void initState() { + super.initState(); + _tabController = TabController(length: 2, vsync: this); + } + @override + void dispose() { + super.dispose(); + _tabController.dispose(); + } + @override + Widget build(BuildContext context) { + return BaseView( + onModelReady: (model) => model.getPrescriptions(), + builder: (_, model, widget) => AppScaffold( + isShowAppBar: true, + appBarTitle: "Ambulance Request", + body: Scaffold( + extendBodyBehindAppBar: true, + appBar: PreferredSize( + preferredSize: Size.fromHeight(65.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: 60.0, + margin: EdgeInsets.only(top: 10.0), + width: MediaQuery.of(context).size.width * 0.9, + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + color: Theme.of(context).dividerColor, + width: 0.7), + ), + color: Colors.white), + child: Center( + child: TabBar( + isScrollable: true, + controller: _tabController, + indicatorWeight: 5.0, + indicatorSize: TabBarIndicatorSize.label, + indicatorColor: Colors.red[800], + labelColor: Theme.of(context).primaryColor, + labelPadding: + EdgeInsets.only(top: 4.0, left: 18.0, right: 18.0), + unselectedLabelColor: Colors.grey[800], + tabs: [ + Container( + width: MediaQuery.of(context).size.width * 0.40, + child: Center( + child: Texts("Ambulance Request"),//TranslationBase.of(context).prescriptions + ), + ), + Container( + width: MediaQuery.of(context).size.width * 0.30, + child: Center( + child: Texts("Orders Log"), + ), + ), + ], + ), + ), + ), + ), + ], + ), + ), + body: Column( + children: [ + Expanded( + child: TabBarView( + physics: BouncingScrollPhysics(), + controller: _tabController, + children: [ + PrescriptionsPage( + prescriptionsViewModel: model, + ), + PrescriptionsHistoryPage( + prescriptionsViewModel: model, + ) + ], + ), + ) + ], + ), + ), + ), + ); + } + +} From 368db03ab892a53b50a60a8a32f3f1c57a8e9010 Mon Sep 17 00:00:00 2001 From: Amjad amireh Date: Sun, 13 Sep 2020 12:24:06 +0300 Subject: [PATCH 43/45] edit card_position.dart --- lib/config/config.dart | 4 + ..._all_transportation_method_list_model.dart | 79 +++++++++++++++++++ lib/core/service/er/am_service.dart | 25 ++++++ .../viewModels/er/am_request_view_model.dart | 32 ++++++++ lib/locator.dart | 6 ++ lib/pages/ErService/widgets/card_common.dart | 9 ++- .../ErService/widgets/card_position.dart | 2 +- 7 files changed, 155 insertions(+), 2 deletions(-) create mode 100644 lib/core/model/er/get_all_transportation_method_list_model.dart create mode 100644 lib/core/service/er/am_service.dart create mode 100644 lib/core/viewModels/er/am_request_view_model.dart diff --git a/lib/config/config.dart b/lib/config/config.dart index 47bb9809..fea1bb02 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -54,6 +54,10 @@ const GET_PATIENT_VITAL_SIGN = const GET_NEAREST_HOSPITAL= 'Services/Patients.svc/REST/Patient_GetProjectAvgERWaitingTime'; +///Er Nearest +const GET_AMBULANCE_REQUEST= + 'Services/Patients.svc/REST/PatientER_RRT_GetAllTransportationMethod'; + diff --git a/lib/core/model/er/get_all_transportation_method_list_model.dart b/lib/core/model/er/get_all_transportation_method_list_model.dart new file mode 100644 index 00000000..3402873e --- /dev/null +++ b/lib/core/model/er/get_all_transportation_method_list_model.dart @@ -0,0 +1,79 @@ +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +class PatientER_RRT_GetAllTransportationMethodListModel { + int id; + DateTime createDate; + DateTime lastEditDate; + int createdBy; + int lastEditBy; + bool isActive; + String title; + String titleAR; + int price; + Null isDefault; + int visibility; + Null durationId; + String description; + String descriptionAR; + int totalPrice; + int vAT; + + PatientER_RRT_GetAllTransportationMethodListModel( + { + this.id, + this.createDate, + this.lastEditDate, + this.createdBy, + this.lastEditBy, + this.isActive, + this.title, + this.titleAR, + this.price, + this.isDefault, + this.visibility, + this.durationId, + this.description, + this.descriptionAR, + this.totalPrice, + this.vAT}); + + PatientER_RRT_GetAllTransportationMethodListModel.fromJson( + Map json) { + id = json['Id']; + createDate = DateUtil.convertStringToDate(json['CreateDate']); + lastEditDate = DateUtil.convertStringToDate(json['LastEditDate']); + createdBy = json['CreatedBy']; + lastEditBy = json['LastEditBy']; + isActive = json['IsActive']; + title = json['Title']; + titleAR = json['TitleAR']; + price = json['Price']; + isDefault = json['isDefault']; + visibility = json['Visibility']; + durationId = json['DurationId']; + description = json['Description']; + descriptionAR = json['DescriptionAR']; + totalPrice = json['TotalPrice']; + vAT = json['VAT']; + } + + Map toJson() { + final Map data = new Map(); + data['Id'] = this.id; + data['CreateDate'] = this.createDate; + data['LastEditDate'] = this.lastEditDate; + data['CreatedBy'] = this.createdBy; + data['LastEditBy'] = this.lastEditBy; + data['IsActive'] = this.isActive; + data['Title'] = this.title; + data['TitleAR'] = this.titleAR; + data['Price'] = this.price; + data['isDefault'] = this.isDefault; + data['Visibility'] = this.visibility; + data['DurationId'] = this.durationId; + data['Description'] = this.description; + data['DescriptionAR'] = this.descriptionAR; + data['TotalPrice'] = this.totalPrice; + data['VAT'] = this.vAT; + return data; + } +} \ No newline at end of file diff --git a/lib/core/service/er/am_service.dart b/lib/core/service/er/am_service.dart new file mode 100644 index 00000000..181ad37b --- /dev/null +++ b/lib/core/service/er/am_service.dart @@ -0,0 +1,25 @@ +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/core/model/er/get_all_transportation_method_list_model.dart'; +import '../base_service.dart'; + +class AmService extends BaseService { + List AmModelList = List(); + Map body = Map(); + + Future getAllTransportationOrders() async { + hasError = false; + + await baseAppClient.post(GET_AMBULANCE_REQUEST, + onSuccess: (dynamic response, int statusCode) { + AmModelList.clear(); + response['AmModelList'].forEach((vital) { + AmModelList.add( + PatientER_RRT_GetAllTransportationMethodListModel.fromJson(vital)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } +} diff --git a/lib/core/viewModels/er/am_request_view_model.dart b/lib/core/viewModels/er/am_request_view_model.dart new file mode 100644 index 00000000..db1acbf0 --- /dev/null +++ b/lib/core/viewModels/er/am_request_view_model.dart @@ -0,0 +1,32 @@ + +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/er/get_all_transportation_method_list_model.dart'; +import 'package:diplomaticquarterapp/core/service/er/am_service.dart'; +import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; +import '../base_view_model.dart'; +import '../../../locator.dart'; + +class AmRequestViewModel extends BaseViewModel{ + + + AmService _amService = locator(); + + List get AmRequestModeList=> + _amService.AmModelList; + + getAmRequestOrders({int id, int projectID}) async { + setState(ViewState.Busy); + + + await _amService.getAllTransportationOrders(); + + if ( _amService.hasError) { + error = _amService.error; + setState(ViewState.Error); + } else + setState(ViewState.Idle); + } + + + +} \ No newline at end of file diff --git a/lib/locator.dart b/lib/locator.dart index 8f347f42..b3accfd2 100644 --- a/lib/locator.dart +++ b/lib/locator.dart @@ -5,6 +5,7 @@ import 'package:get_it/get_it.dart'; import 'core/service/appointment_rate_service.dart'; import 'core/service/dashboard_service.dart'; +import 'core/service/er/am_service.dart'; import 'core/service/er/er_service.dart'; import 'core/service/feedback/feedback_service.dart'; import 'core/service/hospital_service.dart'; @@ -17,6 +18,7 @@ import 'core/service/medical/radiology_service.dart'; import 'core/service/medical/reports_monthly_service.dart'; import 'core/service/medical/vital_sign_service.dart'; import 'core/viewModels/appointment_rate_view_model.dart'; +import 'core/viewModels/er/am_request_view_model.dart'; import 'core/viewModels/er/near_hospital_view_model.dart'; import 'core/viewModels/feedback/feedback_view_model.dart'; import 'core/service/medical/reports_service.dart'; @@ -61,6 +63,9 @@ void setupLocator() { locator.registerFactory(() => VaccineService()); locator.registerLazySingleton(() => ReportsMonthlyService()); locator.registerLazySingleton(() => ErService()); + locator.registerLazySingleton(() => AmService()); + + locator.registerLazySingleton(() => PatientSickLeaveService()); /// View Model @@ -81,6 +86,7 @@ void setupLocator() { locator.registerFactory(() => QrViewModel()); locator.registerFactory(() => ReportsMonthlyViewModel()); locator.registerFactory(() => NearHospitalViewModel()); + locator.registerFactory(() => AmRequestViewModel()); locator.registerFactory(() => PatientSickLeaveViewMode()); } diff --git a/lib/pages/ErService/widgets/card_common.dart b/lib/pages/ErService/widgets/card_common.dart index b5fd205a..35ece966 100644 --- a/lib/pages/ErService/widgets/card_common.dart +++ b/lib/pages/ErService/widgets/card_common.dart @@ -3,6 +3,7 @@ import 'package:diplomaticquarterapp/pages/BookAppointment/Search.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; +import '../AmbulanceReq.dart'; import '../NearestEr.dart'; class CardCommonEr extends StatelessWidget { @@ -61,7 +62,13 @@ class CardCommonEr extends StatelessWidget { Future navigateToSearch(context, type) async { //===Switch case=== if(type==0) - {print("========Ambalunce=========");} + { + + Navigator.push( + context, + FadePage( + page: AmbulanceReq())); + } else{ Navigator.push( diff --git a/lib/pages/ErService/widgets/card_position.dart b/lib/pages/ErService/widgets/card_position.dart index b957ec42..8647ad62 100644 --- a/lib/pages/ErService/widgets/card_position.dart +++ b/lib/pages/ErService/widgets/card_position.dart @@ -40,7 +40,7 @@ class CardPosition extends StatelessWidget { }, child: Container( - width:165, + width:MediaQuery.of(context).size.width * 0.47,//165, margin: EdgeInsets.fromLTRB(7.0, 7.0, 7.0, 7.0), decoration: BoxDecoration(boxShadow: [ BoxShadow(color: Colors.grey[400], blurRadius: 2.0, spreadRadius: 0.0) From a0300738e826fbbf91210e13d7c1205a7c664a5d Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Sun, 13 Sep 2020 17:38:38 +0300 Subject: [PATCH 44/45] done My balance --- lib/config/config.dart | 10 +- lib/core/model/hospitals/hospitals_model.dart | 6 +- lib/core/model/my_balance/AdvanceModel.dart | 18 + .../patient_advance_balance_amount.dart | 28 ++ lib/core/model/my_balance/patient_info.dart | 32 ++ .../patient_info_and_mobile_number.dart | 84 ++++ lib/core/model/sick_leave/sick_leave.dart | 1 + lib/core/service/hospital_service.dart | 36 +- .../service/medical/my_balance_service.dart | 148 +++++++ .../medical/my_balance_view_model.dart | 116 ++++++ lib/locator.dart | 4 + lib/main.dart | 4 +- .../medical/balance/advance_payment_page.dart | 377 ++++++++++++++++++ .../medical/balance/confirm_payment_page.dart | 176 ++++++++ .../balance/dialogs/ConfirmSMSDialog.dart | 363 +++++++++++++++++ .../dialogs/SelectBeneficiaryDialog.dart | 175 ++++++++ .../balance/dialogs/SelectHospitalDialog.dart | 128 ++++++ .../dialogs/SelectPatientFamilyDialog.dart | 129 ++++++ .../dialogs/SelectPatientInfoDialog.dart | 129 ++++++ .../balance/dialogs/show_timer_text.dart | 89 +++++ .../medical/balance/my_balance_page.dart | 106 +++++ lib/pages/medical/balance/new_text_Field.dart | 239 +++++++++++ lib/pages/medical/medical_profile_page.dart | 9 +- .../data_display/medical/doctor_card.dart | 1 + 24 files changed, 2384 insertions(+), 24 deletions(-) create mode 100644 lib/core/model/my_balance/AdvanceModel.dart create mode 100644 lib/core/model/my_balance/patient_advance_balance_amount.dart create mode 100644 lib/core/model/my_balance/patient_info.dart create mode 100644 lib/core/model/my_balance/patient_info_and_mobile_number.dart create mode 100644 lib/core/service/medical/my_balance_service.dart create mode 100644 lib/core/viewModels/medical/my_balance_view_model.dart create mode 100644 lib/pages/medical/balance/advance_payment_page.dart create mode 100644 lib/pages/medical/balance/confirm_payment_page.dart create mode 100644 lib/pages/medical/balance/dialogs/ConfirmSMSDialog.dart create mode 100644 lib/pages/medical/balance/dialogs/SelectBeneficiaryDialog.dart create mode 100644 lib/pages/medical/balance/dialogs/SelectHospitalDialog.dart create mode 100644 lib/pages/medical/balance/dialogs/SelectPatientFamilyDialog.dart create mode 100644 lib/pages/medical/balance/dialogs/SelectPatientInfoDialog.dart create mode 100644 lib/pages/medical/balance/dialogs/show_timer_text.dart create mode 100644 lib/pages/medical/balance/my_balance_page.dart create mode 100644 lib/pages/medical/balance/new_text_Field.dart diff --git a/lib/config/config.dart b/lib/config/config.dart index 47bb9809..7ef2a306 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -7,7 +7,7 @@ const MAX_SMALL_SCREEN = 660; const BASE_URL = 'https://hmgwebservices.com/'; -const GET_PROJECT = '/Lists.svc/REST/GetProject'; +const GET_PROJECT = 'Services/Lists.svc/REST/GetProject'; ///Doctor const GET_MY_DOCTOR = @@ -193,6 +193,14 @@ const GET_PATIENT_SICK_LEAVE = 'Services/Patients.svc/REST/GetPatientSickLeave'; const SendSickLeaveEmail = 'Services/Notifications.svc/REST/SendSickLeaveEmail'; +const GET_PATIENT_AdVANCE_BALANCE_AMOUNT = 'Services/Patients.svc/REST/GetPatientAdvanceBalanceAmount'; +const GET_PATIENT_INFO_BY_ID = 'Services/Doctors.svc/REST/GetPatientInfoByPatientID'; +const GET_PATIENT_INFO_BY_ID_AND_MOBILE_NUMBER = 'Services/Patients.svc/REST/AP_GetPatientInfoByPatientIDandMobileNumber'; +const SEND_ACTIVATION_CODE_FOR_ADVANCE_PAYMENT = 'Services/Authentication.svc/REST/SendActivationCodeForAdvancePayment'; +const CHECK_ACTIVATION_CODE_FOR_ADVANCE_PAYMENT = 'Services/Authentication.svc/REST/CheckActivationCodeForAdvancePayment'; + +const TIMER_MIN = 10; + class AppGlobal { static var context; diff --git a/lib/core/model/hospitals/hospitals_model.dart b/lib/core/model/hospitals/hospitals_model.dart index a8308de8..264528c7 100644 --- a/lib/core/model/hospitals/hospitals_model.dart +++ b/lib/core/model/hospitals/hospitals_model.dart @@ -1,18 +1,18 @@ class HospitalsModel { String desciption; Null desciptionN; - int iD; + dynamic iD; String legalName; String legalNameN; String name; Null nameN; String phoneNumber; String setupID; - int distanceInKilometers; + dynamic distanceInKilometers; bool isActive; String latitude; String longitude; - int mainProjectID; + dynamic mainProjectID; Null projectOutSA; bool usingInDoctorApp; diff --git a/lib/core/model/my_balance/AdvanceModel.dart b/lib/core/model/my_balance/AdvanceModel.dart new file mode 100644 index 00000000..40472b13 --- /dev/null +++ b/lib/core/model/my_balance/AdvanceModel.dart @@ -0,0 +1,18 @@ +import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart'; + +class AdvanceModel { + String fileNumber; + String amount; + HospitalsModel hospitalsModel; + String email; + String note; + String depositorName; + + AdvanceModel( + {this.amount, + this.email, + this.note, + this.hospitalsModel, + this.fileNumber, + this.depositorName}); +} diff --git a/lib/core/model/my_balance/patient_advance_balance_amount.dart b/lib/core/model/my_balance/patient_advance_balance_amount.dart new file mode 100644 index 00000000..44a5083f --- /dev/null +++ b/lib/core/model/my_balance/patient_advance_balance_amount.dart @@ -0,0 +1,28 @@ +class PatientAdvanceBalanceAmount { + int distanceInKilometers; + dynamic patientAdvanceBalanceAmount; + String projectDescription; + int projectID; + + PatientAdvanceBalanceAmount( + {this.distanceInKilometers, + this.patientAdvanceBalanceAmount, + this.projectDescription, + this.projectID}); + + PatientAdvanceBalanceAmount.fromJson(Map json) { + distanceInKilometers = json['DistanceInKilometers']; + patientAdvanceBalanceAmount = json['PatientAdvanceBalanceAmount']; + projectDescription = json['ProjectDescription']; + projectID = json['ProjectID']; + } + + Map toJson() { + final Map data = new Map(); + data['DistanceInKilometers'] = this.distanceInKilometers; + data['PatientAdvanceBalanceAmount'] = this.patientAdvanceBalanceAmount; + data['ProjectDescription'] = this.projectDescription; + data['ProjectID'] = this.projectID; + return data; + } +} diff --git a/lib/core/model/my_balance/patient_info.dart b/lib/core/model/my_balance/patient_info.dart new file mode 100644 index 00000000..6004f014 --- /dev/null +++ b/lib/core/model/my_balance/patient_info.dart @@ -0,0 +1,32 @@ +class PatientInfo { + String fullName; + String mobileNumber; + int patientID; + int projectID; + String zipCode; + + PatientInfo( + {this.fullName, + this.mobileNumber, + this.patientID, + this.projectID, + this.zipCode}); + + PatientInfo.fromJson(Map json) { + fullName = json['FullName']; + mobileNumber = json['MobileNumber']; + patientID = json['PatientID']; + projectID = json['ProjectID']; + zipCode = json['ZipCode']; + } + + Map toJson() { + final Map data = new Map(); + data['FullName'] = this.fullName; + data['MobileNumber'] = this.mobileNumber; + data['PatientID'] = this.patientID; + data['ProjectID'] = this.projectID; + data['ZipCode'] = this.zipCode; + return data; + } +} diff --git a/lib/core/model/my_balance/patient_info_and_mobile_number.dart b/lib/core/model/my_balance/patient_info_and_mobile_number.dart new file mode 100644 index 00000000..8f05b4d9 --- /dev/null +++ b/lib/core/model/my_balance/patient_info_and_mobile_number.dart @@ -0,0 +1,84 @@ +class PatientInfoAndMobileNumber { + String setupID; + int projectID; + int mainAccountID; + int patientType; + int patientID; + String firstName; + Null middleName; + Null lastName; + Null firstNameN; + Null middleNameN; + Null lastNameN; + Null gender; + Null dateofBirth; + Null dateofBirthN; + Null nationalityID; + String mobileNumber; + String emailAddress; + Null zipCode; + + PatientInfoAndMobileNumber( + {this.setupID, + this.projectID, + this.mainAccountID, + this.patientType, + this.patientID, + this.firstName, + this.middleName, + this.lastName, + this.firstNameN, + this.middleNameN, + this.lastNameN, + this.gender, + this.dateofBirth, + this.dateofBirthN, + this.nationalityID, + this.mobileNumber, + this.emailAddress, + this.zipCode}); + + PatientInfoAndMobileNumber.fromJson(Map json) { + setupID = json['SetupID']; + projectID = json['ProjectID']; + mainAccountID = json['MainAccountID']; + patientType = json['PatientType']; + patientID = json['PatientID']; + firstName = json['FirstName']; + middleName = json['MiddleName']; + lastName = json['LastName']; + firstNameN = json['FirstNameN']; + middleNameN = json['MiddleNameN']; + lastNameN = json['LastNameN']; + gender = json['Gender']; + dateofBirth = json['DateofBirth']; + dateofBirthN = json['DateofBirthN']; + nationalityID = json['NationalityID']; + mobileNumber = json['MobileNumber']; + emailAddress = json['EmailAddress']; + zipCode = json['ZipCode']; + } + + Map toJson() { + final Map data = new Map(); + data['SetupID'] = this.setupID; + data['ProjectID'] = this.projectID; + data['MainAccountID'] = this.mainAccountID; + data['PatientType'] = this.patientType; + data['PatientID'] = this.patientID; + 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['Gender'] = this.gender; + data['DateofBirth'] = this.dateofBirth; + data['DateofBirthN'] = this.dateofBirthN; + data['NationalityID'] = this.nationalityID; + data['MobileNumber'] = this.mobileNumber; + data['EmailAddress'] = this.emailAddress; + data['ZipCode'] = this.zipCode; + return data; + } +} diff --git a/lib/core/model/sick_leave/sick_leave.dart b/lib/core/model/sick_leave/sick_leave.dart index d5e6e76c..ff73e1da 100644 --- a/lib/core/model/sick_leave/sick_leave.dart +++ b/lib/core/model/sick_leave/sick_leave.dart @@ -97,6 +97,7 @@ class SickLeave { patientName = json['PatientName']; projectName = json['ProjectName']; qR = json['QR']; + if(json['Speciality']!=null) speciality = json['Speciality'].cast(); } diff --git a/lib/core/service/hospital_service.dart b/lib/core/service/hospital_service.dart index c131d94f..194b8256 100644 --- a/lib/core/service/hospital_service.dart +++ b/lib/core/service/hospital_service.dart @@ -2,35 +2,43 @@ import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart'; import 'package:diplomaticquarterapp/core/model/hospitals/request_get_hospitals_model.dart'; import 'package:diplomaticquarterapp/core/service/base_service.dart'; +import 'package:geolocator/geolocator.dart'; class HospitalService extends BaseService { List _hospitals = List(); List get hospitals => _hospitals; - RequestGetHospitalsModel _requestGetHospitalsModel = RequestGetHospitalsModel( - latitude: 0, - longitude: 0, - versionID: 5.2, - channel: 3, - languageID: 2, - iPAdress: '10.20.10.20', - generalid: 'Cs2020@2016\$2958', - patientOutSA: 0, - sessionID: 'JUWuiMBCEGkAAxQpakQ', - isDentalAllowedBackend: false, - deviceTypeID: 2); + double _latitude; + double _longitude; + + _getCurrentLocation() async { + await getLastKnownPosition().then((value) { + _latitude = value.latitude; + _longitude = value.longitude; + }).catchError((e) { + _longitude = 0; + _latitude = 0; + }); + // currentLocation = LatLng(position.latitude, position.longitude); + } Future getHospitals() async { + await _getCurrentLocation(); + Map body = Map(); + body['Latitude'] = _latitude; + body['Longitude'] = _longitude; + await baseAppClient.post(GET_PROJECT, onSuccess: (dynamic response, int statusCode) { - _hospitals.clear(); + _hospitals.clear(); response['ListProject'].forEach((hospital) { _hospitals.add(HospitalsModel.fromJson(hospital)); }); }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; - }, body: _requestGetHospitalsModel.toJson()); + }, body: body); } + } diff --git a/lib/core/service/medical/my_balance_service.dart b/lib/core/service/medical/my_balance_service.dart new file mode 100644 index 00000000..cbc1be97 --- /dev/null +++ b/lib/core/service/medical/my_balance_service.dart @@ -0,0 +1,148 @@ +import 'dart:convert'; + +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/core/model/my_balance/patient_advance_balance_amount.dart'; +import 'package:diplomaticquarterapp/core/model/my_balance/patient_info.dart'; +import 'package:diplomaticquarterapp/core/model/my_balance/patient_info_and_mobile_number.dart'; +import 'package:diplomaticquarterapp/core/service/base_service.dart'; +import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart'; +import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordsByStatusReq.dart'; +import 'package:diplomaticquarterapp/services/family_files/family_files_provider.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; + +class MyBalanceService extends BaseService { + List patientAdvanceBalanceAmountList = List(); + double totalAdvanceBalanceAmount; + List patientInfoList = List(); + GetAllSharedRecordsByStatusResponse getAllSharedRecordsByStatusResponse = + GetAllSharedRecordsByStatusResponse(); + PatientInfoAndMobileNumber patientInfoAndMobileNumber; + String logInTokenID; + String verificationCode; + + getPatientAdvanceBalanceAmount() async { + hasError = false; + super.error = ""; + await baseAppClient.post(GET_PATIENT_AdVANCE_BALANCE_AMOUNT, + onSuccess: (response, statusCode) async { + patientAdvanceBalanceAmountList.clear(); + response['List_PatientAdvanceBalanceAmount'].forEach((item) { + patientAdvanceBalanceAmountList + .add(PatientAdvanceBalanceAmount.fromJson(item)); + }); + totalAdvanceBalanceAmount = response['TotalAdvanceBalanceAmount']; + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: Map()); + } + + getPatientInfoByPatientID({String id}) async { + hasError = false; + super.error = ""; + Map body = Map(); + body['SearchPatientID'] = int.parse(id); + body['isDentalAllowedBackend'] = false; + await baseAppClient.post(GET_PATIENT_INFO_BY_ID, + onSuccess: (response, statusCode) async { + patientInfoList.clear(); + response['GetPatientInfoByPatientIDList'].forEach((item) { + patientInfoList.add(PatientInfo.fromJson(item)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } + + getPatientInfoByPatientIDAndMobileNumber() async { + hasError = false; + super.error = ""; + Map body = Map(); + body['isDentalAllowedBackend'] = false; + body['MobileNo'] = user.mobileNumber; + body['ProjectID'] = user.projectID; + + await baseAppClient.post(GET_PATIENT_INFO_BY_ID_AND_MOBILE_NUMBER, + onSuccess: (response, statusCode) async { + response['List_PatientInfo'].forEach((item) { + patientInfoAndMobileNumber = PatientInfoAndMobileNumber.fromJson(item); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + super.error = error; + }, body: body); + } + + sendActivationCodeForAdvancePayment({int patientID,int projectID}) async { + hasError = false; + super.error = ""; + Map body = Map(); + body['PatientID'] = patientID; + body['ProjectID'] = projectID; + body['isDentalAllowedBackend'] = false; + + await baseAppClient.post(SEND_ACTIVATION_CODE_FOR_ADVANCE_PAYMENT, + onSuccess: (response, statusCode) async { + logInTokenID = response['LogInTokenID']; + verificationCode = response['VerificationCode']; + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + super.error = error; + }, body: body); + } + + checkActivationCodeForAdvancePayment({String activationCode}) async { + hasError = false; + super.error = ""; + Map body = Map(); + body['activationCode'] = activationCode; + body['PatientMobileNumber'] = 'XXXXXXXXXX'; + body['isDentalAllowedBackend'] = false; + body['LogInTokenID'] = logInTokenID; + + await baseAppClient.post(CHECK_ACTIVATION_CODE_FOR_ADVANCE_PAYMENT, + onSuccess: (response, statusCode) async { + + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + super.error = error; + }, body: body); + } + + getSharedRecordByStatus() async { + try { + var request = GetAllSharedRecordsByStatusReq(); + request.status = 0; + await baseAppClient.post(GET_SHARED_RECORD_BY_STATUS, + onSuccess: (dynamic response, int statusCode) { + sharedPref.setObject(FAMILY_FILE, response); + getAllSharedRecordsByStatusResponse = + GetAllSharedRecordsByStatusResponse.fromJson(response); + }, onFailure: (String error, int statusCode) { + AppToast.showErrorToast(message: error); + hasError = true; + super.error = error; + }, body: request.toJson()); + } catch (error) { + print(error); + hasError = true; + super.error = error; + } + } + + getFamilyFiles() async { + if (await sharedPref.getObject(FAMILY_FILE) != null) { + getAllSharedRecordsByStatusResponse = + GetAllSharedRecordsByStatusResponse.fromJson( + await sharedPref.getObject(FAMILY_FILE)); + return getAllSharedRecordsByStatusResponse; + } else { + return getSharedRecordByStatus(); + } + } +} diff --git a/lib/core/viewModels/medical/my_balance_view_model.dart b/lib/core/viewModels/medical/my_balance_view_model.dart new file mode 100644 index 00000000..350e9d89 --- /dev/null +++ b/lib/core/viewModels/medical/my_balance_view_model.dart @@ -0,0 +1,116 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart'; +import 'package:diplomaticquarterapp/core/model/my_balance/patient_advance_balance_amount.dart'; +import 'package:diplomaticquarterapp/core/model/my_balance/patient_info.dart'; +import 'package:diplomaticquarterapp/core/model/my_balance/patient_info_and_mobile_number.dart'; +import 'package:diplomaticquarterapp/core/service/hospital_service.dart'; +import 'package:diplomaticquarterapp/core/service/medical/my_balance_service.dart'; +import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; +import 'package:diplomaticquarterapp/locator.dart'; +import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; + +class MyBalanceViewModel extends BaseViewModel { + MyBalanceService _myBalanceService = locator(); + + HospitalService _hospitalService = locator(); + + List get hospitals => _hospitalService.hospitals; + + List get patientAdvanceBalanceAmountList => + _myBalanceService.patientAdvanceBalanceAmountList; + + double get totalAdvanceBalanceAmount => + _myBalanceService.totalAdvanceBalanceAmount; + + GetAllSharedRecordsByStatusResponse get getAllSharedRecordsByStatusResponse => + _myBalanceService.getAllSharedRecordsByStatusResponse; + + List get patientInfoList => _myBalanceService.patientInfoList; + + PatientInfoAndMobileNumber get patientInfoAndMobileNumber => + _myBalanceService.patientInfoAndMobileNumber; + + + String get logInTokenID => _myBalanceService.logInTokenID; + String get verificationCode => _myBalanceService.verificationCode; + + getPatientAdvanceBalanceAmount() async { + setState(ViewState.Busy); + await _myBalanceService.getPatientAdvanceBalanceAmount(); + if (_myBalanceService.hasError) { + error = _myBalanceService.error; + setState(ViewState.Error); + } else { + setState(ViewState.Idle); + } + } + + Future getHospitals() async { + setState(ViewState.Busy); + await _hospitalService.getHospitals(); + if (_hospitalService.hasError) { + error = _hospitalService.error; + setState(ViewState.Error); + } else + setState(ViewState.Idle); + } + + Future getPatientInfoByPatientID({String id}) async { + setState(ViewState.Busy); + await _myBalanceService.getPatientInfoByPatientID(id: id); + if (_myBalanceService.hasError) { + error = _myBalanceService.error; + setState(ViewState.ErrorLocal); + AppToast.showErrorToast(message: error); + } else { + setState(ViewState.Idle); + } + } + + Future getPatientInfoByPatientIDAndMobileNumber() async { + setState(ViewState.Busy); + await _myBalanceService.getPatientInfoByPatientIDAndMobileNumber(); + if (_myBalanceService.hasError) { + error = _myBalanceService.error; + setState(ViewState.ErrorLocal); + AppToast.showErrorToast(message: error); + } else { + setState(ViewState.Idle); + } + } + + Future sendActivationCodeForAdvancePayment({int patientID,int projectID}) async { + setState(ViewState.Busy); + await _myBalanceService.sendActivationCodeForAdvancePayment(patientID: patientID,projectID: projectID); + if (_myBalanceService.hasError) { + error = _myBalanceService.error; + setState(ViewState.ErrorLocal); + AppToast.showErrorToast(message: error); + } else { + setState(ViewState.Idle); + } + } + Future checkActivationCodeForAdvancePayment({String activationCode}) async { + setState(ViewState.Busy); + await _myBalanceService.checkActivationCodeForAdvancePayment(activationCode: activationCode); + if (_myBalanceService.hasError) { + error = _myBalanceService.error; + setState(ViewState.ErrorLocal); + } else { + setState(ViewState.Idle); + } + } + + Future getFamilyFiles() async { + setState(ViewState.Busy); + await _myBalanceService.getFamilyFiles(); + if (_myBalanceService.hasError) { + error = _myBalanceService.error; + setState(ViewState.ErrorLocal); + AppToast.showErrorToast(message: error); + } else { + setState(ViewState.Idle); + } + } +} diff --git a/lib/locator.dart b/lib/locator.dart index 8f347f42..6c8d178e 100644 --- a/lib/locator.dart +++ b/lib/locator.dart @@ -11,6 +11,7 @@ import 'core/service/hospital_service.dart'; import 'core/service/medical/PatientSickLeaveService.dart'; import 'core/service/medical/labs_service.dart'; import 'core/service/medical/medical_service.dart'; +import 'core/service/medical/my_balance_service.dart'; import 'core/service/medical/my_doctor_service.dart'; import 'core/service/medical/prescriptions_service.dart'; import 'core/service/medical/radiology_service.dart'; @@ -23,6 +24,7 @@ import 'core/service/medical/reports_service.dart'; import 'core/viewModels/hospital_view_model.dart'; import 'core/viewModels/medical/labs_view_model.dart'; import 'core/viewModels/medical/medical_view_model.dart'; +import 'core/viewModels/medical/my_balance_view_model.dart'; import 'core/viewModels/medical/my_doctor_view_model.dart'; import 'core/viewModels/medical/patient_sick_leave_view_model.dart'; import 'core/viewModels/medical/prescriptions_view_model.dart'; @@ -62,6 +64,7 @@ void setupLocator() { locator.registerLazySingleton(() => ReportsMonthlyService()); locator.registerLazySingleton(() => ErService()); locator.registerLazySingleton(() => PatientSickLeaveService()); + locator.registerLazySingleton(() => MyBalanceService()); /// View Model locator.registerFactory(() => HospitalViewModel()); @@ -82,5 +85,6 @@ void setupLocator() { locator.registerFactory(() => ReportsMonthlyViewModel()); locator.registerFactory(() => NearHospitalViewModel()); locator.registerFactory(() => PatientSickLeaveViewMode()); + locator.registerFactory(() => MyBalanceViewModel()); } diff --git a/lib/main.dart b/lib/main.dart index 0c6b2760..ec42e7a3 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -68,7 +68,7 @@ class MyApp extends StatelessWidget { errorColor: Color.fromRGBO(235, 80, 60, 1.0), scaffoldBackgroundColor:Hexcolor('#E9E9E9'),// Colors.grey[100], textSelectionColor: Color.fromRGBO(80, 100, 253, 0.5), - textSelectionHandleColor: Color.fromRGBO(80, 100, 253, 1.0), + textSelectionHandleColor: Colors.grey, canvasColor: Colors.white, backgroundColor: Color.fromRGBO(255, 255, 255, 1), highlightColor: Colors.grey[100].withOpacity(0.4), @@ -77,7 +77,7 @@ class MyApp extends StatelessWidget { bottomSheetTheme:BottomSheetThemeData( backgroundColor: Hexcolor('#E0E0E0') ) , - cursorColor: Color.fromRGBO(78, 62, 253, 1.0), + cursorColor: Colors.grey, iconTheme: IconThemeData(), appBarTheme: AppBarTheme( color: Colors.grey[700], diff --git a/lib/pages/medical/balance/advance_payment_page.dart b/lib/pages/medical/balance/advance_payment_page.dart new file mode 100644 index 00000000..14f9b664 --- /dev/null +++ b/lib/pages/medical/balance/advance_payment_page.dart @@ -0,0 +1,377 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart'; +import 'package:diplomaticquarterapp/core/model/my_balance/patient_info.dart'; +import 'package:diplomaticquarterapp/core/viewModels/medical/my_balance_view_model.dart'; +import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart'; +import 'package:diplomaticquarterapp/pages/ToDoList/payment_method_select.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/pages/medical/balance/dialogs/SelectHospitalDialog.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.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/transitions/fade_page.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:smart_progress_bar/smart_progress_bar.dart'; + +import '../../../core/model/my_balance/AdvanceModel.dart'; +import 'dialogs/ConfirmSMSDialog.dart'; +import 'dialogs/SelectBeneficiaryDialog.dart'; +import 'dialogs/SelectPatientFamilyDialog.dart'; +import 'dialogs/SelectPatientInfoDialog.dart'; +import 'confirm_payment_page.dart'; +import 'new_text_Field.dart'; + +enum BeneficiaryType { MyAccount, MyFamilyFiles, OtherAccount, NON } + +class AdvancePaymentPage extends StatefulWidget { + @override + _AdvancePaymentPageState createState() => _AdvancePaymentPageState(); +} + +class _AdvancePaymentPageState extends State { + TextEditingController _fileTextController = TextEditingController(); + TextEditingController _notesTextController = TextEditingController(); + BeneficiaryType beneficiaryType = BeneficiaryType.NON; + HospitalsModel _selectedHospital; + String amount = ""; + String email; + PatientInfo _selectedPatientInfo; + GetAllSharedRecordsByStatusList selectedPatientFamily; + AdvanceModel advanceModel = AdvanceModel(); + + @override + void initState() { + super.initState(); + } + + @override + Widget build(BuildContext context) { + return BaseView( + onModelReady: (model) => model.getHospitals(), + builder: (_, model, w) => AppScaffold( + isShowAppBar: true, + appBarTitle: 'Advance Payment', + body: SingleChildScrollView( + physics: ScrollPhysics(), + child: Container( + margin: EdgeInsets.all(12), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts( + 'You can create and add an Advanced Payment for you account or other accounts.', + textAlign: TextAlign.center, + ), + SizedBox( + height: 12, + ), + InkWell( + onTap: () => confirmSelectBeneficiaryDialog(model), + 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(getBeneficiaryType()), + 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, + ), + NewTextFields( + hintText: 'File Number', + controller: _fileTextController, + ), + if (beneficiaryType == BeneficiaryType.OtherAccount) + SizedBox( + height: 12, + ), + if (beneficiaryType == BeneficiaryType.OtherAccount) + InkWell( + onTap: () { + if (_fileTextController.text.isNotEmpty) + model + .getPatientInfoByPatientID( + id: _fileTextController.text) + .then((value) { + confirmSelectPatientDialog(model.patientInfoList); + }).showProgressBar( + text: "Loading", + backgroundColor: + Colors.blue.withOpacity(0.6)); + else + AppToast.showErrorToast( + message: 'Please Enter The File Number'); + }, + 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(getPatientName()), + Icon(Icons.arrow_drop_down) + ], + ), + ), + ), + SizedBox( + height: 12, + ), + InkWell( + onTap: () => confirmSelectHospitalDialog(model.hospitals), + 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(getHospitalName()), + Icon(Icons.arrow_drop_down) + ], + ), + ), + ), + SizedBox( + height: 12, + ), + NewTextFields( + hintText: 'Amount*', + keyboardType: TextInputType.number, + onChanged: (value) { + setState(() { + amount = value; + }); + }, + ), + SizedBox( + height: 12, + ), + NewTextFields( + hintText: 'Depositor Email*', + initialValue: model.user.emailAddress, + onChanged: (value) { + email = value; + }, + ), + SizedBox( + height: 12, + ), + NewTextFields( + hintText: 'Notes', + controller: _notesTextController, + ), + SizedBox( + height: MediaQuery.of(context).size.height * 0.15, + ) + ], + ), + ), + ), + bottomSheet: Container( + height: MediaQuery.of(context).size.height * 0.1, + width: double.infinity, + padding: EdgeInsets.all(12), + child: SecondaryButton( + textColor: Colors.white, + label: 'Submit', + disabled: amount.isEmpty || + _fileTextController.text.isEmpty || + _selectedHospital == null, + onTap: () { + advanceModel.fileNumber = _fileTextController.text; + advanceModel.hospitalsModel = _selectedHospital; + advanceModel.note = _notesTextController.text; + advanceModel.email = email ?? model.user.emailAddress; + advanceModel.amount = amount; + + model.getPatientInfoByPatientIDAndMobileNumber().then((value) { + if (model.state != ViewState.Error && + model.state != ViewState.ErrorLocal) { + Utils.hideKeyboard(context); + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => PaymentMethod())).then( + (value) { + Navigator.push( + context, + FadePage( + page: ConfirmPaymentPage( + advanceModel: advanceModel, + selectedPaymentMethod: value, + patientInfoAndMobileNumber: + model.patientInfoAndMobileNumber, + ), + ), + ); + }, + ); + } + }).showProgressBar( + text: "Loading", + backgroundColor: Colors.blue.withOpacity(0.6)); + }, + ), + )), + ); + } + + void confirmSelectBeneficiaryDialog(MyBalanceViewModel model) { + showDialog( + context: context, + child: SelectBeneficiaryDialog( + beneficiaryType: beneficiaryType, + onValueSelected: (value) { + setState(() { + if (value == BeneficiaryType.MyAccount) { + _fileTextController.text = model.user.patientID.toString(); + advanceModel.depositorName = + model.user.firstName + " " + model.user.lastName; + } else + _fileTextController.text = ""; + + beneficiaryType = value; + }); + }, + ), + ); + } + + void confirmSelectHospitalDialog(List hospitals) { + showDialog( + context: context, + child: SelectHospitalDialog( + hospitals: hospitals, + selectedHospital: _selectedHospital, + onValueSelected: (value) { + setState(() { + _selectedHospital = value; + }); + }, + ), + ); + } + + + void confirmSelectPatientDialog(List patientInfoList) { + showDialog( + context: context, + child: SelectPatientInfoDialog( + patientInfoList: patientInfoList, + selectedPatientInfo: _selectedPatientInfo, + onValueSelected: (value) { + setState(() { + advanceModel.depositorName = value.fullName; + _selectedPatientInfo = value; + }); + }, + ), + ); + } + + void confirmSelectFamilyDialog( + List getAllSharedRecordsByStatusList) { + showDialog( + context: context, + child: SelectPatientFamilyDialog( + getAllSharedRecordsByStatusList: getAllSharedRecordsByStatusList, + selectedPatientFamily: selectedPatientFamily, + onValueSelected: (value) { + setState(() { + selectedPatientFamily = value; + _fileTextController.text = selectedPatientFamily.patientID.toString(); + advanceModel.depositorName = value.patientName; + }); + }, + ), + ); + } + + String getBeneficiaryType() { + switch (beneficiaryType) { + case BeneficiaryType.MyAccount: + return "My Account"; + case BeneficiaryType.MyFamilyFiles: + return "My Family Files"; + break; + case BeneficiaryType.OtherAccount: + return "Other Account"; + break; + case BeneficiaryType.NON: + return "Select Beneficiary"; + } + return ""; + } + + String getHospitalName() { + if (_selectedHospital != null) + return _selectedHospital.name; + else + return "Select Hospital"; + } + + String getPatientName() { + if (_selectedPatientInfo != null) + return _selectedPatientInfo.fullName; + else + return "Select Patient Name"; + } + + String getFamilyMembersName() { + if (selectedPatientFamily != null) + return selectedPatientFamily.patientName; + else + return "Select Patient Name"; + } +} diff --git a/lib/pages/medical/balance/confirm_payment_page.dart b/lib/pages/medical/balance/confirm_payment_page.dart new file mode 100644 index 00000000..d865dd2d --- /dev/null +++ b/lib/pages/medical/balance/confirm_payment_page.dart @@ -0,0 +1,176 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/my_balance/patient_info_and_mobile_number.dart'; +import 'package:diplomaticquarterapp/core/viewModels/medical/my_balance_view_model.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/core/model/my_balance/AdvanceModel.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 'dialogs/ConfirmSMSDialog.dart'; +import 'new_text_Field.dart'; +import 'package:smart_progress_bar/smart_progress_bar.dart'; + +class ConfirmPaymentPage extends StatelessWidget { + final AdvanceModel advanceModel; + final PatientInfoAndMobileNumber patientInfoAndMobileNumber; + final String selectedPaymentMethod; + + ConfirmPaymentPage( + {this.advanceModel, + this.patientInfoAndMobileNumber, + this.selectedPaymentMethod}); + + @override + Widget build(BuildContext context) { + void showSMSDialog() { + showDialog( + context: context, + barrierDismissible: false, + child: ConfirmSMSDialog( + phoneNumber: patientInfoAndMobileNumber.mobileNumber, + + ), + ); + } + + return BaseView( + builder: (_, model, w) => AppScaffold( + isShowAppBar: true, + appBarTitle: 'Advance Payment', + body: SingleChildScrollView( + physics: ScrollPhysics(), + child: Container( + margin: EdgeInsets.all(12), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts( + 'Confirm the Payment', + textAlign: TextAlign.center, + fontWeight: FontWeight.w500, + fontSize: 24, + ), + SizedBox( + height: 12, + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Container( + height: 100.0, + padding: EdgeInsets.all(7.0), + width: MediaQuery.of(context).size.width * 0.45, + child: Image.asset(getImagePath(selectedPaymentMethod)), + ), + Texts( + '${advanceModel.amount} SAR', + fontSize: 26, + bold: true, + ) + ], + ), + SizedBox( + height: 12, + ), + Row( + children: [ + Expanded( + child: Container( + margin: EdgeInsets.all(3), + child: NewTextFields( + hintText: 'File Number', + initialValue: advanceModel.fileNumber, + isEnabled: false, + ), + ), + ), + Expanded( + child: Container( + margin: EdgeInsets.all(3), + child: NewTextFields( + hintText: 'Name', + initialValue: patientInfoAndMobileNumber.firstName, + isEnabled: false, + ), + ), + ), + ], + ), + SizedBox( + height: 12, + ), + NewTextFields( + hintText: 'Mobile Number', + initialValue: patientInfoAndMobileNumber.mobileNumber, + isEnabled: false, + ), + SizedBox( + height: 12, + ), + NewTextFields( + hintText: 'Depositor Name', + initialValue: advanceModel.depositorName, + isEnabled: false, + ), + SizedBox( + height: 12, + ), + NewTextFields( + hintText: 'Note', + initialValue: advanceModel.note, + isEnabled: false, + ), + ], + ), + ), + ), + bottomSheet: Container( + height: MediaQuery.of(context).size.height * 0.1, + width: double.infinity, + padding: EdgeInsets.all(12), + child: SecondaryButton( + textColor: Colors.white, + label: 'CONFIRM', + disabled: model.state == ViewState.Busy, + onTap: () { + model + .sendActivationCodeForAdvancePayment( + patientID: int.parse(advanceModel.fileNumber),projectID: advanceModel.hospitalsModel.iD) + .then((value) { + if (model.state != ViewState.ErrorLocal && + model.state != ViewState.Error) showSMSDialog(); + }).showProgressBar( + text: "Loading", + backgroundColor: Colors.blue.withOpacity(0.6)); + }, + ), + ), + ), + ); + } + + String getImagePath(String paymentMethod) { + switch (paymentMethod) { + case "MADA": + return 'assets/images/new-design/mada.png'; + break; + case "SADAD": + return 'assets/images/new-design/sadad.png'; + break; + case "VISA": + return 'assets/images/new-design/visa.png'; + break; + case "MASTERCARD": + return 'assets/images/new-design/mastercard.png'; + break; + case "Installment": + return 'assets/images/new-design/installment.png'; + break; + } + + return 'assets/images/new-design/mada.png'; + } +} diff --git a/lib/pages/medical/balance/dialogs/ConfirmSMSDialog.dart b/lib/pages/medical/balance/dialogs/ConfirmSMSDialog.dart new file mode 100644 index 00000000..7983d204 --- /dev/null +++ b/lib/pages/medical/balance/dialogs/ConfirmSMSDialog.dart @@ -0,0 +1,363 @@ +import 'dart:async'; + +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/config/size_config.dart'; +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/my_balance/AdvanceModel.dart'; +import 'package:diplomaticquarterapp/core/model/my_balance/patient_info_and_mobile_number.dart'; +import 'package:diplomaticquarterapp/core/viewModels/medical/my_balance_view_model.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:smart_progress_bar/smart_progress_bar.dart'; + +class ConfirmSMSDialog extends StatefulWidget { + final String phoneNumber; + final AdvanceModel advanceModel; + final PatientInfoAndMobileNumber patientInfoAndMobileNumber; + final String selectedPaymentMethod; + const ConfirmSMSDialog({Key key, this.phoneNumber,this.advanceModel,this.selectedPaymentMethod,this.patientInfoAndMobileNumber}) + : super(key: key); + + @override + _ConfirmSMSDialogState createState() => _ConfirmSMSDialogState(); +} + +class _ConfirmSMSDialogState extends State { + final verifyAccountForm = GlobalKey(); + Map verifyAccountFormValue = { + 'digit1': null, + 'digit2': null, + 'digit3': null, + 'digit4': null, + }; + + TextEditingController digit1 = TextEditingController(text: ""); + TextEditingController digit2 = TextEditingController(text: ""); + TextEditingController digit3 = TextEditingController(text: ""); + TextEditingController digit4 = TextEditingController(text: ""); + + String timerText = (TIMER_MIN - 1).toString() + ':59'; + int min = TIMER_MIN - 1; + int sec = 59; + Timer _timer; + + resendCode() { + min = TIMER_MIN - 1; + sec = 59; + _timer = Timer.periodic(Duration(seconds: 1), (Timer timer) { + if (min <= 0 && sec <= 0) { + timer.cancel(); + } else { + setState(() { + sec = sec - 1; + if (sec == 0 && min == 0) { + Navigator.pop(context); + min = 0; + sec = 0; + } else if (sec == 0) { + min = min - 1; + sec = 59; + } + timerText = min.toString() + ':' + sec.toString(); + }); + } + }); + } + + FocusNode focusD1; + FocusNode focusD2; + FocusNode focusD3; + FocusNode focusD4; + + @override + void initState() { + super.initState(); + resendCode(); + focusD1 = FocusNode(); + focusD2 = FocusNode(); + focusD3 = FocusNode(); + focusD4 = FocusNode(); + } + + @override + void dispose() { + _timer.cancel(); + super.dispose(); + } + + @override + Widget build(BuildContext context) { + return BaseView( + builder: (_, model, w) => Dialog( + elevation: 0.6, + child: Container( + height: 520, + child: ListView( + children: [ + Container( + width: double.infinity, + height: 40, + color: Colors.grey[700], + child: Row( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Expanded( + flex: 4, + child: Center( + child: Texts( + 'SMS', + color: Colors.white, + textAlign: TextAlign.center, + ))), + Expanded( + flex: 1, + child: InkWell( + onTap: () => Navigator.pop(context), + child: Container( + decoration: BoxDecoration( + shape: BoxShape.circle, color: Colors.white), + child: Icon( + Icons.clear, + color: Colors.grey[900], + )), + ), + ) + ], + ), + ), + Image.asset( + 'assets/images/login/103.png', + height: MediaQuery.of(context).size.width * 0.25, + width: MediaQuery.of(context).size.width * 0.25, + ), + SizedBox( + height: 12, + ), + Padding( + padding: const EdgeInsets.all(8.0), + child: Texts( + 'Please enter the Verification code send to [${widget.phoneNumber}]', + textAlign: TextAlign.center, + ), + ), + SizedBox( + height: 12, + ), + Form( + key: verifyAccountForm, + child: Container( + width: SizeConfig.realScreenWidth * 0.90, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 30, + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + Container( + width: 65, + child: TextFormField( + textInputAction: TextInputAction.next, + style: TextStyle( + fontSize: SizeConfig.textMultiplier * 3, + ), + focusNode: focusD1, + maxLength: 1, + controller: digit1, + textAlign: TextAlign.center, + keyboardType: TextInputType.number, + decoration: buildInputDecoration(context), + onSaved: (val) { + verifyAccountFormValue['digit1'] = val; + }, + validator: validateCodeDigit, + onFieldSubmitted: (_) { + FocusScope.of(context).requestFocus(focusD2); + }, + onChanged: (val) { + if (val.length == 1) { + FocusScope.of(context).requestFocus(focusD2); + } + }, + ), + ), + Container( + width: 65, + child: TextFormField( + focusNode: focusD2, + controller: digit2, + textInputAction: TextInputAction.next, + maxLength: 1, + textAlign: TextAlign.center, + style: TextStyle( + fontSize: SizeConfig.textMultiplier * 3, + ), + keyboardType: TextInputType.number, + decoration: buildInputDecoration(context), + validator: validateCodeDigit, + onSaved: (val) { + verifyAccountFormValue['digit2'] = val; + }, + onFieldSubmitted: (_) { + FocusScope.of(context).requestFocus(focusD3); + }, + onChanged: (val) { + if (val.length == 1) { + FocusScope.of(context).requestFocus(focusD3); + } + }, + ), + ), + Container( + width: 65, + child: TextFormField( + focusNode: focusD3, + controller: digit3, + textInputAction: TextInputAction.next, + maxLength: 1, + textAlign: TextAlign.center, + style: TextStyle( + fontSize: SizeConfig.textMultiplier * 3, + ), + keyboardType: TextInputType.number, + decoration: buildInputDecoration(context), + validator: validateCodeDigit, + onSaved: (val) { + verifyAccountFormValue['digit3'] = val; + }, + onFieldSubmitted: (_) { + FocusScope.of(context).requestFocus(focusD4); + }, + onChanged: (val) { + if (val.length == 1) { + FocusScope.of(context) + .requestFocus(focusD4); + } + }, + )), + Container( + width: 65, + child: TextFormField( + focusNode: focusD4, + controller: digit4, + maxLength: 1, + textAlign: TextAlign.center, + style: TextStyle( + fontSize: SizeConfig.textMultiplier * 3, + ), + keyboardType: TextInputType.number, + decoration: buildInputDecoration(context), + validator: validateCodeDigit, + onSaved: (val) { + verifyAccountFormValue['digit4'] = val; + }, + onFieldSubmitted: (_) { + FocusScope.of(context).requestFocus(focusD4); + submit(model); + }, + onChanged: (val) { + if (val.length == 1) { + FocusScope.of(context) + .requestFocus(focusD4); + submit(model); + } + }), + ) + ], + ), + SizedBox( + height: 8, + ), + if (model.state == ViewState.ErrorLocal || + model.state == ViewState.Error) + Container( + margin: EdgeInsets.only(left: 8,right: 8), + width: double.maxFinite, + child: Texts( + model.error, + color: Colors.red, + ), + ), + SizedBox(height: 20), + // buildText(), + + Padding( + padding: const EdgeInsets.all(8.0), + child: Texts( + 'The verification code expires in $timerText', + textAlign: TextAlign.center, + ), + ), + SizedBox(height: 20), + + Container( + width: double.maxFinite, + padding: EdgeInsets.all(12), + child: SecondaryButton( + textColor: Colors.white, + label: 'SUBMIT', + onTap: () { + submit(model); + }, + ), + ), + ], + ), + ), + ) + ], + ), + ), + ), + ); + } + + void submit(MyBalanceViewModel model) { + if (verifyAccountForm.currentState.validate()) { + final activationCode = + digit1.text + digit2.text + digit3.text + digit4.text; + model.checkActivationCodeForAdvancePayment( + activationCode: activationCode).then((value) { + //TODO complete payment + }).showProgressBar( + text: "Loading", + backgroundColor: Colors.blue.withOpacity(0.6)); + } + } + + String validateCodeDigit(value) { + if (value.isEmpty) { + return 'Please enter your Password'; + } + + return null; + } + + InputDecoration buildInputDecoration(BuildContext context) { + return InputDecoration( + // ts/images/password_icon.png + contentPadding: EdgeInsets.only(top: 20, bottom: 20), + enabledBorder: OutlineInputBorder( + borderRadius: BorderRadius.all(Radius.circular(5)), + borderSide: BorderSide(color: Colors.black), + ), + focusedBorder: OutlineInputBorder( + borderRadius: BorderRadius.all(Radius.circular(5.0)), + borderSide: BorderSide(color: Theme.of(context).primaryColor), + ), + errorBorder: OutlineInputBorder( + borderRadius: BorderRadius.all(Radius.circular(5.0)), + borderSide: BorderSide(color: Theme.of(context).errorColor), + ), + focusedErrorBorder: OutlineInputBorder( + borderRadius: BorderRadius.all(Radius.circular(5.0)), + borderSide: BorderSide(color: Theme.of(context).errorColor), + ), + ); + } +} diff --git a/lib/pages/medical/balance/dialogs/SelectBeneficiaryDialog.dart b/lib/pages/medical/balance/dialogs/SelectBeneficiaryDialog.dart new file mode 100644 index 00000000..efd907b7 --- /dev/null +++ b/lib/pages/medical/balance/dialogs/SelectBeneficiaryDialog.dart @@ -0,0 +1,175 @@ +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +import '../advance_payment_page.dart'; + +class SelectBeneficiaryDialog extends StatefulWidget { + final BeneficiaryType beneficiaryType; + final Function(BeneficiaryType) onValueSelected; + + SelectBeneficiaryDialog( + {Key key, this.beneficiaryType, this.onValueSelected}); + + @override + _SelectBeneficiaryDialogState createState() => + _SelectBeneficiaryDialogState(this.beneficiaryType); +} + +class _SelectBeneficiaryDialogState extends State { + _SelectBeneficiaryDialogState(this.beneficiaryType); + + BeneficiaryType beneficiaryType; + + @override + Widget build(BuildContext context) { + return SimpleDialog( + children: [ + Container( + child: Column( + children: [ + Divider(), + Row( + children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () { + setState(() { + beneficiaryType = BeneficiaryType.MyAccount; + }); + }, + child: ListTile( + title: const Text('My Account'), + leading: Radio( + value: BeneficiaryType.MyAccount, + groupValue: beneficiaryType, + activeColor: Colors.red[800], + onChanged: (BeneficiaryType value) { + setState(() { + beneficiaryType = value; + }); + }, + ), + ), + ), + ) + ], + ), + SizedBox( + height: 5.0, + ), + Row( + children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () { + setState(() { + beneficiaryType = BeneficiaryType.MyFamilyFiles; + }); + }, + child: ListTile( + title: const Text('My Family Files'), + leading: Radio( + value: BeneficiaryType.MyFamilyFiles, + groupValue: beneficiaryType, + activeColor: Colors.red[800], + onChanged: (BeneficiaryType value) { + setState(() { + beneficiaryType = value; + }); + }, + ), + ), + ), + ) + ], + ), + SizedBox( + height: 5.0, + ), + Row( + children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () { + setState(() { + beneficiaryType = BeneficiaryType.OtherAccount; + }); + }, + child: ListTile( + title: const Text('Other Account'), + leading: Radio( + value: BeneficiaryType.OtherAccount, + groupValue: beneficiaryType, + activeColor: Colors.red[800], + onChanged: (BeneficiaryType value) { + setState(() { + beneficiaryType = value; + }); + }, + ), + ), + ), + ) + ], + ), + 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( + 'CANCEL', + color: Colors.red, + ), + ), + ), + ), + ), + ), + Container( + width: 1, + height: 30, + color: Colors.grey[500], + ), + Expanded( + flex: 1, + child: InkWell( + onTap: () { + widget.onValueSelected(beneficiaryType); + Navigator.pop(context); + }, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Center( + child: Texts( + 'Ok', + fontWeight: FontWeight.w400, + ), + ), + ), + ), + ), + ], + ) + ], + ), + ) + ], + ); + } +} diff --git a/lib/pages/medical/balance/dialogs/SelectHospitalDialog.dart b/lib/pages/medical/balance/dialogs/SelectHospitalDialog.dart new file mode 100644 index 00000000..7957c800 --- /dev/null +++ b/lib/pages/medical/balance/dialogs/SelectHospitalDialog.dart @@ -0,0 +1,128 @@ +import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +class SelectHospitalDialog extends StatefulWidget { + final List hospitals; + final Function(HospitalsModel) onValueSelected; + HospitalsModel selectedHospital; + + SelectHospitalDialog( + {Key key, this.hospitals, this.onValueSelected, this.selectedHospital}); + + @override + _SelectHospitalDialogState createState() => _SelectHospitalDialogState(); +} + +class _SelectHospitalDialogState extends State { + @override + void initState() { + super.initState(); + widget.selectedHospital = widget.selectedHospital ?? widget.hospitals[0]; + } + + @override + Widget build(BuildContext context) { + return SimpleDialog( + children: [ + Column( + children: [ + Divider(), + ...List.generate( + widget.hospitals.length, + (index) => Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 2, + ), + Row( + children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () { + setState(() { + widget.selectedHospital = widget.hospitals[index]; + }); + }, + child: ListTile( + title: Text(widget.hospitals[index].name + + ' ${widget.hospitals[index].distanceInKilometers} KM'), + leading: Radio( + value: widget.hospitals[index], + groupValue: widget.selectedHospital, + activeColor: Colors.red[800], + onChanged: (value) { + setState(() { + widget.selectedHospital = 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( + 'CANCEL', + color: Colors.red, + ), + ), + ), + ), + ), + ), + Container( + width: 1, + height: 30, + color: Colors.grey[500], + ), + Expanded( + flex: 1, + child: InkWell( + onTap: () { + widget.onValueSelected(widget.selectedHospital); + Navigator.pop(context); + }, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Center( + child: Texts( + 'Ok', + fontWeight: FontWeight.w400, + )), + ), + ), + ), + ], + ) + ], + ) + ], + ); + } +} diff --git a/lib/pages/medical/balance/dialogs/SelectPatientFamilyDialog.dart b/lib/pages/medical/balance/dialogs/SelectPatientFamilyDialog.dart new file mode 100644 index 00000000..a21d753a --- /dev/null +++ b/lib/pages/medical/balance/dialogs/SelectPatientFamilyDialog.dart @@ -0,0 +1,129 @@ +import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart'; +import 'package:diplomaticquarterapp/core/model/my_balance/patient_info.dart'; +import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +class SelectPatientFamilyDialog extends StatefulWidget { + final List getAllSharedRecordsByStatusList; + final Function(GetAllSharedRecordsByStatusList) onValueSelected; + GetAllSharedRecordsByStatusList selectedPatientFamily; + + SelectPatientFamilyDialog({Key key, this.getAllSharedRecordsByStatusList, this.onValueSelected,this.selectedPatientFamily}); + + @override + _SelectPatientFamilyDialogState createState() => _SelectPatientFamilyDialogState(); +} + +class _SelectPatientFamilyDialogState extends State { + + @override + void initState() { + super.initState(); + widget.selectedPatientFamily = widget.selectedPatientFamily?? widget.getAllSharedRecordsByStatusList[0]; + } + + @override + Widget build(BuildContext context) { + return SimpleDialog( + children: [ + Column( + children: [ + Divider(), + ...List.generate( + widget.getAllSharedRecordsByStatusList.length, + (index) => Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 2, + ), + Row( + children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () { + setState(() { + widget.selectedPatientFamily = widget.getAllSharedRecordsByStatusList[index]; + }); + }, + child: ListTile( + title: Text(widget.getAllSharedRecordsByStatusList[index].patientName), + leading: Radio( + value: widget.getAllSharedRecordsByStatusList[index], + groupValue: widget.selectedPatientFamily, + activeColor: Colors.red[800], + onChanged: (value) { + setState(() { + widget.selectedPatientFamily = 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( + 'CANCEL', + color: Colors.red, + ), + ), + ), + ), + ), + ), + Container( + width: 1, + height: 30, + color: Colors.grey[500], + ), + Expanded( + flex: 1, + child: InkWell( + onTap: () { + widget.onValueSelected(widget.selectedPatientFamily); + Navigator.pop(context); + }, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Center( + child: Texts( + 'Ok', + fontWeight: FontWeight.w400, + )), + ), + ), + ), + ], + ) + ], + ) + ], + ); + } +} diff --git a/lib/pages/medical/balance/dialogs/SelectPatientInfoDialog.dart b/lib/pages/medical/balance/dialogs/SelectPatientInfoDialog.dart new file mode 100644 index 00000000..af6c02e1 --- /dev/null +++ b/lib/pages/medical/balance/dialogs/SelectPatientInfoDialog.dart @@ -0,0 +1,129 @@ +import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart'; +import 'package:diplomaticquarterapp/core/model/my_balance/patient_info.dart'; +import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +class SelectPatientInfoDialog extends StatefulWidget { + final List patientInfoList ; + final Function(PatientInfo) onValueSelected; + PatientInfo selectedPatientInfo; + + SelectPatientInfoDialog({Key key, this.patientInfoList, this.onValueSelected,this.selectedPatientInfo}); + + @override + _SelectPatientInfoDialogState createState() => _SelectPatientInfoDialogState(); +} + +class _SelectPatientInfoDialogState extends State { + + @override + void initState() { + super.initState(); + widget.selectedPatientInfo = widget.selectedPatientInfo?? widget.patientInfoList[0]; + } + + @override + Widget build(BuildContext context) { + return SimpleDialog( + children: [ + Column( + children: [ + Divider(), + ...List.generate( + widget.patientInfoList.length, + (index) => Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 2, + ), + Row( + children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () { + setState(() { + widget.selectedPatientInfo = widget.patientInfoList[index]; + }); + }, + child: ListTile( + title: Text(widget.patientInfoList[index].fullName), + leading: Radio( + value: widget.patientInfoList[index], + groupValue: widget.selectedPatientInfo, + activeColor: Colors.red[800], + onChanged: (value) { + setState(() { + widget.selectedPatientInfo = 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( + 'CANCEL', + color: Colors.red, + ), + ), + ), + ), + ), + ), + Container( + width: 1, + height: 30, + color: Colors.grey[500], + ), + Expanded( + flex: 1, + child: InkWell( + onTap: () { + widget.onValueSelected(widget.selectedPatientInfo); + Navigator.pop(context); + }, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Center( + child: Texts( + 'Ok', + fontWeight: FontWeight.w400, + )), + ), + ), + ), + ], + ) + ], + ) + ], + ); + } +} diff --git a/lib/pages/medical/balance/dialogs/show_timer_text.dart b/lib/pages/medical/balance/dialogs/show_timer_text.dart new file mode 100644 index 00000000..b2cd936b --- /dev/null +++ b/lib/pages/medical/balance/dialogs/show_timer_text.dart @@ -0,0 +1,89 @@ +import 'dart:async'; + +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/config/size_config.dart'; +import 'package:flutter/material.dart'; +import 'package:hexcolor/hexcolor.dart'; +import 'package:provider/provider.dart'; + +class ShowTimerText extends StatefulWidget { + ShowTimerText({Key key, this.model}); + final model; + + @override + _ShowTimerTextState createState() => _ShowTimerTextState(); +} + +class _ShowTimerTextState extends State { + String timerText = (TIMER_MIN - 1).toString() + ':59'; + int min = TIMER_MIN - 1; + int sec = 59; + Timer _timer; + +// AuthProvider authProv; + + resendCode() { + min = TIMER_MIN - 1; + sec = 59; + _timer = Timer.periodic(Duration(seconds: 1), (Timer timer) { + if (min <= 0 && sec <= 0) { + timer.cancel(); + } else { + setState(() { + sec = sec - 1; + if (sec == 0 && min == 0) { + //TODO + + min = 0; + sec = 0; + } else if (sec == 0) { + min = min - 1; + sec = 59; + } + timerText = min.toString() + ':' + sec.toString(); + }); + } + }); + } + + @override + void initState() { + super.initState(); + resendCode(); + } + + @override + void dispose() { + _timer.cancel(); + super.dispose(); + } + + @override + Widget build(BuildContext context) { + return Center( + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + InkWell( + onTap: min != 0 || sec != 0 + ? null + : () { + resendActivatioinCode(); + }, + child: Text( + timerText, + style: TextStyle( + fontSize: 3.0 * SizeConfig.textMultiplier, + color: Hexcolor('#B8382C'), + fontWeight: FontWeight.bold), + ), + ), + ], + ), + ); + } + + resendActivatioinCode() { + + } +} diff --git a/lib/pages/medical/balance/my_balance_page.dart b/lib/pages/medical/balance/my_balance_page.dart new file mode 100644 index 00000000..9e56dfee --- /dev/null +++ b/lib/pages/medical/balance/my_balance_page.dart @@ -0,0 +1,106 @@ +import 'package:diplomaticquarterapp/core/viewModels/medical/my_balance_view_model.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.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 'advance_payment_page.dart'; + +class MyBalancePage extends StatelessWidget { + @override + Widget build(BuildContext context) { + return BaseView( + onModelReady: (model) => model.getPatientAdvanceBalanceAmount(), + builder: (_, model, w) => AppScaffold( + baseViewModel: model, + isShowAppBar: true, + appBarTitle: 'My Balances', + body: Container( + margin: EdgeInsets.all(12), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts( + 'Balance Amount', + color: Colors.black, + bold: true, + ), + SizedBox( + height: 15, + ), + Container( + padding: EdgeInsets.all(8), + width: double.infinity, + height: 65, + decoration: BoxDecoration( + color: Hexcolor('#B61422'), + shape: BoxShape.rectangle, + borderRadius: BorderRadius.circular(7), + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Texts( + 'Total Balance', + color: Colors.white, + ), + Texts( + '${model.totalAdvanceBalanceAmount ?? 0} SAR', + color: Colors.white, + bold: true, + ), + ], + ), + ), + SizedBox( + height: 9, + ), + ...List.generate( + model.patientAdvanceBalanceAmountList.length, + (index) => Container( + padding: EdgeInsets.all(8), + height: 65, + margin: EdgeInsets.only(top: 8), + decoration: BoxDecoration( + color: Colors.white, + shape: BoxShape.rectangle, + borderRadius: BorderRadius.circular(7), + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Texts(model.patientAdvanceBalanceAmountList[index] + .projectDescription), + Texts( + '${model.patientAdvanceBalanceAmountList[index].patientAdvanceBalanceAmount} SAR', + bold: true, + ), + ], + ), + ), + ), + ], + ), + ), + bottomSheet: Container( + height: MediaQuery.of(context).size.height * 0.1, + width: double.infinity, + padding: EdgeInsets.all(12), + child: SecondaryButton( + // color: Colors.grey[900], + textColor: Colors.white, + label: ' Create Advanced Payment', + onTap: () { + Navigator.push(context, + FadePage(page: AdvancePaymentPage())); + }, + ), + ), + ), + ); + } +} diff --git a/lib/pages/medical/balance/new_text_Field.dart b/lib/pages/medical/balance/new_text_Field.dart new file mode 100644 index 00000000..ad9eb580 --- /dev/null +++ b/lib/pages/medical/balance/new_text_Field.dart @@ -0,0 +1,239 @@ +import 'package:eva_icons_flutter/eva_icons_flutter.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; + +class NumberTextInputFormatter extends TextInputFormatter { + @override + TextEditingValue formatEditUpdate( + TextEditingValue oldValue, TextEditingValue newValue) { + final int newTextLength = newValue.text.length; + int selectionIndex = newValue.selection.end; + int usedSubstringIndex = 0; + final StringBuffer newText = StringBuffer(); + if (newTextLength >= 1) { + newText.write('('); + if (newValue.selection.end >= 1) selectionIndex++; + } + if (newTextLength >= 4) { + newText.write(newValue.text.substring(0, usedSubstringIndex = 3) + ') '); + if (newValue.selection.end >= 3) selectionIndex += 2; + } + if (newTextLength >= 7) { + newText.write(newValue.text.substring(3, usedSubstringIndex = 6) + '-'); + if (newValue.selection.end >= 6) selectionIndex++; + } + if (newTextLength >= 11) { + newText.write(newValue.text.substring(6, usedSubstringIndex = 10) + ' '); + if (newValue.selection.end >= 10) selectionIndex++; + } + // Dump the rest. + if (newTextLength >= usedSubstringIndex) + newText.write(newValue.text.substring(usedSubstringIndex)); + return TextEditingValue( + text: newText.toString(), + selection: TextSelection.collapsed(offset: selectionIndex), + ); + } +} + +final _mobileFormatter = NumberTextInputFormatter(); + +class NewTextFields extends StatefulWidget { + NewTextFields( + {Key key, + this.type, + this.hintText, + this.suffixIcon, + this.autoFocus, + this.onChanged, + this.initialValue, + this.minLines, + this.maxLines, + this.inputFormatters, + this.padding, + this.focus = false, + this.maxLengthEnforced = true, + this.suffixIconColor, + this.inputAction, + this.onSubmit, + this.keepPadding = true, + this.textCapitalization = TextCapitalization.none, + this.controller, + this.keyboardType, + this.validator, + this.borderOnlyError = false, + this.onSaved, + this.onSuffixTap, + this.readOnly: false, + this.maxLength, + this.prefixIcon, + this.bare = false, + this.onTap, + this.fontSize = 16.0, + this.fontWeight = FontWeight.w700, + this.autoValidate = false, + this.hintColor,this.isEnabled=true}) + : super(key: key); + + final String hintText; + + // final String initialValue; + final String type; + final bool autoFocus; + final IconData suffixIcon; + final Color suffixIconColor; + final Icon prefixIcon; + final VoidCallback onTap; + final TextEditingController controller; + final TextInputType keyboardType; + final FormFieldValidator validator; + final Function onSaved; + final Function onSuffixTap; + final Function onChanged; + final Function onSubmit; + final bool readOnly; + final int maxLength; + final int minLines; + final int maxLines; + final bool maxLengthEnforced; + final bool bare; + final bool isEnabled; + final TextInputAction inputAction; + final double fontSize; + final FontWeight fontWeight; + final bool keepPadding; + final TextCapitalization textCapitalization; + final List inputFormatters; + final bool autoValidate; + final EdgeInsets padding; + final bool focus; + final bool borderOnlyError; + final Color hintColor; + final String initialValue; + @override + _NewTextFieldsState createState() => _NewTextFieldsState(); +} + +class _NewTextFieldsState extends State { + final FocusNode _focusNode = FocusNode(); + bool focus = false; + bool view = false; + + @override + void initState() { + super.initState(); + _focusNode.addListener(() { + setState(() { + focus = _focusNode.hasFocus; + }); + }); + } + + @override + void didUpdateWidget(NewTextFields oldWidget) { + if (widget.focus) _focusNode.requestFocus(); + super.didUpdateWidget(oldWidget); + } + + @override + void dispose() { + _focusNode.dispose(); + super.dispose(); + } + + + bool _determineReadOnly() { + if (widget.readOnly != null && widget.readOnly) { + _focusNode.unfocus(); + return true; + } else { + return false; + } + } + + @override + Widget build(BuildContext context) { + return AnimatedContainer( + duration: Duration(milliseconds: 300), + decoration:BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Container( + margin: EdgeInsets.only(top: 8), + + child: TextFormField( + enabled: widget.isEnabled, + initialValue: widget.initialValue, + keyboardAppearance: Theme.of(context).brightness, + scrollPhysics: BouncingScrollPhysics(), + autovalidate: widget.autoValidate, + textCapitalization: widget.textCapitalization, + onFieldSubmitted: widget.inputAction == TextInputAction.next + ? (widget.onSubmit != null + ? widget.onSubmit + : (val) { + _focusNode.nextFocus(); + }) + : widget.onSubmit, + textInputAction: widget.inputAction, + minLines: widget.minLines ?? 1, + maxLines: widget.maxLines ?? 1, + maxLengthEnforced: widget.maxLengthEnforced, + onChanged: widget.onChanged, + focusNode: _focusNode, + maxLength: widget.maxLength ?? null, + controller: widget.controller, + keyboardType: widget.keyboardType, + readOnly: _determineReadOnly(), + obscureText: widget.type == "password" && !view ? true : false, + autofocus: widget.autoFocus ?? false, + validator: widget.validator, + onSaved: widget.onSaved, + + style: Theme.of(context) + .textTheme + .body2 + .copyWith(fontSize: widget.fontSize, fontWeight: widget.fontWeight), + inputFormatters: widget.keyboardType == TextInputType.phone + ? [ + WhitelistingTextInputFormatter.digitsOnly, + _mobileFormatter, + ] + : widget.inputFormatters, + decoration: InputDecoration( + labelText: widget.hintText, + labelStyle: TextStyle(color: Colors.black), + errorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: Theme.of(context) + .errorColor + .withOpacity(0.5), + width: 1.0), + borderRadius: BorderRadius.circular(12.0)), + focusedErrorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: Theme.of(context) + .errorColor + .withOpacity(0.5), + width: 1.0), + borderRadius: BorderRadius.circular(8.0)), + focusedBorder: OutlineInputBorder( + borderSide: + BorderSide(color: Colors.white, width: 1.0), + borderRadius: BorderRadius.circular(12)), + disabledBorder: OutlineInputBorder( + borderSide: + BorderSide(color: Colors.white, width: 1.0), + borderRadius: BorderRadius.circular(12)), + enabledBorder: OutlineInputBorder( + borderSide: + BorderSide(color: Colors.white, width: 1.0), + borderRadius: BorderRadius.circular(12), + ), + ), + ), + ), + ); + } +} diff --git a/lib/pages/medical/medical_profile_page.dart b/lib/pages/medical/medical_profile_page.dart index 7abd724d..678ede88 100644 --- a/lib/pages/medical/medical_profile_page.dart +++ b/lib/pages/medical/medical_profile_page.dart @@ -24,6 +24,7 @@ import 'package:flutter/material.dart'; import 'package:diplomaticquarterapp/pages/insurance/insurance_card_screen.dart'; import 'package:provider/provider.dart'; import '../../locator.dart'; +import 'balance/my_balance_page.dart'; import 'doctor/doctor_home_page.dart'; import 'package:diplomaticquarterapp/pages/insurance/insurance_update_screen.dart'; import 'package:diplomaticquarterapp/pages/insurance/insurance_approval_screen.dart'; @@ -368,10 +369,10 @@ class _MedicalProfilePageState extends State { Expanded( flex: 1, child: InkWell( -// onTap: () { -// Navigator.push( -// context, FadePage(page: InsuranceApproval())); -// }, + onTap: () { + Navigator.push(context, + FadePage(page: MyBalancePage())); + }, child: MedicalProfileItem( title: TranslationBase.of(context).myBalance, diff --git a/lib/widgets/data_display/medical/doctor_card.dart b/lib/widgets/data_display/medical/doctor_card.dart index 0432dc90..b7c4a185 100644 --- a/lib/widgets/data_display/medical/doctor_card.dart +++ b/lib/widgets/data_display/medical/doctor_card.dart @@ -41,6 +41,7 @@ class DoctorCard extends StatelessWidget { borderRadius: BorderRadius.all( Radius.circular(8.0), ), + color: Colors.white ), child: InkWell( onTap: onTap, From 4ac77593adb30e277c696553b1218ad3a331ccb0 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Mon, 14 Sep 2020 12:54:05 +0300 Subject: [PATCH 45/45] add payment service page and translations --- lib/config/localized_values.dart | 28 +++ lib/pages/landing/home_page.dart | 168 ++++++++++-------- .../medical/balance/advance_payment_page.dart | 31 ++-- .../medical/balance/confirm_payment_page.dart | 17 +- .../balance/dialogs/ConfirmSMSDialog.dart | 12 +- .../dialogs/SelectBeneficiaryDialog.dart | 11 +- .../balance/dialogs/SelectHospitalDialog.dart | 5 +- .../dialogs/SelectPatientFamilyDialog.dart | 5 +- .../dialogs/SelectPatientInfoDialog.dart | 5 +- .../balance/dialogs/show_timer_text.dart | 89 ---------- .../medical/balance/my_balance_page.dart | 9 +- lib/pages/paymentService/payment_service.dart | 151 ++++++++++++++++ lib/uitl/translations_delegate_base.dart | 26 +++ 13 files changed, 345 insertions(+), 212 deletions(-) delete mode 100644 lib/pages/medical/balance/dialogs/show_timer_text.dart create mode 100644 lib/pages/paymentService/payment_service.dart diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 0cb3fa2b..baf3cc69 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -461,4 +461,32 @@ const Map> localizedValues = { "UpdateSuccessfully":{"en":"Update Successfully","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":"إنشاء دفعة مقدمة"}, + "AdvancePayment":{"en":"Advance Payment","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":"البريد الإلكتروني للمودع *"}, + "Notes":{"en":"Notes","ar":"ملاحظات"}, + "SelectPatientName":{"en":"Select Patient Name","ar":"اختر اسم المريض"}, + "SelectFamilyPatientName":{"en":"Family Members","ar":"أفراد الأسرة"}, + "SelectHospital":{"en":"Select Hospital","ar":"اختر المستشفى"}, + "MyAccount":{"en":"My Account","ar":"حسابي"}, + "OtherAccount":{"en":"Other Account","ar":"حساب آخر"}, + "SelectBeneficiary":{"en":"Select Beneficiary","ar":"حدد المستفيد"}, + "ConfirmThePayment":{"en":"Confirm The Payment","ar":"تأكيد عملية الدفع"}, + "DepositorName":{"en":"Depositor Name","ar":"اسم المودع *"}, + "MobileNumber":{"en":"Mobile Number","ar":"رقم الجوال"}, + "Ok":{"en":"Ok","ar":"حسنا"}, + "TheVerificationCodeExpiresIn":{"en":"The Verification Code Expires In","ar":"تنتهي صلاحية رمز التحقق في"}, + "PleaseEnterTheVerificationCode":{"en":"Please enter the verification code send to","ar":"الرجاء إدخال رمز التحقق المرسل إلى"}, + }; diff --git a/lib/pages/landing/home_page.dart b/lib/pages/landing/home_page.dart index da9d9348..f4692394 100644 --- a/lib/pages/landing/home_page.dart +++ b/lib/pages/landing/home_page.dart @@ -5,6 +5,7 @@ import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/all_habib_medic import 'package:diplomaticquarterapp/pages/ErService/ErOptions.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/feedback/feedback_home_page.dart'; +import 'package:diplomaticquarterapp/pages/paymentService/payment_service.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/pages/livecare/livecare_home.dart'; @@ -443,52 +444,23 @@ class _HomePageState extends State { SizedBox( height: 8, ), - Container( - margin: EdgeInsets.only(left: 15, right: 15), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Container( - width: MediaQuery.of(context).size.width * 0.29, - child: Center( - child: Padding( - padding: const EdgeInsets.all(15.0), - child: Column( - children: [ - Image.asset( - 'assets/images/al-habib_online_payment_service_icon.png', - height: 55, - ), - SizedBox( - height: 15, - ), - Texts( - TranslationBase.of(context) - .onlinePaymentService, - textAlign: TextAlign.center, - color: Colors.black87, - bold: false, - fontSize: SizeConfig.textMultiplier * 2, - ) - ], - ), - ), - ), - height: MediaQuery.of(context).size.width * 0.4, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(6.0), - color: Colors.white, - ), - ), - Container( + InkWell( + onTap: () => Navigator.push( + context, FadePage(page: PaymentService())), + child: Container( + margin: EdgeInsets.only(left: 15, right: 15), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Container( + width: MediaQuery.of(context).size.width * 0.29, child: Center( child: Padding( padding: const EdgeInsets.all(15.0), child: Column( children: [ Image.asset( - 'assets/images/ereferral_service_icon.png', - width: 50, + 'assets/images/al-habib_online_payment_service_icon.png', height: 55, ), SizedBox( @@ -496,7 +468,7 @@ class _HomePageState extends State { ), Texts( TranslationBase.of(context) - .offersAndPackages, + .onlinePaymentService, textAlign: TextAlign.center, color: Colors.black87, bold: false, @@ -506,49 +478,87 @@ class _HomePageState extends State { ), ), ), - width: MediaQuery.of(context).size.width * 0.29, height: MediaQuery.of(context).size.width * 0.4, decoration: BoxDecoration( borderRadius: BorderRadius.circular(6.0), color: Colors.white, - )), - Container( - width: MediaQuery.of(context).size.width * 0.29, - child: InkWell( - onTap: ()=>Navigator.push(context, - FadePage(page: ErOptions(isAppbar: true,))), - child: Center( - child: Padding( - padding: const EdgeInsets.all(15.0), - child: Column( - children: [ - Image.asset( - 'assets/images/Dr_Schedule_report.png', - width: 50, - height: 50, - ), - SizedBox( - height: 15, - ), - Texts( - TranslationBase.of(context).emergencyServices, - textAlign: TextAlign.center, - color: Colors.black87, - bold: false, - fontSize: SizeConfig.textMultiplier * 2.0, - ) - ], + ), + ), + Container( + child: Center( + child: Padding( + padding: const EdgeInsets.all(15.0), + child: Column( + children: [ + Image.asset( + 'assets/images/ereferral_service_icon.png', + width: 50, + height: 55, + ), + SizedBox( + height: 15, + ), + Texts( + TranslationBase.of(context) + .offersAndPackages, + textAlign: TextAlign.center, + color: Colors.black87, + bold: false, + fontSize: SizeConfig.textMultiplier * 2, + ) + ], + ), + ), + ), + width: MediaQuery.of(context).size.width * 0.29, + height: MediaQuery.of(context).size.width * 0.4, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(6.0), + color: Colors.white, + )), + Container( + width: MediaQuery.of(context).size.width * 0.29, + child: InkWell( + onTap: () => Navigator.push( + context, + FadePage( + page: ErOptions( + isAppbar: true, + ))), + child: Center( + child: Padding( + padding: const EdgeInsets.all(15.0), + child: Column( + children: [ + Image.asset( + 'assets/images/Dr_Schedule_report.png', + width: 50, + height: 50, + ), + SizedBox( + height: 15, + ), + Texts( + TranslationBase.of(context) + .emergencyServices, + textAlign: TextAlign.center, + color: Colors.black87, + bold: false, + fontSize: SizeConfig.textMultiplier * 2.0, + ) + ], + ), ), ), ), + height: MediaQuery.of(context).size.width * 0.4, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(6.0), + color: Colors.white, + ), ), - height: MediaQuery.of(context).size.width * 0.4, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(6.0), - color: Colors.white, - ), - ), - ], + ], + ), ), ), SizedBox( @@ -598,9 +608,9 @@ class _HomePageState extends State { context, FadePage(page: AllHabibMedicalService())), ), DashboardItem( - onTap: (){ - Navigator.push(context, FadePage(page: FeedbackHomePage())); - + onTap: () { + Navigator.push( + context, FadePage(page: FeedbackHomePage())); }, child: Container( width: double.infinity, diff --git a/lib/pages/medical/balance/advance_payment_page.dart b/lib/pages/medical/balance/advance_payment_page.dart index 14f9b664..2b2aad4f 100644 --- a/lib/pages/medical/balance/advance_payment_page.dart +++ b/lib/pages/medical/balance/advance_payment_page.dart @@ -7,6 +7,7 @@ import 'package:diplomaticquarterapp/pages/ToDoList/payment_method_select.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/medical/balance/dialogs/SelectHospitalDialog.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/data_display/text.dart'; @@ -53,7 +54,7 @@ class _AdvancePaymentPageState extends State { onModelReady: (model) => model.getHospitals(), builder: (_, model, w) => AppScaffold( isShowAppBar: true, - appBarTitle: 'Advance Payment', + appBarTitle: TranslationBase.of(context).advancePayment, body: SingleChildScrollView( physics: ScrollPhysics(), child: Container( @@ -62,7 +63,7 @@ class _AdvancePaymentPageState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ Texts( - 'You can create and add an Advanced Payment for you account or other accounts.', + TranslationBase.of(context).advancePaymentLabel, textAlign: TextAlign.center, ), SizedBox( @@ -121,7 +122,7 @@ class _AdvancePaymentPageState extends State { height: 12, ), NewTextFields( - hintText: 'File Number', + hintText: TranslationBase.of(context).fileNumber, controller: _fileTextController, ), if (beneficiaryType == BeneficiaryType.OtherAccount) @@ -186,7 +187,7 @@ class _AdvancePaymentPageState extends State { height: 12, ), NewTextFields( - hintText: 'Amount*', + hintText: TranslationBase.of(context).amount, keyboardType: TextInputType.number, onChanged: (value) { setState(() { @@ -198,7 +199,7 @@ class _AdvancePaymentPageState extends State { height: 12, ), NewTextFields( - hintText: 'Depositor Email*', + hintText: TranslationBase.of(context).depositorEmail, initialValue: model.user.emailAddress, onChanged: (value) { email = value; @@ -208,7 +209,7 @@ class _AdvancePaymentPageState extends State { height: 12, ), NewTextFields( - hintText: 'Notes', + hintText: TranslationBase.of(context).notes, controller: _notesTextController, ), SizedBox( @@ -224,7 +225,7 @@ class _AdvancePaymentPageState extends State { padding: EdgeInsets.all(12), child: SecondaryButton( textColor: Colors.white, - label: 'Submit', + label: TranslationBase.of(context).submit, disabled: amount.isEmpty || _fileTextController.text.isEmpty || _selectedHospital == null, @@ -341,37 +342,37 @@ class _AdvancePaymentPageState extends State { String getBeneficiaryType() { switch (beneficiaryType) { case BeneficiaryType.MyAccount: - return "My Account"; + return TranslationBase.of(context).myAccount; case BeneficiaryType.MyFamilyFiles: - return "My Family Files"; + return TranslationBase.of(context).myFamilyFiles; break; case BeneficiaryType.OtherAccount: - return "Other Account"; + return TranslationBase.of(context).otherAccount; break; case BeneficiaryType.NON: - return "Select Beneficiary"; + return TranslationBase.of(context).selectBeneficiary; } - return ""; + return TranslationBase.of(context).selectBeneficiary; } String getHospitalName() { if (_selectedHospital != null) return _selectedHospital.name; else - return "Select Hospital"; + return TranslationBase.of(context).selectHospital; } String getPatientName() { if (_selectedPatientInfo != null) return _selectedPatientInfo.fullName; else - return "Select Patient Name"; + return TranslationBase.of(context).selectPatientName; } String getFamilyMembersName() { if (selectedPatientFamily != null) return selectedPatientFamily.patientName; else - return "Select Patient Name"; + return TranslationBase.of(context).selectFamilyPatientName; } } diff --git a/lib/pages/medical/balance/confirm_payment_page.dart b/lib/pages/medical/balance/confirm_payment_page.dart index d865dd2d..c7ce32fa 100644 --- a/lib/pages/medical/balance/confirm_payment_page.dart +++ b/lib/pages/medical/balance/confirm_payment_page.dart @@ -3,6 +3,7 @@ import 'package:diplomaticquarterapp/core/model/my_balance/patient_info_and_mobi import 'package:diplomaticquarterapp/core/viewModels/medical/my_balance_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/core/model/my_balance/AdvanceModel.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'; @@ -39,7 +40,7 @@ class ConfirmPaymentPage extends StatelessWidget { return BaseView( builder: (_, model, w) => AppScaffold( isShowAppBar: true, - appBarTitle: 'Advance Payment', + appBarTitle: TranslationBase.of(context).advancePayment, body: SingleChildScrollView( physics: ScrollPhysics(), child: Container( @@ -48,7 +49,7 @@ class ConfirmPaymentPage extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ Texts( - 'Confirm the Payment', + TranslationBase.of(context).confirmThePayment, textAlign: TextAlign.center, fontWeight: FontWeight.w500, fontSize: 24, @@ -81,7 +82,7 @@ class ConfirmPaymentPage extends StatelessWidget { child: Container( margin: EdgeInsets.all(3), child: NewTextFields( - hintText: 'File Number', + hintText: TranslationBase.of(context).fileNumber, initialValue: advanceModel.fileNumber, isEnabled: false, ), @@ -91,7 +92,7 @@ class ConfirmPaymentPage extends StatelessWidget { child: Container( margin: EdgeInsets.all(3), child: NewTextFields( - hintText: 'Name', + hintText: TranslationBase.of(context).name, initialValue: patientInfoAndMobileNumber.firstName, isEnabled: false, ), @@ -103,7 +104,7 @@ class ConfirmPaymentPage extends StatelessWidget { height: 12, ), NewTextFields( - hintText: 'Mobile Number', + hintText: TranslationBase.of(context).mobileNumber, initialValue: patientInfoAndMobileNumber.mobileNumber, isEnabled: false, ), @@ -111,7 +112,7 @@ class ConfirmPaymentPage extends StatelessWidget { height: 12, ), NewTextFields( - hintText: 'Depositor Name', + hintText: TranslationBase.of(context).depositorName, initialValue: advanceModel.depositorName, isEnabled: false, ), @@ -119,7 +120,7 @@ class ConfirmPaymentPage extends StatelessWidget { height: 12, ), NewTextFields( - hintText: 'Note', + hintText: TranslationBase.of(context).notes, initialValue: advanceModel.note, isEnabled: false, ), @@ -133,7 +134,7 @@ class ConfirmPaymentPage extends StatelessWidget { padding: EdgeInsets.all(12), child: SecondaryButton( textColor: Colors.white, - label: 'CONFIRM', + label: TranslationBase.of(context).confirm.toUpperCase(), disabled: model.state == ViewState.Busy, onTap: () { model diff --git a/lib/pages/medical/balance/dialogs/ConfirmSMSDialog.dart b/lib/pages/medical/balance/dialogs/ConfirmSMSDialog.dart index 7983d204..462cc698 100644 --- a/lib/pages/medical/balance/dialogs/ConfirmSMSDialog.dart +++ b/lib/pages/medical/balance/dialogs/ConfirmSMSDialog.dart @@ -7,6 +7,7 @@ import 'package:diplomaticquarterapp/core/model/my_balance/AdvanceModel.dart'; import 'package:diplomaticquarterapp/core/model/my_balance/patient_info_and_mobile_number.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/my_balance_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.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'; @@ -108,7 +109,7 @@ class _ConfirmSMSDialogState extends State { flex: 4, child: Center( child: Texts( - 'SMS', + 'SMS', color: Colors.white, textAlign: TextAlign.center, ))), @@ -139,7 +140,7 @@ class _ConfirmSMSDialogState extends State { Padding( padding: const EdgeInsets.all(8.0), child: Texts( - 'Please enter the Verification code send to [${widget.phoneNumber}]', + TranslationBase.of(context).pleaseEnterTheVerificationCode+'[${widget.phoneNumber}]', textAlign: TextAlign.center, ), ), @@ -289,7 +290,7 @@ class _ConfirmSMSDialogState extends State { Padding( padding: const EdgeInsets.all(8.0), child: Texts( - 'The verification code expires in $timerText', + TranslationBase.of(context).theVerificationCodeExpiresIn+' $timerText', textAlign: TextAlign.center, ), ), @@ -300,7 +301,7 @@ class _ConfirmSMSDialogState extends State { padding: EdgeInsets.all(12), child: SecondaryButton( textColor: Colors.white, - label: 'SUBMIT', + label: TranslationBase.of(context).submit.toUpperCase(), onTap: () { submit(model); }, @@ -332,9 +333,8 @@ class _ConfirmSMSDialogState extends State { String validateCodeDigit(value) { if (value.isEmpty) { - return 'Please enter your Password'; + return ''; } - return null; } diff --git a/lib/pages/medical/balance/dialogs/SelectBeneficiaryDialog.dart b/lib/pages/medical/balance/dialogs/SelectBeneficiaryDialog.dart index efd907b7..17bee4b0 100644 --- a/lib/pages/medical/balance/dialogs/SelectBeneficiaryDialog.dart +++ b/lib/pages/medical/balance/dialogs/SelectBeneficiaryDialog.dart @@ -1,3 +1,4 @@ +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'; @@ -40,7 +41,7 @@ class _SelectBeneficiaryDialogState extends State { }); }, child: ListTile( - title: const Text('My Account'), + title: Text(TranslationBase.of(context).myAccount), leading: Radio( value: BeneficiaryType.MyAccount, groupValue: beneficiaryType, @@ -70,7 +71,7 @@ class _SelectBeneficiaryDialogState extends State { }); }, child: ListTile( - title: const Text('My Family Files'), + title: Text(TranslationBase.of(context).myFamilyFiles), leading: Radio( value: BeneficiaryType.MyFamilyFiles, groupValue: beneficiaryType, @@ -100,7 +101,7 @@ class _SelectBeneficiaryDialogState extends State { }); }, child: ListTile( - title: const Text('Other Account'), + title: Text(TranslationBase.of(context).otherAccount), leading: Radio( value: BeneficiaryType.OtherAccount, groupValue: beneficiaryType, @@ -133,7 +134,7 @@ class _SelectBeneficiaryDialogState extends State { child: Container( child: Center( child: Texts( - 'CANCEL', + TranslationBase.of(context).cancel.toUpperCase(), color: Colors.red, ), ), @@ -157,7 +158,7 @@ class _SelectBeneficiaryDialogState extends State { padding: const EdgeInsets.all(8.0), child: Center( child: Texts( - 'Ok', + TranslationBase.of(context).ok, fontWeight: FontWeight.w400, ), ), diff --git a/lib/pages/medical/balance/dialogs/SelectHospitalDialog.dart b/lib/pages/medical/balance/dialogs/SelectHospitalDialog.dart index 7957c800..9a4a359d 100644 --- a/lib/pages/medical/balance/dialogs/SelectHospitalDialog.dart +++ b/lib/pages/medical/balance/dialogs/SelectHospitalDialog.dart @@ -1,4 +1,5 @@ import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_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'; @@ -88,7 +89,7 @@ class _SelectHospitalDialogState extends State { child: Container( child: Center( child: Texts( - 'CANCEL', + TranslationBase.of(context).cancel.toUpperCase(), color: Colors.red, ), ), @@ -112,7 +113,7 @@ class _SelectHospitalDialogState extends State { padding: const EdgeInsets.all(8.0), child: Center( child: Texts( - 'Ok', + TranslationBase.of(context).ok, fontWeight: FontWeight.w400, )), ), diff --git a/lib/pages/medical/balance/dialogs/SelectPatientFamilyDialog.dart b/lib/pages/medical/balance/dialogs/SelectPatientFamilyDialog.dart index a21d753a..5808aed8 100644 --- a/lib/pages/medical/balance/dialogs/SelectPatientFamilyDialog.dart +++ b/lib/pages/medical/balance/dialogs/SelectPatientFamilyDialog.dart @@ -1,6 +1,7 @@ import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart'; import 'package:diplomaticquarterapp/core/model/my_balance/patient_info.dart'; import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.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'; @@ -89,7 +90,7 @@ class _SelectPatientFamilyDialogState extends State { child: Container( child: Center( child: Texts( - 'CANCEL', + TranslationBase.of(context).cancel.toUpperCase(), color: Colors.red, ), ), @@ -113,7 +114,7 @@ class _SelectPatientFamilyDialogState extends State { padding: const EdgeInsets.all(8.0), child: Center( child: Texts( - 'Ok', + TranslationBase.of(context).ok, fontWeight: FontWeight.w400, )), ), diff --git a/lib/pages/medical/balance/dialogs/SelectPatientInfoDialog.dart b/lib/pages/medical/balance/dialogs/SelectPatientInfoDialog.dart index af6c02e1..bea4f694 100644 --- a/lib/pages/medical/balance/dialogs/SelectPatientInfoDialog.dart +++ b/lib/pages/medical/balance/dialogs/SelectPatientInfoDialog.dart @@ -1,6 +1,7 @@ import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart'; import 'package:diplomaticquarterapp/core/model/my_balance/patient_info.dart'; import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.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'; @@ -89,7 +90,7 @@ class _SelectPatientInfoDialogState extends State { child: Container( child: Center( child: Texts( - 'CANCEL', + TranslationBase.of(context).cancel.toUpperCase(), color: Colors.red, ), ), @@ -113,7 +114,7 @@ class _SelectPatientInfoDialogState extends State { padding: const EdgeInsets.all(8.0), child: Center( child: Texts( - 'Ok', + TranslationBase.of(context).ok, fontWeight: FontWeight.w400, )), ), diff --git a/lib/pages/medical/balance/dialogs/show_timer_text.dart b/lib/pages/medical/balance/dialogs/show_timer_text.dart deleted file mode 100644 index b2cd936b..00000000 --- a/lib/pages/medical/balance/dialogs/show_timer_text.dart +++ /dev/null @@ -1,89 +0,0 @@ -import 'dart:async'; - -import 'package:diplomaticquarterapp/config/config.dart'; -import 'package:diplomaticquarterapp/config/size_config.dart'; -import 'package:flutter/material.dart'; -import 'package:hexcolor/hexcolor.dart'; -import 'package:provider/provider.dart'; - -class ShowTimerText extends StatefulWidget { - ShowTimerText({Key key, this.model}); - final model; - - @override - _ShowTimerTextState createState() => _ShowTimerTextState(); -} - -class _ShowTimerTextState extends State { - String timerText = (TIMER_MIN - 1).toString() + ':59'; - int min = TIMER_MIN - 1; - int sec = 59; - Timer _timer; - -// AuthProvider authProv; - - resendCode() { - min = TIMER_MIN - 1; - sec = 59; - _timer = Timer.periodic(Duration(seconds: 1), (Timer timer) { - if (min <= 0 && sec <= 0) { - timer.cancel(); - } else { - setState(() { - sec = sec - 1; - if (sec == 0 && min == 0) { - //TODO - - min = 0; - sec = 0; - } else if (sec == 0) { - min = min - 1; - sec = 59; - } - timerText = min.toString() + ':' + sec.toString(); - }); - } - }); - } - - @override - void initState() { - super.initState(); - resendCode(); - } - - @override - void dispose() { - _timer.cancel(); - super.dispose(); - } - - @override - Widget build(BuildContext context) { - return Center( - child: Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - InkWell( - onTap: min != 0 || sec != 0 - ? null - : () { - resendActivatioinCode(); - }, - child: Text( - timerText, - style: TextStyle( - fontSize: 3.0 * SizeConfig.textMultiplier, - color: Hexcolor('#B8382C'), - fontWeight: FontWeight.bold), - ), - ), - ], - ), - ); - } - - resendActivatioinCode() { - - } -} diff --git a/lib/pages/medical/balance/my_balance_page.dart b/lib/pages/medical/balance/my_balance_page.dart index 9e56dfee..446333cc 100644 --- a/lib/pages/medical/balance/my_balance_page.dart +++ b/lib/pages/medical/balance/my_balance_page.dart @@ -1,5 +1,6 @@ import 'package:diplomaticquarterapp/core/viewModels/medical/my_balance_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.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'; @@ -18,14 +19,14 @@ class MyBalancePage extends StatelessWidget { builder: (_, model, w) => AppScaffold( baseViewModel: model, isShowAppBar: true, - appBarTitle: 'My Balances', + appBarTitle: TranslationBase.of(context).myBalances, body: Container( margin: EdgeInsets.all(12), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Texts( - 'Balance Amount', + TranslationBase.of(context).balanceAmount, color: Colors.black, bold: true, ), @@ -45,7 +46,7 @@ class MyBalancePage extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Texts( - 'Total Balance', + TranslationBase.of(context).totalBalance, color: Colors.white, ), Texts( @@ -93,7 +94,7 @@ class MyBalancePage extends StatelessWidget { child: SecondaryButton( // color: Colors.grey[900], textColor: Colors.white, - label: ' Create Advanced Payment', + label: TranslationBase.of(context).createAdvancedPayment, onTap: () { Navigator.push(context, FadePage(page: AdvancePaymentPage())); diff --git a/lib/pages/paymentService/payment_service.dart b/lib/pages/paymentService/payment_service.dart new file mode 100644 index 00000000..15a1f699 --- /dev/null +++ b/lib/pages/paymentService/payment_service.dart @@ -0,0 +1,151 @@ +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/pages/medical/balance/advance_payment_page.dart'; +import 'package:diplomaticquarterapp/pages/medical/balance/my_balance_page.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:hexcolor/hexcolor.dart'; +import 'package:provider/provider.dart'; + +class PaymentService extends StatelessWidget { + @override + Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + return AppScaffold( + isShowAppBar: true, + appBarTitle: TranslationBase.of(context).paymentService, + body: SingleChildScrollView( + child: Container( + margin: EdgeInsets.all(12), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + Expanded( + child: InkWell( + onTap: () => Navigator.push( + context, FadePage(page: AdvancePaymentPage())), + child: Container( + margin: EdgeInsets.all(5.0), + padding: EdgeInsets.all(9), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(8.0), + shape: BoxShape.rectangle), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts( + TranslationBase.of(context).payment, + color: Hexcolor('#B61422'), + bold: true, + ), + Texts( + TranslationBase.of(context).paymentOnline, + fontSize: 14, + fontWeight: FontWeight.normal, + ), + Image.asset( + 'assets/images/al-habib_online_payment_service_icon.png', + fit: BoxFit.fill, + height: 55, + width: double.infinity, + ), + ], + ), + ), + ), + ), + Expanded( + child: Container( + margin: EdgeInsets.all(5.0), + padding: EdgeInsets.all(9), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(8.0), + shape: BoxShape.rectangle), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts( + TranslationBase.of(context).onlineCheckIn, + color: Hexcolor('#B61422'), + bold: true, + ), + Texts( + TranslationBase.of(context).appointment, + fontSize: 14, + fontWeight: FontWeight.normal, + ), + Align( + alignment: projectViewModel.isArabic + ? Alignment.centerRight + : Alignment.centerLeft, + child: Image.asset( + 'assets/images/al-habib_online_payment_service_icon.png', + height: 55, + ), + ), + ], + ), + ), + ) + ], + ), + Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded( + child: InkWell( + onTap: () => Navigator.push( + context, FadePage(page: MyBalancePage())), + child: Container( + margin: EdgeInsets.all(5.0), + padding: EdgeInsets.all(9), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(8.0), + shape: BoxShape.rectangle), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts( + 'My Balances', + color: Hexcolor('#B61422'), + bold: true, + ), + Texts( + TranslationBase.of(context).payment, + fontSize: 14, + fontWeight: FontWeight.normal, + ), + Align( + alignment: projectViewModel.isArabic + ? Alignment.centerRight + : Alignment.centerLeft, + child: Image.asset( + 'assets/images/al-habib_online_payment_service_icon.png', + height: 55, + ), + ), + ], + ), + ), + ), + ), + Expanded( + child: Container(), + ) + ], + ), + ], + ), + ), + ), + ); + } +} diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index f8ead077..ba89fc2c 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -532,6 +532,32 @@ class TranslationBase { String get emailSentSuccessfully => localizedValues['EmailSentSuccessfully'][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 fileNumber => localizedValues['FileNumber'][locale.languageCode]; + String get amount => localizedValues['Amount'][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 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 ok => localizedValues['Ok'][locale.languageCode]; + String get theVerificationCodeExpiresIn => localizedValues['TheVerificationCodeExpiresIn'][locale.languageCode]; + String get pleaseEnterTheVerificationCode => localizedValues['PleaseEnterTheVerificationCode'][locale.languageCode]; + } class TranslationBaseDelegate extends LocalizationsDelegate {