Skip to content
pubscout

sms_autofill

2.6.1, released 2 months ago by jaumard.com

Flutter plugin to provide SMS code autofill support.

WASM-readyUses material_ui
$ flutter pub add sms_autofill
Source repository

What it does

Provides SMS verification code autofill support for Android using the SMSRetriever API. Includes pin input widgets and mixins for custom listening behavior.

AI-written summary of version 2.6.1, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need SMS code verification autofill on Android.
  • You want PIN input fields that automatically fill when an SMS is received.

Skip it when

  • You are developing for non-mobile platforms.
  • You need full SMS reading permissions (this plugin uses SMSRetriever which does not require read SMS permissions).

Strengths

  • No permission to read SMS messages is required.
  • Provides pre-built widgets like PinFieldAutoFill and TextFieldPinAutoFill.

Weaknesses

  • Requires specific SMS formatting rules on the backend (ending with an 11-character hash string).
  • Primarily targets Android since iOS handles SMS autofill natively.

Setup

Kind
Plugin (native code)
Effort
Low
Code generation
No
Direct dependencies
3

Requires the incoming SMS message to follow the SMSRetriever API format, including the 11-character app signature hash.

await SmsAutoFill().listenForCode();

PinFieldAutoFill(
  codeLength: 6,
  onCodeChanged: (code) {
    // handle code change
  },
);

Alternatives

Packages that do the same job and could replace sms_autofill.

  • pinput

    Customizable animated PIN and OTP code input widget with autofill support.

  • pin_code_fields

    A customizable PIN and OTP input field widget for Flutter with headless core and Material support.

  • otp_autofill

    Android and iOS OTP autofill plugin using SMS User Consent and Retriever APIs.

  • flutter_form_builder

    Helps create forms in Flutter by removing boilerplate code and reusing validation.

Works with

Packages commonly used together with sms_autofill: ones it builds on, ones built on it, and its own family.