/ SDKs / Flutter
SDKs
Chat SDKs Flutter v4
Chat SDKs Flutter
Chat SDKs
Flutter
Version 4

Track file upload progress using a handler

Copy link

If needed, you can track the file upload progress by passing the function as an argument to a parameter when calling the sendFileMessage() method.

try {
  final message = channel.sendFileMessage(
    params,
    handler: (message, e) {
      // A file message has been successfully sent.
    },
    progressHandler: (sentBytes, totalBytes) {
      // You can view how much of the file has been uploaded to the server.
    },
  );
} catch (e) {
  // Handle error.
}