flutter_tts
flutter_tts copied to clipboard
fix(android): when TextToSpeech initialization fails, the dart side method will always be in a pending state .
- Use
ttsStatus
instead ofisTtsInitialized
. WhenTextToSpeech
initialization is completed, assign the result tottsStatus
. Even ifTextToSpeech
initialization fails, we can callgetEngines
to get the engine list to set a new engine. - Remove
setInitHandler
and useawait setEngine
instead. On the Android side, we will callengineResult
on the initialization callback.