getProductsByPrecautionaryAllergenStatementId method

Future<List<Product>> getProductsByPrecautionaryAllergenStatementId(
  1. String id
)

Gets all the products of the precautionary allergen statement that matches an id.

Implementation

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

  ClientException.checkIsSuccessStatusCode(response);

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