tasks method

Future<List<Task>> tasks()

Implementation

Future<List<Task>> tasks() async {
  Uri uri = _httpClient.config.generateApiUri('/tasks');
  http.Response res = await _httpClient.get(uri);
  Map json = jsonDecode(res.body);
  List tasksRaw = json['tasks'];
  return tasksRaw.map((e) => Task(
      id: e['id'],
      description: e['description']
  )).toList();
}