flutter_cached_network_image icon indicating copy to clipboard operation
flutter_cached_network_image copied to clipboard

Provide Image Info in imageBuilder() Method

Open Ultranmus opened this issue 2 years ago • 0 comments

🚀 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

Ultranmus avatar Feb 02 '24 14:02 Ultranmus