Overview
The sms_autofill package is a Flutter plugin that enables automatic detection and autofill of SMS verification codes on Android and iOS. It simplifies the user experience during authentication flows by automatically extracting one-time passwords (OTPs) sent via SMS, reducing manual input errors and improving conversion rates. The plugin integrates seamlessly with text fields designed for OTP entry, leveraging platform-specific APIs to detect incoming messages and populate the field programmatically.
Use cases
- Automated OTP entry in login flows
- Reducing user friction in account verification
- Improving form completion rates
- Supporting two-factor authentication
- Enabling quick sign-up with SMS codes
Key features
- Automatic SMS code detection
- Cross-platform support (Android & iOS)
- Seamless integration with TextFormField
- Minimal setup required
- Real-time code extraction from incoming messages
Suitable for
- Authentication screens requiring OTP input
- Apps with SMS-based 2FA
- User onboarding flows with phone verification
- Developers seeking improved UX for PIN/OTP fields
- Projects aiming to reduce form abandonment
Considerations
- Requires proper SMS message formatting for detection
- May not work on all devices or carriers
- Limited control over which messages are auto-filled
- Depends on platform-level SMS permissions
- Not guaranteed to work in all emulator environments
