PathMetric class

Utilities for measuring a Path and extracting sub-paths.

Iterate over the object returned by Path.computeMetrics to obtain PathMetric objects. Callers that want to randomly access elements or iterate multiple times should use path.computeMetrics().toList(), since PathMetrics does not memoize.

Once created, the metrics are only valid for the path as it was specified when Path.computeMetrics was called. If additional contours are added or any contours are updated, the metrics need to be recomputed. Previously created metrics will still refer to a snapshot of the path at the time they were computed, rather than to the actual metrics for the new mutations to the path.


contourIndex int
The zero-based index of the contour.
hashCode int
The hash code for this object.
isClosed bool
Whether the contour is closed.
length double
Return the total length of the current contour.
runtimeType Type
A representation of the runtime type of the object.


extractPath(double start, double end, {bool startWithMoveTo = true}) Path
Given a start and end distance, return the intervening segment(s).
getTangentForOffset(double distance) Tangent?
Computes the position of the current contour at the given offset, and the angle of the path at that point.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
toString() String
A string representation of this object.


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