queryArtwork method
Future<Uint8List?>
queryArtwork(
- int id,
- ArtworkType type, {
- ArtworkFormat? format,
- int? size,
- int? quality,
Used to return Songs Artwork.
Parameters:
typeis used to define if artwork is from audios or albums.formatis used to define typePNGorJPEG.sizeis used to define image quality.
Usage and Performance:
- Using
PNGwill return a better image quality but a slow performance. - Using Size greater than 200 probably won't make difference in quality but will cause a slow performance.
Important:
- This method is only necessary for API >= 29
Android Q/10. - If queryArtwork is called in Android below Q/10, will return null.
- If
formatis null, will be set toJPEGfor better performance. - If
sizeis null, will be set to200for better performance - We need this method separated from
querySongs/queryAudiosbecause return Uint8List and using inside query causes a slow performance.
Platforms:
| Android | IOS | Web |
|---|---|---|
✔️ |
✔️ |
✔️ |
See more about platforms support
Implementation
Future<Uint8List?> queryArtwork(
int id,
ArtworkType type, {
ArtworkFormat? format,
int? size,
int? quality,
}) async {
return platform.queryArtwork(
id,
type,
format: format,
size: size,
quality: quality,
);
}