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

rynssnjn/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

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Dart 87.8%
  • Shell 2.9%
  • Objective-C 2.8%
  • Ruby 2.7%
  • Java 2.0%
  • Swift 1.4%
  • Kotlin 0.4%