setDateTime method
Saves a DateTime value with the given key.
This method stores a DateTime value in the storage by converting it to milliseconds since epoch format, associating it with the specified key. If a value already exists for this key, it will be replaced.
Parameters:
key- The unique identifier for the DateTime value.value- The DateTime value to store.
Returns a Future that completes when the DateTime has been successfully stored.
Throws:
- ArgumentError if the key is invalid.
Implementation
@override
Future<void> setDateTime(String key, DateTime value) =>
setInt(key, value.isUtc ? value.millisecondsSinceEpoch : value.toUtc().millisecondsSinceEpoch);