find<T extends Cacheable> method Null safety

  1. @override
T? find<T extends Cacheable>(
  1. {String? key}
)
override

Implementation

@override
T? find<T extends Cacheable>({String? key}) {
  if (T == GroupChannel || T == OpenChannel) {
    return channel as T?;
  } else if (T == ReadStatus) {
    return readStatus[key] as T?;
  } else if (T == TypingStatus) {
    return typingStatus[key] as T?;
  } else if (T == DeliveryStatus) {
    return deliveryStatus as T?;
  } else if (T == CachedDataMap) {
    return cachedMetaData as T?;
  }
  return null;
}