|
|
|
@ -4,8 +4,8 @@ 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/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/viewModel/authentication_view_model.dart';
|
|
|
|
import 'package:doctor_app_flutter/core/viewModel/authentication_view_model.dart';
|
|
|
|
|
|
|
|
import 'package:doctor_app_flutter/core/viewModel/doctor_profile_view_model.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/screens/base/base_view.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/translations_delegate_base.dart';
|
|
|
|
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
|
|
|
|
import 'package:doctor_app_flutter/widgets/auth/sms-popup.dart';
|
|
|
|
import 'package:doctor_app_flutter/widgets/auth/sms-popup.dart';
|
|
|
|
@ -19,7 +19,6 @@ import 'package:hexcolor/hexcolor.dart';
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
|
|
|
|
|
|
|
|
import '../../config/size_config.dart';
|
|
|
|
import '../../config/size_config.dart';
|
|
|
|
import '../../core/viewModel/doctor_profile_view_model.dart';
|
|
|
|
|
|
|
|
import '../../landing_page.dart';
|
|
|
|
import '../../landing_page.dart';
|
|
|
|
import '../../routes.dart';
|
|
|
|
import '../../routes.dart';
|
|
|
|
import '../../util/dr_app_shared_pref.dart';
|
|
|
|
import '../../util/dr_app_shared_pref.dart';
|
|
|
|
@ -46,20 +45,17 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
|
|
|
|
DoctorProfileViewModel doctorProfileViewModel;
|
|
|
|
DoctorProfileViewModel doctorProfileViewModel;
|
|
|
|
AuthMethodTypes fingerPrintBefore;
|
|
|
|
AuthMethodTypes fingerPrintBefore;
|
|
|
|
AuthMethodTypes selectedOption;
|
|
|
|
AuthMethodTypes selectedOption;
|
|
|
|
AuthenticationViewModel model;
|
|
|
|
AuthenticationViewModel authenticationViewModel;
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
doctorProfileViewModel = Provider.of<DoctorProfileViewModel>(context);
|
|
|
|
doctorProfileViewModel = Provider.of<DoctorProfileViewModel>(context);
|
|
|
|
projectsProvider = Provider.of<ProjectViewModel>(context);
|
|
|
|
projectsProvider = Provider.of<ProjectViewModel>(context);
|
|
|
|
return BaseView<AuthenticationViewModel>(
|
|
|
|
authenticationViewModel = Provider.of<AuthenticationViewModel>(context);
|
|
|
|
onModelReady: (model) async {
|
|
|
|
|
|
|
|
this.model = model;
|
|
|
|
return AppScaffold(
|
|
|
|
await model.getInitUserInfo();
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
builder: (_, model, w) => AppScaffold(
|
|
|
|
|
|
|
|
isShowAppBar: false,
|
|
|
|
isShowAppBar: false,
|
|
|
|
baseViewModel: model,
|
|
|
|
// baseViewModel: model,
|
|
|
|
body: SingleChildScrollView(
|
|
|
|
body: SingleChildScrollView(
|
|
|
|
child: Center(
|
|
|
|
child: Center(
|
|
|
|
child: FractionallySizedBox(
|
|
|
|
child: FractionallySizedBox(
|
|
|
|
@ -77,7 +73,7 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
|
|
|
|
SizedBox(
|
|
|
|
SizedBox(
|
|
|
|
height: 100,
|
|
|
|
height: 100,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
model.user != null && isMoreOption == false
|
|
|
|
authenticationViewModel.user != null && isMoreOption == false
|
|
|
|
? Column(
|
|
|
|
? Column(
|
|
|
|
mainAxisAlignment:
|
|
|
|
mainAxisAlignment:
|
|
|
|
MainAxisAlignment.spaceEvenly,
|
|
|
|
MainAxisAlignment.spaceEvenly,
|
|
|
|
@ -86,7 +82,7 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
|
|
|
|
AppText(
|
|
|
|
AppText(
|
|
|
|
TranslationBase.of(context).welcomeBack),
|
|
|
|
TranslationBase.of(context).welcomeBack),
|
|
|
|
AppText(
|
|
|
|
AppText(
|
|
|
|
Helpers.capitalize(model.user.doctorName),
|
|
|
|
Helpers.capitalize(authenticationViewModel.user.doctorName),
|
|
|
|
fontSize: SizeConfig.textMultiplier * 3.5,
|
|
|
|
fontSize: SizeConfig.textMultiplier * 3.5,
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
@ -121,8 +117,8 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
|
|
|
|
fontSize: 14),
|
|
|
|
fontSize: 14),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
subtitle: AppText(
|
|
|
|
subtitle: AppText(
|
|
|
|
model.getType(
|
|
|
|
authenticationViewModel.getType(
|
|
|
|
model.user
|
|
|
|
authenticationViewModel.user
|
|
|
|
.logInTypeID,
|
|
|
|
.logInTypeID,
|
|
|
|
context),
|
|
|
|
context),
|
|
|
|
fontSize: 14,
|
|
|
|
fontSize: 14,
|
|
|
|
@ -131,17 +127,16 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
|
|
|
|
flex: 2,
|
|
|
|
flex: 2,
|
|
|
|
child: ListTile(
|
|
|
|
child: ListTile(
|
|
|
|
title: AppText(
|
|
|
|
title: AppText(
|
|
|
|
model.user.editedOn !=
|
|
|
|
authenticationViewModel.user.editedOn !=
|
|
|
|
null
|
|
|
|
null
|
|
|
|
? DateUtils.getDayMonthYearDateFormatted(
|
|
|
|
? DateUtils.getDayMonthYearDateFormatted(
|
|
|
|
DateUtils.convertStringToDate(
|
|
|
|
DateUtils.convertStringToDate(
|
|
|
|
model.user
|
|
|
|
authenticationViewModel.user
|
|
|
|
.editedOn))
|
|
|
|
.editedOn))
|
|
|
|
: model.user.createdOn !=
|
|
|
|
: authenticationViewModel.user.createdOn !=
|
|
|
|
null
|
|
|
|
null
|
|
|
|
? DateUtils.getDayMonthYearDateFormatted(
|
|
|
|
? DateUtils.getDayMonthYearDateFormatted(
|
|
|
|
DateUtils.convertStringToDate(model
|
|
|
|
DateUtils.convertStringToDate(authenticationViewModel.user
|
|
|
|
.user
|
|
|
|
|
|
|
|
.createdOn))
|
|
|
|
.createdOn))
|
|
|
|
: '--',
|
|
|
|
: '--',
|
|
|
|
textAlign:
|
|
|
|
textAlign:
|
|
|
|
@ -151,17 +146,16 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
|
|
|
|
FontWeight.w800,
|
|
|
|
FontWeight.w800,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
subtitle: AppText(
|
|
|
|
subtitle: AppText(
|
|
|
|
model.user.editedOn !=
|
|
|
|
authenticationViewModel.user.editedOn !=
|
|
|
|
null
|
|
|
|
null
|
|
|
|
? DateUtils.getHour(
|
|
|
|
? DateUtils.getHour(
|
|
|
|
DateUtils.convertStringToDate(
|
|
|
|
DateUtils.convertStringToDate(
|
|
|
|
model.user
|
|
|
|
authenticationViewModel.user
|
|
|
|
.editedOn))
|
|
|
|
.editedOn))
|
|
|
|
: model.user.createdOn !=
|
|
|
|
: authenticationViewModel.user.createdOn !=
|
|
|
|
null
|
|
|
|
null
|
|
|
|
? DateUtils.getHour(
|
|
|
|
? DateUtils.getHour(
|
|
|
|
DateUtils.convertStringToDate(model
|
|
|
|
DateUtils.convertStringToDate(authenticationViewModel.user
|
|
|
|
.user
|
|
|
|
|
|
|
|
.createdOn))
|
|
|
|
.createdOn))
|
|
|
|
: '--',
|
|
|
|
: '--',
|
|
|
|
textAlign:
|
|
|
|
textAlign:
|
|
|
|
@ -194,7 +188,7 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
|
|
|
|
textAlign: TextAlign.start,
|
|
|
|
textAlign: TextAlign.start,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
]),
|
|
|
|
]),
|
|
|
|
model.user != null && isMoreOption == false
|
|
|
|
authenticationViewModel.user != null && isMoreOption == false
|
|
|
|
? Column(
|
|
|
|
? Column(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
@ -213,10 +207,10 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
|
|
|
|
.Fingerprint, true)
|
|
|
|
.Fingerprint, true)
|
|
|
|
},
|
|
|
|
},
|
|
|
|
child: VerificationMethodsList(
|
|
|
|
child: VerificationMethodsList(
|
|
|
|
model: model,
|
|
|
|
authenticationViewModel:authenticationViewModel,
|
|
|
|
authMethodType: SelectedAuthMethodTypesService
|
|
|
|
authMethodType: SelectedAuthMethodTypesService
|
|
|
|
.getMethodsTypeService(
|
|
|
|
.getMethodsTypeService(
|
|
|
|
model.user
|
|
|
|
authenticationViewModel.user
|
|
|
|
.logInTypeID),
|
|
|
|
.logInTypeID),
|
|
|
|
authenticateUser:
|
|
|
|
authenticateUser:
|
|
|
|
(AuthMethodTypes
|
|
|
|
(AuthMethodTypes
|
|
|
|
@ -229,7 +223,7 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Expanded(
|
|
|
|
Expanded(
|
|
|
|
child: VerificationMethodsList(
|
|
|
|
child: VerificationMethodsList(
|
|
|
|
model: model,
|
|
|
|
authenticationViewModel:authenticationViewModel,
|
|
|
|
authMethodType:
|
|
|
|
authMethodType:
|
|
|
|
AuthMethodTypes.MoreOptions,
|
|
|
|
AuthMethodTypes.MoreOptions,
|
|
|
|
onShowMore: () {
|
|
|
|
onShowMore: () {
|
|
|
|
@ -251,7 +245,7 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
|
|
|
|
children: <Widget>[
|
|
|
|
children: <Widget>[
|
|
|
|
Expanded(
|
|
|
|
Expanded(
|
|
|
|
child: VerificationMethodsList(
|
|
|
|
child: VerificationMethodsList(
|
|
|
|
model: model,
|
|
|
|
authenticationViewModel:authenticationViewModel,
|
|
|
|
authMethodType:
|
|
|
|
authMethodType:
|
|
|
|
AuthMethodTypes.Fingerprint,
|
|
|
|
AuthMethodTypes.Fingerprint,
|
|
|
|
authenticateUser:
|
|
|
|
authenticateUser:
|
|
|
|
@ -264,7 +258,7 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
|
|
|
|
)),
|
|
|
|
)),
|
|
|
|
Expanded(
|
|
|
|
Expanded(
|
|
|
|
child: VerificationMethodsList(
|
|
|
|
child: VerificationMethodsList(
|
|
|
|
model: model,
|
|
|
|
authenticationViewModel:authenticationViewModel,
|
|
|
|
authMethodType:
|
|
|
|
authMethodType:
|
|
|
|
AuthMethodTypes.FaceID,
|
|
|
|
AuthMethodTypes.FaceID,
|
|
|
|
authenticateUser:
|
|
|
|
authenticateUser:
|
|
|
|
@ -284,7 +278,7 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
|
|
|
|
children: <Widget>[
|
|
|
|
children: <Widget>[
|
|
|
|
Expanded(
|
|
|
|
Expanded(
|
|
|
|
child: VerificationMethodsList(
|
|
|
|
child: VerificationMethodsList(
|
|
|
|
model: model,
|
|
|
|
authenticationViewModel:authenticationViewModel,
|
|
|
|
authMethodType: AuthMethodTypes
|
|
|
|
authMethodType: AuthMethodTypes
|
|
|
|
.SMS,
|
|
|
|
.SMS,
|
|
|
|
authenticateUser:
|
|
|
|
authenticateUser:
|
|
|
|
@ -296,7 +290,7 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
|
|
|
|
)),
|
|
|
|
)),
|
|
|
|
Expanded(
|
|
|
|
Expanded(
|
|
|
|
child: VerificationMethodsList(
|
|
|
|
child: VerificationMethodsList(
|
|
|
|
model: model,
|
|
|
|
authenticationViewModel:authenticationViewModel,
|
|
|
|
authMethodType:
|
|
|
|
authMethodType:
|
|
|
|
AuthMethodTypes.WhatsApp,
|
|
|
|
AuthMethodTypes.WhatsApp,
|
|
|
|
authenticateUser:
|
|
|
|
authenticateUser:
|
|
|
|
@ -320,7 +314,7 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
bottomSheet: model.user == null ? SizedBox(height: 0,) : Container(
|
|
|
|
bottomSheet: authenticationViewModel.user == null ? SizedBox(height: 0,) : Container(
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
color: Colors.white,
|
|
|
|
color: Colors.white,
|
|
|
|
borderRadius: BorderRadius.all(
|
|
|
|
borderRadius: BorderRadius.all(
|
|
|
|
@ -353,8 +347,6 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),),
|
|
|
|
),),
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ -365,12 +357,12 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await model.sendActivationCodeForDoctorApp(authMethodType:authMethodType, password: widget.password );
|
|
|
|
await authenticationViewModel.sendActivationCodeForDoctorApp(authMethodType:authMethodType, password: widget.password );
|
|
|
|
if (model.state == ViewState.ErrorLocal) {
|
|
|
|
if (authenticationViewModel.state == ViewState.ErrorLocal) {
|
|
|
|
Helpers.showErrorToast(model.error);
|
|
|
|
Helpers.showErrorToast(authenticationViewModel.error);
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
model.setDataAfterSendActivationSuccsess(model.activationCodeForDoctorAppRes);
|
|
|
|
authenticationViewModel.setDataAfterSendActivationSuccsess(authenticationViewModel.activationCodeForDoctorAppRes);
|
|
|
|
sharedPref.setString(PASSWORD, widget.password);
|
|
|
|
sharedPref.setString(PASSWORD, widget.password);
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
this.startSMSService(authMethodType);
|
|
|
|
this.startSMSService(authMethodType);
|
|
|
|
@ -385,14 +377,14 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
|
|
|
|
|
|
|
|
|
|
|
|
sendActivationCodeVerificationScreen(AuthMethodTypes authMethodType) async {
|
|
|
|
sendActivationCodeVerificationScreen(AuthMethodTypes authMethodType) async {
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
await model
|
|
|
|
await authenticationViewModel
|
|
|
|
.sendActivationCodeVerificationScreen(authMethodType);
|
|
|
|
.sendActivationCodeVerificationScreen(authMethodType);
|
|
|
|
|
|
|
|
|
|
|
|
if (model.state == ViewState.ErrorLocal) {
|
|
|
|
if (authenticationViewModel.state == ViewState.ErrorLocal) {
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
Helpers.showErrorToast(model.error);
|
|
|
|
Helpers.showErrorToast(authenticationViewModel.error);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
model.setDataAfterSendActivationSuccsess(model.activationCodeVerificationScreenRes);
|
|
|
|
authenticationViewModel.setDataAfterSendActivationSuccsess(authenticationViewModel.activationCodeVerificationScreenRes);
|
|
|
|
if (authMethodType == AuthMethodTypes.SMS ||
|
|
|
|
if (authMethodType == AuthMethodTypes.SMS ||
|
|
|
|
authMethodType == AuthMethodTypes.WhatsApp) {
|
|
|
|
authMethodType == AuthMethodTypes.WhatsApp) {
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
@ -432,7 +424,7 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
sendActivationCode(AuthMethodTypes authMethodType) async {
|
|
|
|
sendActivationCode(AuthMethodTypes authMethodType) async {
|
|
|
|
if (model.user != null) {
|
|
|
|
if (authenticationViewModel.user != null) {
|
|
|
|
sendActivationCodeVerificationScreen(authMethodType);
|
|
|
|
sendActivationCodeVerificationScreen(authMethodType);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
sendActivationCodeByOtpNotificationType(authMethodType);
|
|
|
|
sendActivationCodeByOtpNotificationType(authMethodType);
|
|
|
|
@ -444,7 +436,7 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
|
|
|
|
new SMSOTP(
|
|
|
|
new SMSOTP(
|
|
|
|
context,
|
|
|
|
context,
|
|
|
|
type,
|
|
|
|
type,
|
|
|
|
model.loggedUser != null ? model.loggedUser.mobileNumber : model.user.mobile,
|
|
|
|
authenticationViewModel.loggedUser != null ? authenticationViewModel.loggedUser.mobileNumber : authenticationViewModel.user.mobile,
|
|
|
|
(value) {
|
|
|
|
(value) {
|
|
|
|
showDialog(
|
|
|
|
showDialog(
|
|
|
|
context: context,
|
|
|
|
context: context,
|
|
|
|
@ -465,14 +457,14 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
|
|
|
|
loginWithFingerPrintOrFaceID(AuthMethodTypes authMethodTypes,
|
|
|
|
loginWithFingerPrintOrFaceID(AuthMethodTypes authMethodTypes,
|
|
|
|
isActive) async {
|
|
|
|
isActive) async {
|
|
|
|
if (isActive) {
|
|
|
|
if (isActive) {
|
|
|
|
await model.showIOSAuthMessages();
|
|
|
|
await authenticationViewModel.showIOSAuthMessages();
|
|
|
|
if (!mounted) return;
|
|
|
|
if (!mounted) return;
|
|
|
|
if (model.user != null &&
|
|
|
|
if (authenticationViewModel.user != null &&
|
|
|
|
(SelectedAuthMethodTypesService.getMethodsTypeService(
|
|
|
|
(SelectedAuthMethodTypesService.getMethodsTypeService(
|
|
|
|
model.user.logInTypeID) ==
|
|
|
|
authenticationViewModel.user.logInTypeID) ==
|
|
|
|
AuthMethodTypes.Fingerprint ||
|
|
|
|
AuthMethodTypes.Fingerprint ||
|
|
|
|
SelectedAuthMethodTypesService.getMethodsTypeService(
|
|
|
|
SelectedAuthMethodTypesService.getMethodsTypeService(
|
|
|
|
model.user.logInTypeID) == AuthMethodTypes.FaceID)) {
|
|
|
|
authenticationViewModel.user.logInTypeID) == AuthMethodTypes.FaceID)) {
|
|
|
|
this.sendActivationCode(authMethodTypes);
|
|
|
|
this.sendActivationCode(authMethodTypes);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
setState(() {
|
|
|
|
setState(() {
|
|
|
|
@ -483,19 +475,19 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
checkActivationCode({value}) async {
|
|
|
|
checkActivationCode({value}) async {
|
|
|
|
await model.checkActivationCodeForDoctorApp(activationCode: value);
|
|
|
|
await authenticationViewModel.checkActivationCodeForDoctorApp(activationCode: value);
|
|
|
|
if (model.state == ViewState.ErrorLocal) {
|
|
|
|
if (authenticationViewModel.state == ViewState.ErrorLocal) {
|
|
|
|
Navigator.pop(context);
|
|
|
|
Navigator.pop(context);
|
|
|
|
Helpers.showErrorToast(model.error);
|
|
|
|
Helpers.showErrorToast(authenticationViewModel.error);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
await model.onCheckActivationCodeSuccess();
|
|
|
|
await authenticationViewModel.onCheckActivationCodeSuccess();
|
|
|
|
navigateToLandingPage();
|
|
|
|
navigateToLandingPage();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
navigateToLandingPage() {
|
|
|
|
navigateToLandingPage() {
|
|
|
|
if (model.state == ViewState.ErrorLocal) {
|
|
|
|
if (authenticationViewModel.state == ViewState.ErrorLocal) {
|
|
|
|
Helpers.showErrorToast(model.error);
|
|
|
|
Helpers.showErrorToast(authenticationViewModel.error);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
projectsProvider.isLogin = true;
|
|
|
|
projectsProvider.isLogin = true;
|
|
|
|
|
|
|
|
|
|
|
|
|