Closed shuai0825 closed 4 years ago
state中 GoodsShowState initState(Map<String, dynamic> args) { final GoodsShowState state = GoodsShowState(); state.goodItems = List(); state.scrollController = ScrollController(); return state; } view中 RefreshIndicator( onRefresh: () { dispatch(Action(GoodsShowAction.refresh, payload: () { completer.complete(); })); return completer.future; }, child: ListView.separated( controller: state.scrollController, itemBuilder: adapter.itemBuilder, separatorBuilder: (BuildContext context, int index) { return divider; }, itemCount: adapter.itemCount, padding: EdgeInsets.only(top: 11),
), )
flutter当前版本导致的,解决办法可以用gridview代替listview
state中 GoodsShowState initState(Map<String, dynamic> args) { final GoodsShowState state = GoodsShowState(); state.goodItems = List(); state.scrollController = ScrollController(); return state; } view中 RefreshIndicator( onRefresh: () { dispatch(Action(GoodsShowAction.refresh, payload: () { completer.complete(); })); return completer.future; }, child: ListView.separated( controller: state.scrollController, itemBuilder: adapter.itemBuilder, separatorBuilder: (BuildContext context, int index) { return divider; }, itemCount: adapter.itemCount, padding: EdgeInsets.only(top: 11),