diff --git a/lib/config/config.dart b/lib/config/config.dart index ca1ed829..32c4d153 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -7,7 +7,7 @@ import 'package:diplomaticquarterapp/widgets/mobile-no/mobile_no.dart'; const MAX_SMALL_SCREEN = 660; const BASE_URL = 'https://uat.hmgwebservices.com/'; - +//const BASE_URL = 'https://hmgwebservices.com/'; const GET_PROJECT = 'Services/Lists.svc/REST/GetProject'; ///Doctor @@ -57,11 +57,16 @@ const GET_NEAREST_HOSPITAL = 'Services/Patients.svc/REST/Patient_GetProjectAvgERWaitingTime'; ///Er Nearest -const GET_AMBULANCE_REQUEST = 'Services/Patients.svc/REST/PatientER_RRT_GetAllTransportationMethod'; -const GET_PATIENT_ALL_PRES_ORDERS= 'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders'; -const GET_PICK_UP_REQUEST_BY_PRES_ORDER_ID= 'Services/Patients.svc/REST/PatientER_RRT_GetPickUpRequestByPresOrderID'; -const UPDATE_PRESS_ORDER = 'Services/Patients.svc/REST/PatientER_UpdatePresOrder'; -const INSERT_ER_INERT_PRES_ORDER = 'Services/Patients.svc/REST/PatientER_InsertPresOrder'; +const GET_AMBULANCE_REQUEST = + 'Services/Patients.svc/REST/PatientER_RRT_GetAllTransportationMethod'; +const GET_PATIENT_ALL_PRES_ORDERS = + 'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders'; +const GET_PICK_UP_REQUEST_BY_PRES_ORDER_ID = + 'Services/Patients.svc/REST/PatientER_RRT_GetPickUpRequestByPresOrderID'; +const UPDATE_PRESS_ORDER = + 'Services/Patients.svc/REST/PatientER_UpdatePresOrder'; +const INSERT_ER_INERT_PRES_ORDER = + 'Services/Patients.svc/REST/PatientER_InsertPresOrder'; ///FindUs const GET_FINDUS_REQUEST = 'Services/Lists.svc/REST/Get_HMG_Locations'; @@ -120,7 +125,8 @@ const GET_QR_PARKING = 'Services/SWP.svc/REST/GetQRParkingByID'; const GET_CLINICS_LIST_URL = "Services/lists.svc/REST/GetClinicCentralized"; //URL to get active appointment list -const GET_ACTIVE_APPOINTMENTS_LIST_URL = "Services/Doctors.svc/Rest/Dr_GetAppointmentActiveNumber"; +const GET_ACTIVE_APPOINTMENTS_LIST_URL = + "Services/Doctors.svc/Rest/Dr_GetAppointmentActiveNumber"; //URL to get projects list const GET_PROJECTS_LIST = 'Services/Lists.svc/REST/GetProject'; @@ -144,7 +150,8 @@ const GET_PATIENT_SHARE = "Services/Doctors.svc/REST/GetCheckinScreenAppointmentDetailsByAppointmentNO"; //URL to get patient appointment history -const GET_PATIENT_APPOINTMENT_HISTORY = "Services/Doctors.svc/REST/PateintHasAppoimentHistory"; +const GET_PATIENT_APPOINTMENT_HISTORY = + "Services/Doctors.svc/REST/PateintHasAppoimentHistory"; //URL to get patient appointment curfew history const GET_PATIENT_APPOINTMENT_CURFEW_HISTORY = @@ -267,13 +274,14 @@ const SEND_ACTIVATION_CODE_FOR_ADVANCE_PAYMENT = const CHECK_ACTIVATION_CODE_FOR_ADVANCE_PAYMENT = 'Services/Authentication.svc/REST/CheckActivationCodeForAdvancePayment'; +const GET_COVID_DRIVETHRU_PROJECT_LIST = + 'Services/Doctors.svc/REST/COVID19_ProjectDriveThroughTestingCenter'; -const GET_COVID_DRIVETHRU_PROJECT_LIST = 'Services/Doctors.svc/REST/COVID19_ProjectDriveThroughTestingCenter'; - -const GET_COVID_DRIVETHRU_PAYMENT_INFO = 'Services/Doctors.svc/REST/COVID19_GetPatientPaymentInormation'; - -const GET_COVID_DRIVETHRU_FREE_SLOTS = 'Services/Doctors.svc/REST/COVID19_GetFreeSlots'; +const GET_COVID_DRIVETHRU_PAYMENT_INFO = + 'Services/Doctors.svc/REST/COVID19_GetPatientPaymentInormation'; +const GET_COVID_DRIVETHRU_FREE_SLOTS = + 'Services/Doctors.svc/REST/COVID19_GetFreeSlots'; ///Smartwatch Integration Services const GET_PATIENT_LAST_RECORD = @@ -331,14 +339,18 @@ const GET_ALL_CITIES = 'services/Lists.svc/rest/GetAllCities'; const CREATE_E_REFERRAL = "Services/Patients.svc/REST/CreateEReferral"; const GET_E_REFERRALS = "Services/Patients.svc/REST/GetEReferrals"; - // Home Health Care -const HHC_GET_ALL_SERVICES = "Services/Patients.svc/REST/PatientER_HHC_GetAllServices"; -const HHC_GET_ALL_CMC_SERVICES = "Services/Patients.svc/REST/PatientER_CMC_GetAllServices"; -const PATIENT_ER_UPDATE_PRES_ORDER ="Services/Patients.svc/REST/PatientER_UpdatePresOrder"; -const GET_ORDER_DETAIL_BY_ID ="Services/Patients.svc/REST/PatientER_HHC_GetTransactionsForOrder"; -const GET_CMC_ORDER_DETAIL_BY_ID ="Services/Patients.svc/REST/PatientER_CMC_GetTransactionsForOrder"; -const GET_CHECK_UP_ITEMS ="Services/Patients.svc/REST/GetCheckUpItems"; +const HHC_GET_ALL_SERVICES = + "Services/Patients.svc/REST/PatientER_HHC_GetAllServices"; +const HHC_GET_ALL_CMC_SERVICES = + "Services/Patients.svc/REST/PatientER_CMC_GetAllServices"; +const PATIENT_ER_UPDATE_PRES_ORDER = + "Services/Patients.svc/REST/PatientER_UpdatePresOrder"; +const GET_ORDER_DETAIL_BY_ID = + "Services/Patients.svc/REST/PatientER_HHC_GetTransactionsForOrder"; +const GET_CMC_ORDER_DETAIL_BY_ID = + "Services/Patients.svc/REST/PatientER_CMC_GetTransactionsForOrder"; +const GET_CHECK_UP_ITEMS = "Services/Patients.svc/REST/GetCheckUpItems"; const PUSH_NOTIFICATION_GET_ALL_NOTIFICATIONS = 'Services/MobileNotifications.svc/REST/PushNotification_GetAllNotifications'; const PUSH_NOTIFICATION_SET_MESSAGES_FROM_POOL_AS_READ = diff --git a/lib/pages/BookAppointment/components/DocAvailableAppointments.dart b/lib/pages/BookAppointment/components/DocAvailableAppointments.dart index 2d857bc9..85569473 100644 --- a/lib/pages/BookAppointment/components/DocAvailableAppointments.dart +++ b/lib/pages/BookAppointment/components/DocAvailableAppointments.dart @@ -235,7 +235,7 @@ class _DocAvailableAppointmentsState extends State return children; }, ), - onDaySelected: (date, events,holidays) { + onDaySelected: (date, events) { _onDaySelected(date, events); _animationController.forward(from: 0.0); }, diff --git a/lib/pages/Covid-DriveThru/Covid-TimeSlots.dart b/lib/pages/Covid-DriveThru/Covid-TimeSlots.dart index 8310528d..939198c3 100644 --- a/lib/pages/Covid-DriveThru/Covid-TimeSlots.dart +++ b/lib/pages/Covid-DriveThru/Covid-TimeSlots.dart @@ -348,7 +348,7 @@ class _CovidTimeSlotsState extends State return children; }, ), - onDaySelected: (date, event,holidays) { + onDaySelected: (date, event) { _onDaySelected( date, event, diff --git a/lib/pages/login/forgot-password.dart b/lib/pages/login/forgot-password.dart index 3bdf5358..cb2604b1 100644 --- a/lib/pages/login/forgot-password.dart +++ b/lib/pages/login/forgot-password.dart @@ -4,8 +4,10 @@ import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; +import 'package:diplomaticquarterapp/widgets/dialogs/alert_dialog.dart'; import 'package:diplomaticquarterapp/widgets/mobile-no/mobile_no.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/otp/sms-popup.dart'; import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -17,11 +19,13 @@ class ForgotPassword extends StatefulWidget { class _ForgotPassword extends State { String selectedType = 'Saudi Arabia'; + String countryCode = '966'; final TextEditingController nationalIDorFile = null; - final TextEditingController mobileNo = TextEditingController(); - + String mobileNo; + var con; @override Widget build(BuildContext context) { + con = context; return AppScaffold( appBarTitle: TranslationBase.of(context).forgotFileNoTitle, isShowAppBar: true, @@ -47,33 +51,11 @@ class _ForgotPassword extends State { children: [ Row( mainAxisAlignment: MainAxisAlignment.center, - children: [ -// Expanded( -// // add Expanded to have your dropdown button fill remaining space -// child: DropdownButtonHideUnderline( -// child: DropdownButton( -// isExpanded: true, -// value: selectedType, -// iconSize: 40, -// elevation: 16, -// onChanged: (String newValue) => { -// setState(() { -// selectedType = newValue; -// }) -// }, -// items: [ -// 'Saudi Arabia', -// 'Dubai', -// ].map>( -// (String value) { -// return DropdownMenuItem( -// value: value, -// child: Text(value), -// ); -// }).toList()))), - ], + children: [], ), - MobileNo(controller: mobileNo), + MobileNo( + onNumberChange: (value) => {mobileNo = value}, + onCountryChange: (value) => countryCode = value), ], ), ), @@ -103,10 +85,10 @@ class _ForgotPassword extends State { sendPatientIDBySMS() { GifLoaderDialogUtils.showMyDialog(context); final authService = new AuthProvider(); - authService.sendPatientIDSMS(mobileNo.text, context).then((res) { + authService.sendPatientIDSMS(mobileNo, context).then((res) { GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { - setState(() {}); + this.startSMSService(mobileNo, res['LogInTokenID']); } else { AppToast.showErrorToast(message: res['ErrorEndUserMessage']); } @@ -116,4 +98,49 @@ class _ForgotPassword extends State { print(err); }); } + + startSMSService(mobile, token) { + new SMSOTP( + context, + 1, + mobile, + (value) => {this.checkActivationCode(value, token, int.parse(mobileNo))}, + () => { + print('Faild..'), + }, + ).displayDialog(context); + } + + checkActivationCode(value, token, mobileNo) { + GifLoaderDialogUtils.showMyDialog(context); + final authService = new AuthProvider(); + var request = { + "LogInTokenID": token, + "PatientOutSA": countryCode == '966' ? 0 : 1, + "PatientMobileNumber": mobileNo, + "ZipCode": countryCode, + "activationCode": value, + "isRegister": false, + "IsSilentLogin": false + }; + authService.forgotPasswordActivation(request, value).then((res) { + if (res is String) { + GifLoaderDialogUtils.hideDialog(con); + Future.delayed(Duration(seconds: 1), () { + AppToast.showErrorToast(message: res); + }); + } else { + GifLoaderDialogUtils.hideDialog(con); + Navigator.of(context).pop(); + AlertDialogBox( + context: con, + confirmMessage: res['ReturnMessage'], + okText: TranslationBase.of(con).ok, + okFunction: () { + AlertDialogBox.closeAlertDialog(con); + Navigator.of(context).pop(); + }).showAlertDialog(context); + } + }); + } } diff --git a/lib/pages/login/register-info.dart b/lib/pages/login/register-info.dart index 7aa95696..83e4fc53 100644 --- a/lib/pages/login/register-info.dart +++ b/lib/pages/login/register-info.dart @@ -4,6 +4,7 @@ import 'package:diplomaticquarterapp/models/Authentication/check_paitent_authent import 'package:diplomaticquarterapp/models/Authentication/register_info_response.dart'; import 'package:diplomaticquarterapp/models/Authentication/register_user_requet.dart'; import 'package:diplomaticquarterapp/pages/login/login-type.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/date_uitl.dart'; @@ -15,6 +16,8 @@ import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:hijri/hijri_calendar.dart'; +import 'package:intl/intl.dart'; class RegisterInfo extends StatefulWidget { @override @@ -31,15 +34,15 @@ class _RegisterInfo extends State { new Location(name: 'KSA', value: '1'), new Location(name: 'Dubai', value: '2'), ]; - var language; + String language = '1'; var registerd_data; final List languageList = [ new Language(name: 'English', value: '2'), new Language(name: 'Arabic', value: '1'), ]; - var email = ''; + String email = ''; - var location; + String location = '1'; @override void initState() { @@ -56,18 +59,13 @@ class _RegisterInfo extends State { isShowAppBar: true, isShowDecPage: false, body: SingleChildScrollView( - child: Container( - padding: EdgeInsets.only(top: 10, left: 20, right: 20, bottom: 30), - height: SizeConfig.realScreenHeight * .9, - width: SizeConfig.realScreenWidth, + padding: EdgeInsets.all(20), child: Column(children: [ - Expanded( - flex: 1, - child: AppText( - TranslationBase.of(context).patientInfo, - fontSize: SizeConfig.textMultiplier * 3, - textAlign: TextAlign.left, - )), + AppText( + TranslationBase.of(context).patientInfo, + fontSize: SizeConfig.textMultiplier * 3, + textAlign: TextAlign.left, + ), registerInfo != null && page == 1 ? Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -146,7 +144,8 @@ class _RegisterInfo extends State { Container( margin: EdgeInsets.only(bottom: 10), child: TextFields( - hintText:registerd_data.patientMobileNumber, + hintText: + registerd_data.patientMobileNumber.toString(), padding: EdgeInsets.only( top: 20, bottom: 20, left: 10, right: 10), readOnly: true, @@ -223,9 +222,10 @@ class _RegisterInfo extends State { Container( margin: EdgeInsets.only(bottom: 10), child: TextFields( - onChanged: (value) { - this.email = value; - this.isValid(); + onChanged: (value) => { + setState(() { + email = value; + }) }, padding: EdgeInsets.only( top: 20, bottom: 20, left: 10, right: 10), @@ -233,30 +233,28 @@ class _RegisterInfo extends State { ], ) : SizedBox(), - Expanded( - flex: 2, - child: Column( - mainAxisAlignment: MainAxisAlignment.end, + Column( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Row( children: [ - Row( - children: [ - Expanded( - child: DefaultButton( - page == 1 - ? TranslationBase.of(context).next - : TranslationBase.of(context).register, - () => {nextPage()}, - textColor: Colors.white, - color: this.isValid() == false && page == 2 - ? Colors.grey - : Colors.black, - )) - ], - ), + Expanded( + child: DefaultButton( + page == 1 + ? TranslationBase.of(context).next + : TranslationBase.of(context).register, + () => {nextPage()}, + textColor: Colors.white, + color: this.isValid() == false && page == 2 + ? Colors.grey + : Colors.black, + )) ], - )) + ), + ], + ) ]), - ))); + )); } nextPage() { @@ -271,8 +269,17 @@ class _RegisterInfo extends State { registerNow() { dynamic request = getTempUserRequest(); - request = RegisterUserRequest.fromJson(request); - this.authService.registerUser(request); + + this.authService.registerUser(request).then((result) => { + print(result), + // userData = result.list; + //AuthenticatedUser.fromJson(result['List'][0]), + sharedPref.setObject(USER_PROFILE, result.list), + + sharedPref.setObject(LOGIN_TOKEN_ID, result.logInTokenID), + sharedPref.setString(TOKEN, result.authenticationTokenID), + Navigator.of(context).pushNamed(HOME) + }); } getRegisterInfo() async { @@ -291,25 +298,30 @@ class _RegisterInfo extends State { } getTempUserRequest() { + DateFormat dateFormat = DateFormat("mm/dd/yyyy"); + print(dateFormat.parse(registerInfo.dateOfBirth)); + var hDate = + new HijriCalendar.fromDate(dateFormat.parse(registerInfo.dateOfBirth)); + var date = hDate.toString(); return { "Patientobject": { "TempValue": true, "PatientIdentificationType": 1, "PatientIdentificationNo": registerInfo.idNumber, - "MobileNumber": registerd_data['patientMobileNumber'], - "PatientOutSA": registerd_data['zipCode'] == '966' ? '0' : '1', + "MobileNumber": registerd_data.patientMobileNumber, + "PatientOutSA": registerd_data.zipCode == '966' ? 0 : 1, "FirstName": registerInfo.firstNameEn, "MiddleName": registerInfo.secondNameEn, "LastName": registerInfo.lastNameEn, "StrDateofBirth": registerInfo.dateOfBirth, - "DateofBirth": - DateUtil.convertISODateToJsonDate(registerInfo.dateOfBirth), - "Gender": registerInfo.gender, + "DateofBirth": DateUtil.convertISODateToJsonDate( + registerInfo.dateOfBirth.replaceAll('/', '-')), + "Gender": registerInfo.gender == 'M' ? 1 : 2, "NationalityID": registerInfo.nationality, - "DateofBirthN": registerInfo.dateOfBirth, + "DateofBirthN": date, "EmailAddress": email, "SourceType": location, - "PreferredLanguage": registerd_data['languageID'], + "PreferredLanguage": registerd_data.languageID.toString(), "Marital": registerInfo.maritalStatusCode == 'U' ? '0' : registerInfo.maritalStatusCode == 'M' @@ -317,7 +329,7 @@ class _RegisterInfo extends State { : '2', }, "PatientIdentificationID": registerInfo.idNumber, - "PatientMobileNumber": registerd_data['PatientMobileNumber'], + "PatientMobileNumber": registerd_data.patientMobileNumber, }; // var patientObject ={}; diff --git a/lib/pages/settings/general_setting.dart b/lib/pages/settings/general_setting.dart index 3b0de399..ef1ec052 100644 --- a/lib/pages/settings/general_setting.dart +++ b/lib/pages/settings/general_setting.dart @@ -82,7 +82,7 @@ class _GeneralSettings extends State mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ new Text( - 'Carnivore', + 'Off', style: new TextStyle(fontSize: 16.0), ), new Radio( @@ -98,7 +98,7 @@ class _GeneralSettings extends State mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ new Text( - 'Herbivore', + 'Invert', style: new TextStyle( fontSize: 16.0, ), @@ -116,7 +116,23 @@ class _GeneralSettings extends State mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ new Text( - 'Omnivore', + 'Dim', + style: new TextStyle(fontSize: 16.0), + ), + new Radio( + value: 2, + groupValue: bindValue, + onChanged: (value) { + bindValue = value; + }, + ), + ], + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + new Text( + 'Black and White', style: new TextStyle(fontSize: 16.0), ), new Radio( @@ -130,7 +146,53 @@ class _GeneralSettings extends State ), ], ) - ])) + ])), + Container( + padding: EdgeInsets.all(10), + child: AppText( + 'Permission', + color: Colors.black, + fontWeight: FontWeight.bold, + ), + ), + Container( + color: Colors.white, + padding: EdgeInsets.all(10), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text('Camera'), + Switch( + value: isVibration, + onChanged: (value) { + setState(() { + isVibration = value; + }); + }, + activeTrackColor: Colors.lightGreenAccent, + activeColor: Colors.green, + ) + ], + )), + Container( + color: Colors.white, + padding: EdgeInsets.all(10), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text('Location'), + Switch( + value: isVibration, + onChanged: (value) { + setState(() { + isVibration = value; + }); + }, + activeTrackColor: Colors.lightGreenAccent, + activeColor: Colors.green, + ) + ], + )) ])); } } diff --git a/lib/pages/settings/profile_setting.dart b/lib/pages/settings/profile_setting.dart index 7a3fceab..31941437 100644 --- a/lib/pages/settings/profile_setting.dart +++ b/lib/pages/settings/profile_setting.dart @@ -1,4 +1,5 @@ import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -11,14 +12,80 @@ class _ProfileSettings extends State with TickerProviderStateMixin { Widget build(BuildContext context) { bool isVibration = true; + var language = 1; return Container( child: ListView(scrollDirection: Axis.vertical, children: [ - Text('Mode'), + Container( + padding: EdgeInsets.all(15), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + AppText( + 'File No', + color: Colors.black, + ), + AppText( + '124545', + color: Colors.black, + ), + ], + ), + ), + SizedBox( + height: 1, + width: MediaQuery.of(context).size.width, + child: Container( + color: Colors.grey[300], + ), + ), + Padding( + child: AppText('SMS and Confirmation Calls Language ', + fontWeight: FontWeight.bold), + padding: EdgeInsets.all(10), + ), + Container( + color: Colors.white, + padding: EdgeInsets.only(top: 0, left: 10, right: 10, bottom: 0), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + AppText('English'), + new Radio( + value: 2, + groupValue: language, + onChanged: (value) { + language = value; + }, + ) + ], + )), + Container( + color: Colors.white, + padding: EdgeInsets.only(top: 0, left: 10, right: 10, bottom: 0), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + AppText('Arabic'), + new Radio( + value: 1, + groupValue: language, + onChanged: (value) { + language = value; + }, + ) + ], + )), + Padding( + child: AppText('Alert'), + padding: EdgeInsets.all(10), + ), Container( color: Colors.white, + padding: EdgeInsets.only(top: 0, left: 10, right: 10, bottom: 0), child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Text('Vibration touch feedback'), + AppText('Alert by Email'), Switch( value: isVibration, onChanged: (value) { @@ -33,9 +100,11 @@ class _ProfileSettings extends State )), Container( color: Colors.white, + padding: EdgeInsets.only(top: 0, left: 10, right: 10, bottom: 0), child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Text('Accsibility Mode'), + AppText('Alert by SMS'), Switch( value: isVibration, onChanged: (value) { @@ -47,6 +116,46 @@ class _ProfileSettings extends State activeColor: Colors.green, ) ], + )), + Padding( + child: AppText('Alert'), + padding: EdgeInsets.all(10), + ), + Container( + color: Colors.white, + padding: EdgeInsets.only(top: 0, left: 10, right: 10, bottom: 0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText('Email'), + TextField( + style: TextStyle(color: Colors.red), + ) + ], + )), + Container( + color: Colors.white, + padding: EdgeInsets.only(top: 0, left: 10, right: 10, bottom: 0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText('Emergency contact name'), + TextField( + style: TextStyle(color: Colors.red), + ) + ], + )), + Container( + color: Colors.white, + padding: EdgeInsets.only(top: 0, left: 10, right: 10, bottom: 0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText('Emergency contact number'), + TextField( + style: TextStyle(color: Colors.red), + ) + ], )) ])); } diff --git a/lib/services/authentication/auth_provider.dart b/lib/services/authentication/auth_provider.dart index fcf1069c..8e4191ec 100644 --- a/lib/services/authentication/auth_provider.dart +++ b/lib/services/authentication/auth_provider.dart @@ -35,6 +35,8 @@ const SEND_ACTIVATION_CODE = 'Services/Authentication.svc/REST/SendActivationCodebyOTPNotificationType'; const CHECK_ACTIVATION_CODE = 'Services/Authentication.svc/REST/CheckActivationCode'; +const FORGOT_PASSWORD = + 'Services/Authentication.svc/REST/CheckActivationCodeForSendFileNo'; const CHECK_PATIENT_FOR_REGISTRATION = "Services/Authentication.svc/REST/CheckPatientForRegisteration"; @@ -111,7 +113,7 @@ class AuthProvider with ChangeNotifier { var imei = await sharedPref.getString(PUSH_TOKEN); // if (!request.) { - newRequest.iMEI =imei; //imei!=null ? imei : ''; + newRequest.iMEI = imei; //imei!=null ? imei : ''; newRequest.firstName = request.firstName + " " + request.lastName; newRequest.firstNameN = request.firstNameN + " " + request.lastNameN; newRequest.lastNameN = request.lastNameN ?? ""; @@ -307,14 +309,14 @@ class AuthProvider with ChangeNotifier { } } - Future registerUser(RegisterUserRequest request) async { - request.versionID = VERSION_ID; - request.channel = CHANNEL; - request.iPAdress = IP_ADDRESS; - request.generalid = GENERAL_ID; - request.deviceTypeID = DeviceTypeID; - request.languageID = LANGUAGE_ID; - + Future registerUser(request) async { + request['VersionID'] = VERSION_ID; + request['Channel'] = CHANNEL; + request['IPAdress'] = IP_ADDRESS; + request['Generalid'] = GENERAL_ID; + request['DeviceTypeID'] = DeviceTypeID; + request['LanguageID'] = LANGUAGE_ID; + var requestN = RegisterUserRequest.fromJson(request); // request.tokenID = ''; dynamic localRes; try { @@ -324,7 +326,7 @@ class AuthProvider with ChangeNotifier { }, onFailure: (String error, int statusCode) { localRes = error; return Future.value(error); - }, body: request.toJson()); + }, body: requestN.toJson()); return Future.value(localRes); } catch (error) { throw error; @@ -394,4 +396,32 @@ class AuthProvider with ChangeNotifier { }, body: request); return Future.value(localRes); } + + Future forgotPasswordActivation(request, [value]) async { + // var neRequest = CheckActivationCodeReq.fromJson(request); + // neRequest.activationCode = value ?? "0000"; + // neRequest.isSilentLogin = value != null ? false : true; + request['VersionID'] = VERSION_ID; + request['Channel'] = CHANNEL; + request['IPAdress'] = IP_ADDRESS; + request['generalid'] = GENERAL_ID; + request['LanguageID'] = LANGUAGE_ID; + request['DeviceTypeID'] = DeviceTypeID; + + dynamic localRes; + try { + await new BaseAppClient().post(FORGOT_PASSWORD, + onSuccess: (dynamic response, int statusCode) { + localRes = response; //CheckActivationCode.fromJson(); + }, onFailure: (String error, int statusCode) { + localRes = error; + return Future.value(error); + // throw error; + }, body: request); + return Future.value(localRes); + } catch (error) { + throw error; + //return Future.value(error); + } + } }