Feature Request: Per-User Rating System #5
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
User should be able to choose between 1 to 5 stars for each dish.
We could introduce a long-press context menu for the rating alongside a rating system on the dish page itself. There, if available, the partners Ranking would also be visible.
We need to introduce changes to the PocketBase Backend for this
Implementation Plan: Issue #5 (Per-User Rating System)
Overview
Introduce a 1 to 5 star rating system for dishes, allowing each user to rate a dish independently. The rating will be accessible via the
DishDetailPageand via a long-press context menu on dish cards. If the user has linked a partner, the partner's rating will also be displayed on the dish page.Phase 1: Backend (PocketBase) Updates
usersCollection: Add a newjsonfield namedratings.dish.remoteIdto the integer rating (1-5).{"dzv2a...": 5, "xj89...": 3}Phase 2: Data Service Layer (
UserSettingsService)_keyUserRatingsand_keyPartnerRatingsstring keys for SharedPreferences.push):ratingsmap in theupdate(userId, body: {...})call to PocketBase.pull):ratingsjson field from the user record.pullPartnerFavorites->pullPartnerData):ratingsfield from the partner's user record in addition tofavorites.Phase 3: State Management (Riverpod)
DishRatingsNotifier:Notifier<Map<String, int>>inproviders.dart.setRating(String remoteId, int rating).ShoppingCart, persisting changes to SharedPreferences and callinguserSettingsService.push()in a fire-and-forget manner.PartnerRatingsNotifier:Notifier<Map<String, int>>to hold the partner's ratings in memory.performFullSync:Phase 4: UI Implementation
DishDetailPage:RatingBar(e.g., usingflutter_rating_baror row ofIconButtons).partner_idexists and they rated it). E.g., "Jane rated this 4 stars".DishCard(Long-press Context Menu):DishCardin aGestureDetector(usingonLongPress) or use aPopupMenuButton/showModalBottomSheet.DishCardto show a small star badge if the current user has rated the dish.Effort / Dependencies
ratingsfield.build_runner) does NOT need to run since we manage this entirely in Riverpod state &userscollection, keeping IsarDishmodel untouched.