Skip to content

Commit fd50a1b

Browse files
blerouxmaheshj01
authored andcommitted
Update InputDecoration.border documentation (flutter#161415)
## Description This PR clarifies the InputDecoration.border documentation and fixes two typos. ## Related Issue Fixes [[Material] Outline TextFields don't respect OutlineInputBorder.color](flutter#31169) ## Tests Documentation only
1 parent 8c5874b commit fd50a1b

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

packages/flutter/lib/src/material/input_decorator.dart

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3674,15 +3674,18 @@ class InputDecoration {
36743674

36753675
/// The shape of the border to draw around the decoration's container.
36763676
///
3677-
/// If [border] is a [MaterialStateUnderlineInputBorder]
3678-
/// or [MaterialStateOutlineInputBorder], then the effective border can depend on
3679-
/// the [WidgetState.focused] state, i.e. if the [TextField] is focused or not.
3677+
/// If [border] is a [WidgetStateInputBorder] then the effective border is resolved
3678+
/// in the following states:
3679+
/// * [WidgetState.disabled].
3680+
/// * [WidgetState.error].
3681+
/// * [WidgetState.focused].
3682+
/// * [WidgetState.hovered].
36803683
///
36813684
/// If [border] derives from [InputBorder] the border's [InputBorder.borderSide],
36823685
/// i.e. the border's color and width, will be overridden to reflect the input
36833686
/// decorator's state. Only the border's shape is used. If custom [BorderSide]
3684-
/// values are desired for a given state, all four borders – [errorBorder],
3685-
/// [focusedBorder], [enabledBorder], [disabledBorder] – must be set.
3687+
/// values are desired for a given state, all five borders – [errorBorder],
3688+
/// [focusedBorder], [enabledBorder], [disabledBorder], [focusedErrorBorder] – must be set.
36863689
///
36873690
/// The decoration's container is the area which is filled if [filled] is
36883691
/// true and bordered per the [border]. It's the area adjacent to

packages/flutter/lib/src/material/material_state.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ typedef MaterialStateTextStyle = WidgetStateTextStyle;
281281
///
282282
/// This class exists to enable widgets with [OutlineInputBorder] valued properties
283283
/// to also accept [MaterialStateProperty<OutlineInputBorder>] values. A material
284-
/// state input border property represents a text style which depends on
284+
/// state input border property represents an input border which depends on
285285
/// a widget's "interactive state". This state is represented as a
286286
/// [Set] of [MaterialState]s, like [MaterialState.pressed],
287287
/// [MaterialState.focused] and [MaterialState.hovered].
@@ -361,7 +361,7 @@ class _MaterialStateOutlineInputBorder extends MaterialStateOutlineInputBorder {
361361
///
362362
/// This class exists to enable widgets with [UnderlineInputBorder] valued properties
363363
/// to also accept [MaterialStateProperty<UnderlineInputBorder>] values. A material
364-
/// state input border property represents a text style which depends on
364+
/// state input border property represents an input border which depends on
365365
/// a widget's "interactive state". This state is represented as a
366366
/// [Set] of [MaterialState]s, like [MaterialState.pressed],
367367
/// [MaterialState.focused] and [MaterialState.hovered].

0 commit comments

Comments
 (0)