DrawPaint class final

How a shape is drawn: Flutter's Paint, with its field names and defaults (black, fill, strokeWidth 0: a hairline, butt, miter, miter limit 4, srcOver, anti-aliased). shader is a gradient or image in the model's Paint form, laid out in the shape's bounds (Flutter's Gradient.createShader(rect)). dashPattern and scaleStroke have no Paint counterpart: dashes as a decoration's dashPattern, and a stroke that stays in the box's pixels under a scaling view box or group as the path node's scaleStroke: false.

JSON: an object, or just a color ("#FF2196F3", or an expression giving a color or a paint object).

Annotations
  • @immutable

Constructors

DrawPaint({String? id, Expr<Color> color = const Expr(Color.black), Paint? shader, PaintingStyle style = PaintingStyle.fill, Expr<double> strokeWidth = const Expr(0.0), StrokeCap strokeCap = StrokeCap.butt, StrokeJoin strokeJoin = StrokeJoin.miter, double strokeMiterLimit = 4, BlendMode blendMode = BlendMode.srcOver, bool isAntiAlias = true, List<double> dashPattern = const [], bool scaleStroke = true, Expr<double> blurRadius = const Expr(0.0)})
const

Properties

blendMode → BlendMode
final
blurRadius → Expr<double>
Softens the shape's edge by this much (Flutter's MaskFilter.blur, its sigma worked out as a box shadow's blurRadius gives it): a glow, a soft shadow. In the drawing's units. 0: a sharp edge.
final
color → Expr<Color>
final
dashPattern → List<double>
Dash and gap lengths, alternating; empty is solid.
final
hashCode → int
The hash code for this object.
no setteroverride
id → String?
Stable id, so a binding can target this paint.
final
isAntiAlias → bool
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
scaleStroke → bool
False: strokeWidth and dashPattern are in the box's pixels however the view box and groups scale the drawing.
final
shader → Paint?
A gradient or image (Paint JSON), over color.
final
strokeCap → StrokeCap
final
strokeJoin → StrokeJoin
final
strokeMiterLimit → double
final
strokeWidth → Expr<double>
final
style → PaintingStyle
final

Methods

copyWith({String? id, Expr<Color>? color, Paint? shader, PaintingStyle? style, Expr<double>? strokeWidth, StrokeCap? strokeCap, StrokeJoin? strokeJoin, double? strokeMiterLimit, BlendMode? blendMode, bool? isAntiAlias, List<double>? dashPattern, bool? scaleStroke, Expr<double>? blurRadius}) → DrawPaint
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() → Object
toString() → String
A string representation of this object.
inherited

Operators

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

Static Methods

fromJson(Object? json) → DrawPaint?

Constants

keys → const Set<String>