Skip to main content

Put Multimedia

The LikeMinds Flutter Chat SDK provides the Put Multimedia feature, allowing you to attach multimedia files to your conversations effortlessly. By utilizing this feature, you can enrich your conversations with various types of media, such as images, videos, documents, and more.

Steps to Put Multimedia in a Conversation

  1. Create an object of the PutMultimediaRequest class, using the PutMultimediaRequestBuilder class.

    note

    Upload your file to your chosen provider, and use the URL of the uploaded file in the request.

  2. For putting multimedia in a chatroom call putMultimedia() present in LMChatClient class using your request object.

  3. Process the response (LMResponse<PutMultimediaResponse>) as per your requirement.

PutMultimediaRequest request = (PutMultimediaRequestBuilder()
..conversationId(237890)
..url("path/to/file")
..index(1)
..type("image")
..meta(meta))
.build();

LMResponse<PutMultimediaResponse> response =
await lmChatClient.putMultimedia(request);

if (response.success) {
// your function to process the response data
processResponse(response);
} else {
// your function to process error message
processError(response);
}

Models

PutMultimediaRequest

List of parameters for the PutMultimediaRequest class

VariableTypeDescriptionOptional
conversationIdintConversation Id
urlStringURL of the multimedia
heightintHeight of the multimedia
widthintWidth of the multimedia
filesCountintCount of attachments
indexintIndex of the multimedia
typeStringType of the multimedia
metaMap<String, dynamic>?Meta data of the multimedia✔️

PutMultimediaResponse

List of parameters for the PutMultimediaResponse class

VariableTypeDescriptionOptional
successboolAPI success status
errorMessageString?Error message in case of failure✔️
datadynamicData object of the response✔️