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:
@@ -1,9 +1,10 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:afterwork/core/constants/colors.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
import '../../core/constants/colors.dart';
|
||||
import '../../core/theme/theme_provider.dart';
|
||||
import '../../core/utils/app_logger.dart';
|
||||
|
||||
void showEventOptions(BuildContext context, GlobalKey key) {
|
||||
// Obtient la position de l'élément pour afficher le menu contextuel
|
||||
@@ -27,7 +28,7 @@ void showEventOptions(BuildContext context, GlobalKey key) {
|
||||
label: 'Voir les détails',
|
||||
color: AppColors.primary, // Utilise la couleur primaire dynamique
|
||||
onTap: () {
|
||||
print('Voir les détails');
|
||||
AppLogger.d('Voir les détails', tag: 'EventMenu');
|
||||
// Log d'action pour suivre l'interaction utilisateur
|
||||
},
|
||||
),
|
||||
@@ -36,7 +37,7 @@ void showEventOptions(BuildContext context, GlobalKey key) {
|
||||
label: 'Modifier l\'événement',
|
||||
color: AppColors.secondary, // Utilise la couleur secondaire dynamique
|
||||
onTap: () {
|
||||
print('Modifier l\'événement');
|
||||
AppLogger.d('Modifier l\'événement', tag: 'EventMenu');
|
||||
},
|
||||
),
|
||||
_buildElegantMenuItem(
|
||||
@@ -48,9 +49,9 @@ void showEventOptions(BuildContext context, GlobalKey key) {
|
||||
},
|
||||
),
|
||||
],
|
||||
elevation: 12.0, // Niveau d'élévation du menu pour une ombre modérée
|
||||
elevation: 12, // Niveau d'élévation du menu pour une ombre modérée
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(20.0), // Coins arrondis pour un look moderne
|
||||
borderRadius: BorderRadius.circular(20), // Coins arrondis pour un look moderne
|
||||
),
|
||||
color: AppColors.customBackgroundColor, // Surface dynamique selon le thème
|
||||
).then((value) {
|
||||
@@ -132,7 +133,7 @@ void _showDeleteConfirmation(BuildContext context) {
|
||||
actions: <Widget>[
|
||||
TextButton(
|
||||
style: ButtonStyle(
|
||||
overlayColor: MaterialStateProperty.all(Colors.grey.shade200),
|
||||
overlayColor: WidgetStateProperty.all(Colors.grey.shade200),
|
||||
),
|
||||
child: Text('Annuler', style: TextStyle(color: Colors.grey.shade700)),
|
||||
onPressed: () {
|
||||
@@ -145,14 +146,14 @@ void _showDeleteConfirmation(BuildContext context) {
|
||||
backgroundColor: AppColors.errorColor, // Bouton de suppression en couleur d'erreur
|
||||
padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 12),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(8.0),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
textStyle: TextStyle(fontWeight: FontWeight.bold),
|
||||
textStyle: const TextStyle(fontWeight: FontWeight.bold),
|
||||
),
|
||||
label: Text('Supprimer'),
|
||||
label: const Text('Supprimer'),
|
||||
onPressed: () {
|
||||
Navigator.of(context).pop();
|
||||
print('Événement supprimé');
|
||||
AppLogger.i('Événement supprimé', tag: 'EventMenu');
|
||||
// Logique de suppression réelle ici
|
||||
},
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user