Skip to content

Commit 61b890b

Browse files
authored
Updated MaterialStatesController class api doc (flutter#134592)
Resolves flutter#133977 (comment)
1 parent 7cd8b40 commit 61b890b

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

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

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -735,11 +735,21 @@ class MaterialStatePropertyAll<T> implements MaterialStateProperty<T> {
735735
///
736736
/// Used by widgets that expose their internal state for the sake of
737737
/// extensions that add support for additional states. See
738-
/// [TextButton.statesController] for example.
738+
/// [TextButton] for an example.
739739
///
740740
/// The controller's [value] is its current set of states. Listeners
741741
/// are notified whenever the [value] changes. The [value] should only be
742742
/// changed with [update]; it should not be modified directly.
743+
///
744+
/// The controller's [value] represents the set of states that a
745+
/// widget's visual properties, typically [MaterialStateProperty]
746+
/// values, are resolved against. It is _not_ the intrinsic state of
747+
/// the widget. The widget is responsible for ensuring that the
748+
/// controller's [value] tracks its intrinsic state. For example one
749+
/// cannot request the keyboard focus for a widget by adding
750+
/// [MaterialState.focused] to its controller. When the widget gains the
751+
/// or loses the focus it will [update] its controller's [value] and
752+
/// notify listeners of the change.
743753
class MaterialStatesController extends ValueNotifier<Set<MaterialState>> {
744754
/// Creates a MaterialStatesController.
745755
MaterialStatesController([Set<MaterialState>? value]) : super(<MaterialState>{...?value});

0 commit comments

Comments
 (0)