queryArtists method
Future<List<ArtistModel> >
queryArtists([
- ArtistSortType? sortType,
- OrderType? orderType,
- UriType? uriType,
- bool? requestPermission,
Used to return Artists Info based in ArtistModel.
Parameters:
requestPermission
is used for request or no Android STORAGE PERMISSION.orderType
is used to define if order will be Ascending or Descending.sortType
is used to define list sort.uriType
is used to define if songs will be catch inEXTERNAL
orINTERNAL
storage.
Important:
- If
requestPermission
is null, will be set tofalse
. - If
orderType
is null, will be set toASC_OR_SMALLER
. - If
sortType
is null, will be set toArtistName
. - If
uriType
is null, will be set toEXTERNAL
. - Mp3 only support one image, artist image don't exist.
Implementation
Future<List<ArtistModel>> queryArtists([
ArtistSortType? sortType,
OrderType? orderType,
UriType? uriType,
bool? requestPermission,
]) async {
final List<dynamic> resultArtists =
await _channel.invokeMethod("queryArtists", {
"requestPermission": _checkPermission(requestPermission),
"sortType":
sortType != null ? sortType.index : ArtistSortType.DEFAULT.index,
"orderType": _checkOrder(orderType),
"uri": uriType != null ? uriType.index : UriType.EXTERNAL.index
});
return resultArtists.map((artistInfo) => ArtistModel(artistInfo)).toList();
}