-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support SVG parsing to/from path.pathData #95
Comments
Interesting idea. Once it's a Dart A another way of playing with paths would be to expose the path parser ( Maybe a reasonable way to expose all this would be to allow a to-be-defined |
BTW, for the example of scaling a |
Looking at this some more, I'm not sure how much would be gained by exposing the production of I'm thinking of leaving any direct production of a I did expose the path parser, and make a utility that can build up a new path string. This allows editing of a path, with a bit of work. For a transform, there's always adding a transform to the containing node. See the docs at 1.1.21-rc.4: |
This is awesome! I think I might try and use this for some cool animations when something is clicked. Always looks good with some animations and it's really fun to play around with. This was just an idea and the fact that you made it possible in such a short time is just amazing... I am running out of ideas on new features. I'll play around with this over the weekend and let you know if I come up with more :) |
Released in 1.1.21 |
In extension to the new awesome feature where you can manipulate the SVG and rebuild it seamlessly by coloring it and other cool stuff, I had this idea that I experimented with a little bit.
If you lookup a SvgPath like so:
You have the
path.pathData
at disposal which basically tells you how that particular path is shaped. There are libraries out there that can transform this pathData to a dart:ui Path object which you can then change by its various methods, for example the transform method.However, I couldn't find an easy way to transform the Path object back into a string which I could then override the original SVG with and rebuild it to create this illusion that the object was changed. It would be cool, imagine you could click on an object and it would scale up and down or some other effect :)
Here are some stackoverflow posts looking for such feature:
flutter-dart-svg-path-to-string
is-it-possible-to-get-an-svg-string-from-flutter-path-object
A newly created issue on another library requesting such feature:
masterashu/svg_path_parser#9
I don't know if this is out of scope for this library, I don't know if it's even possible to parse that way, so I'm just throwing it out there in case it's in scope and would be fun to implement.
The text was updated successfully, but these errors were encountered: