getChannel static method

Future<FeedChannel> getChannel(
  1. String channelUrl,
  2. {Chat? chat}
)

Implementation

static Future<FeedChannel> getChannel(
  String channelUrl, {
  Chat? chat,
}) async {
  sbLog.i(StackTrace.current, 'channelUrl: $channelUrl');
  chat ??= SendbirdChat().chat;

  final channel = chat.channelCache.find<FeedChannel>(channelKey: channelUrl);
  if (channel != null && !channel.dirty) {
    channel.fromCache = true;
    return channel;
  }
  return await FeedChannel.refresh(channelUrl, chat: chat);
}