dependencies:tencent_cloud_chat_message: 最新版本
import 'package:tencent_cloud_chat_intl/localizations/tencent_cloud_chat_localizations.dart';
MaterialApp
或 GetMaterialApp
等第三方包提供的其他条目中,这里以 GetMaterialApp
为例:GetMaterialApp(localizationsDelegates: const [/// 您原先的配置GlobalMaterialLocalizations.delegate,/// 添加此行...TencentCloudChatLocalizations.localizationsDelegates,],supportedLocales: [/// 您原先的配置...S.delegate.supportedLocales,/// 添加此行...TencentCloudChatLocalizations.supportedLocales,],/// 其他配置)
import 'package:tencent_cloud_chat/components/component_config/tencent_cloud_chat_message_common_defines.dart';import 'package:tencent_cloud_chat/components/component_config/tencent_cloud_chat_message_config.dart';import 'package:tencent_cloud_chat/models/tencent_cloud_chat_models.dart';import 'package:tencent_cloud_chat/tencent_cloud_chat.dart';import 'package:tencent_cloud_chat_message/tencent_cloud_chat_message.dart';await TencentCloudChat.controller.initUIKit(options: TencentCloudChatInitOptions(sdkAppID: 'SDKAPPID', // 您的SDKAPPIDuserID: 'userID', // 您的userIDuserSig: 'userSig', // 您的UserSig),components: TencentCloudChatInitComponentsRelated(usedComponentsRegister: [TencentCloudChatMessageManager.register], // 注册聊天组件componentConfigs: TencentCloudChatComponentConfigs(messageConfig: TencentCloudChatMessageConfig(// 以下代码中的配置为建议配置。showMessageSenderName: ({groupID, topicID, userID}) => true,showSelfAvatar: ({groupID, topicID, userID}) => true,defaultMessageMenuConfig: ({groupID, topicID, userID}) =>TencentCloudChatMessageDefaultMessageMenuConfig(enableMessageForward: false,enableMessageSelect: false,),),),),plugins: [],);
plugins: [TencentCloudChatPluginItem(name: "sticker",initData: TencentCloudChatStickerInitData(useDefaultSticker: true, // 默认表情,仅此表情包可与TUIRoomKit其他端互通。useDefaultCustomFace_4350: false, // 如您无需使用其他端TUIRoomKit,可启用下列表情包。useDefaultCustomFace_4351: false,useDefaultCustomFace_4352: false,userID: 'userId', // 您的userId).toJson(),pluginInstance: TencentCloudChatStickerPlugin(context: context,),),],
Navigator.push(context,MaterialPageRoute(builder: (context) => ConferenceMainPage( // 会议主界面chatWidget: TencentCloudChatMessage(options: TencentCloudChatMessageOptions(groupID: 'yourConferenceId'), //您的ConferenceId),),),);
本页内容是否解决了您的问题?