getUploadStatus method

  1. @override
Future<UploadProgress?> getUploadStatus(
  1. String uploadId
)
override

Get the current status of an upload.

Implementation

@override
Future<UploadProgress?> getUploadStatus(String uploadId) async {
  try {
    final result = await methodChannel.invokeMethod<Map>(
      'getUploadStatus',
      {'uploadId': uploadId},
    );
    if (result != null) {
      return UploadProgress.fromMap(Map<String, dynamic>.from(result));
    }
    return null;
  } on PlatformException catch (e) {
    debugPrint('Failed to get upload status: ${e.message}');
    return null;
  }
}