|
|
|
@ -48,6 +48,7 @@ class AuthenticationViewModel extends ChangeNotifier {
|
|
|
|
final DialogService _dialogService;
|
|
|
|
final DialogService _dialogService;
|
|
|
|
final NavigationService _navigationService;
|
|
|
|
final NavigationService _navigationService;
|
|
|
|
final LocalAuthService _localAuthService;
|
|
|
|
final LocalAuthService _localAuthService;
|
|
|
|
|
|
|
|
|
|
|
|
AuthenticationViewModel({
|
|
|
|
AuthenticationViewModel({
|
|
|
|
required AppState appState,
|
|
|
|
required AppState appState,
|
|
|
|
required AuthenticationRepo authenticationRepo,
|
|
|
|
required AuthenticationRepo authenticationRepo,
|
|
|
|
@ -106,7 +107,6 @@ class AuthenticationViewModel extends ChangeNotifier {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Future<void> clearDefaultInputValues() async {
|
|
|
|
Future<void> clearDefaultInputValues() async {
|
|
|
|
|
|
|
|
|
|
|
|
nationalIdController.clear();
|
|
|
|
nationalIdController.clear();
|
|
|
|
phoneNumberController.clear();
|
|
|
|
phoneNumberController.clear();
|
|
|
|
emailController.clear();
|
|
|
|
emailController.clear();
|
|
|
|
@ -622,19 +622,20 @@ class AuthenticationViewModel extends ChangeNotifier {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
checkLastLoginStatus(Function() onSuccess) async {
|
|
|
|
checkLastLoginStatus(Function() onSuccess) async {
|
|
|
|
|
|
|
|
|
|
|
|
Future.delayed(Duration(seconds: 1), () async {
|
|
|
|
Future.delayed(Duration(seconds: 1), () async {
|
|
|
|
if(cacheService.getBool(key: CacheConst.quickLoginEnabled) == null){
|
|
|
|
if (cacheService.getBool(key: CacheConst.quickLoginEnabled) == null) {
|
|
|
|
if (_appState.getSelectDeviceByImeiRespModelElement != null &&
|
|
|
|
if (_appState.getSelectDeviceByImeiRespModelElement != null &&
|
|
|
|
(_appState.getSelectDeviceByImeiRespModelElement!.logInType == 1 || _appState.getSelectDeviceByImeiRespModelElement!.logInType == 4)) {
|
|
|
|
(_appState.getSelectDeviceByImeiRespModelElement!.logInType == 1 || _appState.getSelectDeviceByImeiRespModelElement!.logInType == 4)) {
|
|
|
|
phoneNumberController.text =
|
|
|
|
phoneNumberController.text = (_appState.getAuthenticatedUser()!.mobileNumber!.startsWith("0")
|
|
|
|
(_appState.getAuthenticatedUser()!.mobileNumber!.startsWith("0") ? _appState.getAuthenticatedUser()!.mobileNumber!.replaceFirst("0", "") : _appState.getAuthenticatedUser()!.mobileNumber)!;
|
|
|
|
? _appState.getAuthenticatedUser()!.mobileNumber!.replaceFirst("0", "")
|
|
|
|
|
|
|
|
: _appState.getAuthenticatedUser()!.mobileNumber)!;
|
|
|
|
nationalIdController.text = _appState.getAuthenticatedUser()!.nationalityId!;
|
|
|
|
nationalIdController.text = _appState.getAuthenticatedUser()!.nationalityId!;
|
|
|
|
onSuccess();
|
|
|
|
onSuccess();
|
|
|
|
} else if ((loginTypeEnum == LoginTypeEnum.sms || loginTypeEnum == LoginTypeEnum.whatsapp && _appState.getSelectDeviceByImeiRespModelElement == null) &&
|
|
|
|
} else if ((loginTypeEnum == LoginTypeEnum.sms || loginTypeEnum == LoginTypeEnum.whatsapp && _appState.getSelectDeviceByImeiRespModelElement == null) &&
|
|
|
|
_appState.getAuthenticatedUser() != null) {
|
|
|
|
_appState.getAuthenticatedUser() != null) {
|
|
|
|
phoneNumberController.text =
|
|
|
|
phoneNumberController.text = (_appState.getAuthenticatedUser()!.mobileNumber!.startsWith("0")
|
|
|
|
(_appState.getAuthenticatedUser()!.mobileNumber!.startsWith("0") ? _appState.getAuthenticatedUser()!.mobileNumber!.replaceFirst("0", "") : _appState.getAuthenticatedUser()!.mobileNumber)!;
|
|
|
|
? _appState.getAuthenticatedUser()!.mobileNumber!.replaceFirst("0", "")
|
|
|
|
|
|
|
|
: _appState.getAuthenticatedUser()!.mobileNumber)!;
|
|
|
|
nationalIdController.text = _appState.getAuthenticatedUser()!.nationalityId!;
|
|
|
|
nationalIdController.text = _appState.getAuthenticatedUser()!.nationalityId!;
|
|
|
|
onSuccess();
|
|
|
|
onSuccess();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|