Reviews¶
Source: Various files in pharmanet/lib/
Pages¶
Reviews are embedded into product detail pages as a section rather than a standalone page.
| Component | File | Description |
|---|---|---|
| Rating summary | features/pharmacy/presentation/pages/product_details_page.dart |
Aggregate rating display |
| Review list | features/pharmacy/presentation/pages/product_details_page.dart |
Individual review cards |
Providers¶
Source: pharmanet/lib/core/providers/review_provider.dart
| Provider | Type | Description |
|---|---|---|
productReviewsProvider |
FutureProvider.family<String> |
Reviews for a product |
reviewNotifierProvider |
StateNotifierProvider<AsyncValue<void>> |
Create/update/delete review |
API¶
Source: pharmanet/lib/core/api/review_api.dart
| Method | Description |
|---|---|
fetchProductReviews(productId) |
List reviews for product |
createReview(productId, rating, comment) |
Submit new review |
updateReview(reviewId, rating, comment) |
Edit existing review |
deleteReview(reviewId) |
Remove review |
Review Model¶
Source: pharmanet/lib/core/models/review_model.dart
| Field | Type | Description |
|---|---|---|
id |
String |
Primary key |
productId |
String |
FK to products |
userId |
String |
FK to profiles |
rating |
int |
1-5 star rating |
comment |
String? |
Review text |
createdAt |
DateTime |
Timestamp |
user |
ReviewUser? |
Includes firstName, lastName, profilePictureUrl |
Related¶
- Products — Review display on detail page
- DB: Reviews — Reviews table schema