Thread class
A model class representing a thread. Threads are a way to group replies to a message in a channel.
- Annotations
-
- @JsonSerializable.new()
Constructors
-
Thread({int? activeParticipantCount, ChannelModel? channel, required String channelCid, required String parentMessageId, Message? parentMessage, required String createdByUserId, User? createdBy, required int replyCount, required int participantCount, List<
ThreadParticipant> threadParticipants = const [], DateTime? lastMessageAt, DateTime? createdAt, DateTime? updatedAt, DateTime? deletedAt, String? title, List<Message> latestReplies = const [], List<Read> ? read = const [], Draft? draft, Map<String, Object?> extraData = const {}}) - A model class representing a thread. Threads are a way to group replies to a message in a channel.
-
Thread.fromJson(Map<
String, dynamic> json) -
Create a new instance from a json
factory
Properties
- activeParticipantCount → int?
-
The active participant count in the thread.
final
- channel → ChannelModel?
-
The channel this thread belongs to.
final
- channelCid → String
-
The channel cid this thread belongs to.
final
- createdAt → DateTime
-
The date at which the thread was created.
final
- createdBy → User?
-
The user who created the thread.
final
- createdByUserId → String
-
The id of the user who created the thread.
final
- deletedAt → DateTime?
-
The date at which the thread was deleted.
final
- draft → Draft?
-
The draft message in the thread.
final
-
extraData
→ Map<
String, Object?> -
Map of custom thread extraData
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- lastMessageAt → DateTime?
-
The date of the last message in the thread.
final
-
latestReplies
→ List<
Message> -
The list of latest replies in the thread.
final
- parentMessage → Message?
-
The parent message of the thread.
final
- parentMessageId → String
-
The id of the parent message of the thread.
final
- participantCount → int
-
The number of users participating in the thread.
final
-
props
→ List<
Object?> -
The list of properties that will be used to determine whether
two instances are equal.
no setter
-
read
→ List<
Read> ? -
The list of reads in the thread.
final
- replyCount → int
-
The number of replies in the thread.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- stringify → bool?
-
If set to
true, thetoStringmethod will be overridden to output this instance'sprops.no setterinherited -
threadParticipants
→ List<
ThreadParticipant> -
The list of participants in the thread.
final
- title → String?
-
An optional title for the thread.
final
- updatedAt → DateTime
-
The date at which the thread was last updated.
final
Methods
-
copyWith(
{int? activeParticipantCount, ChannelModel? channel, String? channelCid, DateTime? createdAt, DateTime? updatedAt, DateTime? deletedAt, String? createdByUserId, User? createdBy, String? title, String? parentMessageId, Message? parentMessage, int? replyCount, int? participantCount, List< ThreadParticipant> ? threadParticipants, DateTime? lastMessageAt, List<Message> ? latestReplies, List<Read> ? read, Object? draft = _nullConst, Map<String, Object?> ? extraData}) → Thread - Creates a copy of Thread with specified attributes overridden.
-
getComparableField(
String sortKey) → ComparableField? -
Gets a comparable field value for the given
sortKey. -
merge(
Thread? other) → Thread -
Merge this thread with the
otherthread. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> - Serialize to json
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Constants
-
topLevelFields
→ const List<
String> - Known top level fields.