getPrecautionaryAllergenStatementsByProductId method

Future<List<PrecautionaryAllergenStatement>> getPrecautionaryAllergenStatementsByProductId(
  1. String id
)

Gets all the precautionary allergen statements of the product that matches an id.

Implementation

Future<List<PrecautionaryAllergenStatement>>
    getPrecautionaryAllergenStatementsByProductId(String id) async {
  final response = await _context.client.get(
    Uri.https(
        authority, '$path/products/$id/precautionaryallergenstatements'),
  );

  ClientException.checkIsSuccessStatusCode(response);

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