MaterialState enum

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:

  • MaterialStateColor, a color that has a resolve method that can return a different color depending on the state of the widget that it is used in.

Constants

disabled → const MaterialState

The state when this widget disabled and can not be interacted with.

Disabled widgets should not respond to hover, focus, press, or drag interactions.

See: https://material.io/design/interaction/states.html#disabled.

const MaterialState(5)
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.

const MaterialState(3)
error → const MaterialState

The state when the widget has entered some form of invalid state.

See https://material.io/design/interaction/states.html#usage.

const MaterialState(6)
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.

const MaterialState(1)
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.

const MaterialState(0)
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.

const MaterialState(2)
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.

const MaterialState(4)
values → const List<MaterialState>

A constant List of the values in this enum, in order of their declaration.

const List<MaterialState>

Properties

index int

The integer index of this enum.

final
hashCode int
The hash code for this object. [...]
read-only, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

toString() String
Returns a string representation of this object.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited

Operators

operator ==(dynamic other) bool
The equality operator. [...]
inherited