## 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
83 lines
3.2 KiB
Dart
83 lines
3.2 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
|
import '../../../../../core/constants/colors.dart';
|
|
import '../../../../../domain/entities/user.dart';
|
|
import '../../../data/providers/user_provider.dart';
|
|
|
|
/// [UserInfoCard] affiche les informations essentielles de l'utilisateur de manière concise.
|
|
/// Conçu pour minimiser les répétitions tout en garantissant une expérience utilisateur fluide.
|
|
class UserInfoCard extends StatelessWidget {
|
|
|
|
const UserInfoCard({required this.user, super.key});
|
|
final User user;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
debugPrint("[LOG] Initialisation de UserInfoCard pour l'utilisateur : ${user.userFirstName} ${user.userLastName}");
|
|
|
|
return Card(
|
|
color: AppColors.cardColor.withOpacity(0.9),
|
|
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(15)),
|
|
elevation: 5,
|
|
shadowColor: AppColors.darkPrimary.withOpacity(0.4),
|
|
child: Padding(
|
|
padding: const EdgeInsets.all(16),
|
|
child: Column(
|
|
mainAxisSize: MainAxisSize.min,
|
|
children: [
|
|
Hero(
|
|
tag: 'user_profile_avatar_${user.userId}',
|
|
child: TweenAnimationBuilder<double>(
|
|
duration: const Duration(milliseconds: 600),
|
|
tween: Tween<double>(begin: 0, end: 1),
|
|
curve: Curves.elasticOut,
|
|
builder: (context, scale, child) {
|
|
return Transform.scale(
|
|
scale: scale,
|
|
child: CircleAvatar(
|
|
radius: 50,
|
|
backgroundImage: NetworkImage(user.profileImageUrl),
|
|
backgroundColor: Colors.transparent,
|
|
onBackgroundImageError: (error, stackTrace) {
|
|
debugPrint("[ERROR] Erreur de chargement de l'image de profil : $error");
|
|
},
|
|
child: child,
|
|
),
|
|
);
|
|
},
|
|
child: Icon(Icons.person, size: 50, color: Colors.grey.shade300),
|
|
),
|
|
),
|
|
const SizedBox(height: 10),
|
|
Text(
|
|
'${user.userFirstName} ${user.userLastName}',
|
|
style: TextStyle(
|
|
fontSize: 24,
|
|
fontWeight: FontWeight.bold,
|
|
color: AppColors.accentColor,
|
|
letterSpacing: 1.2,
|
|
),
|
|
),
|
|
const SizedBox(height: 5),
|
|
if (!context.select((UserProvider provider) => provider.isEmailDisplayedElsewhere)) // Afficher seulement si non affiché ailleurs
|
|
GestureDetector(
|
|
onTap: () {
|
|
debugPrint("[LOG] Clic sur l'email de l'utilisateur : ${user.email}");
|
|
},
|
|
child: Text(
|
|
user.email,
|
|
style: TextStyle(
|
|
fontSize: 14,
|
|
color: Colors.grey.shade300,
|
|
decoration: TextDecoration.underline,
|
|
decorationColor: AppColors.accentColor.withOpacity(0.5),
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|