tencent_cloud_chat_uikit source code update to version 5.0.1+3
This commit is contained in:
parent
aecb38a604
commit
214558c7f4
20
CHANGELOG.md
20
CHANGELOG.md
|
|
@ -1,3 +1,23 @@
|
|||
# 5.0.1+3
|
||||
* Optimize UI refresh timing when joining a call midway.
|
||||
|
||||
# 5.0.1+2
|
||||
* Optimize the dependency of the internationalization plugin intl.
|
||||
|
||||
# 5.0.1+1
|
||||
* Fixed the issue of sending files on the web platform.
|
||||
* Fixed the issue where the custom background color of text messages did not take effect.
|
||||
|
||||
# 5.0.1
|
||||
* Optimize the display direction of C2C audio and video call prompt messages.
|
||||
|
||||
# 5.0.0+2
|
||||
* Fixed the issue that the chat page avatar rounded corner configuration did not take effect.
|
||||
* Fixed the issue where clicking multiple voice messages in succession would display the playback animation at the same time.
|
||||
|
||||
# 5.0.0+1
|
||||
* Add the isExcludedFromUnreadCount field setting to the sendMessage method of MessageServiceImpl
|
||||
|
||||
# 5.0.0
|
||||
* Migrate to Flutter 3.29.0.
|
||||
|
||||
|
|
|
|||
|
|
@ -321,6 +321,7 @@ class MessageServiceImpl extends MessageService {
|
|||
localCustomData: localCustomData,
|
||||
cloudCustomData: cloudCustomData,
|
||||
isExcludedFromContentModeration: isExcludedFromContentModeration,
|
||||
isExcludedFromUnreadCount: isExcludedFromUnreadCount,
|
||||
);
|
||||
if (result.code != 0) {
|
||||
String recommendText = ErrorMessageConverter.getErrorMessage(result.code);
|
||||
|
|
|
|||
|
|
@ -15,6 +15,8 @@ import 'package:tencent_cloud_chat_sdk/models/v2_tim_message.dart'
|
|||
if (dart.library.html) 'package:tencent_cloud_chat_sdk/web/compatible_models/v2_tim_message.dart';
|
||||
import 'package:tencent_cloud_chat_sdk/models/v2_tim_message_change_info.dart'
|
||||
if (dart.library.html) 'package:tencent_cloud_chat_sdk/web/compatible_models/v2_tim_message_change_info.dart';
|
||||
import 'package:tencent_cloud_chat_sdk/models/v2_tim_user_full_info.dart'
|
||||
if (dart.library.html) 'package:tencent_cloud_chat_sdk/web/compatible_models/v2_tim_user_full_info.dart';
|
||||
import 'package:tencent_cloud_chat_sdk/models/v2_tim_value_callback.dart'
|
||||
if (dart.library.html) 'package:tencent_cloud_chat_sdk/web/compatible_models/v2_tim_value_callback.dart';
|
||||
import 'package:tencent_cloud_chat_uikit/base_widgets/tim_ui_kit_base.dart';
|
||||
|
|
@ -81,6 +83,18 @@ typedef MessageItemContent = Widget? Function(
|
|||
VoidCallback clearJump,
|
||||
);
|
||||
|
||||
class RenderingDirectionResult {
|
||||
final bool? isSelf;
|
||||
final V2TimUserFullInfo? userInfo;
|
||||
|
||||
const RenderingDirectionResult({
|
||||
this.isSelf,
|
||||
this.userInfo,
|
||||
});
|
||||
}
|
||||
|
||||
typedef RenderingDirectionCallback = RenderingDirectionResult? Function(V2TimMessage message);
|
||||
|
||||
class MessageHoverControlItem {
|
||||
String name;
|
||||
Widget icon;
|
||||
|
|
@ -131,6 +145,8 @@ class MessageItemBuilder {
|
|||
/// message nick name builder
|
||||
final MessageNickNameBuilder? messageNickNameBuilder;
|
||||
|
||||
final RenderingDirectionCallback? renderingDirectionCallback;
|
||||
|
||||
MessageItemBuilder({
|
||||
this.locationMessageItemBuilder,
|
||||
this.textMessageItemBuilder,
|
||||
|
|
@ -145,6 +161,7 @@ class MessageItemBuilder {
|
|||
this.mergerMessageItemBuilder,
|
||||
this.messageRowBuilder,
|
||||
this.messageNickNameBuilder,
|
||||
this.renderingDirectionCallback,
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -283,7 +300,9 @@ class TIMUIKitHistoryMessageListItem extends StatefulWidget {
|
|||
/// If provided, the default message action functionality will appear in the right-click context menu instead.
|
||||
final Widget? Function(V2TimMessage message)? customMessageHoverBarOnDesktop;
|
||||
|
||||
const TIMUIKitHistoryMessageListItem(
|
||||
final RenderingDirectionCallback? renderingDirectionCallback;
|
||||
|
||||
TIMUIKitHistoryMessageListItem(
|
||||
{Key? key,
|
||||
required this.message,
|
||||
@Deprecated(
|
||||
|
|
@ -312,7 +331,8 @@ class TIMUIKitHistoryMessageListItem extends StatefulWidget {
|
|||
this.textFieldController,
|
||||
this.onSecondaryTapForOthersPortrait,
|
||||
this.groupMemberInfo,
|
||||
this.customMessageHoverBarOnDesktop})
|
||||
this.customMessageHoverBarOnDesktop,
|
||||
this.renderingDirectionCallback,})
|
||||
: super(key: key);
|
||||
|
||||
@override
|
||||
|
|
@ -366,6 +386,7 @@ class _TIMUIKItHistoryMessageListItemState extends TIMUIKitState<TIMUIKitHistory
|
|||
final GlobalKey _key = GlobalKey();
|
||||
bool isShowWideToolTip = false;
|
||||
TapDownDetails? _tapDetails;
|
||||
final CoreServicesImpl _coreServicesImpl = serviceLocator<CoreServicesImpl>();
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
|
|
@ -415,7 +436,19 @@ class _TIMUIKItHistoryMessageListItemState extends TIMUIKitState<TIMUIKitHistory
|
|||
final msgType = messageItem.elemType;
|
||||
final isShowJump = (model.jumpMsgID == messageItem.msgID) && (messageItem.msgID?.isNotEmpty ?? false);
|
||||
final MessageItemBuilder? messageItemBuilder = widget.messageItemBuilder;
|
||||
final isFromSelf = messageItem.isSelf ?? true;
|
||||
|
||||
RenderingDirectionResult? overrideIsSelfResult;
|
||||
if (widget.renderingDirectionCallback != null) {
|
||||
overrideIsSelfResult = widget.renderingDirectionCallback!(messageItem);
|
||||
}
|
||||
|
||||
bool isFromSelf = true;
|
||||
if (overrideIsSelfResult != null && overrideIsSelfResult.isSelf != null) {
|
||||
isFromSelf = overrideIsSelfResult.isSelf!;
|
||||
} else {
|
||||
isFromSelf = messageItem.isSelf ?? true;
|
||||
}
|
||||
|
||||
void clearJump() {
|
||||
Future.delayed(const Duration(milliseconds: 100), () {
|
||||
model.jumpMsgID = "";
|
||||
|
|
@ -456,7 +489,7 @@ class _TIMUIKItHistoryMessageListItemState extends TIMUIKitState<TIMUIKitHistory
|
|||
message: messageItem,
|
||||
soundElem: messageItem.soundElem!,
|
||||
msgID: messageItem.msgID ?? "",
|
||||
isFromSelf: messageItem.isSelf ?? true,
|
||||
isFromSelf: isFromSelf,
|
||||
clearJump: clearJump,
|
||||
isShowJump: isShowJump,
|
||||
localCustomInt: messageItem.localCustomInt,
|
||||
|
|
@ -501,7 +534,7 @@ class _TIMUIKItHistoryMessageListItemState extends TIMUIKitState<TIMUIKitHistory
|
|||
TIMUIKitTextElem(
|
||||
chatModel: model,
|
||||
message: messageItem,
|
||||
isFromSelf: messageItem.isSelf ?? true,
|
||||
isFromSelf: isFromSelf,
|
||||
clearJump: clearJump,
|
||||
isShowJump: isShowJump,
|
||||
borderRadius: widget.themeData?.messageBorderRadius,
|
||||
|
|
@ -542,7 +575,7 @@ class _TIMUIKItHistoryMessageListItemState extends TIMUIKitState<TIMUIKitHistory
|
|||
message: messageItem,
|
||||
messageID: messageItem.msgID,
|
||||
fileElem: messageItem.fileElem,
|
||||
isSelf: messageItem.isSelf ?? true,
|
||||
isSelf: isFromSelf,
|
||||
clearJump: clearJump,
|
||||
isShowJump: isShowJump,
|
||||
isShowMessageReaction: widget.isUseMessageReaction,
|
||||
|
|
@ -1149,7 +1182,21 @@ class _TIMUIKItHistoryMessageListItemState extends TIMUIKitState<TIMUIKitHistory
|
|||
final TUITheme theme = value.theme;
|
||||
final message = widget.message;
|
||||
final msgType = message.elemType;
|
||||
final isSelf = message.isSelf ?? true;
|
||||
|
||||
RenderingDirectionResult? renderingDirectionResult;
|
||||
if (widget.renderingDirectionCallback != null) {
|
||||
renderingDirectionResult = widget.renderingDirectionCallback!(message);
|
||||
}
|
||||
|
||||
bool isSelf = true;
|
||||
String? faceUrl = message.faceUrl;
|
||||
if (renderingDirectionResult != null && renderingDirectionResult.isSelf != null) {
|
||||
isSelf = renderingDirectionResult.isSelf!;
|
||||
faceUrl = renderingDirectionResult.userInfo?.faceUrl;
|
||||
} else {
|
||||
isSelf = message.isSelf ?? true;
|
||||
}
|
||||
|
||||
final isGroupTipsMsg = msgType == MessageElemType.V2TIM_ELEM_TYPE_GROUP_TIPS;
|
||||
|
||||
final revokeStatus = isRevokeMessage(message, model);
|
||||
|
|
@ -1323,7 +1370,8 @@ class _TIMUIKItHistoryMessageListItemState extends TIMUIKitState<TIMUIKitHistory
|
|||
width: 40,
|
||||
height: 40,
|
||||
child: Avatar(
|
||||
faceUrl: message.faceUrl ?? "",
|
||||
borderRadius: widget.themeData?.avatarBorderRadius,
|
||||
faceUrl: faceUrl ?? "",
|
||||
showName: MessageUtils.getDisplayName(message),
|
||||
),
|
||||
),
|
||||
|
|
@ -1414,7 +1462,7 @@ class _TIMUIKItHistoryMessageListItemState extends TIMUIKitState<TIMUIKitHistory
|
|||
TIMUIKitTextTranslationElem(
|
||||
message: message,
|
||||
customEmojiStickerList: widget.customEmojiStickerList,
|
||||
isFromSelf: message.isSelf ?? true,
|
||||
isFromSelf: isSelf,
|
||||
isShowJump: false,
|
||||
clearJump: () {},
|
||||
chatModel: model),
|
||||
|
|
@ -1443,7 +1491,9 @@ class _TIMUIKItHistoryMessageListItemState extends TIMUIKitState<TIMUIKitHistory
|
|||
}
|
||||
},
|
||||
child: Avatar(
|
||||
faceUrl: message.faceUrl ?? "", showName: MessageUtils.getDisplayName(message)),
|
||||
borderRadius: widget.themeData?.avatarBorderRadius,
|
||||
faceUrl: faceUrl ?? "",
|
||||
showName: MessageUtils.getDisplayName(message)),
|
||||
),
|
||||
),
|
||||
],
|
||||
|
|
|
|||
|
|
@ -188,7 +188,8 @@ class _TIMUIKitHistoryMessageListContainerState extends TIMUIKitState<TIMUIKitHi
|
|||
allowAtUserWhenReply: chatConfig.isAtWhenReply,
|
||||
allowAvatarTap: chatConfig.isAllowClickAvatar,
|
||||
allowLongPress: chatConfig.isAllowLongPressMessage,
|
||||
isUseMessageReaction: chatConfig.isUseMessageReaction);
|
||||
isUseMessageReaction: chatConfig.isUseMessageReaction,
|
||||
renderingDirectionCallback: widget.messageItemBuilder?.renderingDirectionCallback,);
|
||||
},
|
||||
tongueItemBuilder: widget.tongueItemBuilder,
|
||||
initFindingMsg: widget.initFindingMsg,
|
||||
|
|
|
|||
|
|
@ -77,11 +77,11 @@ class _TIMUIKitSoundElemState extends TIMUIKitState<TIMUIKitSoundElem> {
|
|||
} else {
|
||||
SoundPlayer.play(url: stateElement.url!);
|
||||
widget.chatModel.currentPlayedMsgId = widget.msgID;
|
||||
|
||||
setState(() {
|
||||
isPlaying = widget.chatModel.currentPlayedMsgId != '' && widget.chatModel.currentPlayedMsgId == widget.msgID;
|
||||
});
|
||||
}
|
||||
|
||||
setState(() {
|
||||
isPlaying = widget.chatModel.currentPlayedMsgId != '' && widget.chatModel.currentPlayedMsgId == widget.msgID;
|
||||
});
|
||||
}
|
||||
|
||||
downloadMessageDetailAndSave() async {
|
||||
|
|
@ -201,6 +201,9 @@ class _TIMUIKitSoundElemState extends TIMUIKitState<TIMUIKitSoundElem> {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
isPlaying = widget.chatModel.currentPlayedMsgId != '' && widget.chatModel.currentPlayedMsgId == widget.msgID;
|
||||
|
||||
return GestureDetector(
|
||||
onTap: () => _playSound(),
|
||||
child: Container(
|
||||
|
|
|
|||
|
|
@ -193,7 +193,7 @@ class _TIMUIKitTextElemState extends TIMUIKitState<TIMUIKitTextElem> {
|
|||
: (theme.chatMessageItemFromOthersBgColor);
|
||||
|
||||
final backgroundColor =
|
||||
isShowJumpState ? const Color.fromRGBO(245, 166, 35, 1) : (defaultStyle ?? widget.backgroundColor);
|
||||
isShowJumpState ? const Color.fromRGBO(245, 166, 35, 1) : (widget.backgroundColor ?? defaultStyle);
|
||||
|
||||
return Container(
|
||||
padding: widget.textPadding ?? EdgeInsets.all(isDesktopScreen ? 12 : 10),
|
||||
|
|
|
|||
|
|
@ -472,27 +472,35 @@ class _TIMUIKitTextFieldLayoutWideState extends TIMUIKitState<TIMUIKitTextFieldL
|
|||
try {
|
||||
final convID = widget.conversationID;
|
||||
final convType = widget.conversationType;
|
||||
FilePickerResult? result = await FilePicker.platform.pickFiles();
|
||||
_removeOverlay();
|
||||
if (result != null && result.files.isNotEmpty) {
|
||||
if (PlatformUtils().isWeb) {
|
||||
html.Node? inputElem;
|
||||
inputElem = html.document.getElementById("__file_picker_web-file-input")?.querySelector("input");
|
||||
fileName = result.files.single.name;
|
||||
|
||||
MessageUtils.handleMessageError(
|
||||
model.sendFileMessage(inputElement: inputElem, fileName: fileName, convID: convID, convType: convType),
|
||||
context);
|
||||
} else {
|
||||
if (PlatformUtils().isWeb) {
|
||||
final html.FileUploadInputElement uploadInput = html.FileUploadInputElement();
|
||||
uploadInput.accept = '*/*';
|
||||
uploadInput.click();
|
||||
_removeOverlay();
|
||||
uploadInput.onChange.listen((event) {
|
||||
final file = uploadInput.files?.first;
|
||||
if (file != null) {
|
||||
final fileName = file.name;
|
||||
MessageUtils.handleMessageError(
|
||||
model.sendFileMessage(inputElement: uploadInput, fileName: fileName, convID: convID, convType: convType),
|
||||
context);
|
||||
} else {
|
||||
throw TypeError();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
FilePickerResult? result = await FilePicker.platform.pickFiles();
|
||||
_removeOverlay();
|
||||
if (result != null && result.files.isNotEmpty) {
|
||||
File file = File(result.files.single.path!);
|
||||
final int size = file.lengthSync();
|
||||
final String savePath = file.path;
|
||||
|
||||
MessageUtils.handleMessageError(
|
||||
model.sendFileMessage(filePath: savePath, size: size, convID: convID, convType: convType), context);
|
||||
} else {
|
||||
throw TypeError();
|
||||
}
|
||||
} else {
|
||||
throw TypeError();
|
||||
}
|
||||
} catch (e) {
|
||||
// ignore: avoid_print
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import 'package:provider/provider.dart';
|
|||
import 'package:provider/single_child_widget.dart';
|
||||
import 'package:scroll_to_index/scroll_to_index.dart';
|
||||
import 'package:tencent_chat_i18n_tool/tencent_chat_i18n_tool.dart';
|
||||
import 'package:tencent_cloud_chat_sdk/enum/V2TimGroupListener.dart';
|
||||
import 'package:tencent_cloud_chat_sdk/models/v2_tim_conversation.dart'
|
||||
if (dart.library.html) 'package:tencent_cloud_chat_sdk/web/compatible_models/v2_tim_conversation.dart';
|
||||
import 'package:tencent_cloud_chat_sdk/models/v2_tim_group_application.dart'
|
||||
|
|
@ -234,6 +235,7 @@ class _TUIChatState extends TIMUIKitState<TIMUIKitChat> {
|
|||
bool isInit = false;
|
||||
final TUIChatGlobalModel chatGlobalModel = serviceLocator<TUIChatGlobalModel>();
|
||||
bool _dragging = false;
|
||||
V2TimGroupListener? _groupListener;
|
||||
|
||||
final GlobalKey alignKey = GlobalKey();
|
||||
final GlobalKey listContainerKey = GlobalKey();
|
||||
|
|
@ -256,6 +258,7 @@ class _TUIChatState extends TIMUIKitState<TIMUIKitChat> {
|
|||
if (kProfileMode) {
|
||||
Frame.init();
|
||||
}
|
||||
_addGroupListener();
|
||||
model.abstractMessageBuilder = widget.abstractMessageBuilder;
|
||||
model.onTapAvatar = widget.onTapAvatar;
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) async {
|
||||
|
|
@ -274,6 +277,7 @@ class _TUIChatState extends TIMUIKitState<TIMUIKitChat> {
|
|||
if (kProfileMode) {
|
||||
Frame.destroy();
|
||||
}
|
||||
_removeGroupListener();
|
||||
model.dispose();
|
||||
}
|
||||
|
||||
|
|
@ -308,6 +312,26 @@ class _TUIChatState extends TIMUIKitState<TIMUIKitChat> {
|
|||
}
|
||||
}
|
||||
|
||||
void _addGroupListener() {
|
||||
_groupListener = V2TimGroupListener(
|
||||
onGroupAttributeChanged: (
|
||||
String groupID,
|
||||
Map<String, String> groupAttributeMap,) {
|
||||
if (groupID == widget.conversationID) {
|
||||
_updateJoinInGroupCallWidget();
|
||||
}
|
||||
}
|
||||
);
|
||||
TencentImSDKPlugin.v2TIMManager.addGroupListener(listener: _groupListener!);
|
||||
}
|
||||
|
||||
void _removeGroupListener() {
|
||||
if (_groupListener != null) {
|
||||
TencentImSDKPlugin.v2TIMManager.removeGroupListener(listener: _groupListener!);
|
||||
_groupListener = null;
|
||||
}
|
||||
}
|
||||
|
||||
updateDraft() async {
|
||||
final isTopic = widget.conversation.conversationID.contains("@TOPIC#");
|
||||
if (isTopic) {
|
||||
|
|
|
|||
|
|
@ -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.0
|
||||
version: 5.0.1+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,14 +24,14 @@ dependencies:
|
|||
tencent_chat_i18n_tool: ^2.3.8
|
||||
adaptive_action_sheet: ^2.0.1
|
||||
provider: ^6.0.1
|
||||
intl: ^0.19.0
|
||||
intl: any
|
||||
get_it: ^7.2.0
|
||||
dotted_border: ^2.0.0+2
|
||||
flutter_svg: ^2.0.6
|
||||
image_picker: ^0.8.9
|
||||
file_picker: ^9.0.2
|
||||
tencent_super_tooltip: ^0.0.1
|
||||
better_player_plus: '>=1.0.4 <=1.0.5'
|
||||
better_player_plus: ^1.0.8
|
||||
video_player: ^2.9.2
|
||||
chewie: '>=1.8.4 <=1.8.5'
|
||||
flutter_slidable_plus_plus: ^0.1.0
|
||||
|
|
|
|||
Loading…
Reference in New Issue