patternformatter
a flutter package provides some implementations of text input formatter that format input with pre-defined patterns.
how to use text input formatter
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(),
],
)
Comments are closed.