pinput
7.0.0, released 7 weeks ago by tornike.dev
Customizable animated PIN and OTP code input widget with autofill support.
What it does
Provides a dedicated input widget for PIN codes, passcodes, and one-time passwords (OTP). It supports animated state transitions between default, focused, submitted, and error themes along with form validation. It handles clipboard pasting and integrates with iOS keyboard autofill and Android SMS retrieval workflows.
AI-written summary of version 7.0.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- Building two-factor authentication (2FA) or phone verification screens requiring OTP input.
- Designing passcodes, lock screens, or gift voucher code entries.
- Needing smooth animated transitions between different input box states (focused, error, completed).
Skip it when
- Only needing standard multiline or single-line generic text inputs without individual digit cells.
- Working on legacy Flutter setups that cannot satisfy the Flutter >= 3.44.0 requirement of version 7.0.0.
Strengths
- Extensively customizable with separate themes for default, focused, submitted, and error states.
- Supports iOS native autofill out of the box and integrates smoothly with Android SMS APIs.
- Includes built-in Form validation, custom cursors, obscuring widgets, and haptic feedback.
Weaknesses
- Android SMS autofill requires external packages (like smart_auth) or custom Firebase Auth handling rather than working out of the box.
- Breaking change in version 7.0.0 migrated to material_ui, requiring newer Flutter and Dart SDK versions.
Setup
- Kind
- Flutter widgets
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 2
iOS autofill works out of the box; Android automatic SMS retrieval requires configuration with Firebase Auth or third-party packages like smart_auth.
Pinput(
defaultPinTheme: PinTheme(
width: 56,
height: 56,
decoration: BoxDecoration(
border: Border.all(color: Colors.grey),
borderRadius: BorderRadius.circular(8),
),
),
validator: (pin) => pin == '2222' ? null : 'Pin is incorrect',
onCompleted: (pin) => print(pin),
);Alternatives
Packages that do the same job and could replace pinput.
- pin_code_fields
Offers an established alternative for PIN and OTP input fields if you are targeting older Flutter SDK versions.
93Compare
Works with
Packages commonly used together with pinput: ones it builds on, ones built on it, and its own family.