revert image cache patch

Signed-off-by: dom <githubaccount56556@proton.me>
This commit is contained in:
dom
2026-06-22 12:11:53 +08:00
parent c8187ad3a1
commit c4c4fd5f3d
49 changed files with 157 additions and 107 deletions

View File

@@ -1,8 +1,20 @@
import 'dart:math' show pow;
import 'package:flutter/foundation.dart' show PlatformDispatcher;
const unitArr = ['B', 'K', 'M', 'G', 'T', 'P'];
final devicePixelRatio =
PlatformDispatcher.instance.views.first.devicePixelRatio;
extension NumExt on num {
int? get cacheSize {
if (this == 0) {
return null;
}
return (this * devicePixelRatio).round();
}
String get formatSize {
var value = this;
int index = 0;