ExpanderState class

A simple state class that represents the current expanded state of an Expander.

ExpanderState is an immutable snapshot provided via the Pylon mechanism, enabling child widgets to react to expansion changes without direct access to the controller.

Key features:

  • Immutable design ensures thread-safety and predictable rebuilds.
  • Lightweight; only the boolean flag is stored, minimizing memory use.
  • Integrates with Arcane's Pylon for efficient, targeted state propagation to descendants.

Usage in Arcane UI:

  • Children of Expander can consume this via Pylon to conditionally render content or adjust layouts, e.g., in Section subcomponents or BasicCard bodies.
  • Useful in FillScreen for animating additional UI elements based on expansion, or in SliverScreen for scrollable collapsible sections.

Performance notes:

  • No overhead from observers; Pylon rebuilds only affected subtrees on state change, preventing unnecessary widget tree traversals.

See also:

  • doc/component/expander.md for more detailed documentation
  • Expander, which provides this state to its children
  • ExpanderController, the source of state updates

Constructors

ExpanderState(bool expanded)
Creates an ExpanderState with the specified expanded value.

Properties

expanded bool
Whether the Expander is currently expanded.
final
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited