merge static method

Widget merge({
  1. Key? key,
  2. bool? dense,
  3. ShapeBorder? shape,
  4. ListTileStyle? style,
  5. Color? selectedColor,
  6. Color? iconColor,
  7. Color? textColor,
  8. TextStyle? titleTextStyle,
  9. TextStyle? subtitleTextStyle,
  10. TextStyle? leadingAndTrailingTextStyle,
  11. EdgeInsetsGeometry? contentPadding,
  12. Color? tileColor,
  13. Color? selectedTileColor,
  14. bool? enableFeedback,
  15. double? horizontalTitleGap,
  16. double? minVerticalPadding,
  17. double? minLeadingWidth,
  18. double? minTileHeight,
  19. ListTileTitleAlignment? titleAlignment,
  20. MaterialStateProperty<MouseCursor?>? mouseCursor,
  21. VisualDensity? visualDensity,
  22. required Widget child,
})

Creates a list tile theme that controls the color and style parameters for ListTiles, and merges in the current list tile theme, if any.

Implementation

static Widget merge({
  Key? key,
  bool? dense,
  ShapeBorder? shape,
  ListTileStyle? style,
  Color? selectedColor,
  Color? iconColor,
  Color? textColor,
  TextStyle? titleTextStyle,
  TextStyle? subtitleTextStyle,
  TextStyle? leadingAndTrailingTextStyle,
  EdgeInsetsGeometry? contentPadding,
  Color? tileColor,
  Color? selectedTileColor,
  bool? enableFeedback,
  double? horizontalTitleGap,
  double? minVerticalPadding,
  double? minLeadingWidth,
  double? minTileHeight,
  ListTileTitleAlignment? titleAlignment,
  MaterialStateProperty<MouseCursor?>? mouseCursor,
  VisualDensity? visualDensity,
  required Widget child,
}) {
  return Builder(
    builder: (BuildContext context) {
      final ListTileThemeData parent = ListTileTheme.of(context);
      return ListTileTheme(
        key: key,
        data: ListTileThemeData(
          dense: dense ?? parent.dense,
          shape: shape ?? parent.shape,
          style: style ?? parent.style,
          selectedColor: selectedColor ?? parent.selectedColor,
          iconColor: iconColor ?? parent.iconColor,
          textColor: textColor ?? parent.textColor,
          titleTextStyle: titleTextStyle ?? parent.titleTextStyle,
          subtitleTextStyle: subtitleTextStyle ?? parent.subtitleTextStyle,
          leadingAndTrailingTextStyle: leadingAndTrailingTextStyle ?? parent.leadingAndTrailingTextStyle,
          contentPadding: contentPadding ?? parent.contentPadding,
          tileColor: tileColor ?? parent.tileColor,
          selectedTileColor: selectedTileColor ?? parent.selectedTileColor,
          enableFeedback: enableFeedback ?? parent.enableFeedback,
          horizontalTitleGap: horizontalTitleGap ?? parent.horizontalTitleGap,
          minVerticalPadding: minVerticalPadding ?? parent.minVerticalPadding,
          minLeadingWidth: minLeadingWidth ?? parent.minLeadingWidth,
          minTileHeight: minTileHeight ?? parent.minTileHeight,
          titleAlignment: titleAlignment ?? parent.titleAlignment,
          mouseCursor: mouseCursor ?? parent.mouseCursor,
          visualDensity: visualDensity ?? parent.visualDensity,
        ),
        child: child,
      );
    },
  );
}