copyWith method
OutlinedBorder
copyWith({
- BorderSide? side,
- OutlinedBorder? child,
- List<
BoxShadow> ? shadow, - List<
BoxShadow> ? innerShadow, - Gradient? backgroundGradient,
- GradientBorderSide? borderGradient,
override
Returns a copy of this OutlinedBorder that draws its outline with the
specified side
, if side
is non-null.
Implementation
@override
OutlinedBorder copyWith({
BorderSide? side,
OutlinedBorder? child,
List<BoxShadow>? shadow,
List<BoxShadow>? innerShadow,
Gradient? backgroundGradient,
GradientBorderSide? borderGradient,
}) {
var resolvedChild = child ?? this.child;
if (side != null) {
resolvedChild = (side != BorderSide.none)
? resolvedChild.copyWith(
side: BorderSide(width: side.width, color: Colors.transparent),
)
: resolvedChild;
}
return DecoratedOutlinedBorder(
child: resolvedChild,
shadow: shadow ?? this.shadow,
innerShadow: innerShadow ?? this.innerShadow,
backgroundGradient: backgroundGradient ?? this.backgroundGradient,
borderGradient: borderGradient ?? this.borderGradient,
);
}