getChannels method

Future<List<Channel>> getChannels()

Gets all the channels.

Implementation

Future<List<Channel>> getChannels() async {
  final response = await _context.client.get(
    Uri.https(authority, '$path/channels'),
  );

  ClientException.checkIsSuccessStatusCode(response);

  return (json.decode(response.body) as List)
      .map((e) => Channel.fromJson(e))
      .toList();
}