v0.0.3mask_input_formatter
TextInputFormatter for TextField and TextFormField which format the input by a given mask.
amjadjamali06/mask_input_formatter open-source repository details.
English project snapshot. Visit GitHub for the latest content.
The package provides TextInputFormatter for TextField and TextFormField which format the input by a given mask.
Run this command:
With Flutter:
$ flutter pub add mask_input_formatter
or add following package in your pubspec.yaml file inside the dependencies: section.
dependencies:
mask_input_formatter: ^0.0.3
import 'package:mask_input_formatter/mask_input_formatter.dart';
MaskInputFormatter myFormatter = MaskInputFormatter(mask: '(AA) #####');
TextFormField(
inputFormatters: [myFormatter],
decoration: InputDecoration(
hintText: "(AB) 12345",
)
) // TextFormField
// Input --> JK75757
// Output --> (JK) 75757 set formatted text on TextField
You can use the mask whatever you defined in formatter:
MaskInputFormatter dateFormatter = MaskInputFormatter(mask: '##/##/####');
// --> 26/05/2021
MaskInputFormatter phoneFormatter = MaskInputFormatter(mask: '+# (###) ###-####');
// --> +1 (234) 567-8901
MaskInputFormatter numberFormatter = MaskInputFormatter(mask: 'AAA-###', textAllCaps: true);
// --> XYZ-789
Check example folder for code sample
In last example. --> (AAA-###)
Suggestions and Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Amjad Jamali & team members ( Kamran Khan, Hina Hussain, Faiza Farooqui ) :tada:
Dependency list 2 items
{"sdk":"flutter"}{"sdk":"flutter"}Start with your use case, compare repository activity, and check the original project before adopting it.
“A repository is the most basic element of GitHub.”
GitHub Docs — About repositories ↗