未来的类型是什么。
我在我的棉布检查中添加了一个“ ewndery_specify_type”,它要求我输入以下类型:
等待Future< ???> .delayed(consturation(contration duration(seconds:1));
> 这种类型应该是什么,为什么?它应该是无效的还是空的?
I added an "always_specify_type" to my lint check, it is asking me to enter the type for:
await Future<???>.delayed(const Duration(seconds: 1));
What should this type be and why? Should it be Void or Null or something else?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您应该使用
void
,因为您无意实际使用从future
中返回的值。通过这样做,如果您最终试图偶然使用返回的值,您将获得编译错误。You should use
void
since you have no intention of actually using the value returned from theFuture
. By doing so, you will get a compile error if you are ending up trying to use the returned value by accident.