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