Skip to content
pubscout

pattern_formatter

5.0.0, released 5 weeks ago by hunghd.dev

Provides implementations of TextInputFormatter to format input with pre-defined patterns.

WASM-ready
$ flutter pub add pattern_formatter
Source repository

What it does

Provides pre-defined TextInputFormatter implementations for Flutter TextFields. It supports formatting for thousands grouping in integer and decimal numbers, credit card number grouping, and date formatting.

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

Use it when

  • You need to format numeric text inputs with thousands separators or decimals.
  • You need to format credit card numbers automatically as the user types.
  • You need to format date inputs using predefined patterns.

Skip it when

  • You require complex custom masks that fall outside of the provided pattern implementations.

Strengths

  • Simple to use directly inside standard TextField inputFormatters.
  • Supports thousands grouping, decimal fractions, credit cards, and dates out of the box.

Weaknesses

  • Limited to the pre-defined patterns provided by the package.

Setup

Kind
Flutter widgets
Effort
Low
Code generation
No
Direct dependencies
1
TextField(
  keyboardType: TextInputType.number,
  inputFormatters: [
    ThousandsFormatter()
  ],
)

Alternatives

Packages that do the same job and could replace pattern_formatter.

Works with

Packages commonly used together with pattern_formatter: ones it builds on, ones built on it, and its own family.