Search packages, repositories and app categories

sms_otp_auto_verify cover
Package detailsv2.2.0

sms_otp_auto_verify

A new Flutter plugin to enter a digit code usually in cases of Sms Otp Code. and provide SMS Auto Fill using library SMS Retriever API.

Android
30-day downloads
73
Likes
93
Pub points
140

Install package

flutter pub add sms_otp_auto_verify

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

A Flutter plugin designed to simplify OTP verification via SMS by enabling automatic detection and filling of one-time passcodes. It leverages Android's SMS Retriever API to scan incoming SMS messages for OTP codes, reducing manual input. Ideal for authentication flows requiring SMS-based verification, it enhances user experience by minimizing friction during login or registration processes.

Use cases

  • Automated OTP code entry in login flows
  • Streamlining user registration with SMS verification
  • Reducing user errors in manual OTP input
  • Integrating with two-factor authentication systems
  • Supporting onboarding workflows requiring phone verification

Key features

  • Automatic OTP code detection from SMS
  • Uses Android SMS Retriever API for secure retrieval
  • Minimal user interaction required
  • Simple integration with existing form fields
  • Real-time code auto-fill without app permissions

Suitable for

  • Mobile apps requiring SMS OTP verification
  • Developers seeking seamless OTP UX
  • Android-focused authentication flows
  • Apps using Google's SMS Retriever API
  • Projects prioritizing user convenience in onboarding

Considerations

  • Only available for Android platforms
  • Requires proper setup of SMS Retriever API
  • Dependent on device-level SMS access
  • May not work on all Android devices or carriers
  • Limited to SMS-based OTP delivery

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

sms_otp_auto_verify

A new Flutter plugin to enter a digit code usually in cases of Sms Otp Code. and provide SMS Auto Fill using library SMS Retriever API.

Example App

Getting Started

Import package
import 'package:sms_otp_auto_verify/sms_otp_auto_verify.dart';
Get Signature Code
String? signature = await SmsVerification.getAppSignature();
Add Widget

codeLength must equals with Sms OTP Code length

TextFieldPin(
    textController: textEditingController,
    autoFocus: true,
    codeLength: _otpCodeLength,
    alignment: MainAxisAlignment.center,
    defaultBoxSize: 46.0,
    margin: 10,
    selectedBoxSize: 46.0,
    textStyle: TextStyle(fontSize: 16),
    defaultDecoration: _pinPutDecoration.copyWith(
    border: Border.all(
    color: Theme.of(context)
    .primaryColor
        .withOpacity(0.6))),
    selectedDecoration: _pinPutDecoration,
    onChange: (code) {
    _onOtpCallBack(code,false);
}),
Listen result from OtpListTextField
_onOtpCallBack(String otpCode, bool isAutofill) {
    setState(() {
      this._otpCode = otpCode;
      if (otpCode.length == _otpCodeLength && isAutofill) {
        _enableButton = false;
        _isLoadingButton = true;
        _verifyOtpCode();
      } else if (otpCode.length == _otpCodeLength && !isAutofill) {
        _enableButton = true;
        _isLoadingButton = false;
      }else{
        _enableButton = false;
      }
    });
  }
Example Sms
<#> ExampleApp: Your code is 5664
   r64Iw/6mD1D

Categories

Source repository

Projects using this package

No data available yet.