toParamCacheStrategy method
String
toParamCacheStrategy(
{ - int? ttl,
- bool? keepExpiredCache,
})
Implementation
String toParamCacheStrategy({int? ttl, bool? keepExpiredCache}) {
if (this == CacheStrategy.justAsync) {
return 'cacheStrategy: ${value.pascalCase}Strategy()';
}
return 'cacheStrategy: ${value.pascalCase}Strategy(${ttl == null ? '' : 'ttlValue: const Duration(minutes: $ttl)'}${keepExpiredCache == null ? '' : ttl == null ? '' : ', keepExpiredCache: $keepExpiredCache'}${ttl != null || keepExpiredCache != null ? ',' : ''})';
}