Improve InputDecoration.errorMaxLines documentation (#156468)

## Description

This PR improves the `InputDecoration.errorMaxLines` and `InputDecoration.helperMaxLines` documentations to explain when wrapping and ellipsing are applied.

## Related Issue

Fixes [InputDecoration.errorMaxLines's documentation does not match behavior](https://github.com/flutter/flutter/issues/155626).
This commit is contained in:
Bruno Leroux 2024-10-11 23:35:27 +02:00 committed by GitHub
parent 2682633381
commit 9e64b67111
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2874,7 +2874,15 @@ class InputDecoration {
/// The maximum number of lines the [helperText] can occupy. /// The maximum number of lines the [helperText] can occupy.
/// ///
/// Defaults to null, which means that the [helperText] is not limited. /// Defaults to null, which means that soft line breaks in [helperText] are
/// truncated with an ellipse while hard line breaks are respected.
/// For example, a [helperText] that overflows the width of the field will be
/// truncated with an ellipse. However, a [helperText] with explicit linebreak
/// characters (\n) will display on multiple lines.
///
/// To cause a long [helperText] to wrap, either set [helperMaxLines] or use
/// [helper] which offers more flexibility. For instance, it can be set to a
/// [Text] widget with a specific overflow value.
/// ///
/// This value is passed along to the [Text.maxLines] attribute /// This value is passed along to the [Text.maxLines] attribute
/// of the [Text] widget used to display the helper. /// of the [Text] widget used to display the helper.
@ -2972,7 +2980,15 @@ class InputDecoration {
/// The maximum number of lines the [errorText] can occupy. /// The maximum number of lines the [errorText] can occupy.
/// ///
/// Defaults to null, which means that the [errorText] is not limited. /// Defaults to null, which means that soft line breaks in [errorText] are
/// truncated with an ellipse while hard line breaks are respected.
/// For example, an [errorText] that overflows the width of the field will be
/// truncated with an ellipse. However, an [errorText] with explicit linebreak
/// characters (\n) will display on multiple lines.
///
/// To cause a long [errorText] to wrap, either set [errorMaxLines] or use
/// [error] which offers more flexibility. For instance, it can be set to a
/// [Text] widget with a specific overflow value.
/// ///
/// This value is passed along to the [Text.maxLines] attribute /// This value is passed along to the [Text.maxLines] attribute
/// of the [Text] widget used to display the error. /// of the [Text] widget used to display the error.