MemoryCache class

Constructors

MemoryCache({int maxCacheSize = 200})

Properties

hashCode int
The hash code for this object.
no setterinherited
maxCacheSize int
The maximum size of the cache, the default value is 200.
getter/setter pair
orderList List<String>
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
store Map<String, ({int expired, String value})>
getter/setter pair

Methods

addValue(String key, String value, int expired) → void
Adding a value to the memory with an expired time. key The key. value The value. expired The expired time. The unit is ms.
getValue(String key) String?
Get a value from the memory. if the key is not in the memory or the value is expired will return a null value. key The key.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited