|
|
|
|
@ -13,6 +13,7 @@ import 'package:doctor_app_flutter/widgets/shared/app_loader_widget.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_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/secondary_button.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart';
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
@ -32,10 +33,13 @@ DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
|
|
|
|
|
Helpers helpers = Helpers();
|
|
|
|
|
|
|
|
|
|
class VerificationMethodsScreen extends StatefulWidget {
|
|
|
|
|
VerificationMethodsScreen({this.password});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
final password;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
VerificationMethodsScreen({this.password, });
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
_VerificationMethodsScreenState createState() => _VerificationMethodsScreenState();
|
|
|
|
|
}
|
|
|
|
|
@ -72,9 +76,11 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 80,
|
|
|
|
|
),
|
|
|
|
|
if(authenticationViewModel.isFromLogin)
|
|
|
|
|
InkWell(
|
|
|
|
|
onTap: (){
|
|
|
|
|
Navigator.of(context).pop();
|
|
|
|
|
authenticationViewModel.setUnverified(false,isFromLogin: false);
|
|
|
|
|
authenticationViewModel.setAppStatus(APP_STATUS.UNAUTHENTICATED);
|
|
|
|
|
},
|
|
|
|
|
child: Icon(Icons.arrow_back_ios,color: Color(0xFF2B353E),)
|
|
|
|
|
|
|
|
|
|
@ -392,20 +398,21 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
|
|
|
|
|
child: Column(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.end,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
AppButton(
|
|
|
|
|
title: TranslationBase
|
|
|
|
|
SecondaryButton(
|
|
|
|
|
label: TranslationBase
|
|
|
|
|
.of(context)
|
|
|
|
|
.useAnotherAccount,
|
|
|
|
|
color: Color(0xFFD02127),fontWeight: FontWeight.w700,
|
|
|
|
|
onPressed: () {
|
|
|
|
|
color: Color(0xFFD02127),
|
|
|
|
|
//fontWeight: FontWeight.w700,
|
|
|
|
|
onTap: () {
|
|
|
|
|
authenticationViewModel.deleteUser();
|
|
|
|
|
|
|
|
|
|
Navigator.pushAndRemoveUntil(
|
|
|
|
|
AppGlobal.CONTEX,
|
|
|
|
|
FadePage(
|
|
|
|
|
page: RootPage(),
|
|
|
|
|
),
|
|
|
|
|
(r) => false);
|
|
|
|
|
authenticationViewModel.setAppStatus(APP_STATUS.UNAUTHENTICATED);
|
|
|
|
|
// Navigator.pushAndRemoveUntil(
|
|
|
|
|
// AppGlobal.CONTEX,
|
|
|
|
|
// FadePage(
|
|
|
|
|
// page: RootPage(),
|
|
|
|
|
// ),
|
|
|
|
|
// (r) => false);
|
|
|
|
|
// Navigator.of(context).pushNamed(LOGIN);
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
@ -425,13 +432,13 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
|
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await authenticationViewModel.sendActivationCodeForDoctorApp(authMethodType:authMethodType, password: widget.password );
|
|
|
|
|
await authenticationViewModel.sendActivationCodeForDoctorApp(authMethodType:authMethodType, password: authenticationViewModel.userInfo.password );
|
|
|
|
|
if (authenticationViewModel.state == ViewState.ErrorLocal) {
|
|
|
|
|
Helpers.showErrorToast(authenticationViewModel.error);
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
|
} else {
|
|
|
|
|
authenticationViewModel.setDataAfterSendActivationSuccess(authenticationViewModel.activationCodeForDoctorAppRes);
|
|
|
|
|
sharedPref.setString(PASSWORD, widget.password);
|
|
|
|
|
sharedPref.setString(PASSWORD, authenticationViewModel.userInfo.password);
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
|
this.startSMSService(authMethodType);
|
|
|
|
|
}
|
|
|
|
|
|