提交 272dee82 authored 作者: guoqing's avatar guoqing

修改公共list

上级 2d358412
...@@ -45,8 +45,9 @@ typedef RefreshCallback = Future<void> Function(); ...@@ -45,8 +45,9 @@ typedef RefreshCallback = Future<void> Function();
typedef LoadMoreCallback = Future<void> Function(); typedef LoadMoreCallback = Future<void> Function();
typedef SuccessCallback = Function(List list); typedef SuccessCallback = Function(List list);
typedef ErrorCallback = Function(int code, String msg);
typedef RequestDataCallback = Function( typedef RequestDataCallback = Function(
int page, int pageSize, SuccessCallback success, Function error); int page, int pageSize, SuccessCallback success, ErrorCallback error);
typedef ItemBuilder = Function(BuildContext context, int index, dynamic item); typedef ItemBuilder = Function(BuildContext context, int index, dynamic item);
...@@ -150,7 +151,7 @@ class _MyListViewPublicState extends State<MyListViewPublic> { ...@@ -150,7 +151,7 @@ class _MyListViewPublicState extends State<MyListViewPublic> {
_dataList.addAll(result); _dataList.addAll(result);
listItemCount = _dataList.length; listItemCount = _dataList.length;
hasMore = result.length == widget.pageSize; hasMore = result.length == widget.pageSize;
if (page == 1 && (result.length == 0)) { if (page == 1 && (result.isEmpty)) {
stateType = StateType.empty; //显示空布局 stateType = StateType.empty; //显示空布局
} else { } else {
stateType = StateType.success; //显示成功布局 stateType = StateType.success; //显示成功布局
...@@ -159,7 +160,7 @@ class _MyListViewPublicState extends State<MyListViewPublic> { ...@@ -159,7 +160,7 @@ class _MyListViewPublicState extends State<MyListViewPublic> {
setState(() {}); setState(() {});
} }
void _requestError(r) { void _requestError(r,s) {
stateType = StateType.error; //显示异常布局 stateType = StateType.error; //显示异常布局
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论