ExpansionTileCard class

A single-line ListTile with a trailing button that expands or collapses the tile to reveal or hide the children.

This widget is typically used with ListView to create an "expand / collapse" list entry. When used with scrolling widgets like ListView, a unique PageStorageKey must be specified to enable the ExpansionTileCard to save and restore its expanded state when it is scrolled in and out of view.

See also:

Inheritance

Constructors

ExpansionTileCard({Key? key, Widget? leading, required Widget title, Widget? subtitle, ValueChanged<bool>? onExpansionChanged, List<Widget> children = const <Widget>[], Widget? trailing, BorderRadiusGeometry borderRadius = const BorderRadius.all(Radius.circular(8.0)), double elevation = 2.0, double initialElevation = 0.0, bool initiallyExpanded = false, EdgeInsetsGeometry initialPadding = EdgeInsets.zero, EdgeInsetsGeometry finalPadding = const EdgeInsets.only(bottom: 6.0), EdgeInsetsGeometry? contentPadding, Color? baseColor, Color? expandedColor, Color? expandedTextColor, Duration duration = const Duration(milliseconds: 200), Curve elevationCurve = Curves.easeOut, Curve heightFactorCurve = Curves.easeIn, Curve turnsCurve = Curves.easeIn, Curve colorCurve = Curves.easeIn, Curve paddingCurve = Curves.easeIn, bool isThreeLine = false, Color shadowColor = const Color(0xffaaaaaa), bool animateTrailing = false})
Creates a single-line ListTile with a trailing button that expands or collapses the tile to reveal or hide the children. The initiallyExpanded property must be non-null.
const

Properties

animateTrailing bool
Whether or not to animate a custom trailing widget.
final
baseColor Color?
The background color of the unexpanded tile.
final
borderRadius BorderRadiusGeometry
The radius used for the Material widget's border. Only visible once expanded.
final
children List<Widget>
The widgets that are displayed when the tile expands.
final
colorCurve Curve
The animation curve used to control the header, icon, and material colors.
final
contentPadding EdgeInsetsGeometry?
The inner contentPadding of the ListTile widget.
final
duration Duration
The duration of the expand and collapse animations.
final
elevation double
The final elevation of the Material widget, once expanded.
final
elevationCurve Curve
The animation curve used to control the elevation of the expanded card.
final
expandedColor Color?
The background color of the expanded card.
final
expandedTextColor Color?
The color of the text of the expended card
final
finalPadding EdgeInsetsGeometry
The padding around the outside of the ExpansionTileCard while collapsed.
final
hashCode int
The hash code for this object.
no setterinherited
heightFactorCurve Curve
The animation curve used to control the height of the expanding/collapsing card.
final
initialElevation double
The elevation when collapsed
final
initiallyExpanded bool
Specifies if the list tile is initially expanded (true) or collapsed (false, the default).
final
initialPadding EdgeInsetsGeometry
The padding around the outside of the ExpansionTileCard while collapsed.
final
isThreeLine bool
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
leading Widget?
A widget to display before the title.
final
onExpansionChanged ValueChanged<bool>?
Called when the tile expands or collapses.
final
paddingCurve Curve
The animation curve used by the expanding/collapsing padding.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
shadowColor Color
The color of the cards shadow.
final
subtitle Widget?
Additional content displayed below the title.
final
title Widget
The primary content of the list item.
final
trailing Widget?
A widget to display instead of a rotating arrow icon.
final
turnsCurve Curve
The animation curve used to control the rotation of the trailing widget.
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() ExpansionTileCardState
Creates the mutable state for this widget at a given location in the tree.
override
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object.
inherited
toStringShort() String
A short, textual description of this widget.
inherited

Operators

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