changed imports of AppLocalization

Also added beneficiary validation while quick pay within bank
This commit is contained in:
2025-07-24 22:21:19 +05:30
parent 23d742ace9
commit 787fcdc2e2
42 changed files with 3965 additions and 1025 deletions

View File

@@ -1,4 +1,4 @@
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import '../../../l10n/app_localizations.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
@@ -48,9 +48,9 @@ class LoginScreenState extends State<LoginScreen>
void _submitForm() {
if (_formKey.currentState!.validate()) {
context.read<AuthCubit>().login(
_customerNumberController.text.trim(),
_passwordController.text,
);
_customerNumberController.text.trim(),
_passwordController.text,
);
}
}
@@ -69,10 +69,13 @@ class LoginScreenState extends State<LoginScreen>
builder: (_) => MPinScreen(
mode: MPinMode.set,
onCompleted: (_) {
Navigator.of(context, rootNavigator: true)
.pushReplacement(
Navigator.of(
context,
rootNavigator: true,
).pushReplacement(
MaterialPageRoute(
builder: (_) => const NavigationScaffold()),
builder: (_) => const NavigationScaffold(),
),
);
},
),
@@ -84,9 +87,9 @@ class LoginScreenState extends State<LoginScreen>
);
}
} else if (state is AuthError) {
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(content: Text(state.message)),
);
ScaffoldMessenger.of(
context,
).showSnackBar(SnackBar(content: Text(state.message)));
}
},
builder: (context, state) {
@@ -97,7 +100,7 @@ class LoginScreenState extends State<LoginScreen>
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
// 🔁 Animated Blinking Logo
// 🔁 Animated Blinking Logo
FadeTransition(
opacity: _logoAnimation,
child: Image.asset(
@@ -105,8 +108,11 @@ class LoginScreenState extends State<LoginScreen>
width: 150,
height: 150,
errorBuilder: (context, error, stackTrace) {
return const Icon(Icons.account_balance,
size: 100, color: Colors.blue);
return const Icon(
Icons.account_balance,
size: 100,
color: Colors.blue,
);
},
),
),
@@ -115,9 +121,10 @@ class LoginScreenState extends State<LoginScreen>
Text(
AppLocalizations.of(context).kccb,
style: TextStyle(
fontSize: 32,
fontWeight: FontWeight.bold,
color: Colors.blue),
fontSize: 32,
fontWeight: FontWeight.bold,
color: Colors.blue,
),
),
const SizedBox(height: 48),
@@ -147,7 +154,7 @@ class LoginScreenState extends State<LoginScreen>
},
),
const SizedBox(height: 24),
// Password
// Password
TextFormField(
controller: _passwordController,
obscureText: _obscurePassword,
@@ -233,10 +240,11 @@ class LoginScreenState extends State<LoginScreen>
//disable until registration is implemented
onPressed: null,
style: OutlinedButton.styleFrom(
shape: const StadiumBorder(),
padding: const EdgeInsets.symmetric(vertical: 16),
backgroundColor: Colors.lightBlue[100],
foregroundColor: Colors.black),
shape: const StadiumBorder(),
padding: const EdgeInsets.symmetric(vertical: 16),
backgroundColor: Colors.lightBlue[100],
foregroundColor: Colors.black,
),
child: Text(AppLocalizations.of(context).register),
),
),
@@ -250,7 +258,6 @@ class LoginScreenState extends State<LoginScreen>
}
}
/*import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:kmobile/di/injection.dart';

View File

@@ -1,4 +1,4 @@
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import '../../../l10n/app_localizations.dart';
import 'dart:developer';
@@ -155,7 +155,7 @@ class _MPinScreenState extends State<MPinScreen> {
['1', '2', '3'],
['4', '5', '6'],
['7', '8', '9'],
['Enter', '0', '<']
['Enter', '0', '<'],
];
return Column(
@@ -174,8 +174,9 @@ class _MPinScreenState extends State<MPinScreen> {
_handleComplete();
} else {
setState(() {
errorText =
AppLocalizations.of(context).pleaseEnter4Digits;
errorText = AppLocalizations.of(
context,
).pleaseEnter4Digits;
});
}
} else if (key.isNotEmpty) {
@@ -238,8 +239,10 @@ class _MPinScreenState extends State<MPinScreen> {
if (errorText != null)
Padding(
padding: const EdgeInsets.only(top: 8.0),
child:
Text(errorText!, style: const TextStyle(color: Colors.red)),
child: Text(
errorText!,
style: const TextStyle(color: Colors.red),
),
),
const Spacer(),
buildNumberPad(),

View File

@@ -1,4 +1,4 @@
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import '../../../l10n/app_localizations.dart';
import 'package:flutter/material.dart';
import 'dart:async';
@@ -70,9 +70,7 @@ class _WelcomeScreenState extends State<WelcomeScreen> {
left: 0,
right: 0,
child: Center(
child: CircularProgressIndicator(
color: Colors.white,
),
child: CircularProgressIndicator(color: Colors.white),
),
),
],
@@ -138,6 +136,3 @@ class WelcomeScreen extends StatelessWidget {
}
}
*/