newHost
王亚玲 2 years ago
parent d373d9e528
commit c3e6506c1d

@ -1,3 +1,5 @@
import 'package:aku_new_community/pages/setting_page/blacklist_page/blacklist_page.dart';
class API { class API {
///HOST ///HOST
static const String host = 'http://121.41.26.225:8006'; static const String host = 'http://121.41.26.225:8006';

@ -100,6 +100,15 @@ class _User {
/// ///
String get updateAvatar => '/app/user/updateAvatarImg'; String get updateAvatar => '/app/user/updateAvatarImg';
///
String get blackList => '/app/user/community/blackList/list';
///
String get cancelBlock => '/app/user/community/blackList/cancelBlock';
///
String get Block => '/app/user/community/blackList/block';
} }
class _Login { class _Login {
@ -107,7 +116,7 @@ class _Login {
String get quit => '/app/user/quit'; String get quit => '/app/user/quit';
///app ///app
String get logOut =>'/app/user/logout'; String get logOut => '/app/user/logout';
/// ///
String get allCommunity => '/app/login/findAllCommunity'; String get allCommunity => '/app/login/findAllCommunity';
@ -447,9 +456,10 @@ class _Facilities {
String get cancel => '/app/user/facilities/cancel'; String get cancel => '/app/user/facilities/cancel';
} }
class _Updater{ class _Updater {
///app ///app
String get findNewVersion => '/app/version/findNewVersion'; String get findNewVersion => '/app/version/findNewVersion';
///app ///app
String get insert => '/app/version/insert'; String get insert => '/app/version/insert';
} }

@ -0,0 +1,25 @@
import 'package:json_annotation/json_annotation.dart';
import 'package:equatable/equatable.dart';
part 'blacklist_model.g.dart';
@JsonSerializable()
class BlacklistModel extends Equatable {
int id;
List imgList;
String name;
factory BlacklistModel.fromJson(Map<String, dynamic> json) =>
_$BlacklistModelFromJson(json);
BlacklistModel({
required this.id,
required this.imgList,
required this.name,
});
@override
List<Object?> get props => [id, imgList, name,];
}

@ -0,0 +1,14 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'blacklist_model.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
BlacklistModel _$BlacklistModelFromJson(Map<String, dynamic> json) =>
BlacklistModel(
id: json['id'] as int,
imgList: json['imgList'] as List<dynamic>,
name: json['name'] as String,
);

@ -0,0 +1,40 @@
import 'package:aku_new_community/constants/saas_api.dart';
import 'package:aku_new_community/model/user/blacklist_model.dart';
import 'package:aku_new_community/utils/network/base_list_model.dart';
import 'package:aku_new_community/utils/network/base_model.dart';
import 'package:aku_new_community/utils/network/net_util.dart';
class BlackListFunc {
///
static Future<List<BlacklistModel>> getBlackList() async {
BaseListModel model = await NetUtil().getList(
SAASAPI.user.blackList,
params: {
'pageNum': 1,
'size': 9,
},
);
if (model.rows.length == 0) return [];
return model.rows.map((e) => BlacklistModel.fromJson(e)).toList();
}
///
static Future<bool> cancelBlock(int userId) async {
var base = await NetUtil().get(SAASAPI.user.cancelBlock,
params: {
'userId': userId,
},
showMessage: true);
return base.success;
}
///
static Future<bool> Block(int userId) async {
var base = await NetUtil().get(SAASAPI.user.Block,
params: {
'userId': userId,
},
showMessage: true);
return base.success;
}
}

@ -0,0 +1,216 @@
import 'package:aku_new_community/base/base_style.dart';
import 'package:aku_new_community/gen/assets.gen.dart';
import 'package:aku_new_community/model/user/blacklist_model.dart';
import 'package:aku_new_community/pages/setting_page/blacklist_page/blacklist_func.dart';
import 'package:aku_new_community/widget/dialog/bee_custom_dialog.dart';
import 'package:aku_new_community/widget/others/user_tool.dart';
import 'package:flutter/material.dart';
import 'package:aku_new_community/utils/headers.dart';
import 'package:aku_new_community/widget/bee_scaffold.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:get/get.dart';
class blackListPage extends StatefulWidget {
blackListPage({Key? key}) : super(key: key);
@override
_blackListPageState createState() => _blackListPageState();
}
class _blackListPageState extends State<blackListPage> {
List<BlacklistModel> blackList = [];
// List blackList2 = [
// {
// 'id': 1,
// 'name': '天天',
// 'img': [
// Assets.images.vegetableBanner.path,
// Assets.images.vegetableBanner.path
// ]
// },
// {
// 'id': 1,
// 'name': '天天',
// 'img': [
// Assets.images.vegetableBanner.path,
// Assets.images.vegetableBanner.path
// ]
// },
// {
// 'id': 1,
// 'name': '天天',
// 'img': [
// Assets.images.vegetableBanner.path,
// Assets.images.vegetableBanner.path
// ]
// }
// ];
final EasyRefreshController _refreshController = EasyRefreshController();
@override
void initState() {
super.initState();
// ///appbar refresh
// Future.delayed(Duration(milliseconds: 0), () async {
// await _refresh();
// setState(() {});
// });
}
@override
void dispose() {
_refreshController.dispose();
super.dispose();
}
// Future _refresh() async {
// blackList = await BlackListFunc.getBlackList();
// }
@override
Widget build(BuildContext context) {
return BeeScaffold(
title: '黑名单列表',
body: Column(
children: [
Container(
color: Color(0xF000000).withOpacity(0.06),
width: MediaQuery.of(context).size.width,
height: 75.w,
alignment: Alignment.center,
child: Text.rich(TextSpan(children: [
TextSpan(
text: '点击',
style:
TextStyle(fontSize: 24.sp, color: Color(0xA6000000))),
TextSpan(
text: ' 移出黑名单 ',
style: TextStyle(fontSize: 24.sp, color: Colors.blue)),
TextSpan(
text: '即可在社区中显示对方的动态',
style:
TextStyle(fontSize: 24.sp, color: Color(0xA6000000))),
])),
),
Expanded(
child: EasyRefresh(
firstRefresh: true,
header: MaterialHeader(),
footer: MaterialFooter(),
controller: _refreshController,
onRefresh: () async {
blackList = await BlackListFunc.getBlackList();
// blackList = [
// BlacklistModel(
// id: 0,
// imgList: [Assets.images.vegetableBanner.path],
// name: '张天天')
// ];
setState(() {});
// _page
},
onLoad: () async {},
child: ListView.builder(
itemBuilder: (context, index) {
return _blackList(blackList[index]);
},
itemCount: blackList.length,
)))
],
));
}
_blackList(BlacklistModel model) {
return Column(
children: [
ListTile(
leading: Container(
width: 88.w,
height: 88.w,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(40),
image: DecorationImage(
image: ExactAssetImage(
R.ASSETS_IMAGES_PLACEHOLDER_WEBP ?? model.imgList.first,
),
fit: BoxFit.cover)),
),
title: Text(
_getText(model.name),
style: TextStyle(fontSize: 28.sp, color: ktextSubColor),
),
trailing: GestureDetector(
onTap: () async {
await Get.dialog(
BeeCustomDialog(
height: 247.w,
content: Padding(
padding: EdgeInsets.only(top: 64.w),
child: Text(
'确认将该用户移出黑名单列表吗',
style: UserTool.myAppStyle.dialogContentText,
)),
actions: [
MaterialButton(
onPressed: () {
Get.back();
},
child: Text('考虑一下',
style: TextStyle(
fontSize: 28.w,
color: Colors.black.withOpacity(0.45))),
),
MaterialButton(
onPressed: () async {
var cancelBlock =
await BlackListFunc.cancelBlock(model.id);
if (cancelBlock) {
Get.back();
_refreshController.callRefresh();
}
},
child: Text('确认移出',
style: UserTool.myAppStyle.dialogActionButtonText),
),
],
),
// barrierDismissible: false,
);
},
child: '移出黑名单'.text.size(24.sp).color(Colors.blue).make()),
),
Divider()
],
);
}
_getText(String name) {
String name2 = name.substring(0, 1);
for (var i = 0; i < name.length - 1; i++) {
name2 += '*';
}
return name2;
}
// _blackList(BlacklistModel model) {
// return ListTile(
// leading: Container(
// width: 88.w,
// height: 88.w,
// decoration: BoxDecoration(
// borderRadius: BorderRadius.circular(40),
// image: DecorationImage(
// image: ExactAssetImage(model.imgList.first),
// fit: BoxFit.cover)),
// ),
// title: model.name.text.size(20.sp).color(ktextSubColor).make(),
// subtitle: GestureDetector(
// onTap: () {},
// child: '移出黑名单'.text.size(24.sp).color(Colors.blue).make()),
// );
// }
}

@ -19,6 +19,7 @@ import 'package:aku_new_community/widget/bee_scaffold.dart';
import 'package:aku_new_community/widget/others/user_tool.dart'; import 'package:aku_new_community/widget/others/user_tool.dart';
import 'account_manager_page.dart'; import 'account_manager_page.dart';
import 'blacklist_page/blacklist_page.dart';
import 'feedback_page/feedback_page.dart'; import 'feedback_page/feedback_page.dart';
class SettingsPage extends StatefulWidget { class SettingsPage extends StatefulWidget {
@ -155,6 +156,10 @@ class _SettingsPageState extends State<SettingsPage> {
title: '隐私政策', title: '隐私政策',
onTap: () => Get.to(() => PrivacyPage()), onTap: () => Get.to(() => PrivacyPage()),
), ),
_buildTile(
title: '社区黑名单',
onTap: () => Get.to(() => blackListPage()),
),
].sepWidget( ].sepWidget(
separate: Divider( separate: Divider(
indent: 32.w, indent: 32.w,

@ -1,3 +1,4 @@
import 'package:aku_new_community/utils/headers.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:bot_toast/bot_toast.dart'; import 'package:bot_toast/bot_toast.dart';
@ -190,9 +191,15 @@ class _OtherLoginPageState extends State<OtherLoginPage> {
BotToast.showText(text: base.msg); BotToast.showText(text: base.msg);
} }
}, },
text: clockTimer.timerStart text:
? '${clockTimer.second}秒后重新获取' clockTimer.timerStart ? '${clockTimer.second}秒后重新获取' : '获取验证码'),
: '获取验证码'), 32.hb,
IconButton(
icon: Icon(Icons.ac_unit_outlined),
onPressed: () {
//Get.to(() => RootPage());
},
),
24.w.heightBox, 24.w.heightBox,
Row( Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,

@ -1,5 +1,6 @@
import 'dart:math'; import 'dart:math';
import 'package:aku_new_community/pages/setting_page/blacklist_page/blacklist_func.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -120,17 +121,11 @@ class _EventDetailPageState extends State<EventDetailPage> {
actions: [ actions: [
(CommunityPopButton( (CommunityPopButton(
isMyself: _isMyself, isMyself: _isMyself,
onSelect: (dynamic _) async { onSelect: (int value) async {
if (LoginUtil.isNotLogin) return; if (LoginUtil.isNotLogin) return;
if (!_isMyself) { if (value == 3) {
VoidCallback cancel = BotToast.showLoading(); await Get.dialog(CupertinoAlertDialog(
await Future.delayed( title: '你确定要拉黑他吗'.text.isIntrinsic.make(),
Duration(milliseconds: 500 + Random().nextInt(500)));
cancel();
BotToast.showText(text: '举报成功');
} else {
bool? result = await Get.dialog(CupertinoAlertDialog(
title: '你确定删除吗'.text.isIntrinsic.make(),
actions: [ actions: [
CupertinoDialogAction( CupertinoDialogAction(
child: '取消'.text.black.isIntrinsic.make(), child: '取消'.text.black.isIntrinsic.make(),
@ -138,15 +133,43 @@ class _EventDetailPageState extends State<EventDetailPage> {
), ),
CupertinoDialogAction( CupertinoDialogAction(
child: '确定'.text.color(Colors.orange).isIntrinsic.make(), child: '确定'.text.color(Colors.orange).isIntrinsic.make(),
onPressed: () => Get.back(result: true), onPressed: () async {
var isShielding =
await BlackListFunc.Block(widget.dynamicId);
if (isShielding) {
Get.back();
}
},
), ),
], ],
)); ));
} else {
if (!_isMyself) {
VoidCallback cancel = BotToast.showLoading();
await Future.delayed(
Duration(milliseconds: 500 + Random().nextInt(500)));
cancel();
BotToast.showText(text: '举报成功');
} else {
bool? result = await Get.dialog(CupertinoAlertDialog(
title: '你确定删除吗'.text.isIntrinsic.make(),
actions: [
CupertinoDialogAction(
child: '取消'.text.black.isIntrinsic.make(),
onPressed: () => Get.back(),
),
CupertinoDialogAction(
child: '确定'.text.color(Colors.orange).isIntrinsic.make(),
onPressed: () => Get.back(result: true),
),
],
));
if (result == true) { if (result == true) {
await CommunityFunc.deleteDynamic(widget.dynamicId); await CommunityFunc.deleteDynamic(widget.dynamicId);
Get.back(); Get.back();
widget.refresh!(); widget.refresh!();
}
} }
} }
}, },
@ -300,9 +323,9 @@ class _EventDetailPageState extends State<EventDetailPage> {
); );
} }
Widget _commentWidget(CommentListModel model, int rootIndex){ Widget _commentWidget(CommentListModel model, int rootIndex) {
final userProvider = Provider.of<UserProvider>(context); final userProvider = Provider.of<UserProvider>(context);
return GestureDetector( return GestureDetector(
onTap: () { onTap: () {
_rootId = model.id; _rootId = model.id;
_parentId = model.id; _parentId = model.id;
@ -361,9 +384,9 @@ class _EventDetailPageState extends State<EventDetailPage> {
), ),
Spacer(), Spacer(),
CommunityPopButton( CommunityPopButton(
isMyself: userProvider.userInfoModel?.id==model.createId, isMyself: userProvider.userInfoModel?.id == model.createId,
onSelect: (value) async { onSelect: (value) async {
if (userProvider.userInfoModel?.id==model.createId) { if (userProvider.userInfoModel?.id == model.createId) {
await CommunityFunc.deleteComment(model.id); await CommunityFunc.deleteComment(model.id);
_refreshController.callRefresh(); _refreshController.callRefresh();
} }

@ -1,5 +1,6 @@
import 'dart:math'; import 'dart:math';
import 'package:aku_new_community/pages/setting_page/blacklist_page/blacklist_func.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -144,7 +145,10 @@ class _ChatCardState extends State<ChatCard> {
), ),
20.wb, 20.wb,
GestureDetector( GestureDetector(
onTap: () => Get.to(EventDetailPage(dynamicId: widget.model.id,createId: widget.model.createId,)), onTap: () => Get.to(EventDetailPage(
dynamicId: widget.model.id,
createId: widget.model.createId,
)),
child: Material( child: Material(
color: Colors.transparent, color: Colors.transparent,
child: Row( child: Row(
@ -247,20 +251,13 @@ class _ChatCardState extends State<ChatCard> {
], ],
), ),
Spacer(), Spacer(),
CommunityPopButton( CommunityPopButton(
isMyself: _isMyself, isMyself: _isMyself,
onSelect: (dynamic _) async { onSelect: (int value) async {
if (LoginUtil.isNotLogin) return; if (LoginUtil.isNotLogin) return;
if (!_isMyself) { if (value == 3) {
VoidCallback cancel = BotToast.showLoading(); await Get.dialog(CupertinoAlertDialog(
await Future.delayed( title: '你确定要拉黑他吗'.text.isIntrinsic.make(),
Duration(milliseconds: 500 + Random().nextInt(500)));
cancel();
BotToast.showText(text: '举报成功');
} else {
bool? result = await Get.dialog(CupertinoAlertDialog(
title: '你确定删除吗'.text.isIntrinsic.make(),
actions: [ actions: [
CupertinoDialogAction( CupertinoDialogAction(
child: '取消'.text.black.isIntrinsic.make(), child: '取消'.text.black.isIntrinsic.make(),
@ -269,14 +266,45 @@ class _ChatCardState extends State<ChatCard> {
CupertinoDialogAction( CupertinoDialogAction(
child: child:
'确定'.text.color(Colors.orange).isIntrinsic.make(), '确定'.text.color(Colors.orange).isIntrinsic.make(),
onPressed: () => Get.back(result: true), onPressed: () async {
var isShielding =
await BlackListFunc.Block(widget.model.id);
if (isShielding) {
Get.back();
}
},
), ),
], ],
)); ));
} else {
if (result == true) { if (!_isMyself) {
await CommunityFunc.deleteDynamic(widget.model.id); VoidCallback cancel = BotToast.showLoading();
widget.refresh(); await Future.delayed(
Duration(milliseconds: 500 + Random().nextInt(500)));
cancel();
BotToast.showText(text: '举报成功');
} else {
bool? result = await Get.dialog(CupertinoAlertDialog(
title: '你确定删除吗'.text.isIntrinsic.make(),
actions: [
CupertinoDialogAction(
child: '取消'.text.black.isIntrinsic.make(),
onPressed: () => Get.back(),
),
CupertinoDialogAction(
child: '确定'
.text
.color(Colors.orange)
.isIntrinsic
.make(),
onPressed: () => Get.back(result: true),
),
],
));
if (result == true) {
await CommunityFunc.deleteDynamic(widget.model.id);
widget.refresh();
}
} }
} }
}, },
@ -334,6 +362,10 @@ class CommunityPopButton extends StatelessWidget {
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8.w)), shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8.w)),
itemBuilder: (context) { itemBuilder: (context) {
return [ return [
PopupMenuItem(
child: '拉黑'.text.isIntrinsic.make(),
value: 3,
),
isMyself isMyself
? PopupMenuItem( ? PopupMenuItem(
child: '删除'.text.isIntrinsic.make(), child: '删除'.text.isIntrinsic.make(),

@ -1,6 +1,8 @@
import 'dart:ui' as ui; import 'dart:ui' as ui;
import 'package:aku_new_community/provider/user_provider.dart';
import 'package:aku_new_community/ui/market/vegetable_market/seasonal_vegetables.dart'; import 'package:aku_new_community/ui/market/vegetable_market/seasonal_vegetables.dart';
import 'package:aku_new_community/utils/hive_store.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:card_swiper/card_swiper.dart'; import 'package:card_swiper/card_swiper.dart';
@ -493,7 +495,9 @@ class _MarketPageState extends State<MarketPage>
return GestureDetector( return GestureDetector(
onTap: () { onTap: () {
/// ///
Get.to(() => SeasonalVegetables()); Get.to(() => SeasonalVegetables(
searchText: '',
));
}, },
child: Assets.images.vegetableBanner.image(width: 712.w, height: 200.w), child: Assets.images.vegetableBanner.image(width: 712.w, height: 200.w),
); );
@ -1048,6 +1052,15 @@ class _MarketPageState extends State<MarketPage>
)); ));
} }
///
saveSearchListToSharedPreferences(String value) async {
final userProvider = Provider.of<UserProvider>(Get.context!, listen: false);
HiveStore.appBox!.put(
userProvider.userInfoModel?.id.toString() ?? '' + "userSearhHistory",
value);
}
_goodsTitle( _goodsTitle(
Widget normalTypeButton, Widget normalTypeButton,
Widget salesTypeButton, Widget salesTypeButton,

@ -556,6 +556,7 @@ class SearchGoodsPageState extends State<SearchGoodsPage> {
setState(() {}); setState(() {});
} }
///
_hotGoodsCard(GoodsPopularModel goodsItem, int index) { _hotGoodsCard(GoodsPopularModel goodsItem, int index) {
return GestureDetector( return GestureDetector(
onTap: () { onTap: () {

@ -17,7 +17,10 @@ import '../../../gen/assets.gen.dart';
import '../search/search_goods_page.dart'; import '../search/search_goods_page.dart';
class SeasonalVegetables extends StatefulWidget { class SeasonalVegetables extends StatefulWidget {
const SeasonalVegetables({Key? key}) : super(key: key); final String searchText;
const SeasonalVegetables({Key? key, required this.searchText})
: super(key: key);
@override @override
_SeasonalVegetablesState createState() => _SeasonalVegetablesState(); _SeasonalVegetablesState createState() => _SeasonalVegetablesState();
@ -53,7 +56,7 @@ class _SeasonalVegetablesState extends State<SeasonalVegetables> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final userProvider = Provider.of<UserProvider>(context, listen: false); //final userProvider = Provider.of<UserProvider>(context, listen: false);
final normalTypeButton = MaterialButton( final normalTypeButton = MaterialButton(
onPressed: () { onPressed: () {
_orderType = OrderType.NORMAL; _orderType = OrderType.NORMAL;
@ -130,17 +133,17 @@ class _SeasonalVegetablesState extends State<SeasonalVegetables> {
'价格', '价格',
style: TextStyle( style: TextStyle(
color: _orderType == OrderType.PRICE_HIGH || color: _orderType == OrderType.PRICE_HIGH ||
_orderType == OrderType.PRICE_LOW _orderType == OrderType.PRICE_LOW
? kBalckSubColor ? kBalckSubColor
: ktextPrimary, : ktextPrimary,
fontSize: _orderType == OrderType.PRICE_HIGH || fontSize: _orderType == OrderType.PRICE_HIGH ||
_orderType == OrderType.PRICE_LOW _orderType == OrderType.PRICE_LOW
? 32.sp ? 32.sp
: 28.sp, : 28.sp,
// fontWeight: _orderType == OrderType.PRICE_HIGH || fontWeight: _orderType == OrderType.PRICE_HIGH ||
// _orderType == OrderType.PRICE_LOW _orderType == OrderType.PRICE_LOW
// ? FontWeight.bold ? FontWeight.bold
// : FontWeight.normal, : FontWeight.normal,
), ),
), ),
// Icon( // Icon(
@ -226,33 +229,33 @@ class _SeasonalVegetablesState extends State<SeasonalVegetables> {
fontWeight: FontWeight.w300), fontWeight: FontWeight.w300),
prefixIcon: _showCategory prefixIcon: _showCategory
? GestureDetector( ? GestureDetector(
child: Container( child: Container(
padding: EdgeInsets.only(left: 18.w, right: 18.w), padding: EdgeInsets.only(left: 18.w, right: 18.w),
margin: EdgeInsets.all(12.w), margin: EdgeInsets.all(12.w),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(40.w), borderRadius: BorderRadius.circular(40.w),
color: Color(0xFFF2F2F2)), color: Color(0xFFF2F2F2)),
child: Row( child: Row(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
Text( Text(
'生鲜果蔬', '生鲜果蔬',
// widget.categoryName ?? '', //widget.categoryName ?? '',
style: TextStyle( style: TextStyle(
color: ktextSubColor, color: ktextSubColor,
fontSize: 24.sp, fontSize: 24.sp,
),
),
Icon(
Icons.close,
color: Colors.grey[500],
size: 30.w,
)
],
), ),
height: 44.w,
), ),
Icon( )
Icons.close,
color: Colors.grey[500],
size: 30.w,
)
],
),
height: 44.w,
),
)
: null, : null,
//isDense: true, //isDense: true,
@ -272,15 +275,14 @@ class _SeasonalVegetablesState extends State<SeasonalVegetables> {
20.wb, 20.wb,
GestureDetector( GestureDetector(
onTap: () { onTap: () {
if (TextUtils.isEmpty(_searchText)) return;
_startSearch = true;
_contentFocusNode.unfocus();
_searchText = _searchText.trimLeft();
_searchText = _searchText.trimRight();
remember();
saveSearchListToSharedPreferences(_searchHistory);
_refreshController.callRefresh(); _refreshController.callRefresh();
// if (TextUtils.isEmpty(_searchText)) return;
// _startSearch = true;
// _contentFocusNode.unfocus();
// _searchText = _searchText.trimLeft();
// _searchText = _searchText.trimRight();
// remember();
// saveSearchListToSharedPreferences(_searchHistory);
setState(() {}); setState(() {});
}, },
child: Text( child: Text(
@ -299,6 +301,8 @@ class _SeasonalVegetablesState extends State<SeasonalVegetables> {
child: _goodsTitle(normalTypeButton, salesTypeButton, child: _goodsTitle(normalTypeButton, salesTypeButton,
priceButton, listButton)), priceButton, listButton)),
), ),
_searchHistoryWidget(),
10.hb,
Expanded( Expanded(
child: EasyRefresh( child: EasyRefresh(
firstRefresh: true, firstRefresh: true,
@ -315,29 +319,28 @@ class _SeasonalVegetablesState extends State<SeasonalVegetables> {
child: _onLoad child: _onLoad
? const SizedBox() ? const SizedBox()
: vegetablesList.isEmpty : vegetablesList.isEmpty
? _getListNull() ? _getListNull()
: ListView.builder( : ListView.builder(
itemBuilder: (context, index) { itemBuilder: (context, index) {
return Text(''); return Text('');
}, },
itemCount: vegetablesList.length, itemCount: vegetablesList.length,
))) )))
], ],
)); ));
} }
_goodsTitle(Widget normalTypeButton, _goodsTitle(
Widget salesTypeButton, Widget normalTypeButton,
Widget priceButton, Widget salesTypeButton,
Widget listButton,) { Widget priceButton,
Widget listButton,
) {
return Container( return Container(
height: 90.w, height: 90.w,
alignment: Alignment.centerLeft, alignment: Alignment.centerLeft,
color: Colors.white, color: Colors.white,
width: MediaQuery width: MediaQuery.of(context).size.width,
.of(context)
.size
.width,
child: Container( child: Container(
alignment: Alignment.centerLeft, alignment: Alignment.centerLeft,
height: 60.w, height: 60.w,
@ -389,9 +392,8 @@ class _SeasonalVegetablesState extends State<SeasonalVegetables> {
_editingController.text = text; _editingController.text = text;
_searchText = text; _searchText = text;
setState(() {}); setState(() {});
FocusManager.instance.primaryFocus!.unfocus(); FocusManager.instance.primaryFocus!.unfocus();
_refreshController1.callRefresh(); _refreshController.callRefresh();
}, },
label: Text(text), label: Text(text),
selected: false, selected: false,
@ -403,58 +405,55 @@ class _SeasonalVegetablesState extends State<SeasonalVegetables> {
return _searchHistory.length == 0 return _searchHistory.length == 0
? SizedBox() ? SizedBox()
: Container( : Container(
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: <Widget>[ children: <Widget>[
36.hb, 36.hb,
Container( Container(
child: Container( child: Container(
margin: EdgeInsets.only(left: 15, bottom: 5), margin: EdgeInsets.only(left: 15, bottom: 5),
child: Row( child: Row(
children: <Widget>[ children: <Widget>[
Text( Text(
'历史搜索', '历史搜索',
style: TextStyle( style: TextStyle(
color: Colors.black, color: Colors.black,
fontSize: 16, fontSize: 16,
), ),
), ),
Spacer(), Spacer(),
(_searchHistory.length > 0) (_searchHistory.length > 0)
? GestureDetector( ? GestureDetector(
onTap: () { onTap: () {
_searchHistory = []; _searchHistory = [];
saveSearchListToSharedPreferences( saveSearchListToSharedPreferences(
_searchHistory); _searchHistory);
setState(() {}); setState(() {});
}, },
child: Image.asset( child: Image.asset(
R.ASSETS_ICONS_DELETE_PNG, R.ASSETS_ICONS_DELETE_PNG,
width: 40.w, width: 40.w,
height: 40.w, height: 40.w,
), ),
) )
: Container(), : Container(),
36.wb, 36.wb,
], ],
)), )),
), ),
Container( Container(
width: MediaQuery width: MediaQuery.of(context).size.width,
.of(context) padding: EdgeInsets.only(left: 10, right: 10),
.size child: Wrap(
.width, children: choiceChipList,
padding: EdgeInsets.only(left: 10, right: 10), ),
child: Wrap( ),
children: choiceChipList, // Spacer()
24.hb,
],
), ),
), );
// Spacer()
24.hb,
],
),
);
} }
/// ///

@ -74,7 +74,6 @@ class BeeScaffold extends StatelessWidget {
actions: actions, actions: actions,
bottom: appBarBottom, bottom: appBarBottom,
titleSpacing: titleSpacing, titleSpacing: titleSpacing,
); );
return AnnotatedRegion<SystemUiOverlayStyle>( return AnnotatedRegion<SystemUiOverlayStyle>(

@ -7,16 +7,21 @@ class BeeCustomDialog extends StatelessWidget {
final Widget content; final Widget content;
final double? width; final double? width;
final double? height; final double? height;
const BeeCustomDialog( const BeeCustomDialog(
{Key? key, required this.actions, required this.content, this.width, this.height}) {Key? key,
required this.actions,
required this.content,
this.width,
this.height})
: super(key: key); : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Center( return Center(
child: Container( child: Container(
width: width?? 600.w, width: width ?? 600.w,
height:height?? 700.w, height: height ?? 700.w,
clipBehavior: Clip.antiAliasWithSaveLayer, clipBehavior: Clip.antiAliasWithSaveLayer,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
@ -30,11 +35,13 @@ class BeeCustomDialog extends StatelessWidget {
end: Alignment.bottomCenter, end: Alignment.bottomCenter,
stops: [ stops: [
0, 0,
0.3, 0.35,
], ],
colors: [ colors: [
Color(0x33FBE541), Color(0x33FBE541),
Colors.white, Color(0x33FBE541).withOpacity(0.01),
//Colors.white,
])), ])),
child: Column( child: Column(
children: [ children: [

Loading…
Cancel
Save