getAlbumThumbnail static method

Future<List<int>> getAlbumThumbnail({
  1. required String albumId,
  2. MediumType? mediumType,
  3. bool newest = true,
  4. int? width,
  5. int? height,
  6. bool? highQuality = false,
})

Get album thumbnail by album id mediumType: the type of medium newest: whether to get the newest medium or oldest medium as album thumbnail width: the width of thumbnail height: the height of thumbnail highQuality: whether to use high quality of album thumbnail

Implementation

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