|
|
|
@ -30,7 +30,9 @@ import 'package:hmg_patient_app_new/services/dialog_service.dart';
|
|
|
|
import 'package:hmg_patient_app_new/services/error_handler_service.dart';
|
|
|
|
import 'package:hmg_patient_app_new/services/error_handler_service.dart';
|
|
|
|
import 'package:hmg_patient_app_new/services/localauth_service.dart';
|
|
|
|
import 'package:hmg_patient_app_new/services/localauth_service.dart';
|
|
|
|
import 'package:hmg_patient_app_new/services/navigation_service.dart';
|
|
|
|
import 'package:hmg_patient_app_new/services/navigation_service.dart';
|
|
|
|
|
|
|
|
import 'package:hmg_patient_app_new/widgets/loader/bottomsheet_loader.dart';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import 'models/request_models/get_user_mobile_device_data.dart';
|
|
|
|
import 'models/request_models/insert_patient_mobile_deviceinfo.dart';
|
|
|
|
import 'models/request_models/insert_patient_mobile_deviceinfo.dart';
|
|
|
|
import 'models/request_models/patient_insert_device_imei_request.dart';
|
|
|
|
import 'models/request_models/patient_insert_device_imei_request.dart';
|
|
|
|
|
|
|
|
|
|
|
|
@ -78,10 +80,11 @@ class AuthenticationViewModel extends ChangeNotifier {
|
|
|
|
String errorMsg = '';
|
|
|
|
String errorMsg = '';
|
|
|
|
final FocusNode myFocusNode = FocusNode();
|
|
|
|
final FocusNode myFocusNode = FocusNode();
|
|
|
|
var healthId;
|
|
|
|
var healthId;
|
|
|
|
|
|
|
|
int getDeviceLastLogin =1;
|
|
|
|
|
|
|
|
|
|
|
|
Future<void> onLoginPressed() async {
|
|
|
|
Future<void> onLoginPressed() async {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
LoadingUtils.showFullScreenLoader();
|
|
|
|
LoaderBottomSheet.showLoader();
|
|
|
|
//TODO: We will remove this delay
|
|
|
|
//TODO: We will remove this delay
|
|
|
|
// await Future.delayed(Duration(seconds: 3));
|
|
|
|
// await Future.delayed(Duration(seconds: 3));
|
|
|
|
var data = _appState.getSelectDeviceByImeiRespModelElement;
|
|
|
|
var data = _appState.getSelectDeviceByImeiRespModelElement;
|
|
|
|
@ -93,7 +96,7 @@ class AuthenticationViewModel extends ChangeNotifier {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} catch (e) {
|
|
|
|
} catch (e) {
|
|
|
|
log("Error in onLoginPressed: $e");
|
|
|
|
log("Error in onLoginPressed: $e");
|
|
|
|
LoadingUtils.hideFullScreenLoader();
|
|
|
|
LoaderBottomSheet.hideLoader();
|
|
|
|
_dialogService.showErrorBottomSheet(message: "An unexpected error occurred. Please try again.", onOkPressed: () {});
|
|
|
|
_dialogService.showErrorBottomSheet(message: "An unexpected error occurred. Please try again.", onOkPressed: () {});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -207,7 +210,7 @@ class AuthenticationViewModel extends ChangeNotifier {
|
|
|
|
Future<void> _handleExistingImeiData(dynamic data) async {
|
|
|
|
Future<void> _handleExistingImeiData(dynamic data) async {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
SelectDeviceByImeiRespModelElement? savedData = _appState.getSelectDeviceByImeiRespModelElement;
|
|
|
|
SelectDeviceByImeiRespModelElement? savedData = _appState.getSelectDeviceByImeiRespModelElement;
|
|
|
|
LoadingUtils.hideFullScreenLoader();
|
|
|
|
LoaderBottomSheet.hideLoader();
|
|
|
|
|
|
|
|
|
|
|
|
if (savedData != null) {
|
|
|
|
if (savedData != null) {
|
|
|
|
// TODO: Navigate to SavedLogin when available
|
|
|
|
// TODO: Navigate to SavedLogin when available
|
|
|
|
@ -216,7 +219,7 @@ class AuthenticationViewModel extends ChangeNotifier {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} catch (e) {
|
|
|
|
} catch (e) {
|
|
|
|
log("Error handling existing IMEI data: $e");
|
|
|
|
log("Error handling existing IMEI data: $e");
|
|
|
|
LoadingUtils.hideFullScreenLoader();
|
|
|
|
LoaderBottomSheet.hideLoader();
|
|
|
|
_navigationService.pushPage(page: LoginScreen());
|
|
|
|
_navigationService.pushPage(page: LoginScreen());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -227,7 +230,7 @@ class AuthenticationViewModel extends ChangeNotifier {
|
|
|
|
if (respData != null) {
|
|
|
|
if (respData != null) {
|
|
|
|
dynamic data = SelectDeviceByImeiRespModelElement.fromJson(respData.toJson());
|
|
|
|
dynamic data = SelectDeviceByImeiRespModelElement.fromJson(respData.toJson());
|
|
|
|
_appState.setSelectDeviceByImeiRespModelElement(data);
|
|
|
|
_appState.setSelectDeviceByImeiRespModelElement(data);
|
|
|
|
LoadingUtils.hideFullScreenLoader();
|
|
|
|
LoaderBottomSheet.hideLoader();
|
|
|
|
|
|
|
|
|
|
|
|
// TODO: Navigate to SavedLogin when available
|
|
|
|
// TODO: Navigate to SavedLogin when available
|
|
|
|
// SelectDeviceByImeiRespModelElement savedData =
|
|
|
|
// SelectDeviceByImeiRespModelElement savedData =
|
|
|
|
@ -235,16 +238,16 @@ class AuthenticationViewModel extends ChangeNotifier {
|
|
|
|
_navigationService.pushPage(page: SavedLogin());
|
|
|
|
_navigationService.pushPage(page: SavedLogin());
|
|
|
|
// _navigationService.pushPage(page: LoginScreen());
|
|
|
|
// _navigationService.pushPage(page: LoginScreen());
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
LoadingUtils.hideFullScreenLoader();
|
|
|
|
LoaderBottomSheet.hideLoader();
|
|
|
|
_navigationService.pushPage(page: LoginScreen());
|
|
|
|
_navigationService.pushPage(page: LoginScreen());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} catch (e) {
|
|
|
|
} catch (e) {
|
|
|
|
log("Error processing IMEI registration response: $e");
|
|
|
|
log("Error processing IMEI registration response: $e");
|
|
|
|
LoadingUtils.hideFullScreenLoader();
|
|
|
|
LoaderBottomSheet.hideLoader();
|
|
|
|
_navigationService.pushPage(page: LoginScreen());
|
|
|
|
_navigationService.pushPage(page: LoginScreen());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}, onError: (String error) {
|
|
|
|
}, onError: (String error) {
|
|
|
|
LoadingUtils.hideFullScreenLoader();
|
|
|
|
LoaderBottomSheet.hideLoader();
|
|
|
|
_dialogService.showErrorBottomSheet(message: error, onOkPressed: () {});
|
|
|
|
_dialogService.showErrorBottomSheet(message: error, onOkPressed: () {});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -265,8 +268,8 @@ class AuthenticationViewModel extends ChangeNotifier {
|
|
|
|
if (!isValidated) {
|
|
|
|
if (!isValidated) {
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
LoaderBottomSheet.showLoader();
|
|
|
|
LoadingUtils.showFullScreenLoader();
|
|
|
|
// LoadingUtils.showFullScreenLoader();
|
|
|
|
|
|
|
|
|
|
|
|
dynamic checkPatientAuthenticationReq = RequestUtils.getPatientAuthenticationRequest(
|
|
|
|
dynamic checkPatientAuthenticationReq = RequestUtils.getPatientAuthenticationRequest(
|
|
|
|
phoneNumber: phoneNumberController.text,
|
|
|
|
phoneNumber: phoneNumberController.text,
|
|
|
|
@ -279,20 +282,22 @@ class AuthenticationViewModel extends ChangeNotifier {
|
|
|
|
calenderType: calenderType);
|
|
|
|
calenderType: calenderType);
|
|
|
|
|
|
|
|
|
|
|
|
final result = await _authenticationRepo.checkPatientAuthentication(checkPatientAuthenticationReq: checkPatientAuthenticationReq);
|
|
|
|
final result = await _authenticationRepo.checkPatientAuthentication(checkPatientAuthenticationReq: checkPatientAuthenticationReq);
|
|
|
|
LoadingUtils.hideFullScreenLoader();
|
|
|
|
|
|
|
|
result.fold(
|
|
|
|
result.fold(
|
|
|
|
(failure) async => await _errorHandlerService.handleError(failure: failure),
|
|
|
|
(failure) async => await _errorHandlerService.handleError(failure: failure),
|
|
|
|
(apiResponse) async {
|
|
|
|
(apiResponse) async {
|
|
|
|
if (apiResponse.messageStatus == 2) {
|
|
|
|
if (apiResponse.messageStatus == 2) {
|
|
|
|
|
|
|
|
LoaderBottomSheet.hideLoader();
|
|
|
|
await _dialogService.showErrorBottomSheet(message: apiResponse.errorMessage ?? "ErrorEmpty", onOkPressed: () {});
|
|
|
|
await _dialogService.showErrorBottomSheet(message: apiResponse.errorMessage ?? "ErrorEmpty", onOkPressed: () {});
|
|
|
|
} else if (apiResponse.messageStatus == 1) {
|
|
|
|
} else if (apiResponse.messageStatus == 1) {
|
|
|
|
if (apiResponse.data['isSMSSent']) {
|
|
|
|
if (apiResponse.data['isSMSSent']) {
|
|
|
|
_appState.setAppAuthToken = apiResponse.data['LogInTokenID'];
|
|
|
|
_appState.setAppAuthToken = apiResponse.data['LogInTokenID'];
|
|
|
|
sendActivationCode(
|
|
|
|
await sendActivationCode(
|
|
|
|
otpTypeEnum: otpTypeEnum,
|
|
|
|
otpTypeEnum: otpTypeEnum,
|
|
|
|
phoneNumber: phoneNumberController.text,
|
|
|
|
phoneNumber: phoneNumberController.text,
|
|
|
|
nationalIdOrFileNumber: nationalIdController.text,
|
|
|
|
nationalIdOrFileNumber: nationalIdController.text,
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
if (apiResponse.data['IsAuthenticated']) {
|
|
|
|
if (apiResponse.data['IsAuthenticated']) {
|
|
|
|
await checkActivationCode(
|
|
|
|
await checkActivationCode(
|
|
|
|
@ -300,6 +305,7 @@ class AuthenticationViewModel extends ChangeNotifier {
|
|
|
|
onWrongActivationCode: (String? message) {},
|
|
|
|
onWrongActivationCode: (String? message) {},
|
|
|
|
activationCode: null, //todo silent login case halded on the repo itself..
|
|
|
|
activationCode: null, //todo silent login case halded on the repo itself..
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -347,9 +353,11 @@ class AuthenticationViewModel extends ChangeNotifier {
|
|
|
|
(failure) async => await _errorHandlerService.handleError(failure: failure),
|
|
|
|
(failure) async => await _errorHandlerService.handleError(failure: failure),
|
|
|
|
(apiResponse) async {
|
|
|
|
(apiResponse) async {
|
|
|
|
if (apiResponse.messageStatus == 2) {
|
|
|
|
if (apiResponse.messageStatus == 2) {
|
|
|
|
|
|
|
|
LoaderBottomSheet.hideLoader();
|
|
|
|
await _dialogService.showErrorBottomSheet(message: apiResponse.errorMessage ?? "ErrorEmpty");
|
|
|
|
await _dialogService.showErrorBottomSheet(message: apiResponse.errorMessage ?? "ErrorEmpty");
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
if (apiResponse.data != null && apiResponse.data['isSMSSent'] == true) {
|
|
|
|
if (apiResponse.data != null && apiResponse.data['isSMSSent'] == true) {
|
|
|
|
|
|
|
|
LoaderBottomSheet.hideLoader();
|
|
|
|
navigateToOTPScreen(otpTypeEnum: otpTypeEnum, phoneNumber: phoneNumber);
|
|
|
|
navigateToOTPScreen(otpTypeEnum: otpTypeEnum, phoneNumber: phoneNumber);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
// TODO: Handle isSMSSent false
|
|
|
|
// TODO: Handle isSMSSent false
|
|
|
|
@ -384,7 +392,7 @@ class AuthenticationViewModel extends ChangeNotifier {
|
|
|
|
countryCode: selectedCountrySignup.countryCode,
|
|
|
|
countryCode: selectedCountrySignup.countryCode,
|
|
|
|
loginType: loginTypeEnum.toInt)
|
|
|
|
loginType: loginTypeEnum.toInt)
|
|
|
|
.toJson();
|
|
|
|
.toJson();
|
|
|
|
|
|
|
|
LoaderBottomSheet.showLoader();
|
|
|
|
bool isForRegister = (_appState.getUserRegistrationPayload.healthId != null || _appState.getUserRegistrationPayload.patientOutSa == true);
|
|
|
|
bool isForRegister = (_appState.getUserRegistrationPayload.healthId != null || _appState.getUserRegistrationPayload.patientOutSa == true);
|
|
|
|
if (isForRegister) {
|
|
|
|
if (isForRegister) {
|
|
|
|
if (_appState.getUserRegistrationPayload.patientOutSa == true) request['DOB'] = _appState.getUserRegistrationPayload.dob;
|
|
|
|
if (_appState.getUserRegistrationPayload.patientOutSa == true) request['DOB'] = _appState.getUserRegistrationPayload.dob;
|
|
|
|
@ -393,6 +401,8 @@ class AuthenticationViewModel extends ChangeNotifier {
|
|
|
|
|
|
|
|
|
|
|
|
final resultEither = await _authenticationRepo.checkActivationCodeRepo(newRequest: request, activationCode: activationCode.toString(), isRegister: true);
|
|
|
|
final resultEither = await _authenticationRepo.checkActivationCodeRepo(newRequest: request, activationCode: activationCode.toString(), isRegister: true);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
LoaderBottomSheet.hideLoader();
|
|
|
|
|
|
|
|
|
|
|
|
resultEither.fold((failure) async => await _errorHandlerService.handleError(failure: failure), (apiResponse) {
|
|
|
|
resultEither.fold((failure) async => await _errorHandlerService.handleError(failure: failure), (apiResponse) {
|
|
|
|
final activation = CheckActivationCode.fromJson(apiResponse.data as Map<String, dynamic>);
|
|
|
|
final activation = CheckActivationCode.fromJson(apiResponse.data as Map<String, dynamic>);
|
|
|
|
if (_appState.getUserRegistrationPayload.isRegister == true) {
|
|
|
|
if (_appState.getUserRegistrationPayload.isRegister == true) {
|
|
|
|
@ -412,19 +422,26 @@ class AuthenticationViewModel extends ChangeNotifier {
|
|
|
|
|
|
|
|
|
|
|
|
resultEither.fold((failure) async => await _errorHandlerService.handleError(failure: failure), (apiResponse) async {
|
|
|
|
resultEither.fold((failure) async => await _errorHandlerService.handleError(failure: failure), (apiResponse) async {
|
|
|
|
final activation = CheckActivationCode.fromJson(apiResponse.data as Map<String, dynamic>);
|
|
|
|
final activation = CheckActivationCode.fromJson(apiResponse.data as Map<String, dynamic>);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (activation.errorCode == '699') {
|
|
|
|
if (activation.errorCode == '699') {
|
|
|
|
// Todo: Hide Loader
|
|
|
|
// Todo: Hide Loader
|
|
|
|
// GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
// GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
|
|
|
|
LoaderBottomSheet.hideLoader();
|
|
|
|
onWrongActivationCode(activation.errorEndUserMessage);
|
|
|
|
onWrongActivationCode(activation.errorEndUserMessage);
|
|
|
|
|
|
|
|
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
} else if (activation.messageStatus == 2) {
|
|
|
|
} else if (activation.messageStatus == 2) {
|
|
|
|
|
|
|
|
LoaderBottomSheet.hideLoader();
|
|
|
|
onWrongActivationCode(activation.errorEndUserMessage);
|
|
|
|
onWrongActivationCode(activation.errorEndUserMessage);
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
} else if (_appState.getUserRegistrationPayload.isRegister == true) {
|
|
|
|
} else if (_appState.getUserRegistrationPayload.isRegister == true) {
|
|
|
|
|
|
|
|
LoaderBottomSheet.hideLoader();
|
|
|
|
_navigationService.pushAndReplace(AppRoutes.registerStepTwo);
|
|
|
|
_navigationService.pushAndReplace(AppRoutes.registerStepTwo);
|
|
|
|
// Navigator.popUntil(context, (route) => Utils.route(route, equalsTo: RegisterNew));
|
|
|
|
// Navigator.popUntil(context, (route) => Utils.route(route, equalsTo: RegisterNew));
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
|
|
|
|
|
|
|
|
if (activation.list != null && activation.list!.isNotEmpty) {
|
|
|
|
if (activation.list != null && activation.list!.isNotEmpty) {
|
|
|
|
_appState.setAuthenticatedUser(activation.list!.first);
|
|
|
|
_appState.setAuthenticatedUser(activation.list!.first);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -432,6 +449,11 @@ class AuthenticationViewModel extends ChangeNotifier {
|
|
|
|
_appState.setAppAuthToken = activation.authenticationTokenId;
|
|
|
|
_appState.setAppAuthToken = activation.authenticationTokenId;
|
|
|
|
final request = RequestUtils.getAuthanticatedCommonRequest().toJson();
|
|
|
|
final request = RequestUtils.getAuthanticatedCommonRequest().toJson();
|
|
|
|
bool isUserAgreedBefore = await checkIfUserAgreedBefore(request: request);
|
|
|
|
bool isUserAgreedBefore = await checkIfUserAgreedBefore(request: request);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//updating the last login type in app state to show the fingerprint/face id option on home screen
|
|
|
|
|
|
|
|
_appState.getSelectDeviceByImeiRespModelElement!.logInType = loginTypeEnum.toInt;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
LoaderBottomSheet.hideLoader();
|
|
|
|
insertPatientIMEIData(loginTypeEnum.toInt);
|
|
|
|
insertPatientIMEIData(loginTypeEnum.toInt);
|
|
|
|
clearDefaultInputValues();
|
|
|
|
clearDefaultInputValues();
|
|
|
|
if (isUserAgreedBefore) {
|
|
|
|
if (isUserAgreedBefore) {
|
|
|
|
@ -518,20 +540,22 @@ class AuthenticationViewModel extends ChangeNotifier {
|
|
|
|
await _dialogService.showErrorBottomSheet(message: message ?? "Something went wrong. ", onOkPressed: () {});
|
|
|
|
await _dialogService.showErrorBottomSheet(message: message ?? "Something went wrong. ", onOkPressed: () {});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
loginWithFingerPrintFace() async {
|
|
|
|
loginWithFingerPrintFace(Function success) async {
|
|
|
|
_localAuthService.authenticate().then((value) async {
|
|
|
|
_localAuthService.authenticate().then((value) async {
|
|
|
|
if (value) {
|
|
|
|
if (value) {
|
|
|
|
// we have to handle this if verification true;
|
|
|
|
LoaderBottomSheet.showLoader();
|
|
|
|
|
|
|
|
success();
|
|
|
|
|
|
|
|
loginTypeEnum = (_appState.deviceTypeID == 1 ? LoginTypeEnum.face : LoginTypeEnum.fingerprint);
|
|
|
|
if (!_appState.isAuthenticated) {
|
|
|
|
if (!_appState.isAuthenticated) {
|
|
|
|
loginTypeEnum = (_appState.deviceTypeID == 1 ? LoginTypeEnum.face : LoginTypeEnum.fingerprint);
|
|
|
|
//commenting this api to check either the same flow working or not because this api does not needed further if work fine we will remove this
|
|
|
|
print(loginTypeEnum);
|
|
|
|
// await getPatientDeviceData(loginTypeEnum.toInt);
|
|
|
|
await checkActivationCode(otpTypeEnum: OTPTypeEnum.faceIDFingerprint, activationCode: null, onWrongActivationCode: (String? message) {});
|
|
|
|
await checkActivationCode(otpTypeEnum: OTPTypeEnum.faceIDFingerprint, activationCode: null, onWrongActivationCode: (String? message) {});
|
|
|
|
insertPatientIMEIData((_appState.deviceTypeID == 1 ? LoginTypeEnum.face.toInt : LoginTypeEnum.fingerprint.toInt));
|
|
|
|
await insertPatientIMEIData(loginTypeEnum.toInt);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
// authenticated = true;
|
|
|
|
// authenticated = true;
|
|
|
|
insertPatientIMEIData((_appState.deviceTypeID == 1 ? LoginTypeEnum.face.toInt : LoginTypeEnum.fingerprint.toInt));
|
|
|
|
await insertPatientIMEIData(loginTypeEnum.toInt);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
LoaderBottomSheet.hideLoader();
|
|
|
|
notifyListeners();
|
|
|
|
notifyListeners();
|
|
|
|
// navigateToHomeScreen();
|
|
|
|
// navigateToHomeScreen();
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
@ -760,6 +784,33 @@ class AuthenticationViewModel extends ChangeNotifier {
|
|
|
|
log("Insert IMEI Failed");
|
|
|
|
log("Insert IMEI Failed");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Future<void> getPatientDeviceData(int loginType) async {
|
|
|
|
|
|
|
|
final resultEither = await _authenticationRepo.getPatientDeviceData(
|
|
|
|
|
|
|
|
patientDeviceDataRequest: GetUserMobileDeviceData(
|
|
|
|
|
|
|
|
deviceToken: _appState.deviceToken,
|
|
|
|
|
|
|
|
deviceTypeId: _appState.getDeviceTypeID(),
|
|
|
|
|
|
|
|
patientId: _appState.getSelectDeviceByImeiRespModelElement!.patientId!,
|
|
|
|
|
|
|
|
patientType: _appState.getSelectDeviceByImeiRespModelElement!.patientType,
|
|
|
|
|
|
|
|
patientOutSa:_appState.getSelectDeviceByImeiRespModelElement!.outSa == true ?1 :0,
|
|
|
|
|
|
|
|
loginType: loginType,
|
|
|
|
|
|
|
|
languageId: _appState.getLanguageID(),
|
|
|
|
|
|
|
|
latitude: _appState.userLat,
|
|
|
|
|
|
|
|
longitude: _appState.userLong,
|
|
|
|
|
|
|
|
mobileNo:_appState.getSelectDeviceByImeiRespModelElement!.mobile! ,
|
|
|
|
|
|
|
|
patientMobileNumber:int.parse(_appState.getSelectDeviceByImeiRespModelElement!.mobile!),
|
|
|
|
|
|
|
|
nationalId:_appState.getSelectDeviceByImeiRespModelElement!.identificationNo)
|
|
|
|
|
|
|
|
.toJson());
|
|
|
|
|
|
|
|
resultEither.fold((failure) async => await _errorHandlerService.handleError(failure: failure), (apiResponse) async {
|
|
|
|
|
|
|
|
if (apiResponse.messageStatus == 1) {
|
|
|
|
|
|
|
|
dynamic deviceInfo= apiResponse.data['List_MobileLoginInfo'];
|
|
|
|
|
|
|
|
getDeviceLastLogin = deviceInfo['LoginType'];
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
|