flutter_otp 0.3.2 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).
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');
}
...