biocarl / extended_path

A Flutter Path object with superpowers, including re-sampling, dashed lines and a lot more!
https://pub.dartlang.org/packages/extended_path
BSD 2-Clause "Simplified" License
23 stars 0 forks source link
dart dotted-outline dotted-path flutter svg svg-path

extended_path Pub

This library encapsulates the PathExtended object which serves as a extension to the parent Path class of Flutter. Internally a sampled representation of the Path is stored and updated, allowing to manipulate the Path object in powerful ways.

:construction: This library is still at early-stage development and might be subject to breaking API changes!!! :construction:

Supported PathEffects

Here is increasingly growing list with all available parameters and their visual effects. The animation serves for illustration purposes only. For creating such animations I would like to refer to drawing_animation, another package of mine.

Effect Example
ContinousLine
(default)
DiscretePathEffect
DashPathEffect
PathDashPathEffect

Getting Started

    Path p = Path()..addRect(Rect.fromCircle(center: Offset.zero, radius: 2.0));
    PathExtended pp = PathExtended(p)
      ..applyPathEffect(DashPathEffect([10,2], dashOffset: -1))
      ..addPath(circle(0,30.0),Offset.zero);

Design

The API design for the PathEffect classes is inspired by PathEffect for native Android but with some differences:

Current limitations

Internal sampling rate for the path data is currently hardcoded. This might noticeable when sampling a big amount of path data (bad performance) and also for very small paths (edgy lines).

TODO

Milestones