Refactor ActivityCard UI and improve voting functionality

- Updated ActivityCard layout for better visual consistency and responsiveness.
- Simplified the category badge and adjusted styles for better readability.
- Enhanced the voting section with a progress bar and improved button designs.
- Added a new method in Activity model to check if all trip participants approved an activity.
- Improved error handling and validation in ActivityRepository for voting and fetching activities.
- Implemented pagination in ActivityPlacesService for activity searches.
- Removed outdated scripts for cleaning up duplicate images.
This commit is contained in:
Dayron
2025-11-04 20:21:54 +01:00
parent 8ff9e12fd4
commit f6c8432335
19 changed files with 2902 additions and 961 deletions

View File

@@ -67,6 +67,23 @@ class Activity {
return votes[userId] ?? 0;
}
/// Vérifie si tous les participants du voyage ont voté positivement pour cette activité
bool isApprovedByAllParticipants(List<String> tripParticipants) {
if (tripParticipants.isEmpty) return false;
// Tous les participants doivent avoir voté
for (String participantId in tripParticipants) {
if (!votes.containsKey(participantId)) {
return false; // Quelqu'un n'a pas encore voté
}
if (votes[participantId] != 1) {
return false; // Quelqu'un a voté négativement ou neutre
}
}
return true; // Tous ont voté positivement
}
/// Crée une copie avec des modifications
Activity copyWith({
String? id,