fixed context usage async gaps warnings and deleted some comments

This commit is contained in:
asif
2025-08-24 00:32:06 +05:30
parent 7fe8e8f084
commit 5ee88403dd

View File

@@ -49,8 +49,8 @@ class LoginScreenState extends State<LoginScreen>
if (state is Authenticated) { if (state is Authenticated) {
final storage = getIt<SecureStorage>(); final storage = getIt<SecureStorage>();
final mpin = await storage.read('mpin'); final mpin = await storage.read('mpin');
if (!context.mounted) return;
if (mpin == null) { if (mpin == null) {
// ignore: use_build_context_synchronously
Navigator.of(context).pushReplacement( Navigator.of(context).pushReplacement(
MaterialPageRoute( MaterialPageRoute(
builder: (_) => MPinScreen( builder: (_) => MPinScreen(
@@ -69,7 +69,6 @@ class LoginScreenState extends State<LoginScreen>
), ),
); );
} else { } else {
// ignore: use_build_context_synchronously
Navigator.of(context).pushReplacement( Navigator.of(context).pushReplacement(
MaterialPageRoute(builder: (_) => const NavigationScaffold()), MaterialPageRoute(builder: (_) => const NavigationScaffold()),
); );
@@ -88,7 +87,6 @@ class LoginScreenState extends State<LoginScreen>
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
// 🔁 Animated Blinking Logo
Image.asset( Image.asset(
'assets/images/logo.png', 'assets/images/logo.png',
width: 150, width: 150,
@@ -144,8 +142,7 @@ class LoginScreenState extends State<LoginScreen>
controller: _passwordController, controller: _passwordController,
obscureText: _obscurePassword, obscureText: _obscurePassword,
textInputAction: TextInputAction.done, textInputAction: TextInputAction.done,
onFieldSubmitted: (_) => onFieldSubmitted: (_) => _submitForm(),
_submitForm(), // ⌨️ Enter key submits
decoration: InputDecoration( decoration: InputDecoration(
labelText: AppLocalizations.of(context).password, labelText: AppLocalizations.of(context).password,
border: const OutlineInputBorder(), border: const OutlineInputBorder(),