defaultFetchTtl top-level constant
Global default TTL for cached data.
Used by fetchWithTtl when no explicit TTL is provided. Repositories can override this for entity-specific TTL requirements.
Making this configurable: To connect this to user preferences later:
- Create a provider that reads from SharedPreferences/secure storage
- Pass the value through repository constructors or as a parameter
- Example:
fetchWithTtl(cached: data, ttl: ref.watch(userTtlPrefProvider))
Implementation
const Duration defaultFetchTtl = Duration(days: 3);