queryAlbums method
Future<List<AlbumModel> >
queryAlbums({
- AlbumSortType? sortType,
- OrderType? orderType,
- UriType? uriType,
- bool? ignoreCase,
override
Used to return Albums Info based in AlbumModel.
Parameters:
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.ignoreCase
is used to define if sort will ignore the lowercase or not.
Important:
- If
orderType
is null, will be set toASC_OR_SMALLER
. - If
sortType
is null, will be set toAlbumName
. - If
uriType
is null, will be set toEXTERNAL
. - If
ignoreCase
is null, will be set totrue
.
Platforms:
Android | IOS | Web |
---|---|---|
✔️ |
✔️ |
✔️ |
See more about platforms support
Implementation
@override
Future<List<AlbumModel>> queryAlbums({
AlbumSortType? sortType,
OrderType? orderType,
UriType? uriType,
bool? ignoreCase,
}) async {
final List<dynamic> resultAlbums = await _channel.invokeMethod(
"queryAlbums",
{
"sortType": sortType?.index,
"orderType": orderType != null
? orderType.index
: OrderType.ASC_OR_SMALLER.index,
"uri": uriType != null ? uriType.index : UriType.EXTERNAL.index,
"ignoreCase": ignoreCase ?? true,
},
);
return resultAlbums.map((albumInfo) => AlbumModel(albumInfo)).toList();
}