From 3fba0767d14d3cb7ebd39f3d265449499b4c16fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cyanghuaxuan=E2=80=9D?= <“646903573@qq.com”> Date: Tue, 9 Feb 2021 09:58:05 +0800 Subject: [PATCH] =?UTF-8?q?1.=E4=BF=AE=E5=A4=8D=E6=88=91=E7=9A=84=E8=AE=A2?= =?UTF-8?q?=E5=8D=95=E4=B8=8A=E6=8B=89=E5=8A=A0=E8=BD=BD=E6=9B=B4=E5=A4=9A?= =?UTF-8?q?=E4=B8=8D=E6=98=BE=E7=A4=BA=E6=9A=82=E6=97=A0=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/pages/orders_page/bloc/order_content_bloc.dart | 8 +++++++- lib/pages/orders_page/order_content_page.dart | 7 +++---- pubspec.yaml | 4 +++- 3 files changed, 13 insertions(+), 6 deletions(-) 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