PathFollow class final

A place along an SVG path: progress (0–1) of the way along path's length, turned with it as orient says. Shared by motion.path and a drag track's path.

Values of progress outside 0–1 wrap round a closed path (one that ends where it starts) and clamp to the ends of an open one.

JSON: {"path": "M0 0 C 40 -60, 120 -60, 160 0", "progress": 0.5, "orient": "tangent"}; a bare string reads as path.

Annotations
  • @immutable

Constructors

PathFollow({required String path, List<double> viewBox = const [], double progress = 0, PathOrient orient = PathOrient.none})
const

Properties

effectiveViewBox → List<double>?
no setter
hashCode → int
The hash code for this object.
no setteroverride
hasPath → bool
no setter
orient → PathOrient
final
path → String
SVG path data.
final
progress → double
Where along the path's length, 0–1. Bindable as motion.path.progress.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
viewBox → List<double>
The path's coordinate space [width, height], stretched over the node's parent: its points are where the node goes, from the parent's origin (lay the node out at the origin, offset by half its size to centre it). Empty: the path is in pixels, as offsets from its first point, from the node's own place.
final
viewBoxSize → (double, double)?
viewBox when it is a usable size. The view box's width and height ([w, h], or the last two of [x, y, w, h]), or null when it has none (or one not above 0).
no setter

Methods

copyWith({double? progress}) → PathFollow
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) → PathFollow?
uprightAngle(double radians) → double
A path direction radians folded into −90…90 degrees (turned half round where it heads left), for PathOrient.upright.
wrap(double progress) → double
progress modulo 1 (1 stays the end): a closed path's place.