ExpansionTile class
A widget that expands or collapses to reveal children below a title.
Press Enter or Space to toggle. Use ExpansionTileController for programmatic control over the expanded state.
- Inheritance
-
- Object
- Widget
- StatefulWidget
- ExpansionTile
Constructors
-
ExpansionTile({Key? key, required String title, List<
Widget> children = const [], bool initiallyExpanded = false, ValueChanged<bool> ? onExpansionChanged, ExpansionTileController? controller, Color? expandedColor, Color? collapsedColor, Color? iconColor, FocusNode? focusNode}) -
Creates an ExpansionTile with the given
titleand optionalchildren.const
Properties
-
children
→ List<
Widget> -
The child widgets revealed when expanded.
final
- collapsedColor → Color?
-
The color of the title text when collapsed.
final
- controller → ExpansionTileController?
-
An optional external controller for the expansion state.
final
- expandedColor → Color?
-
The color of the title text when expanded.
final
- focusNode → FocusNode?
-
An optional focus node for keyboard navigation.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- iconColor → Color?
-
The color of the expand/collapse arrow icon.
final
- initiallyExpanded → bool
-
Whether the tile starts in the expanded state.
final
- key → Key?
-
Controls how one widget replaces another in the tree.
finalinherited
-
onExpansionChanged
→ ValueChanged<
bool> ? -
Called when the expansion state changes.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- title → String
-
The title text displayed in the header row.
final
Methods
-
createElement(
) → StatefulElement -
Creates the Element for this widget.
inherited
-
createState(
) → State< ExpansionTile> -
Creates the mutable state for this widget.
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