Skip to content

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

Description

@yagorundy

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:

  • SvgPicture widget does not accept errorBuilder
  • The vector_graphics package does not trigger errorBuilder for BytesLoader objects loadBytes() calls, it only triggers it for errors in decodeVectorGraphics()

image from vector_graphics.dart
image

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions