searchPlaylists method
Searches for playlists matching the given query.
query: The search query string.market: An optional market (country code) to filter results.offset: The index of the first result to return.limit: The maximum number of results to return.
Returns a list of SimplifiedPlaylist objects.
Implementation
Future<List<SimplifiedPlaylist>> searchPlaylists(
String query, {
String? market,
int offset = 0,
int limit = 20,
}) async {
// Perform a search with the specified type (playlist)
final results = await search(
query,
type: [SearchType.playlist],
market: market,
offset: offset,
limit: limit,
);
// Filter the results to only include playlists
return results.whereType<SimplifiedPlaylist>().toList();
}