Home > Software engineering >  Directly navigate to next screen without button using sms_autofill package
Directly navigate to next screen without button using sms_autofill package

Time:10-26

I'm new in flutter, i'm using sms_autofill package to listen otp from my phone.

My question is how to directly navigate to the next screen when otp already filled without making a button ?

Here's my otp screen

enter image description here

Really appreciate for your help, Thanks before...

CodePudding user response:

From the docs i see 2 callbacks you can use. Navigate inside one of the callbacks (prefer onCodeSubmitted)

onCodeSubmitted: //code submitted callback
onCodeChanged: // check if the length is your code length and do the validation

CodePudding user response:

You can use onCodeSubmitted and onCodeChanged Like the example https://i.stack.imgur.com/4eBDp.png

  _navigate(code) {
    /* if the code is succ.
  Navigate here
   */
  }
  • Related