getMediaPath method

Future<String?> getMediaPath(
  1. String messageId
)

Returns the local file path for a media message, or null if the binary hasn't been downloaded yet.

Use this to display images/videos in the UI:

final path = await client.getMediaPath(msg.messageId);
if (path != null) {
  // Display the image/video
  Image.file(File(path));
} else {
  // Show thumbnail + download button
}

Implementation

Future<String?> getMediaPath(String messageId) async {
  return _mediaStorage.getMediaPath(messageId);
}