pub type MaterialState = WidgetState;Use WidgetState instead. Moved to the Widgets layer to make code available outside of Material. This feature was deprecated after v3.19.0-0.3.pre.
Expand description
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:
WidgetState, a general non-Material version that can be used interchangeably withMaterialState. They functionally work the same, exceptWidgetStatecan be used outside of Material.MaterialStateProperty, an interface for objects that “resolve” to different values depending on a widget’s material state.MaterialStateColor, aColorthat implementsMaterialStatePropertywhich is used in APIs that need to accept either aColoror aMaterialStateProperty<Color>.MaterialStateMouseCursor, aMouseCursorthat implementsMaterialStatePropertywhich is used in APIs that need to accept either aMouseCursoror aMaterialStateProperty<MouseCursor>.MaterialStateOutlinedBorder, anOutlinedBorderthat implementsMaterialStatePropertywhich is used in APIs that need to accept either anOutlinedBorderor aMaterialStateProperty<OutlinedBorder>.MaterialStateOutlineInputBorder, anOutlineInputBorderthat implementsMaterialStatePropertywhich is used in APIs that need to accept either anOutlineInputBorderor aMaterialStateProperty<OutlineInputBorder>.MaterialStateUnderlineInputBorder, anUnderlineInputBorderthat implementsMaterialStatePropertywhich is used in APIs that need to accept either anUnderlineInputBorderor aMaterialStateProperty<UnderlineInputBorder>.MaterialStateBorderSide, aBorderSidethat implementsMaterialStatePropertywhich is used in APIs that need to accept either aBorderSideor aMaterialStateProperty<BorderSide>.MaterialStateTextStyle, aTextStylethat implementsMaterialStatePropertywhich is used in APIs that need to accept either aTextStyleor aMaterialStateProperty<TextStyle>.
Aliased Type§
pub enum MaterialState {
Hovered,
Focused,
Pressed,
Dragged,
Selected,
ScrolledUnder,
Disabled,
Error,
}Variants§
Hovered
The state when the user drags their mouse cursor over the given widget.
See: https://material.io/design/interaction/states.html#hover.
Focused
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.
Pressed
The state when the user is actively pressing down on the given widget.
See: https://material.io/design/interaction/states.html#pressed.
Dragged
The state when this widget is being dragged from one place to another by the user.
Selected
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.
ScrolledUnder
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.
Disabled
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.
Error
The state when the widget has entered some form of invalid state.
See https://material.io/design/interaction/states.html#usage.