Skip to content

Commit

Permalink
Updated MaterialStatesController class api doc (flutter#134592)
Browse files Browse the repository at this point in the history
  • Loading branch information
HansMuller authored Sep 13, 2023
1 parent 7cd8b40 commit 61b890b
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion packages/flutter/lib/src/material/material_state.dart
Original file line number Diff line number Diff line change
Expand Up @@ -735,11 +735,21 @@ class MaterialStatePropertyAll<T> implements MaterialStateProperty<T> {
///
/// 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<Set<MaterialState>> {
/// Creates a MaterialStatesController.
MaterialStatesController([Set<MaterialState>? value]) : super(<MaterialState>{...?value});
Expand Down

0 comments on commit 61b890b

Please sign in to comment.