mask_input_formatter
0.0.3, released 5 years ago by amjadjamali06.blogspot.com
A TextInputFormatter that applies a custom mask to TextField/TextFormField input.
What it does
Provides MaskInputFormatter to format user input according to a mask pattern (e.g., dates, phone numbers). It restricts characters based on mask symbols like 'A' for letters and '#' for digits.
AI-written summary of version 0.0.3, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need simple input masking for phone numbers, dates, or custom codes
- You want a lightweight solution without extra dependencies
Skip it when
- You require complex validation or dynamic mask changes
- You need locale‑aware formatting or advanced form handling
Strengths
- Very easy to integrate
- Null‑safe and works on all Flutter platforms
- Supports custom mask patterns
Weaknesses
- Limited to static masks
- No built‑in validation beyond character restrictions
- No support for dynamic mask updates
Setup
- Kind
- Flutter widgets
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 0
import 'package:mask_input_formatter/mask_input_formatter.dart';
MaskInputFormatter myFormatter = MaskInputFormatter(mask: '(AA) #####');
TextFormField(
inputFormatters: [myFormatter],
decoration: InputDecoration(hintText: "(AB) 12345"),
);Alternatives
Packages that do the same job and could replace mask_input_formatter.
- mask_text_input_formatter
TextInputFormatter for TextField and TextFormField to format input using a given mask.
50Compare - pattern_formatter
Provides implementations of TextInputFormatter to format input with pre-defined patterns.
82Compare - textfield_search
TextField widget to search and select values from a static list or future.
76Compare - languagetool_textfield
A text field widget with real-time spell-checking and grammar correction using LanguageTool API.
76Compare