diff --git a/lib/business_logic/listener_model/tui_group_listener_model.dart b/lib/business_logic/listener_model/tui_group_listener_model.dart index e9cd8ca..055bd80 100644 --- a/lib/business_logic/listener_model/tui_group_listener_model.dart +++ b/lib/business_logic/listener_model/tui_group_listener_model.dart @@ -64,6 +64,10 @@ class TUIGroupListenerModel extends ChangeNotifier { final groupName = await _getGroupName(groupID); _needUpdate = NeedUpdate(groupID, UpdateType.kickedFromGroup, groupName); notifyListeners(); + } else { + // 其他成员被踢出时,也需要更新成员列表 + _needUpdate = NeedUpdate(groupID, UpdateType.memberList, ""); + notifyListeners(); } }, onMemberEnter: (String groupID, List memberList) { _needUpdate = NeedUpdate(groupID, UpdateType.memberList, ""); diff --git a/lib/business_logic/separate_models/tui_group_profile_model.dart b/lib/business_logic/separate_models/tui_group_profile_model.dart index 4f58576..8f39023 100644 --- a/lib/business_logic/separate_models/tui_group_profile_model.dart +++ b/lib/business_logic/separate_models/tui_group_profile_model.dart @@ -353,6 +353,15 @@ class TUIGroupProfileModel extends ChangeNotifier { Future kickOffMember(List userIDs) async { final res = await _groupServices.kickGroupMember(groupID: _groupID, memberList: userIDs); + if (res.code == 0) { + // 从本地群成员列表中移除被删除的成员 + _groupMemberList?.removeWhere((member) => userIDs.contains(member?.userID)); + // 更新群成员数量 + if (_groupInfo != null && _groupInfo!.memberCount != null) { + _groupInfo!.memberCount = _groupInfo!.memberCount! - userIDs.length; + } + notifyListeners(); + } return res; } diff --git a/pubspec.yaml b/pubspec.yaml index a5114bc..1a7fe8b 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: tencent_cloud_chat_uikit description: A powerful chat UI component library and business logic for Tencent Cloud Chat, creating seamless in-app chat modules for delightful user experiences. -version: 5.0.2 +version: 5.0.3 homepage: https://trtc.io/products/chat?utm_source=gfs&utm_medium=link&utm_campaign=%E6%B8%A0%E9%81%93&_channel_track_key=k6WgfCKn repository: https://github.com/TencentCloud/chat-uikit-flutter documentation: https://comm.qq.com/im/doc/flutter/en/TUIKit/readme.html @@ -24,7 +24,7 @@ dependencies: tencent_chat_i18n_tool: ^2.3.8 adaptive_action_sheet: ^2.0.1 provider: ^6.0.1 - intl: ^0.19.0 + intl: ^0.20.2 get_it: ^7.2.0 dotted_border: ^2.0.0+2 flutter_svg: ^2.0.6