fix: 修复删除群成员后,回到群组消息,群成员列表不更新的问题
This commit is contained in:
parent
e5d1225f7a
commit
d5f3263822
|
|
@ -64,6 +64,10 @@ class TUIGroupListenerModel extends ChangeNotifier {
|
||||||
final groupName = await _getGroupName(groupID);
|
final groupName = await _getGroupName(groupID);
|
||||||
_needUpdate = NeedUpdate(groupID, UpdateType.kickedFromGroup, groupName);
|
_needUpdate = NeedUpdate(groupID, UpdateType.kickedFromGroup, groupName);
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
|
} else {
|
||||||
|
// 其他成员被踢出时,也需要更新成员列表
|
||||||
|
_needUpdate = NeedUpdate(groupID, UpdateType.memberList, "");
|
||||||
|
notifyListeners();
|
||||||
}
|
}
|
||||||
}, onMemberEnter: (String groupID, List<V2TimGroupMemberInfo> memberList) {
|
}, onMemberEnter: (String groupID, List<V2TimGroupMemberInfo> memberList) {
|
||||||
_needUpdate = NeedUpdate(groupID, UpdateType.memberList, "");
|
_needUpdate = NeedUpdate(groupID, UpdateType.memberList, "");
|
||||||
|
|
|
||||||
|
|
@ -353,6 +353,15 @@ class TUIGroupProfileModel extends ChangeNotifier {
|
||||||
|
|
||||||
Future<V2TimCallback> kickOffMember(List<String> userIDs) async {
|
Future<V2TimCallback> kickOffMember(List<String> userIDs) async {
|
||||||
final res = await _groupServices.kickGroupMember(groupID: _groupID, memberList: userIDs);
|
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;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
name: tencent_cloud_chat_uikit
|
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.
|
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
|
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
|
repository: https://github.com/TencentCloud/chat-uikit-flutter
|
||||||
documentation: https://comm.qq.com/im/doc/flutter/en/TUIKit/readme.html
|
documentation: https://comm.qq.com/im/doc/flutter/en/TUIKit/readme.html
|
||||||
|
|
@ -24,7 +24,7 @@ dependencies:
|
||||||
tencent_chat_i18n_tool: ^2.3.8
|
tencent_chat_i18n_tool: ^2.3.8
|
||||||
adaptive_action_sheet: ^2.0.1
|
adaptive_action_sheet: ^2.0.1
|
||||||
provider: ^6.0.1
|
provider: ^6.0.1
|
||||||
intl: ^0.19.0
|
intl: ^0.20.2
|
||||||
get_it: ^7.2.0
|
get_it: ^7.2.0
|
||||||
dotted_border: ^2.0.0+2
|
dotted_border: ^2.0.0+2
|
||||||
flutter_svg: ^2.0.6
|
flutter_svg: ^2.0.6
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue