A highly customizable Flutter package for PIN code and OTP input fields with beautiful design and animations.
Version 9.0 introduces a new headless architecture - use the ready-made Material Design implementation or build completely custom UIs!
The publishable package is located at:
packages/pin_code_fields/
๐ฆ View Package README for full documentation.
dependencies:
pin_code_fields: ^9.0.0import 'package:pin_code_fields/pin_code_fields.dart';
// Material Design (ready to use)
MaterialPinField(
length: 6,
onCompleted: (pin) => print('PIN: $pin'),
)
// Custom UI (headless)
PinInput(
length: 4,
builder: (context, cells) => YourCustomUI(cells),
)pin_code_fields/
โโโ packages/
โ โโโ pin_code_fields/ # ๐ฆ Main package
โ โโโ lib/
โ โ โโโ src/
โ โ โโโ core/ # Headless input engine
โ โ โโโ material/ # Material Design implementation
โ โโโ example/
โ โโโ test/
โ โโโ README.md
โ โโโ CHANGELOG.md
โ โโโ LICENSE
โโโ docs/
โ โโโ FEATURE_COMPARISON.md
โโโ melos.yaml
โโโ CLAUDE.md
This project uses melos for monorepo management.
# Install melos
dart pub global activate melos
# Bootstrap workspace
melos bootstrap
# Run tests
melos test
# Run analyzer
melos analyze- ๐จ Headless Architecture - Full control over UI rendering
- ๐ฑ Material Design Ready - Beautiful out-of-the-box implementation
- ๐ฎ Unified Controller - Single controller for text, focus, and errors
- โจ Rich Animations - Scale, fade, slide entry animations
- ๐ Obscure Support - Character or custom widget obscuring
- ๐ Paste Support - Long-press to paste from clipboard
- ๐ Form Integration - Works with Flutter's Form widget
- ๐ฒ Autofill Support - SMS OTP autofill for iOS/Android
- ๐ซ Error Animation - Shake animation with programmatic control
Contributions are welcome! Please feel free to submit a Pull Request.
MIT License - see LICENSE for details.
