getFile static method

Future<File> getFile({
  1. required String mediumId,
  2. MediumType? mediumType,
  3. String? mimeType,
})

get medium file by medium id mediumType: the type of medium mimeType: the mime type of medium

Implementation

static Future<File> getFile({
  required String mediumId,
  MediumType? mediumType,
  String? mimeType,
}) async {
  final path = await _channel.invokeMethod('getFile', {
    'mediumId': mediumId,
    'mediumType': mediumTypeToJson(mediumType),
    'mimeType': mimeType,
  }) as String?;
  if (path == null) throw "Cannot get file $mediumId with type $mimeType";
  return File(path);
}