2024-03-14 16:29:09 -04:00
|
|
|
import 'package:flutter_cache_manager/flutter_cache_manager.dart';
|
|
|
|
|
|
2026-01-24 14:34:29 -05:00
|
|
|
class RemoteImageCacheManager extends CacheManager {
|
2024-03-14 16:29:09 -04:00
|
|
|
static const key = 'remoteImageCacheKey';
|
|
|
|
|
static final RemoteImageCacheManager _instance = RemoteImageCacheManager._();
|
2025-08-20 15:36:44 -04:00
|
|
|
static final _config = Config(key, maxNrOfCacheObjects: 500, stalePeriod: const Duration(days: 30));
|
2024-03-14 16:29:09 -04:00
|
|
|
|
|
|
|
|
factory RemoteImageCacheManager() {
|
|
|
|
|
return _instance;
|
|
|
|
|
}
|
|
|
|
|
|
2026-01-24 14:34:29 -05:00
|
|
|
RemoteImageCacheManager._() : super(_config);
|
2025-08-20 15:36:44 -04:00
|
|
|
}
|
|
|
|
|
|
2026-01-24 14:34:29 -05:00
|
|
|
class RemoteThumbnailCacheManager extends CacheManager {
|
2025-08-20 15:36:44 -04:00
|
|
|
static const key = 'remoteThumbnailCacheKey';
|
|
|
|
|
static final RemoteThumbnailCacheManager _instance = RemoteThumbnailCacheManager._();
|
|
|
|
|
static final _config = Config(key, maxNrOfCacheObjects: 5000, stalePeriod: const Duration(days: 30));
|
|
|
|
|
|
|
|
|
|
factory RemoteThumbnailCacheManager() {
|
|
|
|
|
return _instance;
|
|
|
|
|
}
|
|
|
|
|
|
2026-01-24 14:34:29 -05:00
|
|
|
RemoteThumbnailCacheManager._() : super(_config);
|
2024-03-14 16:29:09 -04:00
|
|
|
}
|