toParamCacheStrategy method

String toParamCacheStrategy({
  1. int? ttl,
  2. 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 ? ',' : ''})';
}