A package for masked texts, so if you want a mask for phone, or zip code or any kind of mask, just use it :D
It's very simple, it's a Widget as all the other ones.
new MaskedTextField ( maskedTextFieldController: _textCPFController, mask: "xxx.xxx.xxx-xx", maxLength: 14, keyboardType: TextInputType.number, inputDecoration: new InputDecoration( hintText: "Write you Document here", labelText: "CPF"), );
'x' is the normal char that your text will have.
this sample reproduces something like this in the end:
111.111.111-11 (if you type all '1' of course, hehehe).
You can also change the escape character you want to use.
If you want to change it, you just need to fill the property
escapeCharacter with the character you want.
new MaskedTextField ( maskedTextFieldController: _textCPFController, escapeCharacter: '#', mask: "###.###.###-##", maxLength: 14, keyboardType: TextInputType.number, inputDecoration: new InputDecoration( hintText: "Write you Document here", labelText: "CPF"), );
'x' is the default escape character.
Add this to your package's pubspec.yaml file:
dependencies: masked_text: "^0.0.4"
You can install packages from the command line:
$ flutter packages get
Alternatively, your editor might support
flutter packages get.
Check the docs for your editor to learn more.
Now in your Dart code, you can use:
|0.0.4||May 5, 2018|
|0.0.3||May 1, 2018|
|0.0.2||Apr 26, 2018|
|0.0.1||Apr 22, 2018|
We analyzed this package on Jul 13, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Detected platforms: Flutter
References Flutter, and has no conflicting libraries.
The description is too short.
Add more detail about the package, what it does and what is its target use case. Try to write at least 60 characters.
Package is pre-v1 release.
While there is nothing inherently wrong with versions of
0.*.*, it usually means that the author is still experimenting with the general direction API.
Maintain an example.
Create a short demo in the
example/directory to show how to use this package. Common file name patterns include:
example.dartor you could also use
Fix analysis and formatting issues.
Analysis or formatting checks reported 1 hint.
flutter formatto format