ExpandableListTileButton.custom constructor

ExpandableListTileButton.custom({
  1. Key? key,
  2. required Widget expanded,
  3. required Widget customHeaderBuilder(
    1. dynamic tapAction(),
    2. bool isExpanded,
    3. bool isDisabled
    ),
  4. Color? headerBackgroundColor,
  5. Color? expandedBodyColor,
  6. Color? backgroundColor,
  7. Color? expandedColor,
  8. Color? borderColor,
  9. double elevation = 1,
  10. EdgeInsetsGeometry? margin,
  11. BorderRadius borderRadius = const BorderRadius.all(Radius.circular(10)),
  12. bool disabled = false,
  13. AlignmentGeometry bodyAlignment = Alignment.center,
  14. ExpandableController? controller,
})

Creates an ExpandableListTileButton with a completely custom header provided by customHeaderBuilder.

Accepts both headerBackgroundColor/expandedBodyColor (preferred) and backgroundColor/expandedColor (for backward compatibility).

Implementation

factory ExpandableListTileButton.custom({
  Key? key,
  required Widget expanded,
  required Widget Function(
    Function() tapAction,
    bool isExpanded,
    bool isDisabled,
  )
  customHeaderBuilder,
  Color? headerBackgroundColor,
  Color? expandedBodyColor,
  Color? backgroundColor,
  Color? expandedColor,
  Color? borderColor,
  double elevation = 1,
  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,
    customHeaderBuilder: customHeaderBuilder,
    headerBackgroundColor: headerBackgroundColor,
    backgroundColor: backgroundColor,
    expandedBodyColor: expandedBodyColor,
    expandedColor: expandedColor,
    borderColor: borderColor,
    elevation: elevation,
    margin: margin,
    borderRadius: borderRadius,
    disabled: disabled,
    bodyAlignment: bodyAlignment,
    controller: controller,
  );
}