fix(chat): Correction race condition + Implémentation TODOs
## 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
This commit is contained in:
@@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import '../../../core/constants/colors.dart';
|
||||
import '../../../core/theme/theme_provider.dart';
|
||||
import '../../../core/utils/app_logger.dart';
|
||||
import '../../widgets/friend_suggestions.dart';
|
||||
import '../../widgets/group_list.dart';
|
||||
import '../../widgets/popular_activity_list.dart';
|
||||
@@ -21,10 +22,10 @@ class HomeContentScreen extends StatelessWidget {
|
||||
final themeProvider = Provider.of<ThemeProvider>(context);
|
||||
// Obtention des dimensions de l'écran pour adapter la mise en page
|
||||
final size = MediaQuery.of(context).size;
|
||||
print("Chargement de HomeContentScreen avec le thème actuel");
|
||||
AppLogger.d('Chargement de HomeContentScreen avec le thème actuel', tag: 'HomeContentScreen');
|
||||
|
||||
return SingleChildScrollView(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 12.0, vertical: 15.0),
|
||||
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 15),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
@@ -116,12 +117,12 @@ class HomeContentScreen extends StatelessWidget {
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
const SectionHeader(
|
||||
title: 'Suggestions d’amis',
|
||||
title: 'Suggestions d\'amis',
|
||||
icon: Icons.person_add,
|
||||
textStyle: TextStyle(fontSize: 16, fontWeight: FontWeight.w500),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
FriendSuggestions(size: size),
|
||||
const FriendSuggestions(maxSuggestions: 5),
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -133,13 +134,13 @@ class HomeContentScreen extends StatelessWidget {
|
||||
/// Crée la carte de bienvenue, en utilisant les couleurs dynamiques en fonction du thème sélectionné.
|
||||
/// [themeProvider] fournit l'état actuel du thème pour adapter les couleurs.
|
||||
Widget _buildWelcomeCard(ThemeProvider themeProvider) {
|
||||
print("Création de la carte de bienvenue avec le thème actuel");
|
||||
AppLogger.d('Création de la carte de bienvenue avec le thème actuel', tag: 'HomeContentScreen');
|
||||
return Card(
|
||||
elevation: 5,
|
||||
color: themeProvider.isDarkMode ? AppColors.darkSurface : AppColors.lightSurface,
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(16.0),
|
||||
padding: const EdgeInsets.all(16),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
@@ -165,13 +166,13 @@ class HomeContentScreen extends StatelessWidget {
|
||||
required ThemeProvider themeProvider,
|
||||
required Widget child,
|
||||
}) {
|
||||
print("Création d'une carte de section avec le thème actuel");
|
||||
AppLogger.d("Création d'une carte de section avec le thème actuel", tag: 'HomeContentScreen');
|
||||
return Card(
|
||||
elevation: 3,
|
||||
color: themeProvider.isDarkMode ? AppColors.darkSurface : AppColors.lightSurface,
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(12.0),
|
||||
padding: const EdgeInsets.all(12),
|
||||
child: child,
|
||||
),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user