copyWith method Null safety

ListTileThemeData copyWith(
  1. {bool? dense,
  2. ShapeBorder? shape,
  3. ListTileStyle? style,
  4. Color? selectedColor,
  5. Color? iconColor,
  6. Color? textColor,
  7. EdgeInsetsGeometry? contentPadding,
  8. Color? tileColor,
  9. Color? selectedTileColor,
  10. double? horizontalTitleGap,
  11. double? minVerticalPadding,
  12. double? minLeadingWidth,
  13. bool? enableFeedback,
  14. MaterialStateProperty<MouseCursor?>? mouseCursor,
  15. bool? isThreeLine,
  16. VisualDensity? visualDensity}
)

Creates a copy of this object with the given fields replaced with the new values.

Implementation

ListTileThemeData copyWith({
  bool? dense,
  ShapeBorder? shape,
  ListTileStyle? style,
  Color? selectedColor,
  Color? iconColor,
  Color? textColor,
  EdgeInsetsGeometry? contentPadding,
  Color? tileColor,
  Color? selectedTileColor,
  double? horizontalTitleGap,
  double? minVerticalPadding,
  double? minLeadingWidth,
  bool? enableFeedback,
  MaterialStateProperty<MouseCursor?>? mouseCursor,
  bool? isThreeLine,
  VisualDensity? visualDensity,
}) {
  return ListTileThemeData(
    dense: dense ?? this.dense,
    shape: shape ?? this.shape,
    style: style ?? this.style,
    selectedColor: selectedColor ?? this.selectedColor,
    iconColor: iconColor ?? this.iconColor,
    textColor: textColor ?? this.textColor,
    contentPadding: contentPadding ?? this.contentPadding,
    tileColor: tileColor ?? this.tileColor,
    selectedTileColor: selectedTileColor ?? this.selectedTileColor,
    horizontalTitleGap: horizontalTitleGap ?? this.horizontalTitleGap,
    minVerticalPadding: minVerticalPadding ?? this.minVerticalPadding,
    minLeadingWidth: minLeadingWidth ?? this.minLeadingWidth,
    enableFeedback: enableFeedback ?? this.enableFeedback,
    mouseCursor: mouseCursor ?? this.mouseCursor,
    visualDensity: visualDensity ?? this.visualDensity,
  );
}