flutter_svg icon indicating copy to clipboard operation
flutter_svg copied to clipboard

Loading large size svg will not be smooth

Open jazzyyoung opened this issue 4 years ago • 4 comments

hello dear, First of all, this is a great component that helped me a lot, thank you very much.And I drew a large svg ,with a size of 1024*1024 and about 512k [maybe will be larger in th future :)]. However, after loading this large-sized svg, zooming in and out with my fingers will not be smooth, how to deal with it Thank you again.

jazzyyoung avatar Jul 10 '20 05:07 jazzyyoung

This library was designed primarily with smaller, simpler SVGs in mind - particularly icons.

It should be possible to make that smooth, but I don't have plans to work on that anytime soon. I'd be happy to review PRs or design documents that suggested how to do it.

dnfield avatar Jul 10 '20 16:07 dnfield

Hey @dnfield! How has this changed since vector_graphics is now the backend? I have this inconspicuous SVG here that is ~547kb. I used the vector_graphics_compiler to create a binary but that is still ~200kb. CS2 Skill Group 18

Right now, we're going to switch to using PNGs instead of an SVG for this, but I'd like to come back to it eventually. Is there any other way you think I could optimize this, especially for a scrolling list?

Reprevise avatar Nov 24 '23 21:11 Reprevise

Hey @dnfield! How has this changed since vector_graphics is now the backend? I have this inconspicuous SVG here that is ~547kb. I used the vector_graphics_compiler to create a binary but that is still ~200kb. CS2 Skill Group 18

Right now, we're going to switch to using PNGs instead of an SVG for this, but I'd like to come back to it eventually. Is there any other way you think I could optimize this, especially for a scrolling list?

This particular SVG is very detailed and would probably be better to ship as a raster asset.

dnfield avatar Nov 25 '23 01:11 dnfield

This particular SVG is very detailed and would probably be better to ship as a raster asset.

We have shipped this as a WEBP for the time being (the 17 other rank SVGs too), and it's definitely way more compact at around ~40kb, and Flutter doesn't seem to have a problem with these. Thanks for the input!

Thanks to you and the team for making this, we use your package a lot in production in our app!

Reprevise avatar Nov 25 '23 01:11 Reprevise