MaterialState enum Null safety
Interactive states that some of the Material widgets can take on when receiving input from the user.
States are defined by https://material.io/design/interaction/states.html#usage.
Some Material widgets track their current state in a Set<MaterialState>
.
See also:
- MaterialStateProperty, an interface for objects that "resolve" to different values depending on a widget's material state.
- MaterialStateColor, a Color that implements
MaterialStateProperty
which is used in APIs that need to accept either a Color or aMaterialStateProperty<Color>
. - MaterialStateMouseCursor, a MouseCursor that implements
MaterialStateProperty
which is used in APIs that need to accept either a MouseCursor or a MaterialStateProperty<MouseCursor>. - MaterialStateOutlinedBorder, an OutlinedBorder that implements
MaterialStateProperty
which is used in APIs that need to accept either an OutlinedBorder or a MaterialStateProperty<OutlinedBorder>. - MaterialStateOutlineInputBorder, an OutlineInputBorder that implements
MaterialStateProperty
which is used in APIs that need to accept either an OutlineInputBorder or a MaterialStateProperty<OutlineInputBorder>. - MaterialStateUnderlineInputBorder, an UnderlineInputBorder that implements
MaterialStateProperty
which is used in APIs that need to accept either an UnderlineInputBorder or a MaterialStateProperty<UnderlineInputBorder>. - MaterialStateBorderSide, a BorderSide that implements
MaterialStateProperty
which is used in APIs that need to accept either a BorderSide or a MaterialStateProperty<BorderSide>. - MaterialStateTextStyle, a TextStyle that implements
MaterialStateProperty
which is used in APIs that need to accept either a TextStyle or a MaterialStateProperty<TextStyle>.
Constructors
- MaterialState()
-
const
Values
- hovered → const MaterialState
-
The state when the user drags their mouse cursor over the given widget.
See: https://material.io/design/interaction/states.html#hover.
MaterialState()
- focused → const MaterialState
-
The state when the user navigates with the keyboard to a given widget.
This can also sometimes be triggered when a widget is tapped. For example, when a TextField is tapped, it becomes focused.
See: https://material.io/design/interaction/states.html#focus.
MaterialState()
- pressed → const MaterialState
-
The state when the user is actively pressing down on the given widget.
See: https://material.io/design/interaction/states.html#pressed.
MaterialState()
- dragged → const MaterialState
-
The state when this widget is being dragged from one place to another by the user.
https://material.io/design/interaction/states.html#dragged.
MaterialState()
- selected → const MaterialState
-
The state when this item has been selected.
This applies to things that can be toggled (such as chips and checkboxes) and things that are selected from a set of options (such as tabs and radio buttons).
See: https://material.io/design/interaction/states.html#selected.
MaterialState()
- scrolledUnder → const MaterialState
-
The state when this widget overlaps the content of a scrollable below.
Used by AppBar to indicate that the primary scrollable's content has scrolled up and behind the app bar.
MaterialState()
- disabled → const MaterialState
-
The state when this widget is disabled and cannot be interacted with.
Disabled widgets should not respond to hover, focus, press, or drag interactions.
See: https://material.io/design/interaction/states.html#disabled.
MaterialState()
- error → const MaterialState
-
The state when the widget has entered some form of invalid state.
See https://material.io/design/interaction/states.html#usage.
MaterialState()
Properties
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a non-existent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Constants
-
values
→ const List<
MaterialState> -
A constant List of the values in this enum, in order of their declaration.
[hovered, focused, pressed, dragged, selected, scrolledUnder, disabled, error]