|
|
|
|
@ -302,7 +302,6 @@ class AuthenticationViewModel extends ChangeNotifier {
|
|
|
|
|
phoneNumber: phoneNumberController.text,
|
|
|
|
|
nationalIdOrFileNumber: nationalIdController.text,
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
if (apiResponse.data['IsAuthenticated']) {
|
|
|
|
|
await checkActivationCode(
|
|
|
|
|
@ -310,7 +309,6 @@ class AuthenticationViewModel extends ChangeNotifier {
|
|
|
|
|
onWrongActivationCode: (String? message) {},
|
|
|
|
|
activationCode: null, //todo silent login case halded on the repo itself..
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@ -325,10 +323,13 @@ class AuthenticationViewModel extends ChangeNotifier {
|
|
|
|
|
selectedLoginType: otpTypeEnum.toInt(),
|
|
|
|
|
zipCode: selectedCountrySignup.countryCode,
|
|
|
|
|
nationalId: int.parse(nationalIdOrFileNumber),
|
|
|
|
|
isFileNo: isPatientHasFile(request: payload),
|
|
|
|
|
// isFileNo: isPatientHasFile(request: payload),
|
|
|
|
|
isFileNo: false,
|
|
|
|
|
patientId: 0,
|
|
|
|
|
isForRegister: checkIsUserComingForRegister(request: payload),
|
|
|
|
|
patientOutSA: isPatientOutsideSA(request: payload),
|
|
|
|
|
isForRegister: false,
|
|
|
|
|
// isForRegister: checkIsUserComingForRegister(request: payload),
|
|
|
|
|
patientOutSA: selectedCountrySignup.countryCode == CountryEnum.saudiArabia ? false : true,
|
|
|
|
|
// patientOutSA: isPatientOutsideSA(request: payload),
|
|
|
|
|
payload: payload);
|
|
|
|
|
|
|
|
|
|
// TODO: GET APP SMS SIGNATURE HERE
|
|
|
|
|
@ -373,19 +374,25 @@ class AuthenticationViewModel extends ChangeNotifier {
|
|
|
|
|
required OTPTypeEnum otpTypeEnum,
|
|
|
|
|
required Function(String? message) onWrongActivationCode,
|
|
|
|
|
}) async {
|
|
|
|
|
bool isForRegister = (_appState.getUserRegistrationPayload.healthId != null || _appState.getUserRegistrationPayload.patientOutSa == true);
|
|
|
|
|
|
|
|
|
|
final request = RequestUtils.getCommonRequestWelcome(
|
|
|
|
|
phoneNumber: phoneNumberController.text,
|
|
|
|
|
otpTypeEnum: otpTypeEnum,
|
|
|
|
|
deviceToken: _appState.deviceToken,
|
|
|
|
|
patientOutSA: _appState.getUserRegistrationPayload.projectOutSa == 1 ? true : false,
|
|
|
|
|
// patientOutSA: _appState.getUserRegistrationPayload.projectOutSa == 1 ? true : false,
|
|
|
|
|
patientOutSA: isForRegister
|
|
|
|
|
? _appState.getUserRegistrationPayload.projectOutSa == 1
|
|
|
|
|
? true
|
|
|
|
|
: false
|
|
|
|
|
: _appState.getSelectDeviceByImeiRespModelElement!.outSa!,
|
|
|
|
|
loginTokenID: _appState.appAuthToken,
|
|
|
|
|
registeredData: _appState.getUserRegistrationPayload,
|
|
|
|
|
registeredData: isForRegister ? _appState.getUserRegistrationPayload : null,
|
|
|
|
|
nationIdText: nationalIdController.text,
|
|
|
|
|
countryCode: selectedCountrySignup.countryCode,
|
|
|
|
|
loginType: loginTypeEnum.toInt)
|
|
|
|
|
.toJson();
|
|
|
|
|
LoaderBottomSheet.showLoader();
|
|
|
|
|
bool isForRegister = (_appState.getUserRegistrationPayload.healthId != null || _appState.getUserRegistrationPayload.patientOutSa == true);
|
|
|
|
|
if (isForRegister) {
|
|
|
|
|
if (_appState.getUserRegistrationPayload.patientOutSa == 0) request['DOB'] = _appState.getUserRegistrationPayload.dob;
|
|
|
|
|
request['HealthId'] = _appState.getUserRegistrationPayload.healthId;
|
|
|
|
|
|