diff --git a/lib/core/api_consts.dart b/lib/core/api_consts.dart index daa094e..a603cf9 100644 --- a/lib/core/api_consts.dart +++ b/lib/core/api_consts.dart @@ -804,6 +804,7 @@ class ApiConsts { static final String insertPatientMobileData = 'Services/MobileNotifications.svc/REST/Insert_PatientMobileDeviceInfo'; static final String getPrivileges = 'Services/Patients.svc/REST/Service_Privilege'; + static final String registerUser = 'Services/Authentication.svc/REST/PatientRegistration'; // static values for Api static final double appVersionID = 18.7; diff --git a/lib/core/app_state.dart b/lib/core/app_state.dart index 3c4555e..52500bf 100644 --- a/lib/core/app_state.dart +++ b/lib/core/app_state.dart @@ -5,6 +5,7 @@ import 'package:hmg_patient_app_new/core/common_models/privilege/HMCProjectListM import 'package:hmg_patient_app_new/core/common_models/privilege/PrivilegeModel.dart'; import 'package:hmg_patient_app_new/core/common_models/privilege/ProjectDetailListModel.dart'; import 'package:hmg_patient_app_new/core/common_models/privilege/VidaPlusProjectListModel.dart'; +import 'package:hmg_patient_app_new/features/authentication/models/request_models/send_activation_request_model.dart'; import 'package:hmg_patient_app_new/features/authentication/models/resp_models/authenticated_user_resp_model.dart'; import 'package:hmg_patient_app_new/features/authentication/models/resp_models/check_user_staus_nhic_response_model.dart'; import 'package:hmg_patient_app_new/features/authentication/models/resp_models/select_device_by_imei.dart'; diff --git a/lib/core/utils/request_utils.dart b/lib/core/utils/request_utils.dart index 21b5952..fb6624d 100644 --- a/lib/core/utils/request_utils.dart +++ b/lib/core/utils/request_utils.dart @@ -1,3 +1,5 @@ +import 'package:easy_localization/easy_localization.dart'; +import 'package:hijri_gregorian_calendar/hijri_gregorian_calendar.dart'; import 'package:hmg_patient_app_new/core/api_consts.dart'; import 'package:hmg_patient_app_new/core/app_state.dart'; import 'package:hmg_patient_app_new/core/dependencies.dart'; @@ -63,7 +65,7 @@ class RequestUtils { required String? deviceToken, required bool patientOutSA, required String? loginTokenID, - required var registeredData, + required RegistrationDataModelPayload registeredData, int? patientId, required String nationIdText, required String countryCode, @@ -84,8 +86,8 @@ class RequestUtils { if (registeredData != null) { request.searchType = registeredData.searchType ?? 1; - request.patientID = registeredData.patientID ?? 0; - request.patientIdentificationID = request.nationalID = registeredData.patientIdentificationID ?? '0'; + request.patientID = registeredData.patientId ?? 0; + request.patientIdentificationID = request.nationalID = (registeredData.patientIdentificationId ?? 0); request.dob = registeredData.dob; request.isRegister = registeredData.isRegister; } else { @@ -135,9 +137,10 @@ class RequestUtils { request.patientIdentificationID = request.nationalID = payload["PatientIdentificationID"] ?? '0'; request.dob = payload["DOB"]; request.isRegister = payload["isRegister"]; - request.healthId = _appState.getNHICUserData.healthId; + request.healthId = patientOutSA ? null : _appState.getNHICUserData.healthId; request.isHijri = payload["IsHijri"]; request.deviceToken = _appState.deviceToken; + request.projectOutSA = patientOutSA; } else { request.searchType = isFileNo ? 2 : 1; request.patientID = patientId ?? 0; @@ -176,20 +179,25 @@ class RequestUtils { return request; } - static dynamic getUserSignupCompletionRequest() { + static dynamic getUserSignupCompletionRequest({String? fullName, String? emailAddress, GenderTypeEnum? gender, MaritalStatusTypeEnum? maritalStatus}) { AppState appState = getIt.get(); bool isDubai = appState.getUserRegistrationPayload.patientOutSa == 1 ? true : false; - List names = appState.getUserRegistrationPayload.fullName != null ? appState.getUserRegistrationPayload.fullName!.split(" ") : []; + List names = fullName != null ? fullName.split(" ") : []; var dob = appState.getUserRegistrationPayload.dob; + final DateFormat dateFormat1 = DateFormat('MM/dd/yyyy'); + final DateFormat dateFormat2 = DateFormat('dd/MM/yyyy'); + DateTime gregorianDate = dateFormat2.parse(dob!); + HijriGregDate hijriDate = HijriGregConverter.gregorianToHijri(gregorianDate); + String? date = "${hijriDate.day}/${hijriDate.month}/${hijriDate.year}"; return { "Patientobject": { "TempValue": true, "PatientIdentificationType": - (isDubai ? appState.getNHICUserData.idNumber!.substring(0, 1) : appState.getUserRegistrationPayload.patientIdentificationId?.toString().substring(0, 1)) == "1" ? 1 : 2, - "PatientIdentificationNo": isDubai ? appState.getNHICUserData.idNumber! : appState.getUserRegistrationPayload.patientIdentificationId, + (isDubai ? appState.getUserRegistrationPayload.patientIdentificationId?.toString().substring(0, 1) : appState.getNHICUserData.idNumber!.substring(0, 1)) == "1" ? 1 : 2, + "PatientIdentificationNo": isDubai ? appState.getUserRegistrationPayload.patientIdentificationId.toString() : appState.getNHICUserData.idNumber.toString(), "MobileNumber": appState.getUserRegistrationPayload.patientMobileNumber ?? 0, "PatientOutSA": (appState.getUserRegistrationPayload.zipCode == CountryEnum.saudiArabia.countryCode || appState.getUserRegistrationPayload.zipCode == '+966') ? 0 : 1, "FirstNameN": isDubai ? "..." : appState.getNHICUserData.firstNameAr, @@ -198,19 +206,19 @@ class RequestUtils { "MiddleName": isDubai ? "..." : appState.getNHICUserData.secondNameEn, "LastNameN": isDubai ? "..." : appState.getNHICUserData.lastNameAr, "LastName": isDubai ? (names.length > 1 ? names[1] : "...") : appState.getNHICUserData.lastNameEn, - "StrDateofBirth": dob, + "StrDateofBirth": dateFormat1.format(dateFormat2.parse(dob)), "DateofBirth": DateUtil.convertISODateToJsonDate((dob ?? "").replaceAll('/', '-')), - "Gender": isDubai ? (appState.getUserRegistrationPayload.gender == GenderTypeEnum.male ? 1 : 2) : (appState.getNHICUserData.gender == 'M' ? 1 : 2), - "NationalityID": isDubai ? "UAE" : appState.getUserRegistrationPayload.nationalityCode, + "Gender": isDubai ? (gender == GenderTypeEnum.male ? 1 : 2) : (appState.getNHICUserData.gender == 'M' ? 1 : 2), + "NationalityID": isDubai ? "UAE" : appState.getNHICUserData.nationalityCode, "eHealthIDField": isDubai ? null : appState.getNHICUserData.healthId, - "DateofBirthN": DateTime.now(), - "EmailAddress": appState.getUserRegistrationPayload.emailAddress, - "SourceType": (appState.getUserRegistrationPayload.zipCode == CountryEnum.saudiArabia.countryCode || appState.getUserRegistrationPayload.zipCode == '+966') ? 1 : 2, + "DateofBirthN": date, + "EmailAddress": emailAddress, + "SourceType": (appState.getUserRegistrationPayload.zipCode == CountryEnum.saudiArabia.countryCode || appState.getUserRegistrationPayload.zipCode == '+966') ? "1" : "2", "PreferredLanguage": appState.getLanguageCode() == "ar" ? (isDubai ? "1" : 1) : (isDubai ? "2" : 2), "Marital": isDubai - ? (appState.getUserRegistrationPayload.maritalStatus == MaritalStatusTypeEnum.single + ? (maritalStatus == MaritalStatusTypeEnum.single ? '0' - : appState.getUserRegistrationPayload.maritalStatus == MaritalStatusTypeEnum.married + : maritalStatus == MaritalStatusTypeEnum.married ? '1' : '2') : (appState.getNHICUserData.maritalStatusCode == 'U' @@ -219,12 +227,16 @@ class RequestUtils { ? '1' : '2'), }, - "PatientIdentificationID": isDubai ? appState.getUserRegistrationPayload.patientIdentificationId : appState.getNHICUserData.idNumber, + "PatientIdentificationID": isDubai ? appState.getUserRegistrationPayload.patientIdentificationId.toString() : appState.getNHICUserData.idNumber.toString(), "PatientMobileNumber": appState.getUserRegistrationPayload.patientMobileNumber.toString()[0] == '0' ? appState.getUserRegistrationPayload.patientMobileNumber : '0${appState.getUserRegistrationPayload.patientMobileNumber}', - if (isDubai) "DOB": dob, - if (isDubai) "IsHijri": appState.getUserRegistrationPayload.isHijri, + "DOB": dob, + "IsHijri": appState.getUserRegistrationPayload.isHijri, + "PatientOutSA": (appState.getUserRegistrationPayload.zipCode == CountryEnum.saudiArabia.countryCode || appState.getUserRegistrationPayload.zipCode == '+966') ? 0 : 1, + "isDentalAllowedBackend": appState.getUserRegistrationPayload.isDentalAllowedBackend, + "ZipCode": appState.getUserRegistrationPayload.zipCode, + if (!isDubai) "HealthId": appState.getNHICUserData.healthId, }; } } diff --git a/lib/features/authentication/authentication_repo.dart b/lib/features/authentication/authentication_repo.dart index d81094c..22ca90f 100644 --- a/lib/features/authentication/authentication_repo.dart +++ b/lib/features/authentication/authentication_repo.dart @@ -32,6 +32,8 @@ abstract class AuthenticationRepo { Future>> checkUserStatus({required dynamic commonAuthanticatedRequest}); + Future>> registerUser({required dynamic registrationPayloadDataModelRequest}); + Future>> insertPatientIMEIData({required dynamic patientIMEIDataRequest}); Future>> insertPatientDeviceData({required dynamic patientDeviceDataRequest}); @@ -182,7 +184,6 @@ class AuthenticationRepoImp implements AuthenticationRepo { newRequest.projectOutSA = newRequest.zipCode == '966' ? false : true; newRequest.isDentalAllowedBackend = false; newRequest.forRegisteration = newRequest.isRegister ?? false; - newRequest.isRegister = false; } @@ -357,6 +358,39 @@ class AuthenticationRepoImp implements AuthenticationRepo { } } + @override + Future>> registerUser({required dynamic registrationPayloadDataModelRequest}) async { + try { + GenericApiModel? apiResponse; + Failure? failure; + await apiClient.post( + ApiConsts.registerUser, + body: registrationPayloadDataModelRequest, + onFailure: (error, statusCode, {messageStatus, failureType}) { + failure = failureType; + }, + onSuccess: (response, statusCode, {messageStatus, errorMessage}) { + try { + apiResponse = GenericApiModel( + messageStatus: messageStatus, + statusCode: statusCode, + errorMessage: errorMessage, + data: response, + ); + } catch (e) { + failure = DataParsingFailure(e.toString()); + } + }, + ); + + if (failure != null) return Left(failure!); + if (apiResponse == null) return Left(ServerFailure("Unknown error")); + return Right(apiResponse!); + } catch (e) { + return Left(UnknownFailure(e.toString())); + } + } + @override Future> insertPatientIMEIData({required patientIMEIDataRequest}) { try { diff --git a/lib/features/authentication/authentication_view_model.dart b/lib/features/authentication/authentication_view_model.dart index 6d5f3c1..7122482 100644 --- a/lib/features/authentication/authentication_view_model.dart +++ b/lib/features/authentication/authentication_view_model.dart @@ -107,6 +107,8 @@ class AuthenticationViewModel extends ChangeNotifier { isTermsAccepted = false; selectedCountrySignup = CountryEnum.saudiArabia; pickedCountryByUAEUser = null; + _appState.setUserRegistrationPayload = RegistrationDataModelPayload(); + _appState.setNHICUserData = CheckUserStatusResponseNHIC(); } void onCountryChange(CountryEnum country) { @@ -308,40 +310,27 @@ class AuthenticationViewModel extends ChangeNotifier { } Future sendActivationCode({required OTPTypeEnum otpTypeEnum, required String nationalIdOrFileNumber, required String phoneNumber, dynamic payload}) async { - bool isForRegister = checkIsUserComingForRegister(request: payload); - bool isPatientOutSA = isPatientOutsideSA(request: payload); - bool isFileNo = isPatientHasFile(request: payload); - var request = RequestUtils.getCommonRequestSendActivationCode( otpTypeEnum: otpTypeEnum, mobileNumber: phoneNumber, selectedLoginType: otpTypeEnum.toInt(), zipCode: selectedCountrySignup.countryCode, nationalId: int.parse(nationalIdOrFileNumber), - isFileNo: isFileNo, + isFileNo: isPatientHasFile(request: payload), patientId: 0, - isForRegister: isForRegister, - patientOutSA: isPatientOutSA, + isForRegister: checkIsUserComingForRegister(request: payload), + patientOutSA: isPatientOutsideSA(request: payload), payload: payload); // TODO: GET APP SMS SIGNATURE HERE request.sMSSignature = "enKTDcqbOVd"; - // GifLoaderDialogUtils.showMyDialog(context); - // bool isForRegister = healthId != null || isDubai; - // if (isForRegister) { - // if (!isDubai) { - // request.dob = dob; //isHijri == 1 ? dob : dateFormat2.format(dateFormat.parse(dob)); - // } - // request.healthId = healthId; - // request.isHijri = calenderType.toInt; - // } else { - // // request.dob = ""; - // // request.healthId = ""; - // // request.isHijri = 0; - // } + if (checkIsUserComingForRegister(request: payload)) { + _appState.setUserRegistrationPayload = RegistrationDataModelPayload.fromJson(payload); + print("====== Demo =========="); + } - final resultEither = await _authenticationRepo.sendActivationCodeRepo(sendActivationCodeReq: request, isRegister: isForRegister, languageID: 'er'); + final resultEither = await _authenticationRepo.sendActivationCodeRepo(sendActivationCodeReq: request, isRegister: checkIsUserComingForRegister(request: payload), languageID: 'er'); resultEither.fold( (failure) async => await _errorHandlerService.handleError(failure: failure), @@ -377,19 +366,29 @@ class AuthenticationViewModel extends ChangeNotifier { phoneNumber: phoneNumberController.text, otpTypeEnum: otpTypeEnum, deviceToken: _appState.deviceToken, - patientOutSA: true, + patientOutSA: _appState.getUserRegistrationPayload.projectOutSa == 1 ? true : false, loginTokenID: _appState.appAuthToken, - registeredData: null, + registeredData: _appState.getUserRegistrationPayload, nationIdText: nationalIdController.text, countryCode: selectedCountrySignup.countryCode, loginType: loginTypeEnum.toInt) .toJson(); - bool isForRegister = (_appState.getUserRegistrationPayload.healthId != null || _appState.getUserRegistrationPayload.patientOutSa == true); + bool isForRegister = (_appState.getUserRegistrationPayload.healthId != null || _appState.getUserRegistrationPayload.patientOutSa == 1) ? true : false; if (isForRegister) { - if (_appState.getUserRegistrationPayload.patientOutSa == true) request['DOB'] = _appState.getUserRegistrationPayload.dob; + if (_appState.getUserRegistrationPayload.patientOutSa == 0) request['DOB'] = _appState.getUserRegistrationPayload.dob; request['HealthId'] = _appState.getUserRegistrationPayload.healthId; request['IsHijri'] = _appState.getUserRegistrationPayload.isHijri; + request["PatientOutSA"] = _appState.getUserRegistrationPayload.projectOutSa == true ? 1 : 0; + request["ForRegisteration"] = _appState.getUserRegistrationPayload.isRegister; + request["isRegister"] = false; + + // if (request.containsKey("OTP_SendType")) { + // request.remove("OTP_SendType"); + // print("====== Demo: Removed OTP_SendType for Register state"); + // } + + print("====== Req"); final resultEither = await _authenticationRepo.checkActivationCodeRepo(newRequest: request, activationCode: activationCode.toString(), isRegister: true); @@ -591,11 +590,27 @@ class AuthenticationViewModel extends ChangeNotifier { } Future onRegistrationComplete() async { - var request = RequestUtils.getUserSignupCompletionRequest(); - clearDefaultInputValues(); + var request = RequestUtils.getUserSignupCompletionRequest(fullName: nameController.text, emailAddress: emailController.text, gender: genderType, maritalStatus: maritalStatus); + // print("============= Final Payload ==============="); print(request); - print("==========================================="); + print("=================== ===================="); + + final resultEither = await _authenticationRepo.registerUser(registrationPayloadDataModelRequest: request); + resultEither.fold((failure) async => await _errorHandlerService.handleError(failure: failure), (apiResponse) async { + if (apiResponse.data is String) { + //TODO: Here We Need to Show a Dialog Of Something in the case of Fail With OK and Cancel and the Display Variable WIll be result. + } else { + print(apiResponse.data as Map); + if (apiResponse.data["MessageStatus"] == 1) { + //TODO: Here We Need to Show a Dialog Of Something in the case of Success. + clearDefaultInputValues(); // This will Clear All Default Values Of User. + _navigationService.pushAndReplace(AppRoutes.loginScreen); + } + } + }); + + return; } Future checkUserStatusForRegistration({required dynamic response, required dynamic request}) async { @@ -616,7 +631,8 @@ class AuthenticationViewModel extends ChangeNotifier { sendActivationCode( otpTypeEnum: OTPTypeEnumExtension.fromInt(request["OTP_SendType"]), nationalIdOrFileNumber: request["PatientIdentificationID"].toString(), - phoneNumber: request["PatientMobileNumber"].toString()); + phoneNumber: request["PatientMobileNumber"].toString(), + payload: request); } else { print("=======IN SA======="); chekUserNHICData(request: request); @@ -630,13 +646,12 @@ class AuthenticationViewModel extends ChangeNotifier { bool isPatientOutsideSA({required dynamic request}) { bool isOutSideSa = false; - if (request is Map && request.containsKey("PatientOutSA")) { - if (request["PatientOutSA"] == true) { - isOutSideSa = true; - } else { - isOutSideSa = false; - } + if (request["PatientOutSA"] == true || request["PatientOutSA"] == 1) { + isOutSideSa = true; + } else { + isOutSideSa = false; } + print(isOutSideSa); return isOutSideSa; } diff --git a/lib/features/authentication/models/request_models/registration_payload_model.dart b/lib/features/authentication/models/request_models/registration_payload_model.dart index 93c409b..bbb31f9 100644 --- a/lib/features/authentication/models/request_models/registration_payload_model.dart +++ b/lib/features/authentication/models/request_models/registration_payload_model.dart @@ -1,20 +1,128 @@ +// import 'dart:convert'; +// +// import 'package:hmg_patient_app_new/core/enums.dart'; +// +// class RegistrationDataModelPayload { +// int? patientMobileNumber; +// String? zipCode; +// int? searchType; +// int? patientId; +// int? patientIdentificationId; +// int? otpSendType; +// int? patientOutSa; +// bool? isDentalAllowedBackend; +// String? dob; +// int? isHijri; +// bool? forRegister; +// bool? isRegister; +// String? healthId; +// String? emailAddress; +// String? nationalityCode; +// GenderTypeEnum? gender; +// MaritalStatusTypeEnum? maritalStatus; +// String? fullName; +// +// RegistrationDataModelPayload({ +// this.patientMobileNumber, +// this.zipCode, +// this.searchType, +// this.patientId, +// this.patientIdentificationId, +// this.otpSendType, +// this.patientOutSa, +// this.isDentalAllowedBackend, +// this.dob, +// this.isHijri, +// this.forRegister, +// this.isRegister, +// this.healthId, +// this.emailAddress, +// this.nationalityCode, +// this.gender, +// this.maritalStatus, +// this.fullName, +// }); +// +// factory RegistrationDataModelPayload.fromRawJson(String str) => RegistrationDataModelPayload.fromJson(json.decode(str)); +// +// String toRawJson() => json.encode(toJson()); +// +// factory RegistrationDataModelPayload.fromJson(Map json) => RegistrationDataModelPayload( +// patientMobileNumber: json["PatientMobileNumber"], +// zipCode: json["ZipCode"], +// searchType: json["SearchType"], +// patientId: json["PatientID"], +// patientIdentificationId: json["PatientIdentificationID"], +// otpSendType: json["OTP_SendType"], +// patientOutSa: json["PatientOutSA"], +// isDentalAllowedBackend: json["isDentalAllowedBackend"], +// dob: json["DOB"], +// isHijri: json["IsHijri"], +// forRegister: json["forRegister"], +// isRegister: json["isRegister"], +// healthId: json["healthId"], +// emailAddress: json["emailAddress"], +// nationalityCode: json["nationalityCode"], +// gender: json["gender"], +// maritalStatus: json["maritalStatus"], +// fullName: json["fullName"], +// ); +// +// Map toJson() => { +// "PatientMobileNumber": patientMobileNumber, +// "ZipCode": zipCode, +// "SearchType": searchType, +// "PatientID": patientId, +// "PatientIdentificationID": patientIdentificationId, +// "OTP_SendType": otpSendType, +// "PatientOutSA": patientOutSa, +// "isDentalAllowedBackend": isDentalAllowedBackend, +// "DOB": dob, +// "IsHijri": isHijri, +// "forRegister": forRegister, +// "isRegister": isRegister, +// "healthId": healthId, +// "emailAddress": emailAddress, +// "nationalityCode": nationalityCode, +// "gender": gender, +// "maritalStatus": maritalStatus, +// "fullName": fullName, +// }; +// } + + import 'dart:convert'; import 'package:hmg_patient_app_new/core/enums.dart'; class RegistrationDataModelPayload { int? patientMobileNumber; + String? mobileNo; + String? deviceToken; + bool? projectOutSa; + int? loginType; String? zipCode; + bool? isRegister; + String? logInTokenId; int? searchType; int? patientId; + int? nationalId; int? patientIdentificationId; int? otpSendType; + String? languageId; + String? versionId; + String? channel; + String? ipAdress; + String? generalid; int? patientOutSa; bool? isDentalAllowedBackend; + String? deviceTypeId; + String? smsSignature; String? dob; int? isHijri; - bool? forRegister; - bool? isRegister; + String? patientType; + String? latitude; + String? longitude; String? healthId; String? emailAddress; String? nationalityCode; @@ -22,19 +130,35 @@ class RegistrationDataModelPayload { MaritalStatusTypeEnum? maritalStatus; String? fullName; + RegistrationDataModelPayload({ this.patientMobileNumber, + this.mobileNo, + this.deviceToken, + this.projectOutSa, + this.loginType, this.zipCode, + this.isRegister, + this.logInTokenId, this.searchType, this.patientId, + this.nationalId, this.patientIdentificationId, this.otpSendType, + this.languageId, + this.versionId, + this.channel, + this.ipAdress, + this.generalid, this.patientOutSa, this.isDentalAllowedBackend, + this.deviceTypeId, + this.smsSignature, this.dob, this.isHijri, - this.forRegister, - this.isRegister, + this.patientType, + this.latitude, + this.longitude, this.healthId, this.emailAddress, this.nationalityCode, @@ -48,44 +172,74 @@ class RegistrationDataModelPayload { String toRawJson() => json.encode(toJson()); factory RegistrationDataModelPayload.fromJson(Map json) => RegistrationDataModelPayload( - patientMobileNumber: json["PatientMobileNumber"], - zipCode: json["ZipCode"], - searchType: json["SearchType"], - patientId: json["PatientID"], - patientIdentificationId: json["PatientIdentificationID"], - otpSendType: json["OTP_SendType"], - patientOutSa: json["PatientOutSA"], - isDentalAllowedBackend: json["isDentalAllowedBackend"], - dob: json["DOB"], - isHijri: json["IsHijri"], - forRegister: json["forRegister"], - isRegister: json["isRegister"], - healthId: json["healthId"], - emailAddress: json["emailAddress"], - nationalityCode: json["nationalityCode"], - gender: json["gender"], - maritalStatus: json["maritalStatus"], - fullName: json["fullName"], - ); + patientMobileNumber: json["PatientMobileNumber"], + mobileNo: json["MobileNo"], + deviceToken: json["DeviceToken"], + projectOutSa: json["ProjectOutSA"], + loginType: json["LoginType"], + zipCode: json["ZipCode"], + isRegister: json["isRegister"], + logInTokenId: json["LogInTokenID"], + searchType: json["SearchType"], + patientId: json["PatientID"], + nationalId: json["NationalID"], + patientIdentificationId: json["PatientIdentificationID"], + otpSendType: json["OTP_SendType"], + languageId: json["LanguageID"], + versionId: json["VersionID"], + channel: json["Channel"], + ipAdress: json["IPAdress"], + generalid: json["generalid"], + patientOutSa: json["PatientOutSA"], + isDentalAllowedBackend: json["isDentalAllowedBackend"], + deviceTypeId: json["DeviceTypeID"], + smsSignature: json["SMSSignature"], + dob: json["DOB"], + isHijri: json["IsHijri"], + patientType: json["PatientType"], + latitude: json["Latitude"], + longitude: json["Longitude"], + healthId: json["healthId"], + emailAddress: json["emailAddress"], + nationalityCode: json["nationalityCode"], + gender: json["gender"], + maritalStatus: json["maritalStatus"], + fullName: json["fullName"], + ); Map toJson() => { - "PatientMobileNumber": patientMobileNumber, - "ZipCode": zipCode, - "SearchType": searchType, - "PatientID": patientId, - "PatientIdentificationID": patientIdentificationId, - "OTP_SendType": otpSendType, - "PatientOutSA": patientOutSa, - "isDentalAllowedBackend": isDentalAllowedBackend, - "DOB": dob, - "IsHijri": isHijri, - "forRegister": forRegister, - "isRegister": isRegister, - "healthId": healthId, - "emailAddress": emailAddress, - "nationalityCode": nationalityCode, - "gender": gender, - "maritalStatus": maritalStatus, - "fullName": fullName, - }; + "PatientMobileNumber": patientMobileNumber, + "MobileNo": mobileNo, + "DeviceToken": deviceToken, + "ProjectOutSA": projectOutSa, + "LoginType": loginType, + "ZipCode": zipCode, + "isRegister": isRegister, + "LogInTokenID": logInTokenId, + "SearchType": searchType, + "PatientID": patientId, + "NationalID": nationalId, + "PatientIdentificationID": patientIdentificationId, + "OTP_SendType": otpSendType, + "LanguageID": languageId, + "VersionID": versionId, + "Channel": channel, + "IPAdress": ipAdress, + "generalid": generalid, + "PatientOutSA": patientOutSa, + "isDentalAllowedBackend": isDentalAllowedBackend, + "DeviceTypeID": deviceTypeId, + "SMSSignature": smsSignature, + "DOB": dob, + "IsHijri": isHijri, + "PatientType": patientType, + "Latitude": latitude, + "Longitude": longitude, + "healthId": healthId, + "emailAddress": emailAddress, + "nationalityCode": nationalityCode, + "gender": gender, + "maritalStatus": maritalStatus, + "fullName": fullName, + }; } diff --git a/lib/presentation/authentication/register.dart b/lib/presentation/authentication/register.dart index f238582..efb0a18 100644 --- a/lib/presentation/authentication/register.dart +++ b/lib/presentation/authentication/register.dart @@ -213,7 +213,7 @@ class _RegisterNew extends State { countryCode: authVM.selectedCountrySignup.countryCode, initialPhoneNumber: "", textController: authVM.phoneNumberController, - isEnableCountryDropdown: true, + isEnableCountryDropdown: false, onCountryChange: authVM.onCountryChange, onChange: authVM.onPhoneNumberChange, buttons: [ diff --git a/lib/presentation/authentication/register_step2.dart b/lib/presentation/authentication/register_step2.dart index da46888..0757420 100644 --- a/lib/presentation/authentication/register_step2.dart +++ b/lib/presentation/authentication/register_step2.dart @@ -217,8 +217,8 @@ class _RegisterNew extends State { TextInputWidget( labelText: LocaleKeys.mobileNumber.tr(), hintText: (appState.getUserRegistrationPayload.patientMobileNumber.toString() ?? ""), - controller: authVM!.phoneNumberController, - isEnable: true, + controller: null, + isEnable: false, prefix: null, isAllowRadius: false, isBorderAllowed: false, @@ -255,7 +255,7 @@ class _RegisterNew extends State { icon: AppAssets.cancel, onPressed: () { Navigator.of(context).pop(); - authVM!.clearDefaultInputValues(); + // authVM!.clearDefaultInputValues(); }, backgroundColor: AppColors.secondaryLightRedColor, borderColor: AppColors.secondaryLightRedColor,