CanvasStroke class

Authored stroke settings, including configurations that paint no pixels.

A null appearance stroke means no configured stroke. Transparent colors and zero width retain the remaining settings for subsequent edits. Dash lengths are finite, nonnegative document units; an empty list means solid. Odd-length lists repeat when evaluated. Dash painting is not yet supported, but the authored sequence is preserved without normalization. The constructor snapshots dash; later changes to the caller's list cannot change this stroke, equality, or an editor history entry.

Annotations
  • @freezed
  • @JsonSerializable.new()

Constructors

CanvasStroke({required Color32 color, double width = 4.0, StrokeCap cap = StrokeCap.butt, StrokeJoin join = StrokeJoin.miter, double miterLimit = 4.0, List<double> dash = const <double>[]})
CanvasStroke.fromJson(Map<String, dynamic> json)
factory

Properties

cap → StrokeCap
final
color → Color32
final
copyWith → $CanvasStrokeCopyWith<CanvasStroke>
Create a copy of CanvasStroke with the given fields replaced by the non-null parameter values.
no setterinherited
dash → List<double>
final
hashCode → Color32
The hash code for this object.
no setterinherited
join → StrokeJoin
final
miterLimit → double
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
width → double
final

Methods

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

Operators

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