https://github.com/hnvn/flutter_pattern_formatter
A Flutter package provides some implementations of TextInputFormatter that format input with pre-defined patterns
https://github.com/hnvn/flutter_pattern_formatter
flutter flutter-package formatters textinputformatter
Last synced: 3 months ago
JSON representation
A Flutter package provides some implementations of TextInputFormatter that format input with pre-defined patterns
- Host: GitHub
- URL: https://github.com/hnvn/flutter_pattern_formatter
- Owner: hnvn
- License: bsd-3-clause
- Created: 2019-01-02T10:55:07.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-06-25T10:58:24.000Z (about 1 year ago)
- Last Synced: 2025-03-29T13:09:35.487Z (4 months ago)
- Topics: flutter, flutter-package, formatters, textinputformatter
- Language: C++
- Homepage:
- Size: 1.01 MB
- Stars: 216
- Watchers: 7
- Forks: 85
- Open Issues: 16
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# PatternFormatter
[](https://pub.dartlang.org/packages/pattern_formatter)  [](https://codecov.io/gh/hnvn/flutter_pattern_formatter)
A Flutter package provides some implementations of TextInputFormatter that format input with pre-defined patterns
## How to use
```dart
import 'package:pattern_formatter/pattern_formatter.dart';
```### Thousands grouping
* Integer number:
![]()
```dart
TextField(
keyboardType: TextInputType.number,
inputFormatters: [
ThousandsFormatter()
],
)
```* Decimal number:
![]()
```dart
TextField(
keyboardType: TextInputType.number,
inputFormatters: [
ThousandsFormatter(allowFraction: true)
],
)
```### Card number grouping
![]()
```dart
TextField(
keyboardType: TextInputType.number,
inputFormatters: [
CreditCardFormatter(),
],
)
```### Date format
![]()
```dart
TextField(
keyboardType: TextInputType.number,
inputFormatters: [
DateInputFormatter(),
],
)
```