flutter-masked-text icon indicating copy to clipboard operation
flutter-masked-text copied to clipboard

Remove mask to do a Request IDEA

Open lffspaniol opened this issue 5 years ago • 3 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

lffspaniol avatar Oct 14 '19 20:10 lffspaniol

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

ciceropablo avatar Nov 27 '19 14:11 ciceropablo

Same here

git-xbits avatar Jan 22 '20 21:01 git-xbits

Same

lramondev avatar Feb 14 '20 15:02 lramondev