Files
afterwork/lib/presentation/widgets/custom_appbar.dart
dahoud 92612abbd7 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
2026-01-10 10:43:17 +00:00

54 lines
1.3 KiB
Dart

import 'package:flutter/material.dart';
/// AppBar personnalisée avec support du thème et design moderne.
///
/// Ce widget fournit une AppBar cohérente avec le thème de l'application
/// et des options de personnalisation.
///
/// **Usage:**
/// ```dart
/// CustomAppBar(
/// title: 'Mon Écran',
/// actions: [
/// IconButton(icon: Icon(Icons.search), onPressed: () {}),
/// ],
/// )
/// ```
class CustomAppBar extends StatelessWidget implements PreferredSizeWidget {
const CustomAppBar({
required this.title,
super.key,
this.actions = const [],
this.leading,
this.automaticallyImplyLeading = true,
this.centerTitle,
this.elevation,
});
final String title;
final List<Widget> actions;
final Widget? leading;
final bool automaticallyImplyLeading;
final bool? centerTitle;
final double? elevation;
@override
Widget build(BuildContext context) {
final theme = Theme.of(context);
return AppBar(
title: Text(title),
actions: actions,
leading: leading,
automaticallyImplyLeading: automaticallyImplyLeading,
centerTitle: centerTitle,
elevation: elevation ?? 0,
backgroundColor: theme.colorScheme.surface,
foregroundColor: theme.colorScheme.onSurface,
);
}
@override
Size get preferredSize => const Size.fromHeight(kToolbarHeight);
}