This does not work with TextFormField
chitgoks opened this issue · comments
chitgoks commented
text_form_field.dart': Failed assertion: line 123 pos 15: 'initialValue == null || controller == null': is not true.
final MoneyMaskedTextController moneyMask = MoneyMaskedTextController();
TextFormField(
controller: moneyMask,
decoration: InputDecoration(labelText: 'Currency'),
initialValue: 0,
keyboardType: TextInputType.numberWithOptions(decimal: true),
onChanged: (value) {
value = moneyMask.text;
print(value);
},
onSaved: (value) {
moneyMask.updateValue(double.parse(value));
},
),
Kelsey Torres de Freitas Júnior commented
Hey, did you solve this problem? I'm facing this problem right now.
chitgoks commented
yes. you do not use both controller and initialValue at the same time
Kelsey Torres de Freitas Júnior commented
Many thanks @chitgoks