## Corrections Critiques ### Race Condition - Statuts de Messages - Fix : Les icônes de statut (✓, ✓✓, ✓✓ bleu) ne s'affichaient pas - Cause : WebSocket delivery confirmations arrivaient avant messages locaux - Solution : Pattern Optimistic UI dans chat_bloc.dart - Création message temporaire immédiate - Ajout à la liste AVANT requête HTTP - Remplacement par message serveur à la réponse - Fichier : lib/presentation/state_management/chat_bloc.dart ## Implémentation TODOs (13/21) ### Social (social_header_widget.dart) - ✅ Copier lien du post dans presse-papiers - ✅ Partage natif via Share.share() - ✅ Dialogue de signalement avec 5 raisons ### Partage (share_post_dialog.dart) - ✅ Interface sélection d'amis avec checkboxes - ✅ Partage externe via Share API ### Média (media_upload_service.dart) - ✅ Parsing JSON réponse backend - ✅ Méthode deleteMedia() pour suppression - ✅ Génération miniature vidéo ### Posts (create_post_dialog.dart, edit_post_dialog.dart) - ✅ Extraction URL depuis uploads - ✅ Documentation chargement médias ### Chat (conversations_screen.dart) - ✅ Navigation vers notifications - ✅ ConversationSearchDelegate pour recherche ## Nouveaux Fichiers ### Configuration - build-prod.ps1 : Script build production avec dart-define - lib/core/constants/env_config.dart : Gestion environnements ### Documentation - TODOS_IMPLEMENTED.md : Documentation complète TODOs ## Améliorations ### Architecture - Refactoring injection de dépendances - Amélioration routing et navigation - Optimisation providers (UserProvider, FriendsProvider) ### UI/UX - Amélioration thème et couleurs - Optimisation animations - Meilleure gestion erreurs ### Services - Configuration API avec env_config - Amélioration datasources (events, users) - Optimisation modèles de données
106 lines
3.5 KiB
Dart
106 lines
3.5 KiB
Dart
import 'package:flutter/material.dart';
|
|
import '../../../../../core/constants/colors.dart';
|
|
import '../../../../../domain/entities/user.dart';
|
|
import '../stat_tile.dart';
|
|
|
|
/// [StatisticsSectionCard] affiche les statistiques principales de l'utilisateur avec des animations.
|
|
/// Ce composant est optimisé pour une expérience interactive et une traçabilité complète des actions via les logs.
|
|
class StatisticsSectionCard extends StatelessWidget {
|
|
|
|
const StatisticsSectionCard({required this.user, super.key});
|
|
final User user;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
debugPrint("[LOG] Initialisation de StatisticsSectionCard pour l'utilisateur : ${user.userFirstName} ${user.userLastName}");
|
|
|
|
return Card(
|
|
color: AppColors.cardColor.withOpacity(0.95),
|
|
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(15)),
|
|
elevation: 5,
|
|
shadowColor: AppColors.darkPrimary.withOpacity(0.4),
|
|
child: Padding(
|
|
padding: const EdgeInsets.all(16),
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
const Text(
|
|
'Statistiques Personnelles',
|
|
style: TextStyle(
|
|
fontSize: 20,
|
|
fontWeight: FontWeight.bold,
|
|
color: Colors.white,
|
|
),
|
|
),
|
|
const SizedBox(height: 10),
|
|
// Liste des statistiques avec animations
|
|
_buildAnimatedStatTile(
|
|
icon: Icons.event,
|
|
label: 'Événements Participés',
|
|
value: '${user.eventsCount}',
|
|
logMessage: 'Affichage des événements participés : ${user.eventsCount}',
|
|
),
|
|
_buildDivider(),
|
|
_buildAnimatedStatTile(
|
|
icon: Icons.place,
|
|
label: 'Établissements Visités',
|
|
value: '${user.visitedPlacesCount}',
|
|
logMessage: 'Affichage des établissements visités : ${user.visitedPlacesCount}',
|
|
),
|
|
_buildDivider(),
|
|
_buildAnimatedStatTile(
|
|
icon: Icons.post_add,
|
|
label: 'Publications',
|
|
value: '${user.postsCount}',
|
|
logMessage: 'Affichage des publications : ${user.postsCount}',
|
|
),
|
|
_buildDivider(),
|
|
_buildAnimatedStatTile(
|
|
icon: Icons.group,
|
|
label: 'Amis/Followers',
|
|
value: '${user.friendsCount}',
|
|
logMessage: 'Affichage des amis/followers : ${user.friendsCount}',
|
|
),
|
|
],
|
|
),
|
|
),
|
|
);
|
|
}
|
|
|
|
/// Construit chaque `StatTile` avec une animation de transition en fondu et logue chaque statistique.
|
|
Widget _buildAnimatedStatTile({
|
|
required IconData icon,
|
|
required String label,
|
|
required String value,
|
|
required String logMessage,
|
|
}) {
|
|
debugPrint('[LOG] $logMessage');
|
|
|
|
return TweenAnimationBuilder<double>(
|
|
duration: const Duration(milliseconds: 500),
|
|
tween: Tween<double>(begin: 0, end: 1),
|
|
curve: Curves.easeOut,
|
|
builder: (context, opacity, child) {
|
|
return Opacity(
|
|
opacity: opacity,
|
|
child: StatTile(
|
|
icon: icon,
|
|
label: label,
|
|
value: value,
|
|
),
|
|
);
|
|
},
|
|
);
|
|
}
|
|
|
|
/// Construit un séparateur visuel entre chaque statistique.
|
|
Widget _buildDivider() {
|
|
return Divider(
|
|
color: Colors.white.withOpacity(0.2),
|
|
height: 1,
|
|
indent: 16,
|
|
endIndent: 16,
|
|
);
|
|
}
|
|
}
|