Flutter错误提示:
This expression has a type of ‘void’ so its value can’t be used.
Try checking to see if you’re using the correct API; there might be a function or call that returns void you didn’t expect.
Also check type parameters and variables which might also be void.
这个表达式的类型是'void',所以它的值不能被使用。
试着检查你是否使用了正确的API;可能有一个函数或调用返回了您意想不到的void。还要检查类型参数和变量,它们也可能是void。
解决方法,将实例化对象的 void函数 改成 Future<void> 即可
参考文章:https://blog.csdn.net/qq_36632604/article/details/121253768