Update InputDecoration.border documentation (#161415)

## Description

This PR clarifies the InputDecoration.border documentation and fixes two
typos.

## Related Issue

Fixes [[Material] Outline TextFields don't respect
OutlineInputBorder.color](https://github.com/flutter/flutter/issues/31169)

## Tests

Documentation only
This commit is contained in:
Bruno Leroux 2025-01-14 08:39:39 +01:00 committed by GitHub
parent c16b9c52e4
commit e23c31265d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 10 additions and 7 deletions

View File

@ -3655,15 +3655,18 @@ class InputDecoration {
/// The shape of the border to draw around the decoration's container. /// The shape of the border to draw around the decoration's container.
/// ///
/// If [border] is a [MaterialStateUnderlineInputBorder] /// If [border] is a [WidgetStateInputBorder] then the effective border is resolved
/// or [MaterialStateOutlineInputBorder], then the effective border can depend on /// in the following states:
/// the [WidgetState.focused] state, i.e. if the [TextField] is focused or not. /// * [WidgetState.disabled].
/// * [WidgetState.error].
/// * [WidgetState.focused].
/// * [WidgetState.hovered].
/// ///
/// If [border] derives from [InputBorder] the border's [InputBorder.borderSide], /// If [border] derives from [InputBorder] the border's [InputBorder.borderSide],
/// i.e. the border's color and width, will be overridden to reflect the input /// i.e. the border's color and width, will be overridden to reflect the input
/// decorator's state. Only the border's shape is used. If custom [BorderSide] /// decorator's state. Only the border's shape is used. If custom [BorderSide]
/// values are desired for a given state, all four borders [errorBorder], /// values are desired for a given state, all five borders [errorBorder],
/// [focusedBorder], [enabledBorder], [disabledBorder] must be set. /// [focusedBorder], [enabledBorder], [disabledBorder], [focusedErrorBorder] must be set.
/// ///
/// The decoration's container is the area which is filled if [filled] is /// The decoration's container is the area which is filled if [filled] is
/// true and bordered per the [border]. It's the area adjacent to /// true and bordered per the [border]. It's the area adjacent to

View File

@ -281,7 +281,7 @@ typedef MaterialStateTextStyle = WidgetStateTextStyle;
/// ///
/// This class exists to enable widgets with [OutlineInputBorder] valued properties /// This class exists to enable widgets with [OutlineInputBorder] valued properties
/// to also accept [MaterialStateProperty<OutlineInputBorder>] values. A material /// to also accept [MaterialStateProperty<OutlineInputBorder>] values. A material
/// state input border property represents a text style which depends on /// state input border property represents an input border which depends on
/// a widget's "interactive state". This state is represented as a /// a widget's "interactive state". This state is represented as a
/// [Set] of [MaterialState]s, like [MaterialState.pressed], /// [Set] of [MaterialState]s, like [MaterialState.pressed],
/// [MaterialState.focused] and [MaterialState.hovered]. /// [MaterialState.focused] and [MaterialState.hovered].
@ -361,7 +361,7 @@ class _MaterialStateOutlineInputBorder extends MaterialStateOutlineInputBorder {
/// ///
/// This class exists to enable widgets with [UnderlineInputBorder] valued properties /// This class exists to enable widgets with [UnderlineInputBorder] valued properties
/// to also accept [MaterialStateProperty<UnderlineInputBorder>] values. A material /// to also accept [MaterialStateProperty<UnderlineInputBorder>] values. A material
/// state input border property represents a text style which depends on /// state input border property represents an input border which depends on
/// a widget's "interactive state". This state is represented as a /// a widget's "interactive state". This state is represented as a
/// [Set] of [MaterialState]s, like [MaterialState.pressed], /// [Set] of [MaterialState]s, like [MaterialState.pressed],
/// [MaterialState.focused] and [MaterialState.hovered]. /// [MaterialState.focused] and [MaterialState.hovered].