flutter_otp 0.3.2 copy "flutter_otp: ^0.3.2" to clipboard
flutter_otp: ^0.3.2 copied to clipboard

A Flutter package for sending and validating OTP. Four digit OTP (customizable) is sent as a SMS to the given phone number (and country code).

example/example.md

flutter_otp #

A Flutter package for iOS and Android for sending and verifying OTP to a Phone number. For code example see this example code

⭐ the repo to show your support !

Example #

Example Usage:

...
sendOtp('958347XXXX');  //Pass phone number as String

...

int enteredOtp;
TextField(
  onChanged: (val) {
    enteredOtp = val;    
  }
)

...

bool isCorrectOTP = resultChecker();
if(isCorrectOTP) {
    print('Success');
} else {
    print('Failure');
}
...

OR custom "messageText" can be passed as parameter to sendOTP

...
sendOtp('958347XXXX', 'OTP is : ');  //Pass phone number and Custom messaseText as String

...

int enteredOtp;
TextField(
  onChanged: (val) {
    enteredOtp = val;    
  }
)

...

bool isCorrectOTP = resultChecker();
if(isCorrectOTP) {
    print('Success');
} else {
    print('Failure');
}
...

More Information #

Pub package Flutter documentation.

85
likes
40
pub points
69%
popularity

Publisher

unverified uploader

A Flutter package for sending and validating OTP. Four digit OTP (customizable) is sent as a SMS to the given phone number (and country code).

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

flutter, sms

More

Packages that depend on flutter_otp