You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm attempting to use this library to mask some of my TextFormField fields. However, when I add the controller attribute using the MaskedTextController, whenever I tap on the next field or exit the field I'm editing by any way, the TextFormField value is cleaned.
I've checked issues #13 and #28 but neither helped me.
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, v1.9.1+hotfix.6, on Mac OS X 10.15.1 19B88, locale
en-US)
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.1)
[✓] Xcode - develop for iOS and macOS (Xcode 11.2.1)
[✓] Android Studio (version 3.5)
[✓] IntelliJ IDEA Ultimate Edition (version 2019.3)
[!] Connected device
! No devices available
! Doctor found issues in 1 category.
The text was updated successfully, but these errors were encountered:
Try declare your controller outside of build method as a propertie.
`class _SignupInfoStepState extends State {
final formKey = GlobalKey();
final cpfController = MaskedTextController(mask: '000.000.000-00', text: widget.form.cpf);
@OverRide
Widget build(BuildContext context) {
final theme = Theme.of(context);
`
Try declare your controller outside of build method as a propertie.
`class _SignupInfoStepState extends State {
final formKey = GlobalKey();
final cpfController = MaskedTextController(mask: '000.000.000-00', text: widget.form.cpf);
@OverRide
Widget build(BuildContext context) {
final theme = Theme.of(context);
`
Thank you! I had mine declared inside the build method, once I put it above the build method it worked.
Hi
I'm attempting to use this library to mask some of my
TextFormField
fields. However, when I add the controller attribute using theMaskedTextController
, whenever I tap on the next field or exit the field I'm editing by any way, theTextFormField
value is cleaned.I've checked issues #13 and #28 but neither helped me.
Dependency:
This is my code:
flutter doctor:
The text was updated successfully, but these errors were encountered: