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<WidgetState>, provided by the WidgetStateExtension extension

Whether the widget is in a disabled state.
no setter
error bool

Available on Set<WidgetState>, provided by the WidgetStateExtension extension

Whether the widget is in an error state.
no setter
focused bool

Available on Set<WidgetState>, provided by the WidgetStateExtension extension

Whether the widget is in a focused state.
no setter
hovered bool

Available on Set<WidgetState>, provided by the WidgetStateExtension extension

Whether the widget is in a hovered state.
no setter
pressed bool

Available on Set<WidgetState>, provided by the WidgetStateExtension extension

Whether the widget is in a pressed state.
no setter
selected bool

Available on Set<WidgetState>, provided by the WidgetStateExtension extension

Whether the widget is in a selected state.
no setter