Skip to content

[Enhancement] Support SVG #15501

@dnfield

Description

@dnfield

EDIT:

https://pub.dev/packages/flutter_svg
https://github.com/dnfield/flutter_svg

If that's not meeting your needs or has a bug, please file bugs for it at https://github.com/dnfield/flutter_svg/issues/new


This is a split from #1831

While that issue can focus on a Flutter-specific vector drawable format, this issue should track SVG based support.

@cbazza @deborah-ufw were also particularly interested in this.

I have started some work here: https://github.com/dnfield/flutter_svg
I believe it will be beneficial to have some changes to engine as well, in particular:

  • Expose Skia's native SVG Path parsing logic
  • Expose SkPath::addCircle

I've started work on that here: https://github.com/dnfield/engine/tree/path_svg (branch currently contains other changes as well, will either split that out or submit it after a similar PR lands).

Some other thoughts from that thread:

  • Don't want/need full SVG support (scripting, foreign elements, animations (?), full CSS support, external references, other?)
  • Ideally should be async from top to bottom - including XML parsing
  • Want to be able to load assets created by designers at runtime for use on multiple devices/pixel densities
  • Should be useable anywhere an Image or Icon is today

Metadata

Metadata

Assignees

No one assigned

    Labels

    c: new featureNothing broken; request for a new capabilityengineflutter/engine related. See also e: labels.frameworkflutter/packages/flutter repository. See also f: labels.would be a good packageSeparate Flutter package should be made for this

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions