flutter - Future Builder`构建函数返回null`
问题描述
这是错误消息
To return an empty space that causes the building widget to fill available room, return "Container()". To return an empty space that takes as little room as possible, return "Container(width: 0.0, height: 0.0)".
我设法使用 return 但仍然发生这种情况,这是我发生错误的代码
FutureBuilder(
future: _getdetailRM(),
builder: (context, snapshot) {
if (snapshot.hasData) {
return Container();
}
}
)
解决方案
FutureBuilder(
future: _getdetailRM(),
builder: (context, snapshot) {
if (snapshot.hasData) {
return Container();
}else{
return Container();
}
}
)
推荐阅读
- wpf - 将“SelectedItems”依赖属性绑定到 ViewModel 属性不起作用
- c# - 用一个或多个“选择”命令填充数据表
- c# - C# 表达式在数据库中有效,在内存中无效
- jquery - 如何应用带有空格的 jQuery-autocomplete-ui
- reactjs - 反应路由器重定向
- javascript - 无法在本机反应中更改事件触发器的状态
- java - 自定义类级别验证 - 创建注释
- c++ - 使用定时器重复调用函数
- javascript - Issue with bootstrap modal
- python - (BAD_COLUMN_NAME):字形指的是不存在的列名,散景