ChatRoomsController class interface
Room-level operations exposed by ChatUiAdapter.rooms.
Covers list bootstrap (load), membership flags
(mute/unmute, pin/unpin), archive (hide/unhide /
unarchive), per-user delete (delete), invitation
lifecycle (acceptInvitation / rejectInvitation,
deleteKicked), room metadata (updateConfig), member management
(addMembers, removeMember, updateMemberRole), group creation
(createGroup) and the exit path (leave).
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
acceptInvitation(
String roomId) → Future< ChatResult< void> > -
Accepts a pending invitation to
roomId. -
addMembers(
String roomId, List< String> userIds, {RoomUserMode mode = RoomUserMode.inviteAndJoin}) → Future<ChatResult< void> > -
Invites
userIdstoroomId. A partial failure (some users added, others rejected — banned, already a member) surfaces as a failure with the per-user reasons, instead of being silently swallowed. -
createGroup(
{required String name, required List< String> memberIds, Uint8List? avatarBytes, String? avatarMimeType, String? subject, bool allowInvitations = false, RoomAudience audience = RoomAudience.contacts, Map<String, dynamic> ? custom}) → Future<ChatResult< String> > - Creates a new group room.
-
delete(
String roomId) → Future< ChatResult< void> > -
DELETE — WhatsApp "Delete chat". Removes
roomIdfrom BOTH the main list and the Archived section, permanently from the user's point of view. It reappears EMPTY only if a 1:1 peer writes again (the resurrection path in the event router clears the deleted marker but leaves theclearedAtcutoff in place so prior history stays hidden). -
deleteKicked(
String roomId) → Future< void> -
Drops
roomIdlocally after the backend signalled the current user was removed (kicked / banned). -
hide(
String roomId) → Future< ChatResult< void> > -
ARCHIVE — moves
roomIdinto the collapsible "Archived" section of the room list (sets the per-userhiddenflag). WhatsApp parity: the chat stays archived even when a new message arrives; only an explicit unarchive (or unhide) brings it back to the main list. Distinct from delete, which removes the chat from BOTH sections. -
hydrate(
{String type = 'all'}) → Future< RoomHydrationStatus> - Paints the room list from the local cache alone. Never emits a request.
-
leave(
String roomId) → Future< ChatResult< void> > -
Removes the current user from
roomId. The row is kept (flipped to read-only viaisParticipating=false) and a durablemarkKickedmarker is persisted, so a voluntary leave lands in the same kicked-read-only mechanism as a server-side kick and survives sync. The open chat controller is preserved so the chat stays browsable. -
load(
{String type = 'all', bool forceNetwork = false}) → Future< ChatResult< void> > - Refreshes the room list (cache-then-network).
-
mute(
String roomId, {DateTime? until}) → Future< ChatResult< void> > -
Mutes
roomId(optimistic). Passuntilfor a timed mute (WhatsApp-style 8h / 1 week); omit it for a permanent mute. The room tile reflectsRoomListItem.muteUntiluntil the next list refresh. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
open(
String roomId, {bool fetchIfMissing = true}) → Future< ChatResult< ChatController> > -
Opens
roomId, fetching its detail from the server when it isn't already known to ChatUiAdapter.roomListController — the deep-link case, e.g. a push notification or a shared link pointing at a room the local list/cache hasn't synced yet. -
pin(
String roomId) → Future< ChatResult< void> > -
Pins
roomIdto the top of the room list. -
rejectInvitation(
String roomId) → Future< ChatResult< void> > -
Rejects a pending invitation to
roomId. -
removeMember(
String roomId, String userId) → Future< ChatResult< void> > -
Removes
userIdfromroomId. -
toString(
) → String -
A string representation of this object.
inherited
-
unarchive(
String roomId) → Future< ChatResult< void> > -
UNARCHIVE — restores an archived
roomIdto the main list. Inverse of hide; alias of unhide kept distinct so the in-chat three-dots menu reads as "Unarchive" rather than the lower-level "Unhide". -
unhide(
String roomId) → Future< ChatResult< void> > -
Reveals a previously hidden
roomId(clears thehiddenflag). -
unmute(
String roomId) → Future< ChatResult< void> > -
Reverts a mute on
roomId, clearing any timed-mute expiry. -
unpin(
String roomId) → Future< ChatResult< void> > -
Removes the pin from
roomId. -
updateConfig(
String roomId, {String? name, String? subject, String? avatarUrl, bool clearAvatar = false, Map< String, dynamic> ? custom}) → Future<ChatResult< void> > -
Patches
roomId's metadata. PassclearAvatar: trueto remove the avatar of the room (mutually exclusive with a non-nullavatarUrl); the SDK forwards an empty string so the backend'sapply_room_configoverwrites the preserved value with "" instead of restoring the previous one. -
updateMemberRole(
String roomId, String userId, RoomRole role) → Future< ChatResult< void> > -
Promotes / demotes
userIdinroomId.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited