![](https://createapp.pro/wp-content/uploads/2024/05/createapp-391914430.jpg)
Masked Text Field
Masked Text Field
Features
A package for masked text field for formet your text and good UI, so if you want a mask for phone number, or IP address or any kind of formate. Use this package.
Getting started
Add the dependency in pubsec.yaml file.
dart
dependencies:
flutter:
sdk: flutter
masked_text_field: any
Usage Example
import flutter_social_button.dart
import 'package:masked_text_field/masked_text_field.dart';
for add Text Field
It’s very simple, it’s a Widget as all the other ones.
MaskedTextField
(
maskedTextFieldController: textfieldController,
mask: "xxx.xxx.xxx.xxx",
maxLength: 15,
keyboardType: TextInputType.number,
inputDecoration: new InputDecoration(
hintText: "192.192.192.192", labelText: "IP Address"),
);
‘x’ is the normal char that your text will have.
this sample reproduces something like this in the end: 192.192.192.192.
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.
MaskedTextField
(
maskedTextFieldController: textfieldController,
escapeCharacter: '#',
mask: "###.###.###.###",
maxLength: 15,
keyboardType: TextInputType.number,
inputDecoration: new InputDecoration(
hintText: "192.192.192.192", labelText: "IP Address"),
);
‘x’ is the default escape character.
Example
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.