CacheEntry constructor
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;