WIP - feat(nutrition): implement ingredients management and custom lists#1194
Open
pankaj-basnet wants to merge 5 commits into
Open
Conversation
221ab66 to
a5cb4e2
Compare
…d providers for ingredient state and filtering, reusable ingredient UI components and localization, integrate ingredients and nutritional plans screens
files added/modified:
lib/models/nutrition/ingredient_filters.dart lib/providers/ingredient_repository.dart
lib/providers/ingredient_notifier.dart lib/providers/ingredient_notifier.g.dart lib/providers/ingredient_filters_notifier.dart lib/providers/ingredient_filters_notifier.g.dart
lib/l10n/app_en.arb lib/widgets/nutrition/ingredient_list_tile.dart lib/widgets/nutrition/ingredient_detail.dart lib/widgets/nutrition/ingredient_filter_row.dart lib/widgets/nutrition/ingredient_images.dart
lib/main.dart lib/screens/ingredients_screen.dart lib/screens/ingredient_screen.dart lib/screens/nutritional_plans_screen.dart
Member
|
BTW, we already have Also, is |
…etailScreen using existing components
Contributor
Author
|
reused |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Still WIP (for "feature/offline-mode" branch)
Ingredient Management module, enabling users to organize nutritional data into custom lists with full offline support. It leverages PowerSync and Drift for local persistence, ensuring that ingredient data and user-created lists remain reactive and accessible without an internet connection.
Ingredients Screen:
Custom Ingredient Lists:
Users can now create, rename, and delete custom lists (e.g., "Daily Staples," "High Protein Snacks").
Implemented a "Manage all lists" screen for high-level organization.
Added an "Add to List" bottom sheet accessible from ingredient details.
Real-time membership toggling with immediate UI feedback via Riverpod.
Database Architecture:
ingredient_listsandingredient_list_itemstables in the PowerSync schema.database.dartto include these new entities for local-first synchronization.State Management:
allIngredientListsProvider,ingredientsInListProvider) for real-time list updates.Proposed Changes
1. Persistence & Data Layer
Schema & Database:
lib/database/powersync/database.dart(Main database definition)lib/database/powersync/tables/ingredient_lists.dart(User list table)lib/database/powersync/tables/ingredient_list_items.dart(Junction table for many-to-many)Repositories & Data Models:
lib/providers/ingredient_repository.dart(Data access layer)lib/models/nutrition/ingredient_filters.dart(Filter logic model)lib/models/nutrition/ingredient_list_entry.dart(UI-specific data model)2. State Management (Logic Layer)
lib/providers/ingredient_notifier.dart(Main state controller)lib/providers/ingredient_filters_notifier.dart(Filtering logic)3. User Interface (Presentation Layer)
Main Screens:
lib/screens/ingredients_screen.dart(Search & Discovery)lib/screens/ingredient_screen.dart(Individual detail view)lib/screens/ingredient_lists_screen.dart(List management)lib/screens/ingredient_list_detail_screen.dart(Inside a specific list)lib/screens/nutritional_plans_screen.dart(Integration point)Reusable Widgets:
lib/widgets/nutrition/add_ingredient_to_list_sheet.dart(Action sheet)lib/widgets/nutrition/ingredient_filter_row.dart(Filter bar)lib/widgets/nutrition/ingredient_list_tile.dart(Card UI)lib/widgets/nutrition/ingredient_images.dart(Image handling)Related Issue(s)
Please check that the PR fulfills these requirements
dart format .)📱 UI Gallery: Nutrition & Ingredient Management