querySongs method Null safety

Future<List<SongModel>> querySongs(
  1. {SongSortType? sortType,
  2. OrderType? orderType,
  3. UriType? uriType,
  4. bool? ignoreCase,
  5. String? path}

Used to return Songs Info based in SongModel.


  • 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.
  • path is used to define where the songs will be 'queried'.


  • If orderType is null, will be set to ASC_OR_SMALLER.
  • If sortType is null, will be set to DEFAULT.
  • If uriType is null, will be set to EXTERNAL.
  • If ignoreCase is null, will be set to true.
  • If path is null, will be set to the default platform path.



See more about platforms support


Future<List<SongModel>> querySongs({
  SongSortType? sortType,
  OrderType? orderType,
  UriType? uriType,
  bool? ignoreCase,
  String? path,
}) async {
  return platform.querySongs(
    sortType: sortType,
    orderType: orderType,
    uriType: uriType,
    ignoreCase: ignoreCase,
    path: path,