DecorationExtension extension

Extension methods for Decoration providing type-safe copyWith operations.

Adds convenience methods to Decoration for creating modified copies when the decoration is either a BoxDecoration or ShapeDecoration. These methods handle type checking and provide appropriate defaults when the decoration doesn't match the expected type.

on

Methods

copyWithIfBoxDecoration({Color? color, DecorationImage? image, BoxBorder? border, BorderRadiusGeometry? borderRadius, List<BoxShadow>? boxShadow, Gradient? gradient, BoxShape? shape, BlendMode? backgroundBlendMode}) BoxDecoration

Available on Decoration, provided by the DecorationExtension extension

Creates a BoxDecoration copy with specified properties replaced.
copyWithIfShapeDecoration({ShapeBorder? shape, Color? color, Gradient? gradient, List<BoxShadow>? shadows, DecorationImage? image}) ShapeDecoration

Available on Decoration, provided by the DecorationExtension extension

Creates a ShapeDecoration copy with specified properties replaced.