From 7a8392a97ea3182faffff461daf003fda325ad3b Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Mon, 31 Aug 2020 15:43:31 +0300 Subject: [PATCH 1/6] 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 2/6] 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 3/6] 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 4/6] 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 5/6] 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 6/6] 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';