getRingtones method
invokes the getRingtones method on the native platform, which returns a list of hashmaps that get converted to Ringtone objects containing platform ringtone sounds.
Implementation
@override
Future<List<Ringtone>?> getRingtones() async {
var ringtones = await methodChannel.invokeMethod<List>('getRingtones');
ringtones = ringtones?.map((ringtone) => Map<String, dynamic>.from(ringtone)).toList();
return ringtones?.map((map) => Ringtone.fromJson(map)).toList();
}