e495a4b38e
- Introduced MealPlanApiPaths for handling meal plan related API endpoints. - Added MealPlanScreen for displaying and managing meal plans. - Implemented MealPlanRepository for fetching and updating meal plan data. - Created data models: MealPlanEntry, MealPlanRecipe, InventoryCompareItem, ShoppingItem, and MealPlanDashboard. - Integrated meal plan functionality into the app router and UI. - Updated localization files for meal plan related strings in English and Swedish. - Added state management for meal plan using Riverpod.
45 lines
1.5 KiB
Dart
45 lines
1.5 KiB
Dart
class AuthApiPaths {
|
|
static const login = '/auth/login';
|
|
}
|
|
|
|
class ProductApiPaths {
|
|
static const list = '/products';
|
|
}
|
|
|
|
class RecipeApiPaths {
|
|
static const list = '/recipes';
|
|
static String detail(int id) => '/recipes/$id';
|
|
static String update(int id) => '/recipes/$id';
|
|
static String remove(int id) => '/recipes/$id';
|
|
static String inventoryPreview(int id) => '/recipes/$id/inventory-preview';
|
|
static const parseMarkdown = '/recipes/parse-markdown';
|
|
}
|
|
|
|
class InventoryApiPaths {
|
|
static const list = '/inventory';
|
|
static String update(int id) => '/inventory/$id';
|
|
static String remove(int id) => '/inventory/$id';
|
|
static String consume(int id) => '/inventory/$id/consume';
|
|
static String consumptionHistory(int id) => '/inventory/$id/consumption-history';
|
|
}
|
|
|
|
class PantryApiPaths {
|
|
static const list = '/pantry';
|
|
static String remove(int id) => '/pantry/$id';
|
|
}
|
|
|
|
class MealPlanApiPaths {
|
|
static const list = '/meal-plan';
|
|
|
|
static String listByRange(String from, String to) =>
|
|
'$list?from=${Uri.encodeQueryComponent(from)}&to=${Uri.encodeQueryComponent(to)}';
|
|
|
|
static String shoppingList(String from, String to) =>
|
|
'$list/shopping-list?from=${Uri.encodeQueryComponent(from)}&to=${Uri.encodeQueryComponent(to)}';
|
|
|
|
static String inventoryCompare(String from, String to) =>
|
|
'$list/inventory-compare?from=${Uri.encodeQueryComponent(from)}&to=${Uri.encodeQueryComponent(to)}';
|
|
|
|
static String removeByDate(String date) =>
|
|
'$list/${Uri.encodeComponent(date)}';
|
|
} |