ExpandableListTileButton constructor

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

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.shadowColor,
  this.elevation = 1,
  this.margin,
  this.expandedBottomMargin = 16.0,
  this.headerPadding,
  this.headerBodyPadding,
  this.leadingPadding,
  this.trailingPadding,
  this.headerWidth,
  this.headerHeight,
  this.headerMinWidth,
  this.headerMaxWidth,
  this.headerMinHeight,
  this.headerMaxHeight,
  this.headerContentAlignment = Alignment.centerLeft,
  this.leadingSizeFactor,
  this.leading,
  this.icon,
  this.trailingExpandedIcon = Icons.expand_less,
  this.trailingCollapsedIcon = Icons.expand_more,
  this.trailingBuilder,
  this.borderRadius = const BorderRadius.all(Radius.circular(10)),
  this.disabled = false,
  this.headerDisabled = false,
  this.bodyAlignment = Alignment.topCenter,
  this.controller,
  this.trailingSize,
  this.animationDuration = const Duration(milliseconds: 300),
  this.animationCurve = Curves.easeInOutCubic,
  this.enableHaptics = true,
  this.mouseCursor = SystemMouseCursors.click,
  this.semanticsLabel,
  this.continuous = true,
  this.fetchExpandedContent,
  this.loadingWidget,
  this.errorWidget,
  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.',
     );