With the auto_sms_verification plugin, you can perform SMS-based user verification in your Android app automatically, without requiring the user to manually type verification codes, and without requiring any extra app permissions.

Please check the original doc as well

Getting Started

Import package

import 'package:auto_sms_verification/auto_sms_verification.dart';

Get Signature Code

var appSignature = await AutoSmsVerification.appSignature();

Add Widget

listen SMS

void _startListeningOtpCode() async {
    var sms = await AutoSmsVerification.startListeningSms();
    _smsCode = getCode(sms) ?? '';

Call function in initState

void initState() {

Stop Listening on dispose function

  void dispose() {

Parse OTP from SMS

String? getCode(String? sms) {
    if (sms != null) {
      final intRegex = RegExp(r'\d+', multiLine: true);
      final code = intRegex.allMatches(sms);
      return code;
    return null;

Example Sms

<#> MyApp: your one time code is 5664