ttsGetAvailableVoices method
Get the list of available TTS voices on the platform.
Implementation
@override
Future<List<ReaderTTSVoice>> ttsGetAvailableVoices() async {
final voicesStr = await methodChannel.invokeMethod<List<dynamic>>('ttsGetAvailableVoices');
final voices =
voicesStr
?.cast<String>()
.map<Map<String, dynamic>>((str) => json.decode(str) as Map<String, dynamic>)
.map<ReaderTTSVoice>((map) => ReaderTTSVoice.fromJson(map))
.toList() ??
<ReaderTTSVoice>[];
return voices;
}