StringPathBuilder class
A PathBuilder that produces a path string. This can be used with a PathParser if you have a path string that you want to parse, modify, and then reconstitute as a path string.
Usage:
One possible use is to intercept path builder calls, and transform them to
something else. For example, if for some reason you wanted to remove all
lineTo commands ('L'
/'l'
, or additional coordinates in an 'M'
/'m'
)
from the path of an SvgPath
node, you could do this:
class NoLinesPathBuilder extends StringPathBuilder {
@override
void lineTo(PointT p) {}
}
void removeLinesFrom(final SvgPath node) {
final pb = NoLinesPathBuilder();
PathParser(pb, node.pathData).parse();
node.pathData = pb.result;
}
- Inheritance
-
- Object
- PathBuilder
- StringPathBuilder
Constructors
Properties
Methods
-
arcToPoint(
PointT arcEnd, {required RadiusT radius, required double rotation, required bool largeArc, required bool clockwise}) → void -
Add an arc.
rotation
in radians, as is (sorta offhandedly) documented for Flutter's Path.override -
close(
) → void -
Add a close to the path
override
-
cubicTo(
PointT c1, PointT c2, PointT p, bool shorthand) → void -
Add a cubicTo to the path
override
-
end(
) → void -
Finish the path.
override
-
lineTo(
PointT p) → void -
Add a lineTo to the path
override
-
moveTo(
PointT p) → void -
Add a moveTo to the path
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
quadraticBezierTo(
PointT control, PointT p, bool shorthand) → void -
Add a quadraticBezierTo to the path
override
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited