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) {
final storage = getIt<SecureStorage>();
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<LoginScreen>
),
);
} else {
// ignore: use_build_context_synchronously
Navigator.of(context).pushReplacement(
MaterialPageRoute(builder: (_) => const NavigationScaffold()),
);
@@ -88,7 +87,6 @@ class LoginScreenState extends State<LoginScreen>
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<LoginScreen>
controller: _passwordController,
obscureText: _obscurePassword,
textInputAction: TextInputAction.done,
onFieldSubmitted: (_) =>
_submitForm(), // ⌨️ Enter key submits
onFieldSubmitted: (_) => _submitForm(),
decoration: InputDecoration(
labelText: AppLocalizations.of(context).password,
border: const OutlineInputBorder(),