ChatGroupManager class

The group manager class, which manages group creation and deletion, user joining and exiting the group, etc.

Properties

downloadCallback ChatDownloadCallback?
group shared file download callback.
read / write
hashCode int
The hash code for this object.
read-onlyinherited
runtimeType Type
A representation of the runtime type of the object.
read-onlyinherited

Methods

acceptInvitation(String groupId, String inviter) Future<ChatGroup>
Accepts a group invitation.
acceptJoinApplication(String groupId, String username) Future<void>
Approves a group request.
addAdmin(String groupId, String memberId) Future<void>
Adds a group admin.
addAllowList(String groupId, List<String> members) Future<void>
Adds members to the allow list of the group.
addEventHandler(String identifier, ChatGroupEventHandler handler) → void
Adds the group event handler. After calling this method, you can handle for new group event when they arrive.
addMembers(String groupId, List<String> members, {String? welcome}) Future<void>
Adds users to the group.
blockGroup(String groupId) Future<void>
Blocks group messages.
blockMembers(String groupId, List<String> members) Future<void>
Adds the user to the block list of the group.
changeGroupDescription(String groupId, String desc) Future<void>
Changes the group description.
changeGroupName(String groupId, String name) Future<void>
Changes the group name.
changeOwner(String groupId, String newOwner) Future<void>
Transfers the group ownership.
clearEventHandlers() → void
Clear all group event handlers.
createGroup({String? groupName, String? desc, List<String>? inviteMembers, String? inviteReason, required ChatGroupOptions options}) Future<ChatGroup>
Creates a group instance.
declineInvitation({required String groupId, required String inviter, String? reason}) Future<void>
Declines a group invitation.
declineJoinApplication(String groupId, String username, {String? reason}) Future<void>
Declines a group request.
destroyGroup(String groupId) Future<void>
Destroys the group instance.
downloadGroupSharedFile({required String groupId, required String fileId, required String savePath}) Future<void>
Downloads the shared file of the group.
fetchAllowListFromServer(String groupId) Future<List<String>>
Gets the allow list of the group from the server.
fetchAnnouncementFromServer(String groupId) Future<String?>
Gets the group announcement from the server.
fetchBlockListFromServer(String groupId, {int pageSize = 200, int pageNum = 1}) Future<List<String>>
Gets the group block list from server with pagination.
fetchGroupFileListFromServer(String groupId, {int pageSize = 200, int pageNum = 1}) Future<List<ChatGroupSharedFile>>
Gets the shared files of the group from the server.
fetchGroupInfoFromServer(String groupId, {bool fetchMembers = false}) Future<ChatGroup>
Gets the group information from the server.
fetchJoinedGroupsFromServer({int pageSize = 20, int pageNum = 0, bool needMemberCount = false, bool needRole = false}) Future<List<ChatGroup>>
Gets all groups of the current user from the server.
fetchMemberAttributes({required String groupId, String? userId}) Future<Map<String, String>>
Gets all custom attributes of a group member.
fetchMemberListFromServer(String groupId, {int pageSize = 200, String? cursor}) Future<ChatCursorResult<String>>
Gets the member list of the group with pagination.
fetchMembersAttributes({required String groupId, required List<String> userIds, List<String>? keys}) Future<Map<String, Map<String, String>>>
Gets custom attributes of multiple group members by attribute key.
fetchMuteListFromServer(String groupId, {int pageSize = 200, int pageNum = 1}) Future<Map<String, int>>
Gets the mute list of the group from the server.
fetchPublicGroupsFromServer({int pageSize = 200, String? cursor}) Future<ChatCursorResult<ChatGroupInfo>>
Gets public groups from the server with pagination.
getEventHandler(String identifier) ChatGroupEventHandler?
Get the group event handler.
getGroupWithId(String groupId) Future<ChatGroup?>
Gets the group instance from the cache by group ID.
getJoinedGroups() Future<List<ChatGroup>>
Gets all groups of the current user from the cache.
inviterUser(String groupId, List<String> members, {String? reason}) Future<void>
Invites users to join the group.
isMemberInAllowListFromServer(String groupId) Future<bool>
Gets whether the member is on the allow list of the group.
joinPublicGroup(String groupId) Future<void>
Joins a public group.
leaveGroup(String groupId) Future<void>
Leaves a group.
muteAllMembers(String groupId) Future<void>
Mutes all members.
muteMembers(String groupId, List<String> members, {int duration = -1}) Future<void>
Mutes group members.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
removeAdmin(String groupId, String adminId) Future<void>
Removes a group admin.
removeAllowList(String groupId, List<String> members) Future<void>
Removes members from the allow list of the group.
removeEventHandler(String identifier) → void
Remove the group event handler.
removeGroupSharedFile(String groupId, String fileId) Future<void>
Removes a shared file of the group.
removeMemberAttributes({required String groupId, required List<String> keys, String? userId}) Future<void>
Removes custom attributes of a group member.
removeMembers(String groupId, List<String> members) Future<void>
Removes a member from the group.
requestToJoinPublicGroup(String groupId, {String? reason}) Future<void>
Requests to join a group.
setMemberAttributes({required String groupId, required Map<String, String> attributes, String? userId}) Future<void>
Sets custom attributes of a group member.
toString() String
A string representation of this object.
inherited
unblockGroup(String groupId) Future<void>
Unblocks group messages.
unblockMembers(String groupId, List<String> members) Future<void>
Removes users from the group block list.
unMuteAllMembers(String groupId) Future<void>
Unmutes all members.
unMuteMembers(String groupId, List<String> members) Future<void>
Unmutes group members.
updateGroupAnnouncement(String groupId, String announcement) Future<void>
Updates the group announcement.
updateGroupExtension(String groupId, String extension) Future<void>
Updates the group extension field.
uploadGroupSharedFile(String groupId, String filePath) Future<void>
Uploads the shared file to the group.

Operators

operator ==(Object other) bool
The equality operator.
inherited