mirror of
https://github.com/immich-app/immich.git
synced 2024-12-29 11:24:37 +02:00
8e4c4c34e4
* Use CachedNetworkImage and separate cache for thumbnails on library page * Use caching for shared albums as well * Introduce cache service
21 lines
465 B
Dart
21 lines
465 B
Dart
import 'package:flutter_cache_manager/flutter_cache_manager.dart';
|
|
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
|
|
|
enum CacheType {
|
|
albumThumbnail,
|
|
sharedAlbumThumbnail;
|
|
}
|
|
|
|
final cacheServiceProvider = Provider((_) => CacheService());
|
|
|
|
class CacheService {
|
|
|
|
BaseCacheManager getCache(CacheType type) {
|
|
return _getDefaultCache(type.name);
|
|
}
|
|
|
|
BaseCacheManager _getDefaultCache(String cacheName) {
|
|
return CacheManager(Config(cacheName));
|
|
}
|
|
|
|
} |