put method
Stores value under key.
ttl (relative) or expiresAt (absolute) make the entry expire; when
both are given expiresAt wins. sync overrides the database's sync
mode for this write when it is stronger than the default.
Throws InvalidKeyException for a reserved or empty key and
SerializationException when value cannot be encoded.
Implementation
Future<void> put(
String key,
Object? value, {
Duration? ttl,
DateTime? expiresAt,
SyncMode? sync,
}) {
_ensureOpen();
return _track(
() => _applyMutations(<_Mutation>[
_Mutation.put(key, value, _resolveExpiry(ttl, expiresAt)),
], sync: sync),
);
}