Textfield InputDecorator height can grow to accomodate error text#17292
Textfield InputDecorator height can grow to accomodate error text#17292HansMuller merged 2 commits intoflutter:masterfrom
Conversation
| @@ -343,6 +345,7 @@ class _HelperErrorState extends State<_HelperError> with SingleTickerProviderSta | |||
| style: widget.errorStyle, | |||
| textAlign: widget.textAlign, | |||
| overflow: TextOverflow.ellipsis, | |||
There was a problem hiding this comment.
Do you also want to be able to specify the overflow here? I know that at least for Arabic, ellipsis is pretty bad as a choice (it cuts off whole words only, so often doesn't fill the available space). It's a good default, but it would be good to be able to specify it. (See #16450 also)
There was a problem hiding this comment.
That seems reasonable. An alternative would be an error widget value, which would would allow one to display anything at all for the error. The implementation is already structured this way. The hardest part might be deciding what to call the property. Maybe InputDecoration.errorWidget.
If it's OK with you, I'd like to defer this bit of evolution to a separate PR.
|
Per @HansMuller this is working as intended - this PR fixed the structure of the counter layout. |
|
@HansMuller Could you add a similar parameter but for helperText, which takes place at the exact same location as errorText ? Because at the moment it seems that we can make a multiline errorText under TextFields, but text given in helperText attribute is still wrapped. Maybe it is intentional? |


Added
InputDecoration.errorMaxLinesandInputDecorationTheme.errorMaxLines. The default is null, which matches the current implementation: the input decorator'serrorTextis '...' clipped to a single line. IferrorMaxLinesis a value greater than 1, the error text will wrap untilerrorMaxLineshave been filled and then '...' clip as before.The InputDecorator's height will grow depending on how many lines (if any) the non-null
errorTextoccupies.Also: changed the type of
InputDecoration.contentPadding. It is now EdgeInsetsGeometry, socontentPaddingvalues can be depend on the text direction.Fixes: #17172
Incorporates the contentPadding change proposed by @xclud in #16329