Add enum to verification_methods

auth_refactor
Elham Rababah 5 years ago
parent 53791f1028
commit a3caf023e2

@ -0,0 +1,24 @@
enum AuthMethodTypes { SMS, WhatsApp, Fingerprint,FaceID,MoreOptions }
extension SelectedAuthMethodTypesService on AuthMethodTypes {
// ignore: missing_return
int getTypeIdService() {
switch (this) {
case AuthMethodTypes.SMS:
return 1;
break;
case AuthMethodTypes.WhatsApp:
return 2;
break;
case AuthMethodTypes.Fingerprint:
return 3;
break;
case AuthMethodTypes.FaceID:
return 4;
break;
case AuthMethodTypes.MoreOptions:
return 5;
break;
}
}
}

@ -1,6 +1,7 @@
import 'dart:async'; import 'dart:async';
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/auth_method_types.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
@ -9,7 +10,7 @@ import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
class SMSOTP { class SMSOTP {
final type; final AuthMethodTypes type;
final mobileNo; final mobileNo;
final Function onSuccess; final Function onSuccess;
final Function onFailure; final Function onFailure;
@ -81,7 +82,7 @@ class SMSOTP {
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
type == 1 type == AuthMethodTypes.SMS
? Padding( ? Padding(
child: Icon( child: Icon(
DoctorApp.verify_sms_1, DoctorApp.verify_sms_1,

@ -1,6 +1,7 @@
import 'dart:io' show Platform; import 'dart:io' show Platform;
import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
import 'package:doctor_app_flutter/core/enum/auth_method_types.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/model/imei_details.dart'; import 'package:doctor_app_flutter/core/model/imei_details.dart';
import 'package:doctor_app_flutter/core/viewModel/authentication_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/authentication_view_model.dart';
@ -14,7 +15,7 @@ import 'package:doctor_app_flutter/models/doctor/profile_req_Model.dart';
import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/date-utils.dart';
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/otp/sms-popup.dart'; import 'package:doctor_app_flutter/widgets/auth/sms-popup.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
@ -57,15 +58,16 @@ class _VerificationMethodsState extends State<VerificationMethods> {
final LocalAuthentication auth = LocalAuthentication(); final LocalAuthentication auth = LocalAuthentication();
var _availableBiometrics; var _availableBiometrics;
ProjectViewModel projectsProvider; ProjectViewModel projectsProvider;
var isMoreOption = false; bool isMoreOption = false;
var onlySMSBox = false; bool onlySMSBox = false;
var loginTokenID; var loginTokenID;
DoctorProfileViewModel doctorProfileViewModel;
bool authenticated; bool authenticated;
var fingrePrintBefore; AuthMethodTypes fingrePrintBefore;
var selectedOption; AuthMethodTypes selectedOption;
@override @override
void initState() { void initState() {
@ -97,7 +99,7 @@ class _VerificationMethodsState extends State<VerificationMethods> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
DoctorProfileViewModel authProv = Provider.of<DoctorProfileViewModel>(context); doctorProfileViewModel = Provider.of<DoctorProfileViewModel>(context);
projectsProvider = Provider.of<ProjectViewModel>(context); projectsProvider = Provider.of<ProjectViewModel>(context);
return FutureBuilder( return FutureBuilder(
future: Future.wait([_loggedUserFuture]), future: Future.wait([_loggedUserFuture]),
@ -112,7 +114,7 @@ class _VerificationMethodsState extends State<VerificationMethods> {
} else { } else {
return SingleChildScrollView( return SingleChildScrollView(
child: Container( child: Container(
height: SizeConfig.realScreenHeight * .9, height: SizeConfig.realScreenHeight * .87,
width: SizeConfig.realScreenWidth, width: SizeConfig.realScreenWidth,
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
@ -253,14 +255,16 @@ class _VerificationMethodsState extends State<VerificationMethods> {
Expanded( Expanded(
child: InkWell( child: InkWell(
onTap: () => { onTap: () => {
authenticateUser(3, // TODO check this logic it seem it will create bug to us
true, authProv)
authenticateUser(AuthMethodTypes.Fingerprint,
true)
}, },
child: getButton( child: methodCard(
user.logInTypeID, user.logInTypeID == 4 ?AuthMethodTypes.FaceID:user.logInTypeID == 2?AuthMethodTypes.WhatsApp:user.logInTypeID ==3? AuthMethodTypes.Fingerprint:AuthMethodTypes.SMS
authProv))), ))),
Expanded( Expanded(
child: getButton(5, authProv)) child: methodCard(AuthMethodTypes.MoreOptions))
]), ]),
]) ])
: Column( : Column(
@ -274,11 +278,11 @@ class _VerificationMethodsState extends State<VerificationMethods> {
MainAxisAlignment.center, MainAxisAlignment.center,
children: <Widget>[ children: <Widget>[
Expanded( Expanded(
child: getButton( child: methodCard(
3, authProv)), AuthMethodTypes.Fingerprint)),
Expanded( Expanded(
child: getButton( child: methodCard(
4, authProv)) AuthMethodTypes.FaceID))
], ],
) )
: SizedBox(), : SizedBox(),
@ -287,9 +291,9 @@ class _VerificationMethodsState extends State<VerificationMethods> {
MainAxisAlignment.center, MainAxisAlignment.center,
children: <Widget>[ children: <Widget>[
Expanded( Expanded(
child: getButton(1, authProv)), child: methodCard(AuthMethodTypes.SMS)),
Expanded( Expanded(
child: getButton(2, authProv)) child: methodCard(AuthMethodTypes.WhatsApp))
], ],
), ),
]), ]),
@ -326,14 +330,9 @@ class _VerificationMethodsState extends State<VerificationMethods> {
}); });
} }
bool hideSilentMethods() {
return verificationMethod == 4 || verificationMethod == 3 ? true : false;
}
sendActivationCodeByOtpNotificationType( sendActivationCodeByOtpNotificationType(
oTPSendType, DoctorProfileViewModel authProv) async { AuthMethodTypes authMethodType) async {
// TODO : build enum for verfication method if (authMethodType == AuthMethodTypes.SMS || authMethodType == AuthMethodTypes.WhatsApp) {
if (oTPSendType == 1 || oTPSendType == 2) {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
int projectID = await sharedPref.getInt(PROJECT_ID); int projectID = await sharedPref.getInt(PROJECT_ID);
@ -343,7 +342,7 @@ class _VerificationMethodsState extends State<VerificationMethods> {
memberID: _loggedUser['List_MemberInformation'][0]['MemberID'], memberID: _loggedUser['List_MemberInformation'][0]['MemberID'],
zipCode: _loggedUser['ZipCode'], zipCode: _loggedUser['ZipCode'],
mobileNumber: _loggedUser['MobileNumber'], mobileNumber: _loggedUser['MobileNumber'],
otpSendType: oTPSendType.toString(), otpSendType: authMethodType.getTypeIdService().toString(),
password: widget.password); password: widget.password);
await widget.model await widget.model
.sendActivationCodeForDoctorApp(activationCodeModel); .sendActivationCodeForDoctorApp(activationCodeModel);
@ -358,11 +357,11 @@ class _VerificationMethodsState extends State<VerificationMethods> {
sharedPref.setString(LOGIN_TOKEN_ID, widget.model.activationCodeForDoctorAppRes["LogInTokenID"]); sharedPref.setString(LOGIN_TOKEN_ID, widget.model.activationCodeForDoctorAppRes["LogInTokenID"]);
sharedPref.setString(PASSWORD, widget.password); sharedPref.setString(PASSWORD, widget.password);
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
this.startSMSService(oTPSendType, authProv); this.startSMSService(authMethodType);
} }
} else { } else {
// TODO route to this page with parameters to inicate we should present 2 option // TODO route to this page with parameters to inicate we should present 2 option
if (Platform.isAndroid && oTPSendType == 3) { if (Platform.isAndroid && authMethodType == AuthMethodTypes.Fingerprint) {
Helpers.showErrorToast('Your device not support this feature'); Helpers.showErrorToast('Your device not support this feature');
} else { } else {
} }
@ -370,7 +369,7 @@ class _VerificationMethodsState extends State<VerificationMethods> {
} }
sendActivationCodeVerificationScreen( sendActivationCodeVerificationScreen(
oTPSendType, DoctorProfileViewModel authProv) async { AuthMethodTypes authMethodType) async {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
ActivationCodeForVerificationScreenModel activationCodeModel = ActivationCodeForVerificationScreenModel( ActivationCodeForVerificationScreenModel activationCodeModel = ActivationCodeForVerificationScreenModel(
iMEI: user.iMEI, iMEI: user.iMEI,
@ -378,7 +377,7 @@ class _VerificationMethodsState extends State<VerificationMethods> {
memberID: user.doctorID, memberID: user.doctorID,
zipCode: user.outSA == true ? '971' : '966', zipCode: user.outSA == true ? '971' : '966',
mobileNumber: user.mobile, mobileNumber: user.mobile,
oTPSendType: oTPSendType, oTPSendType: authMethodType ==AuthMethodTypes.FaceID?4:authMethodType ==AuthMethodTypes.Fingerprint?3:authMethodType ==AuthMethodTypes.WhatsApp?2:1,
isMobileFingerPrint: 1, isMobileFingerPrint: 1,
vidaAuthTokenID: user.vidaAuthTokenID, vidaAuthTokenID: user.vidaAuthTokenID,
vidaRefreshTokenID: user.vidaRefreshTokenID); vidaRefreshTokenID: user.vidaRefreshTokenID);
@ -395,20 +394,20 @@ class _VerificationMethodsState extends State<VerificationMethods> {
sharedPref.setString( sharedPref.setString(
VIDA_REFRESH_TOKEN_ID, widget.model.activationCodeVerificationScreenRes["VidaRefreshTokenID"]); VIDA_REFRESH_TOKEN_ID, widget.model.activationCodeVerificationScreenRes["VidaRefreshTokenID"]);
sharedPref.setString(LOGIN_TOKEN_ID, widget.model.activationCodeVerificationScreenRes["LogInTokenID"]); sharedPref.setString(LOGIN_TOKEN_ID, widget.model.activationCodeVerificationScreenRes["LogInTokenID"]);
if (oTPSendType == 1 || oTPSendType == 2) { if (authMethodType == AuthMethodTypes.SMS || authMethodType == AuthMethodTypes.WhatsApp) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
this.startSMSService(oTPSendType, authProv); this.startSMSService(authMethodType);
} else { } else {
checkActivationCode(authProv); checkActivationCode();
} }
} }
} }
Widget getButton(flag, authProv) { Widget methodCard(AuthMethodTypes authMethodType) {
switch (flag) { switch (authMethodType) {
case 2: case AuthMethodTypes.WhatsApp:
return InkWell( return InkWell(
onTap: () => {authenticateUser(2, true, authProv)}, onTap: () => {authenticateUser(AuthMethodTypes.WhatsApp, true)},
child: Container( child: Container(
margin: EdgeInsets.all(10), margin: EdgeInsets.all(10),
decoration: BoxDecoration( decoration: BoxDecoration(
@ -442,9 +441,9 @@ class _VerificationMethodsState extends State<VerificationMethods> {
), ),
))); )));
break; break;
case 1: case AuthMethodTypes.SMS:
return InkWell( return InkWell(
onTap: () => {authenticateUser(1, true, authProv)}, onTap: () => {authenticateUser(AuthMethodTypes.SMS, true)},
child: Container( child: Container(
margin: EdgeInsets.all(10), margin: EdgeInsets.all(10),
decoration: BoxDecoration( decoration: BoxDecoration(
@ -462,11 +461,7 @@ class _VerificationMethodsState extends State<VerificationMethods> {
height: 60, height: 60,
width: 60, width: 60,
), ),
projectsProvider.isArabic SizedBox(
? SizedBox(
height: 20,
)
: SizedBox(
height: 20, height: 20,
), ),
AppText( AppText(
@ -478,11 +473,11 @@ class _VerificationMethodsState extends State<VerificationMethods> {
), ),
))); )));
break; break;
case 3: case AuthMethodTypes.Fingerprint:
return InkWell( return InkWell(
onTap: () => { onTap: () => {
if (checkIfBiometricAvailable(BiometricType.fingerprint)) if (checkIfBiometricAvailable(BiometricType.fingerprint))
{authenticateUser(3, true, authProv)} {authenticateUser(AuthMethodTypes.Fingerprint, true)}
}, },
child: Container( child: Container(
margin: EdgeInsets.all(10), margin: EdgeInsets.all(10),
@ -513,11 +508,11 @@ class _VerificationMethodsState extends State<VerificationMethods> {
), ),
))); )));
break; break;
case 4: case AuthMethodTypes.FaceID:
return InkWell( return InkWell(
onTap: () { onTap: () {
if (checkIfBiometricAvailable(BiometricType.face)) { if (checkIfBiometricAvailable(BiometricType.face)) {
authenticateUser(4, true, authProv); authenticateUser(AuthMethodTypes.FaceID, true);
} }
}, },
child: child:
@ -622,41 +617,32 @@ class _VerificationMethodsState extends State<VerificationMethods> {
return isAvailable; return isAvailable;
} }
formatDate(date) {
return DateFormat('MMM dd, yyy, kk:mm').format(date);
}
authenticateUser(type, isActive, authProv) { authenticateUser( AuthMethodTypes authMethodType, isActive) {
//GifLoaderDialogUtils.showMyDialog(context); if (authMethodType == AuthMethodTypes.Fingerprint || authMethodType == AuthMethodTypes.FaceID) {
if (type == 3 || type == 4) { fingrePrintBefore = authMethodType;
fingrePrintBefore = type;
} }
this.selectedOption = fingrePrintBefore != null ? fingrePrintBefore : type; this.selectedOption = fingrePrintBefore != null ? fingrePrintBefore : authMethodType;
switch (type) { switch (authMethodType) {
case 1: case AuthMethodTypes.SMS:
this.loginWithSMS(1, isActive, authProv); sendActivationCode(authMethodType);
break; break;
case 2: case AuthMethodTypes.WhatsApp:
this.loginWithSMS(2, isActive, authProv); sendActivationCode(authMethodType);
break; break;
case 3: case AuthMethodTypes.Fingerprint:
this.loginWithFingurePrintFace(3, isActive, authProv); this.loginWithFingerPrintOrFaceID(AuthMethodTypes.Fingerprint, isActive);
break; break;
case 4: case AuthMethodTypes.FaceID:
this.loginWithFingurePrintFace(4, isActive, authProv); this.loginWithFingerPrintOrFaceID(AuthMethodTypes.FaceID, isActive);
break; break;
default: default:
break; break;
} }
sharedPref.setInt(OTP_TYPE, selectedOption); sharedPref.setInt(OTP_TYPE, selectedOption.getTypeIdService());
// sharedPref.setInt(LAST_LOGIN),
} }
loginWithSMS(type, isActive, authProv) {
this.sendActivationCode(type, authProv);
}
Future<void> _getAvailableBiometrics() async { Future<void> _getAvailableBiometrics() async {
var availableBiometrics; var availableBiometrics;
@ -672,15 +658,15 @@ class _VerificationMethodsState extends State<VerificationMethods> {
}); });
} }
sendActivationCode(type, authProv) async { sendActivationCode(AuthMethodTypes authMethodType) async {
if (user != null) { if (user != null) {
sendActivationCodeVerificationScreen(type, authProv); sendActivationCodeVerificationScreen(authMethodType);
} else { } else {
sendActivationCodeByOtpNotificationType(type, authProv); sendActivationCodeByOtpNotificationType(authMethodType);
} }
} }
startSMSService(type, authProv) { startSMSService(AuthMethodTypes type) {
new SMSOTP( new SMSOTP(
context, context,
type, type,
@ -694,7 +680,7 @@ class _VerificationMethodsState extends State<VerificationMethods> {
); );
}); });
this.checkActivationCode(authProv, value: value); this.checkActivationCode(value: value);
}, },
() => { () => {
widget.changeLoadingState(false), widget.changeLoadingState(false),
@ -703,10 +689,8 @@ class _VerificationMethodsState extends State<VerificationMethods> {
).displayDialog(context); ).displayDialog(context);
} }
loginWithFingurePrintFace(type, isActive, authProv) async { loginWithFingerPrintOrFaceID(AuthMethodTypes authMethodTypes, isActive) async {
if (isActive) { if (isActive) {
// this.startBiometricLoginIfAvailable();
const iosStrings = const IOSAuthMessages( const iosStrings = const IOSAuthMessages(
cancelButton: 'cancel', cancelButton: 'cancel',
goToSettingsButton: 'settings', goToSettingsButton: 'settings',
@ -724,8 +708,7 @@ class _VerificationMethodsState extends State<VerificationMethods> {
} }
if (!mounted) return; if (!mounted) return;
if (user != null && (user.logInTypeID == 3 || user.logInTypeID == 4)) { if (user != null && (user.logInTypeID == 3 || user.logInTypeID == 4)) {
this.sendActivationCode(type, authProv); this.sendActivationCode(authMethodTypes);
// this.checkActivationCode(authProv);
} else { } else {
setState(() { setState(() {
this.onlySMSBox = true; this.onlySMSBox = true;
@ -734,7 +717,7 @@ class _VerificationMethodsState extends State<VerificationMethods> {
} }
} }
checkActivationCode(DoctorProfileViewModel authProv, {value}) async { checkActivationCode( {value}) async {
CheckActivationCodeRequestModel checkActivationCodeForDoctorApp = CheckActivationCodeRequestModel checkActivationCodeForDoctorApp =
new CheckActivationCodeRequestModel( new CheckActivationCodeRequestModel(
zipCode: zipCode:
@ -756,44 +739,20 @@ class _VerificationMethodsState extends State<VerificationMethods> {
} else { } else {
sharedPref.setString(TOKEN, widget.model.checkActivationCodeForDoctorAppRes['AuthenticationTokenID']); sharedPref.setString(TOKEN, widget.model.checkActivationCodeForDoctorAppRes['AuthenticationTokenID']);
if (widget.model.checkActivationCodeForDoctorAppRes['List_DoctorProfile'] != null) { if (widget.model.checkActivationCodeForDoctorAppRes['List_DoctorProfile'] != null) {
loginProcessCompleted(widget.model.checkActivationCodeForDoctorAppRes['List_DoctorProfile'][0], authProv); loginProcessCompleted(widget.model.checkActivationCodeForDoctorAppRes['List_DoctorProfile'][0]);
sharedPref.setObj(CLINIC_NAME, widget.model.checkActivationCodeForDoctorAppRes['List_DoctorsClinic']); sharedPref.setObj(CLINIC_NAME, widget.model.checkActivationCodeForDoctorAppRes['List_DoctorsClinic']);
} else { } else {
sharedPref.setObj(CLINIC_NAME, widget.model.checkActivationCodeForDoctorAppRes['List_DoctorsClinic']); sharedPref.setObj(CLINIC_NAME, widget.model.checkActivationCodeForDoctorAppRes['List_DoctorsClinic']);
ClinicModel clinic = ClinicModel clinic =
ClinicModel.fromJson(widget.model.checkActivationCodeForDoctorAppRes['List_DoctorsClinic'][0]); ClinicModel.fromJson(widget.model.checkActivationCodeForDoctorAppRes['List_DoctorsClinic'][0]);
getDocProfiles(clinic, authProv); getDocProfiles(clinic);
} }
} }
}
// authProv
// .checkActivationCodeForDoctorApp(checkActivationCodeForDoctorApp) loginProcessCompleted(Map<String, dynamic> profile) {
// .then((res) async {
// widget.changeLoadingState(false);
// if (res['MessageStatus'] == 1) {
// sharedPref.setString(TOKEN, res['AuthenticationTokenID']);
// if (res['List_DoctorProfile'] != null) {
// loginProcessCompleted(res['List_DoctorProfile'][0], authProv);
// sharedPref.setObj(CLINIC_NAME, res['List_DoctorsClinic']);
// } else {
// sharedPref.setObj(CLINIC_NAME, res['List_DoctorsClinic']);
// ClinicModel clinic =
// ClinicModel.fromJson(res['List_DoctorsClinic'][0]);
// getDocProfiles(clinic, authProv);
// }
// } else {
// Navigator.pop(context);
// Helpers.showErrorToast(res['ErrorEndUserMessage']);
// }
// }).catchError((err) {
// Navigator.pop(context);
// Helpers.showErrorToast(err);
// });
}
loginProcessCompleted(Map<String, dynamic> profile, authProv) {
var doctor = DoctorProfileModel.fromJson(profile); var doctor = DoctorProfileModel.fromJson(profile);
authProv.setDoctorProfile(doctor); doctorProfileViewModel.setDoctorProfile(doctor);
sharedPref.setObj(DOCTOR_PROFILE, profile); sharedPref.setObj(DOCTOR_PROFILE, profile);
projectsProvider.isLogin = true; projectsProvider.isLogin = true;
@ -805,7 +764,7 @@ class _VerificationMethodsState extends State<VerificationMethods> {
(r) => false); (r) => false);
} }
getDocProfiles(ClinicModel clinicInfo, authProv) { getDocProfiles(ClinicModel clinicInfo) {
ProfileReqModel docInfo = new ProfileReqModel( ProfileReqModel docInfo = new ProfileReqModel(
doctorID: clinicInfo.doctorID, doctorID: clinicInfo.doctorID,
clinicID: clinicInfo.clinicID, clinicID: clinicInfo.clinicID,
@ -813,15 +772,14 @@ class _VerificationMethodsState extends State<VerificationMethods> {
projectID: clinicInfo.projectID, projectID: clinicInfo.projectID,
tokenID: '', tokenID: '',
languageID: 2); languageID: 2);
authProv.getDocProfiles(docInfo.toJson()).then((res) { doctorProfileViewModel.getDocProfiles(docInfo.toJson()).then((res) {
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
loginProcessCompleted(res['DoctorProfileList'][0], authProv); loginProcessCompleted(res['DoctorProfileList'][0]);
} else { } else {
// changeLoadingState(false); // changeLoadingState(false);
Helpers.showErrorToast(res['ErrorEndUserMessage']); Helpers.showErrorToast(res['ErrorEndUserMessage']);
} }
}).catchError((err) { }).catchError((err) {
// changeLoadingState(false);
Helpers.showErrorToast(err); Helpers.showErrorToast(err);
}); });
} }

Loading…
Cancel
Save