## 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
136 lines
4.6 KiB
Dart
136 lines
4.6 KiB
Dart
import 'package:flutter/material.dart';
|
|
|
|
/// [FriendExpandingCard] est un widget animé qui s'agrandit pour afficher des options supplémentaires.
|
|
/// Il permet de voir plus de détails, d'envoyer un message ou de supprimer un ami.
|
|
class FriendExpandingCard extends StatefulWidget {
|
|
|
|
const FriendExpandingCard({
|
|
required this.name, required this.imageUrl, required this.description, required this.onTap, required this.onMessageTap, required this.onRemoveTap, super.key,
|
|
});
|
|
final String name;
|
|
final String imageUrl;
|
|
final String description;
|
|
final VoidCallback onTap;
|
|
final VoidCallback onMessageTap;
|
|
final VoidCallback onRemoveTap;
|
|
|
|
@override
|
|
_FriendExpandingCardState createState() => _FriendExpandingCardState();
|
|
}
|
|
|
|
class _FriendExpandingCardState extends State<FriendExpandingCard> {
|
|
bool _isExpanded = false;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return GestureDetector(
|
|
onTap: widget.onTap,
|
|
onLongPress: () {
|
|
setState(() {
|
|
_isExpanded = !_isExpanded;
|
|
});
|
|
},
|
|
child: AnimatedContainer(
|
|
duration: const Duration(milliseconds: 300),
|
|
curve: Curves.easeInOut,
|
|
height: _isExpanded ? 200 : 100,
|
|
margin: const EdgeInsets.symmetric(vertical: 10, horizontal: 5),
|
|
padding: const EdgeInsets.all(10),
|
|
decoration: BoxDecoration(
|
|
color: Colors.grey.shade900,
|
|
borderRadius: BorderRadius.circular(16),
|
|
boxShadow: const [
|
|
BoxShadow(
|
|
color: Colors.black26,
|
|
blurRadius: 10,
|
|
offset: Offset(2, 2),
|
|
),
|
|
],
|
|
),
|
|
child: Column(
|
|
children: [
|
|
Row(
|
|
children: [
|
|
Hero(
|
|
tag: widget.name,
|
|
child: CircleAvatar(
|
|
backgroundImage: NetworkImage(widget.imageUrl),
|
|
radius: 30,
|
|
),
|
|
),
|
|
const SizedBox(width: 16),
|
|
Expanded(
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
Text(
|
|
widget.name,
|
|
style: const TextStyle(
|
|
color: Colors.white,
|
|
fontSize: 18,
|
|
fontWeight: FontWeight.bold,
|
|
),
|
|
),
|
|
const SizedBox(height: 5),
|
|
AnimatedOpacity(
|
|
opacity: _isExpanded ? 1.0 : 0.0,
|
|
duration: const Duration(milliseconds: 300),
|
|
child: Text(
|
|
widget.description,
|
|
style: const TextStyle(
|
|
color: Colors.white70,
|
|
fontSize: 14,
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
if (_isExpanded)
|
|
IconButton(
|
|
icon: const Icon(Icons.close, color: Colors.white54),
|
|
onPressed: () {
|
|
setState(() {
|
|
_isExpanded = false;
|
|
});
|
|
},
|
|
),
|
|
],
|
|
),
|
|
if (_isExpanded) ...[
|
|
const SizedBox(height: 10),
|
|
Row(
|
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
|
children: [
|
|
ElevatedButton.icon(
|
|
onPressed: widget.onMessageTap,
|
|
icon: const Icon(Icons.message, color: Colors.white),
|
|
label: const Text('Message'),
|
|
style: ElevatedButton.styleFrom(
|
|
iconColor: Colors.green,
|
|
shape: RoundedRectangleBorder(
|
|
borderRadius: BorderRadius.circular(20),
|
|
),
|
|
),
|
|
),
|
|
ElevatedButton.icon(
|
|
onPressed: widget.onRemoveTap,
|
|
icon: const Icon(Icons.delete, color: Colors.red),
|
|
label: const Text('Remove'),
|
|
style: ElevatedButton.styleFrom(
|
|
iconColor: Colors.redAccent,
|
|
shape: RoundedRectangleBorder(
|
|
borderRadius: BorderRadius.circular(20),
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
],
|
|
],
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|