-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Description
Is there an existing issue for this?
- I have searched the existing issues
- I have read the guide to filing a bug
Use case
InputDecorator.error added in #129275 is completely useless in its current form.
In fact, it is just a widget displayed under TextField, while blocking access to errorText, which completely breaks the existing validation mechanisms.
All interaction with this widget has to be done completely manually. If you put the TextField in Column, and our error widget under it, the effect will be exactly the same.
Because of this, closed #11068 is not actually resolved.
Proposal
#129275 is a fork of #118610, where this problem was discovered and discussion of possible solution methods began.
Four solutions to the problem were proposed in #118610 (comment), two of which were discarded.
Meanwhile, neither of the other two were implemented in #129275, for some reason approved for merging.
These options are:
Option 2
AddWidget errorinInputDecoration
Add a validator variant:Widget? Function(String? input)? validatorBuilderinFormField. It allows to replace the classical validator with a version that can return a Widget instead of a string.
This option was liked by @justinmc but wasn't implemented in #129275
Option 4
AddWidget Function(String)? errorBuilderonInputDecorationwhich when not null is called to converterrorTextto a Widget.
Both of these options solve the problem that has arisen.
I am willing to implement this, but I need approval and need to choose one of these options.