ExpandableListTileButton.iconListTile constructor
ExpandableListTileButton.iconListTile({
- Key? key,
- required Widget expanded,
- required IconData icon,
- required Widget title,
- Widget? subtitle,
- Color? headerBackgroundColor,
- Color? expandedBodyColor,
- Color? backgroundColor,
- Color? expandedColor,
- EdgeInsetsGeometry? leadingPadding,
- Color? iconColor,
- Color? trailingIconColor,
- Color? borderColor,
- double elevation = 1,
- double? leadingSizeFactor,
- EdgeInsetsGeometry? margin,
- BorderRadius borderRadius = const BorderRadius.all(Radius.circular(10)),
- bool disabled = false,
- AlignmentGeometry bodyAlignment = Alignment.center,
- ExpandableController? controller,
Creates an ExpandableListTileButton with a default header using an icon on the left.
Accepts both headerBackgroundColor/expandedBodyColor (preferred) and
backgroundColor/expandedColor (for backward compatibility).
Implementation
factory ExpandableListTileButton.iconListTile({
Key? key,
required Widget expanded,
required IconData icon,
required Widget title,
Widget? subtitle,
Color? headerBackgroundColor,
Color? expandedBodyColor,
Color? backgroundColor,
Color? expandedColor,
EdgeInsetsGeometry? leadingPadding,
Color? iconColor,
Color? trailingIconColor,
Color? borderColor,
double elevation = 1,
double? leadingSizeFactor,
EdgeInsetsGeometry? margin,
BorderRadius borderRadius = const BorderRadius.all(Radius.circular(10)),
bool disabled = false,
AlignmentGeometry bodyAlignment = Alignment.center,
ExpandableController? controller,
}) {
return ExpandableListTileButton(
key: key,
expanded: expanded,
title: title,
subtitle: subtitle,
headerBackgroundColor: headerBackgroundColor,
backgroundColor: backgroundColor,
expandedBodyColor: expandedBodyColor,
expandedColor: expandedColor,
icon: icon,
iconColor: iconColor,
trailingIconColor: trailingIconColor,
borderColor: borderColor,
elevation: elevation,
margin: margin,
leadingSizeFactor: leadingSizeFactor,
borderRadius: borderRadius,
disabled: disabled,
bodyAlignment: bodyAlignment,
controller: controller,
customHeaderBuilder: (toggleExpansion, isExpanded, isDisabled) =>
IconListTileButton(
icon: icon,
iconColor: iconColor,
leadingSizeFactor: leadingSizeFactor ?? 1.0,
leadingPadding: leadingPadding,
title: title,
subtitle: subtitle,
trailing: Icon(
isExpanded ? Icons.expand_less : Icons.expand_more,
color: trailingIconColor,
),
onPressed: toggleExpansion,
backgroundColor: Colors.transparent,
disabled: isDisabled,
),
);
}