我想创建一个可以刷新列表项的自定义小部件。它看起来像这样:
...
Widget build(BuildContext context){
return new RefreshIndicator(
child:data.isEmpty?
new SingleChildScrollView(
child:new Center(
child:new Text("this is a empty widget which needs to be center in parent!)
),
)
:
new ListView.separated(...)
);
}
Run Code Online (Sandbox Code Playgroud)
但是当我触摸屏幕并移动时它无法刷新,我想这太短了所以不足以滚动?我尝试将Containerinstate定义Center为相同的结果,但如果我定义1000为Container's height,则现在可以刷新,我该怎么办?