Apply the new authentication logic

merge-requests/778/head
Mohammad Aljammal 5 years ago
parent 36f34226bd
commit 243108e81a

@ -64,7 +64,7 @@ class BaseAppClient {
else else
body['LanguageID'] = 2; body['LanguageID'] = 2;
body['stamp'] = STAMP; body['stamp'] = DateTime.now().toIso8601String();
// if(!body.containsKey("IPAdress")) // if(!body.containsKey("IPAdress"))
body['IPAdress'] = IP_ADDRESS; body['IPAdress'] = IP_ADDRESS;
body['VersionID'] = VERSION_ID; body['VersionID'] = VERSION_ID;

@ -5,8 +5,8 @@ const ONLY_NUMBERS = "[0-9]";
const ONLY_LETTERS = "[a-zA-Z &'\"]"; const ONLY_LETTERS = "[a-zA-Z &'\"]";
const ONLY_DATE = "[0-9/]"; const ONLY_DATE = "[0-9/]";
const BASE_URL_LIVE_CARE = 'https://livecare.hmg.com/'; const BASE_URL_LIVE_CARE = 'https://livecare.hmg.com/';
const BASE_URL = 'https://hmgwebservices.com/'; // const BASE_URL = 'https://hmgwebservices.com/';
// const BASE_URL = 'https://uat.hmgwebservices.com/'; const BASE_URL = 'https://uat.hmgwebservices.com/';
const PHARMACY_ITEMS_URL = "Services/Lists.svc/REST/GetPharmcyItems_Region_enh"; const PHARMACY_ITEMS_URL = "Services/Lists.svc/REST/GetPharmcyItems_Region_enh";
const PHARMACY_LIST_URL = "Services/Patients.svc/REST/GetPharmcyList"; const PHARMACY_LIST_URL = "Services/Patients.svc/REST/GetPharmcyList";
const PATIENT_PROGRESS_NOTE_URL = "Services/DoctorApplication.svc/REST/GetProgressNoteForInPatient"; const PATIENT_PROGRESS_NOTE_URL = "Services/DoctorApplication.svc/REST/GetProgressNoteForInPatient";
@ -279,14 +279,14 @@ var SERVICES_PATIANT_HEADER_AR = [
"المريض الواصل" "المريض الواصل"
]; ];
var DEVICE_TOKEN = "";
const PRIMARY_COLOR = 0xff515B5D; const PRIMARY_COLOR = 0xff515B5D;
const TRANSACTION_NO = 0; const TRANSACTION_NO = 0;
const LANGUAGE_ID = 2; const LANGUAGE_ID = 2;
const STAMP = '2020-04-27T12:17:17.721Z'; const STAMP = '2020-04-27T12:17:17.721Z';
const IP_ADDRESS = '9.9.9.9'; const IP_ADDRESS = '9.9.9.9';
const VERSION_ID = 6.2; const VERSION_ID = 6.3;
const CHANNEL = 9; const CHANNEL = 9;
const SESSION_ID = 'BlUSkYymTt'; const SESSION_ID = 'BlUSkYymTt';
const IS_LOGIN_FOR_DOCTOR_APP = true; const IS_LOGIN_FOR_DOCTOR_APP = true;

@ -12,5 +12,4 @@ final LOGGED_IN_USER = 'loggedUser';
final DASHBOARD_DATA = 'dashboard-data'; final DASHBOARD_DATA = 'dashboard-data';
final OTP_TYPE = 'otp-type'; final OTP_TYPE = 'otp-type';
final LAST_LOGIN_USER = 'last-login-user'; final LAST_LOGIN_USER = 'last-login-user';
final PASSWORD = 'password';
final CLINIC_NAME = 'clinic-name'; final CLINIC_NAME = 'clinic-name';

@ -1,34 +1,26 @@
class ActivationCodeModel { class ActivationCodeModel {
String mobileNumber;
String zipCode;
int channel; int channel;
int languageID; int languageID;
double versionID; double versionID;
int memberID; int memberID;
String password;
int facilityId; int facilityId;
String generalid; String generalid;
String otpSendType; String otpSendType;
ActivationCodeModel( ActivationCodeModel(
{this.mobileNumber, {this.channel,
this.zipCode,
this.channel,
this.languageID, this.languageID,
this.versionID, this.versionID,
this.memberID, this.memberID,
this.password,
this.facilityId, this.facilityId,
this.otpSendType, this.otpSendType,
this.generalid}); this.generalid});
ActivationCodeModel.fromJson(Map<String, dynamic> json) { ActivationCodeModel.fromJson(Map<String, dynamic> json) {
mobileNumber = json['MobileNumber'];
zipCode = json['ZipCode'];
channel = json['Channel']; channel = json['Channel'];
languageID = json['LanguageID']; languageID = json['LanguageID'];
versionID = json['VersionID']; versionID = json['VersionID'];
memberID = json['MemberID']; memberID = json['MemberID'];
password = json['Password'];
facilityId = json['facilityId']; facilityId = json['facilityId'];
otpSendType = json['OTP_SendType']; otpSendType = json['OTP_SendType'];
generalid = json['generalid']; generalid = json['generalid'];
@ -36,13 +28,10 @@ class ActivationCodeModel {
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>(); final Map<String, dynamic> data = new Map<String, dynamic>();
data['MobileNumber'] = this.mobileNumber;
data['ZipCode'] = this.zipCode;
data['Channel'] = this.channel; data['Channel'] = this.channel;
data['LanguageID'] = this.languageID; data['LanguageID'] = this.languageID;
data['VersionID'] = this.versionID; data['VersionID'] = this.versionID;
data['MemberID'] = this.memberID; data['MemberID'] = this.memberID;
data['Password'] = this.password;
data['facilityId'] = this.facilityId; data['facilityId'] = this.facilityId;
data['OTP_SendType'] = otpSendType; data['OTP_SendType'] = otpSendType;
data['generalid'] = this.generalid; data['generalid'] = this.generalid;

@ -55,8 +55,6 @@ class ActivationCodeForVerificationScreenModel {
data['facilityId'] = this.facilityId; data['facilityId'] = this.facilityId;
data['generalid'] = this.generalid; data['generalid'] = this.generalid;
data['IsMobileFingerPrint'] = this.isMobileFingerPrint; data['IsMobileFingerPrint'] = this.isMobileFingerPrint;
data['VidaAuthTokenID'] = this.vidaAuthTokenID;
data['VidaRefreshTokenID'] = this.vidaRefreshTokenID;
data['IMEI'] = this.iMEI; data['IMEI'] = this.iMEI;
return data; return data;
} }

@ -5,11 +5,16 @@ class CheckActivationCodeForDoctorAppResponseModel {
List<ListDoctorsClinic> listDoctorsClinic; List<ListDoctorsClinic> listDoctorsClinic;
List<DoctorProfileModel> listDoctorProfile; List<DoctorProfileModel> listDoctorProfile;
MemberInformation memberInformation; MemberInformation memberInformation;
String vidaAuthTokenID;
String vidaRefreshTokenID;
CheckActivationCodeForDoctorAppResponseModel( CheckActivationCodeForDoctorAppResponseModel(
{this.authenticationTokenID, {this.authenticationTokenID,
this.listDoctorsClinic, this.listDoctorsClinic,
this.memberInformation}); this.memberInformation,
this.listDoctorProfile,
this.vidaAuthTokenID,
this.vidaRefreshTokenID});
CheckActivationCodeForDoctorAppResponseModel.fromJson( CheckActivationCodeForDoctorAppResponseModel.fromJson(
Map<String, dynamic> json) { Map<String, dynamic> json) {
@ -27,6 +32,8 @@ class CheckActivationCodeForDoctorAppResponseModel {
listDoctorProfile.add(new DoctorProfileModel.fromJson(v)); listDoctorProfile.add(new DoctorProfileModel.fromJson(v));
}); });
} }
vidaAuthTokenID = json['VidaAuthTokenID'];
vidaRefreshTokenID = json['VidaRefreshTokenID'];
memberInformation = json['memberInformation'] != null memberInformation = json['memberInformation'] != null
? new MemberInformation.fromJson(json['memberInformation']) ? new MemberInformation.fromJson(json['memberInformation'])
@ -60,7 +67,8 @@ class ListDoctorsClinic {
bool isActive; bool isActive;
String clinicName; String clinicName;
ListDoctorsClinic({this.setupID, ListDoctorsClinic(
{this.setupID,
this.projectID, this.projectID,
this.doctorID, this.doctorID,
this.clinicID, this.clinicID,
@ -99,7 +107,8 @@ class MemberInformation {
String preferredLanguage; String preferredLanguage;
List<Roles> roles; List<Roles> roles;
MemberInformation({this.clinics, MemberInformation(
{this.clinics,
this.doctorId, this.doctorId,
this.email, this.email,
this.employeeId, this.employeeId,

@ -2,6 +2,9 @@ class CheckActivationCodeRequestModel {
String mobileNumber; String mobileNumber;
String zipCode; String zipCode;
int doctorID; int doctorID;
int memberID;
String password;
String facilityId;
String iPAdress; String iPAdress;
int channel; int channel;
int languageID; int languageID;
@ -12,6 +15,8 @@ class CheckActivationCodeRequestModel {
String activationCode; String activationCode;
String vidaAuthTokenID; String vidaAuthTokenID;
String vidaRefreshTokenID; String vidaRefreshTokenID;
String iMEI;
bool isForSilentLogin;
int oTPSendType; int oTPSendType;
CheckActivationCodeRequestModel( CheckActivationCodeRequestModel(
{this.mobileNumber, {this.mobileNumber,
@ -27,7 +32,7 @@ class CheckActivationCodeRequestModel {
this.activationCode, this.activationCode,
this.vidaAuthTokenID, this.vidaAuthTokenID,
this.vidaRefreshTokenID, this.vidaRefreshTokenID,
this.oTPSendType}); this.oTPSendType,this.password,this.facilityId,this.memberID,this.isForSilentLogin=false,this.iMEI});
CheckActivationCodeRequestModel.fromJson(Map<String, dynamic> json) { CheckActivationCodeRequestModel.fromJson(Map<String, dynamic> json) {
mobileNumber = json['MobileNumber']; mobileNumber = json['MobileNumber'];
@ -62,6 +67,11 @@ class CheckActivationCodeRequestModel {
data['VidaAuthTokenID'] = this.vidaAuthTokenID; data['VidaAuthTokenID'] = this.vidaAuthTokenID;
data['VidaRefreshTokenID'] = this.vidaRefreshTokenID; data['VidaRefreshTokenID'] = this.vidaRefreshTokenID;
data['OTP_SendType'] = this.oTPSendType; data['OTP_SendType'] = this.oTPSendType;
data['facilityId'] = this.facilityId;
data['MemberID'] = this.memberID;
data['Password'] = this.password;
data['IMEI'] = this.iMEI;
data['IsForSilentLogin'] = this.isForSilentLogin;
return data; return data;
} }
} }

@ -70,35 +70,25 @@ class AuthenticationViewModel extends BaseViewModel {
bool isLogin = false; bool isLogin = false;
bool unverified = false; bool unverified = false;
bool isFromLogin = false; bool isFromLogin = false;
APP_STATUS app_status = APP_STATUS.LOADING; APP_STATUS appStatus = APP_STATUS.LOADING;
String localToken ="";
AuthenticationViewModel({bool checkDeviceInfo = false}) { AuthenticationViewModel({bool checkDeviceInfo = false}) {
getDeviceInfoFromFirebase(); getDeviceInfoFromFirebase();
getDoctorProfile(); getDoctorProfile();
} }
/// select Device IMEI
Future selectDeviceImei(imei) async {
setState(ViewState.Busy);
await _authService.selectDeviceImei(imei);
if (_authService.hasError) {
error = _authService.error;
setState(ViewState.Error);
} else
setState(ViewState.Idle);
}
/// Insert Device IMEI /// Insert Device IMEI
Future insertDeviceImei() async { Future insertDeviceImei(token) async {
var loggedIn = await sharedPref.getObj(LOGGED_IN_USER); var loggedIn = await sharedPref.getObj(LOGGED_IN_USER);
var user = await sharedPref.getObj(LAST_LOGIN_USER); var data = await sharedPref.getObj(LAST_LOGIN_USER);
if (user != null) { if (data != null) {
user = GetIMEIDetailsModel.fromJson(user); user = GetIMEIDetailsModel.fromJson(data);
} }
var profileInfo = await sharedPref.getObj(DOCTOR_PROFILE); var profileInfo = await sharedPref.getObj(DOCTOR_PROFILE);
profileInfo['IMEI'] = DEVICE_TOKEN; profileInfo['IMEI'] = token;
profileInfo['LogInTypeID'] = await sharedPref.getInt(OTP_TYPE); profileInfo['LogInTypeID'] = await sharedPref.getInt(OTP_TYPE);
profileInfo['BioMetricEnabled'] = true; profileInfo['BioMetricEnabled'] = true;
profileInfo['MobileNo'] = profileInfo['MobileNo'] =
@ -115,9 +105,8 @@ class AuthenticationViewModel extends BaseViewModel {
: user.doctorID; : user.doctorID;
insertIMEIDetailsModel.outSA = loggedIn != null ? loggedIn['PatientOutSA'] : user.outSA; insertIMEIDetailsModel.outSA = loggedIn != null ? loggedIn['PatientOutSA'] : user.outSA;
insertIMEIDetailsModel.vidaAuthTokenID = await sharedPref.getString(VIDA_AUTH_TOKEN_ID); insertIMEIDetailsModel.vidaAuthTokenID = await sharedPref.getString(VIDA_AUTH_TOKEN_ID);
insertIMEIDetailsModel.vidaRefreshTokenID = insertIMEIDetailsModel.vidaRefreshTokenID =await sharedPref.getString(VIDA_REFRESH_TOKEN_ID);
await sharedPref.getString(VIDA_REFRESH_TOKEN_ID); insertIMEIDetailsModel.password = userInfo.password;
insertIMEIDetailsModel.password = await sharedPref.getString(PASSWORD);
await _authService.insertDeviceImei(insertIMEIDetailsModel); await _authService.insertDeviceImei(insertIMEIDetailsModel);
if (_authService.hasError) { if (_authService.hasError) {
@ -174,21 +163,22 @@ class AuthenticationViewModel extends BaseViewModel {
ActivationCodeModel activationCodeModel = ActivationCodeModel( ActivationCodeModel activationCodeModel = ActivationCodeModel(
facilityId: projectID, facilityId: projectID,
memberID: loggedUser.listMemberInformation[0].memberID, memberID: loggedUser.listMemberInformation[0].memberID,
zipCode: loggedUser.zipCode,
mobileNumber: loggedUser.mobileNumber,
otpSendType: authMethodType.getTypeIdService().toString(), otpSendType: authMethodType.getTypeIdService().toString(),
password: password); );
await _authService.sendActivationCodeForDoctorApp(activationCodeModel); await _authService.sendActivationCodeForDoctorApp(activationCodeModel);
if (_authService.hasError) { if (_authService.hasError) {
error = _authService.error; error = _authService.error;
setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);
} else } else {
await sharedPref.setString(LOGIN_TOKEN_ID,
_authService.activationCodeForDoctorAppRes.logInTokenID);
setState(ViewState.Idle); setState(ViewState.Idle);
} }
}
/// check activation code for sms and whats app /// check activation code for sms and whats app
Future checkActivationCodeForDoctorApp({String activationCode}) async { Future checkActivationCodeForDoctorApp({String activationCode,bool isSilentLogin = false}) async {
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
CheckActivationCodeRequestModel checkActivationCodeForDoctorApp = CheckActivationCodeRequestModel checkActivationCodeForDoctorApp =
new CheckActivationCodeRequestModel( new CheckActivationCodeRequestModel(
@ -201,13 +191,19 @@ class AuthenticationViewModel extends BaseViewModel {
: user.projectID, : user.projectID,
logInTokenID: await sharedPref.getString(LOGIN_TOKEN_ID), logInTokenID: await sharedPref.getString(LOGIN_TOKEN_ID),
activationCode: activationCode ?? '0000', activationCode: activationCode ?? '0000',
memberID:userInfo.userID!=null? int.parse(userInfo.userID):user.doctorID ,
password: userInfo.password,
facilityId:userInfo.projectID!=null? userInfo.projectID.toString():user.projectID.toString(),
oTPSendType: await sharedPref.getInt(OTP_TYPE), oTPSendType: await sharedPref.getInt(OTP_TYPE),
iMEI: localToken,
isForSilentLogin:isSilentLogin,
generalid: "Cs2020@2016\$2958"); generalid: "Cs2020@2016\$2958");
await _authService.checkActivationCodeForDoctorApp(checkActivationCodeForDoctorApp); await _authService.checkActivationCodeForDoctorApp(checkActivationCodeForDoctorApp);
if (_authService.hasError) { if (_authService.hasError) {
error = _authService.error; error = _authService.error;
setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);
} else { } else {
await setDataAfterSendActivationSuccess(checkActivationCodeForDoctorAppRes);
setState(ViewState.Idle); setState(ViewState.Idle);
} }
} }
@ -253,15 +249,14 @@ class AuthenticationViewModel extends BaseViewModel {
} }
/// add  token to shared preferences in case of send activation code is success /// add  token to shared preferences in case of send activation code is success
setDataAfterSendActivationSuccess(SendActivationCodeForDoctorAppResponseModel sendActivationCodeForDoctorAppResponseModel) { setDataAfterSendActivationSuccess(CheckActivationCodeForDoctorAppResponseModel sendActivationCodeForDoctorAppResponseModel)async {
print("VerificationCode : " + sendActivationCodeForDoctorAppResponseModel.verificationCode); // print("VerificationCode : " + sendActivationCodeForDoctorAppResponseModel.verificationCode);
// DrAppToastMsg.showSuccesToast("_VerificationCode_ : " + sendActivationCodeForDoctorAppResponseModel.verificationCode); await sharedPref.setString(VIDA_AUTH_TOKEN_ID,
sharedPref.setString(VIDA_AUTH_TOKEN_ID,
sendActivationCodeForDoctorAppResponseModel.vidaAuthTokenID); sendActivationCodeForDoctorAppResponseModel.vidaAuthTokenID);
sharedPref.setString(VIDA_REFRESH_TOKEN_ID, await sharedPref.setString(VIDA_REFRESH_TOKEN_ID,
sendActivationCodeForDoctorAppResponseModel.vidaRefreshTokenID); sendActivationCodeForDoctorAppResponseModel.vidaRefreshTokenID);
sharedPref.setString(LOGIN_TOKEN_ID, await sharedPref.setString(LOGIN_TOKEN_ID,
sendActivationCodeForDoctorAppResponseModel.logInTokenID); sendActivationCodeForDoctorAppResponseModel.authenticationTokenID);
} }
saveObjToString(String key, value) async { saveObjToString(String key, value) async {
@ -312,7 +307,7 @@ class AuthenticationViewModel extends BaseViewModel {
} }
/// add some logic in case of check activation code is success /// add some logic in case of check activation code is success
onCheckActivationCodeSuccess() async { onCheckActivationCodeSuccess({bool isSilentLogin = false}) async {
sharedPref.setString( sharedPref.setString(
TOKEN, TOKEN,
checkActivationCodeForDoctorAppRes.authenticationTokenID); checkActivationCodeForDoctorAppRes.authenticationTokenID);
@ -359,17 +354,12 @@ class AuthenticationViewModel extends BaseViewModel {
if (Platform.isIOS) { if (Platform.isIOS) {
_firebaseMessaging.requestNotificationPermissions(); _firebaseMessaging.requestNotificationPermissions();
} }
try {
setState(ViewState.Busy); setState(ViewState.Busy);
} catch (e) {
Helpers.showErrorToast("fdfdfdfdf"+e.toString());
}
var token = await _firebaseMessaging.getToken(); var token = await _firebaseMessaging.getToken();
if (DEVICE_TOKEN == "") { if (localToken == "") {
DEVICE_TOKEN = token; localToken = token;
await _authService.selectDeviceImei(DEVICE_TOKEN); await _authService.selectDeviceImei(localToken);
if (_authService.hasError) { if (_authService.hasError) {
error = _authService.error; error = _authService.error;
setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);
@ -378,6 +368,10 @@ class AuthenticationViewModel extends BaseViewModel {
user =_authService.dashboardItemsList[0]; user =_authService.dashboardItemsList[0];
sharedPref.setObj( sharedPref.setObj(
LAST_LOGIN_USER, _authService.dashboardItemsList[0]); LAST_LOGIN_USER, _authService.dashboardItemsList[0]);
await sharedPref.setString(VIDA_REFRESH_TOKEN_ID,
user.vidaRefreshTokenID);
await sharedPref.setString(VIDA_AUTH_TOKEN_ID,
user.vidaAuthTokenID);
this.unverified = true; this.unverified = true;
} }
setState(ViewState.Idle); setState(ViewState.Idle);
@ -390,22 +384,22 @@ class AuthenticationViewModel extends BaseViewModel {
/// determine the status of the app /// determine the status of the app
APP_STATUS get status { APP_STATUS get status {
if (state == ViewState.Busy) { if (state == ViewState.Busy) {
app_status = APP_STATUS.LOADING; appStatus = APP_STATUS.LOADING;
} else { } else {
if(this.doctorProfile !=null) if(this.doctorProfile !=null)
app_status = APP_STATUS.AUTHENTICATED; appStatus = APP_STATUS.AUTHENTICATED;
else if (this.unverified) { else if (this.unverified) {
app_status = APP_STATUS.UNVERIFIED; appStatus = APP_STATUS.UNVERIFIED;
} else if (this.isLogin) { } else if (this.isLogin) {
app_status = APP_STATUS.AUTHENTICATED; appStatus = APP_STATUS.AUTHENTICATED;
} else { } else {
app_status = APP_STATUS.UNAUTHENTICATED; appStatus = APP_STATUS.UNAUTHENTICATED;
} }
} }
return app_status; return appStatus;
} }
setAppStatus(APP_STATUS status){ setAppStatus(APP_STATUS status){
this.app_status = status; this.appStatus = status;
notifyListeners(); notifyListeners();
} }
@ -419,7 +413,7 @@ class AuthenticationViewModel extends BaseViewModel {
logout({bool isFromLogin = false}) async { logout({bool isFromLogin = false}) async {
DEVICE_TOKEN = ""; localToken = "";
String lang = await sharedPref.getString(APP_Language); String lang = await sharedPref.getString(APP_Language);
await Helpers.clearSharedPref(); await Helpers.clearSharedPref();
doctorProfile = null; doctorProfile = null;
@ -427,7 +421,7 @@ class AuthenticationViewModel extends BaseViewModel {
deleteUser(); deleteUser();
await getDeviceInfoFromFirebase(); await getDeviceInfoFromFirebase();
this.isFromLogin = isFromLogin; this.isFromLogin = isFromLogin;
app_status = APP_STATUS.UNAUTHENTICATED; appStatus = APP_STATUS.UNAUTHENTICATED;
setState(ViewState.Idle); setState(ViewState.Idle);
} }

@ -44,8 +44,8 @@ class DashboardViewModel extends BaseViewModel {
_firebaseMessaging.getToken().then((String token) async { _firebaseMessaging.getToken().then((String token) async {
if (token != '') { if (token != '') {
DEVICE_TOKEN = token; // DEVICE_TOKEN = token;
authProvider.insertDeviceImei(); authProvider.insertDeviceImei(token);
} }
}); });
} }

@ -432,8 +432,7 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
Helpers.showErrorToast(authenticationViewModel.error); Helpers.showErrorToast(authenticationViewModel.error);
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
} else { } else {
authenticationViewModel.setDataAfterSendActivationSuccess(authenticationViewModel.activationCodeForDoctorAppRes);
sharedPref.setString(PASSWORD, authenticationViewModel.userInfo.password);
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
this.startSMSService(authMethodType); this.startSMSService(authMethodType);
} }
@ -454,13 +453,14 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
Helpers.showErrorToast(authenticationViewModel.error); Helpers.showErrorToast(authenticationViewModel.error);
} else { } else {
authenticationViewModel.setDataAfterSendActivationSuccess(authenticationViewModel.activationCodeVerificationScreenRes); await sharedPref.setString(LOGIN_TOKEN_ID,
authenticationViewModel.activationCodeVerificationScreenRes.logInTokenID);
if (authMethodType == AuthMethodTypes.SMS || if (authMethodType == AuthMethodTypes.SMS ||
authMethodType == AuthMethodTypes.WhatsApp) { authMethodType == AuthMethodTypes.WhatsApp) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
this.startSMSService(authMethodType); this.startSMSService(authMethodType);
} else { } else {
checkActivationCode(); checkActivationCode(isSilentLogin: true);
} }
} }
} }
@ -541,8 +541,8 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
} }
} }
checkActivationCode({String value}) async { checkActivationCode({String value,bool isSilentLogin = false}) async {
await authenticationViewModel.checkActivationCodeForDoctorApp(activationCode: value); await authenticationViewModel.checkActivationCodeForDoctorApp(activationCode: value,isSilentLogin: isSilentLogin);
if (authenticationViewModel.state == ViewState.ErrorLocal) { if (authenticationViewModel.state == ViewState.ErrorLocal) {
Navigator.pop(context); Navigator.pop(context);
Helpers.showErrorToast(authenticationViewModel.error); Helpers.showErrorToast(authenticationViewModel.error);

@ -657,7 +657,7 @@ packages:
name: meta name: meta
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.3.0-nullsafety.4" version: "1.3.0-nullsafety.3"
mime: mime:
dependency: transitive dependency: transitive
description: description:
@ -949,7 +949,7 @@ packages:
name: stack_trace name: stack_trace
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.10.0-nullsafety.2" version: "1.10.0-nullsafety.1"
sticky_headers: sticky_headers:
dependency: "direct main" dependency: "direct main"
description: description:
@ -1147,5 +1147,5 @@ packages:
source: hosted source: hosted
version: "2.2.1" version: "2.2.1"
sdks: sdks:
dart: ">=2.10.0 <=2.11.0-213.1.beta" dart: ">=2.10.0 <2.11.0"
flutter: ">=1.22.0 <2.0.0" flutter: ">=1.22.0 <2.0.0"

Loading…
Cancel
Save