ExpansionTile constructor
- Key? key,
- Widget? leading,
- required Widget title,
- Widget? subtitle,
- ValueChanged<
bool> ? onExpansionChanged, - List<
Widget> children = const <Widget>[], - Widget? trailing,
- bool showTrailingIcon = true,
- bool initiallyExpanded = false,
- bool maintainState = false,
- EdgeInsetsGeometry? tilePadding,
- CrossAxisAlignment? expandedCrossAxisAlignment,
- Alignment? expandedAlignment,
- EdgeInsetsGeometry? childrenPadding,
- Color? backgroundColor,
- Color? collapsedBackgroundColor,
- Color? textColor,
- Color? collapsedTextColor,
- Color? iconColor,
- Color? collapsedIconColor,
- ShapeBorder? shape,
- ShapeBorder? collapsedShape,
- Clip? clipBehavior,
- ListTileControlAffinity? controlAffinity,
- ExpansionTileController? controller,
- bool? dense,
- VisualDensity? visualDensity,
- double? minTileHeight,
- bool? enableFeedback = true,
- bool enabled = true,
- AnimationStyle? expansionAnimationStyle,
Creates a single-line ListTile with an expansion arrow icon that expands or collapses the tile to reveal or hide the children. The initiallyExpanded property must be non-null.
Implementation
const ExpansionTile({
super.key,
this.leading,
required this.title,
this.subtitle,
this.onExpansionChanged,
this.children = const <Widget>[],
this.trailing,
this.showTrailingIcon = true,
this.initiallyExpanded = false,
this.maintainState = false,
this.tilePadding,
this.expandedCrossAxisAlignment,
this.expandedAlignment,
this.childrenPadding,
this.backgroundColor,
this.collapsedBackgroundColor,
this.textColor,
this.collapsedTextColor,
this.iconColor,
this.collapsedIconColor,
this.shape,
this.collapsedShape,
this.clipBehavior,
this.controlAffinity,
this.controller,
this.dense,
this.visualDensity,
this.minTileHeight,
this.enableFeedback = true,
this.enabled = true,
this.expansionAnimationStyle,
}) : assert(
expandedCrossAxisAlignment != CrossAxisAlignment.baseline,
'CrossAxisAlignment.baseline is not supported since the expanded children '
'are aligned in a column, not a row. Try to use another constant.',
);