Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Absence of focus node in credit_card_form.dart #40

Closed
NikhilKamathB opened this issue Feb 21, 2021 · 1 comment · Fixed by #65
Closed

Absence of focus node in credit_card_form.dart #40

NikhilKamathB opened this issue Feb 21, 2021 · 1 comment · Fixed by #65

Comments

@NikhilKamathB
Copy link

Bug
First and foremost thanks for this package. It was very helpful for my use-case, however when I tried to customize 'credit_card_form.dart' file, I found out that there was no focus node associated with 'cardNumber' textformfield, also disposal of this node ('cardNumberNode') was missing in the 'dispose' function.

Container( padding: const EdgeInsets.symmetric(vertical: 8.0), margin: const EdgeInsets.only(left: 16, top: 16, right: 16), child: TextFormField( obscureText: widget.obscureNumber, controller: _cardNumberController, cursorColor: widget.cursorColor ?? themeColor, onEditingComplete: () { FocusScope.of(context).requestFocus(expiryDateNode); }, style: TextStyle( color: widget.textColor, ), decoration: widget.cardNumberDecoration, keyboardType: TextInputType.number, textInputAction: TextInputAction.next, validator: (String value) { // Validate less that 13 digits +3 white spaces if (value.isEmpty || value.length < 16) { return widget.numberValidationMessage; } return null; }, ), ),

@override void dispose() { cardHolderNode.dispose(); cvvFocusNode.dispose(); expiryDateNode.dispose(); super.dispose(); }

need to insert focusNode: cardHolderNode, and cardNumberNode.dispose(); in lib/credit_card_form.dart (lines, between 177 - 196 and lines 150 - 155 respectively as per github (master)) otherwise, the package worked fine. Feel free to close this issue if insignificant.

@vatsaltanna
Copy link
Collaborator

Hello @NikhilKamathB, As card number is the first field so it doesn't require focus node.

Closing this for now feel free to reopen If more information is required.

meetjanani added a commit to meetjanani/flutter_credit_card that referenced this issue Sep 28, 2021
….dart =>

As card number is the first field so it doesn't require focus node.
meetjanani added a commit to meetjanani/flutter_credit_card that referenced this issue Oct 8, 2021
….dart =>

As card number is the first field so it doesn't require focus node.
meetjanani added a commit to meetjanani/flutter_credit_card that referenced this issue Oct 8, 2021
….dart =>

As card number is the first field so it doesn't require focus node.
meetjanani added a commit to meetjanani/flutter_credit_card that referenced this issue Oct 11, 2021
….dart =>

As card number is the first field so it doesn't require focus node.
meetjanani added a commit to meetjanani/flutter_credit_card that referenced this issue Oct 11, 2021
….dart =>

As card number is the first field so it doesn't require focus node
meetjanani pushed a commit to meetjanani/flutter_credit_card that referenced this issue Oct 11, 2021
….dart =>

As card number is the first field so it doesn't require focus node
meetjanani pushed a commit to meetjanani/flutter_credit_card that referenced this issue Oct 11, 2021
….dart =>

As card number is the first field so it doesn't require focus node
vatsaltanna pushed a commit that referenced this issue Oct 11, 2021
As card number is the first field so it doesn't require focus node
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants