ExpandableListTileButton constructor
const
ExpandableListTileButton({
- Key? key,
- required Widget expanded,
- Widget customHeaderBuilder()?,
- Widget? title,
- Widget? subtitle,
- Color? headerBackgroundColor,
- Color? expandedBodyColor,
- Color? backgroundColor,
- Color? expandedColor,
- Color? iconColor,
- Color? trailingIconColor,
- Color? borderColor,
- double elevation = 1,
- EdgeInsetsGeometry? margin,
- double? leadingSizeFactor,
- Widget? leading,
- IconData? icon,
- BorderRadius borderRadius = const BorderRadius.all(Radius.circular(10)),
- bool disabled = false,
- AlignmentGeometry bodyAlignment = Alignment.center,
- ExpandableController? controller,
- Size? trailingSize,
- bool overlay = false,
Creates an ExpandableListTileButton with the given properties.
Use this constructor when providing a customHeaderBuilder.
At least one of customHeaderBuilder or title must be non-null.
Accepts both headerBackgroundColor/expandedBodyColor (preferred) and
backgroundColor/expandedColor (for backward compatibility).
Implementation
const ExpandableListTileButton({
super.key,
required this.expanded,
this.customHeaderBuilder,
this.title,
this.subtitle,
this.headerBackgroundColor,
this.expandedBodyColor,
this.backgroundColor,
this.expandedColor,
this.iconColor,
this.trailingIconColor,
this.borderColor,
this.elevation = 1,
this.margin,
this.leadingSizeFactor,
this.leading,
this.icon,
this.borderRadius = const BorderRadius.all(Radius.circular(10)),
this.disabled = false,
this.bodyAlignment = Alignment.center,
this.controller,
this.trailingSize,
bool overlay = false,
}) : _finalHeaderBackgroundColor = headerBackgroundColor ?? backgroundColor,
_finalExpandedBodyColor = expandedBodyColor ?? expandedColor,
_useOverlay = overlay,
assert(
customHeaderBuilder != null || title != null,
'Either customHeaderBuilder or title must be provided for the header.',
);