ApiMealRepo class

The ApiMealRepo class handles meal-related API operations.

It uses the ApiConnector to make requests and interact with the backend for fetching and adding meals, among other meal-related operations.

Constructors

ApiMealRepo(ApiConnector _apiConnector)
Constructs an instance of ApiMealRepo with a provided ApiConnector.

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

addMeal({required Meal meal, required User user}) Future<ApiReturn>
Adds a new meal entry to the backend via the API.
deleteMeal({required Meal meal, required User user}) Future<ApiReturn>
Deletes an existing meal from the backend via the API.
editMeal({required Meal meal, required User user}) Future<ApiReturn>
Edits an existing meal in the backend via the API.
getMeals({required User user, DateTime? day}) Future<ApiReturn>
Fetches meals for a specific day (defaults to the current day).
getMealTypes(User user) Future<ApiReturn>
Fetches all available meal types from the API.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited