toMap method
Converts the CacheModel instance to a map for easy serialization. The map can be used for storage or network transmission.
Implementation
Map<String, dynamic> toMap() {
return <String, dynamic>{
'expirationDateTime': expirationDateTime
.toJson(), // Serializes the expirationDateTime to a string format
'value': value, // Included cached value
};
}