Browse Source

safety

master
fmk 3 years ago
parent
commit
8d1f3e08be
  1. 34
      lib/store/store_order.dart
  2. 21
      lib/store/store_view/store_order_list.dart

34
lib/store/store_order.dart

@ -43,7 +43,7 @@ class StoreOrderPage extends StatefulWidget {
} }
class _StoreOrderPage extends State<StoreOrderPage> class _StoreOrderPage extends State<StoreOrderPage>
with TickerProviderStateMixin /*, AutomaticKeepAliveClientMixin*/ { with TickerProviderStateMixin {
TabController tabcontroller; TabController tabcontroller;
ApiService apiService; ApiService apiService;
MinApiService minService; MinApiService minService;
@ -125,9 +125,7 @@ class _StoreOrderPage extends State<StoreOrderPage>
await minService.getParentInfo("$tableId").catchError((error) { await minService.getParentInfo("$tableId").catchError((error) {
debugPrint(error); debugPrint(error);
}); });
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {}
}
} }
/// ///
@ -164,6 +162,8 @@ class _StoreOrderPage extends State<StoreOrderPage>
} }
} }
RefreshController refreshController;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Stack( return Stack(
@ -173,14 +173,11 @@ class _StoreOrderPage extends State<StoreOrderPage>
right: 0, right: 0,
top: 0, top: 0,
bottom: 54.h, bottom: 54.h,
child: DefaultTabController(
length: 2,
child: NestedScrollView( child: NestedScrollView(
controller: controller, controller: controller,
dragStartBehavior: DragStartBehavior.start, dragStartBehavior: DragStartBehavior.start,
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
headerSliverBuilder: headerSliverBuilder: (BuildContext context, bool innerScrolled) {
(BuildContext context, bool innerBoxIsScrolled) {
return [ return [
SliverOverlapAbsorber( SliverOverlapAbsorber(
handle: NestedScrollView.sliverOverlapAbsorberHandleFor( handle: NestedScrollView.sliverOverlapAbsorberHandleFor(
@ -319,8 +316,9 @@ class _StoreOrderPage extends State<StoreOrderPage>
]; ];
}, },
body: TabBarView( body: TabBarView(
physics: BouncingScrollPhysics(), physics: NeverScrollableScrollPhysics(),
children: [ children: [
///
StoreOrderListPage( StoreOrderListPage(
widget.arguments, widget.arguments,
activitys, activitys,
@ -338,8 +336,18 @@ class _StoreOrderPage extends State<StoreOrderPage>
], ],
controller: tabcontroller, controller: tabcontroller,
), ),
), ),/*SmartRefresher(
), controller: refreshController =
RefreshController(initialRefresh: false),
enablePullDown: true,
enablePullUp: false,
header: MyHeader(),
physics: BouncingScrollPhysics(),
onRefresh: () {
queryStoreInfo();
},
child:
),*/
), ),
Positioned( Positioned(
bottom: 0, bottom: 0,
@ -446,9 +454,11 @@ class _StoreOrderPage extends State<StoreOrderPage>
); );
} }
///
showPeopleNum(String tableName) async { showPeopleNum(String tableName) async {
var people = await showDialog( var people = await showDialog(
context: context, context: context,
barrierDismissible: false,
builder: (context) { builder: (context) {
return PeopleNumView(tableName); return PeopleNumView(tableName);
}, },
@ -458,6 +468,8 @@ class _StoreOrderPage extends State<StoreOrderPage>
setState(() { setState(() {
this.numberOfPeople = people; this.numberOfPeople = people;
}); });
} else {
Navigator.of(context).pop();
} }
} }

21
lib/store/store_view/store_order_list.dart

@ -70,10 +70,10 @@ class _StoreOrderListPage extends State<StoreOrderListPage> {
await minService.findMiNiGroupList({ await minService.findMiNiGroupList({
"id": widget.arguments["id"], "id": widget.arguments["id"],
}).catchError((error) { }).catchError((error) {
refreshController.refreshFailed(); // refreshController.refreshFailed();
}); });
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
refreshController.refreshCompleted(); // refreshController.refreshCompleted();
setState(() { setState(() {
appletProducts = baseData.data; appletProducts = baseData.data;
productListBeans.clear(); productListBeans.clear();
@ -81,11 +81,11 @@ class _StoreOrderListPage extends State<StoreOrderListPage> {
productListBeans.addAll(appletProducts[isSelected].productList); productListBeans.addAll(appletProducts[isSelected].productList);
}); });
} else { } else {
refreshController.refreshFailed(); // refreshController.refreshFailed();
} }
} }
RefreshController refreshController; // RefreshController refreshController;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -95,17 +95,6 @@ class _StoreOrderListPage extends State<StoreOrderListPage> {
margin: EdgeInsets.only( margin: EdgeInsets.only(
top: (MediaQuery.of(context).padding.top + 38 + kToolbarHeight), top: (MediaQuery.of(context).padding.top + 38 + kToolbarHeight),
), ),
child: SmartRefresher(
controller: refreshController =
RefreshController(initialRefresh: false),
enablePullDown: true,
enablePullUp: false,
header: MyHeader(),
physics: BouncingScrollPhysics(),
onRefresh: () {
appletGoods();
},
child: SingleChildScrollView(
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
@ -139,8 +128,6 @@ class _StoreOrderListPage extends State<StoreOrderListPage> {
), ),
], ],
), ),
),
),
); );
} }

Loading…
Cancel
Save