ExpandableListTileButton.listTile constructor

ExpandableListTileButton.listTile({
  1. Key? key,
  2. required Widget expanded,
  3. required Widget title,
  4. Widget? subtitle,
  5. Color? headerBackgroundColor,
  6. Color? expandedBodyColor,
  7. Color? backgroundColor,
  8. Color? expandedColor,
  9. Color? trailingIconColor,
  10. Color? borderColor,
  11. Color? shadowColor,
  12. double elevation = 1,
  13. Widget? leading,
  14. EdgeInsetsGeometry? margin,
  15. double expandedBottomMargin = 16.0,
  16. EdgeInsetsGeometry? headerPadding,
  17. EdgeInsetsGeometry? headerBodyPadding,
  18. EdgeInsetsGeometry? leadingPadding,
  19. EdgeInsetsGeometry? trailingPadding,
  20. double? headerWidth,
  21. double? headerHeight,
  22. double? headerMinWidth,
  23. double? headerMaxWidth,
  24. double? headerMinHeight,
  25. double? headerMaxHeight,
  26. Alignment headerContentAlignment = Alignment.centerLeft,
  27. IconData trailingExpandedIcon = Icons.expand_less,
  28. IconData trailingCollapsedIcon = Icons.expand_more,
  29. Widget trailingBuilder(
    1. bool isExpanded,
    2. bool isDisabled
    )?,
  30. BorderRadius borderRadius = const BorderRadius.all(Radius.circular(10)),
  31. bool disabled = false,
  32. bool headerDisabled = false,
  33. AlignmentGeometry bodyAlignment = Alignment.topCenter,
  34. ExpandableController? controller,
  35. Duration animationDuration = const Duration(milliseconds: 300),
  36. Curve animationCurve = Curves.easeInOutCubic,
  37. bool enableHaptics = true,
  38. MouseCursor mouseCursor = SystemMouseCursors.click,
  39. String? semanticsLabel,
  40. 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,
            ),
  );
}