Skip to content

A Flutter package provides some implementations of TextInputFormatter that format input with pre-defined patterns

License

Notifications You must be signed in to change notification settings

hnvn/flutter_pattern_formatter

Repository files navigation

PatternFormatter

pub package codecov

A Flutter package provides some implementations of TextInputFormatter that format input with pre-defined patterns

How to use

import 'package:pattern_formatter/pattern_formatter.dart';

Thousands grouping

  • Integer number:

TextField(
  keyboardType: TextInputType.number,
  inputFormatters: [
    ThousandsFormatter()
  ],
)
  • Decimal number:

TextField(
  keyboardType: TextInputType.number,
  inputFormatters: [
    ThousandsFormatter(allowFraction: true)
  ],
)

Card number grouping

TextField(
  keyboardType: TextInputType.number,
  inputFormatters: [
    CreditCardFormatter(),
  ],
)

Date format

TextField(
  keyboardType: TextInputType.number,
  inputFormatters: [
    DateInputFormatter(),
  ],
)

About

A Flutter package provides some implementations of TextInputFormatter that format input with pre-defined patterns

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •