I'm trying to pick image from gallery and it works fine. But if the image's extension is webp it's not picking it. So I can't handle the error. Cause it's not throws an error about it. Here is my code snippet:
try {
final XFile? image = await _picker.pickImage(
source: ImageSource.gallery);
if (image != null) {
print(image.path);
}
} catch (e) {
print(e);
}
How can I handle the unsupported image format immediately? I tried timeOut but it also throws error when user viewing the gallery view and not selected image yet.