CacheModel class

A model representing cached data along with its expiration time.

Constructors

CacheModel.new({required DateTime? expirationDateTime, required dynamic value})
Constructor for CacheModel. expirationDateTime is the time when the cached data expires, and value is the actual cached data.
CacheModel.fromMap(dynamic data)
Factory constructor to create a CacheModel instance from a map. This function attempts to parse the map and create a CacheModel object.
factory

Properties

expirationDateTime DateTime?
final
hashCode int
The hash code for this object.
no setterinherited
isExpired bool
Determines if the cached value has expired.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
value → dynamic
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toMap() Map<String, dynamic>
Converts the CacheModel instance to a map for easy serialization. The map can be used for storage or network transmission.
toString() String
A string representation of this object.
override

Operators

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