- r - 以节省内存的方式增长 data.frame
- ruby-on-rails - ruby/ruby on rails 内存泄漏检测
- android - 无法解析导入android.support.v7.app
- UNIX 域套接字与共享内存(映射文件)
我的意思是检查刷新指示器是否正在刷新。根据该值采取行动以在该值为真时停止 Spinner 旋转。
Widget _productLogic(MainModel model) {
Widget content = Center(
child: Text("No products available."),
);
if (model.allProduct.length > 0 && !model.isLoading) {
content = _buildProductList(model.allProduct);
} else if (model.isLoading) {
content = Center(
child: CircularProgressIndicator(),
);
}
return RefreshIndicator(
child: content,
onRefresh: model.fetchProducts,
backgroundColor: Colors.blue,
color: Colors.red);
}
@override
Widget build(BuildContext context) {
return ScopedModelDescendant<MainModel>(
builder: (BuildContext context, Widget child, MainModel model) {
return _productLogic(model);
});
}
最佳答案
实际上,您必须将Global Key 设置为RefreshIndicator
并检查currentState
,如下所示
final GlobalKey<RefreshIndicatorState> _refreshKey =
new GlobalKey<RefreshIndicatorState>();
然后
return RefreshIndicator(
key: _refreshKey,
然后
_refreshKey.currentState?.show()?.then((_) {......
关于dart - 如何检查 RefreshIndicator 状态以根据其状态值采取行动?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53940661/
在 Catalyst我正在尝试转发一个私有(private)行动来做一些工作。这是函数定义: sub get_form :Private :Args(1) { my ($self, $c, $ty
public class SimpleHTTPRequest { String envelope1="" + ""+ ""+ ""+ "ghjghj"+
我有一些返回 Promise 的 JavaScript 函数。我使用 .then 来处理从这些函数返回的数据。但是,下面的代码是否保证了顺序? result2 会在 result 之后处理吗? con
我有这样的类层次结构 public abstract class CalendarEventBase{} public class TrainingEvent : CalendarEventBase{
我有一个问题:我需要创建一个可以从 javascript 调用的网络服务(在 C# 中),该服务返回一个在(它是一个 excel)中生成的文件,并且在 javascript 中返回一个新文件,打开一个
我正在向我的 UITableViewCell 添加自定义按钮。在该按钮的操作中,我想调用 showAlert: 函数并希望在该方法中传递单元格标签。 如何在 showAlert 方法中传递参数:act
我正在尝试推送到 harbor registry 2.2。它与 ssl 一起工作,并且存储在本地安装的 NFS 共享上。我得到的错误是:未经授权访问存储库:测试/ flask ,操作:推送:未经授权访
我正在尝试推送到 harbor registry 2.2。它与 ssl 一起工作,并且存储在本地安装的 NFS 共享上。我得到的错误是:未经授权访问存储库:测试/ flask ,操作:推送:未经授权访
无论我如何尝试编写 Action 测试,这个错误都会困扰我一段时间,它给了我这个: “操作可能没有未定义的“类型”属性。您是否拼错了常量?操作:{}" 但如果我控制台记录我正在尝试测试的操作,它会打印
我是一名优秀的程序员,十分优秀!