From 5ee88403dda5ce97606c1369c59777722b065ca7 Mon Sep 17 00:00:00 2001 From: asif Date: Sun, 24 Aug 2025 00:32:06 +0530 Subject: [PATCH] fixed context usage async gaps warnings and deleted some comments --- lib/features/auth/screens/login_screen.dart | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/lib/features/auth/screens/login_screen.dart b/lib/features/auth/screens/login_screen.dart index 0118ff4..8597a8a 100644 --- a/lib/features/auth/screens/login_screen.dart +++ b/lib/features/auth/screens/login_screen.dart @@ -49,8 +49,8 @@ class LoginScreenState extends State if (state is Authenticated) { final storage = getIt(); final mpin = await storage.read('mpin'); + if (!context.mounted) return; if (mpin == null) { - // ignore: use_build_context_synchronously Navigator.of(context).pushReplacement( MaterialPageRoute( builder: (_) => MPinScreen( @@ -69,7 +69,6 @@ class LoginScreenState extends State ), ); } else { - // ignore: use_build_context_synchronously Navigator.of(context).pushReplacement( MaterialPageRoute(builder: (_) => const NavigationScaffold()), ); @@ -88,7 +87,6 @@ class LoginScreenState extends State child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ - // 🔁 Animated Blinking Logo Image.asset( 'assets/images/logo.png', width: 150, @@ -144,8 +142,7 @@ class LoginScreenState extends State controller: _passwordController, obscureText: _obscurePassword, textInputAction: TextInputAction.done, - onFieldSubmitted: (_) => - _submitForm(), // ⌨️ Enter key submits + onFieldSubmitted: (_) => _submitForm(), decoration: InputDecoration( labelText: AppLocalizations.of(context).password, border: const OutlineInputBorder(),