copyWith method Null safety

BottomSheetThemeData copyWith(
  1. {Color? backgroundColor,
  2. double? elevation,
  3. Color? modalBackgroundColor,
  4. double? modalElevation,
  5. ShapeBorder? shape,
  6. Clip? clipBehavior,
  7. BoxConstraints? constraints}
)

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

Implementation

BottomSheetThemeData copyWith({
  Color? backgroundColor,
  double? elevation,
  Color? modalBackgroundColor,
  double? modalElevation,
  ShapeBorder? shape,
  Clip? clipBehavior,
  BoxConstraints? constraints,
}) {
  return BottomSheetThemeData(
    backgroundColor: backgroundColor ?? this.backgroundColor,
    elevation: elevation ?? this.elevation,
    modalBackgroundColor: modalBackgroundColor ?? this.modalBackgroundColor,
    modalElevation: modalElevation ?? this.modalElevation,
    shape: shape ?? this.shape,
    clipBehavior: clipBehavior ?? this.clipBehavior,
    constraints: constraints ?? this.constraints,
  );
}