FLUTTER ECOSYSTEM

mask_text_input_formatter

The package provides TextInputFormatter for TextField and TextFormField which format the input by a given mask.

mask_text_input_formatter cover
Latest version
2.9.0
30-day downloads
478.6K
Likes
1.3K
Pub points
160

Package Overview

Selection guidance generated from public package information. For reference only.

Overview

The mask_text_input_formatter package provides a TextInputFormatter for Flutter's TextField and TextFormField widgets, enabling real-time input formatting using customizable masks. It helps users enter data like phone numbers, dates, or IDs in a structured way by automatically inserting separators and enforcing format rules as they type. The formatter supports dynamic masks and handles cursor positioning correctly across platforms. It is ideal for forms requiring consistent input patterns without manual validation.

Use cases
  • Phone number input with country code formatting
  • Date entry with DD/MM/YYYY mask
  • Credit card number formatting with spaces
  • Custom numeric or alphanumeric pattern inputs
  • Form fields requiring strict data structure
Key features
  • Real-time input masking
  • Support for dynamic and static masks
  • Correct cursor positioning during editing
  • Cross-platform compatibility (Android, iOS, Web, macOS, Windows, Linux)
  • Easy integration with TextField and TextFormField
Suitable for
  • Form builders needing structured input
  • Internationalization-ready input fields
  • Data collection apps with strict format requirements
  • User-friendly data entry interfaces
  • Developers seeking minimal validation logic
Considerations
  • May require careful mask definition to avoid unexpected behavior
  • Can interfere with copy-paste operations if not configured properly
  • Limited support for complex conditional masks
  • Performance impact on high-frequency input scenarios
  • Not suitable for non-text input types
Supported platformsAndroidiOSWebmacOSWindowsLinux

Install package

flutter pub add mask_text_input_formatter

Categories

Source repository

Related projects

Rankings