CacheConfigurationModel constructor

const CacheConfigurationModel({
  1. required String name,
  2. int maxCacheSize = CacheConstants.defaultMaxDiskCacheSize,
  3. int maxCacheEntries = CacheConstants.defaultMaxCacheEntries,
  4. Duration defaultTtl = CacheConstants.defaultCacheTtl,
  5. CacheExpirationPolicy expirationPolicy = CacheExpirationPolicy.ttl,
  6. CacheStorageLevel storageLevel = CacheStorageLevel.multiLevel,
  7. CacheFileType fileType = CacheFileType.general,
  8. bool autoCleanupEnabled = true,
  9. double cleanupThreshold = CacheConstants.cacheCleanupThreshold,
  10. double cleanupTargetRatio = CacheConstants.cacheCleanupTargetRatio,
  11. Duration cleanupInterval = CacheConstants.cacheCleanupInterval,
  12. bool wifiOnlyMode = false,
  13. int maxConcurrentDownloads = CacheConstants.defaultMaxConcurrentDownloads,
  14. Duration networkTimeout = CacheConstants.defaultNetworkTimeout,
  15. Duration downloadTimeout = CacheConstants.defaultDownloadTimeout,
  16. int retryAttempts = CacheConstants.defaultRetryAttempts,
  17. Duration retryDelay = CacheConstants.defaultRetryDelay,
  18. bool enabled = true,
  19. bool debugMode = false,
  20. String? customCacheDirectory,
  21. Map<String, String> customHeaders = const <String, String>{},
  22. CachePriority priority = CachePriority.normal,
  23. bool validateIntegrity = true,
  24. bool enableCompression = false,
  25. bool enableEncryption = false,
  26. Map<String, Object?> metadata = const <String, Object?>{},
})

Constructor for CacheConfigurationModel

Implementation

const CacheConfigurationModel({
  required this.name,
  this.maxCacheSize = CacheConstants.defaultMaxDiskCacheSize,
  this.maxCacheEntries = CacheConstants.defaultMaxCacheEntries,
  this.defaultTtl = CacheConstants.defaultCacheTtl,
  this.expirationPolicy = CacheExpirationPolicy.ttl,
  this.storageLevel = CacheStorageLevel.multiLevel,
  this.fileType = CacheFileType.general,
  this.autoCleanupEnabled = true,
  this.cleanupThreshold = CacheConstants.cacheCleanupThreshold,
  this.cleanupTargetRatio = CacheConstants.cacheCleanupTargetRatio,
  this.cleanupInterval = CacheConstants.cacheCleanupInterval,
  this.wifiOnlyMode = false,
  this.maxConcurrentDownloads = CacheConstants.defaultMaxConcurrentDownloads,
  this.networkTimeout = CacheConstants.defaultNetworkTimeout,
  this.downloadTimeout = CacheConstants.defaultDownloadTimeout,
  this.retryAttempts = CacheConstants.defaultRetryAttempts,
  this.retryDelay = CacheConstants.defaultRetryDelay,
  this.enabled = true,
  this.debugMode = false,
  this.customCacheDirectory,
  this.customHeaders = const <String, String>{},
  this.priority = CachePriority.normal,
  this.validateIntegrity = true,
  this.enableCompression = false,
  this.enableEncryption = false,
  this.metadata = const <String, Object?>{},
});