copyWith method
BoxSpec
copyWith({
- AlignmentGeometry? alignment,
- EdgeInsetsGeometry? padding,
- EdgeInsetsGeometry? margin,
- BoxConstraints? constraints,
- Decoration? decoration,
- Decoration? foregroundDecoration,
- double? width,
- double? height,
- Matrix4? transform,
- AlignmentGeometry? transformAlignment,
- Clip? clipBehavior,
- AnimatedData? animated,
override
Returns a new BoxSpec with the specified properties replaced.
This method is useful for creating modified copies of an existing BoxSpec with some attributes changed.
Implementation
@override
BoxSpec copyWith({
AlignmentGeometry? alignment,
EdgeInsetsGeometry? padding,
EdgeInsetsGeometry? margin,
BoxConstraints? constraints,
Decoration? decoration,
Decoration? foregroundDecoration,
double? width,
double? height,
Matrix4? transform,
AlignmentGeometry? transformAlignment,
Clip? clipBehavior,
AnimatedData? animated,
}) {
return BoxSpec(
alignment: alignment ?? this.alignment,
padding: padding ?? this.padding,
margin: margin ?? this.margin,
constraints: constraints ?? this.constraints,
decoration: decoration ?? this.decoration,
foregroundDecoration: foregroundDecoration ?? this.foregroundDecoration,
transform: transform ?? this.transform,
transformAlignment: transformAlignment ?? this.transformAlignment,
clipBehavior: clipBehavior ?? this.clipBehavior,
width: width ?? this.width,
height: height ?? this.height,
animated: animated ?? this.animated,
);
}