bhrott / flutter-masked-text

A masked text for Flutter.

Home Page:https://pub.dartlang.org/packages/flutter_masked_text

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Remove mask to do a Request IDEA

lffspaniol opened this issue · comments

i'm start programing flutter 2 days ago, this is a cool project but if i need to remove the mask to do a request, the text is seted to ""

  static String maskCnpj = "00.000.000/0000-00";
  final _cnpj = MaskedTextController(mask: maskCnpj);
  final _user = TextEditingController();
  final _password = TextEditingController();
  void onClick() {
    print("potato");
    if (_formkey.currentState.validate()) {
      print(_cnpj.text); //out 12.345.678/9101-11
      print(_user.text);
      print(_password.text);
    }
  }

i try remove mask with .updateMask("") but this clean the field; ok : Im noob.
after the i remove the mask with .updateMask("00000000000000") <- THIS WORKS BUT is not cool

  static String maskCnpj = "00.000.000/0000-00";
  final _cnpj = MaskedTextController(mask: maskCnpj);
  final _user = TextEditingController();
  final _password = TextEditingController();
  void onClick() {
    print("potato");
    if (_formkey.currentState.validate()) {
      _cnpj.updateMask("00000000000000");
      print(_cnpj.text); 
      _cnpj.updateMask(maskCnpj);
      print(_user.text);
      print(_password.text);
    }
  }

maybe add a var.textNoMask will be awesome

tansk's for attention

I have the same problem. @benhurott, any news or tip?

Same here