copyWith method Null safety

CardTheme copyWith(
  1. {Clip? clipBehavior,
  2. Color? color,
  3. Color? shadowColor,
  4. Color? surfaceTintColor,
  5. double? elevation,
  6. EdgeInsetsGeometry? margin,
  7. ShapeBorder? shape}
)

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

Implementation

CardTheme copyWith({
  Clip? clipBehavior,
  Color? color,
  Color? shadowColor,
  Color? surfaceTintColor,
  double? elevation,
  EdgeInsetsGeometry? margin,
  ShapeBorder? shape,
}) {
  return CardTheme(
    clipBehavior: clipBehavior ?? this.clipBehavior,
    color: color ?? this.color,
    shadowColor: shadowColor ?? this.shadowColor,
    surfaceTintColor: surfaceTintColor ?? this.surfaceTintColor,
    elevation: elevation ?? this.elevation,
    margin: margin ?? this.margin,
    shape: shape ?? this.shape,
  );
}