|
|
@ -1,5 +1,9 @@
|
|
|
|
|
|
|
|
import 'package:aku_community/constants/api.dart';
|
|
|
|
|
|
|
|
import 'package:aku_community/models/market/goods_item.dart';
|
|
|
|
|
|
|
|
import 'package:aku_community/pages/things_page/widget/bee_list_view.dart';
|
|
|
|
import 'package:flutter/cupertino.dart';
|
|
|
|
import 'package:flutter/cupertino.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
|
|
|
import 'package:flutter_easyrefresh/easy_refresh.dart';
|
|
|
|
|
|
|
|
|
|
|
|
import 'package:waterfall_flow/waterfall_flow.dart';
|
|
|
|
import 'package:waterfall_flow/waterfall_flow.dart';
|
|
|
|
|
|
|
|
|
|
|
@ -26,6 +30,14 @@ class SearchGoodsPageState extends State<SearchGoodsPage> {
|
|
|
|
TextEditingController _editingController = TextEditingController();
|
|
|
|
TextEditingController _editingController = TextEditingController();
|
|
|
|
OrderType _orderType = OrderType.NORMAL;
|
|
|
|
OrderType _orderType = OrderType.NORMAL;
|
|
|
|
IconData priceIcon = CupertinoIcons.chevron_up_chevron_down;
|
|
|
|
IconData priceIcon = CupertinoIcons.chevron_up_chevron_down;
|
|
|
|
|
|
|
|
EasyRefreshController _refreshController = EasyRefreshController();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
|
|
|
void dispose() {
|
|
|
|
|
|
|
|
_refreshController.dispose();
|
|
|
|
|
|
|
|
super.dispose();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
final normalTypeButton = MaterialButton(
|
|
|
|
final normalTypeButton = MaterialButton(
|
|
|
@ -108,6 +120,10 @@ class SearchGoodsPageState extends State<SearchGoodsPage> {
|
|
|
|
title: Padding(
|
|
|
|
title: Padding(
|
|
|
|
padding: EdgeInsets.symmetric(vertical: 12.w),
|
|
|
|
padding: EdgeInsets.symmetric(vertical: 12.w),
|
|
|
|
child: TextField(
|
|
|
|
child: TextField(
|
|
|
|
|
|
|
|
onEditingComplete: () {
|
|
|
|
|
|
|
|
setState(() {});
|
|
|
|
|
|
|
|
_refreshController.callRefresh();
|
|
|
|
|
|
|
|
},
|
|
|
|
controller: _editingController,
|
|
|
|
controller: _editingController,
|
|
|
|
decoration: InputDecoration(
|
|
|
|
decoration: InputDecoration(
|
|
|
|
border: OutlineInputBorder(
|
|
|
|
border: OutlineInputBorder(
|
|
|
@ -131,17 +147,27 @@ class SearchGoodsPageState extends State<SearchGoodsPage> {
|
|
|
|
// ),
|
|
|
|
// ),
|
|
|
|
// preferredSize: Size.fromHeight(80.w),
|
|
|
|
// preferredSize: Size.fromHeight(80.w),
|
|
|
|
// ),
|
|
|
|
// ),
|
|
|
|
body: WaterfallFlow.builder(
|
|
|
|
body: BeeListView(
|
|
|
|
padding: EdgeInsets.all(32.w),
|
|
|
|
path: API.market.search,
|
|
|
|
gridDelegate: SliverWaterfallFlowDelegateWithFixedCrossAxisCount(
|
|
|
|
controller: _refreshController,
|
|
|
|
crossAxisCount: 2,
|
|
|
|
extraParams: {'searchName': _editingController.text},
|
|
|
|
mainAxisSpacing: 20.w,
|
|
|
|
convert: (model) =>
|
|
|
|
crossAxisSpacing: 20.w,
|
|
|
|
model.tableList!.map((e) => GoodsItem.fromJson(e)).toList(),
|
|
|
|
),
|
|
|
|
builder: (items) {
|
|
|
|
itemBuilder: (context, index) {
|
|
|
|
return WaterfallFlow.builder(
|
|
|
|
return GoodsCard();
|
|
|
|
padding: EdgeInsets.all(32.w),
|
|
|
|
|
|
|
|
gridDelegate: SliverWaterfallFlowDelegateWithFixedCrossAxisCount(
|
|
|
|
|
|
|
|
crossAxisCount: 2,
|
|
|
|
|
|
|
|
mainAxisSpacing: 20.w,
|
|
|
|
|
|
|
|
crossAxisSpacing: 20.w,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
itemBuilder: (context, index) {
|
|
|
|
|
|
|
|
final item = items[index];
|
|
|
|
|
|
|
|
return GoodsCard(item: item);
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
itemCount: items.length,
|
|
|
|
|
|
|
|
);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
itemCount: 10,
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|