dependencies:tencent_cloud_chat_message: latest version
import 'package:tencent_cloud_chat_intl/localizations/tencent_cloud_chat_localizations.dart';
MaterialApp
or GetMaterialApp
. Here, GetMaterialApp
is used as an example:GetMaterialApp(localizationsDelegates: const [/// Your original configurationGlobalMaterialLocalizations.delegate,/// Add this line...TencentCloudChatLocalizations.localizationsDelegates,],supportedLocales: [/// Your original configuration...S.delegate.supportedLocales,/// Add this line...TencentCloudChatLocalizations.supportedLocales,],/// Other settings)
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', // Your SDKAPPIDuserID: 'userID', // Your userIDuserSig: 'userSig', // Your userSig),components: TencentCloudChatInitComponentsRelated(usedComponentsRegister: [TencentCloudChatMessageManager.register], // Register chat componentscomponentConfigs: TencentCloudChatComponentConfigs(messageConfig: TencentCloudChatMessageConfig(// The following configuration is recommended.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, // Default stickers, only this sticker pack can interoperate with TUIRoomKit from other platforms.useDefaultCustomFace_4350: false, // If you do not need to use TUIRoomKit from other platforms, you can enable the following emoji pack.useDefaultCustomFace_4351: false,useDefaultCustomFace_4352: false,userID: 'userId', // Your userId).toJson(),pluginInstance: TencentCloudChatStickerPlugin(context: context,),),],
chatWidget
into the conference page, ConferenceMainPage
. After passing it in, the chat button will display in the bottom toolbar. Clicking the chat button will automatically navigate to chatWidget
.Navigator.push(context,MaterialPageRoute(builder: (context) => ConferenceMainPage( // Conference main pagechatWidget: TencentCloudChatMessage(options: TencentCloudChatMessageOptions(groupID: 'yourConferenceId'), // Your Confere),),),);
Was this page helpful?