Initial commit: unionflow-mobile-apps
Application Flutter complète (sans build artifacts). Signed-off-by: lions dev Team
This commit is contained in:
51
lib/features/feed/domain/entities/feed_item.dart
Normal file
51
lib/features/feed/domain/entities/feed_item.dart
Normal file
@@ -0,0 +1,51 @@
|
||||
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,
|
||||
];
|
||||
}
|
||||
Reference in New Issue
Block a user