2020-08-13 01:34:16 +00:00
|
|
|
import 'dart:io' as 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-06-19 23:03:26 +00:00
|
|
|
import 'package:photos/models/file.dart';
|
2020-04-24 20:59:11 +00:00
|
|
|
|
2020-06-15 04:50:26 +00:00
|
|
|
class FileLruCache {
|
2021-07-22 18:41:58 +00:00
|
|
|
static final LRUMap<String, io.File> _map = LRUMap(25);
|
2020-04-24 20:59:11 +00:00
|
|
|
|
2021-08-04 10:11:38 +00:00
|
|
|
static io.File get(String key) {
|
|
|
|
return _map.get(key);
|
2020-04-24 20:59:11 +00:00
|
|
|
}
|
|
|
|
|
2021-08-04 10:11:38 +00:00
|
|
|
static void put(String key, io.File imageData) {
|
|
|
|
_map.put(key, imageData);
|
2020-04-24 20:59:11 +00:00
|
|
|
}
|
|
|
|
}
|