52 lines
1.2 KiB
Dart
52 lines
1.2 KiB
Dart
import 'package:equatable/equatable.dart';
|
|
|
|
enum FeedItemType { post, event, contribution, notification }
|
|
|
|
/// Entité principale représentant un élément de n'importe quel flux (DRY)
|
|
class FeedItem extends Equatable {
|
|
final String id;
|
|
final FeedItemType type;
|
|
final String authorName; // Nom de l'utilisateur ou de l'entité
|
|
final String? authorAvatarUrl;
|
|
final DateTime createdAt;
|
|
final String content;
|
|
|
|
// Interactions sociales
|
|
final int likesCount;
|
|
final int commentsCount;
|
|
final bool isLikedByMe;
|
|
|
|
// Actions spécifiques (ex: Payer, S'inscrire)
|
|
final String? customActionLabel;
|
|
final String? actionUrlTarget; // Deep link ou route
|
|
|
|
const FeedItem({
|
|
required this.id,
|
|
required this.type,
|
|
required this.authorName,
|
|
this.authorAvatarUrl,
|
|
required this.createdAt,
|
|
required this.content,
|
|
this.likesCount = 0,
|
|
this.commentsCount = 0,
|
|
this.isLikedByMe = false,
|
|
this.customActionLabel,
|
|
this.actionUrlTarget,
|
|
});
|
|
|
|
@override
|
|
List<Object?> get props => [
|
|
id,
|
|
type,
|
|
authorName,
|
|
authorAvatarUrl,
|
|
createdAt,
|
|
content,
|
|
likesCount,
|
|
commentsCount,
|
|
isLikedByMe,
|
|
customActionLabel,
|
|
actionUrlTarget,
|
|
];
|
|
}
|