sms_autofill icon indicating copy to clipboard operation
sms_autofill copied to clipboard

Issue: PinFieldAutoFill - Double tap to manually enter OTP, even when FocusNode has the focus

Open gauravdhingra9 opened this issue 3 years ago • 8 comments

I am facing an issue in PinFieldAutoFill while manually entering the OTP, where:

  • Single tap on the OTP Field opens the keyboard, but unable to type.
  • I need to tap on the field widget again to be able to start typing, else nothing happens on pressing keys on the keyboard.
  • Tried to fix it by setting focus through FocusNode programmatically, but setting focus to active only opens keyboard and the user is unable to enter any text until he clicks the text field widget again.

gauravdhingra9 avatar Jul 12 '21 21:07 gauravdhingra9

@gauravdhingra9 tengo el mismo problema pudiste solucionarlo?

miguelflores1993 avatar Jul 15 '21 17:07 miguelflores1993

i have the same issue

15520065 avatar Jul 17 '21 05:07 15520065

Give a parameter currentCode: "" and it will work perfectly

PinFieldAutoFill( keyboardType: TextInputType.number, cursor: Cursor(color: peach, enabled: true, width: 1), autoFocus: true, controller: _pinController, codeLength: 6, currentCode: "", decoration: BoxLooseDecoration( textStyle: TextStyle(color: Colors.black), radius: Radius.circular(1), strokeColorBuilder: FixedColorBuilder(Colors.black)), onCodeChanged: (pin) { if (pin.length == 6) { signInWithPhoneNumber(pin); } }, ),

guptan404 avatar Jul 30 '21 21:07 guptan404

The same issue, Used currentCode: "".. but not worked for me

arasu33 avatar Oct 01 '21 14:10 arasu33

The same issue, Used currentCode: "".. but not worked for me

Could you please confirm package version of PinFieldAutoFill you are using

guptan404 avatar Oct 07 '21 23:10 guptan404

Used sms_autofill: ^2.1.2

Center( child: Padding( padding: const EdgeInsets.fromLTRB(32.0, 8, 32, 8), child: PinFieldAutoFill( codeLength: 4, cursor: Cursor(color: kPrimaryColor, enabled: true, width: 1), autoFocus: true, decoration: UnderlineDecoration( textStyle: TextStyle(fontSize: 24, color: Colors.black), colorBuilder: FixedColorBuilder(Colors.black.withOpacity(0.1)), ), currentCode: "", onCodeSubmitted: (code) {}, onCodeChanged: (code) { }, ), ), ),

arasu33 avatar Oct 08 '21 04:10 arasu33

Finally, its worked for me when I changed the stateless widget to state full widget...

arasu33 avatar Dec 05 '21 11:12 arasu33

i'm having the same issue when warped inside a Column widget.

darshanm0 avatar Dec 15 '21 01:12 darshanm0