getBaseChannel static method Null safety

Future<BaseChannel> getBaseChannel(
  1. ChannelType type,
  2. String channelUrl
)

Returns channel with given type and channelUrl

Implementation

static Future<BaseChannel> getBaseChannel(
  ChannelType type,
  String channelUrl,
) async {
  switch (type) {
    case ChannelType.group:
      return GroupChannel.getChannel(channelUrl);
    case ChannelType.open:
      return OpenChannel.getChannel(channelUrl);
  }
}