fetchLyrics method

  1. @override
Future<Map<String, dynamic>> fetchLyrics({
  1. required String title,
  2. required String artist,
  3. int? duration,
})
override

Fetch lyrics for a song by title and artist

Implementation

@override
Future<Map<String, dynamic>> fetchLyrics({
  required String title,
  required String artist,
  int? duration,
}) async {
  final result = await methodChannel.invokeMethod(
    'getLyrics',
    {
      'title': title.trim(),
      'artist': artist.trim(),
      'duration': duration ?? -1,
    },
  );

  return (result as Map).cast<String, dynamic>();
}