feat(inventory): implement swipeable inventory tile and product picker field
This commit is contained in:
@@ -24,18 +24,16 @@ final mealPlanDashboardProvider = FutureProvider<MealPlanDashboard>((ref) async
|
||||
|
||||
return guardedApiCall(ref, () async {
|
||||
final repository = ref.read(mealPlanRepositoryProvider);
|
||||
final entries = await repository.fetchEntries(week.fromIso, week.toIso, token: token);
|
||||
final shoppingItems = await repository.fetchShoppingList(week.fromIso, week.toIso, token: token);
|
||||
final inventoryCompareItems = await repository.fetchInventoryCompare(
|
||||
week.fromIso,
|
||||
week.toIso,
|
||||
token: token,
|
||||
);
|
||||
|
||||
// Start all three requests in parallel.
|
||||
final entriesFuture = repository.fetchEntries(week.fromIso, week.toIso, token: token);
|
||||
final shoppingFuture = repository.fetchShoppingList(week.fromIso, week.toIso, token: token);
|
||||
final compareFuture = repository.fetchInventoryCompare(week.fromIso, week.toIso, token: token);
|
||||
|
||||
return MealPlanDashboard(
|
||||
entries: entries,
|
||||
shoppingItems: shoppingItems,
|
||||
inventoryCompareItems: inventoryCompareItems,
|
||||
entries: await entriesFuture,
|
||||
shoppingItems: await shoppingFuture,
|
||||
inventoryCompareItems: await compareFuture,
|
||||
);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user