copyWith method Null safety

DrawerThemeData copyWith(
  1. {Color? backgroundColor,
  2. Color? scrimColor,
  3. double? elevation,
  4. ShapeBorder? shape,
  5. double? width}
)

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

Implementation

DrawerThemeData copyWith({
  Color? backgroundColor,
  Color? scrimColor,
  double? elevation,
  ShapeBorder? shape,
  double? width,
}) {
  return DrawerThemeData(
    backgroundColor: backgroundColor ?? this.backgroundColor,
    scrimColor: scrimColor ?? this.scrimColor,
    elevation: elevation ?? this.elevation,
    shape: shape ?? this.shape,
    width: width ?? this.width,
  );
}