editArtwork method
Used to edit audio artwork.
Parameters:
data
is used to find multiples audios data.openFilePicker
is used to define if folder picker will be open to user choose image.imagePath
is used to define image path, only necessary ifopenFilePicker
is false.format
is used to define image type:PNG
orJPEG
.size
is used to define image quality.description
is used to define artwork description.searchInsideFolders
is used for find specific audio data inside the folders. (Only required when using Android 10 or above)
Important:
- This method will always return a bool.
- If return true edit works, else edit found a problem.
- If
openFilePicker
is null, will be set totrue
. - If
imagePath
is null,openFilePicker
need to be true. - If
format
is null, will be set toJPEG
. - If
size
is null, will be set to24
. - If
description
is null, will be set to"artwork"
.
Implementation
Future<bool> editArtwork(
String data, {
bool? openFilePicker,
String? imagePath,
ArtworkFormat? format,
int? size,
String? description,
bool? searchInsideFolders,
}) async {
assert(
openFilePicker == false || imagePath == null,
"Cannot change artwork image without image.\n"
"Set [openFilePicker] to true or give [imagePath] a correct path");
final bool resultEditArt = await _channel.invokeMethod("editArtwork", {
"data": data,
"type": format != null ? format.index : ArtworkFormat.JPEG.index,
"size": size ?? 24,
"description": description ?? "artwork",
"openFilePicker": openFilePicker ?? true,
"imagePath": imagePath,
"searchInsideFolders": searchInsideFolders ?? false,
});
return resultEditArt;
}