dnfield / flutter_svg

SVG parsing, rendering, and widget library for Flutter
MIT License
1.67k stars 458 forks source link

Add errorBuilder to SvgPicture and adjust underlying vector_graphics errorBuilder (to trigger on BytesLoader errors) #996

Open Yagorundy opened 1 year ago

Yagorundy commented 1 year ago

My use case: I am trying to fallback to a svg in assets if my SvgPicture.network() fails for any reason (wrong url, request returns 404, invalid svg format, ...)

widgets like the Flutter Image fully support this errorBuilder and any error in the process (image loading/parsing/rendering) triggers the errorBuilder callback

From my observations:

image from vector_graphics.dart image

guopeng1994 commented 10 months ago

WE NEED THIS!!

mnayef95 commented 1 month ago

I've created a PR on vector_graphics. Once @dnfield approves it, we can update flutter_svg to handle it.

https://github.com/dnfield/vector_graphics/pull/255