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,16 +1,22 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
import '../../../../../core/constants/colors.dart';
|
||||
import '../../../../../core/utils/page_transitions.dart';
|
||||
import '../../../../../data/providers/user_provider.dart';
|
||||
import '../../screens/profile/edit_profile_screen.dart';
|
||||
|
||||
/// [EditOptionsCard] permet à l'utilisateur d'accéder aux options d'édition du profil,
|
||||
/// incluant la modification du profil, la photo et le mot de passe.
|
||||
/// Les interactions sont entièrement loguées pour une traçabilité complète.
|
||||
class EditOptionsCard extends StatelessWidget {
|
||||
const EditOptionsCard({Key? key}) : super(key: key);
|
||||
const EditOptionsCard({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
debugPrint("[LOG] Initialisation de EditOptionsCard");
|
||||
debugPrint('[LOG] Initialisation de EditOptionsCard');
|
||||
final userProvider = Provider.of<UserProvider>(context, listen: false);
|
||||
final user = userProvider.user;
|
||||
|
||||
return Card(
|
||||
color: AppColors.cardColor.withOpacity(0.95),
|
||||
@@ -24,25 +30,11 @@ class EditOptionsCard extends StatelessWidget {
|
||||
context,
|
||||
icon: Icons.edit,
|
||||
label: 'Éditer le profil',
|
||||
logMessage: "Édition du profil",
|
||||
onTap: () => debugPrint("[LOG] Édition du profil activée."),
|
||||
),
|
||||
_buildDivider(),
|
||||
_buildOption(
|
||||
context,
|
||||
icon: Icons.camera_alt,
|
||||
label: 'Changer la photo de profil',
|
||||
logMessage: "Changement de la photo de profil",
|
||||
onTap: () =>
|
||||
debugPrint("[LOG] Changement de la photo de profil activé."),
|
||||
),
|
||||
_buildDivider(),
|
||||
_buildOption(
|
||||
context,
|
||||
icon: Icons.lock,
|
||||
label: 'Changer le mot de passe',
|
||||
logMessage: "Changement du mot de passe",
|
||||
onTap: () => debugPrint("[LOG] Changement du mot de passe activé."),
|
||||
logMessage: 'Édition du profil',
|
||||
onTap: () {
|
||||
debugPrint('[LOG] Édition du profil activée.');
|
||||
context.pushFadeScale(EditProfileScreen(user: user));
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -59,13 +51,13 @@ class EditOptionsCard extends StatelessWidget {
|
||||
}) {
|
||||
return InkWell(
|
||||
onTap: () {
|
||||
debugPrint("[LOG] $logMessage");
|
||||
debugPrint('[LOG] $logMessage');
|
||||
onTap();
|
||||
},
|
||||
splashColor: AppColors.accentColor.withOpacity(0.3),
|
||||
highlightColor: AppColors.accentColor.withOpacity(0.1),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 12.0),
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12),
|
||||
child: Row(
|
||||
children: [
|
||||
Icon(icon, color: AppColors.accentColor),
|
||||
|
||||
Reference in New Issue
Block a user