getDietById method

Future<Diet> getDietById(
  1. String id
)

Gets the diet that matches an id.

Implementation

Future<Diet> getDietById(String id) async {
  final response = await _context.client.get(
    Uri.https(authority, '$path/diets/$id'),
  );

  ClientException.checkIsSuccessStatusCode(response);

  return Diet.fromJson(json.decode(response.body));
}