Skip to content
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

Catching error or having an "error" placeholder #1007

Open
vd3d opened this issue Oct 30, 2023 · 5 comments · May be fixed by #1102
Open

Catching error or having an "error" placeholder #1007

vd3d opened this issue Oct 30, 2023 · 5 comments · May be fixed by #1102

Comments

@vd3d
Copy link

vd3d commented Oct 30, 2023

Hi,

First thanks for the library :-)

I'm currently using "SvgPicture.network" with a placeholder, but when there are internet connection issues, I got an exception in the debug log.

But, the placeholder continues to animate, I would like to put a default icon or just an empty one.

I have see multiples requests like mines:
dnfield/vector_graphics#196 (commits)
#881

... and more...

I have the feeling it has been implemented, or partially, but I can't figure out how I can handle such cases (which are commons)

Thanks for your help

PS: I haven't find any solution on this forum, sorry

@animator
Copy link

+1 .. kindly add an error builder.

@alexda12
Copy link

@animator @vd3d Instead of waiting for an errorBuilder property to be added, you can actually handle this yourself by bypassing svgPicture.network, handle the loading of the URL yourself via DIO or Http package and then return an SvgPicture yourself from the http get request. if there is an exception you can trap this and handle appropriately - i.e add a retry button to re-load the resource , in situations where there is no network. This approach with Riverpod for caching works a treat and means there is absolutely no need to use svgPicture.network.

@animator
Copy link

animator commented Jan 6, 2024

@alexda12 I am using SVG string which can be a faulty SVG XML string. Thus, the need of an error builder in case there is any issue in parsing or rendering. This has nothing to do with network.

@amake
Copy link

amake commented Oct 1, 2024

I see that createCompatVectorGraphic takes an errorBuilder; it would be great if you could expose that as an argument to SvgPicture.

@amake
Copy link

amake commented Oct 2, 2024

I see now that this is basically a duplicate of #996.

For my purposes I need that, and dnfield/vector_graphics#255 addressed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants