getSongsById method

Future<List<SongInfo>> getSongsById({
  1. required List<String> ids,
  2. SongSortType sortType = SongSortType.DEFAULT,
})

This method fetch songs by Id. To return data sorted in the same order that ids appears on ids list parameter use sortType param with SongSortType.CURRENT_IDs_ORDER value.

ids List of IDs. sortType Data sort Type.

Implementation

Future<List<SongInfo>> getSongsById(
    {required List<String> ids,
    SongSortType sortType = SongSortType.DEFAULT}) async {
  List<dynamic> dataList = await channel.invokeMethod("getSongsById", {
    SOURCE_KEY: SOURCE_SONGS,
    SORT_TYPE: sortType.index,
    'song_ids': ids,
  });
  return _parseSongDataList(dataList);
}