From e23c31265d75644fa89423321a5504620f09fa1c Mon Sep 17 00:00:00 2001 From: Bruno Leroux Date: Tue, 14 Jan 2025 08:39:39 +0100 Subject: [PATCH] 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 --- .../flutter/lib/src/material/input_decorator.dart | 13 ++++++++----- .../flutter/lib/src/material/material_state.dart | 4 ++-- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/packages/flutter/lib/src/material/input_decorator.dart b/packages/flutter/lib/src/material/input_decorator.dart index 2eb5eac247..9368dbaf7d 100644 --- a/packages/flutter/lib/src/material/input_decorator.dart +++ b/packages/flutter/lib/src/material/input_decorator.dart @@ -3655,15 +3655,18 @@ class InputDecoration { /// The shape of the border to draw around the decoration's container. /// - /// If [border] is a [MaterialStateUnderlineInputBorder] - /// or [MaterialStateOutlineInputBorder], then the effective border can depend on - /// the [WidgetState.focused] state, i.e. if the [TextField] is focused or not. + /// If [border] is a [WidgetStateInputBorder] then the effective border is resolved + /// in the following states: + /// * [WidgetState.disabled]. + /// * [WidgetState.error]. + /// * [WidgetState.focused]. + /// * [WidgetState.hovered]. /// /// 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 /// decorator's state. Only the border's shape is used. If custom [BorderSide] - /// values are desired for a given state, all four borders – [errorBorder], - /// [focusedBorder], [enabledBorder], [disabledBorder] – must be set. + /// values are desired for a given state, all five borders – [errorBorder], + /// [focusedBorder], [enabledBorder], [disabledBorder], [focusedErrorBorder] – must be set. /// /// 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 diff --git a/packages/flutter/lib/src/material/material_state.dart b/packages/flutter/lib/src/material/material_state.dart index ee7233e22a..d6cfc214ff 100644 --- a/packages/flutter/lib/src/material/material_state.dart +++ b/packages/flutter/lib/src/material/material_state.dart @@ -281,7 +281,7 @@ typedef MaterialStateTextStyle = WidgetStateTextStyle; /// /// This class exists to enable widgets with [OutlineInputBorder] valued properties /// to also accept [MaterialStateProperty] 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 /// [Set] of [MaterialState]s, like [MaterialState.pressed], /// [MaterialState.focused] and [MaterialState.hovered]. @@ -361,7 +361,7 @@ class _MaterialStateOutlineInputBorder extends MaterialStateOutlineInputBorder { /// /// This class exists to enable widgets with [UnderlineInputBorder] valued properties /// to also accept [MaterialStateProperty] 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 /// [Set] of [MaterialState]s, like [MaterialState.pressed], /// [MaterialState.focused] and [MaterialState.hovered].