mask_text_input_formatter
2.9.0, released 3 years ago by an unverified publisher
TextInputFormatter for TextField and TextFormField to format input using a given mask.
What it does
Provides a TextInputFormatter that automatically formats text input in TextField and TextFormField widgets based on a defined mask string and regular expression filters. It supports both lazy and eager autocompletion modes, allows retrieving unmasked values, and lets you update masks dynamically.
AI-written summary of version 2.9.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need to format phone numbers, credit cards, dates, or other structured input in text fields.
- You need to easily retrieve both the masked and unmasked values from a text field.
Skip it when
- You require a full form builder solution rather than just an input formatter.
Strengths
- Easy integration with standard Flutter TextField and TextFormField widgets.
- Supports dynamic mask updates and lazy/eager autocompletion types.
- Provides methods to retrieve both masked and unmasked text values easily.
Weaknesses
- Limited to text formatting via string masks and filters.
- No built-in comprehensive collection of predefined regional masks (like international phone formats) out of the box.
Setup
- Kind
- Flutter widgets
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 0
var maskFormatter = new MaskTextInputFormatter(
mask: '+# (###) ###-##-##',
filter: { "#": RegExp(r'[0-9]') },
type: MaskAutoCompletionType.lazy
);
TextField(inputFormatters: [maskFormatter])Alternatives
Packages that do the same job and could replace mask_text_input_formatter.
- mask_input_formatter
A TextInputFormatter that applies a custom mask to TextField/TextFormField input.
48Compare - 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
Works with
Packages commonly used together with mask_text_input_formatter: ones it builds on, ones built on it, and its own family.
- nylo_supportBuilt on mask_text_input_formatterSupport library for the Nylo framework offering routing, networking, storage, widgets and more.
- br_validatorsBuilt on mask_text_input_formatterValidation functions and input masks for common Brazilian documents and data.
- kartalBuilt on mask_text_input_formatterCollection of Dart and Flutter extensions for context, primitive variables, and common utilities.
- fancy_credit_card_inputBuilt on mask_text_input_formatterA highly customizable credit card input field with built-in animations and card brand detection.