feat: add complete review/rating system for events

New feature: Users can view, submit, and interact with event reviews.

Components added:
- ReviewModel, ReviewStatsModel, ReviewListResponse (models)
- ReviewService with getReviews, submitReview, markHelpful, flagReview
- StarRatingInput (interactive 5-star picker with labels)
- StarDisplay (read-only fractional star display)
- ReviewSummary (average rating + distribution bars)
- ReviewForm (star picker + comment field + submit/update)
- ReviewCard (avatar, timestamp, expandable comment, helpful/flag)
- ReviewSection (main container with pagination and state mgmt)

Integration:
- Added to LearnMoreScreen (both mobile and desktop layouts)
- Review API endpoints point to app.eventifyplus.com Node.js backend
- EventModel updated with averageRating/reviewCount fields

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-30 18:04:37 +05:30
parent a7f3b215e4
commit 1badeff966
11 changed files with 1034 additions and 0 deletions

View File

@@ -68,6 +68,10 @@ class EventModel {
// Structured important info list [{title, value}, ...]
final List<Map<String, String>> importantInfo;
// Review stats (populated when backend includes them)
final double? averageRating;
final int? reviewCount;
EventModel({
required this.id,
required this.name,
@@ -91,6 +95,8 @@ class EventModel {
this.longitude,
this.locationName,
this.importantInfo = const [],
this.averageRating,
this.reviewCount,
});
/// Safely parse a double from backend (may arrive as String or num)
@@ -148,6 +154,8 @@ class EventModel {
longitude: _parseDouble(j['longitude']),
locationName: j['location_name'] as String?,
importantInfo: _parseImportantInfo(j['important_info']),
averageRating: (j['average_rating'] as num?)?.toDouble(),
reviewCount: (j['review_count'] as num?)?.toInt(),
);
}
}