image cache patch

Signed-off-by: dom <githubaccount56556@proton.me>
This commit is contained in:
dom
2026-05-11 12:51:45 +08:00
parent 32eeef7866
commit 459f84b208
48 changed files with 260 additions and 143 deletions

View File

@@ -1,16 +1,5 @@
import 'dart:math' show pow;
import 'package:flutter/widgets.dart' show BuildContext, MediaQuery;
extension ImageExtension on num {
int? cacheSize(BuildContext context) {
if (this == 0) {
return null;
}
return (this * MediaQuery.devicePixelRatioOf(context)).round();
}
}
extension IntExt on int? {
int? operator +(int other) => this == null ? null : this! + other;
int? operator -(int other) => this == null ? null : this! - other;