searchSongs static method
Implementation
static Future<List<Song>> searchSongs({
String? query,
String? artistId,
required int limit,
required int page,
}) async {
final jsonString = await _channel.invokeMethod<String>('searchSongs', {
if (query != null) 'query': query,
if (artistId != null) 'artistId': artistId,
'limit': limit,
'page': page,
});
if (jsonString == null) {
throw PlatformException(code: 'NULL_RESPONSE');
}
final jsonObject = json.decode(jsonString) as List<dynamic>;
return jsonObject.map(Song.fromJson).toList(growable: false);
}