tencent_cloud_chat_uikit source code update to version 4.0.6

This commit is contained in:
vinsonswang 2025-04-25 11:44:46 +08:00
parent be9c53aa25
commit 744204bb3a
5 changed files with 50 additions and 47 deletions

View File

@ -1,3 +1,7 @@
# 4.0.6
* Solve the updateSelfInfo exception problem.
* The success of calling the initSDK interface is determined by the code of the return value. Avoid inaccurate judgment when calling the interface multiple times.
# 4.0.5 # 4.0.5
* Upgrade tencent_cloud_chat_sdk to the minimum version 8.5.6864+6. * Upgrade tencent_cloud_chat_sdk to the minimum version 8.5.6864+6.
* Changed the SDK interface call from getConversationListByConversaionIds to getConversationListByConversationIds. * Changed the SDK interface call from getConversationListByConversaionIds to getConversationListByConversationIds.
@ -19,12 +23,11 @@
# 4.0.1 # 4.0.1
* Upgraded the plugin tim_ui_kit_sticker_plugin to 4.0.1. * Upgraded the plugin tim_ui_kit_sticker_plugin to 4.0.1.
* Use the 'useTencentCloudChatStickerPackageOldKeys' parameter in StickerPanelConfig to control whether the emoticon is compatible with version 3.x. * Add the 'useTencentCloudChatStickerPackageOldKeys' parameter in StickerPanelConfig to control whether the emoticon is compatible with version 3.x.
# 4.0.0 # 4.0.0
## Breaking changes ## Breaking changes
* Upgraded the plugin tim_ui_kit_sticker_plugin to 4.0.0. * Upgraded the plugin tim_ui_kit_sticker_plugin to 4.0.0.
* Delete the useQQStickerPackage and unicodeEmojiList parameters in StickerPanelConfig.
* Delete the isUseDefaultEmoji parameter in TIMUIKitChatConfig. * Delete the isUseDefaultEmoji parameter in TIMUIKitChatConfig.
* Delete the isUseDefaultEmoji parameter in each widget. * Delete the isUseDefaultEmoji parameter in each widget.

View File

@ -220,50 +220,41 @@ class TUIProfileViewModel extends ChangeNotifier {
return res; return res;
} }
updateUserInfo(String key, dynamic value) { updateUserInfo(V2TimUserFullInfo userFullInfo) {
if (key == "nickName") { if (userFullInfo.nickName != null) {
_userProfile?.friendInfo!.userProfile?.nickName = value; _userProfile?.friendInfo!.userProfile?.nickName = userFullInfo.nickName;
} }
if (key == "faceUrl") { if (userFullInfo.faceUrl != null) {
_userProfile?.friendInfo!.userProfile?.faceUrl = value; _userProfile?.friendInfo!.userProfile?.faceUrl = userFullInfo.faceUrl;
} }
if (key == "nickName") { if (userFullInfo.selfSignature != null) {
_userProfile?.friendInfo!.userProfile?.nickName = value; _userProfile?.friendInfo!.userProfile?.selfSignature = userFullInfo.selfSignature;
} }
if (key == "selfSignature") { if (userFullInfo.gender != null) {
_userProfile?.friendInfo!.userProfile?.selfSignature = value; _userProfile?.friendInfo!.userProfile?.gender = userFullInfo.gender;
} }
if (key == "gender") { if (userFullInfo.allowType != null) {
_userProfile?.friendInfo!.userProfile?.gender = value; _userProfile?.friendInfo!.userProfile?.allowType = userFullInfo.allowType;
} }
if (key == "allowType") { if (userFullInfo.customInfo != null) {
_userProfile?.friendInfo!.userProfile?.allowType = value; _userProfile?.friendInfo!.userProfile?.customInfo = userFullInfo.customInfo;
} }
if (key == "customInfo") { if (userFullInfo.role != null) {
_userProfile?.friendInfo!.userProfile?.customInfo = value; _userProfile?.friendInfo!.userProfile?.role = userFullInfo.role;
} }
if (key == "role") { if (userFullInfo.level != null) {
_userProfile?.friendInfo!.userProfile?.role = value; _userProfile?.friendInfo!.userProfile?.level = userFullInfo.level;
} }
if (key == "level") { if (userFullInfo.birthday != null) {
_userProfile?.friendInfo!.userProfile?.level = value; _userProfile?.friendInfo!.userProfile?.birthday = userFullInfo.birthday;
}
if (key == "birthday") {
_userProfile?.friendInfo!.userProfile?.birthday = value;
} }
} }
Future<V2TimCallback> updateSelfInfo(Map<String, dynamic> newSelfInfo) async { Future<V2TimCallback> updateSelfInfo(V2TimUserFullInfo userFullInfo) async {
final res = await _coreServices.setSelfInfo( final res = await _coreServices.setSelfInfo(userFullInfo: userFullInfo);
userFullInfo: V2TimUserFullInfo.fromJson(
newSelfInfo,
),
);
if (res.code == 0) { if (res.code == 0) {
newSelfInfo.forEach((key, value) { updateUserInfo(userFullInfo);
updateUserInfo(key, value);
});
notifyListeners(); notifyListeners();
} }

View File

@ -148,7 +148,11 @@ class CoreServicesImpl implements CoreServices {
_loginInfo = info; _loginInfo = info;
}, },
onUserSigExpired: listener.onUserSigExpired)); onUserSigExpired: listener.onUserSigExpired));
return result.data; if (result.code == 0) {
return true;
} else {
return false;
}
} }
/// This method is used for init the TUIKit after you initialized the IM SDK from Native SDK. /// This method is used for init the TUIKit after you initialized the IM SDK from Native SDK.

View File

@ -1,6 +1,7 @@
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:tencent_cloud_chat_sdk/models/v2_tim_callback.dart'; import 'package:tencent_cloud_chat_sdk/models/v2_tim_callback.dart';
import 'package:tencent_cloud_chat_sdk/models/v2_tim_friend_operation_result.dart'; import 'package:tencent_cloud_chat_sdk/models/v2_tim_friend_operation_result.dart';
import 'package:tencent_cloud_chat_sdk/models/v2_tim_user_full_info.dart';
import 'package:tencent_cloud_chat_uikit/business_logic/separate_models/tui_profile_view_model.dart'; import 'package:tencent_cloud_chat_uikit/business_logic/separate_models/tui_profile_view_model.dart';
import 'package:tencent_cloud_chat_uikit/ui/widgets/text_input_bottom_sheet.dart'; import 'package:tencent_cloud_chat_uikit/ui/widgets/text_input_bottom_sheet.dart';
@ -84,28 +85,33 @@ class TIMUIKitProfileController {
} }
Future<V2TimCallback> updateSelfSignature(String selfSignature) { Future<V2TimCallback> updateSelfSignature(String selfSignature) {
Map<String, dynamic> infoMap = {"selfSignature": selfSignature}; V2TimUserFullInfo userFullInfo = V2TimUserFullInfo();
return model.updateSelfInfo(infoMap); userFullInfo.selfSignature = selfSignature;
return model.updateSelfInfo(userFullInfo);
} }
Future<V2TimCallback> updateNickName(String nickName) { Future<V2TimCallback> updateNickName(String nickName) {
Map<String, dynamic> infoMap = {"nickName": nickName}; V2TimUserFullInfo userFullInfo = V2TimUserFullInfo();
return model.updateSelfInfo(infoMap); userFullInfo.nickName = nickName;
return model.updateSelfInfo(userFullInfo);
} }
/// 1 2 /// 1 2
Future<V2TimCallback> updateGender(int gender) { Future<V2TimCallback> updateGender(int gender) {
Map<String, dynamic> infoMap = {"gender": gender}; V2TimUserFullInfo userFullInfo = V2TimUserFullInfo();
return model.updateSelfInfo(infoMap); userFullInfo.gender = gender;
return model.updateSelfInfo(userFullInfo);
} }
Future<V2TimCallback> updateBirthday(int birthday) { Future<V2TimCallback> updateBirthday(int birthday) {
Map<String, dynamic> infoMap = {"birthday": birthday}; V2TimUserFullInfo userFullInfo = V2TimUserFullInfo();
return model.updateSelfInfo(infoMap); userFullInfo.birthday = birthday;
return model.updateSelfInfo(userFullInfo);
} }
Future<V2TimCallback> updateAvatar(String url) { Future<V2TimCallback> updateAvatar(String url) {
Map<String, dynamic> infoMap = {"faceUrl" : url}; V2TimUserFullInfo userFullInfo = V2TimUserFullInfo();
return model.updateSelfInfo(infoMap); userFullInfo.faceUrl = url;
return model.updateSelfInfo(userFullInfo);
} }
} }

View File

@ -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: 4.0.5 version: 4.0.6
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
@ -28,7 +28,7 @@ dependencies:
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
image_picker: ^0.8.5+3 image_picker: ^0.8.9
file_picker: ^5.3.0 file_picker: ^5.3.0
tencent_super_tooltip: ^0.0.1 tencent_super_tooltip: ^0.0.1
better_player_plus: '>=1.0.4 <=1.0.5' better_player_plus: '>=1.0.4 <=1.0.5'
@ -45,7 +45,6 @@ dependencies:
shared_preferences: ^2.0.13 shared_preferences: ^2.0.13
scroll_to_index: ^2.1.1 scroll_to_index: ^2.1.1
wechat_assets_picker: ^9.3.3 wechat_assets_picker: ^9.3.3
wechat_camera_picker: ^4.3.4
flutter_easyrefresh: ^2.2.1 flutter_easyrefresh: ^2.2.1
extended_image: ^9.0.0 extended_image: ^9.0.0
extended_text_field: ^16.0.0 extended_text_field: ^16.0.0