diff --git a/lib/pages/orders_page/bloc/order_content_bloc.dart b/lib/pages/orders_page/bloc/order_content_bloc.dart index 5247f01..cb5e557 100644 --- a/lib/pages/orders_page/bloc/order_content_bloc.dart +++ b/lib/pages/orders_page/bloc/order_content_bloc.dart @@ -1,5 +1,6 @@ import 'dart:async'; +import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'package:zhiying_base_widget/pages/orders_page/models/order_filter_model.dart'; import 'package:zhiying_base_widget/pages/orders_page/models/order_model.dart'; import 'package:zhiying_comm/util/base_bloc.dart'; @@ -14,7 +15,8 @@ class OrderContentBloc extends BlocBase { Stream> get outData => _ordersController.stream; String _state; OrderFilterModel _filter; - + RefreshController refreshController = + RefreshController(initialRefresh: false); @override void dispose() { _ordersController.close(); @@ -60,6 +62,10 @@ class OrderContentBloc extends BlocBase { } else { _filter.pageNo = ((int.tryParse(_filter.pageNo) ?? 1) + 1).toString(); } + refreshController.refreshCompleted(); + refreshController.resetNoData(); + }else{ + refreshController.loadNoData(); } _orders.addAll(list.map((item) { diff --git a/lib/pages/orders_page/order_content_page.dart b/lib/pages/orders_page/order_content_page.dart index befa4cb..d95c741 100644 --- a/lib/pages/orders_page/order_content_page.dart +++ b/lib/pages/orders_page/order_content_page.dart @@ -59,8 +59,7 @@ class OrderContentContainer extends StatefulWidget { class _OrderContentContainerState extends State { OrderContentBloc _bloc; - RefreshController _refreshController = - RefreshController(initialRefresh: false); + StreamSubscription streamSubscription; @override @@ -92,7 +91,7 @@ class _OrderContentContainerState extends State { if (snapshot.data == null) { return Container(); } - _refreshController.refreshCompleted(); + List orders = snapshot.data; if (orders.length == 0) { return Container( @@ -105,7 +104,7 @@ class _OrderContentContainerState extends State { enablePullDown: true, enablePullUp: true, header: WaterDropHeader(), - controller: _refreshController, + controller: _bloc.refreshController, onLoading: () { _bloc.loadMore(); }, diff --git a/pubspec.yaml b/pubspec.yaml index 7dbe21d..7c52f17 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -44,7 +44,9 @@ dependencies: url: http://192.168.0.138:3000/FnuoOS_Flutter_Components/permission_handler.git more_picture_share: - path: ../more_picture_share + git: + url: 'http://192.168.0.138:3000/FnuoOS_ZhiYing/more_picture_share.git' + ref: '0.0.1' intl: 0.16.1