ChatGroupEventHandler class
~english The group event handler.
Occurs when the following group events happens: joining a group, approving or declining a group request, and kicking a user out of a group.
Adds a group event handler:
ChatClient.getInstance.groupManager.addEventHandler(UNIQUE_HANDLER_ID, ChatGroupEventHandler());
Removes a group event handler:
ChatClient.getInstance.groupManager.removeEventHandler(UNIQUE_HANDLER_ID);
~end
~chinese 群组事件监听
添加监听:
ChatClient.getInstance.groupManager.addEventHandler(UNIQUE_HANDLER_ID, ChatGroupEventHandler());
移除监听:
ChatClient.getInstance.groupManager.removeEventHandler(UNIQUE_HANDLER_ID);
~end
Constructors
-
ChatGroupEventHandler({void onAdminAddedFromGroup(String groupId, String admin)?, void onAdminRemovedFromGroup(String groupId, String admin)?, void onAllGroupMemberMuteStateChanged(String groupId, bool isAllMuted)?, void onAllowListAddedFromGroup(String groupId, List<
String> members)?, void onAllowListRemovedFromGroup(String groupId, List<String> members)?, void onAnnouncementChangedFromGroup(String groupId, String announcement)?, void onAutoAcceptInvitationFromGroup(String groupId, String inviter, String? inviteMessage)?, void onGroupDestroyed(String groupId, String? groupName)?, void onInvitationAcceptedFromGroup(String groupId, String invitee, String? reason)?, void onInvitationDeclinedFromGroup(String groupId, String invitee, String? reason)?, void onInvitationReceivedFromGroup(String groupId, String? groupName, String inviter, String? reason)?, void onMemberExitedFromGroup(String groupId, String member)?, void onMemberJoinedFromGroup(String groupId, String member)?, void onMuteListAddedFromGroup(String groupId, List<String> mutes, int? muteExpire)?, void onMuteListRemovedFromGroup(String groupId, List<String> mutes)?, void onOwnerChangedFromGroup(String groupId, String newOwner, String oldOwner)?, void onRequestToJoinAcceptedFromGroup(String groupId, String? groupName, String accepter)?, void onRequestToJoinDeclinedFromGroup(String groupId, String? groupName, String? decliner, String? reason, String? applicant)?, void onRequestToJoinReceivedFromGroup(String groupId, String? groupName, String applicant, String? reason)?, void onUserRemovedFromGroup(String groupId, String? groupName)?, void onSpecificationDidUpdate(ChatGroup group)?, void onDisableChanged(String groupId, bool isDisable)?, void onAttributesChangedOfGroupMember(String groupId, String userId, Map<String, String> ? attributes, String? operatorId)?}) - ~english The group manager listener callback.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- onAdminAddedFromGroup → (void Function(String groupId, String admin)?)
-
~english
Occurs when a member is set as an admin.
~end
final
- onAdminRemovedFromGroup → (void Function(String groupId, String admin)?)
-
~english
Occurs when a member's admin privileges are removed.
~end
final
- onAllGroupMemberMuteStateChanged → (void Function(String groupId, bool isAllMuted)?)
-
~english
Occurs when all group members are muted or unmuted.
~end
final
-
onAllowListAddedFromGroup
→ (void Function(String groupId, List<
String> members)?) -
~english
Occurs when one or more group members are added to the allowlist.
~end
final
-
onAllowListRemovedFromGroup
→ (void Function(String groupId, List<
String> members)?) -
~english
Occurs when one or more members are removed from the allowlist.
~end
final
- onAnnouncementChangedFromGroup → (void Function(String groupId, String announcement)?)
-
~english
Occurs when the announcement is updated.
~end
final
-
onAttributesChangedOfGroupMember
→ (void Function(String groupId, String userId, Map<
String, String> ? attributes, String? operatorId)?) -
~english
Occurs when a custom attribute(s) of a group member is/are changed.
final
- onAutoAcceptInvitationFromGroup → (void Function(String groupId, String inviter, String? inviteMessage)?)
-
~english
Occurs when the group invitation is accepted automatically.
For settings, See ChatOptions.autoAcceptGroupInvitation.
The SDK will join the group before notifying the app of the acceptance of the group invitation.
~end
final
- onDisableChanged → (void Function(String groupId, bool isDisable)?)
-
~english
Occurs when the group is enabled or disabled.
~end
final
- onGroupDestroyed → (void Function(String groupId, String? groupName)?)
-
~english
Occurs when a group is destroyed.
~end
final
- onInvitationAcceptedFromGroup → (void Function(String groupId, String invitee, String? reason)?)
-
~english
Occurs when a group invitation is accepted.
~end
final
- onInvitationDeclinedFromGroup → (void Function(String groupId, String invitee, String? reason)?)
-
~english
Occurs when a group invitation is declined.
~end
final
- onInvitationReceivedFromGroup → (void Function(String groupId, String? groupName, String inviter, String? reason)?)
-
~english
Occurs when the user receives a group invitation.
~end
final
- onMemberExitedFromGroup → (void Function(String groupId, String member)?)
-
~english
Occurs when a member proactively leaves the group.
~end
final
- onMemberJoinedFromGroup → (void Function(String groupId, String member)?)
-
~english
Occurs when a user joins a group.
~end
final
-
onMuteListAddedFromGroup
→ (void Function(String groupId, List<
String> mutes, int? muteExpire)?) -
~english
Occurs when one or more group members are muted.
final
-
onMuteListRemovedFromGroup
→ (void Function(String groupId, List<
String> mutes)?) -
~english
Occurs when one or more group members are unmuted.
~end
final
- onOwnerChangedFromGroup → (void Function(String groupId, String newOwner, String oldOwner)?)
-
~english
Occurs when the group ownership is transferred.
~end
final
- onRequestToJoinAcceptedFromGroup → (void Function(String groupId, String? groupName, String accepter)?)
-
~english
Occurs when a group request is accepted.
~end
final
- onRequestToJoinDeclinedFromGroup → (void Function(String groupId, String? groupName, String? decliner, String? reason, String? applicant)?)
-
~english
Occurs when a group request is declined.
~end
final
- onRequestToJoinReceivedFromGroup → (void Function(String groupId, String? groupName, String applicant, String? reason)?)
-
~english
Occurs when the group owner or administrator receives a group request from a user.
~end
final
-
~english
Occurs when a shared file is added to a group.
~end
final
-
~english
Occurs when a shared file is removed from a group.
~end
final
- onSpecificationDidUpdate → (void Function(ChatGroup group)?)
-
~english
Occurs when the group detail information is updated.
~end
final
- onUserRemovedFromGroup → (void Function(String groupId, String? groupName)?)
-
~english
Occurs when the current user is removed from the group by the group admin.
~end
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
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