ptitspas-ynov/frontend/lib/models/m_dashbord/conversation_model.dart
Hanim 9f874f30e7 feat: Add dashboard layout with sidebar and main content area
- Implemented AppFooter widget for mobile and desktop views.
- Created ChildrenSidebar widget to display children's information.
- Developed AppLayout to manage app structure with optional footer.
- Added ChildrenSidebar for selecting children and displaying their status.
- Introduced DashboardAppBar for navigation and user actions.
- Built WMainContentArea for displaying assistant details and calendar.
- Created MainContentArea to manage contracts and events display.
- Implemented MessagingSidebar for messaging functionality.
- Updated widget tests to reflect new structure and imports.
2025-08-28 12:58:44 +02:00

46 lines
971 B
Dart

class ConversationModel {
final String id;
final String title;
final List<String> participantIds;
final List<MessageModel> messages;
final DateTime lastMessageAt;
final int unreadCount;
final String? childId;
ConversationModel({
required this.id,
required this.title,
required this.participantIds,
required this.messages,
required this.lastMessageAt,
this.unreadCount = 0,
this.childId,
});
MessageModel? get lastMessage => messages.isNotEmpty ? messages.last : null;
bool get hasUnreadMessages => unreadCount > 0;
}
class MessageModel {
final String id;
final String content;
final String senderId;
final DateTime sentAt;
final bool isFromAI;
final MessageStatus status;
MessageModel({
required this.id,
required this.content,
required this.senderId,
required this.sentAt,
this.isFromAI = false,
required this.status,
});
}
enum MessageStatus {
sent,
delivered,
read,
}