import 'package:image_picker/image_picker.dart'; import '../../util/filter_chip_enums.dart'; class PromptData { PromptData({ required this.images, required this.textInput, Set? basicIngredients, Set? cuisines, Set? dietaryRestrictions, List? additionalTextInputs, }) : additionalTextInputs = additionalTextInputs ?? [], selectedBasicIngredients = basicIngredients ?? {}, selectedCuisines = cuisines ?? {}, selectedDietaryRestrictions = dietaryRestrictions ?? {}; PromptData.empty() : images = [], additionalTextInputs = [], selectedBasicIngredients = {}, selectedCuisines = {}, selectedDietaryRestrictions = {}, textInput = ''; String get cuisines { return selectedCuisines.map((catFilter) => catFilter.name).join(","); } String get ingredients { return selectedBasicIngredients .map((ingredient) => ingredient.name) .join(", "); } String get dietaryRestrictions { return selectedDietaryRestrictions .map((restriction) => restriction.name) .join(", "); } List images; String textInput; List additionalTextInputs; Set selectedBasicIngredients; Set selectedCuisines; Set selectedDietaryRestrictions; PromptData copyWith({ List? images, String? textInput, List? additionalTextInputs, Set? basicIngredients, Set? cuisineSelections, Set? dietaryRestrictions, }) { return PromptData( images: images ?? this.images, textInput: textInput ?? this.textInput, additionalTextInputs: additionalTextInputs ?? this.additionalTextInputs, basicIngredients: basicIngredients ?? selectedBasicIngredients, cuisines: cuisineSelections ?? selectedCuisines, dietaryRestrictions: dietaryRestrictions ?? selectedDietaryRestrictions, ); } }