CustomInputController constructor

CustomInputController({
  1. String? text,
  2. required String mask,
  3. Map<String, RegExp>? translator,
})

Implementation

CustomInputController({String? text, required this.mask, Map<String, RegExp>? translator}) : super(text: text) {
  this.translator = translator ?? CustomInputController.getDefaultTranslator();

  this.addListener(() {
    var previous = this._lastUpdatedText;
    if (this.beforeChange(previous, this.text)) {
      this.updateText(this.text);
      this.afterChange(previous, this.text);
    } else {
      this.updateText(this._lastUpdatedText);
    }
  });

  this.updateText(this.text);
}