set method
Stores value under key (null removes it). With ttl the entry disappears once it elapses.
Takes effect immediately for readers; the future completes once it is on disk.
Implementation
Future<void> set(String key, Object? value, {Duration? ttl}) {
if (value == null) return remove(key);
_put(key, value, ttl == null ? null : DateTime.now().add(ttl).millisecondsSinceEpoch);
return _schedule();
}