handle case of null voices list
This commit is contained in:
parent
3be53cc398
commit
04f6e7df13
1 changed files with 2 additions and 2 deletions
|
|
@ -45,8 +45,8 @@ class TtsController {
|
|||
|
||||
await tts.awaitSpeakCompletion(true);
|
||||
|
||||
final voices = await tts.getVoices;
|
||||
availableLangCodes = (voices as List)
|
||||
final voices = (await tts.getVoices) as List?;
|
||||
availableLangCodes = (voices ?? [])
|
||||
.map((v) {
|
||||
// on iOS / web, the codes are in 'locale', but on Android, they are in 'name'
|
||||
final nameCode = v['name']?.split("-").first;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue