diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index 8fde2166..4d04378a 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -55,22 +55,24 @@ class BaseAppClient { body['DeviceTypeID'] = DeviceTypeID; - body['PatientType'] = body.containsKey('PatientType') - ? body['PatientType'] != null ? body['PatientType'] : PATIENT_TYPE - : PATIENT_TYPE; + if(!body.containsKey('IsPublicRequest')) { + 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; + body['PatientTypeID'] = body.containsKey('PatientTypeID') + ? body['PatientTypeID'] != null + ? body['PatientTypeID'] + : PATIENT_TYPE_ID + : PATIENT_TYPE_ID; - if (user != null) { - body['TokenID'] = token; - body['PatientID'] = - body['PatientID'] != null ? body['PatientID'] : user['PatientID']; - body['PatientOutSA'] = user['OutSA']; - body['SessionID'] = getSessionId(token); + if (user != null) { + body['TokenID'] = token; + body['PatientID'] = + body['PatientID'] != null ? body['PatientID'] : user['PatientID']; + body['PatientOutSA'] = user['OutSA']; + body['SessionID'] = getSessionId(token); + } } print("URL : $url"); diff --git a/lib/core/service/medical/my_balance_service.dart b/lib/core/service/medical/my_balance_service.dart index cbc1be97..27d5d602 100644 --- a/lib/core/service/medical/my_balance_service.dart +++ b/lib/core/service/medical/my_balance_service.dart @@ -88,6 +88,7 @@ class MyBalanceService extends BaseService { onSuccess: (response, statusCode) async { logInTokenID = response['LogInTokenID']; verificationCode = response['VerificationCode']; + print(verificationCode); }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; diff --git a/lib/pages/BookAppointment/components/SearchByClinic.dart b/lib/pages/BookAppointment/components/SearchByClinic.dart index 6b3eff38..9c4d778f 100644 --- a/lib/pages/BookAppointment/components/SearchByClinic.dart +++ b/lib/pages/BookAppointment/components/SearchByClinic.dart @@ -223,6 +223,7 @@ class _SearchByClinicState extends State { } }).catchError((err) { print(err); + AppToast.showErrorToast(message: err); }).showProgressBar( text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); } diff --git a/lib/pages/landing/home_page.dart b/lib/pages/landing/home_page.dart index f4692394..6e8d5fce 100644 --- a/lib/pages/landing/home_page.dart +++ b/lib/pages/landing/home_page.dart @@ -363,7 +363,7 @@ class _HomePageState extends State { height: 50, ), SizedBox( - height: 15, + height: 13.5, ), Texts( TranslationBase.of(context) diff --git a/lib/pages/landing/landing_page.dart b/lib/pages/landing/landing_page.dart index d892be83..315a9aa7 100644 --- a/lib/pages/landing/landing_page.dart +++ b/lib/pages/landing/landing_page.dart @@ -11,7 +11,6 @@ import 'package:diplomaticquarterapp/pages/ToDoList/ToDo.dart'; import 'package:diplomaticquarterapp/pages/livecare/incoming_call.dart'; import 'package:diplomaticquarterapp/pages/medical/medical_profile_page.dart'; import 'package:diplomaticquarterapp/pages/medical/my_admissions_page.dart'; -import 'package:diplomaticquarterapp/services/robo_search/search_provider.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'; @@ -19,13 +18,10 @@ 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'; -import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:permission_handler/permission_handler.dart'; -import 'package:provider/provider.dart'; import 'home_page.dart'; -import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; class LandingPage extends StatefulWidget { static bool isOpenCallPage = false; @@ -110,14 +106,7 @@ class _LandingPageState extends State with WidgetsBindingObserver { _firebaseMessaging.setAutoInitEnabled(true); if (Platform.isIOS) { - _firebaseMessaging.requestNotificationPermissions( -// const IosNotificationSettings( -// sound: true, -// badge: true, -// alert: true, -// provisional: true, -// ), - ); + _firebaseMessaging.requestNotificationPermissions(); } _firebaseMessaging.getToken().then((String token) { @@ -126,123 +115,124 @@ class _LandingPageState extends State with WidgetsBindingObserver { checkUserStatus(token); } requestPermissions(); + }).catchError((err) { + print(err); }); //_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/balance/advance_payment_page.dart b/lib/pages/medical/balance/advance_payment_page.dart index 2b2aad4f..5cef835f 100644 --- a/lib/pages/medical/balance/advance_payment_page.dart +++ b/lib/pages/medical/balance/advance_payment_page.dart @@ -1,11 +1,14 @@ +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; 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/Authentication/authenticated_user.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_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart'; @@ -18,11 +21,10 @@ 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 'confirm_payment_page.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 } @@ -40,12 +42,17 @@ class _AdvancePaymentPageState extends State { String amount = ""; String email; PatientInfo _selectedPatientInfo; + AuthenticatedUser authenticatedUser; GetAllSharedRecordsByStatusList selectedPatientFamily; AdvanceModel advanceModel = AdvanceModel(); + AppSharedPreferences sharedPref = AppSharedPreferences(); + AuthenticatedUser authUser; + @override void initState() { super.initState(); + getAuthUser(); } @override @@ -253,6 +260,7 @@ class _AdvancePaymentPageState extends State { selectedPaymentMethod: value, patientInfoAndMobileNumber: model.patientInfoAndMobileNumber, + authenticatedUser: authUser, ), ), ); @@ -304,7 +312,6 @@ class _AdvancePaymentPageState extends State { ); } - void confirmSelectPatientDialog(List patientInfoList) { showDialog( context: context, @@ -331,7 +338,8 @@ class _AdvancePaymentPageState extends State { onValueSelected: (value) { setState(() { selectedPatientFamily = value; - _fileTextController.text = selectedPatientFamily.patientID.toString(); + _fileTextController.text = + selectedPatientFamily.patientID.toString(); advanceModel.depositorName = value.patientName; }); }, @@ -369,10 +377,20 @@ class _AdvancePaymentPageState extends State { return TranslationBase.of(context).selectPatientName; } + getAuthUser() async { + if (await this.sharedPref.getObject(USER_PROFILE) != null) { + var data = AuthenticatedUser.fromJson( + await this.sharedPref.getObject(USER_PROFILE)); + setState(() { + authUser = data; + }); + } + } + String getFamilyMembersName() { if (selectedPatientFamily != null) return selectedPatientFamily.patientName; else - return TranslationBase.of(context).selectFamilyPatientName; + 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 c7ce32fa..cc5df0a6 100644 --- a/lib/pages/medical/balance/confirm_payment_page.dart +++ b/lib/pages/medical/balance/confirm_payment_page.dart @@ -1,28 +1,41 @@ +import 'package:diplomaticquarterapp/config/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/models/Appointments/AppoimentAllHistoryResultList.dart'; +import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; -import 'package:diplomaticquarterapp/core/model/my_balance/AdvanceModel.dart'; +import 'package:diplomaticquarterapp/routes.dart'; +import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; +import 'package:diplomaticquarterapp/uitl/app_shared_preferences.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'; +import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:smart_progress_bar/smart_progress_bar.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; + MyInAppBrowser browser; + AuthenticatedUser authenticatedUser; + AppSharedPreferences sharedPref = AppSharedPreferences(); ConfirmPaymentPage( {this.advanceModel, this.patientInfoAndMobileNumber, - this.selectedPaymentMethod}); + this.selectedPaymentMethod, + this.authenticatedUser}); @override Widget build(BuildContext context) { @@ -32,9 +45,18 @@ class ConfirmPaymentPage extends StatelessWidget { barrierDismissible: false, child: ConfirmSMSDialog( phoneNumber: patientInfoAndMobileNumber.mobileNumber, - ), - ); + ).then((value) { + print("dialog dismissed"); + print(value); + if (value != null && value) { + AppoitmentAllHistoryResultList appo = + new AppoitmentAllHistoryResultList(); + appo.projectID = patientInfoAndMobileNumber.projectID; + openPayment(selectedPaymentMethod, authenticatedUser, + double.parse(advanceModel.amount), appo); + } + }); } return BaseView( @@ -139,7 +161,8 @@ class ConfirmPaymentPage extends StatelessWidget { onTap: () { model .sendActivationCodeForAdvancePayment( - patientID: int.parse(advanceModel.fileNumber),projectID: advanceModel.hospitalsModel.iD) + patientID: int.parse(advanceModel.fileNumber), + projectID: advanceModel.hospitalsModel.iD) .then((value) { if (model.state != ViewState.ErrorLocal && model.state != ViewState.Error) showSMSDialog(); @@ -174,4 +197,110 @@ class ConfirmPaymentPage extends StatelessWidget { return 'assets/images/new-design/mada.png'; } + + openPayment(String paymentMethod, AuthenticatedUser authenticatedUser, + double amount, AppoitmentAllHistoryResultList appo) { + browser = new MyInAppBrowser( + onExitCallback: onBrowserExit, + appo: appo, + onLoadStartCallback: onBrowserLoadStart); + + browser.openPaymentBrowser( + amount, + "Advance Payment", + Utils.getAdvancePaymentTransID( + authenticatedUser.projectID, authenticatedUser.patientID), + appo.projectID.toString(), + authenticatedUser.emailAddress, + paymentMethod, + authenticatedUser, + browser); + } + + onBrowserLoadStart(String url) { + print("onBrowserLoadStart"); + print(url); + + MyInAppBrowser.successURLS.forEach((element) { + if (url.contains(element)) { + if (browser.isOpened()) browser.close(); + MyInAppBrowser.isPaymentDone = true; + return; + } + }); + + MyInAppBrowser.errorURLS.forEach((element) { + if (url.contains(element)) { + if (browser.isOpened()) browser.close(); + MyInAppBrowser.isPaymentDone = false; + return; + } + }); + } + + onBrowserExit(AppoitmentAllHistoryResultList appo, bool isPaymentMade) { + print("onBrowserExit Called!!!!"); + if (isPaymentMade) checkPaymentStatus(appo); + } + + checkPaymentStatus(AppoitmentAllHistoryResultList appo) { + DoctorsListService service = new DoctorsListService(); + service + .checkPaymentStatus( + Utils.getAppointmentTransID( + appo.projectID, appo.clinicID, appo.appointmentNo), + AppGlobal.context) + .then((res) { + print("Printing Payment Status Reponse!!!!"); + print(res); + String paymentInfo = res['Response_Message']; + if (paymentInfo == 'Success') { + createAdvancePayment(res, appo); + } else { + AppToast.showErrorToast(message: res['Response_Message']); + } + }).catchError((err) { + print(err); + }).showProgressBar( + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + } + + createAdvancePayment(res, AppoitmentAllHistoryResultList appo) { + DoctorsListService service = new DoctorsListService(); + String paymentReference = res['Fort_id'].toString(); + service + .createAdvancePayment(appo, res['Amount'], res['Fort_id'], + res['PaymentMethod'], AppGlobal.context) + .then((res) { + print(res['OnlineCheckInAppointments'][0]['AdvanceNumber']); + addAdvancedNumberRequest( + res['OnlineCheckInAppointments'][0]['AdvanceNumber'].toString(), + paymentReference, + appo.appointmentNo.toString(), + appo); + }).catchError((err) { + print(err); + }).showProgressBar( + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + } + + addAdvancedNumberRequest(String advanceNumber, String paymentReference, + String appointmentID, AppoitmentAllHistoryResultList appo) { + DoctorsListService service = new DoctorsListService(); + service + .addAdvancedNumberRequest( + advanceNumber, paymentReference, appointmentID, AppGlobal.context) + .then((res) { + print(res); + navigateToHome(AppGlobal.context); + }).catchError((err) { + print(err); + }).showProgressBar( + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + } + + Future navigateToHome(context) async { + Navigator.of(context).pushNamed(HOME); + } + } diff --git a/lib/pages/medical/balance/dialogs/ConfirmSMSDialog.dart b/lib/pages/medical/balance/dialogs/ConfirmSMSDialog.dart index 462cc698..8dd2b29e 100644 --- a/lib/pages/medical/balance/dialogs/ConfirmSMSDialog.dart +++ b/lib/pages/medical/balance/dialogs/ConfirmSMSDialog.dart @@ -19,7 +19,13 @@ class ConfirmSMSDialog extends StatefulWidget { final AdvanceModel advanceModel; final PatientInfoAndMobileNumber patientInfoAndMobileNumber; final String selectedPaymentMethod; - const ConfirmSMSDialog({Key key, this.phoneNumber,this.advanceModel,this.selectedPaymentMethod,this.patientInfoAndMobileNumber}) + + const ConfirmSMSDialog( + {Key key, + this.phoneNumber, + this.advanceModel, + this.selectedPaymentMethod, + this.patientInfoAndMobileNumber}) : super(key: key); @override @@ -109,7 +115,7 @@ class _ConfirmSMSDialogState extends State { flex: 4, child: Center( child: Texts( - 'SMS', + 'SMS', color: Colors.white, textAlign: TextAlign.center, ))), @@ -140,7 +146,8 @@ class _ConfirmSMSDialogState extends State { Padding( padding: const EdgeInsets.all(8.0), child: Texts( - TranslationBase.of(context).pleaseEnterTheVerificationCode+'[${widget.phoneNumber}]', + TranslationBase.of(context).pleaseEnterTheVerificationCode + + '[${widget.phoneNumber}]', textAlign: TextAlign.center, ), ), @@ -277,7 +284,7 @@ class _ConfirmSMSDialogState extends State { if (model.state == ViewState.ErrorLocal || model.state == ViewState.Error) Container( - margin: EdgeInsets.only(left: 8,right: 8), + margin: EdgeInsets.only(left: 8, right: 8), width: double.maxFinite, child: Texts( model.error, @@ -290,7 +297,9 @@ class _ConfirmSMSDialogState extends State { Padding( padding: const EdgeInsets.all(8.0), child: Texts( - TranslationBase.of(context).theVerificationCodeExpiresIn+' $timerText', + TranslationBase.of(context) + .theVerificationCodeExpiresIn + + ' $timerText', textAlign: TextAlign.center, ), ), @@ -301,7 +310,8 @@ class _ConfirmSMSDialogState extends State { padding: EdgeInsets.all(12), child: SecondaryButton( textColor: Colors.white, - label: TranslationBase.of(context).submit.toUpperCase(), + label: + TranslationBase.of(context).submit.toUpperCase(), onTap: () { submit(model); }, @@ -322,12 +332,14 @@ class _ConfirmSMSDialogState extends State { 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)); + model + .checkActivationCodeForAdvancePayment(activationCode: activationCode) + .then((value) {}) + .showProgressBar( + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)) + .then((value) { + Navigator.pop(context, true); + }); } } diff --git a/lib/services/clinic_services/get_clinic_service.dart b/lib/services/clinic_services/get_clinic_service.dart index 8cc1e469..61c5ad59 100644 --- a/lib/services/clinic_services/get_clinic_service.dart +++ b/lib/services/clinic_services/get_clinic_service.dart @@ -148,7 +148,8 @@ class ClinicListService extends BaseService { "isDentalAllowedBackend": true, "Latitude": lat.toString(), "Longitude": long.toString(), - "DeviceTypeID": 1 + "DeviceTypeID": req.DeviceTypeID, + "IsPublicRequest" : true }; dynamic localRes; diff --git a/lib/uitl/utils.dart b/lib/uitl/utils.dart index 6958e67f..b78e5d11 100644 --- a/lib/uitl/utils.dart +++ b/lib/uitl/utils.dart @@ -96,6 +96,14 @@ class Utils { appoNo.toString(); } + static String getAdvancePaymentTransID(int projectID, int fileNumber) { + return projectID.toString() + + '-' + + fileNumber.toString() + + '-' + + DateTime.now().millisecondsSinceEpoch.toString(); + } + bool validateIDBox(String value, type) { Pattern pattern = loginIDPattern(type); //r'^\d+(?:\.\d+)?$';