-
Notifications
You must be signed in to change notification settings - Fork 124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Get text with no mask #55
Comments
I have the same problem, my field receives a mask of type '000.000.000-00' but in the database I need to write only '00000000000' as I would do to obtain the unformatted value? I tried to do it in several ways with the updatemask but it clears the string: Example: print (myController.text); Result: I / flutter (22318): 102.710.347-26 |
I did a test here but it doesn’t apply to all cases, but I believe it already serves as a base, I’ll check and see if it improves I hope it will serve as a basis for your package: String get rawNumberValue { but if mask has the character '|' going to be a problem or "Only for numbers" String get numberValue{ |
Use regex: |
You have to remember that it’s not just a number, the return may be letters and characters .... |
It is do not possible to get the text with no mask, example:
var controller = new MaskedTextController(text: '', mask: '000-000');
controller.updateText('123456');
print(controller.text); //123-456
but if do you need the value like this ?:
print(controller.text); //123456
The text was updated successfully, but these errors were encountered: