TencentCloudChatMessageController class
Controller for the TencentCloudChatMessage component, enabling a range of custom message operations. The currently supported methods are listed below. For specific usage, please refer to the comments on each controller method.
- updateMessages: Updates the message widgets.
- mentionGroupMembers: Allows for mentioning users within a group.
- setMessageTextWithMentions: Sets the text message in the input area, with the ability to mention users.
- scrollToBottom: Enables automatic scrolling to the bottom of the message list.
- scrollToSpecificMessage: Enables scrolling to a specific message in the list.
- sendMessage: Allows for sending a message and automatically adds it to the message list UI.
- Inheritance
-
- Object
- ChangeNotifier
- TencentCloudChatComponentBaseController
- TencentCloudChatMessageController
Properties
- eventName ↔ EventName?
-
getter/setter pair
- eventValue ↔ String?
-
getter/setter pair
- groupID ↔ String?
-
getter/setter pair
-
groupMembersFullInfo
↔ List<
V2TimGroupMemberFullInfo> ? -
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasListeners → bool
-
Whether any listeners are currently registered.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- topicID ↔ String?
-
getter/setter pair
- userID ↔ String?
-
getter/setter pair
Methods
-
addListener(
VoidCallback listener) → void -
Register a closure to be called when the object changes.
inherited
-
dispose(
) → void -
Discards any resources used by the object. After this is called, the
object is not in a usable state and should be discarded (calls to
addListener will throw after the object is disposed).
inherited
-
mentionGroupMembers(
{required List< V2TimGroupMemberFullInfo> groupMembers, String? user, String? group, String? topicID}) → void -
Mentions users within a group.
Accepts a list of
V2TimGroupMemberFullInfo
objects representing the group members to mention. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notifyListeners(
) → void -
Call all the registered listeners.
inherited
-
removeListener(
VoidCallback listener) → void -
Remove a previously registered closure from the list of closures that are
notified when the object changes.
inherited
-
scrollToBottom(
{String? userID, String? groupID, String? topicID}) → void -
Scrolls the message list to the bottom for the specified conversation.
The
userID
andgroupID
parameters identify the target conversation. -
scrollToSpecificMessage(
{String? userID, String? groupID, String? topicID, String? msgID}) → void -
Scrolls the message list to a specific message in the specified conversation.
The
userID
andgroupID
parameters identify the target conversation. ThemsgID
parameter identifies the target message. -
sendMessage(
{required V2TimMsgCreateInfoResult createdMessage, String? groupID, String? userID, String? topicID, V2TimMessage? repliedMessage, V2TimGroupInfo? groupInfo, OfflinePushInfo? offlinePushInfo, bool? needReadReceipt, TencentCloudChatMessageConfig? config, BeforeMessageSending? beforeMessageSendingHook, bool? isResend = false}) → Future< V2TimValueCallback< V2TimMessage> ?> -
Sends a message and adds it to the message list UI.
Before sending, use the Chat SDK create message method to create a message instance,
and pass the created instance through the
createdMessage
parameter. TherepliedMessage
parameter indicates whether this message is a reply to a previous message. Other parameters are used to configure the offline push configuration for the recipient, whether a read receipt is needed, and other features. TheuserID
,groupID
andtopicID
parameters identify the target conversation. -
setDraft(
String conversationID, String draft) → void -
setMessageTextWithMentions(
{List< V2TimGroupMemberFullInfo> ? groupMembersToMention, String? messageText, String? user, String? group, String? topicID}) → void -
Sets the text message in the message input area, replacing the current editing content,
with an optional list of
V2TimGroupMemberFullInfo
objects representing the group members to be mentioned. If no group members are provided, the method will simply set the message text. -
toString(
) → String -
A string representation of this object.
inherited
-
updateMessages(
{required List< V2TimMessage> messages}) → void - Updates the message widgets, causing them to re-render in the widget tree.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited