searchAlbums method

Future<List<AlbumDetailed>> searchAlbums(
  1. String query
)

Performs a search specifically for albums with the given query and returns a list of album details.

Implementation

Future<List<AlbumDetailed>> searchAlbums(String query) async {
  final searchData = await constructRequest(
    "search",
    body: {
      "query": query,
      "params": "Eg-KAQwIABAAGAEgACgAMABqChAEEAMQCRAFEAo%3D"
    },
  );

  return traverseList(searchData, ["musicResponsiveListItemRenderer"])
      .map(AlbumParser.parseSearchResult)
      .toList();
}