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,47 +1,157 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
/// Drawer personnalisé avec navigation et design moderne.
|
||||
///
|
||||
/// Ce widget fournit un drawer de navigation avec des options
|
||||
/// stylisées et cohérentes avec le thème de l'application.
|
||||
///
|
||||
/// **Usage:**
|
||||
/// ```dart
|
||||
/// Scaffold(
|
||||
/// drawer: CustomDrawer(),
|
||||
/// body: MyContent(),
|
||||
/// )
|
||||
/// ```
|
||||
class CustomDrawer extends StatelessWidget {
|
||||
const CustomDrawer({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final theme = Theme.of(context);
|
||||
|
||||
return Drawer(
|
||||
child: ListView(
|
||||
padding: EdgeInsets.zero,
|
||||
children: <Widget>[
|
||||
const DrawerHeader(
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.blueAccent,
|
||||
child: Column(
|
||||
children: [
|
||||
_buildHeader(theme),
|
||||
Expanded(
|
||||
child: _buildMenuItems(context, theme),
|
||||
),
|
||||
_buildFooter(theme),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
/// Construit l'en-tête du drawer.
|
||||
Widget _buildHeader(ThemeData theme) {
|
||||
return DrawerHeader(
|
||||
decoration: BoxDecoration(
|
||||
gradient: LinearGradient(
|
||||
colors: [
|
||||
theme.colorScheme.primary,
|
||||
theme.colorScheme.secondary,
|
||||
],
|
||||
begin: Alignment.topLeft,
|
||||
end: Alignment.bottomRight,
|
||||
),
|
||||
),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Icon(
|
||||
Icons.event,
|
||||
size: 48,
|
||||
color: theme.colorScheme.onPrimary,
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
Text(
|
||||
'AfterWork',
|
||||
style: theme.textTheme.headlineSmall?.copyWith(
|
||||
color: theme.colorScheme.onPrimary,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
child: Text(
|
||||
'AfterWork',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 24,
|
||||
),
|
||||
),
|
||||
),
|
||||
ListTile(
|
||||
leading: Icon(Icons.home),
|
||||
title: Text('Accueil'),
|
||||
onTap: () {
|
||||
Navigator.pushNamed(context, '/home');
|
||||
},
|
||||
),
|
||||
ListTile(
|
||||
leading: Icon(Icons.event),
|
||||
title: Text('Événements'),
|
||||
onTap: () {
|
||||
Navigator.pushNamed(context, '/event');
|
||||
},
|
||||
),
|
||||
ListTile(
|
||||
leading: Icon(Icons.camera_alt), // Icône mise à jour pour la story
|
||||
title: Text('Story'),
|
||||
onTap: () {
|
||||
Navigator.pushNamed(context, '/story');
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
/// Construit les éléments du menu.
|
||||
Widget _buildMenuItems(BuildContext context, ThemeData theme) {
|
||||
return ListView(
|
||||
padding: EdgeInsets.zero,
|
||||
children: [
|
||||
_buildMenuItem(
|
||||
context,
|
||||
theme,
|
||||
icon: Icons.home,
|
||||
title: 'Accueil',
|
||||
route: '/home',
|
||||
),
|
||||
_buildMenuItem(
|
||||
context,
|
||||
theme,
|
||||
icon: Icons.event,
|
||||
title: 'Événements',
|
||||
route: '/event',
|
||||
),
|
||||
_buildMenuItem(
|
||||
context,
|
||||
theme,
|
||||
icon: Icons.camera_alt,
|
||||
title: 'Story',
|
||||
route: '/story',
|
||||
),
|
||||
_buildMenuItem(
|
||||
context,
|
||||
theme,
|
||||
icon: Icons.people,
|
||||
title: 'Amis',
|
||||
route: '/friends',
|
||||
),
|
||||
_buildMenuItem(
|
||||
context,
|
||||
theme,
|
||||
icon: Icons.settings,
|
||||
title: 'Paramètres',
|
||||
route: '/settings',
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
/// Construit un élément de menu.
|
||||
Widget _buildMenuItem(
|
||||
BuildContext context,
|
||||
ThemeData theme, {
|
||||
required IconData icon,
|
||||
required String title,
|
||||
required String route,
|
||||
}) {
|
||||
return ListTile(
|
||||
leading: Icon(
|
||||
icon,
|
||||
color: theme.colorScheme.primary,
|
||||
),
|
||||
title: Text(title),
|
||||
onTap: () {
|
||||
Navigator.pop(context);
|
||||
Navigator.pushNamed(context, route);
|
||||
},
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
/// Construit le pied de page du drawer.
|
||||
Widget _buildFooter(ThemeData theme) {
|
||||
return Container(
|
||||
padding: const EdgeInsets.all(16),
|
||||
decoration: BoxDecoration(
|
||||
border: Border(
|
||||
top: BorderSide(
|
||||
color: theme.colorScheme.outline.withOpacity(0.2),
|
||||
),
|
||||
),
|
||||
),
|
||||
child: Text(
|
||||
'Version 1.0.0',
|
||||
style: theme.textTheme.bodySmall?.copyWith(
|
||||
color: theme.colorScheme.onSurface.withOpacity(0.6),
|
||||
),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user