MealDatabaseRepo class
The MealDatabaseRepo class provides repository methods for meal-related
database operations. It interacts with the DatabaseWrapper to perform
CRUD operations and manage meal data in the local database.
Constructors
- MealDatabaseRepo(DatabaseWrapper _databaseWrapper)
-
Constructor for
MealDatabaseRepo.
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 int userID}) → Future< int?> - Adds a new meal to the database.
-
deleteMeal(
{required Meal meal, required int userID}) → Future< bool> - Deletes a meal and its corresponding day_meals entry.
-
getMealID(
int userID, int year, int month, int day, String mealType) → Future< int?> - Retrieves the meal ID based on user ID, day, and meal type.
-
getMealsForDay(
int userID, int year, int month, int day) → Future< List< Meal> > - Retrieves all meals for a specific day, based on the user ID and day ID.
-
getMealTypes(
) → Future< List< String> > - Retrieves all meal types stored in the database.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
updateMeal(
{required Meal meal, required int userID}) → Future< bool> - Updates an existing meal in the database based on user, day, and meal type.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited