@@ -26,7 +26,8 @@ mixin ImageCacheManager on BaseCacheManager {
2626 int ? maxWidth,
2727 }) async * {
2828 if (maxHeight == null && maxWidth == null ) {
29- yield * getFileStream (url, key: key, headers: headers, withProgress: withProgress);
29+ yield * getFileStream (url,
30+ key: key, headers: headers, withProgress: withProgress);
3031 return ;
3132 }
3233 key ?? = url;
@@ -75,9 +76,12 @@ mixin ImageCacheManager on BaseCacheManager {
7576 }
7677
7778 var image = await _decodeImage (originalFile.file);
78-
79- var shouldResize = maxWidth != null ? image.width > maxWidth : false ||
80- maxHeight != null ? image.height > maxHeight : false ;
79+
80+ var shouldResize = maxWidth != null
81+ ? image.width > maxWidth
82+ : false || maxHeight != null
83+ ? image.height > maxHeight
84+ : false ;
8185 if (! shouldResize) return originalFile;
8286 if (maxWidth != null && maxHeight != null ) {
8387 var resizeFactorWidth = image.width / maxWidth;
@@ -88,8 +92,12 @@ mixin ImageCacheManager on BaseCacheManager {
8892 maxHeight = (image.height / resizeFactor).round ();
8993 }
9094
91- var resized = await _decodeImage (originalFile.file, width: maxWidth, height: maxHeight, allowUpscaling: false );
92- var resizedFile = (await resized.toByteData (format: ui.ImageByteFormat .png))! .buffer.asUint8List ();
95+ var resized = await _decodeImage (originalFile.file,
96+ width: maxWidth, height: maxHeight, allowUpscaling: false );
97+ var resizedFile =
98+ (await resized.toByteData (format: ui.ImageByteFormat .png))!
99+ .buffer
100+ .asUint8List ();
93101 var maxAge = originalFile.validTill.difference (DateTime .now ());
94102
95103 var file = await putFile (
0 commit comments