copyWith method
BoxDecoration
copyWith({
- Color? color,
- DecorationImage? image,
- BoxBorder? border,
- BorderRadiusGeometry? borderRadius,
- List<
BoxShadow> ? boxShadow, - Gradient? gradient,
- BlendMode? backgroundBlendMode,
- BoxShape? shape,
override
Creates a copy of this object but with the given fields replaced with the new values.
Implementation
@override
BoxDecoration copyWith({
Color? color,
DecorationImage? image,
BoxBorder? border,
BorderRadiusGeometry? borderRadius,
List<painting.BoxShadow>? boxShadow,
Gradient? gradient,
BlendMode? backgroundBlendMode,
BoxShape? shape,
}) {
assert(boxShadow is List<BoxShadow>?);
return BoxDecoration(
color: color ?? this.color,
image: image ?? this.image,
border: border ?? this.border,
borderRadius: borderRadius ?? this.borderRadius,
boxShadow: (boxShadow ?? this.boxShadow) as List<BoxShadow>?,
gradient: gradient ?? this.gradient,
backgroundBlendMode: backgroundBlendMode ?? this.backgroundBlendMode,
shape: shape ?? this.shape,
);
}