首页 > 解决方案 > 阻止进程等待未来完成

问题描述


String longMehtod() async{
    await longProcess()
    return ok;
}

Future<String> a = longMehtod()
//add some code to block the process to wait Future complete and I can get the value of a 

我可以阻止该过程并确保必须在不使用等待/异步的情况下打印该值吗?

或者在Rxjava中有没有像blockingget这样的方法?

标签: flutterdart

解决方案


推荐阅读