Expander class

An expandable/collapsible component.

Inheritance

Constructors

Expander({required Component header, required Component child, bool initiallyExpanded = false, void onExpansionChanged(bool expanded)?, Component? leading, bool showIcon = true, EdgeInsets? contentPadding, bool maintainState = true, Key? key})
const

Properties

child Component
Expandable content
final
contentPadding EdgeInsets?
Custom padding for the content
final
hashCode int
The hash code for this object.
no setterinherited
Header content (always visible)
final
initiallyExpanded bool
Whether initially expanded
final
key Key?
Controls how one component replaces another component in the tree.
finalinherited
leading Component?
Custom leading icon
final
maintainState bool
Whether to maintain child state when collapsed
final
onExpansionChanged → void Function(bool expanded)?
Callback when expansion changes
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
showIcon bool
Whether to show the expansion icon
final

Methods

createElement() Element
Creates a StatefulElement to manage this component's location in the tree.
inherited
createState() State<Expander>
Creates the mutable state for this component at a given location in the tree.
override
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

Static Properties

styles List<StyleRule>
final