CacheEntry constructor

CacheEntry(
  1. String key,
  2. dynamic value,
  3. int timeout
)

Creates a new instance of the cache entry and assigns its values.

  • key a unique key to locate the value.
  • value a value to be stored.
  • timeout expiration timeout in milliseconds.

Implementation

CacheEntry(String key, dynamic value, int timeout)
    : _key = key,
      _value = value,
      _expiration = DateTime.now()
          .toUtc()
          .add(Duration(milliseconds: timeout))
          .millisecondsSinceEpoch;