Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,24 @@ Here’s an example of setting configuration parameters in your Flutter applicat
```dart
Cloudinary cloudinary = CloudinaryObject.fromCloudName(cloudName: 'demo');
```
### Pre-caching Images
Flutter allows you to pre-load Cloudinary images into memory so they display instantly when needed. This improves performance and provides a smoother user experience.

Example:

```dart
// Precache a Cloudinary image in Flutter
void precacheCloudinaryImage(BuildContext context) {
final image = CldImageWidget(
publidId: 'sample',
transformation: Transformation()
..resize(Resize.scale()..width(500)),
);

// Preload the image into cache
precacheImage(image.imageProvider, context);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding the pre-caching documentation! However, there's an issue with the implementation that will prevent it from compiling.

Problem

The code uses image.imageProvider, but this property is not accessible on CldImageWidget. If you try to compile this code, you'll get the following error:

}


### Transform and Optimize Assets

Expand Down Expand Up @@ -82,4 +100,4 @@ Cloudinary is a powerful media API for websites and mobile apps alike, Cloudinar
- [Cloudinary Website](https://cloudinary.com): Learn about Cloudinary's products, partners, customers, pricing, and more.

## Licence
Released under the MIT license.
Released under the MIT license.