add abstract method

Future<bool> add(
  1. String key,
  2. dynamic value,
  3. Duration ttl
)

Stores a value in the cache if the key does not exist.

Returns true if the item was actually added, false otherwise.

  • Parameters:
    • key: A non-null, non-empty string representing the cache key.
    • value: The data to be cached.
    • ttl: The duration for which the item should remain in the cache.

Implementation

Future<bool> add(String key, dynamic value, Duration ttl);