相关疑难解决方法(0)

什么是 Future 以及如何使用它?

我收到以下错误:

A value of type 'Future<int>' can't be assigned to a variable of type 'int'
Run Code Online (Sandbox Code Playgroud)

它可能是另一种类型而不是int,但基本上模式是

A value of type 'Future<T>' can't be assigned to a variable of type 'T'
Run Code Online (Sandbox Code Playgroud)

所以...

  • 究竟是什么Future
  • 我如何获得我想要获得的实际价值?
  • 当我只有一个时,我使用什么小部件来显示我的价值Future<T>

future async-await dart flutter flutter-futurebuilder

17
推荐指数
4
解决办法
6736
查看次数