Conversation class
A chat conversation (direct message or group).
- Available extensions
Constructors
-
Conversation({required String id, required ConversationType type, required ConversationMode mode, String? name, String? avatarUrl, ConversationStatus status = ConversationStatus.active, List<
Participant> participants = const [], Message? lastMessage, DateTime? lastMessageAt, int unreadCount = 0, DateTime? expiresAt, ParticipantRole myRole = ParticipantRole.member, String? myUserId, Map<String, dynamic> ? metadata, DateTime? createdAt, DateTime? updatedAt}) -
Creates a conversation.
const
Properties
- activeParticipantCount → int
-
Available on Conversation, provided by the ConversationExtensions extension
Count of active (online) participants.no setter - approvedParticipantsCount → int
-
no setter
- avatarUrl → String?
-
final
- createdAt → DateTime?
-
final
- displayAvatar → String?
-
no setter
- displayName → String
-
Available on Conversation, provided by the ConversationExtensions extension
Display name: conversation name or participant names for direct chats.no setter - displayName → String
-
no setter
- expiresAt → DateTime?
-
final
- hasDeletedParticipant → bool
-
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasUnread → bool
-
no setter
- id → String
-
final
- isActive → bool
-
no setter
- isAdmin → bool
-
no setter
- isArchived → bool
-
no setter
- isDirect → bool
-
Available on Conversation, provided by the ConversationExtensions extension
Whether this is a direct (1:1) chat.no setter - isDirect → bool
-
no setter
- isEphemeral → bool
-
Available on Conversation, provided by the ConversationExtensions extension
Whether this conversation is ephemeral (temporary/expiring).no setter - isEphemeral → bool
-
no setter
- isExpired → bool
-
Available on Conversation, provided by the ConversationExtensions extension
Whether this conversation has expired.no setter - isExpired → bool
-
no setter
- isGroup → bool
-
Available on Conversation, provided by the ConversationExtensions extension
Whether this is a group chat.no setter - isGroup → bool
-
no setter
- isStandard → bool
-
no setter
- lastActivityLabel → String
-
Available on Conversation, provided by the ConversationExtensions extension
Last activity label: "Active now", "2h ago", "Yesterday"no setter - lastMessage → Message?
-
final
- lastMessageAt → DateTime?
-
final
-
metadata
→ Map<
String, dynamic> ? -
final
- mode → ConversationMode
-
final
- myRole → ParticipantRole
-
final
- myUserId → String?
-
final
- name → String?
-
final
- onlineParticipantsCount → int
-
no setter
- otherParticipant → Participant?
-
Available on Conversation, provided by the ConversationExtensions extension
Other participant in direct chat (null for group).no setter - otherParticipant → Participant?
-
no setter
-
participants
→ List<
Participant> -
final
-
props
→ List<
Object?> -
The list of properties that will be used to determine whether
two instances are equal.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
final
- status → ConversationStatus
-
final
- stringify → bool?
-
If set to
true, thetoStringmethod will be overridden to output this instance'sprops.no setterinherited - type → ConversationType
-
final
- unreadCount → int
-
final
- updatedAt → DateTime?
-
final
Methods
-
copyWith(
{String? id, String? name, String? avatarUrl, ConversationType? type, ConversationMode? mode, ConversationStatus? status, List< Participant> ? participants, Message? lastMessage, DateTime? lastMessageAt, int? unreadCount, DateTime? expiresAt, ParticipantRole? myRole, String? myUserId, Map<String, dynamic> ? metadata, DateTime? createdAt, DateTime? updatedAt}) → Conversation -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited