@@ -1,5 +1,6 @@ | |||||
import 'dart:async'; | 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_filter_model.dart'; | ||||
import 'package:zhiying_base_widget/pages/orders_page/models/order_model.dart'; | import 'package:zhiying_base_widget/pages/orders_page/models/order_model.dart'; | ||||
import 'package:zhiying_comm/util/base_bloc.dart'; | import 'package:zhiying_comm/util/base_bloc.dart'; | ||||
@@ -14,7 +15,8 @@ class OrderContentBloc extends BlocBase { | |||||
Stream<List<OrderModel>> get outData => _ordersController.stream; | Stream<List<OrderModel>> get outData => _ordersController.stream; | ||||
String _state; | String _state; | ||||
OrderFilterModel _filter; | OrderFilterModel _filter; | ||||
RefreshController refreshController = | |||||
RefreshController(initialRefresh: false); | |||||
@override | @override | ||||
void dispose() { | void dispose() { | ||||
_ordersController.close(); | _ordersController.close(); | ||||
@@ -60,6 +62,10 @@ class OrderContentBloc extends BlocBase { | |||||
} else { | } else { | ||||
_filter.pageNo = ((int.tryParse(_filter.pageNo) ?? 1) + 1).toString(); | _filter.pageNo = ((int.tryParse(_filter.pageNo) ?? 1) + 1).toString(); | ||||
} | } | ||||
refreshController.refreshCompleted(); | |||||
refreshController.resetNoData(); | |||||
}else{ | |||||
refreshController.loadNoData(); | |||||
} | } | ||||
_orders.addAll(list.map((item) { | _orders.addAll(list.map((item) { | ||||
@@ -59,8 +59,7 @@ class OrderContentContainer extends StatefulWidget { | |||||
class _OrderContentContainerState extends State<OrderContentContainer> { | class _OrderContentContainerState extends State<OrderContentContainer> { | ||||
OrderContentBloc _bloc; | OrderContentBloc _bloc; | ||||
RefreshController _refreshController = | |||||
RefreshController(initialRefresh: false); | |||||
StreamSubscription streamSubscription; | StreamSubscription streamSubscription; | ||||
@override | @override | ||||
@@ -92,7 +91,7 @@ class _OrderContentContainerState extends State<OrderContentContainer> { | |||||
if (snapshot.data == null) { | if (snapshot.data == null) { | ||||
return Container(); | return Container(); | ||||
} | } | ||||
_refreshController.refreshCompleted(); | |||||
List<OrderModel> orders = snapshot.data; | List<OrderModel> orders = snapshot.data; | ||||
if (orders.length == 0) { | if (orders.length == 0) { | ||||
return Container( | return Container( | ||||
@@ -105,7 +104,7 @@ class _OrderContentContainerState extends State<OrderContentContainer> { | |||||
enablePullDown: true, | enablePullDown: true, | ||||
enablePullUp: true, | enablePullUp: true, | ||||
header: WaterDropHeader(), | header: WaterDropHeader(), | ||||
controller: _refreshController, | |||||
controller: _bloc.refreshController, | |||||
onLoading: () { | onLoading: () { | ||||
_bloc.loadMore(); | _bloc.loadMore(); | ||||
}, | }, | ||||
@@ -44,7 +44,9 @@ dependencies: | |||||
url: http://192.168.0.138:3000/FnuoOS_Flutter_Components/permission_handler.git | url: http://192.168.0.138:3000/FnuoOS_Flutter_Components/permission_handler.git | ||||
more_picture_share: | 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 | intl: 0.16.1 | ||||