delete<T extends Cacheable> method Null safety

  1. @override
void delete<T extends Cacheable>(
  1. {String? key,
  2. Cacheable? data}
)
override

Implementation

@override
void delete<T extends Cacheable>({String? key, Cacheable? data}) {
  if (T == DeliveryStatus || data is DeliveryStatus) {
    deliveryStatus = null;
  } else if (T == TypingStatus || data is TypingStatus) {
    typingStatus.remove(key);
  } else if (T == ReadStatus || data is ReadStatus) {
    readStatus.remove(key);
  } else if (T == CachedDataMap || data is CachedDataMap) {
    cachedMetaData = null;
  }

  //channel should be delete itself
}