sendImageMessage method
Sends an image message to a chat.
chatId
: The ID of the chat where the message will be sent.
image
: The image data to send.
Implementation
@override
Future<void> sendImageMessage({
required String chatId,
required Uint8List image,
}) async {
var ref = _storage
.ref('${_options.chatsCollectionName}/$chatId/${const Uuid().v4()}');
return ref.putData(image).then(
(_) => ref.getDownloadURL().then(
(url) {
_sendMessage(
chatId,
{
'image_url': url,
},
);
},
),
);
}