ThreadsRequest class

A request object for fetching the threads the logged-in user participates in, page by page.

Every returned row is a thread the user is subscribed to — participation is subscription, and unfollowing removes the row (the server hard-deletes it).

A ThreadsRequest is single-use and one-directional: it accumulates its cursor and dedupe state internally and has no reset. To refresh a list, build a new request from the same builder and replace the list — do not re-run an exhausted request. (Same contract as ConversationsRequest and MessagesRequest.)

Properties

debugFetchPage Future<ThreadsPage> Function({String? guid, required int limit, required bool participatedByMe, String? uid, int? updatedAtCursor})?
Test seam: overrides the page fetcher so pagination behavior is verifiable offline. Production code never sets this.
getter/setter pair
guid String?
Scope the list to one group's threads (/groups/{guid}/threads). Mutually exclusive with uid.
final
hashCode int
The hash code for this object.
no setterinherited
limit int
Number of results per page.
final
participatedByMe bool
Filter to threads the logged-in user participates in. Always sent on the wire, even when true.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
uid String?
Scope the list to one 1-1 counterpart's threads (/users/{uid}/threads). Mutually exclusive with guid.
final

Methods

fetchNext({required dynamic onSuccess(List<MessageThread> threads)?, required dynamic onError(CometChatException excep)?}) Future<List<MessageThread>>
Fetches the next page of threads.
hasMore() bool
Whether more pages may remain. False once a fetch returned a raw page shorter than limit.
markSeen(int parentMessageId) → void
Marks a locally inserted row as seen so the next fetchNext does not return it as a duplicate (the row-insert recipe, master plan §5.6.1). Deliberately does NOT move the cursor.
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

Constants

defaultLimit → const int
Default limit. Deliberately below the server default of 100 — a thread row is heavy (root message + last reply, both fully hydrated).
maxLimit → const int
Maximum limit for the number of results (server max).