getNodesByChannelId method

Future<List<Node>> getNodesByChannelId(
  1. int id
)

Gets all the nodes of the channel that matches an id.

Implementation

Future<List<Node>> getNodesByChannelId(int id) async {
  final response = await _context.client.get(
    Uri.https(authority, '$path/channels/$id/nodes'),
  );

  ClientException.checkIsSuccessStatusCode(response);

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