DataHandlerMealRepo class

The DataHandlerMealRepo class is responsible for handling meal-related operations, either through the local database or the API, depending on the availability of local database support.

It contains methods for fetching meal types, retrieving meals for specific days, adding new meals, editing existing meals, and deleting meals.

Constructors

DataHandlerMealRepo(ApiConnector _apiConnector, DatabaseWrapper databaseWrapper)
Constructs an instance of DataHandlerMealRepo.

Properties

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

Methods

addMeal({required Meal meal, required User user}) Future<bool>
Adds a new meal to either the local database or the API.
deleteMeal({required Meal meal, required User user}) Future<bool>
Deletes an existing meal from either the local database or the API.
editMeal({required Meal meal, required User user}) Future<bool>
Edits an existing meal in either the local database or the API.
getMeals({required User user, DateTime? day}) Future<List<Meal>?>
Fetches meals for a specific day from either the local database or the API.
getMealTypes(User user) Future<List<String>?>
Fetches all meal types either from the local database or the API, depending on the availability of local database support.
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