withSize function
Implementation
ImageProvider<Object> withSize(
ImageProvider<Object> base, {
int? width,
int? height,
}) {
if (width == null && height == null) return base;
// IMPORTANT: never pass both; it can distort aspect ratio across platforms.
if (width != null && height != null) {
final side = math.max(width, height);
return ResizeImage(base, width: side);
}
return ResizeImage(base, width: width, height: height);
}