getThumbnail static method

Future<List<int>> getThumbnail({
  1. required String mediumId,
  2. MediumType? mediumType,
  3. int? width,
  4. int? height,
  5. bool? highQuality = false,
})

Get medium thumbnail by medium id

Implementation

static Future<List<int>> getThumbnail({
  required String mediumId,
  MediumType? mediumType,
  int? width,
  int? height,
  bool? highQuality = false,
}) async {
  final bytes = await _channel.invokeMethod('getThumbnail', {
    'mediumId': mediumId,
    'mediumType': mediumTypeToJson(mediumType),
    'width': width,
    'height': height,
    'highQuality': highQuality,
  });
  if (bytes == null) throw "Failed to fetch thumbnail of medium $mediumId";
  return new List<int>.from(bytes);
}