fix issues in design

merge-requests/928/head
Elham Rababh 4 years ago
parent 4dcc20b681
commit 3431c353e9

@ -15,37 +15,32 @@ 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/buttons/secondary_button.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/shared/loader/gif_loader_dialog_utils.dart';
import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart'; 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 '../../landing_page.dart';
import '../../root_page.dart';
import '../../routes.dart';
import '../../util/dr_app_shared_pref.dart'; import '../../util/dr_app_shared_pref.dart';
import '../../util/helpers.dart'; import '../../util/helpers.dart';
import '../../widgets/auth/verification_methods_list.dart'; import '../../widgets/auth/verification_methods_list.dart';
import 'login_screen.dart';
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
Helpers helpers = Helpers(); Helpers helpers = Helpers();
///TODO Elham* check if this still in user or not
class VerificationMethodsScreen extends StatefulWidget { class VerificationMethodsScreen extends StatefulWidget {
final password; final password;
VerificationMethodsScreen({
VerificationMethodsScreen({this.password, }); this.password,
});
@override @override
_VerificationMethodsScreenState createState() => _VerificationMethodsScreenState(); _VerificationMethodsScreenState createState() =>
_VerificationMethodsScreenState();
} }
class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> { class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
ProjectViewModel projectsProvider; ProjectViewModel projectsProvider;
bool isMoreOption = false; bool isMoreOption = false;
bool onlySMSBox = false; bool onlySMSBox = false;
@ -58,74 +53,78 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
projectsProvider = Provider.of<ProjectViewModel>(context); projectsProvider = Provider.of<ProjectViewModel>(context);
authenticationViewModel = Provider.of<AuthenticationViewModel>(context); authenticationViewModel = Provider.of<AuthenticationViewModel>(context);
return AppScaffold( return AppScaffold(
isShowAppBar: false, isShowAppBar: false,
backgroundColor: Theme.of(context).scaffoldBackgroundColor, backgroundColor: Theme.of(context).scaffoldBackgroundColor,
// baseViewModel: model,
body: SingleChildScrollView( body: SingleChildScrollView(
child: Center( child: Center(
child: FractionallySizedBox( child: FractionallySizedBox(
child: Container( widthFactor: 0.9,
margin: EdgeInsetsDirectional.fromSTEB(30, 0, 30, 0),
height: SizeConfig.realScreenHeight * .95,
width: SizeConfig.realScreenWidth,
child: SingleChildScrollView( child: SingleChildScrollView(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[ children: <Widget>[
SizedBox( SizedBox(
height: 80, height: SizeConfig.heightMultiplier *
(SizeConfig.isHeightVeryShort ? 6 : 4),
), ),
if (authenticationViewModel.isFromLogin) if (authenticationViewModel.isFromLogin)
InkWell( InkWell(
onTap: () { onTap: () {
authenticationViewModel.setUnverified(false,isFromLogin: false); authenticationViewModel.setUnverified(false,
authenticationViewModel.setAppStatus(APP_STATUS.UNAUTHENTICATED); isFromLogin: false);
authenticationViewModel
.setAppStatus(APP_STATUS.UNAUTHENTICATED);
}, },
child: Icon(Icons.arrow_back_ios,color: Color(0xFF2B353E),) child: Icon(
Icons.arrow_back_ios,
), color: AppGlobal.appTextColor,
Container( )),
Column(
child: Column(
children: <Widget>[ children: <Widget>[
SizedBox( SizedBox(
height: 20, height: SizeConfig.heightMultiplier *
(SizeConfig.isHeightVeryShort ? 3 : 4),
), ),
authenticationViewModel.user != null && isMoreOption == false authenticationViewModel.user != null &&
isMoreOption == false
? Column( ? Column(
mainAxisAlignment: mainAxisAlignment: MainAxisAlignment.spaceEvenly,
MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
AppText( AppText(
TranslationBase.of(context).welcomeBack, TranslationBase.of(context).welcomeBack,
fontSize:12, fontSize: SizeConfig
fontWeight: FontWeight.w700, .getTextMultiplierBasedOnWidth() *
color: Color(0xFF2B353E), 3.5,
fontWeight: FontWeight.w600,
color: AppGlobal.appTextColor,
letterSpacing: -0.72,
), ),
AppText( AppText(
Helpers.capitalize(authenticationViewModel.user.doctorName), Helpers.convertToTitleCase(
fontSize: 24, authenticationViewModel.user.doctorName),
color: Color(0xFF2B353E), fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
6,
color: AppGlobal.appTextColor,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
letterSpacing: -1.44,
), ),
SizedBox( SizedBox(
height: 20, height: SizeConfig.heightMultiplier * 4,
), ),
AppText( AppText(
TranslationBase.of(context).accountInfo, TranslationBase.of(context).accountInfo,
fontSize: 16, fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
4.5,
color: Color(0xFF2E303A), color: Color(0xFF2E303A),
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
letterSpacing: -0.64,
), ),
SizedBox( SizedBox(
height: 20, height: SizeConfig.heightMultiplier * 4),
),
Container( Container(
padding: EdgeInsets.all(15), padding: EdgeInsets.all(15),
decoration: BoxDecoration( decoration: BoxDecoration(
@ -134,125 +133,188 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
Radius.circular(10), Radius.circular(10),
), ),
border: Border.all( border: Border.all(
color: HexColor('#707070'), color: HexColor('#707070'), width: 0.1),
width: 0.1),
), ),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment:
MainAxisAlignment.spaceBetween,
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Column( Container(
width: SizeConfig.realScreenWidth * .5,
padding: EdgeInsets.all(0),
child: Column(
mainAxisAlignment:
MainAxisAlignment.start,
children: [ children: [
Text( Text(
TranslationBase.of(context) TranslationBase.of(context)
.lastLoginAt, .lastLoginAt,
overflow: overflow: TextOverflow.ellipsis,
TextOverflow.ellipsis,
style: TextStyle( style: TextStyle(
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontSize: 16, fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
4.5,
color: Color(0xFF2E303A), color: Color(0xFF2E303A),
fontWeight: FontWeight.w700,),
),
Row(
children: [
AppText(
TranslationBase
.of(context)
.verifyWith,
fontSize: 14,
color: Color(0xFF575757),
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
letterSpacing: -0.4),
), ),
AppText( Container(
authenticationViewModel.getType( width: MediaQuery.of(context)
authenticationViewModel.user .size
.width *
0.55,
child: RichText(
text: TextSpan(
text: TranslationBase.of(
context)
.verifyWith +
':',
style: TextStyle(
color:
Color(0xFF575757),
fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
3.5,
fontFamily: 'Poppins',
fontWeight:
FontWeight.w600,
letterSpacing: -0.4),
children: <TextSpan>[
TextSpan(
text: authenticationViewModel
.getType(
authenticationViewModel
.user
.logInTypeID, .logInTypeID,
context), context),
fontSize: 14, style: TextStyle(
color: Color(0xFF2B353E), color: AppGlobal
.appTextColor,
fontWeight: FontWeight.w700, fontSize: SizeConfig
), .getTextMultiplierBasedOnWidth() *
], 3.5,
fontFamily:
'Poppins',
fontWeight:
FontWeight.w600,
letterSpacing:
-0.48),
) )
]),
),
),
], ],
crossAxisAlignment: CrossAxisAlignment.start,), crossAxisAlignment:
Column(children: [ CrossAxisAlignment.start,
),
),
Column(
mainAxisAlignment:
MainAxisAlignment.start,
children: [
AppText( AppText(
authenticationViewModel.user.editedOn != authenticationViewModel
.user.editedOn !=
null null
? AppDateUtils.getDayMonthYearDateFormatted( ? AppDateUtils
AppDateUtils.convertStringToDate( .getDayMonthYearDateFormatted(
authenticationViewModel.user AppDateUtils
.editedOn)) .convertStringToDate(
: authenticationViewModel.user.createdOn != authenticationViewModel
.user
.editedOn),
isMonthShort: true)
: authenticationViewModel
.user.createdOn !=
null null
? AppDateUtils.getDayMonthYearDateFormatted( ? AppDateUtils.getDayMonthYearDateFormatted(
AppDateUtils.convertStringToDate(authenticationViewModel.user AppDateUtils
.createdOn)) .convertStringToDate(
authenticationViewModel
.user
.createdOn),
isMonthShort: true)
: '--', : '--',
textAlign: textAlign: TextAlign.right,
TextAlign.right, fontSize: SizeConfig
fontSize: 13, .getTextMultiplierBasedOnWidth() *
4.5,
color: Color(0xFF2E303A), color: Color(0xFF2E303A),
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
letterSpacing: -0.48,
), ),
AppText( AppText(
authenticationViewModel.user.editedOn != authenticationViewModel
.user.editedOn !=
null null
? AppDateUtils.getHour( ? AppDateUtils.getHour(AppDateUtils
AppDateUtils.convertStringToDate( .convertStringToDate(
authenticationViewModel.user authenticationViewModel
.editedOn)) .user.editedOn))
: authenticationViewModel.user.createdOn != : authenticationViewModel
.user.createdOn !=
null null
? AppDateUtils.getHour( ? AppDateUtils.getHour(
AppDateUtils.convertStringToDate(authenticationViewModel.user AppDateUtils
.convertStringToDate(
authenticationViewModel
.user
.createdOn)) .createdOn))
: '--', : '--',
textAlign: textAlign: TextAlign.right,
TextAlign.right, fontSize: SizeConfig
fontSize: 14, .getTextMultiplierBasedOnWidth() *
3.5,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
letterSpacing: -0.48,
color: Color(0xFF575757), color: Color(0xFF575757),
) )
], ],
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment:
CrossAxisAlignment.end,
) )
], ],
), ),
), ),
SizedBox( SizedBox(
height: 20, height: SizeConfig.heightMultiplier * 3,
), ),
Row( Row(
children: [ children: [
//todo add translation
AppText( AppText(
"Please Verify", "Please Verify",
fontSize: 16, fontSize: SizeConfig
color: Color(0xFF2B353E), .getTextMultiplierBasedOnWidth() *
4.5,
fontWeight: FontWeight.w700, color: AppGlobal.appTextColor,
fontWeight: FontWeight.w600,
letterSpacing: -.64,
), ),
], ],
) ),
SizedBox(
height: SizeConfig.heightMultiplier * 2,
),
], ],
) )
: Column( : Column(
mainAxisAlignment: mainAxisAlignment: MainAxisAlignment.spaceEvenly,
MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
this.onlySMSBox == false this.onlySMSBox == false
? Container( ? Container(
margin: EdgeInsets.only(bottom: 20, top: 30), margin: EdgeInsets.only(
bottom: 20, top: 30),
child: AppText( child: AppText(
TranslationBase.of(context) TranslationBase.of(context)
.verifyLoginWith, .verifyLoginWith,
fontSize: 18, fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
4,
color: Color(0xFF2E303A), color: Color(0xFF2E303A),
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
textAlign: TextAlign.left, textAlign: TextAlign.left,
@ -261,12 +323,14 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
: AppText( : AppText(
TranslationBase.of(context) TranslationBase.of(context)
.verifyFingerprint2, .verifyFingerprint2,
fontSize: fontSize: SizeConfig
SizeConfig.textMultiplier * 2.5, .getTextMultiplierBasedOnWidth() *
4,
textAlign: TextAlign.start, textAlign: TextAlign.start,
), ),
]), ]),
authenticationViewModel.user != null && isMoreOption == false authenticationViewModel.user != null &&
isMoreOption == false
? Column( ? Column(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
@ -277,18 +341,21 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
children: <Widget>[ children: <Widget>[
Expanded( Expanded(
child: InkWell( child: InkWell(
onTap: () => onTap: () => {
{
// TODO check this logic it seem it will create bug to us // TODO check this logic it seem it will create bug to us
authenticateUser( authenticateUser(
AuthMethodTypes AuthMethodTypes
.Fingerprint, true) .Fingerprint,
true)
}, },
child: VerificationMethodsList( child: VerificationMethodsList(
authenticationViewModel:authenticationViewModel, authenticationViewModel:
authMethodType: SelectedAuthMethodTypesService authenticationViewModel,
authMethodType:
SelectedAuthMethodTypesService
.getMethodsTypeService( .getMethodsTypeService(
authenticationViewModel.user authenticationViewModel
.user
.logInTypeID), .logInTypeID),
authenticateUser: authenticateUser:
(AuthMethodTypes (AuthMethodTypes
@ -301,7 +368,8 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
), ),
Expanded( Expanded(
child: VerificationMethodsList( child: VerificationMethodsList(
authenticationViewModel:authenticationViewModel, authenticationViewModel:
authenticationViewModel,
authMethodType: authMethodType:
AuthMethodTypes.MoreOptions, AuthMethodTypes.MoreOptions,
onShowMore: () { onShowMore: () {
@ -323,57 +391,53 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
children: <Widget>[ children: <Widget>[
Expanded( Expanded(
child: VerificationMethodsList( child: VerificationMethodsList(
authenticationViewModel:authenticationViewModel, authenticationViewModel:
authenticationViewModel,
authMethodType: authMethodType:
AuthMethodTypes.Fingerprint, AuthMethodTypes.Fingerprint,
authenticateUser: authenticateUser: (AuthMethodTypes
(AuthMethodTypes
authMethodType, authMethodType,
isActive) => isActive) =>
authenticateUser( authenticateUser(
authMethodType, authMethodType, isActive),
isActive),
)), )),
Expanded( Expanded(
child: VerificationMethodsList( child: VerificationMethodsList(
authenticationViewModel:authenticationViewModel, authenticationViewModel:
authenticationViewModel,
authMethodType: authMethodType:
AuthMethodTypes.FaceID, AuthMethodTypes.FaceID,
authenticateUser: authenticateUser: (AuthMethodTypes
(AuthMethodTypes
authMethodType, authMethodType,
isActive) => isActive) =>
authenticateUser( authenticateUser(
authMethodType, authMethodType, isActive),
isActive),
)) ))
], ],
) )
: SizedBox(), : SizedBox(),
Row( Row(
mainAxisAlignment: mainAxisAlignment: MainAxisAlignment.center,
MainAxisAlignment.center,
children: <Widget>[ children: <Widget>[
Expanded( Expanded(
child: VerificationMethodsList( child: VerificationMethodsList(
authenticationViewModel:authenticationViewModel, authenticationViewModel:
authMethodType: AuthMethodTypes authenticationViewModel,
.SMS, authMethodType: AuthMethodTypes.SMS,
authenticateUser: authenticateUser:
( (AuthMethodTypes authMethodType,
AuthMethodTypes authMethodType,
isActive) => isActive) =>
authenticateUser( authenticateUser(
authMethodType, isActive), authMethodType, isActive),
)), )),
Expanded( Expanded(
child: VerificationMethodsList( child: VerificationMethodsList(
authenticationViewModel:authenticationViewModel, authenticationViewModel:
authenticationViewModel,
authMethodType: authMethodType:
AuthMethodTypes.WhatsApp, AuthMethodTypes.WhatsApp,
authenticateUser: authenticateUser:
( (AuthMethodTypes authMethodType,
AuthMethodTypes authMethodType,
isActive) => isActive) =>
authenticateUser( authenticateUser(
authMethodType, isActive), authMethodType, isActive),
@ -385,15 +449,17 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
// ) // )
], ],
), ),
),
], ],
), ),
), ),
), ),
), ),
), ),
), bottomSheet: authenticationViewModel.user == null
bottomSheet: authenticationViewModel.user == null ? SizedBox(height: 0,) : Container( ? SizedBox(
height: 0,
)
: Container(
height: 90, height: 90,
width: double.infinity, width: double.infinity,
child: Center( child: Center(
@ -403,22 +469,24 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
mainAxisAlignment: MainAxisAlignment.end, mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[ children: <Widget>[
SecondaryButton( SecondaryButton(
label: TranslationBase label:
.of(context) TranslationBase.of(context).useAnotherAccount ?? '',
.useAnotherAccount,
color: Color(0xFFD02127), color: Color(0xFFD02127),
//fontWeight: FontWeight.w700, //fontWeight: FontWeight.w700,
onTap: () { onTap: () {
authenticationViewModel.deleteUser(); authenticationViewModel.deleteUser();
authenticationViewModel.setAppStatus(APP_STATUS.UNAUTHENTICATED); authenticationViewModel
.setAppStatus(APP_STATUS.UNAUTHENTICATED);
}, },
), ),
SizedBox(
SizedBox(height: 25,) height: 25,
)
], ],
), ),
), ),
),), ),
),
); );
} }
@ -428,13 +496,13 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
authMethodType == AuthMethodTypes.WhatsApp) { authMethodType == AuthMethodTypes.WhatsApp) {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
await authenticationViewModel.sendActivationCodeForDoctorApp(
await authenticationViewModel.sendActivationCodeForDoctorApp(authMethodType:authMethodType, password: authenticationViewModel.userInfo.password ); authMethodType: authMethodType,
password: authenticationViewModel.userInfo.password);
if (authenticationViewModel.state == ViewState.ErrorLocal) { if (authenticationViewModel.state == ViewState.ErrorLocal) {
Helpers.showErrorToast(authenticationViewModel.error); Helpers.showErrorToast(authenticationViewModel.error);
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
} else { } else {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
this.startSMSService(authMethodType); this.startSMSService(authMethodType);
} }
@ -455,8 +523,10 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
Helpers.showErrorToast(authenticationViewModel.error); Helpers.showErrorToast(authenticationViewModel.error);
} else { } else {
await sharedPref.setString(TOKEN, await sharedPref.setString(
authenticationViewModel.activationCodeVerificationScreenRes.logInTokenID); TOKEN,
authenticationViewModel
.activationCodeVerificationScreenRes.logInTokenID);
if (authMethodType == AuthMethodTypes.SMS || if (authMethodType == AuthMethodTypes.SMS ||
authMethodType == AuthMethodTypes.WhatsApp) { authMethodType == AuthMethodTypes.WhatsApp) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
@ -507,7 +577,9 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
new SMSOTP( new SMSOTP(
context, context,
type, type,
authenticationViewModel.loggedUser != null ? authenticationViewModel.loggedUser.mobileNumber : authenticationViewModel.user.mobile, authenticationViewModel.loggedUser != null
? authenticationViewModel.loggedUser.mobileNumber
: authenticationViewModel.user.mobile,
(value) { (value) {
showDialog( showDialog(
context: context, context: context,
@ -517,14 +589,14 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
this.checkActivationCode(value: value, isSilentLogin: isSilentLogin); this.checkActivationCode(value: value, isSilentLogin: isSilentLogin);
}, },
() => () => {
{
print('Faild..'), print('Faild..'),
}, },
).displayDialog(context); ).displayDialog(context);
} }
loginWithFingerPrintOrFaceID(AuthMethodTypes authMethodTypes,
isActive) async { loginWithFingerPrintOrFaceID(
AuthMethodTypes authMethodTypes, isActive) async {
if (isActive) { if (isActive) {
await authenticationViewModel.showIOSAuthMessages(); await authenticationViewModel.showIOSAuthMessages();
if (!mounted) return; if (!mounted) return;
@ -533,7 +605,8 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
authenticationViewModel.user.logInTypeID) == authenticationViewModel.user.logInTypeID) ==
AuthMethodTypes.Fingerprint || AuthMethodTypes.Fingerprint ||
SelectedAuthMethodTypesService.getMethodsTypeService( SelectedAuthMethodTypesService.getMethodsTypeService(
authenticationViewModel.user.logInTypeID) == AuthMethodTypes.FaceID)) { authenticationViewModel.user.logInTypeID) ==
AuthMethodTypes.FaceID)) {
this.sendActivationCode(authMethodTypes); this.sendActivationCode(authMethodTypes);
} else { } else {
setState(() { setState(() {
@ -544,21 +617,18 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
} }
checkActivationCode({String value, bool isSilentLogin = false}) async { checkActivationCode({String value, bool isSilentLogin = false}) async {
await authenticationViewModel.checkActivationCodeForDoctorApp(activationCode: value,isSilentLogin: isSilentLogin); 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);
} else { } else {
await authenticationViewModel.onCheckActivationCodeSuccess(); await authenticationViewModel.onCheckActivationCodeSuccess();
if (value != null) { if (value != null) {
if(Navigator.canPop(context)) if (Navigator.canPop(context)) Navigator.pop(context);
Navigator.pop(context);
} }
if(Navigator.canPop(context)) if (Navigator.canPop(context)) Navigator.pop(context);
Navigator.pop(context);
navigateToLandingPage(); navigateToLandingPage();
} }
} }
@ -569,5 +639,4 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
authenticationViewModel.setAppStatus(APP_STATUS.AUTHENTICATED); authenticationViewModel.setAppStatus(APP_STATUS.AUTHENTICATED);
} }
} }
} }

@ -71,7 +71,7 @@ class CardWithBgWidget extends StatelessWidget {
), ),
Container( Container(
padding: EdgeInsets.all(padding), padding: EdgeInsets.all(padding),
margin: EdgeInsets.only(left: marginLeft), margin: EdgeInsets.only(left: !projectProvider.isArabic?marginLeft:0, right:projectProvider.isArabic?marginLeft:0 ),
child: widget) child: widget)
], ],
), ),

Loading…
Cancel
Save