improve image lifecycle handling
This commit is contained in:
1 parent
6f3a84fb31
commit
d1e769fb7c
14 files changed
+126
-51
No files matched your search
@@ -25,12 +25,9 @@ import 'package:weblibre/core/logger.dart';
|
||||
import 'package:weblibre/domain/entities/equatable_image.dart';
|
||||
import 'package:weblibre/utils/lru_cache.dart';
|
||||
|
||||
final _cache = LRUCache<int, EquatableImage>(
|
||||
100,
|
||||
onEvict: (image) => image.dispose(),
|
||||
);
|
||||
final _cache = LRUCache<int, EquatableImage>(100);
|
||||
|
||||
/// Clears the global image cache, disposing all cached images.
|
||||
/// Clears the global image decode cache.
|
||||
void clearImageCache() {
|
||||
_cache.clear();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user