PatternScaleBehavior enum

Changes how the pattern is drawn on the Canvas shape or Widget. Used in the paintOn methods of each Pattern.

All patterns are by default scaled to their container (PatternScaleBehavior.container). This means that, regardless of its size, a Rectangle will contain 40 diagonal stripes or 40 dots.

Use PatternScaleBehavior.canvas to scale the pattern to the whole Canvas area. Now the Canvas will contain 40 diagonal stripes or 40 dots, so, a Rectangle will contain as many dots or stripes as it can fit.

Pattern p = DiagonalStripesThick(bgColor: bgColor, fgColor: fgColor);
p.paintOnRect(canvas, size, rect1, patternScaleBehavior: PatternScaleBehavior.canvas);

Use PatternScaleBehavior.customRect and a customRect (e.g. a Rectangle with half the Canvas height) to further customize the Pattern size:

Rect halfCanvas = Rect.fromLTWH(0, size.height / 2, size.width, size.height / 2);
p.paintOnRect(canvas, size, rect1, patternScaleBehavior: PatternScaleBehavior.customRect
, customRect: halfCanvas);
Inheritance

Constructors

PatternScaleBehavior()
const

Values

container → const PatternScaleBehavior
customRect → const PatternScaleBehavior
canvas → const PatternScaleBehavior

Properties

hashCode int
The hash code for this object.
no setterinherited
index int
A numeric identifier for the enumerated value.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Constants

values → const List<PatternScaleBehavior>
A constant List of the values in this enum, in order of their declaration.