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,367 +53,440 @@ 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), child: SingleChildScrollView(
height: SizeConfig.realScreenHeight * .95, child: Column(
width: SizeConfig.realScreenWidth, crossAxisAlignment: CrossAxisAlignment.start,
child: SingleChildScrollView( children: <Widget>[
child: Column( SizedBox(
crossAxisAlignment: CrossAxisAlignment.start, height: SizeConfig.heightMultiplier *
// mainAxisAlignment: MainAxisAlignment.spaceBetween, (SizeConfig.isHeightVeryShort ? 6 : 4),
children: <Widget>[ ),
SizedBox( if (authenticationViewModel.isFromLogin)
height: 80,
),
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: SizeConfig.heightMultiplier *
height: 20, (SizeConfig.isHeightVeryShort ? 3 : 4),
), ),
authenticationViewModel.user != null && isMoreOption == false authenticationViewModel.user != null &&
? Column( isMoreOption == false
mainAxisAlignment: ? Column(
MainAxisAlignment.spaceEvenly, mainAxisAlignment: MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
AppText(
AppText( TranslationBase.of(context).welcomeBack,
TranslationBase.of(context).welcomeBack, fontSize: SizeConfig
fontSize:12, .getTextMultiplierBasedOnWidth() *
fontWeight: FontWeight.w700, 3.5,
color: Color(0xFF2B353E), fontWeight: FontWeight.w600,
), color: AppGlobal.appTextColor,
AppText( letterSpacing: -0.72,
Helpers.capitalize(authenticationViewModel.user.doctorName),
fontSize: 24,
color: Color(0xFF2B353E),
fontWeight: FontWeight.bold,
),
SizedBox(
height: 20,
),
AppText(
TranslationBase.of(context).accountInfo ,
fontSize: 16,
color: Color(0xFF2E303A),
fontWeight: FontWeight.w600,
),
SizedBox(
height: 20,
),
Container(
padding: EdgeInsets.all(15),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(
Radius.circular(10),
),
border: Border.all(
color: HexColor('#707070'),
width: 0.1),
), ),
child: Row( AppText(
mainAxisAlignment: MainAxisAlignment.spaceBetween, Helpers.convertToTitleCase(
children: <Widget>[ authenticationViewModel.user.doctorName),
Column( fontSize: SizeConfig
children: [ .getTextMultiplierBasedOnWidth() *
6,
Text( color: AppGlobal.appTextColor,
TranslationBase.of(context) fontWeight: FontWeight.bold,
.lastLoginAt, letterSpacing: -1.44,
overflow: ),
TextOverflow.ellipsis, SizedBox(
style: TextStyle( height: SizeConfig.heightMultiplier * 4,
fontFamily: 'Poppins', ),
fontSize: 16, AppText(
color: Color(0xFF2E303A), TranslationBase.of(context).accountInfo,
fontWeight: FontWeight.w700,), fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
4.5,
color: Color(0xFF2E303A),
fontWeight: FontWeight.w600,
letterSpacing: -0.64,
),
SizedBox(
height: SizeConfig.heightMultiplier * 4),
Container(
padding: EdgeInsets.all(15),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(
Radius.circular(10),
),
border: Border.all(
color: HexColor('#707070'), width: 0.1),
),
child: Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[
Container(
width: SizeConfig.realScreenWidth * .5,
padding: EdgeInsets.all(0),
child: Column(
mainAxisAlignment:
MainAxisAlignment.start,
children: [
Text(
TranslationBase.of(context)
.lastLoginAt,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontFamily: 'Poppins',
fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
4.5,
color: Color(0xFF2E303A),
fontWeight: FontWeight.w600,
letterSpacing: -0.4),
),
Container(
width: MediaQuery.of(context)
.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,
context),
style: TextStyle(
color: AppGlobal
.appTextColor,
fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
3.5,
fontFamily:
'Poppins',
fontWeight:
FontWeight.w600,
letterSpacing:
-0.48),
)
]),
),
),
],
crossAxisAlignment:
CrossAxisAlignment.start,
),
), ),
Row( Column(
mainAxisAlignment:
MainAxisAlignment.start,
children: [ children: [
AppText( AppText(
TranslationBase authenticationViewModel
.of(context) .user.editedOn !=
.verifyWith, null
fontSize: 14, ? AppDateUtils
color: Color(0xFF575757), .getDayMonthYearDateFormatted(
fontWeight: FontWeight.w600, AppDateUtils
), .convertStringToDate(
AppText( authenticationViewModel
authenticationViewModel.getType( .user
authenticationViewModel.user .editedOn),
.logInTypeID, isMonthShort: true)
context), : authenticationViewModel
fontSize: 14, .user.createdOn !=
color: Color(0xFF2B353E), null
? AppDateUtils.getDayMonthYearDateFormatted(
AppDateUtils
.convertStringToDate(
authenticationViewModel
.user
.createdOn),
isMonthShort: true)
: '--',
textAlign: TextAlign.right,
fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
4.5,
color: Color(0xFF2E303A),
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
letterSpacing: -0.48,
), ),
AppText(
authenticationViewModel
.user.editedOn !=
null
? AppDateUtils.getHour(AppDateUtils
.convertStringToDate(
authenticationViewModel
.user.editedOn))
: authenticationViewModel
.user.createdOn !=
null
? AppDateUtils.getHour(
AppDateUtils
.convertStringToDate(
authenticationViewModel
.user
.createdOn))
: '--',
textAlign: TextAlign.right,
fontSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
3.5,
fontWeight: FontWeight.w600,
letterSpacing: -0.48,
color: Color(0xFF575757),
)
], ],
crossAxisAlignment:
CrossAxisAlignment.end,
) )
], ],
crossAxisAlignment: CrossAxisAlignment.start,), ),
Column(children: [ ),
AppText( SizedBox(
authenticationViewModel.user.editedOn != height: SizeConfig.heightMultiplier * 3,
null ),
? AppDateUtils.getDayMonthYearDateFormatted( Row(
AppDateUtils.convertStringToDate( children: [
authenticationViewModel.user //todo add translation
.editedOn)) AppText(
: authenticationViewModel.user.createdOn != "Please Verify",
null fontSize: SizeConfig
? AppDateUtils.getDayMonthYearDateFormatted( .getTextMultiplierBasedOnWidth() *
AppDateUtils.convertStringToDate(authenticationViewModel.user 4.5,
.createdOn)) color: AppGlobal.appTextColor,
: '--', fontWeight: FontWeight.w600,
textAlign: letterSpacing: -.64,
TextAlign.right, ),
fontSize: 13,
color: Color(0xFF2E303A),
fontWeight: FontWeight.w700,
),
AppText(
authenticationViewModel.user.editedOn !=
null
? AppDateUtils.getHour(
AppDateUtils.convertStringToDate(
authenticationViewModel.user
.editedOn))
: authenticationViewModel.user.createdOn !=
null
? AppDateUtils.getHour(
AppDateUtils.convertStringToDate(authenticationViewModel.user
.createdOn))
: '--',
textAlign:
TextAlign.right,
fontSize: 14,
fontWeight: FontWeight.w600,
color: Color(0xFF575757),
)
],
crossAxisAlignment: CrossAxisAlignment.start,
)
], ],
), ),
), SizedBox(
SizedBox( height: SizeConfig.heightMultiplier * 2,
height: 20, ),
), ],
Row( )
children: [ : Column(
AppText( mainAxisAlignment: MainAxisAlignment.spaceEvenly,
"Please Verify",
fontSize: 16,
color: Color(0xFF2B353E),
fontWeight: FontWeight.w700,
),
],
)
],
)
: Column(
mainAxisAlignment:
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(
child: AppText( bottom: 20, top: 30),
TranslationBase.of(context) child: AppText(
.verifyLoginWith, TranslationBase.of(context)
fontSize: 18, .verifyLoginWith,
color: Color(0xFF2E303A), fontSize: SizeConfig
fontWeight: FontWeight.bold, .getTextMultiplierBasedOnWidth() *
textAlign: TextAlign.left, 4,
), color: Color(0xFF2E303A),
) fontWeight: FontWeight.bold,
: AppText( textAlign: TextAlign.left,
TranslationBase.of(context) ),
.verifyFingerprint2, )
fontSize: : AppText(
SizeConfig.textMultiplier * 2.5, TranslationBase.of(context)
textAlign: TextAlign.start, .verifyFingerprint2,
), fontSize: SizeConfig
]), .getTextMultiplierBasedOnWidth() *
authenticationViewModel.user != null && isMoreOption == false 4,
? Column( textAlign: TextAlign.start,
),
]),
authenticationViewModel.user != null &&
isMoreOption == false
? Column(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Row( Row(
mainAxisAlignment: mainAxisAlignment:
MainAxisAlignment.center, MainAxisAlignment.center,
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,
.Fingerprint, true) true)
}, },
child: VerificationMethodsList(
authenticationViewModel:
authenticationViewModel,
authMethodType:
SelectedAuthMethodTypesService
.getMethodsTypeService(
authenticationViewModel
.user
.logInTypeID),
authenticateUser:
(AuthMethodTypes
authMethodType,
isActive) =>
authenticateUser(
authMethodType,
isActive),
)),
),
Expanded(
child: VerificationMethodsList( child: VerificationMethodsList(
authenticationViewModel:authenticationViewModel, authenticationViewModel:
authMethodType: SelectedAuthMethodTypesService authenticationViewModel,
.getMethodsTypeService( authMethodType:
authenticationViewModel.user AuthMethodTypes.MoreOptions,
.logInTypeID), onShowMore: () {
authenticateUser: setState(() {
(AuthMethodTypes isMoreOption = true;
authMethodType, });
isActive) => },
))
]),
])
: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
onlySMSBox == false
? Row(
mainAxisAlignment:
MainAxisAlignment.center,
children: <Widget>[
Expanded(
child: VerificationMethodsList(
authenticationViewModel:
authenticationViewModel,
authMethodType:
AuthMethodTypes.Fingerprint,
authenticateUser: (AuthMethodTypes
authMethodType,
isActive) =>
authenticateUser( authenticateUser(
authMethodType, authMethodType, isActive),
isActive),
)), )),
), Expanded(
child: VerificationMethodsList(
authenticationViewModel:
authenticationViewModel,
authMethodType:
AuthMethodTypes.FaceID,
authenticateUser: (AuthMethodTypes
authMethodType,
isActive) =>
authenticateUser(
authMethodType, isActive),
))
],
)
: SizedBox(),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Expanded( Expanded(
child: VerificationMethodsList( child: VerificationMethodsList(
authenticationViewModel:authenticationViewModel, authenticationViewModel:
authMethodType: authenticationViewModel,
AuthMethodTypes.MoreOptions, authMethodType: AuthMethodTypes.SMS,
onShowMore: () { authenticateUser:
setState(() { (AuthMethodTypes authMethodType,
isMoreOption = true; isActive) =>
}); authenticateUser(
}, authMethodType, isActive),
)) )),
]), Expanded(
]) child: VerificationMethodsList(
: Column( authenticationViewModel:
mainAxisAlignment: MainAxisAlignment.start, authenticationViewModel,
crossAxisAlignment: CrossAxisAlignment.start, authMethodType:
children: <Widget>[ AuthMethodTypes.WhatsApp,
onlySMSBox == false authenticateUser:
? Row( (AuthMethodTypes authMethodType,
mainAxisAlignment: isActive) =>
MainAxisAlignment.center, authenticateUser(
children: <Widget>[ authMethodType, isActive),
Expanded( ))
child: VerificationMethodsList( ],
authenticationViewModel:authenticationViewModel, ),
authMethodType: ]),
AuthMethodTypes.Fingerprint,
authenticateUser:
(AuthMethodTypes
authMethodType,
isActive) =>
authenticateUser(
authMethodType,
isActive),
)),
Expanded(
child: VerificationMethodsList(
authenticationViewModel:authenticationViewModel,
authMethodType:
AuthMethodTypes.FaceID,
authenticateUser:
(AuthMethodTypes
authMethodType,
isActive) =>
authenticateUser(
authMethodType,
isActive),
))
],
)
: SizedBox(),
Row(
mainAxisAlignment:
MainAxisAlignment.center,
children: <Widget>[
Expanded(
child: VerificationMethodsList(
authenticationViewModel:authenticationViewModel,
authMethodType: AuthMethodTypes
.SMS,
authenticateUser:
(
AuthMethodTypes authMethodType,
isActive) =>
authenticateUser(
authMethodType, isActive),
)),
Expanded(
child: VerificationMethodsList(
authenticationViewModel:authenticationViewModel,
authMethodType:
AuthMethodTypes.WhatsApp,
authenticateUser:
(
AuthMethodTypes authMethodType,
isActive) =>
authenticateUser(
authMethodType, isActive),
))
],
),
]),
// ) // )
], ],
), ),
), ],
],
),
), ),
), ),
), ),
), ),
), ),
bottomSheet: authenticationViewModel.user == null ? SizedBox(height: 0,) : Container( bottomSheet: authenticationViewModel.user == null
height: 90, ? SizedBox(
width: double.infinity, height: 0,
child: Center( )
child: FractionallySizedBox( : Container(
widthFactor: 0.9, height: 90,
child: Column( width: double.infinity,
mainAxisAlignment: MainAxisAlignment.end, child: Center(
children: <Widget>[ child: FractionallySizedBox(
SecondaryButton( widthFactor: 0.9,
label: TranslationBase child: Column(
.of(context) mainAxisAlignment: MainAxisAlignment.end,
.useAnotherAccount, children: <Widget>[
color: Color(0xFFD02127), SecondaryButton(
//fontWeight: FontWeight.w700, label:
onTap: () { TranslationBase.of(context).useAnotherAccount ?? '',
authenticationViewModel.deleteUser(); color: Color(0xFFD02127),
authenticationViewModel.setAppStatus(APP_STATUS.UNAUTHENTICATED); //fontWeight: FontWeight.w700,
}, onTap: () {
authenticationViewModel.deleteUser();
authenticationViewModel
.setAppStatus(APP_STATUS.UNAUTHENTICATED);
},
),
SizedBox(
height: 25,
)
],
),
), ),
),
SizedBox(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,12 +523,14 @@ 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);
this.startSMSService(authMethodType,isSilentLogin: true); this.startSMSService(authMethodType, isSilentLogin: true);
} else { } else {
checkActivationCode(isSilentLogin: true); checkActivationCode(isSilentLogin: true);
} }
@ -473,7 +543,7 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
fingerPrintBefore = authMethodType; fingerPrintBefore = authMethodType;
} }
this.selectedOption = this.selectedOption =
fingerPrintBefore != null ? fingerPrintBefore : authMethodType; fingerPrintBefore != null ? fingerPrintBefore : authMethodType;
switch (authMethodType) { switch (authMethodType) {
case AuthMethodTypes.SMS: case AuthMethodTypes.SMS:
@ -503,11 +573,13 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
} }
} }
startSMSService(AuthMethodTypes type,{isSilentLogin: false}) { startSMSService(AuthMethodTypes type, {isSilentLogin: false}) {
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,
@ -515,25 +587,26 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
return AppLoaderWidget(); return AppLoaderWidget();
}); });
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;
if (authenticationViewModel.user != null && if (authenticationViewModel.user != null &&
(SelectedAuthMethodTypesService.getMethodsTypeService( (SelectedAuthMethodTypesService.getMethodsTypeService(
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(() {
@ -543,22 +616,19 @@ 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)) Navigator.pop(context);
if(Navigator.canPop(context)) navigateToLandingPage();
Navigator.pop(context);
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