pathModifier property
PathModifier?
pathModifier
finalinherited
An optional mapper callback that can be used to apply some styling to tree lines like dashing and dotting.
When defined, this is called right before drawing lines on the canvas.
A Path instance containing all computed tree line segments is provided to this callback which should then apply the desired transformations and return either the same or a new Path instance.
Example using the path_drawing package:
import 'package:path_drawing/path_drawing.dart';
Path dashingModifier(Path path) {
return dashPath(
path,
dashArray: CircularIntervalList(const <double>[8.0, 2.0]),
dashOffset: const DashOffset.absolute(1),
);
}
Path dottingModifier(Path path) {
return dashPath(
path,
dashArray: CircularIntervalList(const <double>[2.0]),
dashOffset: const DashOffset.absolute(1),
);
}
The values above should be tweaked to reach the desired result.
Performance warning: be careful when using dashing/dotting algorithms as they could lead to poor rendering (jank), typically when combining large trees and animations.
Implementation
final PathModifier? pathModifier;