Add Beneficiary bugs fixed
This commit is contained in:
@@ -23,7 +23,9 @@ class AddBeneficiaryScreen extends StatefulWidget {
|
||||
|
||||
class _AddBeneficiaryScreen extends State<AddBeneficiaryScreen> {
|
||||
final _formKey = GlobalKey<FormState>();
|
||||
|
||||
final _accountNumberFieldKey = GlobalKey<FormFieldState>();
|
||||
final _confirmAccountNumberFieldKey = GlobalKey<FormFieldState>();
|
||||
final _ifscFieldKey = GlobalKey<FormFieldState>();
|
||||
final TextEditingController accountNumberController = TextEditingController();
|
||||
final TextEditingController confirmAccountNumberController =
|
||||
TextEditingController();
|
||||
@@ -237,6 +239,7 @@ class _AddBeneficiaryScreen extends State<AddBeneficiaryScreen> {
|
||||
child: Column(
|
||||
children: [
|
||||
TextFormField(
|
||||
key: _accountNumberFieldKey,
|
||||
controller: accountNumberController,
|
||||
decoration: InputDecoration(
|
||||
labelText: AppLocalizations.of(
|
||||
@@ -267,6 +270,7 @@ class _AddBeneficiaryScreen extends State<AddBeneficiaryScreen> {
|
||||
const SizedBox(height: 24),
|
||||
// Confirm Account Number
|
||||
TextFormField(
|
||||
key: _confirmAccountNumberFieldKey,
|
||||
controller: confirmAccountNumberController,
|
||||
decoration: InputDecoration(
|
||||
labelText: AppLocalizations.of(
|
||||
@@ -285,15 +289,14 @@ class _AddBeneficiaryScreen extends State<AddBeneficiaryScreen> {
|
||||
).reenterAccountNumber;
|
||||
}
|
||||
if (value != accountNumberController.text) {
|
||||
return AppLocalizations.of(
|
||||
context,
|
||||
).accountMismatch;
|
||||
return AppLocalizations.of(context,).accountMismatch;
|
||||
}
|
||||
return null;
|
||||
},
|
||||
),
|
||||
const SizedBox(height: 24),
|
||||
TextFormField(
|
||||
key: _ifscFieldKey,
|
||||
controller: ifscController,
|
||||
maxLength: 11,
|
||||
inputFormatters: [
|
||||
@@ -390,20 +393,20 @@ class _AddBeneficiaryScreen extends State<AddBeneficiaryScreen> {
|
||||
child: SizedBox(
|
||||
width: double.infinity,
|
||||
child: ElevatedButton(
|
||||
onPressed: _isValidating
|
||||
? null
|
||||
: () {
|
||||
if (confirmAccountNumberController
|
||||
.text ==
|
||||
accountNumberController.text) {
|
||||
_validateBeneficiary();
|
||||
} else {
|
||||
setState(() {
|
||||
_validationError =
|
||||
'Please enter a valid and matching account number.';
|
||||
});
|
||||
}
|
||||
},
|
||||
onPressed: _isValidating
|
||||
? null
|
||||
: () {
|
||||
final isAccountValid =
|
||||
_accountNumberFieldKey.currentState!.validate();
|
||||
final isConfirmAccountValid =
|
||||
_confirmAccountNumberFieldKey.currentState!.validate();
|
||||
final isIfscValid = _ifscFieldKey.currentState!.validate();
|
||||
|
||||
if (isAccountValid && isConfirmAccountValid && isIfscValid) {
|
||||
_validateBeneficiary();
|
||||
}
|
||||
},
|
||||
|
||||
child: _isValidating
|
||||
? const SizedBox(
|
||||
width: 20,
|
||||
|
@@ -15,15 +15,19 @@ void main() async {
|
||||
]);
|
||||
|
||||
// Check for device compromise
|
||||
final compromisedMessage = await SecurityService.deviceCompromisedMessage;
|
||||
if (compromisedMessage != null) {
|
||||
runApp(MaterialApp(
|
||||
home: SecurityErrorScreen(message: compromisedMessage),
|
||||
));
|
||||
return;
|
||||
}
|
||||
// final compromisedMessage = await SecurityService.deviceCompromisedMessage;
|
||||
// if (compromisedMessage != null) {
|
||||
// runApp(MaterialApp(
|
||||
// home: SecurityErrorScreen(message: compromisedMessage),
|
||||
// ));
|
||||
// return;
|
||||
// }
|
||||
|
||||
// Initialize dependencies
|
||||
await setupDependencies();
|
||||
runApp(const KMobile());
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user