putIfAbsent method

  1. @override
Future<bool> putIfAbsent(
  1. String key,
  2. dynamic value, {
  3. Duration? expiryDuration,
})
override

Associates the specified key with the given value if not already associated with a value.

  • key: key with which the specified value is to be associated
  • value: value to be associated with the specified key

Returns true if a value was set.

Implementation

@override
Future<bool> putIfAbsent(String key, dynamic value,
    {Duration? expiryDuration}) {
  _secondary.putIfAbsent(key, value, expiryDuration: expiryDuration);
  return _primary.putIfAbsent(key, value, expiryDuration: expiryDuration);
}