diff --git a/lib/features/authentication/authentication_view_model.dart b/lib/features/authentication/authentication_view_model.dart index eeccfc8..5c17843 100644 --- a/lib/features/authentication/authentication_view_model.dart +++ b/lib/features/authentication/authentication_view_model.dart @@ -509,10 +509,11 @@ class AuthenticationViewModel extends ChangeNotifier { await _dialogService.showErrorBottomSheet(message: message ?? "Something went wrong. ", onOkPressed: () {}); } - loginWithFingerPrintFace() async { + loginWithFingerPrintFace(Function success) async { _localAuthService.authenticate().then((value) async { if (value) { // we have to handle this if verification true; + success(); if(!_appState.isAuthenticated) { loginTypeEnum = (_appState.deviceTypeID == 1 ? LoginTypeEnum.face : LoginTypeEnum.fingerprint); print(loginTypeEnum); diff --git a/lib/presentation/authentication/quick_login.dart b/lib/presentation/authentication/quick_login.dart index c5f540b..5e76496 100644 --- a/lib/presentation/authentication/quick_login.dart +++ b/lib/presentation/authentication/quick_login.dart @@ -101,9 +101,6 @@ class _QuickLogin extends State { text:LocaleKeys.enableQuickLogin.tr(), onPressed: () { widget.onPressed(); - setState(() { - - }); }, backgroundColor: Color(0xffED1C2B), borderColor: Color(0xffED1C2B), diff --git a/lib/presentation/authentication/saved_login_screen.dart b/lib/presentation/authentication/saved_login_screen.dart index 55cbadf..146adad 100644 --- a/lib/presentation/authentication/saved_login_screen.dart +++ b/lib/presentation/authentication/saved_login_screen.dart @@ -97,7 +97,7 @@ class _SavedLogin extends State { text: "${LocaleKeys.loginBy.tr()} ${loginType.displayName}", onPressed: () { if (loginType == LoginTypeEnum.fingerprint || loginType == LoginTypeEnum.face) { - authVm.loginWithFingerPrintFace(); + authVm.loginWithFingerPrintFace((){}); } else { // int? val = loginType.toInt; authVm.checkUserAuthentication(otpTypeEnum: loginType == LoginTypeEnum.sms ? OTPTypeEnum.sms : OTPTypeEnum.whatsapp); @@ -220,7 +220,7 @@ class _SavedLogin extends State { iconColor: null, onPressed: () { if (loginType == LoginTypeEnum.fingerprint || loginType == LoginTypeEnum.face) { - authVm.loginWithFingerPrintFace(); + authVm.loginWithFingerPrintFace((){}); } else { loginType = LoginTypeEnum.whatsapp; int? val = loginType.toInt; diff --git a/lib/presentation/home/landing_page.dart b/lib/presentation/home/landing_page.dart index b55632b..1e0ccc5 100644 --- a/lib/presentation/home/landing_page.dart +++ b/lib/presentation/home/landing_page.dart @@ -35,14 +35,14 @@ class LandingPage extends StatefulWidget { class _LandingPageState extends State { late final AuthenticationViewModel authVM; - + bool isDone = false; @override void initState() { authVM = context.read(); authVM.savePushTokenToAppState(); if (mounted) { authVM.checkLastLoginStatus(() { - showQuickLogin(context, false); + showQuickLogin(context); }); } super.initState(); @@ -321,7 +321,7 @@ class _LandingPageState extends State { ); } - void showQuickLogin(BuildContext context, bool isDone) { + void showQuickLogin(BuildContext context) { showCommonBottomSheet( context, title: "", @@ -329,16 +329,19 @@ class _LandingPageState extends State { isDone: isDone, onPressed: () { // sharedPref.setBool(HAS_ENABLED_QUICK_LOGIN, true); - authVM.loginWithFingerPrintFace(); + authVM.loginWithFingerPrintFace((){ + isDone = true; + setState(() { + + }); + }); + }, ), height:isDone == false ? ResponsiveExtension.screenHeight * 0.5 : ResponsiveExtension.screenHeight * 0.3, isFullScreen: false, callBackFunc: (str) { - isDone = true; - setState(() { - }); }, ); }