copyWith method Null safety

DialogTheme copyWith(
  1. {Color? backgroundColor,
  2. double? elevation,
  3. ShapeBorder? shape,
  4. AlignmentGeometry? alignment,
  5. Color? iconColor,
  6. TextStyle? titleTextStyle,
  7. TextStyle? contentTextStyle,
  8. EdgeInsetsGeometry? actionsPadding}
)

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

Implementation

DialogTheme copyWith({
  Color? backgroundColor,
  double? elevation,
  ShapeBorder? shape,
  AlignmentGeometry? alignment,
  Color? iconColor,
  TextStyle? titleTextStyle,
  TextStyle? contentTextStyle,
  EdgeInsetsGeometry? actionsPadding,
}) {
  return DialogTheme(
    backgroundColor: backgroundColor ?? this.backgroundColor,
    elevation: elevation ?? this.elevation,
    shape: shape ?? this.shape,
    alignment: alignment ?? this.alignment,
    iconColor: iconColor ?? this.iconColor,
    titleTextStyle: titleTextStyle ?? this.titleTextStyle,
    contentTextStyle: contentTextStyle ?? this.contentTextStyle,
    actionsPadding: actionsPadding ?? this.actionsPadding,
  );
}