feat: add meal planning feature with API integration
- 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.
This commit is contained in:
@@ -26,4 +26,20 @@ class InventoryApiPaths {
|
||||
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)}';
|
||||
}
|
||||
@@ -17,6 +17,7 @@ import '../../features/inventory/presentation/create_inventory_screen.dart';
|
||||
import '../../features/inventory/presentation/inventory_edit_screen.dart';
|
||||
import '../../features/inventory/presentation/consume_inventory_screen.dart';
|
||||
import '../../features/inventory/presentation/consumption_history_screen.dart';
|
||||
import '../../features/meal_plan/presentation/meal_plan_screen.dart';
|
||||
import '../../features/pantry/presentation/pantry_screen.dart';
|
||||
|
||||
final appRouterProvider = Provider<GoRouter>((ref) {
|
||||
@@ -159,6 +160,10 @@ final appRouterProvider = Provider<GoRouter>((ref) {
|
||||
path: '/inventory',
|
||||
builder: (context, state) => const InventoryScreen(),
|
||||
),
|
||||
GoRoute(
|
||||
path: '/matsedel',
|
||||
builder: (context, state) => const MealPlanScreen(),
|
||||
),
|
||||
GoRoute(
|
||||
path: '/baslager',
|
||||
builder: (context, state) => const PantryScreen(),
|
||||
|
||||
@@ -27,6 +27,12 @@ class AppShell extends ConsumerWidget {
|
||||
icon: Icons.inventory_2_outlined,
|
||||
label: 'Inventarie',
|
||||
),
|
||||
_AppDestination(
|
||||
path: '/matsedel',
|
||||
title: 'Matsedel',
|
||||
icon: Icons.calendar_month_outlined,
|
||||
label: 'Matsedel',
|
||||
),
|
||||
_AppDestination(
|
||||
path: '/baslager',
|
||||
title: 'Baslager',
|
||||
|
||||
Reference in New Issue
Block a user