Skip to content
pubscout

mask

1.0.5, released 4 years ago by an unverified publisher

Provides input masks and validators for common data types

WASM-ready
$ flutter pub add mask
Source repository

What it does

Mask offers a set of input formatters and validation functions for CPF, CNPJ, email, money, date, time, phone, and generic patterns. It simplifies form handling by providing ready‑made tools for formatting and validating user input.

AI-written summary of version 1.0.5, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need to validate Brazilian CPF/CNPJ numbers
  • You need to format and validate monetary values
  • You need to format dates, times, or phone numbers in forms
  • You want a quick way to apply generic masks with minimal configuration

Skip it when

  • You require highly custom or complex validation logic beyond the provided patterns
  • You need international phone or date formats not covered by the defaults

Strengths

  • Wide coverage of common Brazilian data formats
  • Simple API using TextFormField validators and inputFormatters
  • No external code generation or build steps required

Weaknesses

  • Limited to the predefined masks; custom regex support is minimal
  • No support for international formats outside Brazil

Setup

Kind
Flutter widgets
Effort
Low
Code generation
No
Direct dependencies
0
TextFormField(
  autovalidateMode: AutovalidateMode.onUserInteraction,
  validator: (value) => Mask.validations.money(value, min: 100.0),
  inputFormatters: [Mask.money()],
)

Alternatives

Packages that do the same job and could replace mask.