A Flutter package that provides a TextInputFormatter for TextField and TextFormField to automatically format user input according to a specified mask. It helps users enter data like phone numbers, dates, or IDs in a structured way by inserting placeholders and formatting characters dynamically as they type. The formatter supports custom masks and handles backspace and cursor movement correctly across platforms. Ideal for improving input accuracy and user experience in forms requiring specific formats.
Use cases
- Phone number input with country code
- Date entry with separators
- Credit card number formatting
- Custom numeric or alphanumeric patterns
- Form validation through input structure
- Dynamic field formatting
Key features
- Supports customizable masks
- Handles backspace and cursor positioning
- Cross-platform compatibility
- Real-time input formatting
- Easy integration with TextField and TextFormField
- Flexible placeholder and separator configuration
Suitable for
- Form inputs requiring structured data
- Mobile and web applications with input validation
- User-friendly data entry interfaces
- Developers seeking simple masking solutions
- Apps needing consistent input patterns
Considerations
- May require careful mask definition to avoid conflicts
- Limited support for complex dynamic masks
- Performance impact on high-frequency input
- Not suitable for non-text input types
- Requires manual handling of edge cases like paste operations
