queryGenres method

  1. @override
Future<List<GenreModel>> queryGenres({
  1. GenreSortType? sortType,
  2. OrderType? orderType,
  3. UriType? uriType,
  4. bool? ignoreCase,
})
override

Used to return Genres Info based in GenreModel.

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 in EXTERNAL or INTERNAL storage.
  • ignoreCase is used to define if sort will ignore the lowercase or not.

Important:

  • If orderType is null, will be set to ASC_OR_SMALLER.
  • If sortType is null, will be set to GenreName.
  • If uriType is null, will be set to EXTERNAL.

Platforms:

Android IOS Web
✔️ ✔️ ✔️

See more about platforms support

Implementation

@override
Future<List<GenreModel>> queryGenres({
  GenreSortType? sortType,
  OrderType? orderType,
  UriType? uriType,
  bool? ignoreCase,
}) async {
  final List<dynamic> resultGenres = await _channel.invokeMethod(
    "queryGenres",
    {
      "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 resultGenres.map((genreInfo) => GenreModel(genreInfo)).toList();
}