ChatGroupEventHandler class
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);
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)?, 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)?}) - The group manager listener callback.
Properties
- hashCode → int
-
The hash code for this object.
read-onlyinherited
- onAdminAddedFromGroup → (void Function(String groupId, String admin)?)
-
Occurs when a member is set as an admin.
final
- onAdminRemovedFromGroup → (void Function(String groupId, String admin)?)
-
Occurs when a member's admin privileges are removed.
final
- onAllGroupMemberMuteStateChanged → (void Function(String groupId, bool isAllMuted)?)
-
Occurs when all group members are muted or unmuted.
final
-
onAllowListAddedFromGroup
→ (void Function(String groupId, List<
String> members)?) -
Occurs when one or more group members are added to the allowlist.
final
-
onAllowListRemovedFromGroup
→ (void Function(String groupId, List<
String> members)?) -
Occurs when one or more members are removed from the allowlist.
final
- onAnnouncementChangedFromGroup → (void Function(String groupId, String announcement)?)
-
Occurs when the announcement is updated.
final
-
onAttributesChangedOfGroupMember
→ (void Function(String groupId, String userId, Map<
String, String> ? attributes, String? operatorId)?) -
Occurs when a custom attribute(s) of a group member is/are changed.
final
- onAutoAcceptInvitationFromGroup → (void Function(String groupId, String inviter, String? inviteMessage)?)
-
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.
final
- onDisableChanged → (void Function(String groupId, bool isDisable)?)
-
Occurs when the group is enabled or disabled.
final
- onGroupDestroyed → (void Function(String groupId, String? groupName)?)
-
Occurs when a group is destroyed.
final
- onInvitationAcceptedFromGroup → (void Function(String groupId, String invitee, String? reason)?)
-
Occurs when a group invitation is accepted.
final
- onInvitationDeclinedFromGroup → (void Function(String groupId, String invitee, String? reason)?)
-
Occurs when a group invitation is declined.
final
- onInvitationReceivedFromGroup → (void Function(String groupId, String? groupName, String inviter, String? reason)?)
-
Occurs when the user receives a group invitation.
final
- onMemberExitedFromGroup → (void Function(String groupId, String member)?)
-
Occurs when a member proactively leaves the group.
final
- onMemberJoinedFromGroup → (void Function(String groupId, String member)?)
-
Occurs when a user joins a group.
final
-
onMuteListAddedFromGroup
→ (void Function(String groupId, List<
String> mutes, int? muteExpire)?) -
Occurs when one or more group members are muted.
final
-
onMuteListRemovedFromGroup
→ (void Function(String groupId, List<
String> mutes)?) -
Occurs when one or more group members are unmuted.
final
- onOwnerChangedFromGroup → (void Function(String groupId, String newOwner, String oldOwner)?)
-
Occurs when the group ownership is transferred.
final
- onRequestToJoinAcceptedFromGroup → (void Function(String groupId, String? groupName, String accepter)?)
-
Occurs when a group request is accepted.
final
- onRequestToJoinDeclinedFromGroup → (void Function(String groupId, String? groupName, String decliner, String? reason)?)
-
Occurs when a group request is declined.
final
- onRequestToJoinReceivedFromGroup → (void Function(String groupId, String? groupName, String applicant, String? reason)?)
-
Occurs when the group owner or administrator receives a group request from a user.
final
-
Occurs when a shared file is added to a group.
final
-
Occurs when a shared file is removed from a group.
final
- onSpecificationDidUpdate → (void Function(ChatGroup group)?)
-
Occurs when the group detail information is updated.
final
- onUserRemovedFromGroup → (void Function(String groupId, String? groupName)?)
-
Occurs when the current user is removed from the group by the group admin.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
read-onlyinherited
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