jaumard / sms_autofill

Flutter plugin to provide SMS code autofill support
MIT License
282 stars 174 forks source link

Run a function on completing PhoneFieldHint #100

Closed prodosdigital closed 3 years ago

prodosdigital commented 3 years ago

Hello, is there any way we can automatically run a function as soon as the phone number is selected and prefilled in the TextField and retrive phone no from the text field? Something like onCompletePrefill: () { sendOtp(); }

jaumard commented 3 years ago

Hello, you can provide a text controller, so you're free to listen to it and do what you need :)

prodosdigital commented 3 years ago

Hey, Thanks a lot for your help! Somehow the controller.addListener didn't with PhoneFieldHint but worked perfectly with PhoneFormFieldHint.

jaumard commented 3 years ago

Strange as it should work too normally @grahamsmith we might have a bug in that place maybe since the refactoring

grahamsmith commented 3 years ago

Have you provided your own controller or are you trying to listen to the one created if one isn't provided?

We may have a bug but want to understand some better repo steps.

prodosdigital commented 3 years ago

Have you provided your own controller or are you trying to listen to the one created if one isn't provided?

We may have a bug but want to understand some better repo steps.

I created my own controller added it as to the controller parameter of PhoneFieldHint