add method
Adds the provided value to the cache.
This is used to add events to the cache that have not been posted to the network.
This will do a lookup in the cache to find the event that matches the provided value
and if it is found, it will remove the old event and add the new one.
Implementation
void add(AppFitEvent event) {
// Determine if the event is already in the cache
if (_cache.where((e) => e.id == event.id).isNotEmpty) {
// If it is, remove the old event and add the new one
remove(event.id);
}
_cache.add(event);
}