mask_text_input_formatter 1.0.0 copy "mask_text_input_formatter: ^1.0.0" to clipboard
mask_text_input_formatter: ^1.0.0 copied to clipboard

outdated

Mask Text Input Formatter

mask_text_input_formatter #

Masked text input formatter for flutter.

logo

Example #

sample

Usage #

Follow install guide:

https://pub.dartlang.org/packages/mask_text_input_formatter#-installing-tab

Import the library:

import 'package:mask_text_input_formatter/mask_text_input_formatter.dart';

Create mask formatter:

var maskFormatter = new MaskTextInputFormatter(mask: '+# (###) ###-##-##', filter: { "#": RegExp(r'[0-9]') });

Set it to text field:

TextField(inputFormatters: [maskFormatter])

Change the mask #

You can use the updateMask method to change the mask after the formatter was created:

var textEditingController = TextEditingController(text: "12345678");
var maskFormatter = new MaskTextInputFormatter(mask: '####-####', filter: { "#": RegExp(r'[0-9]') });

TextField(controller: textEditingController, inputFormatters: [maskFormatter])  // -> "1234-5678"

textEditingController.value = maskFormatter.updateMask("##-##-##-##"); // -> "12-34-56-78"
1204
likes
0
pub points
99%
popularity

Publisher

unverified uploader

Mask Text Input Formatter

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter

More

Packages that depend on mask_text_input_formatter