## 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
91 lines
2.8 KiB
Dart
91 lines
2.8 KiB
Dart
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({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
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),
|
|
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)),
|
|
elevation: 4,
|
|
shadowColor: AppColors.darkPrimary.withOpacity(0.3),
|
|
child: Column(
|
|
mainAxisSize: MainAxisSize.min,
|
|
children: [
|
|
_buildOption(
|
|
context,
|
|
icon: Icons.edit,
|
|
label: 'Éditer le profil',
|
|
logMessage: 'Édition du profil',
|
|
onTap: () {
|
|
debugPrint('[LOG] Édition du profil activée.');
|
|
context.pushFadeScale(EditProfileScreen(user: user));
|
|
},
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
|
|
/// Construit chaque option de la carte avec une animation de feedback visuel.
|
|
Widget _buildOption(
|
|
BuildContext context, {
|
|
required IconData icon,
|
|
required String label,
|
|
required String logMessage,
|
|
required VoidCallback onTap,
|
|
}) {
|
|
return InkWell(
|
|
onTap: () {
|
|
debugPrint('[LOG] $logMessage');
|
|
onTap();
|
|
},
|
|
splashColor: AppColors.accentColor.withOpacity(0.3),
|
|
highlightColor: AppColors.accentColor.withOpacity(0.1),
|
|
child: Padding(
|
|
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12),
|
|
child: Row(
|
|
children: [
|
|
Icon(icon, color: AppColors.accentColor),
|
|
const SizedBox(width: 16),
|
|
Text(
|
|
label,
|
|
style: const TextStyle(
|
|
fontSize: 16,
|
|
fontWeight: FontWeight.w500,
|
|
color: Colors.white,
|
|
),
|
|
),
|
|
const Spacer(),
|
|
const Icon(Icons.arrow_forward_ios, color: Colors.white, size: 16),
|
|
],
|
|
),
|
|
),
|
|
);
|
|
}
|
|
|
|
/// Construit un séparateur entre les options pour une meilleure structure visuelle.
|
|
Widget _buildDivider() {
|
|
return Divider(
|
|
color: Colors.white.withOpacity(0.2),
|
|
height: 1,
|
|
indent: 16,
|
|
endIndent: 16,
|
|
);
|
|
}
|
|
}
|