Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: 4 days 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 (about 6 years ago)
- Default Branch: master
- Last Pushed: 2024-06-25T10:58:24.000Z (7 months ago)
- Last Synced: 2025-01-19T14:13:20.206Z (11 days ago)
- Topics: flutter, flutter-package, formatters, textinputformatter
- Language: C++
- Homepage:
- Size: 1.01 MB
- Stars: 215
- Watchers: 8
- Forks: 85
- Open Issues: 16
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# PatternFormatter
[![pub package](https://img.shields.io/pub/v/pattern_formatter.svg)](https://pub.dartlang.org/packages/pattern_formatter) ![](https://github.com/hnvn/flutter_pattern_formatter/workflows/unit%20test/badge.svg) [![codecov](https://codecov.io/gh/hnvn/flutter_pattern_formatter/branch/master/graph/badge.svg)](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(),
],
)
```