RemoteContentPack<T>.withCache constructor
RemoteContentPack<T>.withCache ({})
ENH-94: same signed/typed content pack with a durable verified cache. Kept as a NAMED constructor (instead of changing RemoteContentPack's existing signature by adding optional params) so every pre-existing consumer remains 100% API-gate compatible — additive only, no major version bump/BREAKING changelog required.
Implementation
RemoteContentPack.withCache({
required this.assetPath,
required this.schemaVersion,
required this.fromJson,
required this.storage,
required this.cacheKey,
this.migrate,
this.contentSecret,
this.fetchRemote,
this.maxCacheAge,
AssetBundle? bundle,
}) : historyCapacity = null,
contentVersionResolver = null,
_bundle = bundle ?? rootBundle {
if (cacheKey == null || cacheKey!.isEmpty) {
throw ArgumentError.value(cacheKey, 'cacheKey', 'must not be empty');
}
}