feat: add product selection step before meal planning
Inserts a new PlanProductsSheet as step 1 of the planning flow. Users see their current products as a multi-select checklist (all selected by default) before choosing the planning mode and dates. - Empty state explains the benefit and offers "Add products" CTA while always allowing "Plan without products" to skip - Selected product IDs flow through PlanMenuSheet → PlanDatePickerSheet → MenuService.generateForDates → backend - Backend: added ProductIDs field to generate-menu request body; uses ListForPromptByIDs when set, ListForPrompt otherwise - Backend: added Repository.ListForPromptByIDs (filtered SQL query) - All 12 ARB locale files updated with planProducts* keys Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -5,11 +5,17 @@ import 'package:food_ai/l10n/app_localizations.dart';
|
||||
enum PlanMode { singleMeal, singleDay, days, week }
|
||||
|
||||
/// Bottom sheet that lets the user choose a planning horizon.
|
||||
/// Closes itself and calls [onModeSelected] with the chosen mode.
|
||||
/// Closes itself and calls [onModeSelected] with the chosen mode and the
|
||||
/// product IDs selected in the previous step (may be empty).
|
||||
class PlanMenuSheet extends StatelessWidget {
|
||||
const PlanMenuSheet({super.key, required this.onModeSelected});
|
||||
const PlanMenuSheet({
|
||||
super.key,
|
||||
required this.onModeSelected,
|
||||
required this.selectedProductIds,
|
||||
});
|
||||
|
||||
final void Function(PlanMode mode) onModeSelected;
|
||||
final void Function(PlanMode mode, List<String> productIds) onModeSelected;
|
||||
final List<String> selectedProductIds;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -61,7 +67,7 @@ class PlanMenuSheet extends StatelessWidget {
|
||||
|
||||
void _select(BuildContext context, PlanMode mode) {
|
||||
Navigator.pop(context);
|
||||
onModeSelected(mode);
|
||||
onModeSelected(mode, selectedProductIds);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user