WidgetStateExtension extension
Extension on Set<WidgetState> providing convenient boolean getters for common states.
This extension simplifies checking for widget states by providing readable
property accessors instead of using contains() calls.
Example
Set<WidgetState> states = {WidgetState.hovered, WidgetState.focused};
if (states.hovered) {
// Handle hover state
}
if (states.disabled) {
// Handle disabled state
}
- on
Properties
- disabled → bool
-
Available on Set<
Whether the widget is in a disabled state.WidgetState> , provided by the WidgetStateExtension extensionno setter - error → bool
-
Available on Set<
Whether the widget is in an error state.WidgetState> , provided by the WidgetStateExtension extensionno setter - focused → bool
-
Available on Set<
Whether the widget is in a focused state.WidgetState> , provided by the WidgetStateExtension extensionno setter - hovered → bool
-
Available on Set<
Whether the widget is in a hovered state.WidgetState> , provided by the WidgetStateExtension extensionno setter - pressed → bool
-
Available on Set<
Whether the widget is in a pressed state.WidgetState> , provided by the WidgetStateExtension extensionno setter - selected → bool
-
Available on Set<
Whether the widget is in a selected state.WidgetState> , provided by the WidgetStateExtension extensionno setter