resizeIfNeeded static method
ImageProvider<Object>
resizeIfNeeded(
- int? cacheWidth,
- int? cacheHeight,
- BoxFit? objectFit,
- ImageProvider<
Object> provider,
override
Composes the provider
in a ResizeImage only when cacheWidth
and
cacheHeight
are not both null.
When cacheWidth
and cacheHeight
are both null, this will return the
provider
directly.
Implementation
static ImageProvider<Object> resizeIfNeeded(
int? cacheWidth, int? cacheHeight, BoxFit? objectFit, ImageProvider provider) {
if (cacheWidth != null || cacheHeight != null) {
return WebFResizeImage(provider, width: cacheWidth, height: cacheHeight, objectFit: objectFit);
}
return provider;
}