ExpandableListTileButton.listTile constructor
ExpandableListTileButton.listTile({
- Key? key,
- required Widget expanded,
- required Widget title,
- Widget? subtitle,
- Color? headerBackgroundColor,
- Color? expandedBodyColor,
- Color? backgroundColor,
- Color? expandedColor,
- Color? trailingIconColor,
- Color? borderColor,
- Color? shadowColor,
- double elevation = 1,
- Widget? leading,
- EdgeInsetsGeometry? margin,
- double expandedBottomMargin = 16.0,
- EdgeInsetsGeometry? headerPadding,
- EdgeInsetsGeometry? headerBodyPadding,
- EdgeInsetsGeometry? leadingPadding,
- EdgeInsetsGeometry? trailingPadding,
- double? headerWidth,
- double? headerHeight,
- double? headerMinWidth,
- double? headerMaxWidth,
- double? headerMinHeight,
- double? headerMaxHeight,
- Alignment headerContentAlignment = Alignment.centerLeft,
- IconData trailingExpandedIcon = Icons.expand_less,
- IconData trailingCollapsedIcon = Icons.expand_more,
- Widget trailingBuilder()?,
- BorderRadius borderRadius = const BorderRadius.all(Radius.circular(10)),
- bool disabled = false,
- bool headerDisabled = false,
- AlignmentGeometry bodyAlignment = Alignment.topCenter,
- ExpandableController? controller,
- Duration animationDuration = const Duration(milliseconds: 300),
- Curve animationCurve = Curves.easeInOutCubic,
- bool enableHaptics = true,
- MouseCursor mouseCursor = SystemMouseCursors.click,
- String? semanticsLabel,
- bool continuous = true,
Implementation
factory ExpandableListTileButton.listTile({
Key? key,
required Widget expanded,
required Widget title,
Widget? subtitle,
Color? headerBackgroundColor,
Color? expandedBodyColor,
Color? backgroundColor,
Color? expandedColor,
Color? trailingIconColor,
Color? borderColor,
Color? shadowColor,
double elevation = 1,
Widget? leading,
EdgeInsetsGeometry? margin,
double expandedBottomMargin = 16.0,
EdgeInsetsGeometry? headerPadding,
EdgeInsetsGeometry? headerBodyPadding,
EdgeInsetsGeometry? leadingPadding,
EdgeInsetsGeometry? trailingPadding,
double? headerWidth,
double? headerHeight,
double? headerMinWidth,
double? headerMaxWidth,
double? headerMinHeight,
double? headerMaxHeight,
Alignment headerContentAlignment = Alignment.centerLeft,
IconData trailingExpandedIcon = Icons.expand_less,
IconData trailingCollapsedIcon = Icons.expand_more,
Widget Function(bool isExpanded, bool isDisabled)? trailingBuilder,
BorderRadius borderRadius = const BorderRadius.all(Radius.circular(10)),
bool disabled = false,
bool headerDisabled = false,
AlignmentGeometry bodyAlignment = Alignment.topCenter,
ExpandableController? controller,
Duration animationDuration = const Duration(milliseconds: 300),
Curve animationCurve = Curves.easeInOutCubic,
bool enableHaptics = true,
MouseCursor mouseCursor = SystemMouseCursors.click,
String? semanticsLabel,
bool continuous = true,
}) {
return ExpandableListTileButton(
key: key,
expanded: expanded,
title: title,
subtitle: subtitle,
headerBackgroundColor: headerBackgroundColor,
backgroundColor: backgroundColor,
expandedBodyColor: expandedBodyColor,
expandedColor: expandedColor,
trailingIconColor: trailingIconColor,
borderColor: borderColor,
shadowColor: shadowColor,
elevation: elevation,
margin: margin,
expandedBottomMargin: expandedBottomMargin,
headerPadding: headerPadding,
headerBodyPadding: headerBodyPadding,
leadingPadding: leadingPadding,
trailingPadding: trailingPadding,
headerWidth: headerWidth,
headerHeight: headerHeight,
headerMinWidth: headerMinWidth,
headerMaxWidth: headerMaxWidth,
headerMinHeight: headerMinHeight,
headerMaxHeight: headerMaxHeight,
headerContentAlignment: headerContentAlignment,
leading: leading,
trailingExpandedIcon: trailingExpandedIcon,
trailingCollapsedIcon: trailingCollapsedIcon,
trailingBuilder: trailingBuilder,
borderRadius: borderRadius,
disabled: disabled,
headerDisabled: headerDisabled,
bodyAlignment: bodyAlignment,
controller: controller,
animationDuration: animationDuration,
animationCurve: animationCurve,
enableHaptics: enableHaptics,
mouseCursor: mouseCursor,
semanticsLabel: semanticsLabel,
continuous: continuous,
customHeaderBuilder:
(toggleExpansion, isExpanded, isDisabled, animValue) =>
ListTileButton(
padding: headerPadding,
bodyPadding: headerBodyPadding,
leadingPadding: leadingPadding,
trailingPadding: trailingPadding,
width: headerWidth,
height: headerHeight,
minWidth: headerMinWidth,
maxWidth: headerMaxWidth,
minHeight: headerMinHeight ?? 60.0,
maxHeight: headerMaxHeight,
contentAlignment: headerContentAlignment,
onPressed: toggleExpansion,
leading: leading,
body: title,
subtitle: subtitle,
trailing: isDisabled
? null
: trailingBuilder != null
? trailingBuilder(isExpanded, isDisabled)
: RotationTransition(
turns: AlwaysStoppedAnimation(animValue * 0.5),
child: Icon(
trailingCollapsedIcon,
color: trailingIconColor,
),
),
backgroundColor: Colors.transparent,
disabled: headerDisabled,
),
);
}