/ SDKs / Flutter
SDKs
Chat SDKs Flutter v3
Chat SDKs Flutter
Chat SDKs
Flutter
Version 3
Sendbird Chat SDK v3 for Flutter is no longer supported as a new version is released. Check out our latest Chat SDK v4

Copy a message

Copy link

A user can copy and send their own message in the same channel or to another channel. Both user messages and file messages can be copied using the copyMessage() method.

try {
    final preMessage = channel.copyMessage(MESSAGE_TO_COPY, TARGET_CHANNEL, onCompleted: (msg, error) {
        // MESSAGE_TO_COPY can be either UserMessage or FileMessage.
        // The message is successfully copied to the target channel.
    });
} catch (e) {
    // Handle error.
}

List of parameters

Copy link
Parameter nameTypeDescription

message

BaseMessage

Specifies a type of message to copy. Acceptable values are UserMessage or FileMessage.

targetChannel

BaseChannel

Specifies a target channel to send a copied message to.

onCompleted

Function(BaseMessage, error)

Specifies the callback handler to receive the response from Sendbird server for a message copy request.