ente/lib/core/cache/image_cache.dart

17 lines
287 B
Dart
Raw Normal View History

2023-08-24 16:56:24 +00:00
import "dart:io";
2020-04-24 20:59:11 +00:00
2020-05-04 20:44:34 +00:00
import 'package:photos/core/cache/lru_map.dart';
2020-04-24 20:59:11 +00:00
2020-06-15 04:50:26 +00:00
class FileLruCache {
2023-08-24 16:56:24 +00:00
static final LRUMap<String, File> _map = LRUMap(25);
2020-04-24 20:59:11 +00:00
2023-08-24 16:56:24 +00:00
static File? get(String key) {
2021-08-04 10:11:38 +00:00
return _map.get(key);
2020-04-24 20:59:11 +00:00
}
2023-08-24 16:56:24 +00:00
static void put(String key, File value) {
_map.put(key, value);
2020-04-24 20:59:11 +00:00
}
}