Decoration class final

A box's paint: Flutter's BoxDecoration, with stacked paints as in a design tool (fills bottom to top, then strokes).

Annotations
  • @immutable

Constructors

Decoration({List<Paint> fills = const [], List<Paint> foregroundFills = const [], List<Paint> strokes = const [], double strokeWidth = 1, StrokeAlign strokeAlign = StrokeAlign.inside, StrokeSides strokeSides = StrokeSides.all, StrokeCap strokeCap = StrokeCap.butt, List<double> dashPattern = const [], BorderRadius radius = BorderRadius.zero, List<Effect> effects = const [], Clip clip = Clip.none, BlendMode blendMode = BlendMode.srcOver, DecorationShape shape = DecorationShape.rectangle, String? clipPath, List<double>? clipViewBox, BoxFit clipFit = BoxFit.fill, List<ClipCut> clipCuts = const []})
const

Properties

blendMode → BlendMode
final
clip → Clip
Clips the content to the box (rounded by radius).
final
clipCuts → List<ClipCut>
Shapes cut out of the node in its own pixels at points of its box (a ticket's notches, a bite out of a card's corner): they keep their size as the body stretches.
final
clipFit → BoxFit
How clipViewBox maps onto the box (Flutter's BoxFit, as a customPaint's fit): fill stretches it (the default), none keeps its units pixels, contain keeps its aspect.
final
clipPath → String?
The node cut to a path, as CSS clip-path: path(…) and Flutter's ClipPath: SVG path data in clipViewBox's units, mapped onto the box by clipFit as a customPaint's view box is. With neither, the box's unit square stretched over it (0 to 1 across and down, whatever its size): a header's wave that fits every width. The node's fills and children are cut to it, its border is drawn along it (inside) and its shadow takes its shape; a pointer outside it passes through. Null: the node's own shape (radius, shape), cut by clipCuts when it has any.
final
clipViewBox → List<double>?
The units clipPath is written in, [width, height] or [minX, minY, width, height], as a customPaint's or a path's viewBox. Null: the unit square, or with clipFit none the box's own pixels.
final
dashPattern → List<double>
Dash and gap lengths, alternating; empty is a solid stroke.
final
effects → List<Effect>
final
fills → List<Paint>
final
foregroundFills → List<Paint>
Fills painted over the content.
final
hasClipShape → bool
Whether the node is cut to a shape of its own (clipPath or clipCuts).
no setter
hashCode → int
The hash code for this object.
no setteroverride
isNone → bool
no setter
radius → BorderRadius
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
shape → DecorationShape
A rectangle (rounded by radius) or a circle.
final
strokeAlign → StrokeAlign
final
strokeCap → StrokeCap
final
strokes → List<Paint>
final
strokeSides → StrokeSides
final
strokeWidth → double
final
visibleFills → Iterable<Paint>
no setter
visibleStrokes → Iterable<Paint>
no setter

Methods

copyWith({List<Paint>? fills, List<Paint>? foregroundFills, List<Paint>? strokes, double? strokeWidth, StrokeAlign? strokeAlign, StrokeSides? strokeSides, StrokeCap? strokeCap, List<double>? dashPattern, BorderRadius? radius, List<Effect>? effects, Clip? clip, BlendMode? blendMode, DecorationShape? shape, String? clipPath, List<double>? clipViewBox, BoxFit? clipFit, List<ClipCut>? clipCuts}) → Decoration
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() → Json
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
override

Static Methods

fromJson(Object? json) → Decoration

Constants

none → const Decoration