getByUsername method

Future<Channel> getByUsername(
  1. dynamic username
)

Gets the metadata associated with the channel of the specified user. username must be either a Username or a string which is parsed to a Username

Implementation

Future<Channel> getByUsername(dynamic username) async {
  username = Username.fromString(username);

  var channelPage = await ChannelPage.getByUsername(
      _httpClient, (username as Username).value);
  return Channel(
    ChannelId(channelPage.channelId),
    channelPage.channelTitle,
    channelPage.channelLogoUrl,
    channelPage.channelBannerUrl,
    channelPage.subscribersCount,
  );
}