Skip to content

Enable catch for exception returned from underline Flutter #128415

@jdevp

Description

@jdevp

Is there an existing issue for this?

Use case

I'm using source: ImageSource.gallery for users to select images, in which case users can accidentally select video files instead of images. If that happens, Flutter will return the following exception but it is not catchable by the Image Picker package. Therefore, my app will try to load invalid data and crashes. Please add a function to catch whatever error raised by Flutter in the package so the app will know if a valid image data is loaded.

D/skia (28235): --- Failed to create image decoder with message 'unimplemented'

I posted the same question here.

https://stackoverflow.com/questions/76419277/in-flutter-how-do-i-check-that-an-image-returns-from-image-picker-is-valid?noredirect=1#comment134757812_76419277

Proposal

Modify the package so that the exception from underline Flutter will be caught at package level.

Metadata

Metadata

Assignees

No one assigned

    Labels

    in triagePresently being triaged by the triage teamwaiting for customer responseThe Flutter team cannot make further progress on this issue until the original reporter responds

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions