From 157f48e653ab3f54b6895ae0bb788634571f2c34 Mon Sep 17 00:00:00 2001 From: vinsonswang Date: Mon, 21 Oct 2024 19:54:44 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E6=9B=B4=E6=96=B0=E7=AC=AC=E4=B8=89?= =?UTF-8?q?=E6=96=B9=E5=BA=93=20extended=5Ftext=20=E5=92=8C=20=20=20extend?= =?UTF-8?q?ed=5Ftext=5Ffield=20=E7=89=88=E6=9C=AC=EF=BC=8C=E6=94=AF?= =?UTF-8?q?=E6=8C=81=20flutter=20sdk=203.24=202=E3=80=81=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E5=92=8C=E4=BC=98=E5=8C=96=E8=8B=A5=E5=B9=B2=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 7 ++- .../tui_group_listener_model.dart | 55 ++++++++++++++++--- .../tui_chat_separate_view_model.dart | 28 ++++++---- .../tui_conversation_view_model.dart | 13 +++++ lib/ui/utils/message.dart | 35 +++++++++++- .../TIMUIKitAddGroup/tim_uikit_add_group.dart | 6 +- .../tim_uikit_send_application.dart | 3 + .../tim_uikit_message_read_receipt.dart | 3 + .../tim_uikit_text_field.dart | 7 ++- .../tim_uikit_text_field_layout/narrow.dart | 29 +--------- .../tim_uikit_text_field_layout/wide.dart | 21 ------- lib/ui/views/TIMUIKitChat/tim_uikit_chat.dart | 2 - .../TIMUIKitChat/tim_uikit_chat_config.dart | 10 +++- .../tim_uikit_conversation.dart | 27 ++++++++- .../widgets/tim_uikit_group_button_area.dart | 6 +- .../tim_uikit_group_message_disturb.dart | 4 ++ .../widgets/tim_uikit_group_type.dart | 19 +++++-- pubspec.yaml | 14 +++-- 18 files changed, 196 insertions(+), 93 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a8a9ed2..bd8b286 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +# 3.0.0 +## Breaking Changes +* Migrated to Flutter 3.24.0 +## Bug Fixes +* Fix and optimize some issues + # 2.7.2 * Fix the issue where failed messages cannot be resent. * Fix the issue where image messages that failed to send are not loaded using the local path. @@ -79,7 +85,6 @@ ## Bug Fixes * Fixed an issue on time tag creator. -* Fixed an issue on Video Message LocalURL. # 2.3.2 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 cc4c70e..60b6e76 100644 --- a/lib/business_logic/listener_model/tui_group_listener_model.dart +++ b/lib/business_logic/listener_model/tui_group_listener_model.dart @@ -7,14 +7,16 @@ import 'package:tencent_im_base/tencent_im_base.dart'; import 'package:tencent_cloud_chat_uikit/business_logic/view_models/tui_chat_global_model.dart'; import 'package:tencent_cloud_chat_uikit/data_services/group/group_services.dart'; import 'package:tencent_cloud_chat_uikit/data_services/services_locatar.dart'; +import 'package:tencent_cloud_chat_uikit/tencent_cloud_chat_uikit.dart'; -enum UpdateType { groupInfo, memberList, joinApplicationList } +enum UpdateType { groupInfo, memberList, joinApplicationList, groupDismissed, kickedFromGroup } class NeedUpdate { final String groupID; final UpdateType updateType; + final String extraData; - NeedUpdate(this.groupID, this.updateType); + NeedUpdate(this.groupID, this.updateType, this.extraData); } class TUIGroupListenerModel extends ChangeNotifier { @@ -22,6 +24,8 @@ class TUIGroupListenerModel extends ChangeNotifier { V2TimGroupListener? _groupListener; NeedUpdate? _needUpdate; final TUIChatGlobalModel chatViewModel = serviceLocator(); + late CoreServicesImpl coreInstance = TIMUIKitCore.getInstance(); + late V2TIMManager sdkInstance = TIMUIKitCore.getSDKInstance(); NeedUpdate? get needUpdate => _needUpdate; @@ -34,23 +38,27 @@ class TUIGroupListenerModel extends ChangeNotifier { TUIGroupListenerModel() { _groupListener = V2TimGroupListener( onMemberInvited: (groupID, opUser, memberList) { - _needUpdate = NeedUpdate(groupID, UpdateType.memberList); + _needUpdate = NeedUpdate(groupID, UpdateType.memberList, ""); notifyListeners(); }, - onMemberKicked: (groupID, opUser, memberList) { - _needUpdate = NeedUpdate(groupID, UpdateType.memberList); + onMemberKicked: (groupID, opUser, memberList) async { + if (_isLoginUserKickedFromGroup(groupID, memberList)) { + _deleteGroupConversation(groupID); + } + final groupName = await _getGroupName(groupID); + _needUpdate = NeedUpdate(groupID, UpdateType.kickedFromGroup, groupName); notifyListeners(); }, onMemberEnter: (String groupID, List memberList) { - _needUpdate = NeedUpdate(groupID, UpdateType.memberList); + _needUpdate = NeedUpdate(groupID, UpdateType.memberList, ""); notifyListeners(); }, onMemberLeave: (String groupID, V2TimGroupMemberInfo member) { - _needUpdate = NeedUpdate(groupID, UpdateType.memberList); + _needUpdate = NeedUpdate(groupID, UpdateType.memberList, ""); notifyListeners(); }, onGroupInfoChanged: (groupID, changeInfos) { - _needUpdate = NeedUpdate(groupID, UpdateType.groupInfo); + _needUpdate = NeedUpdate(groupID, UpdateType.groupInfo, ""); notifyListeners(); }, onReceiveJoinApplication: @@ -59,6 +67,12 @@ class TUIGroupListenerModel extends ChangeNotifier { chatViewModel.refreshGroupApplicationList(); notifyListeners(); }, + onGroupDismissed: (String groupID, V2TimGroupMemberInfo opUser) async { + _deleteGroupConversation(groupID); + final groupName = await _getGroupName(groupID); + _needUpdate = NeedUpdate(groupID, UpdateType.groupDismissed, groupName); + notifyListeners(); + } ); } @@ -122,4 +136,29 @@ class TUIGroupListenerModel extends ChangeNotifier { Future.delayed(const Duration(milliseconds: 500), () => chatViewModel.refreshGroupApplicationList()); } + + Future _getGroupName(String groupID) async { + final groupInfoList = await sdkInstance.getGroupManager().getGroupsInfo(groupIDList: [groupID]); + String groupName = TIM_t("群组"); + if (groupInfoList.data != null) { + groupName = groupInfoList.data!.first!.groupInfo!.groupName!; + } + return groupName; + } + + void _deleteGroupConversation(String groupID) async { + sdkInstance.getConversationManager().deleteConversation(conversationID: "group_${groupID}"); + } + + bool _isLoginUserKickedFromGroup(String groupID, List memberList) { + final loginUserInfo = coreInstance.loginInfo; + int index = memberList.indexWhere((element) => element.userID == loginUserInfo.userID); + if (index > -1) { + return true; + } + return false; + } } + + + diff --git a/lib/business_logic/separate_models/tui_chat_separate_view_model.dart b/lib/business_logic/separate_models/tui_chat_separate_view_model.dart index 88355a0..1f84f74 100644 --- a/lib/business_logic/separate_models/tui_chat_separate_view_model.dart +++ b/lib/business_logic/separate_models/tui_chat_separate_view_model.dart @@ -1136,26 +1136,32 @@ class TUIChatSeparateViewModel extends ChangeNotifier { required List conversationList, }) async { final selectedMessages = List.from(_multiSelectedMessageList); + if (conversationType == ConvType.c2c) { + selectedMessages.sort((a, b) => a.timestamp.compareTo(b.timestamp)); + } else if (conversationType == ConvType.group) { + selectedMessages.sort((a, b) => a.seq.compareTo(b.seq)); + } for (var conversation in conversationList) { final convID = conversation.groupID ?? conversation.userID ?? ""; final convType = conversation.type; for (var message in selectedMessages) { - final forwardMessageInfo = - await _messageService.createForwardMessage(msgID: message.msgID!); + final forwardMessageInfo = await _messageService.createForwardMessage(msgID: message.msgID!); final messageInfo = forwardMessageInfo!.messageInfo; if (messageInfo != null) { tools.setUserInfoForMessage(messageInfo, forwardMessageInfo.id); messageInfo.status = MessageStatus.V2TIM_MSG_STATUS_SENDING; addSendingMessageID(messageInfo.id); - _sendMessage( - id: forwardMessageInfo.id!, - convID: convID, - convType: convType == 1 ? ConvType.c2c : ConvType.group, - offlinePushInfo: tools.buildMessagePushInfo( - forwardMessageInfo.messageInfo!, - convID, - convType == 1 ? ConvType.c2c : ConvType.group), - ); + await Future.delayed(Duration(milliseconds: 100), () { + _sendMessage( + id: forwardMessageInfo.id!, + convID: convID, + convType: convType == 1 ? ConvType.c2c : ConvType.group, + offlinePushInfo: tools.buildMessagePushInfo( + forwardMessageInfo.messageInfo!, + convID, + convType == 1 ? ConvType.c2c : ConvType.group), + ); + }); } } } diff --git a/lib/business_logic/view_models/tui_conversation_view_model.dart b/lib/business_logic/view_models/tui_conversation_view_model.dart index 0cfe020..f7257c7 100644 --- a/lib/business_logic/view_models/tui_conversation_view_model.dart +++ b/lib/business_logic/view_models/tui_conversation_view_model.dart @@ -122,6 +122,8 @@ class TUIConversationViewModel extends ChangeNotifier { if (!PlatformUtils().isWeb) { loadInitConversation(); } + }, onConversationDeleted:(List conversationIDList) { + _onConversationDeleted(conversationIDList); }); } @@ -219,6 +221,17 @@ class TUIConversationViewModel extends ChangeNotifier { notifyListeners(); } + _onConversationDeleted(List list) { + for (int i = 0; i < list.length; i++) { + int index = _conversationList.indexWhere((item) => item!.conversationID == list[i]); + if (index > -1) { + _conversationList.removeAt(index); + _conversationList = removeDuplicates(_conversationList, (item1, item2) => item1?.conversationID == item2?.conversationID); + } + } + notifyListeners(); + } + _addNewConversation(List list) { _conversationList.addAll(list); _conversationList = removeDuplicates(_conversationList, (item1, item2) => item1?.conversationID == item2?.conversationID); diff --git a/lib/ui/utils/message.dart b/lib/ui/utils/message.dart index cb3fa6e..0d5aff3 100644 --- a/lib/ui/utils/message.dart +++ b/lib/ui/utils/message.dart @@ -37,6 +37,26 @@ class MessageUtils { return false; } + static String getCustomGroupCreatedOrDismissedString(V2TimMessage message) { + try { + final isGroup = message.groupID != null; + final isCustomMessage = message.elemType == MessageElemType.V2TIM_ELEM_TYPE_CUSTOM; + if (isCustomMessage && isGroup) { + final data = message.customElem?.data ?? ""; + Map customMap = jsonDecode(data); + if (customMap.containsKey('businessID') && customMap['businessID'] == "group_create") { + final content = "${customMap['opUser']}${customMap['content']}"; + return content; + } + return ""; + } + return ""; + } catch (e) { + outputLogger.i("getCustomGroupCreatedOrDismissedString json parse error"); + return ""; + } + } + static Future _getGroupChangeType(V2TimGroupChangeInfo info, List groupMemberList) async { int? type = info.type; @@ -139,17 +159,26 @@ class MessageUtils { final String? option7 = opUserNickName ?? ""; final groupChangeInfoList = groupTipsElem.groupChangeInfoList ?? []; String changedInfoString = ""; + bool changedValue = false; for (V2TimGroupChangeInfo? element in groupChangeInfoList) { final newText = await _getGroupChangeType(element!, groupMemberList); changedInfoString += (changedInfoString.isEmpty ? "" : " / ") + newText; + changedValue = element!.boolValue ?? false; } if (changedInfoString.isEmpty) { changedInfoString = TIM_t("群资料"); } - displayMessage = - TIM_t_para("{{option7}}修改", "$option7修改")(option7: option7) + - changedInfoString; + if (changedInfoString == TIM_t("全员禁言状态")) { + changedInfoString = TIM_t("全员禁言"); + displayMessage = changedValue == false ? TIM_t_para("{{option7}} 取消", "$option7 取消")(option7: option7) + + changedInfoString : TIM_t_para("{{option7}} 开启", "$option7 开启")(option7: option7) + + changedInfoString; + } else { + displayMessage = + TIM_t_para("{{option7}}修改", "$option7修改")(option7: option7) + + changedInfoString; + } break; case GroupTipsElemType.V2TIM_GROUP_TIPS_TYPE_QUIT: final String? option6 = opUserNickName ?? ""; diff --git a/lib/ui/views/TIMUIKitAddGroup/tim_uikit_add_group.dart b/lib/ui/views/TIMUIKitAddGroup/tim_uikit_add_group.dart index 23d4798..6603c96 100644 --- a/lib/ui/views/TIMUIKitAddGroup/tim_uikit_add_group.dart +++ b/lib/ui/views/TIMUIKitAddGroup/tim_uikit_add_group.dart @@ -60,6 +60,9 @@ class _TIMUIKitAddGroupState extends TIMUIKitState { case GroupType.Work: groupType = TIM_t("工作群"); break; + case GroupType.Community: + groupType = TIM_t("社群"); + break; default: groupType = TIM_t("未知群"); break; @@ -86,7 +89,6 @@ class _TIMUIKitAddGroupState extends TIMUIKitState { if (widget.closeFunc != null) { widget.closeFunc!(); } - widget.onTapExistGroup(groupID, groupConversation); return; } @@ -106,7 +108,7 @@ class _TIMUIKitAddGroupState extends TIMUIKitState { ), ); }else{ - Navigator.pushReplacement( + Navigator.push( context, MaterialPageRoute( builder: (context) => SendJoinGroupApplication( diff --git a/lib/ui/views/TIMUIKitAddGroup/tim_uikit_send_application.dart b/lib/ui/views/TIMUIKitAddGroup/tim_uikit_send_application.dart index 870e29b..85888e0 100644 --- a/lib/ui/views/TIMUIKitAddGroup/tim_uikit_send_application.dart +++ b/lib/ui/views/TIMUIKitAddGroup/tim_uikit_send_application.dart @@ -61,6 +61,9 @@ class _SendJoinGroupApplicationState case GroupType.Work: groupType = TIM_t("工作群"); break; + case GroupType.Community: + groupType = TIM_t("社群"); + break; default: groupType = TIM_t("未知群"); break; diff --git a/lib/ui/views/TIMUIKitChat/TIMUIKItMessageList/tim_uikit_message_read_receipt.dart b/lib/ui/views/TIMUIKitChat/TIMUIKItMessageList/tim_uikit_message_read_receipt.dart index 2b1c04a..8f21c6e 100644 --- a/lib/ui/views/TIMUIKitChat/TIMUIKItMessageList/tim_uikit_message_read_receipt.dart +++ b/lib/ui/views/TIMUIKitChat/TIMUIKItMessageList/tim_uikit_message_read_receipt.dart @@ -49,6 +49,9 @@ class TIMUIKitMessageReadReceipt extends TIMUIKitStatelessWidget { readCount: value?.readCount ?? 0) ); }else{ + if (value?.unreadCount == 0) { + return; + } Navigator.push( context, MaterialPageRoute( diff --git a/lib/ui/views/TIMUIKitChat/TIMUIKitTextField/tim_uikit_text_field.dart b/lib/ui/views/TIMUIKitChat/TIMUIKitTextField/tim_uikit_text_field.dart index 56fe765..bf1e4dd 100644 --- a/lib/ui/views/TIMUIKitChat/TIMUIKitTextField/tim_uikit_text_field.dart +++ b/lib/ui/views/TIMUIKitChat/TIMUIKitTextField/tim_uikit_text_field.dart @@ -529,7 +529,10 @@ class _InputTextFieldState extends TIMUIKitState { } final int selfRole = widget.model.selfMemberInfo?.role ?? 0; - final bool canAtAll = (selfRole == GroupMemberRoleType.V2TIM_GROUP_MEMBER_ROLE_ADMIN || selfRole == GroupMemberRoleType.V2TIM_GROUP_MEMBER_ROLE_OWNER); + final bool canAtAll = widget.model.chatConfig.isMemberCanAtAll ? true : (selfRole == GroupMemberRoleType + .V2TIM_GROUP_MEMBER_ROLE_ADMIN || selfRole + == + GroupMemberRoleType.V2TIM_GROUP_MEMBER_ROLE_OWNER); if (isDesktopScreen) { (int, String, bool)? changedCharacterRecord = findChangedCharacter(originalText, text); @@ -860,7 +863,6 @@ class _InputTextFieldState extends TIMUIKitState { backSpaceText: deleteStickerFromText, addStickerToText: addStickerToText, customStickerPanel: widget.customStickerPanel, - forbiddenText: forbiddenText, onChanged: widget.onChanged, backgroundColor: widget.backgroundColor, morePanelConfig: widget.morePanelConfig, @@ -898,7 +900,6 @@ class _InputTextFieldState extends TIMUIKitState { backSpaceText: deleteStickerFromText, addStickerToText: addStickerToText, customStickerPanel: widget.customStickerPanel, - forbiddenText: forbiddenText, onChanged: widget.onChanged, backgroundColor: widget.backgroundColor, morePanelConfig: widget.morePanelConfig, diff --git a/lib/ui/views/TIMUIKitChat/TIMUIKitTextField/tim_uikit_text_field_layout/narrow.dart b/lib/ui/views/TIMUIKitChat/TIMUIKitTextField/tim_uikit_text_field_layout/narrow.dart index 0999262..e0d8fec 100644 --- a/lib/ui/views/TIMUIKitChat/TIMUIKitTextField/tim_uikit_text_field_layout/narrow.dart +++ b/lib/ui/views/TIMUIKitChat/TIMUIKitTextField/tim_uikit_text_field_layout/narrow.dart @@ -84,8 +84,6 @@ class TIMUIKitTextFieldLayoutNarrow extends StatefulWidget { /// show send emoji icon final bool showSendEmoji; - final String? forbiddenText; - final VoidCallback onSubmitted; final VoidCallback goDownBottom; @@ -118,7 +116,6 @@ class TIMUIKitTextFieldLayoutNarrow extends StatefulWidget { required this.handleAtText, required this.handleSoftKeyBoardDelete, this.repliedMessage, - this.forbiddenText, required this.onSubmitted, required this.goDownBottom, required this.showSendAudio, @@ -414,23 +411,7 @@ class _TIMUIKitTextFieldLayoutNarrowState extends TIMUIKitState { @override Widget tuiBuild(BuildContext context, TUIKitBuildValue value) { final TUITheme theme = value.theme; - final closePanel = OptimizeUtils.throttle((_) => textFieldController.hideAllPanel(), 60); final isBuild = isInit; isInit = true; _updateJoinInGroupCallWidget(); @@ -474,7 +473,6 @@ class _TUIChatState extends TIMUIKitState { key: alignKey, alignment: Alignment.topCenter, child: Listener( - onPointerMove: closePanel, child: TIMUIKitHistoryMessageListContainer( customMessageHoverBarOnDesktop: widget.customMessageHoverBarOnDesktop, conversation: widget.conversation, diff --git a/lib/ui/views/TIMUIKitChat/tim_uikit_chat_config.dart b/lib/ui/views/TIMUIKitChat/tim_uikit_chat_config.dart index 763e264..3abe48d 100644 --- a/lib/ui/views/TIMUIKitChat/tim_uikit_chat_config.dart +++ b/lib/ui/views/TIMUIKitChat/tim_uikit_chat_config.dart @@ -243,6 +243,13 @@ class TIMUIKitChatConfig { /// [Default]: 400 final double desktopStickerPanelHeight; + /// Determine whether the normal members can @All in a group chat. + /// If enabled, normal members can @All in a group chat. + /// If disabled, only the group owner or administrators can @All. + /// + /// [Default]: false + final bool isMemberCanAtAll; + const TIMUIKitChatConfig( {this.onTapLink, this.timeDividerConfig, @@ -291,5 +298,6 @@ class TIMUIKitChatConfig { this.showC2cMessageEditStatus = true, this.additionalDesktopControlBarItems, this.isAllowLongPressAvatarToAt = true, - this.isUseDefaultEmoji = false}); + this.isUseDefaultEmoji = false, + this.isMemberCanAtAll = false}); } diff --git a/lib/ui/views/TIMUIKitConversation/tim_uikit_conversation.dart b/lib/ui/views/TIMUIKitConversation/tim_uikit_conversation.dart index 4e9a79d..47a00c8 100644 --- a/lib/ui/views/TIMUIKitConversation/tim_uikit_conversation.dart +++ b/lib/ui/views/TIMUIKitConversation/tim_uikit_conversation.dart @@ -11,6 +11,7 @@ import 'package:tencent_cloud_chat_uikit/base_widgets/tim_ui_kit_statelesswidget import 'package:tencent_cloud_chat_uikit/business_logic/life_cycle/conversation_life_cycle.dart'; import 'package:tencent_cloud_chat_uikit/business_logic/view_models/tui_conversation_view_model.dart'; import 'package:tencent_cloud_chat_uikit/business_logic/view_models/tui_friendship_view_model.dart'; +import 'package:tencent_cloud_chat_uikit/business_logic/listener_model/tui_group_listener_model.dart'; import 'package:tencent_cloud_chat_uikit/data_services/core/tim_uikit_wide_modal_operation_key.dart'; import 'package:tencent_cloud_chat_uikit/data_services/services_locatar.dart'; import 'package:tencent_cloud_chat_uikit/tencent_cloud_chat_uikit.dart'; @@ -143,6 +144,7 @@ class _TIMUIKitConversationState extends TIMUIKitState { late TIMUIKitConversationController _timuiKitConversationController; final TUIThemeViewModel themeViewModel = serviceLocator(); final TUIFriendShipViewModel friendShipViewModel = serviceLocator(); + final TUIGroupListenerModel groupListenerModel = serviceLocator(); late AutoScrollController _autoScrollController; @override @@ -289,13 +291,33 @@ class _TIMUIKitConversationState extends TIMUIKitState { final theme = value.theme; final isDesktopScreen = TUIKitScreenUtils.getFormFactor(context) == DeviceType.Desktop; return MultiProvider( - providers: [ChangeNotifierProvider.value(value: model), ChangeNotifierProvider.value(value: friendShipViewModel)], + providers: [ + ChangeNotifierProvider.value(value: model), + ChangeNotifierProvider.value(value: friendShipViewModel), + ChangeNotifierProvider.value(value: groupListenerModel)], builder: (BuildContext context, Widget? w) { final _model = Provider.of(context); bool haveMoreData = _model.haveMoreData; final _friendShipViewModel = Provider.of(context); _model.lifeCycle = widget.lifeCycle; + final TUIGroupListenerModel groupListenerModel = Provider.of(context, listen: true); + final NeedUpdate? needUpdate = groupListenerModel.needUpdate; + if (needUpdate != null) { + groupListenerModel.needUpdate = null; + if (needUpdate.updateType == UpdateType.groupDismissed) { + onTIMCallback(TIMCallback( + type: TIMCallbackType.INFO, + infoRecommendText: "${needUpdate!.extraData}${TIM_t("已解散")}", + infoCode: 6661402)); + } else if (needUpdate.updateType == UpdateType.kickedFromGroup) { + onTIMCallback(TIMCallback( + type: TIMCallbackType.INFO, + infoRecommendText: "${TIM_t("您已被踢出")}${needUpdate!.extraData}", + infoCode: 6661402)); + } + } + List filteredConversationList = getFilteredConversation(); if (TencentUtils.checkString(_model.scrollToConversation) != null) { @@ -344,7 +366,8 @@ class _TIMUIKitConversationState extends TIMUIKitState { lastMessageBuilder: widget.lastMessageBuilder, faceUrl: conversationItem.faceUrl ?? "", nickName: conversationItem.showName ?? "", - isDisturb: conversationItem.recvOpt != 0, + isDisturb: (conversationItem.groupType == "Meeting" ? false : conversationItem + .recvOpt != 0), lastMsg: conversationItem.lastMessage, isPined: isPined, groupAtInfoList: conversationItem.groupAtInfoList ?? [], diff --git a/lib/ui/views/TIMUIKitGroupProfile/widgets/tim_uikit_group_button_area.dart b/lib/ui/views/TIMUIKitGroupProfile/widgets/tim_uikit_group_button_area.dart index c6796d3..07fdc6c 100644 --- a/lib/ui/views/TIMUIKitGroupProfile/widgets/tim_uikit_group_button_area.dart +++ b/lib/ui/views/TIMUIKitGroupProfile/widgets/tim_uikit_group_button_area.dart @@ -94,7 +94,7 @@ class GroupProfileButtonArea extends TIMUIKitStatelessWidget { } }, child: Text( - TIM_t("清空聊天记录"), + TIM_t("确定"), style: TextStyle(color: theme.cautionColor), ), isDefaultAction: false, @@ -157,6 +157,10 @@ class GroupProfileButtonArea extends TIMUIKitStatelessWidget { if (deleteConvRes.code == 0) { model.lifeCycle?.didLeaveGroup(); } + onTIMCallback(TIMCallback( + type: TIMCallbackType.INFO, + infoRecommendText: "${TIM_t("您已退出")}${model.groupInfo?.groupName}", + infoCode: 6661402)); } }, child: Text( diff --git a/lib/ui/views/TIMUIKitGroupProfile/widgets/tim_uikit_group_message_disturb.dart b/lib/ui/views/TIMUIKitGroupProfile/widgets/tim_uikit_group_message_disturb.dart index 91cf421..c604190 100644 --- a/lib/ui/views/TIMUIKitGroupProfile/widgets/tim_uikit_group_message_disturb.dart +++ b/lib/ui/views/TIMUIKitGroupProfile/widgets/tim_uikit_group_message_disturb.dart @@ -13,7 +13,11 @@ class GroupMessageDisturb extends TIMUIKitStatelessWidget { @override Widget tuiBuild(BuildContext context, TUIKitBuildValue value) { final model = Provider.of(context); + final isShowDisturb = model.groupInfo?.groupType == "Meeting" ? false : true; final isDisturb = model.conversation?.recvOpt != 0; + if (!isShowDisturb) { + return Container(); + } return TIMUIKitOperationItem( isEmpty: false, operationName: TIM_t("消息免打扰"), diff --git a/lib/ui/views/TIMUIKitGroupProfile/widgets/tim_uikit_group_type.dart b/lib/ui/views/TIMUIKitGroupProfile/widgets/tim_uikit_group_type.dart index 1f1284d..edacc6e 100644 --- a/lib/ui/views/TIMUIKitGroupProfile/widgets/tim_uikit_group_type.dart +++ b/lib/ui/views/TIMUIKitGroupProfile/widgets/tim_uikit_group_type.dart @@ -33,6 +33,9 @@ class GroupProfileType extends TIMUIKitStatelessWidget { case GroupType.Work: groupType = TIM_t("工作群"); break; + case GroupType.Community: + groupType = TIM_t("社群"); + break; default: groupType = TIM_t("未知群"); break; @@ -42,22 +45,26 @@ class GroupProfileType extends TIMUIKitStatelessWidget { padding: const EdgeInsets.symmetric(vertical: 12, horizontal: 16), decoration: BoxDecoration( color: Colors.white, - border: isDesktopScreen ? null : Border( - bottom: BorderSide( - color: - theme.weakDividerColor ?? CommonColor.weakDividerColor))), + border: isDesktopScreen + ? null + : Border( + bottom: BorderSide( + color: theme.weakDividerColor ?? + CommonColor.weakDividerColor))), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Text( TIM_t("群类型"), style: TextStyle( - fontSize: isDesktopScreen ? 14 : 16, color: theme.darkTextColor), + fontSize: isDesktopScreen ? 14 : 16, + color: theme.darkTextColor), ), Text( groupType, style: TextStyle( - fontSize: isDesktopScreen ? 14 : 16, color: theme.weakTextColor), + fontSize: isDesktopScreen ? 14 : 16, + color: theme.weakTextColor), ) ], ), diff --git a/pubspec.yaml b/pubspec.yaml index b710286..67c8d1c 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: 2.7.2 +version: 3.0.0 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 @@ -14,7 +14,7 @@ platforms: environment: sdk: '>=3.0.0 <4.0.0' - flutter: ">=3.22.0" + flutter: ">=3.24.0" dependencies: flutter: @@ -44,8 +44,8 @@ dependencies: wechat_camera_picker: ^4.2.0-dev.2 flutter_easyrefresh: ^2.2.1 extended_image: '>=8.2.0 <=8.2.4' - extended_text_field: ^15.0.0 - extended_text: ^13.0.0 + extended_text_field: ^16.0.0 + extended_text: ^14.0.0 package_info_plus: ^4.0.1 loading_animation_widget: ^1.1.0+3 permission_handler: ^10.2.0 @@ -83,9 +83,11 @@ dev_dependencies: lints: ^1.0.1 dependency_overrides: +# tencent_chat_i18n_tool: +# path: ../../../tencent_chat_i18n_tool - # tencent_chat_i18n_tool: - # path: D:\Project\tencent-chat-i18n-tool +# tencent_cloud_chat_sdk: +# path: ../../../tencent_cloud_chat_sdk # For information on the generic Dart part of this file, see the # following page: https://dart.dev/tools/pub/pubspec