1
0
Fork 0
mirror of https://github.com/immich-app/immich.git synced 2025-01-08 12:56:48 +01:00
immich/mobile/lib/shared/services/cache.service.dart

21 lines
465 B
Dart
Raw Normal View History

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));
}
}