CanvasPaint class

Shared style for Flint canvas drawing operations.

Constructors

CanvasPaint({String? fill, CanvasImagePattern? pattern, String? stroke = '#111827', double lineWidth = 1, String font = '16px sans-serif'})
Creates canvas paint settings.
const
CanvasPaint.fromJson(Map<String, Object?> json)
Creates paint settings from json.
factory

Properties

fill String?
Fill color. When null, fill operations are skipped.
final
font String
CSS canvas font string used for text operations.
final
hashCode int
The hash code for this object.
no setterinherited
lineWidth double
Stroke width in canvas pixels.
final
pattern CanvasImagePattern?
Image pattern fill. When provided, browser builds use it before fill.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
stroke String?
Stroke color. When null, stroke operations are skipped.
final

Methods

copyWith({String? fill, CanvasImagePattern? pattern, String? stroke, double? lineWidth, String? font, bool clearFill = false, bool clearPattern = false, bool clearStroke = false}) CanvasPaint
Creates a copy with selected paint values replaced.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, Object?>
Converts paint settings to a JSON-friendly map.
toString() String
A string representation of this object.
inherited

Operators

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