diff --git a/lib/core/routes/app_shell/app_shell_screen.dart b/lib/core/routes/app_shell/app_shell_screen.dart index fd8c155..c6c3d35 100644 --- a/lib/core/routes/app_shell/app_shell_screen.dart +++ b/lib/core/routes/app_shell/app_shell_screen.dart @@ -38,9 +38,11 @@ class AppShellScreen extends StatelessWidget { @override Widget build(BuildContext context) { return ResponsiveBuilder( - mobile: MobileShellPage( - navigationShell: navigationShell, - onTap: (value) => _gotoBranch(value, context), + mobile: SafeArea( + child: MobileShellPage( + navigationShell: navigationShell, + onTap: (value) => _gotoBranch(value, context), + ), ), tablet: TabletShellPage( navigationShell: navigationShell, diff --git a/lib/main.dart b/lib/main.dart index 1fb7fc2..0b21bc5 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -54,21 +54,26 @@ class MyApp extends StatefulWidget { } class _MyAppState extends State { + Future setupInteractedMessage() async { + final initialMessage = await FirebaseMessaging.instance.getInitialMessage(); + + if (initialMessage != null) { + _handleMessage(initialMessage); + } + + FirebaseMessaging.onMessageOpenedApp.listen(_handleMessage); + } + + void _handleMessage(RemoteMessage message) { + appRouter.go( + const SplashScreenRoute(navigateToNotification: true).location, + ); + } + @override void initState() { super.initState(); - _handleInitialMessage(); - } - - Future _handleInitialMessage() async { - final message = await FirebaseMessaging.instance.getInitialMessage(); - if (message != null) { - WidgetsBinding.instance.addPostFrameCallback((_) { - appRouter.go( - const SplashScreenRoute(navigateToNotification: true).location, - ); - }); - } + setupInteractedMessage(); } @override diff --git a/lib/views/forget_password_create/pages/m_forget_password_create_page.dart b/lib/views/forget_password_create/pages/m_forget_password_create_page.dart index dc01d8e..1618bd4 100644 --- a/lib/views/forget_password_create/pages/m_forget_password_create_page.dart +++ b/lib/views/forget_password_create/pages/m_forget_password_create_page.dart @@ -52,135 +52,138 @@ class _MobileForgotPasswordCreatePageState Widget build(BuildContext context) { return Scaffold( backgroundColor: AppColors.backgroundColor, - body: Center( - child: SingleChildScrollView( - padding: EdgeInsets.symmetric(horizontal: 24.0.w()), - child: Consumer( - builder: (context, viewModel, _) { - return Column( - mainAxisSize: MainAxisSize.min, - children: [ - Padding( - padding: EdgeInsets.symmetric(horizontal: 22.0.w()), - child: SvgPicture.asset( - AssetsManager.logoBig, - width: double.infinity, - height: 50.0.h(), + resizeToAvoidBottomInset: false, + body: SafeArea( + child: Center( + child: SingleChildScrollView( + padding: EdgeInsets.symmetric(horizontal: 24.0.w()), + child: Consumer( + builder: (context, viewModel, _) { + return Column( + mainAxisSize: MainAxisSize.min, + children: [ + Padding( + padding: EdgeInsets.symmetric(horizontal: 22.0.w()), + child: SvgPicture.asset( + AssetsManager.logoBig, + width: double.infinity, + height: 50.0.h(), + ), ), - ), - SizedBox(height: 72.0.h()), - Text( - ForgotPasswordCreateStrings.forgotPasswordTitle, - style: TextStyle( - fontSize: 28.0.sp(), - fontWeight: FontWeight.bold, - color: AppColors.grey80, + SizedBox(height: 72.0.h()), + Text( + ForgotPasswordCreateStrings.forgotPasswordTitle, + style: TextStyle( + fontSize: 28.0.sp(), + fontWeight: FontWeight.bold, + color: AppColors.grey80, + ), ), - ), - SizedBox(height: 16.0.h()), - Text( - ForgotPasswordCreateStrings.forgotPasswordSubtitle, - textAlign: TextAlign.center, - style: TextStyle( - fontSize: 14.0.sp(), - fontWeight: FontWeight.w400, - color: AppColors.grey60, - ), - ), - SizedBox(height: 40.0.h()), - LoginTextField( - controller: viewModel.newPasswordController, - focusNode: viewModel.newPasswordFocus, - label: ForgotPasswordCreateStrings.createNewPassword, - iconPath: AssetsManager.passwordIcon, - isPassword: true, - obscureText: viewModel.obscureForgotPassword, - onToggleVisibility: - viewModel.toggleForgotPasswordVisibility, - ), - SizedBox(height: 16.0.h()), - Container( - alignment: Alignment.centerLeft, - padding: EdgeInsets.only(left: 16.0.w()), - child: Text( - ForgotPasswordCreateStrings.atLast5Character, + SizedBox(height: 16.0.h()), + Text( + ForgotPasswordCreateStrings.forgotPasswordSubtitle, + textAlign: TextAlign.center, style: TextStyle( fontSize: 14.0.sp(), + fontWeight: FontWeight.w400, color: AppColors.grey60, ), ), - ), - SizedBox(height: 6.0.h()), - Container( - alignment: Alignment.centerLeft, - padding: EdgeInsets.only(left: 16.0.w()), - child: Text( - ForgotPasswordCreateStrings.atLeast1uppercase, - style: TextStyle( - fontSize: 14.0.sp(), - color: AppColors.grey60, + SizedBox(height: 40.0.h()), + LoginTextField( + controller: viewModel.newPasswordController, + focusNode: viewModel.newPasswordFocus, + label: ForgotPasswordCreateStrings.createNewPassword, + iconPath: AssetsManager.passwordIcon, + isPassword: true, + obscureText: viewModel.obscureForgotPassword, + onToggleVisibility: + viewModel.toggleForgotPasswordVisibility, + ), + SizedBox(height: 16.0.h()), + Container( + alignment: Alignment.centerLeft, + padding: EdgeInsets.only(left: 16.0.w()), + child: Text( + ForgotPasswordCreateStrings.atLast5Character, + style: TextStyle( + fontSize: 14.0.sp(), + color: AppColors.grey60, + ), ), ), - ), - SizedBox(height: 6.0.h()), - Container( - alignment: Alignment.centerLeft, - padding: EdgeInsets.only(left: 16.0.w()), - child: Text( - ForgotPasswordCreateStrings.atLeast1lowercase, - style: TextStyle( - fontSize: 14.0.sp(), - color: AppColors.grey60, + SizedBox(height: 6.0.h()), + Container( + alignment: Alignment.centerLeft, + padding: EdgeInsets.only(left: 16.0.w()), + child: Text( + ForgotPasswordCreateStrings.atLeast1uppercase, + style: TextStyle( + fontSize: 14.0.sp(), + color: AppColors.grey60, + ), ), ), - ), - SizedBox(height: 6.0.h()), - Container( - alignment: Alignment.centerLeft, - padding: EdgeInsets.only(left: 16.0.w()), - child: Text( - ForgotPasswordCreateStrings.atLeastSpecial, - style: TextStyle( - fontSize: 14.0.sp(), - color: AppColors.grey60, + SizedBox(height: 6.0.h()), + Container( + alignment: Alignment.centerLeft, + padding: EdgeInsets.only(left: 16.0.w()), + child: Text( + ForgotPasswordCreateStrings.atLeast1lowercase, + style: TextStyle( + fontSize: 14.0.sp(), + color: AppColors.grey60, + ), ), ), - ), - SizedBox(height: 80.0.h()), - viewModel.isResetPasswordLoading - ? BaseButton( - isEnabled: viewModel.isNewPasswordValid, - text: ForgotPasswordCreateStrings.resetLink, - onPressed: null, - isLoading: true, - ) - : BaseButton( - isEnabled: viewModel.isNewPasswordValid, - text: ForgotPasswordCreateStrings.resetLink, - onPressed: - viewModel.isNewPasswordValid - ? () async { - viewModel.resetPassword(); - } - : null, + SizedBox(height: 6.0.h()), + Container( + alignment: Alignment.centerLeft, + padding: EdgeInsets.only(left: 16.0.w()), + child: Text( + ForgotPasswordCreateStrings.atLeastSpecial, + style: TextStyle( + fontSize: 14.0.sp(), + color: AppColors.grey60, + ), ), + ), + SizedBox(height: 80.0.h()), + viewModel.isResetPasswordLoading + ? BaseButton( + isEnabled: viewModel.isNewPasswordValid, + text: ForgotPasswordCreateStrings.resetLink, + onPressed: null, + isLoading: true, + ) + : BaseButton( + isEnabled: viewModel.isNewPasswordValid, + text: ForgotPasswordCreateStrings.resetLink, + onPressed: + viewModel.isNewPasswordValid + ? () async { + viewModel.resetPassword(); + } + : null, + ), - TextButton( - onPressed: () { - context.pop(); - }, - child: Text( - ForgotPasswordCreateStrings.backToSignInButton, - style: TextStyle( - fontSize: 14.0.sp(), - fontWeight: FontWeight.w500, - color: AppColors.mainBlue, + TextButton( + onPressed: () { + context.pop(); + }, + child: Text( + ForgotPasswordCreateStrings.backToSignInButton, + style: TextStyle( + fontSize: 14.0.sp(), + fontWeight: FontWeight.w500, + color: AppColors.mainBlue, + ), ), ), - ), - ], - ); - }, + ], + ); + }, + ), ), ), ), diff --git a/lib/views/forget_password_otp.dart/pages/d_forget_password_otp.dart_page.dart b/lib/views/forget_password_otp.dart/pages/d_forget_password_otp_page.dart similarity index 100% rename from lib/views/forget_password_otp.dart/pages/d_forget_password_otp.dart_page.dart rename to lib/views/forget_password_otp.dart/pages/d_forget_password_otp_page.dart diff --git a/lib/views/forget_password_otp.dart/pages/forgot_password_otp_screen.dart b/lib/views/forget_password_otp.dart/pages/forgot_password_otp_screen.dart index fdb4b91..f796204 100644 --- a/lib/views/forget_password_otp.dart/pages/forgot_password_otp_screen.dart +++ b/lib/views/forget_password_otp.dart/pages/forgot_password_otp_screen.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; -import 'package:tm_app/views/forget_password_otp.dart/pages/d_forget_password_otp.dart_page.dart'; -import 'package:tm_app/views/forget_password_otp.dart/pages/m_forget_password_otp.dart_page.dart'; -import 'package:tm_app/views/forget_password_otp.dart/pages/t_forget_password_otp.dart_page.dart'; +import 'package:tm_app/views/forget_password_otp.dart/pages/d_forget_password_otp_page.dart'; +import 'package:tm_app/views/forget_password_otp.dart/pages/m_forget_password_otp_page.dart'; +import 'package:tm_app/views/forget_password_otp.dart/pages/t_forget_password_otp_page.dart'; import '../../shared/responsive_builder.dart'; diff --git a/lib/views/forget_password_otp.dart/pages/m_forget_password_otp.dart_page.dart b/lib/views/forget_password_otp.dart/pages/m_forget_password_otp.dart_page.dart deleted file mode 100644 index fc29c89..0000000 --- a/lib/views/forget_password_otp.dart/pages/m_forget_password_otp.dart_page.dart +++ /dev/null @@ -1,149 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:flutter_svg/svg.dart'; -import 'package:go_router/go_router.dart'; -import 'package:pinput/pinput.dart'; -import 'package:provider/provider.dart'; -import 'package:tm_app/core/routes/app_routes.dart'; -import 'package:tm_app/core/utils/size_config.dart'; - -import '../../../core/constants/assets.dart'; -import '../../../core/theme/colors.dart'; -import '../../../core/utils/app_toast.dart'; -import '../../../view_models/auth_view_model.dart'; -import '../../shared/base_button.dart'; -import '../strings/forgot_password_otp_strings.dart'; - -class MobileForgotPasswordOtpPage extends StatefulWidget { - const MobileForgotPasswordOtpPage({super.key}); - - @override - State createState() => - _MobileForgotPasswordOtpPageState(); -} - -class _MobileForgotPasswordOtpPageState - extends State { - late final AuthViewModel viewModel; - - @override - void initState() { - super.initState(); - viewModel = context.read(); - viewModel.addListener(_viewModelListener); - } - - void _viewModelListener() { - if (viewModel.errorMessageOtp != null) { - AppToast.error(context, viewModel.errorMessageOtp!); - } else if (!viewModel.isLoadingOtp && - viewModel.verifyOtpSuccess && - viewModel.resetToken != null) { - const ForgotPasswordCreateRouteData().pushReplacement(context); - viewModel.clearOtpFlow(); - } - } - - @override - void dispose() { - viewModel.removeListener(_viewModelListener); - super.dispose(); - } - - @override - Widget build(BuildContext context) { - return Scaffold( - backgroundColor: AppColors.backgroundColor, - body: Center( - child: SingleChildScrollView( - padding: EdgeInsets.symmetric(horizontal: 24.0.w()), - child: Consumer( - builder: (context, viewModel, _) { - return Column( - mainAxisSize: MainAxisSize.min, - children: [ - Padding( - padding: EdgeInsets.symmetric(horizontal: 22.0.w()), - child: SvgPicture.asset( - AssetsManager.logoBig, - width: double.infinity, - height: 50.0.h(), - ), - ), - SizedBox(height: 72.0.h()), - Text( - ForgotPasswordOtpStrings.forgotPasswordTitle, - style: TextStyle( - fontSize: 28.0.sp(), - fontWeight: FontWeight.bold, - color: AppColors.grey80, - ), - ), - SizedBox(height: 16.0.h()), - Text( - ForgotPasswordOtpStrings.forgotPasswordSubtitle, - textAlign: TextAlign.center, - style: TextStyle( - fontSize: 14.0.sp(), - fontWeight: FontWeight.w400, - color: AppColors.grey60, - ), - ), - SizedBox(height: 40.0.h()), - Pinput( - controller: viewModel.otpController, - length: 6, - pinAnimationType: PinAnimationType.scale, - defaultPinTheme: PinTheme( - width: 50.0.w(), - height: 50.0.h(), - textStyle: TextStyle( - fontSize: 20.0.sp(), - fontWeight: FontWeight.bold, - ), - decoration: BoxDecoration( - color: AppColors.grey0, - borderRadius: BorderRadius.circular(10), - border: Border.all(color: AppColors.grey40), - ), - ), - ), - SizedBox(height: 24.0.h()), - viewModel.isLoadingOtp - ? BaseButton( - isEnabled: viewModel.isOtpValid, - text: ForgotPasswordOtpStrings.resetLink, - onPressed: null, - isLoading: true, - ) - : BaseButton( - isEnabled: viewModel.canSubmitOtpPage, - text: ForgotPasswordOtpStrings.resetLink, - onPressed: - viewModel.canSubmitOtpPage - ? () async { - await viewModel.verifyOtp(context); - } - : null, - ), - TextButton( - onPressed: () { - context.pop(); - }, - child: Text( - ForgotPasswordOtpStrings.backToSignInButton, - style: TextStyle( - fontSize: 14.0.sp(), - fontWeight: FontWeight.w500, - color: AppColors.mainBlue, - ), - ), - ), - ], - ); - }, - ), - ), - ), - ); - } -} diff --git a/lib/views/forget_password_otp.dart/pages/m_forget_password_otp_page.dart b/lib/views/forget_password_otp.dart/pages/m_forget_password_otp_page.dart new file mode 100644 index 0000000..c2db98b --- /dev/null +++ b/lib/views/forget_password_otp.dart/pages/m_forget_password_otp_page.dart @@ -0,0 +1,151 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_svg/svg.dart'; +import 'package:go_router/go_router.dart'; +import 'package:pinput/pinput.dart'; +import 'package:provider/provider.dart'; +import 'package:tm_app/core/routes/app_routes.dart'; +import 'package:tm_app/core/utils/size_config.dart'; + +import '../../../core/constants/assets.dart'; +import '../../../core/theme/colors.dart'; +import '../../../core/utils/app_toast.dart'; +import '../../../view_models/auth_view_model.dart'; +import '../../shared/base_button.dart'; +import '../strings/forgot_password_otp_strings.dart'; + +class MobileForgotPasswordOtpPage extends StatefulWidget { + const MobileForgotPasswordOtpPage({super.key}); + + @override + State createState() => + _MobileForgotPasswordOtpPageState(); +} + +class _MobileForgotPasswordOtpPageState + extends State { + late final AuthViewModel viewModel; + + @override + void initState() { + super.initState(); + viewModel = context.read(); + viewModel.addListener(_viewModelListener); + } + + void _viewModelListener() { + if (viewModel.errorMessageOtp != null) { + AppToast.error(context, viewModel.errorMessageOtp!); + } else if (!viewModel.isLoadingOtp && + viewModel.verifyOtpSuccess && + viewModel.resetToken != null) { + const ForgotPasswordCreateRouteData().pushReplacement(context); + viewModel.clearOtpFlow(); + } + } + + @override + void dispose() { + viewModel.removeListener(_viewModelListener); + super.dispose(); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: AppColors.backgroundColor, + body: SafeArea( + child: Center( + child: SingleChildScrollView( + padding: EdgeInsets.symmetric(horizontal: 24.0.w()), + child: Consumer( + builder: (context, viewModel, _) { + return Column( + mainAxisSize: MainAxisSize.min, + children: [ + Padding( + padding: EdgeInsets.symmetric(horizontal: 22.0.w()), + child: SvgPicture.asset( + AssetsManager.logoBig, + width: double.infinity, + height: 50.0.h(), + ), + ), + SizedBox(height: 72.0.h()), + Text( + ForgotPasswordOtpStrings.forgotPasswordTitle, + style: TextStyle( + fontSize: 28.0.sp(), + fontWeight: FontWeight.bold, + color: AppColors.grey80, + ), + ), + SizedBox(height: 16.0.h()), + Text( + ForgotPasswordOtpStrings.forgotPasswordSubtitle, + textAlign: TextAlign.center, + style: TextStyle( + fontSize: 14.0.sp(), + fontWeight: FontWeight.w400, + color: AppColors.grey60, + ), + ), + SizedBox(height: 40.0.h()), + Pinput( + controller: viewModel.otpController, + length: 6, + pinAnimationType: PinAnimationType.scale, + defaultPinTheme: PinTheme( + width: 50.0.w(), + height: 50.0.h(), + textStyle: TextStyle( + fontSize: 20.0.sp(), + fontWeight: FontWeight.bold, + ), + decoration: BoxDecoration( + color: AppColors.grey0, + borderRadius: BorderRadius.circular(10), + border: Border.all(color: AppColors.grey40), + ), + ), + ), + SizedBox(height: 24.0.h()), + viewModel.isLoadingOtp + ? BaseButton( + isEnabled: viewModel.isOtpValid, + text: ForgotPasswordOtpStrings.resetLink, + onPressed: null, + isLoading: true, + ) + : BaseButton( + isEnabled: viewModel.canSubmitOtpPage, + text: ForgotPasswordOtpStrings.resetLink, + onPressed: + viewModel.canSubmitOtpPage + ? () async { + await viewModel.verifyOtp(context); + } + : null, + ), + TextButton( + onPressed: () { + context.pop(); + }, + child: Text( + ForgotPasswordOtpStrings.backToSignInButton, + style: TextStyle( + fontSize: 14.0.sp(), + fontWeight: FontWeight.w500, + color: AppColors.mainBlue, + ), + ), + ), + ], + ); + }, + ), + ), + ), + ), + ); + } +} diff --git a/lib/views/forget_password_otp.dart/pages/t_forget_password_otp.dart_page.dart b/lib/views/forget_password_otp.dart/pages/t_forget_password_otp_page.dart similarity index 100% rename from lib/views/forget_password_otp.dart/pages/t_forget_password_otp.dart_page.dart rename to lib/views/forget_password_otp.dart/pages/t_forget_password_otp_page.dart diff --git a/lib/views/login/pages/login_mobile_page.dart b/lib/views/login/pages/login_mobile_page.dart index b826cf7..134e2ce 100644 --- a/lib/views/login/pages/login_mobile_page.dart +++ b/lib/views/login/pages/login_mobile_page.dart @@ -46,79 +46,81 @@ class _LoginMobilePageState extends State { Widget build(BuildContext context) { return Scaffold( backgroundColor: AppColors.backgroundColor, - body: Center( - child: SingleChildScrollView( - padding: EdgeInsets.symmetric(horizontal: 24.0.w()), - child: Consumer( - builder: (context, viewModel, _) { - return Column( - mainAxisSize: MainAxisSize.min, - children: [ - // LoginLogo(width: 190.0.w(), height: 88.0.h()), - Padding( - padding: EdgeInsets.symmetric(horizontal: 22.0.w()), - child: SvgPicture.asset( - AssetsManager.logoBig, - width: double.infinity, - height: 50.0.h(), - ), - ), - SizedBox(height: 32.0.h()), - const LoginTitle(), - SizedBox(height: 32.0.h()), - - LoginTextField( - controller: viewModel.usernameController, - focusNode: viewModel.usernameFocus, - label: LoginStrings.usernameLabel, - iconPath: AssetsManager.userIcon, - ), - SizedBox(height: 16.0.h()), - - LoginTextField( - controller: viewModel.passwordController, - focusNode: viewModel.passwordFocus, - label: LoginStrings.passwordLabel, - iconPath: AssetsManager.passwordIcon, - isPassword: true, - obscureText: viewModel.obscurePassword, - onToggleVisibility: viewModel.togglePasswordVisibility, - ), - SizedBox(height: 32.0.h()), - - if (viewModel.isLoading) - BaseButton( - isEnabled: false, - onPressed: null, - isLoading: true, - textColor: AppColors.white, - ) - else - BaseButton( - isEnabled: viewModel.isLoginEnabled, - onPressed: () async { - if (viewModel.isLoginEnabled) { - await viewModel.login(); - } - }, - ), - SizedBox(height: 32.0.h()), - TextButton( - onPressed: () { - const ForgotPasswordRouteData().push(context); - }, - child: Text( - LoginStrings.forgotPassword, - style: TextStyle( - fontSize: 14.0.sp(), - fontWeight: FontWeight.w500, - color: AppColors.mainBlue, + body: SafeArea( + child: Center( + child: SingleChildScrollView( + padding: EdgeInsets.symmetric(horizontal: 24.0.w()), + child: Consumer( + builder: (context, viewModel, _) { + return Column( + mainAxisSize: MainAxisSize.min, + children: [ + // LoginLogo(width: 190.0.w(), height: 88.0.h()), + Padding( + padding: EdgeInsets.symmetric(horizontal: 22.0.w()), + child: SvgPicture.asset( + AssetsManager.logoBig, + width: double.infinity, + height: 50.0.h(), ), ), - ), - ], - ); - }, + SizedBox(height: 32.0.h()), + const LoginTitle(), + SizedBox(height: 32.0.h()), + + LoginTextField( + controller: viewModel.usernameController, + focusNode: viewModel.usernameFocus, + label: LoginStrings.usernameLabel, + iconPath: AssetsManager.userIcon, + ), + SizedBox(height: 16.0.h()), + + LoginTextField( + controller: viewModel.passwordController, + focusNode: viewModel.passwordFocus, + label: LoginStrings.passwordLabel, + iconPath: AssetsManager.passwordIcon, + isPassword: true, + obscureText: viewModel.obscurePassword, + onToggleVisibility: viewModel.togglePasswordVisibility, + ), + SizedBox(height: 32.0.h()), + + if (viewModel.isLoading) + BaseButton( + isEnabled: false, + onPressed: null, + isLoading: true, + textColor: AppColors.white, + ) + else + BaseButton( + isEnabled: viewModel.isLoginEnabled, + onPressed: () async { + if (viewModel.isLoginEnabled) { + await viewModel.login(); + } + }, + ), + SizedBox(height: 32.0.h()), + TextButton( + onPressed: () { + const ForgotPasswordRouteData().push(context); + }, + child: Text( + LoginStrings.forgotPassword, + style: TextStyle( + fontSize: 14.0.sp(), + fontWeight: FontWeight.w500, + color: AppColors.mainBlue, + ), + ), + ), + ], + ); + }, + ), ), ), ), diff --git a/lib/views/splash/pages/m_splash_page.dart b/lib/views/splash/pages/m_splash_page.dart index a030b04..05b2098 100644 --- a/lib/views/splash/pages/m_splash_page.dart +++ b/lib/views/splash/pages/m_splash_page.dart @@ -27,16 +27,14 @@ class _MobileSplashPageState extends State { void _viewModelListener() { if (viewModel.isLoggedIn) { - WidgetsBinding.instance.addPostFrameCallback((_) { - if (widget.navigateToNotification) { - Router.neglect( - context, - () => const NotificationRouteData().go(context), - ); - } else { - Router.neglect(context, () => const HomeRouteData().go(context)); - } - }); + if (widget.navigateToNotification) { + Router.neglect( + context, + () => const NotificationRouteData().go(context), + ); + } else { + Router.neglect(context, () => const HomeRouteData().go(context)); + } } else { WidgetsBinding.instance.addPostFrameCallback((_) { Router.neglect(context, () => const LoginScreenRoute().go(context));