Baseflow / Baseflow/flutter_cached_network_image

Provide Image Info in imageBuilder() Method

Open
#923 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Dart
Stars
2.6k
Forks
731
Avg merge
3d 9h
Merged PRs (30d)
1

Description

## 🚀 Feature Requests

I have a feature request that I believe would enhance the package's usability. Specifically, it would be immensely helpful if the imageBuilder() method could provide information about the loaded image(ImageInfo) . Currently, users need to implement a separate completer and utilize a FutureBuilder to obtain image dimensions. However, this approach not only introduces additional complexity but also poses challenges in scenarios where the image failed to load initially due to internet connectivity issues; in such cases, the image is not automatically reloaded when the internet connection is restored.
```
CachedNetworkImage(
imageUrl : url,
imageBuilder(context, imageProvider, imageInfo){}
)
```

By incorporating image info directly into the imageBuilder() method, users could dynamically adjust the aspect ratio based on the image's size without the need for additional asynchronous handling (Beneficial for users who wish to dynamically adjust the aspect ratio based on whether the loaded image is in portrait or landscape orientation.).

### Platforms affected (mark all that apply)
- [ ] :iphone: iOS
- [ ] :robot: Android

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.