responsive_cloud_image 1.2.0
responsive_cloud_image: ^1.2.0 copied to clipboard
A CDN-agnostic responsive image loader that dynamically calculates widget bounds and requests optimized images from Supabase, Cloudinary, Imgix, Unsplash, Shopify, and more.
1.2.0 #
Added #
quality(1-100): optional output quality requested from the CDN. It is sent asqualityto Supabase (limited to the documented 20-100 range) and Appwrite, asqto Imgix, Unsplash and Sanity, and asq_<value>to Cloudinary. Shopify,CloudProvider.customandCloudProvider.genericignore it. When it is not set, nothing changes.cacheKey: a stable identity for the disk cache on native platforms, for images whose URL carries a changing part such as the token of a signed URL. The size,fitandqualityare added to the key automatically, so different renditions never overwrite each other. The original-URL fallback gets its own key. Ignored on the web, where the browser caches by URL.CloudUrlAdapter.buildUrlaccepts the samequalityargument.
Notes #
- Nothing changes for existing code: both new parameters are optional and default to
null.
1.1.0 #
Fixed #
- Allow
cached_network_image3.4.1 up to (but not including) 5.0.0, so apps already on 4.x can install this package. This also restores the full pub.dev dependency score. - The original
imageUrlis now tried once when the optimized image fails to load, as the README always promised, beforeerrorWidgetis shown. Previously the fallback URL was passed around but never used. - A zero-size layout (for example the first frame of an expand animation) no longer downloads the full-size original. Nothing is requested until the box has an area.
CloudUrlAdapter.buildUrlno longer throws onNaN, infinite or malformed input, and a throwingcustomUrlBuilderis reported throughFlutterError.reportErrorand falls back to the original URL instead of crashing the build.- Requested sizes are capped: 2500 px for Supabase, 4000 px for Appwrite and 4096 px otherwise (the aspect ratio is kept). Large widgets on high-density screens no longer ask for sizes the provider rejects.
fitis respected.BoxFit.contain,scaleDown,fill,fitWidthandfitHeightnow select the matching crop or resize mode of each provider instead of always requesting a cropped image.BoxFit.noneskips URL optimization.- Supabase: signed and authenticated URLs are returned unchanged (their parameters are ignored by the
server), and only the first
/object/public/is rewritten. - Appwrite: sends the documented
gravityparameter instead ofcrop. - Shopify: an existing
_WxHsuffix is replaced instead of stacked. - Repeated query parameters are preserved for the query-string providers.
- The default error icon no longer scales with the full image height, and the default placeholder now follows the app theme instead of a fixed dark colour.
Added #
sizeStep(default 50): requested sizes are rounded up to a multiple of this value, so resizing or animating a widget reuses cached images instead of requesting a new URL every frame. Use1for the exact size.maxDimension: optional cap for the larger side of the request.httpHeaders: headers sent with every image request, for example for private buckets.alignmentandsemanticLabel.CloudUrlAdapter.buildUrlacceptsfit,sizeStepandmaxDimension.- Debug assertions for
provider: customwithout acustomUrlBuilder,sizeStep < 1andmaxDimension <= 0. - Unit and widget tests, including a Chrome test for the web renderer.
topicsandscreenshotsinpubspec.yaml.
Changed #
- The minimum SDK is now Dart 3.8 / Flutter 3.32 (was Dart 3.11.5 and a placeholder Flutter constraint).
- Requested sizes are now rounded up to the next multiple of
sizeStep(default 50), so URLs differ from 1.0.x. SetsizeStep: 1for the old exact sizes. customUrlBuildernow receives the final whole-pixel size (after rounding and capping).- Internal restructure:
cloud_providers.dartis split intocloud_provider.dart,cloud_url_adapter.dartand one file per provider underproviders/. The public API is unchanged. - The example app's Android main manifest and macOS entitlements now allow network access.
1.0.2 #
- Added complete public API documentation (Dartdoc comments) across all exported libraries, widgets, classes, and enum values.
- Optimized the public API footprint by making the
CloudUrlAdapterconstructor private. - Resolved all static analysis warnings regarding API documentation coverage.
1.0.1 #
- Fixed platform compatibility analyzer warnings.
- Restored full 100% WASM compatibility.
- Added conditional compilation for Web, Mobile, and Desktop targets.
1.0.0 #
- Initial release
