mirror of
https://github.com/immich-app/immich.git
synced 2025-01-08 12:56:48 +01:00
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));
|
||
|
}
|
||
|
|
||
|
}
|