seed method

void seed(
  1. String key,
  2. Object? data, {
  3. Duration ttl = const Duration(hours: 1),
})

Pre-populates a fresh entry that expires in ttl (default 1 hour).

Implementation

void seed(
  String key,
  Object? data, {
  Duration ttl = const Duration(hours: 1),
}) {
  _data[key] = CacheEntry(data: data, expiryDate: DateTime.now().add(ttl));
}