From 61b890bfcbc106bc011007c6ac6fd42ec87c9818 Mon Sep 17 00:00:00 2001 From: Hans Muller Date: Wed, 13 Sep 2023 10:33:08 -0700 Subject: [PATCH] Updated MaterialStatesController class api doc (#134592) Resolves https://github.com/flutter/flutter/pull/133977#discussion_r1320373180 --- .../flutter/lib/src/material/material_state.dart | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/packages/flutter/lib/src/material/material_state.dart b/packages/flutter/lib/src/material/material_state.dart index 6fad0799ffad2..59d5dfcb71ee9 100644 --- a/packages/flutter/lib/src/material/material_state.dart +++ b/packages/flutter/lib/src/material/material_state.dart @@ -735,11 +735,21 @@ class MaterialStatePropertyAll implements MaterialStateProperty { /// /// Used by widgets that expose their internal state for the sake of /// extensions that add support for additional states. See -/// [TextButton.statesController] for example. +/// [TextButton] for an example. /// /// The controller's [value] is its current set of states. Listeners /// are notified whenever the [value] changes. The [value] should only be /// changed with [update]; it should not be modified directly. +/// +/// The controller's [value] represents the set of states that a +/// widget's visual properties, typically [MaterialStateProperty] +/// values, are resolved against. It is _not_ the intrinsic state of +/// the widget. The widget is responsible for ensuring that the +/// controller's [value] tracks its intrinsic state. For example one +/// cannot request the keyboard focus for a widget by adding +/// [MaterialState.focused] to its controller. When the widget gains the +/// or loses the focus it will [update] its controller's [value] and +/// notify listeners of the change. class MaterialStatesController extends ValueNotifier> { /// Creates a MaterialStatesController. MaterialStatesController([Set? value]) : super({...?value});