EMGroupManager class

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

~chinese 群组管理类,用于管理群组的创建,删除及成员管理等操作。 ~end

Constructors

EMGroupManager.new()

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 groupId, String inviter) Future<EMGroup>
~english Accepts a group invitation.
acceptJoinApplication(String groupId, String username) Future<void>
~english Approves a group join application. Only the group owner can call this method.
addAdmin(String groupId, String memberId) Future<void>
~english Adds a group administrator. Only the group owner can call this method.
addAllowList(String groupId, List<String> members) Future<void>
~english Adds members to the group allowlist. Only the group owner and admins can call this method.
addEventHandler(String identifier, EMGroupEventHandler handler) → void
~english 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>
~english Invites users to join a group.
blockGroup(String groupId) Future<void>
~english Blocks group messages. The server will no longer send messages from this group to the user. The group owner cannot block group messages.
blockMembers(String groupId, List<String> members) Future<void>
~english Adds users to the group blocklist. Only the group owner can call this method.
changeGroupDescription(String groupId, String desc) Future<void>
changeGroupName(String groupId, String name) Future<void>
changeOwner(String groupId, String newOwner) Future<void>
~english Changes the group owner. Only the group owner can call this method.
clearAllGroupsFromLocal() Future<void>
~english Clears all groups of the current user from the local database.
clearEventHandlers() → void
~english Clear all group event handlers. ~end
createGroup({String? groupName, String? avatarUrl, String? desc, List<String>? inviteMembers, String? inviteReason, required EMGroupOptions options}) Future<EMGroup>
~english Creates a group.
declineInvitation({required String groupId, required String inviter, String? reason}) Future<void>
~english Declines a group invitation.
declineJoinApplication(String groupId, String username, {String? reason}) Future<void>
~english Declines a group join application. Only the group owner can call this method.
destroyGroup(String groupId) Future<void>
~english Destroys a group. Only the group owner can call this method.
downloadGroupSharedFile({required String groupId, required String fileId, required String savePath}) Future<void>
~english Downloads group shared files.
fetchAllowListFromServer(String groupId) Future<List<String>>
~english Gets the group allowlist from the server.
fetchAnnouncementFromServer(String groupId) Future<String?>
~english Gets the group announcement from the server.
fetchBlockListFromServer(String groupId, {int pageSize = 200, int pageNum = 1}) Future<List<String>>
~english Gets the group blocklist from the server. Only the group owner and admins can call this method.
fetchGroupFileListFromServer(String groupId, {int pageSize = 200, int pageNum = 1}) Future<List<EMGroupSharedFile>>
~english Gets the group shared file list from the server.
fetchGroupInfoFromServer(String groupId, {bool? fetchMembers}) Future<EMGroup>
~english Fetches group details including group ID, name, description, basic settings, owner and admins.
fetchGroupMembersInfo({required String groupId, String? cursor, int limit = 20}) Future<EMCursorResult<GroupMemberInfo>>
~english Gets the list of group members from the server.
fetchJoinedGroupCount() Future<int>
~english Gets the number of groups joined by the current user from the server.
fetchJoinedGroupsFromServer({int pageSize = 20, int pageNum = 0, bool needMemberCount = false, bool needRole = false}) Future<List<EMGroup>>
~english Gets the groups joined by the current user from the server with pagination.
fetchMemberAttributes({required String groupId, String? userId}) Future<Map<String, String>>
~english Gets all custom attributes of a group member.
fetchMemberListFromServer(String groupId, {int pageSize = 200, String? cursor}) Future<EMCursorResult<String>>
~english Gets the list of group members from the server with pagination.
fetchMembersAttributes({required String groupId, required List<String> userIds, List<String>? keys}) Future<Map<String, Map<String, String>>>
~english Gets custom attributes of multiple group members by attribute keys.
fetchMuteListFromServer(String groupId, {int pageSize = 200, int pageNum = 1}) Future<Map<String, int>>
~english Gets the group mute list from the server. Only the group owner and admins can call this method.
fetchPublicGroupsFromServer({int pageSize = 200, String? cursor}) Future<EMCursorResult<EMGroupInfo>>
~english Gets public groups within the specified range from the server.
getEventHandler(String identifier) EMGroupEventHandler?
~english Get the group event handler.
getGroupWithId(String groupId) Future<EMGroup?>
~english Gets the group instance, creates it if it does not exist.
getJoinedGroups() Future<List<EMGroup>>
~english Gets all group information of the current user from the local cache.
inviterUser(String groupId, List<String> members, {String? reason}) Future<void>
~english Invites users to join a group.
isMemberInAllowListFromServer(String groupId) Future<bool>
~english Checks whether the current user is on the group allowlist.
isMemberInGroupMuteList(String groupId) Future<bool>
~english Checks whether the current user is in the group mute list.
joinPublicGroup(String groupId) Future<void>
~english Joins a public group. The group style should be EMGroupStylePublicOpenJoin.
leaveGroup(String groupId) Future<void>
~english Leaves a group. The group owner cannot leave, only can destroy the group.
muteAllMembers(String groupId) Future<void>
~english Mutes all group members. Only the group owner and admins can call this method.
muteMembers(String groupId, List<String> members, {int duration = -1}) Future<void>
~english Mutes group members. Only the group owner and admins can call this method.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
removeAdmin(String groupId, String adminId) Future<void>
~english Removes a group administrator. Only the group owner can call this method.
removeAllowList(String groupId, List<String> members) Future<void>
~english Removes members from the group allowlist. Only the group owner and admins can call this method.
removeEventHandler(String identifier) → void
~english Remove the group event handler.
removeGroupSharedFile(String groupId, String fileId) Future<void>
~english Removes group shared files.
removeMemberAttributes({required String groupId, required List<String> keys, String? userId}) Future<void>
~english Removes group member custom attributes.
removeMembers(String groupId, List<String> members) Future<void>
~english Removes members from the group. Only the group owner can call this method.
requestToJoinPublicGroup(String groupId, {String? reason}) Future<void>
~english Requests to join a public group that requires approval. The group style should be PublicJoinNeedApproval.
setMemberAttributes({required String groupId, required Map<String, String> attributes, String? userId}) Future<void>
~english Set group member custom attributes.
toString() String
A string representation of this object.
inherited
unblockGroup(String groupId) Future<void>
~english Unblocks group messages.
unblockMembers(String groupId, List<String> members) Future<void>
~english Removes users from the group blocklist. Only the group owner can call this method.
unMuteAllMembers(String groupId) Future<void>
~english Unmutes all group members. Only the group owner and admins can call this method.
unMuteMembers(String groupId, List<String> members) Future<void>
~english Unmutes group members. Only the group owner and admins can call this method.
updateGroupAnnouncement(String groupId, String announcement) Future<void>
~english Updates the group announcement. Only the group owner and admins can call this method.
updateGroupAvatar({required String groupId, required String avatarUrl}) Future<EMGroup>
~english Changes the group avatar. Only the group owner can call this method.
updateGroupDesc(String groupId, String desc) Future<void>
~english Changes the group description. Only the group owner can call this method.
updateGroupExtension(String groupId, String extension) Future<void>
~english Updates group extension information. Only the group owner can call this method.
updateGroupName(String groupId, String name) Future<void>
~english Changes the group name. Only the group owner can call this method.
uploadGroupSharedFile(String groupId, String filePath) Future<void>
~english Uploads group shared files.

Operators

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