## 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
77 lines
1.7 KiB
Dart
77 lines
1.7 KiB
Dart
import 'package:equatable/equatable.dart';
|
|
|
|
/// Entité de domaine représentant une notification.
|
|
///
|
|
/// Cette entité est pure et indépendante de la couche de données.
|
|
/// Elle représente une notification dans le domaine métier.
|
|
class Notification extends Equatable {
|
|
const Notification({
|
|
required this.id,
|
|
required this.title,
|
|
required this.message,
|
|
required this.type,
|
|
required this.timestamp,
|
|
this.isRead = false,
|
|
this.eventId,
|
|
this.userId,
|
|
this.metadata,
|
|
});
|
|
|
|
final String id;
|
|
final String title;
|
|
final String message;
|
|
final NotificationType type;
|
|
final DateTime timestamp;
|
|
final bool isRead;
|
|
final String? eventId;
|
|
final String? userId;
|
|
final Map<String, dynamic>? metadata;
|
|
|
|
@override
|
|
List<Object?> get props => [
|
|
id,
|
|
title,
|
|
message,
|
|
type,
|
|
timestamp,
|
|
isRead,
|
|
eventId,
|
|
userId,
|
|
metadata,
|
|
];
|
|
|
|
/// Crée une copie de cette notification avec des valeurs modifiées.
|
|
Notification copyWith({
|
|
String? id,
|
|
String? title,
|
|
String? message,
|
|
NotificationType? type,
|
|
DateTime? timestamp,
|
|
bool? isRead,
|
|
String? eventId,
|
|
String? userId,
|
|
Map<String, dynamic>? metadata,
|
|
}) {
|
|
return Notification(
|
|
id: id ?? this.id,
|
|
title: title ?? this.title,
|
|
message: message ?? this.message,
|
|
type: type ?? this.type,
|
|
timestamp: timestamp ?? this.timestamp,
|
|
isRead: isRead ?? this.isRead,
|
|
eventId: eventId ?? this.eventId,
|
|
userId: userId ?? this.userId,
|
|
metadata: metadata ?? this.metadata,
|
|
);
|
|
}
|
|
}
|
|
|
|
/// Type de notification.
|
|
enum NotificationType {
|
|
event,
|
|
friend,
|
|
reminder,
|
|
other,
|
|
}
|
|
|