states property Null safety
Describes the current MaterialState
of the Toggleable.
The returned set will include:
- MaterialState.disabled, if isInteractive is false
- MaterialState.hovered, if a pointer is hovering over the Toggleable
- MaterialState.focused, if the Toggleable has input focus
- MaterialState.selected, if value is true or null
Implementation
Set<MaterialState> get states => <MaterialState>{
if (!isInteractive) MaterialState.disabled,
if (_hovering) MaterialState.hovered,
if (_focused) MaterialState.focused,
if (value ?? true) MaterialState.selected,
};