ExpansionTile constructor

const ExpansionTile(
  1. {Key? key,
  2. Widget? leading,
  3. required Widget title,
  4. Widget? subtitle,
  5. ValueChanged<bool>? onExpansionChanged,
  6. List<Widget> children = const <Widget>[],
  7. Widget? trailing,
  8. bool initiallyExpanded = false,
  9. bool maintainState = false,
  10. EdgeInsetsGeometry? tilePadding,
  11. CrossAxisAlignment? expandedCrossAxisAlignment,
  12. Alignment? expandedAlignment,
  13. EdgeInsetsGeometry? childrenPadding,
  14. Color? backgroundColor,
  15. Color? collapsedBackgroundColor,
  16. Color? textColor,
  17. Color? collapsedTextColor,
  18. Color? iconColor,
  19. Color? collapsedIconColor,
  20. ShapeBorder? shape,
  21. ShapeBorder? collapsedShape,
  22. Clip? clipBehavior,
  23. ListTileControlAffinity? controlAffinity,
  24. ExpansionTileController? controller,
  25. bool? dense,
  26. VisualDensity? visualDensity,
  27. bool? enableFeedback = true,
  28. bool enabled = true,
  29. 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.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.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.',
     );