Tkko / Flutter_Pinput

Flutter package to create Pin code input text field with every pixel customization possibility 🎨 with beautiful animations, iOS autofill, Android autofill
https://pub.dev/packages/pinput
MIT License
775 stars 179 forks source link

Ability to remove autofill #190

Closed Yagorundy closed 3 months ago

Yagorundy commented 3 months ago

Is your feature request related to a problem? Please describe.

Hi! I am trying to remove the autofill for web desktop versions. Having AutofillHits.oneTimeCode prompts desktop web browsers to autofill user passwords in the pin code field.

When using Pinput() constructor, best I can do is provide empty array [] to autofillHints, since if I provide null the value is resolved to: this.autofillHints = const [ AutofillHints.oneTimeCode, ], When I provide empty array, there is still autofill configuration created for the input. For desktop web browsers it still hints user passwords for the pin field.

https://github.com/user-attachments/assets/3684ed64-d4c3-4e29-be84-318fa3618105

Only way to disable the autofill configuration is to provide null to this property, and only way to do that is to use Pinput.builder() However, I want to use the widgets provided by you package, and Pinput.builder() forces me to provide a builder.

Describe the solution you'd like I think the easiest solution would be to make builder in Pinput.builder() nullable. This way I can pass null to autofillHints to remove the autofill (since there isn't a default value in the Pinput.builder() constructor) and I could also pass null to builder so I can use the package provided widgets.

@Tkko

Tkko commented 3 months ago
Hi @Yagorundy, if you provide null the autofillHints should be resolved as null instead of the default value. null array
Screenshot 2024-08-19 at 1 01 55 PM Screenshot 2024-08-19 at 1 02 39 PM
Yagorundy commented 3 months ago

@Tkko All is good, providing null to autofillHints works. Thanks!