鸿蒙提交
This commit is contained in:
@@ -94,7 +94,11 @@ class _TtsPlayerSheetState extends ConsumerState<TtsPlayerSheet> {
|
||||
_subscribeSystemTts();
|
||||
_subscribeOnlineTts();
|
||||
_subscribeSystemTtsErrors();
|
||||
_startPlaying();
|
||||
// 延迟到构建完成后启动朗读,避免在initState中修改provider导致
|
||||
// "Tried to modify a provider while the widget tree was building" 错误
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
if (mounted) _startPlaying();
|
||||
});
|
||||
}
|
||||
|
||||
/// 从插件状态读取配置
|
||||
|
||||
Reference in New Issue
Block a user