TinoGuo / pin_input_text_field

A textField widget to help display different style pin
Apache License 2.0
374 stars 81 forks source link

Set pin code from code #2

Closed jaumard closed 5 years ago

jaumard commented 5 years ago

I'm working on a plugin to autofill sms code, I want to use your widget as textField but for now it doesn't support setting a pin from code. Would it be possible to add this ?

I can do a PR if you don't have time but I want to be sure you'll accept it first :)

Thanks !

TinoGuo commented 5 years ago

@jaumard code means abcd? Supporting other input styles of Pin is coming. I think it will publish before the weekend.

jaumard commented 5 years ago

No I mean I want something like:

PinInputTextField(
              onSubmit: (pin) {
                //Add submit action.
              },
              currentCode: '123456',
              pinLength: 6,     // The length of the pin
              decoration: BoxTightDecoration(), // or BoxLooseDecoration, UnderlineDecoration
              width: 300.0,
              height: 48.0,
            );

That will allow to retrieve the PIN from the SMS and set it automatically on the field :) my widget will wrap this one and provide the PIN.

TinoGuo commented 5 years ago

@jaumard Okay, this feature will include next release.😃😃

jaumard commented 5 years ago

awesome ! Thanks @TinoGuo !

TinoGuo commented 5 years ago

@jaumard It's ready in dev branch

jaumard commented 5 years ago

thanks I'll try to test it today and let you know :)

jaumard commented 5 years ago

It works ! Just one thing, I find it really hard to find out when the field has the focus or not, would it be possible to add a focusColor under PinDecoration ? like this when the field has focus it put the first empty digit as the one with the focus, or if all are filled the last one. What do you think ?

jaumard commented 5 years ago

https://github.com/jaumard/sms_autofill :) when you've publish all of this I'll be all good to publish mine too ! Thanks !

TinoGuo commented 5 years ago

@jaumard It has been published just now!

jaumard commented 5 years ago

@TinoGuo thanks !! Perfect :)