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:
@@ -4,9 +4,9 @@ import '../../../../../core/constants/colors.dart';
|
||||
/// [AccountDeletionCard] est un widget permettant à l'utilisateur de supprimer son compte.
|
||||
/// Il affiche une confirmation avant d'effectuer l'action de suppression.
|
||||
class AccountDeletionCard extends StatelessWidget {
|
||||
final BuildContext context;
|
||||
|
||||
const AccountDeletionCard({Key? key, required this.context}) : super(key: key);
|
||||
const AccountDeletionCard({required this.context, super.key});
|
||||
final BuildContext context;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -43,14 +43,14 @@ class AccountDeletionCard extends StatelessWidget {
|
||||
actions: [
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
debugPrint("[LOG] Suppression du compte annulée.");
|
||||
debugPrint('[LOG] Suppression du compte annulée.');
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
child: Text('Annuler', style: TextStyle(color: AppColors.accentColor)),
|
||||
),
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
debugPrint("[LOG] Suppression du compte confirmée.");
|
||||
debugPrint('[LOG] Suppression du compte confirmée.');
|
||||
Navigator.of(context).pop();
|
||||
// Logique de suppression du compte ici.
|
||||
},
|
||||
|
||||
@@ -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),
|
||||
|
||||
@@ -4,17 +4,14 @@ import '../../../../../core/constants/colors.dart';
|
||||
/// [ExpandableSectionCard] est une carte qui peut s'étendre pour révéler des éléments enfants.
|
||||
/// Ce composant inclut des animations d'extension, des logs pour chaque action et une expérience utilisateur optimisée.
|
||||
class ExpandableSectionCard extends StatefulWidget {
|
||||
|
||||
const ExpandableSectionCard({
|
||||
required this.title, required this.icon, required this.children, super.key,
|
||||
});
|
||||
final String title;
|
||||
final IconData icon;
|
||||
final List<Widget> children;
|
||||
|
||||
const ExpandableSectionCard({
|
||||
Key? key,
|
||||
required this.title,
|
||||
required this.icon,
|
||||
required this.children,
|
||||
}) : super(key: key);
|
||||
|
||||
@override
|
||||
_ExpandableSectionCardState createState() => _ExpandableSectionCardState();
|
||||
}
|
||||
|
||||
@@ -1,66 +1,251 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
|
||||
/// [FriendCard] est un widget représentant une carte d'ami.
|
||||
/// Cette carte inclut l'image de l'ami, son nom, et un bouton qui permet
|
||||
/// d'interagir avec cette carte (via le `onTap`).
|
||||
///
|
||||
/// Ce widget est conçu pour être utilisé dans des listes d'amis, comme
|
||||
/// dans la section "Mes Amis" de l'application.
|
||||
class FriendCard extends StatelessWidget {
|
||||
final String name; // Le nom de l'ami
|
||||
final String imageUrl; // URL de l'image de profil de l'ami
|
||||
final VoidCallback onTap; // Fonction callback exécutée lors d'un clic sur la carte
|
||||
import '../../../core/constants/design_system.dart';
|
||||
import '../../../core/utils/page_transitions.dart';
|
||||
import '../../../data/datasources/chat_remote_data_source.dart';
|
||||
import '../../../data/services/secure_storage.dart';
|
||||
import '../../../domain/entities/friend.dart';
|
||||
import '../../screens/chat/chat_screen.dart';
|
||||
import '../animated_widgets.dart';
|
||||
import '../custom_snackbar.dart';
|
||||
import '../friend_detail_screen.dart';
|
||||
import '../social_badge_widget.dart';
|
||||
|
||||
/// Constructeur de [FriendCard] avec des paramètres obligatoires.
|
||||
const FriendCard({
|
||||
Key? key,
|
||||
required this.name,
|
||||
required this.imageUrl,
|
||||
required this.onTap,
|
||||
}) : super(key: key);
|
||||
/// [FriendCard] est un widget qui représente la carte d'un ami dans la liste.
|
||||
/// Il affiche une image de profil, le nom, le statut, la dernière interaction,
|
||||
/// un voyant pour l'état en ligne, et la durée de l'amitié.
|
||||
class FriendCard extends StatefulWidget {
|
||||
const FriendCard({required this.friend, super.key});
|
||||
|
||||
final Friend friend;
|
||||
|
||||
@override
|
||||
State<FriendCard> createState() => _FriendCardState();
|
||||
}
|
||||
|
||||
class _FriendCardState extends State<FriendCard> {
|
||||
final ChatRemoteDataSource _chatDataSource = ChatRemoteDataSource(http.Client());
|
||||
final SecureStorage _storage = SecureStorage();
|
||||
bool _isCreatingConversation = false;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
// Lorsque l'utilisateur clique sur la carte, on déclenche la fonction onTap.
|
||||
debugPrint("[LOG] Carte de l'ami $name cliquée.");
|
||||
onTap(); // Exécuter le callback fourni
|
||||
},
|
||||
child: Card(
|
||||
elevation: 4, // Élévation de la carte pour donner un effet d'ombre
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(16.0)), // Bordure arrondie
|
||||
color: Colors.grey.shade800, // Couleur de fond de la carte
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(12.0), // Padding interne pour espacer le contenu
|
||||
child: Row(
|
||||
// Calcul de la durée de l'amitié
|
||||
final duration = _calculateFriendshipDuration(widget.friend.dateAdded);
|
||||
|
||||
return AnimatedCard(
|
||||
onTap: () => _navigateToFriendDetail(context),
|
||||
elevation: DesignSystem.elevationSm,
|
||||
hoverElevation: DesignSystem.elevationLg,
|
||||
borderRadius: DesignSystem.borderRadiusLg,
|
||||
padding: DesignSystem.paddingAll(DesignSystem.spacingMd),
|
||||
child: Column(
|
||||
children: [
|
||||
Stack(
|
||||
alignment: Alignment.topRight,
|
||||
children: [
|
||||
// Image de profil de l'ami affichée sous forme de cercle
|
||||
Hero(
|
||||
tag: name, // Le tag Hero permet de créer une transition animée vers un autre écran.
|
||||
tag: 'friend_avatar_${widget.friend.friendId}',
|
||||
child: CircleAvatar(
|
||||
backgroundImage: NetworkImage(imageUrl), // Charger l'image depuis l'URL
|
||||
radius: 30, // Taille de l'avatar
|
||||
radius: 50,
|
||||
backgroundImage: _getImageProvider(),
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 16), // Espacement entre l'image et le nom
|
||||
// Le nom de l'ami avec un texte en gras et blanc
|
||||
Expanded(
|
||||
child: Text(
|
||||
name,
|
||||
style: const TextStyle(
|
||||
fontSize: 18, // Taille de la police
|
||||
color: Colors.white, // Couleur du texte
|
||||
fontWeight: FontWeight.bold, // Style en gras
|
||||
// Indicateur de statut en ligne
|
||||
Positioned(
|
||||
right: 0,
|
||||
top: 0,
|
||||
child: AnimatedSwitcher(
|
||||
duration: const Duration(milliseconds: 200),
|
||||
child: CircleAvatar(
|
||||
key: ValueKey<bool>(widget.friend.isOnline ?? false),
|
||||
radius: 8,
|
||||
backgroundColor: (widget.friend.isOnline ?? false)
|
||||
? Colors.green
|
||||
: Colors.grey,
|
||||
),
|
||||
),
|
||||
),
|
||||
// Icône de flèche indiquant que la carte est cliquable
|
||||
Icon(Icons.chevron_right, color: Colors.white70),
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
Text(
|
||||
'${widget.friend.friendFirstName} ${widget.friend.friendLastName}',
|
||||
style: const TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 16,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 5),
|
||||
Text(
|
||||
widget.friend.status.name,
|
||||
style: const TextStyle(fontSize: 14),
|
||||
),
|
||||
const SizedBox(height: 5),
|
||||
Text(
|
||||
widget.friend.lastInteraction ?? 'Aucune interaction récente',
|
||||
style: const TextStyle(
|
||||
fontStyle: FontStyle.italic,
|
||||
fontSize: 12,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
// Affichage de la durée de l'amitié
|
||||
Text(
|
||||
'Amis depuis: $duration',
|
||||
style: const TextStyle(
|
||||
fontSize: 12,
|
||||
color: Colors.grey,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
// Affichage des badges
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: _buildBadges(),
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
// Bouton de message compact
|
||||
SizedBox(
|
||||
width: double.infinity,
|
||||
child: ElevatedButton.icon(
|
||||
onPressed: _isCreatingConversation ? null : _openChat,
|
||||
icon: _isCreatingConversation
|
||||
? const SizedBox(
|
||||
width: 14,
|
||||
height: 14,
|
||||
child: CircularProgressIndicator(strokeWidth: 2),
|
||||
)
|
||||
: const Icon(Icons.chat_bubble_outline_rounded, size: 16),
|
||||
label: Text(
|
||||
_isCreatingConversation ? 'Envoi...' : 'Message',
|
||||
style: const TextStyle(fontSize: 13, fontWeight: FontWeight.w500),
|
||||
),
|
||||
style: ElevatedButton.styleFrom(
|
||||
padding: const EdgeInsets.symmetric(vertical: 6, horizontal: 12),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
elevation: 1,
|
||||
minimumSize: Size.zero,
|
||||
tapTargetSize: MaterialTapTargetSize.shrinkWrap,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> _openChat() async {
|
||||
final userId = await _storage.getUserId();
|
||||
if (userId == null) {
|
||||
if (mounted) {
|
||||
context.showError('Erreur: Utilisateur non connecté');
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
setState(() {
|
||||
_isCreatingConversation = true;
|
||||
});
|
||||
|
||||
try {
|
||||
// Obtenir ou créer la conversation
|
||||
final conversationModel = await _chatDataSource.getOrCreateConversation(
|
||||
userId,
|
||||
widget.friend.friendId,
|
||||
);
|
||||
|
||||
if (mounted) {
|
||||
setState(() {
|
||||
_isCreatingConversation = false;
|
||||
});
|
||||
|
||||
// Naviguer vers l'écran de chat
|
||||
context.pushSlideUp(ChatScreen(conversation: conversationModel.toEntity()));
|
||||
}
|
||||
} catch (e) {
|
||||
if (mounted) {
|
||||
setState(() {
|
||||
_isCreatingConversation = false;
|
||||
});
|
||||
context.showError('Erreur lors de l\'ouverture du chat');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Retourne l'image de l'ami, soit à partir d'une URL soit une image par défaut.
|
||||
ImageProvider _getImageProvider() {
|
||||
return widget.friend.imageUrl != null && widget.friend.imageUrl!.isNotEmpty
|
||||
? (widget.friend.imageUrl!.startsWith('https')
|
||||
? NetworkImage(widget.friend.imageUrl!) // Image depuis une URL
|
||||
: AssetImage(widget.friend.imageUrl!) as ImageProvider) // Image locale
|
||||
: const AssetImage('lib/assets/images/default_avatar.png'); // Image par défaut
|
||||
}
|
||||
|
||||
/// Calcule la durée de l'amitié depuis la date d'ajout.
|
||||
String _calculateFriendshipDuration(String? dateAdded) {
|
||||
if (dateAdded == null || dateAdded.isEmpty) return 'Inconnu';
|
||||
final date = DateTime.parse(dateAdded);
|
||||
final duration = DateTime.now().difference(date);
|
||||
|
||||
if (duration.inDays < 30) {
|
||||
return '${duration.inDays} jour${duration.inDays > 1 ? 's' : ''}';
|
||||
} else if (duration.inDays < 365) {
|
||||
final months = (duration.inDays / 30).floor();
|
||||
return '$months mois';
|
||||
} else {
|
||||
final years = (duration.inDays / 365).floor();
|
||||
return '$years an${years > 1 ? 's' : ''}';
|
||||
}
|
||||
}
|
||||
|
||||
/// Navigation vers l'écran de détails de l'ami
|
||||
void _navigateToFriendDetail(BuildContext context) {
|
||||
debugPrint(
|
||||
"[LOG] Navigation : Détails de l'ami ${widget.friend.friendFirstName} ${widget.friend.friendLastName}",);
|
||||
context.pushFadeScale(
|
||||
FriendDetailScreen(
|
||||
friendFirstName: widget.friend.friendFirstName,
|
||||
friendLastName: widget.friend.friendLastName,
|
||||
imageUrl: widget.friend.imageUrl ?? '',
|
||||
friendId: widget.friend.friendId,
|
||||
status: widget.friend.status,
|
||||
lastInteraction: widget.friend.lastInteraction ?? 'Aucune',
|
||||
dateAdded: widget.friend.dateAdded ?? 'Inconnu',
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
/// Crée une liste de badges à afficher sur la carte de l'ami.
|
||||
List<Widget> _buildBadges() {
|
||||
final List<Widget> badges = [];
|
||||
|
||||
// Exemple de badges en fonction des attributs de l'ami
|
||||
if (widget.friend.isBestFriend != null && widget.friend.isBestFriend == true) {
|
||||
badges.add(const BadgeWidget(
|
||||
badge: 'Meilleur Ami',
|
||||
icon: Icons.star,
|
||||
),);
|
||||
}
|
||||
|
||||
if (widget.friend.hasKnownSinceChildhood != null && widget.friend.hasKnownSinceChildhood == true) {
|
||||
badges.add(const BadgeWidget(
|
||||
badge: 'Ami d\'enfance',
|
||||
icon: Icons.child_care,
|
||||
),);
|
||||
}
|
||||
|
||||
if (widget.friend.isOnline != null && widget.friend.isOnline == true) {
|
||||
badges.add(const BadgeWidget(
|
||||
badge: 'En ligne',
|
||||
icon: Icons.circle,
|
||||
),);
|
||||
}
|
||||
|
||||
// Ajouter d'autres badges si nécessaire
|
||||
return badges;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,9 +6,9 @@ import '../stat_tile.dart';
|
||||
/// [StatisticsSectionCard] affiche les statistiques principales de l'utilisateur avec des animations.
|
||||
/// Ce composant est optimisé pour une expérience interactive et une traçabilité complète des actions via les logs.
|
||||
class StatisticsSectionCard extends StatelessWidget {
|
||||
final User user;
|
||||
|
||||
const StatisticsSectionCard({Key? key, required this.user}) : super(key: key);
|
||||
const StatisticsSectionCard({required this.user, super.key});
|
||||
final User user;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -20,7 +20,7 @@ class StatisticsSectionCard extends StatelessWidget {
|
||||
elevation: 5,
|
||||
shadowColor: AppColors.darkPrimary.withOpacity(0.4),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(16.0),
|
||||
padding: const EdgeInsets.all(16),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
@@ -38,28 +38,28 @@ class StatisticsSectionCard extends StatelessWidget {
|
||||
icon: Icons.event,
|
||||
label: 'Événements Participés',
|
||||
value: '${user.eventsCount}',
|
||||
logMessage: "Affichage des événements participés : ${user.eventsCount}",
|
||||
logMessage: 'Affichage des événements participés : ${user.eventsCount}',
|
||||
),
|
||||
_buildDivider(),
|
||||
_buildAnimatedStatTile(
|
||||
icon: Icons.place,
|
||||
label: 'Établissements Visités',
|
||||
value: '${user.visitedPlacesCount}',
|
||||
logMessage: "Affichage des établissements visités : ${user.visitedPlacesCount}",
|
||||
logMessage: 'Affichage des établissements visités : ${user.visitedPlacesCount}',
|
||||
),
|
||||
_buildDivider(),
|
||||
_buildAnimatedStatTile(
|
||||
icon: Icons.post_add,
|
||||
label: 'Publications',
|
||||
value: '${user.postsCount}',
|
||||
logMessage: "Affichage des publications : ${user.postsCount}",
|
||||
logMessage: 'Affichage des publications : ${user.postsCount}',
|
||||
),
|
||||
_buildDivider(),
|
||||
_buildAnimatedStatTile(
|
||||
icon: Icons.group,
|
||||
label: 'Amis/Followers',
|
||||
value: '${user.friendsCount}',
|
||||
logMessage: "Affichage des amis/followers : ${user.friendsCount}",
|
||||
logMessage: 'Affichage des amis/followers : ${user.friendsCount}',
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -74,7 +74,7 @@ class StatisticsSectionCard extends StatelessWidget {
|
||||
required String value,
|
||||
required String logMessage,
|
||||
}) {
|
||||
debugPrint("[LOG] $logMessage");
|
||||
debugPrint('[LOG] $logMessage');
|
||||
|
||||
return TweenAnimationBuilder<double>(
|
||||
duration: const Duration(milliseconds: 500),
|
||||
|
||||
@@ -5,11 +5,11 @@ import '../../../../core/constants/colors.dart';
|
||||
/// [SupportSectionCard] affiche les options de support et assistance.
|
||||
/// Inclut des animations, du retour haptique, et des logs détaillés pour chaque action.
|
||||
class SupportSectionCard extends StatelessWidget {
|
||||
const SupportSectionCard({Key? key}) : super(key: key);
|
||||
const SupportSectionCard({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
debugPrint("[LOG] Initialisation de SupportSectionCard.");
|
||||
debugPrint('[LOG] Initialisation de SupportSectionCard.');
|
||||
|
||||
return Card(
|
||||
color: AppColors.cardColor.withOpacity(0.95),
|
||||
@@ -17,7 +17,7 @@ class SupportSectionCard extends StatelessWidget {
|
||||
elevation: 6,
|
||||
shadowColor: AppColors.darkPrimary.withOpacity(0.4),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 20.0),
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 20),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
@@ -35,7 +35,7 @@ class SupportSectionCard extends StatelessWidget {
|
||||
context,
|
||||
icon: Icons.help_outline,
|
||||
label: 'Support et Assistance',
|
||||
logMessage: "Accès au Support et Assistance.",
|
||||
logMessage: 'Accès au Support et Assistance.',
|
||||
),
|
||||
_buildDivider(),
|
||||
_buildOption(
|
||||
@@ -49,7 +49,7 @@ class SupportSectionCard extends StatelessWidget {
|
||||
context,
|
||||
icon: Icons.privacy_tip_outlined,
|
||||
label: 'Politique de confidentialité',
|
||||
logMessage: "Accès à la politique de confidentialité.",
|
||||
logMessage: 'Accès à la politique de confidentialité.',
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -67,13 +67,13 @@ class SupportSectionCard extends StatelessWidget {
|
||||
return InkWell(
|
||||
onTap: () {
|
||||
HapticFeedback.lightImpact(); // Retour haptique léger
|
||||
debugPrint("[LOG] $logMessage");
|
||||
debugPrint('[LOG] $logMessage');
|
||||
// Ajout de la navigation ou de l'action ici.
|
||||
},
|
||||
splashColor: AppColors.accentColor.withOpacity(0.3),
|
||||
highlightColor: AppColors.cardColor.withOpacity(0.1),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 12.0),
|
||||
padding: const EdgeInsets.symmetric(vertical: 12),
|
||||
child: Row(
|
||||
children: [
|
||||
Icon(icon, color: AppColors.accentColor, size: 28),
|
||||
|
||||
@@ -7,9 +7,9 @@ import '../../../data/providers/user_provider.dart';
|
||||
/// [UserInfoCard] affiche les informations essentielles de l'utilisateur de manière concise.
|
||||
/// Conçu pour minimiser les répétitions tout en garantissant une expérience utilisateur fluide.
|
||||
class UserInfoCard extends StatelessWidget {
|
||||
final User user;
|
||||
|
||||
const UserInfoCard({Key? key, required this.user}) : super(key: key);
|
||||
const UserInfoCard({required this.user, super.key});
|
||||
final User user;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -21,29 +21,32 @@ class UserInfoCard extends StatelessWidget {
|
||||
elevation: 5,
|
||||
shadowColor: AppColors.darkPrimary.withOpacity(0.4),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(16.0),
|
||||
padding: const EdgeInsets.all(16),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
TweenAnimationBuilder<double>(
|
||||
duration: const Duration(milliseconds: 600),
|
||||
tween: Tween<double>(begin: 0, end: 1),
|
||||
curve: Curves.elasticOut,
|
||||
builder: (context, scale, child) {
|
||||
return Transform.scale(
|
||||
scale: scale,
|
||||
child: CircleAvatar(
|
||||
radius: 50,
|
||||
backgroundImage: NetworkImage(user.profileImageUrl),
|
||||
backgroundColor: Colors.transparent,
|
||||
onBackgroundImageError: (error, stackTrace) {
|
||||
debugPrint("[ERROR] Erreur de chargement de l'image de profil : $error");
|
||||
},
|
||||
child: child,
|
||||
),
|
||||
);
|
||||
},
|
||||
child: Icon(Icons.person, size: 50, color: Colors.grey.shade300),
|
||||
Hero(
|
||||
tag: 'user_profile_avatar_${user.userId}',
|
||||
child: TweenAnimationBuilder<double>(
|
||||
duration: const Duration(milliseconds: 600),
|
||||
tween: Tween<double>(begin: 0, end: 1),
|
||||
curve: Curves.elasticOut,
|
||||
builder: (context, scale, child) {
|
||||
return Transform.scale(
|
||||
scale: scale,
|
||||
child: CircleAvatar(
|
||||
radius: 50,
|
||||
backgroundImage: NetworkImage(user.profileImageUrl),
|
||||
backgroundColor: Colors.transparent,
|
||||
onBackgroundImageError: (error, stackTrace) {
|
||||
debugPrint("[ERROR] Erreur de chargement de l'image de profil : $error");
|
||||
},
|
||||
child: child,
|
||||
),
|
||||
);
|
||||
},
|
||||
child: Icon(Icons.person, size: 50, color: Colors.grey.shade300),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
Text(
|
||||
|
||||
Reference in New Issue
Block a user