IFSC Field Testing #2

This commit is contained in:
2025-09-16 12:59:31 +05:30
parent d2044d49b5
commit ba1ef0ed24
2 changed files with 28 additions and 6 deletions

View File

@@ -39,6 +39,7 @@ class _QuickPayOutsideBankScreen extends State<QuickPayOutsideBankScreen> {
final phoneController = TextEditingController();
final amountController = TextEditingController();
final remarksController = TextEditingController();
final _ifscFocusNode = FocusNode();
final service = getIt<BeneficiaryService>();
late String accountType;
@@ -49,6 +50,11 @@ class _QuickPayOutsideBankScreen extends State<QuickPayOutsideBankScreen> {
@override
void initState() {
super.initState();
_ifscFocusNode.addListener(() {
if (!_ifscFocusNode.hasFocus && ifscController.text.trim().length == 11) {
_validateIFSC();
}
});
WidgetsBinding.instance.addPostFrameCallback((_) {
setState(() {
accountType = 'Savings';
@@ -139,6 +145,7 @@ class _QuickPayOutsideBankScreen extends State<QuickPayOutsideBankScreen> {
amountController.dispose();
remarksController.dispose();
super.dispose();
_ifscFocusNode.dispose();
}
void _onProceedToPay() {
@@ -479,6 +486,7 @@ class _QuickPayOutsideBankScreen extends State<QuickPayOutsideBankScreen> {
children: [
Expanded(
child: TextFormField(
focusNode: _ifscFocusNode,
maxLength: 11,
inputFormatters: [
LengthLimitingTextInputFormatter(11),
@@ -501,9 +509,6 @@ class _QuickPayOutsideBankScreen extends State<QuickPayOutsideBankScreen> {
),
controller: ifscController,
textInputAction: TextInputAction.next,
onFieldSubmitted: (_) {
_validateIFSC();
},
onChanged: (value) {
setState(() {
final trimmed = value.trim().toUpperCase();