getAllergens method

Future<List<Allergen>> getAllergens()

Gets all the allergens.

Implementation

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

  ClientException.checkIsSuccessStatusCode(response);

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