@ -4,6 +4,7 @@ import 'package:hexcolor/hexcolor.dart';
import ' package:hmg_nurses/classes/colors.dart ' ;
import ' package:hmg_nurses/classes/date-utils.dart ' ;
import ' package:hmg_nurses/classes/enums.dart ' ;
import ' package:hmg_nurses/config/routes.dart ' ;
import ' package:hmg_nurses/extensions/int_extensions.dart ' ;
import ' package:hmg_nurses/extensions/string_extensions.dart ' ;
import ' package:hmg_nurses/extensions/util_extensions.dart ' ;
@ -11,7 +12,6 @@ import 'package:hmg_nurses/extensions/widget_extensions.dart';
import ' package:hmg_nurses/generated/locale_keys.g.dart ' ;
import ' package:hmg_nurses/main.dart ' ;
import ' package:hmg_nurses/provider/login_provider_model.dart ' ;
import ' package:hmg_nurses/ui/login/login_vm.dart ' ;
import ' package:hmg_nurses/ui/login/widgets/verification_method_card.dart ' ;
import ' package:hmg_nurses/widgets/button/default_button.dart ' ;
import ' package:local_auth/local_auth.dart ' ;
@ -33,7 +33,7 @@ class LoginMethodsPage extends StatefulWidget {
class LoginMethodsPageState extends State < LoginMethodsPage > {
bool isMoreOption = false ;
bool onlySMSBox = false ;
late LoginViewModel loginViewModel ;
LoginType ? loginType ;
AuthMethodTypes ? selectedAuthType ;
late LoginProviderModel loginProviderModel ;
@ -43,396 +43,241 @@ class LoginMethodsPageState extends State<LoginMethodsPage> {
if ( loginType = = null ) {
loginType = ModalRoute . of ( context ) ! . settings . arguments as LoginType ;
}
loginViewModel = context . read < LoginViewModel > ( ) ;
loginProviderModel = context . read < LoginProviderModel > ( ) ;
return Scaffold (
appBar: AppBar (
backgroundColor: Colors . transparent ,
leading: IconButton (
icon: const Icon ( Icons . arrow_back_ios , color: MyColors . darkIconColor ) ,
onPressed: ( ) = > Navigator . pop ( context ) ,
) ,
/ / actions: [ Center ( child: " Employee Digital ID " . toText12 ( color: MyColors . textMixColor , isUnderLine: true ) . onPress ( ( ) { } ) ) , 21. width ] ,
) ,
/ / appBar: AppBar (
/ / backgroundColor: Colors . transparent ,
/ / leading: null ,
/ / / / actions: [ Center ( child: " Employee Digital ID " . toText12 ( color: MyColors . textMixColor , isUnderLine: true ) . onPress ( ( ) { } ) ) , 21. width ] ,
/ / ) ,
body: Container (
width: double . infinity ,
height: double . infinity ,
padding: const EdgeInsets . all ( 21 ) ,
child: Column (
children: [
if ( loginType = = LoginType . SILENT_LOGIN & & appState . lastLoginImeiDate ! = null )
Column (
mainAxisAlignment: MainAxisAlignment . spaceEvenly ,
crossAxisAlignment: CrossAxisAlignment . start ,
children: < Widget > [
LocaleKeys . welcomeBack . tr ( ) . toText12 ( ) ,
( appState . lastLoginImeiDate ! . titleDescription ! + " " + appState . lastLoginImeiDate ! . doctorName ! ) . toText20 ( isBold: true ) ,
heightSpacer3per ( ) ,
LocaleKeys . wouldYouLikeToLoginWithCurrentUsername . tr ( ) . toText14 ( ) ,
heightSpacer3per ( ) ,
Container (
padding: const EdgeInsets . all ( 12 ) ,
decoration: BoxDecoration (
color: Colors . white ,
borderRadius: const BorderRadius . all ( Radius . circular ( 10 ) ) ,
border: Border . all ( color: HexColor ( ' #707070 ' ) , width: 0.1 ) ,
) ,
child: Row (
mainAxisAlignment: MainAxisAlignment . spaceBetween ,
crossAxisAlignment: CrossAxisAlignment . start ,
children: < Widget > [
Expanded (
child: SafeArea (
child: SingleChildScrollView (
child: Column (
children: [
21. height ,
if ( loginType = = LoginType . SILENT_LOGIN & & appState . lastLoginImeiDate ! = null )
Column (
mainAxisAlignment: MainAxisAlignment . s tart ,
mainAxisAlignment: MainAxisAlignment . spaceEvenly ,
crossAxisAlignment: CrossAxisAlignment . start ,
children: [
LocaleKeys . lastLoginDetails . tr ( ) . toText13 ( ) ,
SizedBox (
width: 55. w ,
children: < Widget > [
LocaleKeys . welcomeBack . tr ( ) . toText12 ( ) ,
( appState . lastLoginImeiDate ! . titleDescription ! + " " + appState . lastLoginImeiDate ! . doctorName ! ) . toText20 ( isBold: true ) ,
heightSpacer3per ( ) ,
LocaleKeys . wouldYouLikeToLoginWithCurrentUsername . tr ( ) . toText14 ( ) ,
heightSpacer3per ( ) ,
Container (
padding: const EdgeInsets . all ( 12 ) ,
decoration: BoxDecoration (
color: Colors . white ,
borderRadius: const BorderRadius . all ( Radius . circular ( 10 ) ) ,
border: Border . all ( color: HexColor ( ' #707070 ' ) , width: 0.1 ) ,
) ,
child: Row (
children: [
" ${ LocaleKeys . verificationType . tr ( ) } : " . toText11 ( ) ,
loginViewModel . getType ( appState . lastLoginImeiDate ! . logInTypeID ? ? 1 ) . toText11 ( isBold: true ) ,
mainAxisAlignment: MainAxisAlignment . spaceBetween ,
crossAxisAlignment: CrossAxisAlignment . start ,
children: < Widget > [
Column (
mainAxisAlignment: MainAxisAlignment . start ,
crossAxisAlignment: CrossAxisAlignment . start ,
children: [
LocaleKeys . lastLoginDetails . tr ( ) . toText13 ( ) ,
SizedBox (
width: 55. w ,
child: Row (
children: [
" ${ LocaleKeys . verificationType . tr ( ) } : " . toText11 ( ) ,
loginProviderModel . getType ( appState . lastLoginImeiDate ! . logInTypeID ? ? 1 ) . toText11 ( isBold: true ) ,
] ,
) ,
) ,
] ,
) ,
Column (
mainAxisAlignment: MainAxisAlignment . start ,
crossAxisAlignment: CrossAxisAlignment . end ,
children: [
( appState . lastLoginImeiDate ! . editedOn ! = null
? AppDateUtils . getDayMonthYearDateFormatted ( AppDateUtils . convertStringToDate ( appState . lastLoginImeiDate ! . editedOn ? ? " " ) , isMonthShort: true )
: appState . lastLoginImeiDate ! . createdOn ! = null
? AppDateUtils . getDayMonthYearDateFormatted ( AppDateUtils . convertStringToDate ( appState . lastLoginImeiDate ! . createdOn ? ? " " ) , isMonthShort: true )
: ' -- ' )
. toText11 ( isBold: true ) ,
heightSpacer06per ( ) ,
( appState . lastLoginImeiDate ! . editedOn ! = null
? AppDateUtils . getHour ( AppDateUtils . convertStringToDate ( appState . lastLoginImeiDate ! . editedOn ? ? " " ) )
: appState . lastLoginImeiDate ! . createdOn ! = null
? AppDateUtils . getHour ( AppDateUtils . convertStringToDate ( appState . lastLoginImeiDate ! . createdOn ? ? " " ) )
: ' -- ' )
. toText10 ( )
] ,
)
] ,
) ,
) ,
heightSpacer3per ( ) ,
LocaleKeys . pleaseVerify . tr ( ) . toText14 ( ) . paddingOnly ( left: 1. w ) ,
heightSpacer2per ( ) ,
] ,
) ,
Column (
mainAxisAlignment: MainAxisAlignment . start ,
crossAxisAlignment: CrossAxisAlignment . end ,
children: [
( appState . lastLoginImeiDate ! . editedOn ! = null
? AppDateUtils . getDayMonthYearDateFormatted ( AppDateUtils . convertStringToDate ( appState . lastLoginImeiDate ! . editedOn ? ? " " ) , isMonthShort: true )
: appState . lastLoginImeiDate ! . createdOn ! = null
? AppDateUtils . getDayMonthYearDateFormatted ( AppDateUtils . convertStringToDate ( appState . lastLoginImeiDate ! . createdOn ? ? " " ) , isMonthShort: true )
: ' -- ' )
. toText11 ( isBold: true ) ,
heightSpacer06per ( ) ,
( appState . lastLoginImeiDate ! . editedOn ! = null
? AppDateUtils . getHour ( AppDateUtils . convertStringToDate ( appState . lastLoginImeiDate ! . editedOn ? ? " " ) )
: appState . lastLoginImeiDate ! . createdOn ! = null
? AppDateUtils . getHour ( AppDateUtils . convertStringToDate ( appState . lastLoginImeiDate ! . createdOn ? ? " " ) )
: ' -- ' )
. toText10 ( )
] ,
)
] ,
) ,
) ,
heightSpacer3per ( ) ,
LocaleKeys . pleaseVerify . tr ( ) . toText14 ( ) . paddingOnly ( left: 1. w ) ,
heightSpacer2per ( ) ,
] ,
) ,
Column (
mainAxisAlignment: MainAxisAlignment . start ,
crossAxisAlignment: CrossAxisAlignment . start ,
children: < Widget > [
if ( loginType = = LoginType . FROM_LOGIN | | loginType = = LoginType . REGISTER_NEW_BIO )
Column (
children: [
LocaleKeys . pleaseVerifyForBio . tr ( ) . toText14 ( ) ,
21. height ,
] ,
) ,
if ( loginType = = LoginType . FROM_LOGIN | | loginType = = LoginType . SILENT_LOGIN )
Row (
mainAxisAlignment: MainAxisAlignment . center ,
children: < Widget > [
Expanded (
child: VerificationMethodsList (
authMethodType: AuthMethodTypes . faceID ,
isBioAvailable: loginProviderModel . isFaceBioAvailable ,
authenticateUser: ( AuthMethodTypes authMethodType , isActive ) async {
/ / loginViewModel . startSMSService ( authMethodType , context: context ) ;
/ / appState . setMemberBeforeLogin
bool isAuthenticated = await loginProviderModel . loginWithFaceIDAndBiometrics ( ) ;
if ( isAuthenticated ) {
appState . lastLoginTyp = loginProviderModel . getLoginMethodId ( AuthMethodTypes . faceID ) ;
if ( loginType = = LoginType . FROM_LOGIN ) {
setState ( ( ) {
loginType = LoginType . REGISTER_NEW_BIO ;
selectedAuthType = AuthMethodTypes . faceID ;
} ) ;
} else if ( loginType = = LoginType . SILENT_LOGIN ) {
if ( appState . lastLoginImeiDate ! . logInTypeID = = loginProviderModel . getLoginMethodId ( AuthMethodTypes . faceID ) ) {
loginProviderModel . sendActivationCode (
appState . memberBeforeLogin ! ,
appState . projectID ,
loginProviderModel . getLoginMethodId ( AuthMethodTypes . sms ) ,
true ,
) ;
} else {
setState ( ( ) {
loginType = LoginType . REGISTER_NEW_BIO ;
selectedAuthType = AuthMethodTypes . faceID ;
} ) ;
}
}
} else {
print ( " Authentaction Failded " ) ;
}
} ,
) ,
) ,
21. width ,
Expanded (
child: VerificationMethodsList (
authMethodType: AuthMethodTypes . fingerPrint ,
isBioAvailable: loginProviderModel . isFingerBioAvailable ,
onShowMore: ( ) async {
bool isAuthenticated = await loginProviderModel . loginWithFaceIDAndBiometrics ( ) ;
if ( isAuthenticated ) {
if ( loginType = = LoginType . FROM_LOGIN ) {
appState . lastLoginTyp = loginProviderModel . getLoginMethodId ( AuthMethodTypes . fingerPrint ) ;
loginType = LoginType . REGISTER_NEW_BIO ;
selectedAuthType = AuthMethodTypes . fingerPrint ;
setState ( ( ) { } ) ;
}
} else {
print ( " Authentaction Failded " ) ;
}
} ,
) ,
) ,
] ,
) ,
21. height ,
Row (
mainAxisAlignment: MainAxisAlignment . center ,
children: < Widget > [
Expanded (
child: VerificationMethodsList (
authMethodType: AuthMethodTypes . sms ,
authenticateUser: ( AuthMethodTypes authMethodType , isActive ) {
/ / loginViewModel . startSMSService ( authMethodType , context: context ) ;
if ( selectedAuthType = = null ) {
appState . lastLoginTyp = loginProviderModel . getLoginMethodId ( AuthMethodTypes . sms ) ;
} else if ( selectedAuthType = = AuthMethodTypes . faceID | | selectedAuthType = = AuthMethodTypes . fingerPrint ) {
appState . lastLoginTyp = loginProviderModel . getLoginMethodId ( selectedAuthType ! ) ;
}
loginProviderModel . sendActivationCode (
appState . memberBeforeLogin ! ,
appState . projectID ,
loginProviderModel . getLoginMethodId ( AuthMethodTypes . sms ) ,
false ,
) ;
} ,
) ,
) ,
21. width ,
Expanded (
child: VerificationMethodsList (
authMethodType: AuthMethodTypes . whatsApp ,
authenticateUser: ( AuthMethodTypes authMethodType , isActive ) {
/ / loginViewModel . startSMSService ( authMethodType , context: context ) ;
if ( selectedAuthType = = null ) {
appState . lastLoginTyp = loginProviderModel . getLoginMethodId ( AuthMethodTypes . whatsApp ) ;
} else if ( selectedAuthType = = AuthMethodTypes . faceID | | selectedAuthType = = AuthMethodTypes . fingerPrint ) {
appState . lastLoginTyp = loginProviderModel . getLoginMethodId ( selectedAuthType ! ) ;
}
loginProviderModel . sendActivationCode (
appState . memberBeforeLogin ! ,
appState . projectID ,
loginProviderModel . getLoginMethodId ( AuthMethodTypes . whatsApp ) ,
false ,
) ;
} ,
) ,
) ,
] ,
) ,
] ,
) ,
] ,
) ,
) ,
) ;
return Scaffold (
appBar: AppBar (
backgroundColor: Colors . transparent ,
leading: IconButton (
icon: const Icon ( Icons . arrow_back_ios , color: MyColors . darkIconColor ) ,
onPressed: ( ) = > Navigator . pop ( context ) ,
) ,
/ / actions: [ Center ( child: " Employee Digital ID " . toText12 ( color: MyColors . textMixColor , isUnderLine: true ) . onPress ( ( ) { } ) ) , 21. width ] ,
) ,
body: SingleChildScrollView (
child: Center (
child: FractionallySizedBox (
widthFactor: 0.9 ,
child: SingleChildScrollView (
child: Column (
crossAxisAlignment: CrossAxisAlignment . start ,
children: < Widget > [
heightSpacer1per ( ) ,
if ( loginViewModel . isFromLogin )
InkWell (
onTap: ( ) {
/ / loginViewModel . setUnverified ( false , isFromLogin: false ) ;
/ / loginViewModel . setAppStatus ( APPSTATUS . unAuthenticated ) ;
} ,
child: const Icon (
Icons . arrow_back_ios ,
color: MyColors . darkTextColor ,
) ,
) ,
Column (
children: < Widget > [
heightSpacer1per ( ) ,
isMoreOption = = false
? Column (
mainAxisAlignment: MainAxisAlignment . spaceEvenly ,
crossAxisAlignment: CrossAxisAlignment . start ,
children: < Widget > [
LocaleKeys . welcomeBack . tr ( ) . toText12 ( ) ,
" Dr Amal Ahmed " . toText20 ( isBold: true ) ,
heightSpacer3per ( ) ,
LocaleKeys . wouldYouLikeToLoginWithCurrentUsername . tr ( ) . toText14 ( ) ,
heightSpacer3per ( ) ,
Container (
padding: const EdgeInsets . all ( 12 ) ,
decoration: BoxDecoration (
color: Colors . white ,
borderRadius: const BorderRadius . all ( Radius . circular ( 10 ) ) ,
border: Border . all ( color: HexColor ( ' #707070 ' ) , width: 0.1 ) ,
) ,
child: Row (
mainAxisAlignment: MainAxisAlignment . spaceBetween ,
crossAxisAlignment: CrossAxisAlignment . start ,
children: < Widget > [
Column (
mainAxisAlignment: MainAxisAlignment . start ,
crossAxisAlignment: CrossAxisAlignment . start ,
children: [
LocaleKeys . lastLoginDetails . tr ( ) . toText13 ( ) ,
SizedBox (
width: 55. w ,
child: Row (
children: [
" ${ LocaleKeys . verificationType . tr ( ) } : " . toText11 ( ) ,
" ${ loginViewModel . getType ( 1 ) } " . toText11 ( isBold: true ) ,
] ,
) ,
) ,
] ,
) ,
Column (
mainAxisAlignment: MainAxisAlignment . start ,
crossAxisAlignment: CrossAxisAlignment . end ,
children: [ " 12 NOV, 2022 " . toText11 ( isBold: true ) , heightSpacer06per ( ) , " 09:56 AM " . toText10 ( ) ] ,
)
] ,
) ,
) ,
heightSpacer3per ( ) ,
LocaleKeys . pleaseVerify . tr ( ) . toText14 ( ) . paddingOnly ( left: 1. w ) ,
heightSpacer2per ( ) ,
] ,
)
: Column (
mainAxisAlignment: MainAxisAlignment . spaceEvenly ,
crossAxisAlignment: CrossAxisAlignment . start ,
children: < Widget > [
LocaleKeys . pleaseVerifyForBio . tr ( ) . toText14 ( ) . paddingAll ( 10 ) ,
Column (
mainAxisAlignment: MainAxisAlignment . start ,
crossAxisAlignment: CrossAxisAlignment . start ,
children: < Widget > [
if ( loginType = = LoginType . FROM_LOGIN | | loginType = = LoginType . SILENT_WITH_OTP )
Column (
children: [
LocaleKeys . pleaseVerifyForBio . tr ( ) . toText14 ( ) ,
21. height ,
] ,
) ,
isMoreOption = = false
? Column ( mainAxisAlignment: MainAxisAlignment . start , crossAxisAlignment: CrossAxisAlignment . start , children: < Widget > [
Row ( mainAxisAlignment: MainAxisAlignment . center , children: < Widget > [
if ( loginType = = LoginType . FROM_LOGIN | | loginType = = LoginType . SILENT_LOGIN )
Row (
mainAxisAlignment: MainAxisAlignment . center ,
children: < Widget > [
Expanded (
child: VerificationMethodsList (
authMethodType: SelectedAuthMethodTypesService . getMethodsTypeService ( 1 ) ,
authenticateUser: ( AuthMethodTypes authMethodType , isActive ) {
loginViewModel . startSMSService ( authMethodType , context: context ) ;
authMethodType: AuthMethodTypes . faceID ,
isBioAvailable: loginProviderModel . isFaceBioAvailable ,
authenticateUser: ( AuthMethodTypes authMethodType , isActive ) async {
bool isAuthenticated = await loginProviderModel . loginWithFaceIDAndBiometrics ( ) ;
if ( isAuthenticated ) {
appState . lastLoginTyp = loginProviderModel . getLoginMethodId ( authMethodType ) ;
if ( loginType = = LoginType . FROM_LOGIN ) {
setState ( ( ) {
loginType = LoginType . FROM_LOGIN ;
} ) ;
} else if ( loginType = = LoginType . SILENT_LOGIN ) {
if ( appState . lastLoginImeiDate ! . logInTypeID = = loginProviderModel . getLoginMethodId ( authMethodType ) ) {
loginProviderModel . sendActivationCode (
appState . memberBeforeLogin ! ,
appState . projectID ,
loginProviderModel . getLoginMethodId ( AuthMethodTypes . sms ) ,
loginType ? ? LoginType . FROM_LOGIN ,
isNeedBinding: false ,
) ;
} else {
setState ( ( ) {
loginType = LoginType . SILENT_WITH_OTP ;
} ) ;
}
}
} else {
print ( " Authentication Failed " ) ;
}
} ,
) ,
) ,
21. width ,
Expanded (
child: VerificationMethodsList (
authMethodType: AuthMethodTypes . moreOptions ,
onShowMore: ( ) {
setState ( ( ) {
isMoreOption = true ;
} ) ;
} ,
) )
] ) ,
] )
: Column ( mainAxisAlignment: MainAxisAlignment . start , crossAxisAlignment: CrossAxisAlignment . start , children: < Widget > [
onlySMSBox = = false
? Row (
mainAxisAlignment: MainAxisAlignment . center ,
children: < Widget > [
Expanded (
child: VerificationMethodsList (
authMethodType: AuthMethodTypes . fingerPrint ,
authenticateUser: ( AuthMethodTypes authMethodType , isActive ) {
loginViewModel . startSMSService ( authMethodType , context: context ) ;
} ,
) ) ,
Expanded (
child: VerificationMethodsList (
authMethodType: AuthMethodTypes . faceID ,
authenticateUser: ( AuthMethodTypes authMethodType , isActive ) {
loginViewModel . startSMSService ( authMethodType , context: context ) ;
} ,
) )
] ,
)
: const SizedBox ( ) ,
Row (
mainAxisAlignment: MainAxisAlignment . center ,
children: < Widget > [
Expanded (
child: VerificationMethodsList (
authMethodType: AuthMethodTypes . sms ,
authenticateUser: ( AuthMethodTypes authMethodType , isActive ) {
loginViewModel . startSMSService ( authMethodType , context: context ) ;
} ,
) ) ,
Expanded (
child: VerificationMethodsList (
authMethodType: AuthMethodTypes . whatsApp ,
authenticateUser: ( AuthMethodTypes authMethodType , isActive ) {
loginViewModel . startSMSService ( authMethodType , context: context ) ;
child: VerificationMethodsList (
authMethodType: AuthMethodTypes . fingerPrint ,
isBioAvailable: loginProviderModel . isFingerBioAvailable ,
authenticateUser: ( AuthMethodTypes authMethodType , isActive ) async {
bool isAuthenticated = await loginProviderModel . loginWithFaceIDAndBiometrics ( ) ;
if ( isAuthenticated ) {
appState . lastLoginTyp = loginProviderModel . getLoginMethodId ( authMethodType ) ;
if ( loginType = = LoginType . FROM_LOGIN ) {
setState ( ( ) {
loginType = LoginType . FROM_LOGIN ;
} ) ;
} else if ( loginType = = LoginType . SILENT_LOGIN ) {
if ( appState . lastLoginImeiDate ! . logInTypeID = = loginProviderModel . getLoginMethodId ( authMethodType ) ) {
loginProviderModel . sendActivationCode (
appState . memberBeforeLogin ! ,
appState . projectID ,
loginProviderModel . getLoginMethodId ( AuthMethodTypes . sms ) ,
loginType ? ? LoginType . FROM_LOGIN ,
isNeedBinding: false ,
) ;
} else {
setState ( ( ) {
loginType = LoginType . SILENT_WITH_OTP ;
} ) ;
}
}
} else {
print ( " Authentication Failed " ) ;
}
} ,
) )
] ,
) ,
) ,
] ,
) ,
21. height ,
Row (
mainAxisAlignment: MainAxisAlignment . center ,
children: < Widget > [
Expanded (
child: VerificationMethodsList (
authMethodType: AuthMethodTypes . sms ,
authenticateUser: ( AuthMethodTypes authMethodType , isActive ) {
if ( loginType = = LoginType . FROM_LOGIN | | loginType = = LoginType . SILENT_LOGIN ) {
if ( appState . lastLoginTyp = = - 1 ) appState . lastLoginTyp = loginProviderModel . getLoginMethodId ( authMethodType ) ;
if ( loginType = = LoginType . SILENT_LOGIN ) {
loginType = LoginType . SILENT_WITH_OTP ;
}
}
loginProviderModel . sendActivationCode (
appState . memberBeforeLogin ! ,
appState . projectID ,
loginProviderModel . getLoginMethodId ( AuthMethodTypes . sms ) ,
loginType ? ? LoginType . FROM_LOGIN ,
) ;
} ,
) ,
) ,
] ) ,
/ / )
] ,
) ,
] ,
) ,
) ,
) ,
) ,
) ,
bottomSheet: ! isMoreOption
? null
: Container (
height: 10. h ,
color: MyColors . backgroundColor ,
width: double . infinity ,
child: Center (
child: FractionallySizedBox (
widthFactor: 0.9 ,
child: Column (
mainAxisAlignment: MainAxisAlignment . end ,
children: < Widget > [
Padding (
padding: EdgeInsets . symmetric ( horizontal: 4. w ) ,
child: DefaultButton ( LocaleKeys . useAnotherAccount . tr ( ) , ( ) { } , colors: const [ MyColors . redColor , MyColors . redColor ] ) ,
21. width ,
Expanded (
child: VerificationMethodsList (
authMethodType: AuthMethodTypes . whatsApp ,
authenticateUser: ( AuthMethodTypes authMethodType , isActive ) {
if ( loginType = = LoginType . FROM_LOGIN | | loginType = = LoginType . SILENT_LOGIN ) {
if ( appState . lastLoginTyp = = - 1 ) appState . lastLoginTyp = loginProviderModel . getLoginMethodId ( authMethodType ) ;
if ( loginType = = LoginType . SILENT_LOGIN ) {
loginType = LoginType . SILENT_WITH_OTP ;
}
}
loginProviderModel . sendActivationCode (
appState . memberBeforeLogin ! ,
appState . projectID ,
loginProviderModel . getLoginMethodId ( AuthMethodTypes . whatsApp ) ,
loginType ? ? LoginType . FROM_LOGIN ,
) ;
} ,
) ,
) ,
] ,
) ,
] ,
) ,
height Spacer3per( ) ,
12. height ,
] ,
) ,
) ,
) ,
) ,
21. height ,
DefaultButton (
LocaleKeys . useAnotherAccount . tr ( ) ,
( ) async {
Navigator . pushReplacementNamed ( context , AppRoutes . login , arguments: false ) ;
} ,
colors: const [
MyColors . redColor ,
MyColors . redColor ,
] ,
) ,
] ,
) ,
) ,
) ;
}
}