IFSC bug fixed
This commit is contained in:
@@ -76,10 +76,11 @@ final _ifscFieldKey = GlobalKey<FormFieldState>();
|
||||
final ifsc = ifscController.text.trim().toUpperCase();
|
||||
if (ifsc.isEmpty) return;
|
||||
|
||||
try {
|
||||
final result = await beneficiaryService.validateIFSC(ifsc);
|
||||
|
||||
if (mounted) {
|
||||
if (result.bankName == '') {
|
||||
if (result.bankName == null || result.bankName.isEmpty) {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(content: Text(AppLocalizations.of(context).invalidIfsc)),
|
||||
);
|
||||
@@ -90,6 +91,22 @@ final _ifscFieldKey = GlobalKey<FormFieldState>();
|
||||
branchNameController.text = result.branchName;
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
if (mounted) {
|
||||
final errorMessage = e.toString().toUpperCase();
|
||||
String snackbarMessage = AppLocalizations.of(context).somethingWentWrong;
|
||||
|
||||
if (errorMessage.contains('INVALID') && errorMessage.contains('IFSC')) {
|
||||
snackbarMessage = AppLocalizations.of(context).invalidIfsc;
|
||||
}
|
||||
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(content: Text(snackbarMessage)),
|
||||
);
|
||||
bankNameController.clear();
|
||||
branchNameController.clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void _validateBeneficiary() async {
|
||||
@@ -354,7 +371,7 @@ final _ifscFieldKey = GlobalKey<FormFieldState>();
|
||||
},
|
||||
),
|
||||
const SizedBox(height: 24),
|
||||
// 🔹 Bank Name (Disabled)
|
||||
// Bank Name (Disabled)
|
||||
TextFormField(
|
||||
controller: bankNameController,
|
||||
enabled: false, // changed from readOnly to disabled
|
||||
|
||||
@@ -66,10 +66,11 @@ class _QuickPayOutsideBankScreen extends State<QuickPayOutsideBankScreen> {
|
||||
final ifsc = ifscController.text.trim().toUpperCase();
|
||||
if (ifsc.isEmpty) return;
|
||||
|
||||
try {
|
||||
final result = await service.validateIFSC(ifsc);
|
||||
|
||||
if (mounted) {
|
||||
if (result.bankName == '') {
|
||||
if (result.bankName == null || result.bankName.isEmpty) {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(content: Text(AppLocalizations.of(context).invalidIfsc)),
|
||||
);
|
||||
@@ -80,6 +81,22 @@ class _QuickPayOutsideBankScreen extends State<QuickPayOutsideBankScreen> {
|
||||
branchNameController.text = result.branchName;
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
if (mounted) {
|
||||
final errorMessage = e.toString().toUpperCase();
|
||||
String snackbarMessage = AppLocalizations.of(context).somethingWentWrong;
|
||||
|
||||
if (errorMessage.contains('INVALID') && errorMessage.contains('IFSC')) {
|
||||
snackbarMessage = AppLocalizations.of(context).invalidIfsc;
|
||||
}
|
||||
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(content: Text(snackbarMessage)),
|
||||
);
|
||||
bankNameController.clear();
|
||||
branchNameController.clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void _validateBeneficiary() async {
|
||||
|
||||
Reference in New Issue
Block a user