Isolate 的入口点函数不能标记为异步

the entry point function of Isolate can not marked as async

flutter中隔离的例子!不起作用。新的 isolate 没有 运行。但是如果我删除入口点函数的 async 。它工作正常。那么,如何在 flutter 中的新隔离中进行等待操作。

可能存在 Dart 2 错误。

如果 async 不起作用,您始终可以使用 .then() 而不是 asyncawait 来链接异步调用。

在将代码从主隔离区移动到另一个隔离区时遇到了同样的问题。在我的例子中,我移动了异步方法通道调用,这些调用在新的 isolate 中停止工作。在主隔离中,调用阻塞了 ui.

找到以下内容

https://github.com/flutter/flutter/issues/13937

https://github.com/flutter/flutter/issues/16846