分类 + 首页轮播图+列表切换

hmxc
章文轩 3 years ago
parent bd432292fb
commit 57bd25f384

@ -102,4 +102,4 @@ dependencies {
} }
apply plugin: 'com.google.gms.google-services' apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.google.firebase.crashlytics' //apply plugin: 'com.google.firebase.crashlytics'

@ -12,7 +12,7 @@ buildscript {
classpath 'com.android.tools.build:gradle:4.2.0' classpath 'com.android.tools.build:gradle:4.2.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:4.3.5' classpath 'com.google.gms:google-services:4.3.5'
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.5.1' // classpath 'com.google.firebase:firebase-crashlytics-gradle:2.5.1'
} }
} }

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

@ -159,9 +159,6 @@ class R {
static const String ASSETS_ICONS_BORROW_SUCCESS_PNG = static const String ASSETS_ICONS_BORROW_SUCCESS_PNG =
'assets/icons/borrow_success.png'; 'assets/icons/borrow_success.png';
/// ![preview](file:///Users/datang/aku_community/assets/icons/category.png)
static const String ASSETS_ICONS_CATEGORY_PNG = 'assets/icons/category.png';
/// ![preview](file:///Users/datang/aku_community/assets/icons/change.png) /// ![preview](file:///Users/datang/aku_community/assets/icons/change.png)
static const String ASSETS_ICONS_CHANGE_PNG = 'assets/icons/change.png'; static const String ASSETS_ICONS_CHANGE_PNG = 'assets/icons/change.png';
@ -334,6 +331,10 @@ class R {
/// ![preview](file:///Users/datang/aku_community/assets/icons/icon_back.png) /// ![preview](file:///Users/datang/aku_community/assets/icons/icon_back.png)
static const String ASSETS_ICONS_ICON_BACK_PNG = 'assets/icons/icon_back.png'; static const String ASSETS_ICONS_ICON_BACK_PNG = 'assets/icons/icon_back.png';
/// ![preview](file:///Users/datang/aku_community/assets/icons/icon_change_grid.png)
static const String ASSETS_ICONS_ICON_CHANGE_GRID_PNG =
'assets/icons/icon_change_grid.png';
/// ![preview](file:///Users/datang/aku_community/assets/icons/icon_change_list.png) /// ![preview](file:///Users/datang/aku_community/assets/icons/icon_change_list.png)
static const String ASSETS_ICONS_ICON_CHANGE_LIST_PNG = static const String ASSETS_ICONS_ICON_CHANGE_LIST_PNG =
'assets/icons/icon_change_list.png'; 'assets/icons/icon_change_list.png';

@ -546,10 +546,12 @@ class _Market {
///jcook ///jcook
String get findLogistics => '/user/jcookOrder/findLogistics'; String get findLogistics => '/user/jcookOrder/findLogistics';
///jcook ///jcook
String get confirmOrder => '/user/jcookOrder/confirm'; String get confirmOrder => '/user/jcookOrder/confirm';
///jcook
String get findRotationList => '/user/jcookGoods/findRotationList';
} }

@ -5,7 +5,6 @@
// ignore_for_file: lines_longer_than_80_chars // ignore_for_file: lines_longer_than_80_chars
import 'package:device_info_plus_web/device_info_plus_web.dart'; import 'package:device_info_plus_web/device_info_plus_web.dart';
import 'package:firebase_core_web/firebase_core_web.dart';
import 'package:image_picker_for_web/image_picker_for_web.dart'; import 'package:image_picker_for_web/image_picker_for_web.dart';
import 'package:package_info_plus_web/package_info_plus_web.dart'; import 'package:package_info_plus_web/package_info_plus_web.dart';
import 'package:shared_preferences_web/shared_preferences_web.dart'; import 'package:shared_preferences_web/shared_preferences_web.dart';
@ -16,7 +15,6 @@ import 'package:flutter_web_plugins/flutter_web_plugins.dart';
// ignore: public_member_api_docs // ignore: public_member_api_docs
void registerPlugins(Registrar registrar) { void registerPlugins(Registrar registrar) {
DeviceInfoPlusPlugin.registerWith(registrar); DeviceInfoPlusPlugin.registerWith(registrar);
FirebaseCoreWeb.registerWith(registrar);
ImagePickerPlugin.registerWith(registrar); ImagePickerPlugin.registerWith(registrar);
PackageInfoPlugin.registerWith(registrar); PackageInfoPlugin.registerWith(registrar);
SharedPreferencesPlugin.registerWith(registrar); SharedPreferencesPlugin.registerWith(registrar);

@ -6,8 +6,8 @@ import 'package:aku_community/provider/app_provider.dart';
import 'package:aku_community/utils/message_parser.dart'; import 'package:aku_community/utils/message_parser.dart';
import 'package:aku_community/utils/websocket/fire_dialog.dart'; import 'package:aku_community/utils/websocket/fire_dialog.dart';
import 'package:aku_community/utils/websocket/web_socket_util.dart'; import 'package:aku_community/utils/websocket/web_socket_util.dart';
import 'package:firebase_core/firebase_core.dart'; // import 'package:firebase_core/firebase_core.dart';
import 'package:firebase_crashlytics/firebase_crashlytics.dart'; // import 'package:firebase_crashlytics/firebase_crashlytics.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/foundation.dart'; import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -21,21 +21,21 @@ import 'package:provider/provider.dart';
class MainInitialize { class MainInitialize {
///firebase ///firebase
static Future initFirebase() async { // static Future initFirebase() async {
await Firebase.initializeApp(); // await Firebase.initializeApp();
// web MacOS Platform not support firebase // // web MacOS Platform not support firebase
if (!kIsWeb && !Platform.isMacOS) { // if (!kIsWeb && !Platform.isMacOS) {
FirebaseCrashlytics.instance // FirebaseCrashlytics.instance
.setCrashlyticsCollectionEnabled(kReleaseMode); // .setCrashlyticsCollectionEnabled(kReleaseMode);
} // }
FlutterError.onError = (detail) { // FlutterError.onError = (detail) {
LoggerData.addData(detail); // LoggerData.addData(detail);
if (kReleaseMode && !kIsWeb && !Platform.isMacOS) { // if (kReleaseMode && !kIsWeb && !Platform.isMacOS) {
FirebaseCrashlytics.instance.recordFlutterError(detail); // FirebaseCrashlytics.instance.recordFlutterError(detail);
} // }
FlutterError.presentError(detail); // FlutterError.presentError(detail);
}; // };
} // }
static initTheme() { static initTheme() {
SystemChrome.setSystemUIOverlayStyle(SystemStyle.initial); SystemChrome.setSystemUIOverlayStyle(SystemStyle.initial);

@ -1,13 +1,20 @@
class CategoryModel { class CategoryModel {
int? id; int? id;
String? name; String? name;
List<String>? imgUrls;
List<CategoryList>? categoryList; List<CategoryList>? categoryList;
CategoryModel({this.id, this.name, this.categoryList}); CategoryModel({this.id, this.name, this.categoryList,this.imgUrls});
CategoryModel.fromJson(Map<String, dynamic> json) { CategoryModel.fromJson(Map<String, dynamic> json) {
id = json['id']; id = json['id'];
name = json['name']; name = json['name'];
if (json['imgUrls'] != null) {
imgUrls = [];
json['imgUrls'].forEach((v) {
imgUrls!.add(v.toString());
});
}
if (json['categoryList'] != null) { if (json['categoryList'] != null) {
categoryList = []; categoryList = [];
json['categoryList'].forEach((v) { json['categoryList'].forEach((v) {
@ -23,12 +30,16 @@ class CategoryModel {
if (this.categoryList != null) { if (this.categoryList != null) {
data['categoryList'] = this.categoryList!.map((v) => v.toJson()).toList(); data['categoryList'] = this.categoryList!.map((v) => v.toJson()).toList();
} }
if (this.imgUrls != null) {
data['imgUrls'] = this.imgUrls!.map((v) => v).toList();
}
return data; return data;
} }
} }
class CategoryList { class CategoryList {
int? id; int? id;
List<String>? imgUrls;
String? name; String? name;
List<CategoryListSecond>? categoryListSecond; List<CategoryListSecond>? categoryListSecond;
@ -43,6 +54,12 @@ class CategoryList {
categoryListSecond!.add(new CategoryListSecond.fromJson(v)); categoryListSecond!.add(new CategoryListSecond.fromJson(v));
}); });
} }
if (json['imgUrls'] != null) {
imgUrls = [];
json['imgUrls'].forEach((v) {
imgUrls!.add(v.toString());
});
}
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
@ -53,6 +70,9 @@ class CategoryList {
data['categoryList'] = data['categoryList'] =
this.categoryListSecond!.map((v) => v.toJson()).toList(); this.categoryListSecond!.map((v) => v.toJson()).toList();
} }
if (this.imgUrls != null) {
data['imgUrls'] = this.imgUrls!.map((v) => v).toList();
}
return data; return data;
} }
} }
@ -60,13 +80,19 @@ class CategoryList {
class CategoryListSecond { class CategoryListSecond {
int? id; int? id;
String? name; String? name;
List<String>? imgUrls;
CategoryListSecond({this.id, this.name,}); CategoryListSecond({this.id, this.name,});
CategoryListSecond.fromJson(Map<String, dynamic> json) { CategoryListSecond.fromJson(Map<String, dynamic> json) {
id = json['id']; id = json['id'];
name = json['name']; name = json['name'];
if (json['imgUrls'] != null) {
imgUrls = [];
json['imgUrls'].forEach((v) {
imgUrls!.add(v.toString());
});
}
} }
@ -74,7 +100,9 @@ class CategoryListSecond {
final Map<String, dynamic> data = new Map<String, dynamic>(); final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id; data['id'] = this.id;
data['name'] = this.name; data['name'] = this.name;
if (this.imgUrls != null) {
data['imgUrls'] = this.imgUrls!.map((v) => v).toList();
}
return data; return data;
} }
} }

@ -0,0 +1,59 @@
class MarketSwiperModel {
int? id;
int? jcookGoodsId;
int? skuId;
List<ImgList>? imgList;
MarketSwiperModel({this.id, this.jcookGoodsId, this.skuId, this.imgList});
MarketSwiperModel.fromJson(Map<String, dynamic> json) {
id = json['id'];
jcookGoodsId = json['jcookGoodsId'];
skuId = json['skuId'];
if (json['imgList'] != null) {
imgList = [];
json['imgList'].forEach((v) {
imgList!.add(new ImgList.fromJson(v));
});
}
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['jcookGoodsId'] = this.jcookGoodsId;
data['skuId'] = this.skuId;
if (this.imgList != null) {
data['imgList'] = this.imgList!.map((v) => v.toJson()).toList();
}
return data;
}
}
class ImgList {
String? url;
String? size;
int? longs;
int? paragraph;
int? sort;
ImgList({this.url, this.size, this.longs, this.paragraph, this.sort});
ImgList.fromJson(Map<String, dynamic> json) {
url = json['url'];
size = json['size'];
longs = json['longs'];
paragraph = json['paragraph'];
sort = json['sort'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['url'] = this.url;
data['size'] = this.size;
data['longs'] = this.longs;
data['paragraph'] = this.paragraph;
data['sort'] = this.sort;
return data;
}
}

@ -103,40 +103,40 @@ class _PropertyPageState extends State<PropertyPage>
textAlign: TextAlign.center, textAlign: TextAlign.center,
), ),
]), ]),
actions: [ // actions: [
GestureDetector( // GestureDetector(
onTap: () { // onTap: () {
Get.to(() => BeeSearch()); // Get.to(() => BeeSearch());
}, // },
child: Image.asset(R.ASSETS_ICONS_ICON_PROPERTY_SEARCH_PNG, // child: Image.asset(R.ASSETS_ICONS_ICON_PROPERTY_SEARCH_PNG,
height: 40.w, width: 40.w), // height: 40.w, width: 40.w),
), // ),
Padding( // // Padding(
padding: EdgeInsets.only(right: 10.w, left: 12.w), // // padding: EdgeInsets.only(right: 10.w, left: 12.w),
child: Badge( // // child: Badge(
elevation: 0, // // elevation: 0,
badgeColor: Color(0xFFCF2525), // // badgeColor: Color(0xFFCF2525),
padding: sum > 9 ? EdgeInsets.all(2.w) : EdgeInsets.all(5.w), // // padding: sum > 9 ? EdgeInsets.all(2.w) : EdgeInsets.all(5.w),
showBadge: appProvider.messageCenterModel.commentCount != 0 || // // showBadge: appProvider.messageCenterModel.commentCount != 0 ||
appProvider.messageCenterModel.sysCount != 0, // // appProvider.messageCenterModel.sysCount != 0,
position: BadgePosition.topEnd( // // position: BadgePosition.topEnd(
top: 3, // // top: 8.w,
end: -5, // // end: -4.w,
), // // ),
badgeContent: Text( // // badgeContent: Text(
(sum).toString(), // // (sum).toString(),
style: TextStyle(color: Colors.white, fontSize: 10.sp), // // style: TextStyle(color: Colors.white, fontSize: 20.sp),
), // // ),
child: GestureDetector( // // child: GestureDetector(
onTap: () { // // onTap: () {
if (LoginUtil.isNotLogin) return; // // if (LoginUtil.isNotLogin) return;
Get.to(() => MessageCenterPage()); // // Get.to(() => MessageCenterPage());
}, // // },
child: Image.asset(R.ASSETS_ICONS_ICON_PROPERTY_MESSAGE_PNG, // // child: Image.asset(R.ASSETS_ICONS_ICON_PROPERTY_MESSAGE_PNG,
height: 40.w, width: 40.w), // // height: 40.w, width: 40.w),
)), // // )),
), // // ),
], // ],
expandedHeight: 420.w, expandedHeight: 420.w,
backgroundColor: Colors.white, backgroundColor: Colors.white,
flexibleSpace: Stack( flexibleSpace: Stack(
@ -156,7 +156,7 @@ class _PropertyPageState extends State<PropertyPage>
bottom: 0), bottom: 0),
Positioned( Positioned(
child: Container( child: Container(
margin: EdgeInsets.only(left: 32.w, right: 32.w), margin: EdgeInsets.only(left: 32.w, right: 32.w,top: 10.w),
width: 686.w, width: 686.w,
height: 74.w, height: 74.w,
decoration: BoxDecoration( decoration: BoxDecoration(

@ -67,11 +67,6 @@ class UserProvider extends ChangeNotifier {
Future updateProfile() async { Future updateProfile() async {
_userInfoModel = await SignFunc.getUserInfo(); _userInfoModel = await SignFunc.getUserInfo();
if (_userInfoModel != null && !kIsWeb && !Platform.isMacOS) { if (_userInfoModel != null && !kIsWeb && !Platform.isMacOS) {
try {
await JPush().setAlias(_userInfoModel!.id.toString());
} catch (e) {
LoggerData.addData(e);
}
} }
notifyListeners(); notifyListeners();
} }

@ -5,6 +5,7 @@ import 'package:aku_community/model/community/community_topic_model.dart';
import 'package:aku_community/model/community/hot_news_model.dart'; import 'package:aku_community/model/community/hot_news_model.dart';
import 'package:aku_community/model/community/swiper_model.dart'; import 'package:aku_community/model/community/swiper_model.dart';
import 'package:aku_community/model/good/category_model.dart'; import 'package:aku_community/model/good/category_model.dart';
import 'package:aku_community/model/good/market_swiper_model.dart';
import 'package:aku_community/models/market/goods_classification.dart'; import 'package:aku_community/models/market/goods_classification.dart';
import 'package:aku_community/models/market/goods_popular_model.dart'; import 'package:aku_community/models/market/goods_popular_model.dart';
import 'package:aku_community/models/market/order/goods_home_model.dart'; import 'package:aku_community/models/market/order/goods_home_model.dart';
@ -131,6 +132,17 @@ class CommunityFunc {
} }
} }
///
static Future<List<MarketSwiperModel>> marketSwiper() async {
BaseModel model = await NetUtil().get(
API.market.findRotationList,
);
if (model.data!.length == 0)
return [];
return (model.data as List)
.map((e) => MarketSwiperModel.fromJson(e))
.toList();
}

@ -15,7 +15,8 @@ import 'new_category_sub_view.dart';
class NewCategoryPage extends StatefulWidget { class NewCategoryPage extends StatefulWidget {
final List<CategoryModel> models; final List<CategoryModel> models;
NewCategoryPage({Key? key, required this.models}) : super(key: key); final int index;
NewCategoryPage({Key? key, required this.models, required this.index}) : super(key: key);
@override @override
_NewCategoryPageState createState() => _NewCategoryPageState(); _NewCategoryPageState createState() => _NewCategoryPageState();
@ -28,7 +29,8 @@ class _NewCategoryPageState extends State<NewCategoryPage>
@override @override
void initState() { void initState() {
super.initState(); super.initState();
_tabController = TabController(length: widget.models.length, vsync: this); _index=widget.index;
_tabController = TabController(length: widget.models.length, vsync: this,initialIndex: widget.index);
} }
@override @override

@ -26,7 +26,7 @@ class NewCategorySubCard extends StatelessWidget {
children: [ children: [
Spacer(), Spacer(),
FadeInImage.assetNetwork( FadeInImage.assetNetwork(
image:'', image:API.image(subModels.imgUrls!.isNotEmpty? subModels.imgUrls!.first :''),//subModels.imgUrls!.isNotEmpty? subModels.imgUrls!.first :'',
placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP, placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP,
height: 75.w, height: 75.w,
width: 75.w, width: 75.w,
@ -49,7 +49,7 @@ class NewCategorySubCard extends StatelessWidget {
], ],
), ),
onPressed: () async { onPressed: () async {
Get.to(()=> SearchGoodsPage(search:subModels.name ,)); Get.to(()=> SearchGoodsPage(categoryName:subModels.name ,categoryId:subModels.id ,));
// await Get.to( // await Get.to(
// () => GoodsListView( // () => GoodsListView(
// model: model, // model: model,

@ -5,6 +5,7 @@ import 'package:aku_community/constants/api.dart';
import 'package:aku_community/model/common/img_model.dart'; import 'package:aku_community/model/common/img_model.dart';
import 'package:aku_community/model/community/swiper_model.dart'; import 'package:aku_community/model/community/swiper_model.dart';
import 'package:aku_community/model/good/category_model.dart'; import 'package:aku_community/model/good/category_model.dart';
import 'package:aku_community/model/good/market_swiper_model.dart';
import 'package:aku_community/models/market/goods_classification.dart'; import 'package:aku_community/models/market/goods_classification.dart';
import 'package:aku_community/models/market/goods_popular_model.dart'; import 'package:aku_community/models/market/goods_popular_model.dart';
import 'package:aku_community/models/market/order/goods_home_model.dart'; import 'package:aku_community/models/market/order/goods_home_model.dart';
@ -62,7 +63,8 @@ class _MarketPageState extends State<MarketPage>
double tabBarHeight = 40.w; double tabBarHeight = 40.w;
late TabController _tabController; late TabController _tabController;
List<SwiperModel> _swiperModels = []; // List<SwiperModel> _swiperModels = [];
List<MarketSwiperModel> _marketSwiperModels = [];
List<CategoryModel> _categoryModels = []; List<CategoryModel> _categoryModels = [];
@ -176,7 +178,8 @@ class _MarketPageState extends State<MarketPage>
_refresh() async { _refresh() async {
await updateMarketInfo(); await updateMarketInfo();
_swiperModels = await CommunityFunc.swiper(); //_swiperModels = await CommunityFunc.swiper();
_marketSwiperModels = await CommunityFunc.marketSwiper();
_newTotal = await CommunityFunc.getNewProductsTodayNum(); _newTotal = await CommunityFunc.getNewProductsTodayNum();
_total = await CommunityFunc.getSkuTotal(); _total = await CommunityFunc.getSkuTotal();
_brandTotal = await CommunityFunc.getSettledBrandsNum(); _brandTotal = await CommunityFunc.getSettledBrandsNum();
@ -614,7 +617,7 @@ class _MarketPageState extends State<MarketPage>
child: Swiper( child: Swiper(
key: UniqueKey(), key: UniqueKey(),
itemBuilder: (BuildContext context, int index) { itemBuilder: (BuildContext context, int index) {
return getSwiperImage(_swiperModels[index]); return getSwiperImage(_marketSwiperModels[index]);
}, },
pagination: SwiperPagination( pagination: SwiperPagination(
@ -623,7 +626,7 @@ class _MarketPageState extends State<MarketPage>
builder: (BuildContext context, SwiperPluginConfig config) { builder: (BuildContext context, SwiperPluginConfig config) {
return RectIndicator( return RectIndicator(
position: config.activeIndex, position: config.activeIndex,
count: _swiperModels.length, count: _marketSwiperModels.length,
activeColor: Color(0x99FFFFFF), activeColor: Color(0x99FFFFFF),
color: Color(0xD9FFFFFF), color: Color(0xD9FFFFFF),
// keyColor // keyColor
@ -640,16 +643,19 @@ class _MarketPageState extends State<MarketPage>
// control: new SwiperControl(), // control: new SwiperControl(),
autoplay: true, autoplay: true,
onTap: (index) { onTap: (index) {
Get.to(() => if(_marketSwiperModels[index].jcookGoodsId!=null){
PublicInformationDetailPage(id: _swiperModels[index].newsId!)); Get.to(
() => GoodDetailPage(goodId: _marketSwiperModels[index].jcookGoodsId!),
);
}
}, },
itemCount: _swiperModels.length, itemCount: _marketSwiperModels.length,
), ),
), ),
); );
} }
Widget getSwiperImage(SwiperModel swiperModel) { Widget getSwiperImage(MarketSwiperModel swiperModel) {
return Container( return Container(
clipBehavior: Clip.antiAlias, clipBehavior: Clip.antiAlias,
decoration: BoxDecoration( decoration: BoxDecoration(
@ -657,7 +663,7 @@ class _MarketPageState extends State<MarketPage>
), ),
child: FadeInImage.assetNetwork( child: FadeInImage.assetNetwork(
placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP, placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP,
image: API.image(ImgModel.first(swiperModel.voResourcesImgList)), image:API.image(swiperModel.imgList!.isNotEmpty? swiperModel.imgList!.first.url :''),
fit: BoxFit.fill, fit: BoxFit.fill,
imageErrorBuilder: (context, error, stackTrace) { imageErrorBuilder: (context, error, stackTrace) {
return Image.asset( return Image.asset(
@ -671,6 +677,7 @@ class _MarketPageState extends State<MarketPage>
_buttonTitle() { _buttonTitle() {
Container titles = Container( Container titles = Container(
key:UniqueKey(),
alignment: Alignment.center, alignment: Alignment.center,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
@ -685,7 +692,7 @@ class _MarketPageState extends State<MarketPage>
if (index == 9) { if (index == 9) {
return _buildAllTile(); return _buildAllTile();
} else { } else {
return _buildTile(_goodsClassificationList[index]); return _buildTile(_goodsClassificationList[index],index);
} }
}, },
itemCount: 10, itemCount: 10,
@ -701,8 +708,11 @@ class _MarketPageState extends State<MarketPage>
); );
} }
_buildTile(GoodsClassification item) { _buildTile(GoodsClassification item,int index) {
return GestureDetector( return GestureDetector(
onTap: (){
Get.to(() => NewCategoryPage(models: _categoryModels,index: index,));
},
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
@ -732,7 +742,7 @@ class _MarketPageState extends State<MarketPage>
_buildAllTile() { _buildAllTile() {
return GestureDetector( return GestureDetector(
onTap: () async{ onTap: () async{
Get.to(() => NewCategoryPage(models: _categoryModels)); Get.to(() => NewCategoryPage(models: _categoryModels,index: 0,));
}, },
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
@ -840,6 +850,7 @@ class _MarketPageState extends State<MarketPage>
child: Container( child: Container(
width: 96.w, width: 96.w,
height: 96.w, height: 96.w,
key:UniqueKey(),
child: FadeInImage.assetNetwork( child: FadeInImage.assetNetwork(
placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP, placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP,
image: _goodsPopularModelList[index].mainPhoto ?? '', image: _goodsPopularModelList[index].mainPhoto ?? '',
@ -903,6 +914,7 @@ class _MarketPageState extends State<MarketPage>
normalTypeButton, normalTypeButton,
salesTypeButton, salesTypeButton,
priceButton, priceButton,
], ],
), ),
), ),

@ -1,301 +1,301 @@
// import 'package:aku_community/base/base_style.dart'; // // import 'package:aku_community/base/base_style.dart';
//
import 'package:flutter/cupertino.dart'; // import 'package:flutter/cupertino.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';
import 'package:flutter_easyrefresh/easy_refresh.dart'; // import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; // import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart'; // import 'package:get/get.dart';
import 'package:waterfall_flow/waterfall_flow.dart'; // import 'package:waterfall_flow/waterfall_flow.dart';
//
import 'package:aku_community/constants/api.dart'; // import 'package:aku_community/constants/api.dart';
import 'package:aku_community/models/market/display_category_model.dart'; // import 'package:aku_community/models/market/display_category_model.dart';
import 'package:aku_community/models/market/goods_item.dart'; // import 'package:aku_community/models/market/goods_item.dart';
import 'package:aku_community/models/market/market_category_model.dart'; // import 'package:aku_community/models/market/market_category_model.dart';
import 'package:aku_community/ui/market/category/category_card.dart'; // import 'package:aku_community/ui/market/category/category_card.dart';
import 'package:aku_community/ui/market/category/category_page.dart'; // import 'package:aku_community/ui/market/category/category_page.dart';
import 'package:aku_community/ui/market/goods/goods_card.dart'; // import 'package:aku_community/ui/market/goods/goods_card.dart';
import 'package:aku_community/ui/market/order/my_order_page.dart'; // import 'package:aku_community/ui/market/order/my_order_page.dart';
import 'package:aku_community/ui/market/search/search_goods_page.dart'; // import 'package:aku_community/ui/market/search/search_goods_page.dart';
import 'package:aku_community/utils/headers.dart'; // import 'package:aku_community/utils/headers.dart';
import 'package:aku_community/utils/network/base_list_model.dart'; // import 'package:aku_community/utils/network/base_list_model.dart';
import 'package:aku_community/utils/network/net_util.dart'; // import 'package:aku_community/utils/network/net_util.dart';
import 'package:aku_community/widget/bee_scaffold.dart'; // import 'package:aku_community/widget/bee_scaffold.dart';
//
// import 'package:aku_community/ui/market/goods/goods_detail_page.dart'; // // import 'package:aku_community/ui/market/goods/goods_detail_page.dart';
//
// import 'package:aku_community/widget/tab_bar/bee_tab_bar.dart'; // // import 'package:aku_community/widget/tab_bar/bee_tab_bar.dart';
//
class MarketPage111 extends StatefulWidget { // class MarketPage111 extends StatefulWidget {
MarketPage111({Key? key}) : super(key: key); // MarketPage111({Key? key}) : super(key: key);
//
@override // @override
_MarketPageState createState() => _MarketPageState(); // _MarketPageState createState() => _MarketPageState();
} // }
//
class _MarketPageState extends State<MarketPage111> // class _MarketPageState extends State<MarketPage111>
with AutomaticKeepAliveClientMixin { // with AutomaticKeepAliveClientMixin {
List<MarketCategoryModel> _marketModels = []; // List<MarketCategoryModel> _marketModels = [];
List<GoodsItem> _hotItems = []; // List<GoodsItem> _hotItems = [];
late EasyRefreshController _refreshController; // late EasyRefreshController _refreshController;
int _pageNum = 1; // int _pageNum = 1;
int _size = 4; // int _size = 4;
int _pageCount = 0; // int _pageCount = 0;
//
Future updateMarketInfo() async { // Future updateMarketInfo() async {
BaseListModel baseListModel = // BaseListModel baseListModel =
await NetUtil().getList(API.market.hotTop, params: { // await NetUtil().getList(API.market.hotTop, params: {
"pageNum": _pageNum, // "pageNum": _pageNum,
"size": _size, // "size": _size,
}); // });
if (baseListModel.tableList!.isNotEmpty) { // if (baseListModel.tableList!.isNotEmpty) {
_hotItems = (baseListModel.tableList as List) // _hotItems = (baseListModel.tableList as List)
.map((e) => GoodsItem.fromJson(e)) // .map((e) => GoodsItem.fromJson(e))
.toList(); // .toList();
} // }
_pageCount = baseListModel.pageCount!; // _pageCount = baseListModel.pageCount!;
} // }
//
Future loadMarketInfo() async { // Future loadMarketInfo() async {
BaseListModel baseListModel = // BaseListModel baseListModel =
await NetUtil().getList(API.market.hotTop, params: { // await NetUtil().getList(API.market.hotTop, params: {
"pageNum": _pageNum, // "pageNum": _pageNum,
"size": _size, // "size": _size,
}); // });
if (baseListModel.tableList!.isNotEmpty) { // if (baseListModel.tableList!.isNotEmpty) {
_hotItems.addAll((baseListModel.tableList as List) // _hotItems.addAll((baseListModel.tableList as List)
.map((e) => GoodsItem.fromJson(e)) // .map((e) => GoodsItem.fromJson(e))
.toList()); // .toList());
} // }
_pageCount = baseListModel.pageCount!; // _pageCount = baseListModel.pageCount!;
} // }
//
@override // @override
void initState() { // void initState() {
super.initState(); // super.initState();
_refreshController = EasyRefreshController(); // _refreshController = EasyRefreshController();
Future.delayed(Duration(milliseconds: 0), () async { // Future.delayed(Duration(milliseconds: 0), () async {
_marketModels = await DisplayCategoryModel.top8; // _marketModels = await DisplayCategoryModel.top8;
await updateMarketInfo(); // await updateMarketInfo();
setState(() {}); // setState(() {});
}); // });
} // }
//
@override // @override
void dispose() { // void dispose() {
_refreshController.dispose(); // _refreshController.dispose();
super.dispose(); // super.dispose();
} // }
//
@override // @override
Widget build(BuildContext context) { // Widget build(BuildContext context) {
super.build(context); // super.build(context);
final mediaWidth = MediaQuery.of(context).size.width; // final mediaWidth = MediaQuery.of(context).size.width;
return BeeScaffold( // return BeeScaffold(
leading: IconButton( // leading: IconButton(
icon: Icon(CupertinoIcons.search), // icon: Icon(CupertinoIcons.search),
onPressed: () { // onPressed: () {
Get.to(() => SearchGoodsPage()); // Get.to(() => SearchGoodsPage());
}, // },
), // ),
title: '商城', // title: '商城',
actions: [ // actions: [
MaterialButton( // MaterialButton(
minWidth: 108.w, // minWidth: 108.w,
padding: EdgeInsets.zero, // padding: EdgeInsets.zero,
onPressed: () async { // onPressed: () async {
// Get.to(() => SecondHandPage()); // // Get.to(() => SecondHandPage());
Get.to(() => MyOrderPage()); // Get.to(() => MyOrderPage());
}, // },
child: Column( // child: Column(
mainAxisAlignment: MainAxisAlignment.center, // mainAxisAlignment: MainAxisAlignment.center,
mainAxisSize: MainAxisSize.max, // mainAxisSize: MainAxisSize.max,
children: [ // children: [
Image.asset( // Image.asset(
R.ASSETS_ICONS_SECOND_HAND_PNG, // R.ASSETS_ICONS_SECOND_HAND_PNG,
width: 48.w, // width: 48.w,
height: 48.w, // height: 48.w,
), // ),
4.hb, // 4.hb,
// '二手'.text.size(20.sp).black.make(), // // '二手'.text.size(20.sp).black.make(),
'订单'.text.size(20.sp).black.make(), // '订单'.text.size(20.sp).black.make(),
], // ],
), // ),
), // ),
MaterialButton( // MaterialButton(
minWidth: 108.w, // minWidth: 108.w,
padding: EdgeInsets.zero, // padding: EdgeInsets.zero,
onPressed: () async { // onPressed: () async {
final cancel = BotToast.showLoading(); // final cancel = BotToast.showLoading();
List<MarketCategoryModel> models = // List<MarketCategoryModel> models =
await DisplayCategoryModel.fetchCategory(0); // await DisplayCategoryModel.fetchCategory(0);
cancel(); // cancel();
Get.to(() => CategoryPage(models: models)); // Get.to(() => CategoryPage(models: models));
}, // },
child: Column( // child: Column(
mainAxisAlignment: MainAxisAlignment.center, // mainAxisAlignment: MainAxisAlignment.center,
mainAxisSize: MainAxisSize.max, // mainAxisSize: MainAxisSize.max,
children: [ // children: [
Image.asset( // Image.asset(
R.ASSETS_ICONS_CATEGORY_PNG, // R.ASSETS_ICONS_CATEGORY_PNG,
width: 48.w, // width: 48.w,
height: 48.w, // height: 48.w,
), // ),
4.hb, // 4.hb,
'分类'.text.size(20.sp).black.make(), // '分类'.text.size(20.sp).black.make(),
], // ],
), // ),
), // ),
], // ],
body: // body:
NestedScrollView( // NestedScrollView(
headerSliverBuilder: (context, value) { // headerSliverBuilder: (context, value) {
var gridItems = Material( // var gridItems = Material(
color: Colors.white, // color: Colors.white,
clipBehavior: Clip.antiAlias, // clipBehavior: Clip.antiAlias,
borderRadius: BorderRadius.circular(8.w), // borderRadius: BorderRadius.circular(8.w),
child: GridView( // child: GridView(
physics: NeverScrollableScrollPhysics(), // physics: NeverScrollableScrollPhysics(),
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( // gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 4, // crossAxisCount: 4,
childAspectRatio: 1, // childAspectRatio: 1,
), // ),
shrinkWrap: true, // shrinkWrap: true,
children: // children:
_marketModels.map((e) => CategoryCard(model: e)).toList(), // _marketModels.map((e) => CategoryCard(model: e)).toList(),
), // ),
); // );
return [ // return [
SliverAppBar( // SliverAppBar(
//AppBar top Widget height // //AppBar top Widget height
//bottom height: 48 // //bottom height: 48
// flexibleSpace ( - )/4*2 + + bottom + top // // flexibleSpace ( - )/4*2 + + bottom + top
// * // // *
//expandedHeight: // //expandedHeight:
//(mediaWidth - 32.w * 2) / 4 * 2 + 16.w * 2 + 48 + 68.w, // //(mediaWidth - 32.w * 2) / 4 * 2 + 16.w * 2 + 48 + 68.w,
// // //
expandedHeight: (mediaWidth - 32.w * 2) / 4 * 2 + 16.w * 2, // expandedHeight: (mediaWidth - 32.w * 2) / 4 * 2 + 16.w * 2,
backgroundColor: Colors.transparent, // backgroundColor: Colors.transparent,
elevation: 0, // elevation: 0,
flexibleSpace: FlexibleSpaceBar( // flexibleSpace: FlexibleSpaceBar(
background: Container( // background: Container(
color: Color(0xFFF9F9F9), // color: Color(0xFFF9F9F9),
padding: EdgeInsets.only( // padding: EdgeInsets.only(
top: 16.w, // top: 16.w,
left: 32.w, // left: 32.w,
right: 32.w, // right: 32.w,
bottom: 16.w, //bottom // bottom: 16.w, //bottom
), // ),
child: Column( // child: Column(
children: [ // children: [
// SizedBox( // // SizedBox(
// height: 58.w, // // height: 58.w,
// child: Row( // // child: Row(
// children: [ // // children: [
// Text( // // Text(
// '热搜:', // // '热搜:',
// style: TextStyle( // // style: TextStyle(
// fontSize: 20.sp, // // fontSize: 20.sp,
// ), // // ),
// ), // // ),
// 20.wb, // // 20.wb,
// ListView.separated( // // ListView.separated(
// scrollDirection: Axis.horizontal, // // scrollDirection: Axis.horizontal,
// separatorBuilder: (_, __) => 20.wb, // // separatorBuilder: (_, __) => 20.wb,
// itemBuilder: (context, index) { // // itemBuilder: (context, index) {
// final item = _hotItems[index]; // // final item = _hotItems[index];
// return MaterialButton( // // return MaterialButton(
// padding: // // padding:
// EdgeInsets.symmetric(horizontal: 40.w), // // EdgeInsets.symmetric(horizontal: 40.w),
// minWidth: 0, // // minWidth: 0,
// shape: StadiumBorder( // // shape: StadiumBorder(
// side: BorderSide( // // side: BorderSide(
// color: ktextSubColor, // // color: ktextSubColor,
// width: 1, // // width: 1,
// ), // // ),
// ), // // ),
// materialTapTargetSize: // // materialTapTargetSize:
// MaterialTapTargetSize.shrinkWrap, // // MaterialTapTargetSize.shrinkWrap,
// onPressed: () { // // onPressed: () {
// Get.to(() => GoodsDetailPage(id: item.id)); // // Get.to(() => GoodsDetailPage(id: item.id));
// }, // // },
// child: Text( // // child: Text(
// item.title, // // item.title,
// style: TextStyle( // // style: TextStyle(
// color: ktextSubColor, // // color: ktextSubColor,
// ), // // ),
// ), // // ),
// ); // // );
// }, // // },
// itemCount: _hotItems.length, // // itemCount: _hotItems.length,
// ).expand(), // // ).expand(),
// ], // // ],
// ), // // ),
// ), // // ),
// 10.hb, // // 10.hb,
gridItems.expand(), // gridItems.expand(),
], // ],
), // ),
), // ),
), // ),
pinned: true, // pinned: true,
toolbarHeight: 0, // toolbarHeight: 0,
// bottom: PreferredSize( // // bottom: PreferredSize(
// child: Material( // // child: Material(
// color: Color(0xFFF9F9F9), // // color: Color(0xFFF9F9F9),
// child: Align( // // child: Align(
// alignment: Alignment.centerLeft, // // alignment: Alignment.centerLeft,
// child: BeeTabBar( // // child: BeeTabBar(
// scrollable: true, // // scrollable: true,
// controller: _tabController, // // controller: _tabController,
// tabs: ['社区商城', '二手市场'], // // tabs: ['社区商城', '二手市场'],
// ), // // ),
// ), // // ),
// ), // // ),
// preferredSize: Size.fromHeight(48), // // preferredSize: Size.fromHeight(48),
// ), // // ),
), // ),
]; // ];
}, // },
body: EasyRefresh( // body: EasyRefresh(
firstRefresh: false, // firstRefresh: false,
enableControlFinishLoad: false, // enableControlFinishLoad: false,
header: MaterialHeader(), // header: MaterialHeader(),
footer: MaterialFooter(), // footer: MaterialFooter(),
controller: _refreshController, // controller: _refreshController,
onRefresh: () async { // onRefresh: () async {
_pageNum = 1; // _pageNum = 1;
await updateMarketInfo(); // await updateMarketInfo();
setState(() {}); // setState(() {});
}, // },
onLoad: () async { // onLoad: () async {
_pageNum++; // _pageNum++;
await loadMarketInfo(); // await loadMarketInfo();
if (_pageCount <= _pageNum) { // if (_pageCount <= _pageNum) {
_refreshController.finishLoad(noMore: false); // _refreshController.finishLoad(noMore: false);
} // }
setState(() {}); // setState(() {});
}, // },
child: WaterfallFlow.builder( // child: WaterfallFlow.builder(
gridDelegate: SliverWaterfallFlowDelegateWithFixedCrossAxisCount( // gridDelegate: SliverWaterfallFlowDelegateWithFixedCrossAxisCount(
crossAxisCount: 2, // crossAxisCount: 2,
mainAxisSpacing: 20.w, // mainAxisSpacing: 20.w,
crossAxisSpacing: 20.w, // crossAxisSpacing: 20.w,
), // ),
padding: EdgeInsets.all(32.w), // padding: EdgeInsets.all(32.w),
itemBuilder: (context, index) { // itemBuilder: (context, index) {
return SizedBox(); // return SizedBox();
//final item = _hotItems[index]; // //final item = _hotItems[index];
// return GoodsCard(item: item); // // return GoodsCard(item: item);
}, // },
itemCount: _hotItems.length, // itemCount: _hotItems.length,
), // ),
), // ),
), // ),
); // );
} // }
//
@override // @override
bool get wantKeepAlive => true; // bool get wantKeepAlive => true;
} // }

@ -19,7 +19,6 @@ import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:aku_community/base/base_style.dart'; import 'package:aku_community/base/base_style.dart';
import 'package:aku_community/constants/api.dart'; import 'package:aku_community/constants/api.dart';
import 'package:aku_community/models/market/goods_item.dart'; import 'package:aku_community/models/market/goods_item.dart';
@ -27,7 +26,9 @@ import 'package:aku_community/pages/things_page/widget/bee_list_view.dart';
import 'package:aku_community/ui/market/goods/goods_card.dart'; import 'package:aku_community/ui/market/goods/goods_card.dart';
import 'package:aku_community/utils/headers.dart'; import 'package:aku_community/utils/headers.dart';
import 'package:aku_community/widget/bee_scaffold.dart'; import 'package:aku_community/widget/bee_scaffold.dart';
import 'package:waterfall_flow/waterfall_flow.dart';
import '../search_goods_card.dart';
import 'good_detail_page.dart'; import 'good_detail_page.dart';
import 'goods_list_card.dart'; import 'goods_list_card.dart';
@ -39,8 +40,11 @@ enum OrderType {
} }
class SearchGoodsPage extends StatefulWidget { class SearchGoodsPage extends StatefulWidget {
final String? search; final String? categoryName;
SearchGoodsPage({Key? key, this.search}) : super(key: key); final int? categoryId;
SearchGoodsPage({Key? key, this.categoryName, this.categoryId})
: super(key: key);
@override @override
SearchGoodsPageState createState() => SearchGoodsPageState(); SearchGoodsPageState createState() => SearchGoodsPageState();
@ -49,6 +53,7 @@ class SearchGoodsPage extends StatefulWidget {
class SearchGoodsPageState extends State<SearchGoodsPage> { 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;
String priceIcon = R.ASSETS_ICONS_ICON_PRICE_NORMAL_PNG; String priceIcon = R.ASSETS_ICONS_ICON_PRICE_NORMAL_PNG;
EasyRefreshController _refreshController = EasyRefreshController(); EasyRefreshController _refreshController = EasyRefreshController();
@ -58,22 +63,23 @@ class SearchGoodsPageState extends State<SearchGoodsPage> {
FocusNode _contentFocusNode = FocusNode(); FocusNode _contentFocusNode = FocusNode();
bool _showList = true; bool _showList = true;
bool _startSearch = false; bool _startSearch = false;
int? orderBySalesVolume; int? orderBySalesVolume;
int? orderByPrice; int? orderByPrice;
int? brandId; int? brandId;
double? minPrice; double? minPrice;
double? maxPrice; double? maxPrice;
List<SearchGoodsModel> _models = []; List<SearchGoodsModel> _models = [];
ScrollController _scrollController= new ScrollController(); ScrollController _scrollController = new ScrollController();
List<GoodsPopularModel> goodsPopularModels = []; List<GoodsPopularModel> goodsPopularModels = [];
int? categoryThirdId;
bool _showCategory = false;
bool _showListOrGrid = true;//true list false grid
@override @override
void initState() { void initState() {
super.initState(); super.initState();
if(widget.search!=null){ if (widget.categoryName != null) {
_startSearch = true; _showCategory = true;
_searchText = widget.search??'';
_editingController.text = widget.search??'';
} }
getSearchListFromSharedPreferences(); getSearchListFromSharedPreferences();
@ -102,11 +108,10 @@ class SearchGoodsPageState extends State<SearchGoodsPage> {
child: Text( child: Text(
'综合', '综合',
style: TextStyle( style: TextStyle(
color: color: _orderType == OrderType.NORMAL ? kBalckSubColor : ktextPrimary,
_orderType == OrderType.NORMAL ? kBalckSubColor : ktextPrimary,
fontSize: _orderType == OrderType.NORMAL ? 32.sp : 28.sp, fontSize: _orderType == OrderType.NORMAL ? 32.sp : 28.sp,
fontWeight: _orderType == OrderType.NORMAL fontWeight: _orderType == OrderType.NORMAL
?FontWeight.bold ? FontWeight.bold
: FontWeight.normal, : FontWeight.normal,
), ),
), ),
@ -118,18 +123,17 @@ class SearchGoodsPageState extends State<SearchGoodsPage> {
_orderType = OrderType.SALES; _orderType = OrderType.SALES;
orderBySalesVolume = 2; orderBySalesVolume = 2;
orderByPrice = null; orderByPrice = null;
priceIcon = R.ASSETS_ICONS_ICON_PRICE_NORMAL_PNG; priceIcon = R.ASSETS_ICONS_ICON_PRICE_NORMAL_PNG;
_refreshController1.callRefresh(); _refreshController1.callRefresh();
setState(() {}); setState(() {});
}, },
child: Text( child: Text(
'销量', '销量',
style: TextStyle( style: TextStyle(
color: color: _orderType == OrderType.SALES ? kBalckSubColor : ktextPrimary,
_orderType == OrderType.SALES ? kBalckSubColor : ktextPrimary,
fontSize: _orderType == OrderType.SALES ? 32.sp : 28.sp, fontSize: _orderType == OrderType.SALES ? 32.sp : 28.sp,
fontWeight: _orderType == OrderType.SALES fontWeight: _orderType == OrderType.SALES
?FontWeight.bold ? FontWeight.bold
: FontWeight.normal, : FontWeight.normal,
), ),
), ),
@ -169,16 +173,16 @@ class SearchGoodsPageState extends State<SearchGoodsPage> {
'价格', '价格',
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,
), ),
), ),
@ -190,36 +194,114 @@ class SearchGoodsPageState extends State<SearchGoodsPage> {
// ? kBalckSubColor // ? kBalckSubColor
// : ktextPrimary, // : ktextPrimary,
// ), // ),
Image.asset(priceIcon,width: 32.w,height: 32.w,) Image.asset(
priceIcon,
width: 32.w,
height: 32.w,
)
], ],
), ),
height: 80.w, height: 80.w,
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
); );
return return BeeScaffold(
BeeScaffold( titleSpacing: 0,
bgColor: Color(0xFFF9F9F9),
bodyColor: Color(0xFFF9F9F9),
title: Row(
children: [
Container(
width: 520.w,
height: 68.w,
child: TextField(
keyboardType: TextInputType.text,
onEditingComplete: () {
setState(() {});
// _refreshController.callRefresh();
},
focusNode: _contentFocusNode,
onChanged: (text) {
_startSearch = false;
_searchText = text;
setState(() {});
},
onTap: () {
_showCategory = false;
setState(() {});
},
onSubmitted: (_submitted) async {
if (TextUtils.isEmpty(_searchText)) return;
_startSearch = true;
_contentFocusNode.unfocus();
_searchText = _searchText.trimLeft();
_searchText = _searchText.trimRight();
remember();
saveSearchListToSharedPreferences(_searchHistory);
_refreshController1.callRefresh();
setState(() {});
},
style: TextStyle(
textBaseline: TextBaseline.ideographic,
fontSize: 32.sp,
color: Colors.black,
),
controller: _editingController,
decoration: InputDecoration(
contentPadding: EdgeInsets.only(left: 20.w),
filled: true,
fillColor: Colors.white,
hintText: _showCategory ? '' : "请输入想要搜索的内容...",
hintStyle: TextStyle(
color: Colors.grey.shade500,
fontSize: 14,
fontWeight: FontWeight.w300),
prefixIcon: _showCategory
? GestureDetector(
child: Container(
padding: EdgeInsets.only(left: 18.w, right: 18.w),
margin: EdgeInsets.all(12.w),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(40.w),
color: Color(0xFFF2F2F2)),
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
Text(
widget.categoryName ?? '',
style: TextStyle(
color: ktextSubColor,
fontSize: 24.sp,
),
),
Icon(
Icons.close,
color: Colors.grey[500],
size: 30.w,
)
],
),
height: 44.w,
),
)
: null,
titleSpacing: 0, //isDense: true,
bgColor: Color(0xFFF9F9F9), // prefixIcon: Icon(CupertinoIcons.search),
bodyColor: Color(0xFFF9F9F9),
title: Row( enabledBorder: OutlineInputBorder(
children: [ borderSide: BorderSide(color: ktextPrimary),
Container( borderRadius: BorderRadius.circular(40.w),
width: 520.w, ),
height: 68.w, focusedBorder: OutlineInputBorder(
child: TextField( borderSide: BorderSide(color: Color(0xFFE52E2E)),
keyboardType: TextInputType.text, borderRadius: BorderRadius.circular(40.w),
onEditingComplete: () { ),
setState(() {}); ),
// _refreshController.callRefresh(); ),
}, ),
focusNode: _contentFocusNode, 20.wb,
onChanged: (text) { GestureDetector(
_startSearch = false; onTap: () {
_searchText = text;
setState(() {});
},
onSubmitted: (_submitted) async {
if (TextUtils.isEmpty(_searchText)) return; if (TextUtils.isEmpty(_searchText)) return;
_startSearch = true; _startSearch = true;
_contentFocusNode.unfocus(); _contentFocusNode.unfocus();
@ -230,259 +312,260 @@ class SearchGoodsPageState extends State<SearchGoodsPage> {
_refreshController1.callRefresh(); _refreshController1.callRefresh();
setState(() {}); setState(() {});
}, },
style: TextStyle( child: Text(
textBaseline: TextBaseline.ideographic, '搜索',
fontSize: 32.sp, style: TextStyle(color: ktextPrimary, fontSize: 28.sp),
color: Colors.black,
), ),
controller: _editingController,
decoration: InputDecoration(
contentPadding: EdgeInsets.only(left: 20.w),
//filled: true,
fillColor: Color(0xFFF3F3F3),
hintText: "请输入想要搜索的内容...",
hintStyle: TextStyle(
color: Colors.grey.shade500,
fontSize: 14,
fontWeight: FontWeight.w300),
//isDense: true,
// prefixIcon: Icon(CupertinoIcons.search),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: ktextPrimary),
borderRadius: BorderRadius.circular(40),
),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFE52E2E)),
borderRadius: BorderRadius.circular(40),
),
),
),
),
20.wb,
GestureDetector(
onTap: (){
if (TextUtils.isEmpty(_searchText)) return;
_startSearch = true;
_contentFocusNode.unfocus();
_searchText = _searchText.trimLeft();
_searchText = _searchText.trimRight();
remember();
saveSearchListToSharedPreferences(_searchHistory);
_refreshController1.callRefresh();
setState(() {});
},
child: Text(
'搜索',
style: TextStyle(color: ktextPrimary, fontSize: 28.sp),
), ),
), ],
], ),
), body: Stack(
children: [
body:Stack( (!(!TextUtils.isEmpty(_editingController.text) && _startSearch)) &&
!_showCategory
children: [ ? Column(
children: [
_searchHistoryWidget(),
10.hb,
Row(
children: [
20.wb,
Text(
'热搜榜',
style: TextStyle(
color: ktextSubColor,
fontSize: 32.sp,
),
),
Spacer(),
GestureDetector(
child: Image.asset(
_showList
? R.ASSETS_ICONS_XIANSHI_PNG
: R.ASSETS_ICONS_EYE_CLOSE_PNG,
width: 40.w,
height: 40.w,
),
onTap: () {
_showList = !_showList;
setState(() {});
},
),
32.wb,
],
),
10.hb,
_showList
? Container(
color: Color(0xFFF2F3F4),
child: EasyRefresh(
firstRefresh: true,
header: MaterialHeader(),
footer: MaterialFooter(),
controller: _refreshController,
onRefresh: () async {
goodsPopularModels =
await CommunityFunc.getGoodsPopularModel(
20);
setState(() {});
},
child: goodsPopularModels.isEmpty
? Container()
: ListView.separated(
padding: EdgeInsets.symmetric(
vertical: 16.w, horizontal: 32.w),
itemBuilder: (context, index) {
return _hotGoodsCard(
goodsPopularModels[index], index);
},
separatorBuilder: (_, __) {
return 16.w.heightBox;
},
itemCount: goodsPopularModels.length),
),
// BeeListView(
// path: API.market.search,
// controller: _refreshController,
// extraParams: {'searchName': ''},
// convert: (model) => model.tableList!
// .map((e) => GoodsItem.fromJson(e))
// .toList(),
// builder: (items) {
// return ListView.separated(
// padding: EdgeInsets.only(top: 10.w,
// left: 20.w, right: 20.w, bottom: 32.w),
//
// // gridDelegate: SliverWaterfallFlowDelegateWithFixedCrossAxisCount(
// // crossAxisCount: 2,
// // mainAxisSpacing: 20.w,
// // crossAxisSpacing: 20.w,
// // ),
// itemBuilder: (context, index) {
// final item = items[index];
// return _hotGoodsCard(
// item, index); //GoodsCard(item: item);
// },
// separatorBuilder: (_, __) {
// return 32.w.heightBox;
// },
// itemCount: items.length,
// );
// },
// ),
).expand()
: SizedBox(),
],
)
: Column(
children: [
Row(
children: [
normalTypeButton,
salesTypeButton,
priceButton,
Spacer(),
GestureDetector(
onTap: (){
_showListOrGrid = !_showListOrGrid;
setState(() {
});
},
child: Image.asset(_showListOrGrid?
R.ASSETS_ICONS_ICON_CHANGE_LIST_PNG:
R.ASSETS_ICONS_ICON_CHANGE_GRID_PNG,width: 40.w,height: 40.w,),
),
!(!TextUtils.isEmpty(_editingController.text) && 30.wb,
_startSearch) ],
? Column( ),
children: [ 10.hb,
_searchHistoryWidget(), Container(
10.hb, color: Color(0xFFF2F3F4),
Row( child: BeeListView(
path: API.market.findGoodsList,
controller: _refreshController1,
refreshExtra: (model) =>
_models = model as List<SearchGoodsModel>,
extraParams: {
"orderBySalesVolume": orderBySalesVolume,
"orderByPrice": orderByPrice,
"keyword": _searchText,
"brandId": brandId,
"minPrice": minPrice,
"maxPrice": maxPrice,
'categoryThirdId': widget.categoryId,
},
convert: (model) => model.tableList!
.map((e) => SearchGoodsModel.fromJson(e))
.toList(),
builder: (items) {
return
_showListOrGrid?ListView.separated(
controller: _scrollController,
padding: EdgeInsets.only(
top: 10.w,
left: 20.w,
right: 20.w,
bottom: 32.w),
// gridDelegate: SliverWaterfallFlowDelegateWithFixedCrossAxisCount(
// crossAxisCount: 2,
// mainAxisSpacing: 20.w,
// crossAxisSpacing: 20.w,
// ),
itemBuilder: (context, index) {
final item = items[index];
return GoodsListCard(
model: item,
refreshController: _refreshController1,
); //GoodsCard(item: item);
},
separatorBuilder: (_, __) {
return 32.w.heightBox;
},
itemCount: items.length,
):WaterfallFlow.builder(
gridDelegate: SliverWaterfallFlowDelegateWithFixedCrossAxisCount(
crossAxisCount: 2,
mainAxisSpacing: 20.w,
crossAxisSpacing: 20.w,
),
padding: EdgeInsets.only(
top: 10.w,
left: 20.w,
right: 20.w,
bottom: 32.w),
itemBuilder: (context, index) {
final item = _models[index];
return SearchGoodsCard(item: item,refreshController: _refreshController1,);
},
itemCount: _models.length,
);
},
),
).expand(),
],
),
Positioned(
right: 26.w,
bottom: 92.w,
child: Column(
children: [ children: [
20.wb, GestureDetector(
Text( child: Image.asset(
'热搜榜', R.ASSETS_ICONS_COLLECT_PNG,
style: TextStyle( width: 84.w,
color: ktextSubColor, height: 84.w,
fontSize: 32.sp,
), ),
onTap: () async {
var result = await Get.to(() => MyCollectionPage());
if (result != null) if (result) {
_refreshController1.callRefresh();
}
},
), ),
Spacer(), 24.hb,
GestureDetector( GestureDetector(
child: Image.asset( child: Image.asset(
_showList R.ASSETS_ICONS_ICON_TOTOP_PNG,
? R.ASSETS_ICONS_XIANSHI_PNG width: 84.w,
: R.ASSETS_ICONS_EYE_CLOSE_PNG, height: 84.w,
width: 40.w,
height: 40.w,
), ),
onTap: () { onTap: () {
_showList = !_showList; _scrollController.jumpToTop();
setState(() {});
}, },
), ),
32.wb,
], ],
), ),
10.hb,
_showList
? Container(
color: Color(0xFFF2F3F4),
child: EasyRefresh(
firstRefresh: true,
header: MaterialHeader(),
footer: MaterialFooter(),
controller: _refreshController,
onRefresh: () async {
goodsPopularModels = await CommunityFunc.getGoodsPopularModel(20);
setState(() {});
},
child: goodsPopularModels.isEmpty
? Container()
: ListView.separated(
padding: EdgeInsets.symmetric(vertical: 16.w, horizontal: 32.w),
itemBuilder: (context, index) {
return _hotGoodsCard(goodsPopularModels[index], index);
},
separatorBuilder: (_, __) {
return 16.w.heightBox;
},
itemCount: goodsPopularModels.length),
),
// BeeListView(
// path: API.market.search,
// controller: _refreshController,
// extraParams: {'searchName': ''},
// convert: (model) => model.tableList!
// .map((e) => GoodsItem.fromJson(e))
// .toList(),
// builder: (items) {
// return ListView.separated(
// padding: EdgeInsets.only(top: 10.w,
// left: 20.w, right: 20.w, bottom: 32.w),
//
// // gridDelegate: SliverWaterfallFlowDelegateWithFixedCrossAxisCount(
// // crossAxisCount: 2,
// // mainAxisSpacing: 20.w,
// // crossAxisSpacing: 20.w,
// // ),
// itemBuilder: (context, index) {
// final item = items[index];
// return _hotGoodsCard(
// item, index); //GoodsCard(item: item);
// },
// separatorBuilder: (_, __) {
// return 32.w.heightBox;
// },
// itemCount: items.length,
// );
// },
// ),
).expand()
: SizedBox(),
],
):Column(
children: [
Row(
children: [
normalTypeButton,
salesTypeButton,
priceButton,
],
),
10.hb,
Container(
color: Color(0xFFF2F3F4),
child: BeeListView(
path: API.market.findGoodsList,
controller: _refreshController1,
refreshExtra:( model) => _models = model as List<SearchGoodsModel>,
extraParams: {"orderBySalesVolume":orderBySalesVolume,"orderByPrice":orderByPrice,
"keyword":_searchText,
"brandId":brandId,"minPrice":minPrice,"maxPrice":maxPrice,},
convert: (model) => model.tableList!
.map((e) => SearchGoodsModel.fromJson(e))
.toList(),
builder: (items) {
return ListView.separated(
controller: _scrollController,
padding: EdgeInsets.only(top: 10.w,
left: 20.w, right: 20.w, bottom: 32.w),
// gridDelegate: SliverWaterfallFlowDelegateWithFixedCrossAxisCount(
// crossAxisCount: 2,
// mainAxisSpacing: 20.w,
// crossAxisSpacing: 20.w,
// ),
itemBuilder: (context, index) {
final item = items[index];
return GoodsListCard(
model: item,refreshController: _refreshController1,); //GoodsCard(item: item);
},
separatorBuilder: (_, __) {
return 32.w.heightBox;
},
itemCount: items.length,
);
},
),
).expand(),
],
),
Positioned(
right: 26.w,
bottom: 92.w,
child: Column(
children: [
GestureDetector(
child: Image.asset(R.ASSETS_ICONS_COLLECT_PNG,width: 84.w,height: 84.w,),
onTap: ()async{
var result = await Get.to(() => MyCollectionPage());
if(result!=null)
if(result){
_refreshController1.callRefresh();
}
},
),
24.hb,
GestureDetector(
child: Image.asset(R.ASSETS_ICONS_ICON_TOTOP_PNG,width: 84.w,height: 84.w,),
onTap: (){
_scrollController.jumpToTop();
},
),
],
), ),
), ],
], ));
)
);
} }
/// ///
remember() { remember() {
if (_searchHistory.contains(_searchText)) { if (_searchHistory.contains(_searchText)) {
_searchHistory.remove(_searchText); _searchHistory.remove(_searchText);
List<String> list = [_searchText]; List<String> list = [_searchText];
list.addAll(_searchHistory); list.addAll(_searchHistory);
_searchHistory = list; _searchHistory = list;
} else { } else {
List<String> list = [_searchText]; List<String> list = [_searchText];
list.addAll(_searchHistory); list.addAll(_searchHistory);
_searchHistory = list; _searchHistory = list;
while (_searchHistory.length > 15) { while (_searchHistory.length > 15) {
_searchHistory.removeLast(); _searchHistory.removeLast();
}
} }
saveSearchListToSharedPreferences(_searchHistory); }
setState(() {}); saveSearchListToSharedPreferences(_searchHistory);
setState(() {});
} }
_hotGoodsCard(GoodsPopularModel goodsItem, int index) { _hotGoodsCard(GoodsPopularModel goodsItem, int index) {
return GestureDetector( return GestureDetector(
onTap: (){ onTap: () {
Get.to( Get.to(
() => GoodDetailPage(goodId: goodsItem.id!), () => GoodDetailPage(goodId: goodsItem.id!),
); );
}, },
child: Container( child: Container(
@ -497,7 +580,7 @@ class SearchGoodsPageState extends State<SearchGoodsPage> {
clipBehavior: Clip.antiAlias, clipBehavior: Clip.antiAlias,
child: FadeInImage.assetNetwork( child: FadeInImage.assetNetwork(
placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP, placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP,
image: goodsItem.mainPhoto??'', image: goodsItem.mainPhoto ?? '',
fit: BoxFit.fill, fit: BoxFit.fill,
width: 124.w, width: 124.w,
height: 124.w, height: 124.w,
@ -563,7 +646,7 @@ class SearchGoodsPageState extends State<SearchGoodsPage> {
SizedBox( SizedBox(
width: 500.w, width: 500.w,
child: Text( child: Text(
goodsItem.skuName??'', goodsItem.skuName ?? '',
maxLines: 1, maxLines: 1,
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
style: TextStyle(color: ktextPrimary, fontSize: 28.sp), style: TextStyle(color: ktextPrimary, fontSize: 28.sp),
@ -578,8 +661,11 @@ class SearchGoodsPageState extends State<SearchGoodsPage> {
), ),
10.wb, 10.wb,
Text( Text(
goodsItem.viewsNum==null?'0':goodsItem.viewsNum.toString(), goodsItem.viewsNum == null
style: TextStyle(color: Color(0xFFBBBBBB), fontSize: 24.sp), ? '0'
: goodsItem.viewsNum.toString(),
style:
TextStyle(color: Color(0xFFBBBBBB), fontSize: 24.sp),
), ),
], ],
) )
@ -678,12 +764,15 @@ class SearchGoodsPageState extends State<SearchGoodsPage> {
getSearchListFromSharedPreferences() async { getSearchListFromSharedPreferences() async {
final userProvider = Provider.of<UserProvider>(Get.context!, listen: false); final userProvider = Provider.of<UserProvider>(Get.context!, listen: false);
_searchHistory = HiveStore.appBox!.get( _searchHistory = HiveStore.appBox!.get(
userProvider.userInfoModel?.id.toString() ?? '' + "userSearhHistory")??''; userProvider.userInfoModel?.id.toString() ??
'' + "userSearhHistory") ??
'';
if (_searchHistory == null) { if (_searchHistory == null) {
_searchHistory = []; _searchHistory = [];
} }
setState(() {}); setState(() {});
} }
/// ///
saveSearchListToSharedPreferences(List<String> value) async { saveSearchListToSharedPreferences(List<String> value) async {
final userProvider = Provider.of<UserProvider>(Get.context!, listen: false); final userProvider = Provider.of<UserProvider>(Get.context!, listen: false);
@ -692,7 +781,4 @@ class SearchGoodsPageState extends State<SearchGoodsPage> {
userProvider.userInfoModel?.id.toString() ?? '' + "userSearhHistory", userProvider.userInfoModel?.id.toString() ?? '' + "userSearhHistory",
value); value);
} }
} }

@ -0,0 +1,289 @@
import 'package:aku_community/models/market/order/goods_home_model.dart';
import 'package:aku_community/models/search/search_goods_model.dart';
import 'package:aku_community/ui/market/search/good_detail_page.dart';
import 'package:flutter/material.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:get/get.dart';
import 'package:aku_community/base/base_style.dart';
import 'package:aku_community/constants/api.dart';
import 'package:aku_community/model/common/img_model.dart';
import 'package:aku_community/models/market/goods_item.dart';
import 'package:aku_community/ui/market/goods/goods_detail_page.dart';
import 'package:aku_community/utils/headers.dart';
import 'collection/collection_func.dart';
class SearchGoodsCard extends StatefulWidget {
final SearchGoodsModel item;
final EasyRefreshController? refreshController;
const SearchGoodsCard({Key? key, required this.item, this.refreshController,})
: super(key: key);
@override
_SearchGoodsCardState createState() => _SearchGoodsCardState();
}
class _SearchGoodsCardState extends State<SearchGoodsCard> {
@override
Widget build(BuildContext context) {
return MaterialButton(
color: Colors.white,
elevation: 0,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(24.w),
),
padding: EdgeInsets.zero,
onPressed: () {
Get.to(
() => GoodDetailPage(goodId: widget.item.id!),
);
},
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
clipBehavior: Clip.antiAlias,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(24.w)),
),
child: Stack(
children: [
FadeInImage.assetNetwork(
placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP,
image: widget.item.mainPhoto ?? '',
fit: BoxFit.fill,
imageErrorBuilder: (context, error, stackTrace) {
return Image.asset(R.ASSETS_IMAGES_PLACEHOLDER_WEBP);
},
),
// Positioned(
// left: 0,
// right: 0,
// bottom: 0,
// child: Container(
// height: 38.w,
// color: Colors.black54,
// alignment: Alignment.centerLeft,
// padding: EdgeInsets.symmetric(horizontal: 12.w),
// child: Text(
// item.skuName??'',
// overflow: TextOverflow.ellipsis,
// style: TextStyle(
// color: Colors.white,
// fontSize: 18.sp,
// ),
// ),
// ),
// ),
],
),
),
Container(
padding: EdgeInsets.only(
left: 16.w, right: 16.w,
top: 10.w,
),
child: Text(
widget.item.skuName ?? '',
maxLines: 2,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 28.sp,
color: ktextPrimary
),
),
),
Padding(
padding: EdgeInsets.only(
left: 16.w, right: 16.w,
top: 10.w,
),
child: Container(
child: _getIcon(widget.item.kind??0),
)
),
10.hb,
Padding(
padding: EdgeInsets.symmetric(
horizontal: 16.w,
),
child: RichText(
text: TextSpan(
children: [
TextSpan(
text: '¥',
style: TextStyle(
color: Colors.red,
fontSize: 28.sp,
),
),
TextSpan(
text: '${widget.item.sellPrice ?? ''} ',
style: TextStyle(
color: Colors.red,
fontWeight: FontWeight.bold,
fontSize: 40.sp,
),
),
],
),
),
),
Row(
children: [
Column(
children: [
Padding(
padding: EdgeInsets.symmetric(
horizontal: 16.w,
),
child: RichText(
text: TextSpan(
children: [
TextSpan(
text: '原价:',
style: TextStyle(
color: ktextSubColor,
fontSize: 20.sp,
),
),
TextSpan(
text: widget.item.discountPrice == null ? '' : '¥${widget.item
.discountPrice ?? ''}',
style: TextStyle(
color: ktextSubColor,
fontSize: 20.sp,
decoration: TextDecoration.lineThrough,
),
),
],
),
),
),
Padding(
padding: EdgeInsets.symmetric(
horizontal: 16.w,
),
child: RichText(
text: TextSpan(
children: [
TextSpan(
text: '折扣:',
style: TextStyle(
color: ktextSubColor,
fontSize: 20.sp,
),
),
TextSpan(
text: (widget.item.discountPrice ?? 0) > (widget.item.sellPrice ?? 0)
? _getDiscount(widget.item.sellPrice ?? -1,
widget.item.discountPrice ?? -1)
: '暂无折扣',
style: TextStyle(
color: ktextSubColor,
fontSize: 20.sp,
),
),
],
),
),
),
],
),
Spacer(),
GestureDetector(
onTap: () async {
await CollectionFunc.collection(widget.item.id!);
if (widget.refreshController != null) {
widget.refreshController!.callRefresh();
}
},
child: (widget.item.isCollection ?? 0) != 0
? Image.asset(
R.ASSETS_ICONS_SHOP_FAVORFILL_PNG,
width: 42.w,
height: 42.w,
)
: Image.asset(
R.ASSETS_ICONS_ICON_FAVOR_CHOOSE_PNG,
width: 42.w,
height: 42.w,
),
),
20.wb,
],
),
20.hb,
],
),
);
}
_getDiscount(double sellPrice, double discountPrice) {
String count = '';
count = ((sellPrice / discountPrice) * 10).toStringAsFixed(1);
return count + '';
}
Widget _getIcon(int type) {
if (type == 1) {
return Container(
width: 86.w,
height: 26.w,
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(4.w),),
gradient: LinearGradient(
begin: FractionalOffset.centerLeft,
end: FractionalOffset.centerRight,
colors: <Color>[Color(0xFFEC5329), Color(0xFFF58123)],
),
),
child: Text(
'京东自营',
style: TextStyle(
fontSize: 18.sp,
color: kForeGroundColor
),
),
);
}
else if (type == 2) {
return Container(
alignment: Alignment.center,
width: 86.w,
height: 30.w,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(4.w),),
gradient: LinearGradient(
begin: FractionalOffset.centerLeft,
end: FractionalOffset.centerRight,
colors: <Color>[Color(0xFFF59B1C), Color(0xFFF5AF16)],
),
),
child: Text(
'京东POP',
style: TextStyle(
fontSize: 18.sp,
color: kForeGroundColor
),
),
);
}
else
return SizedBox();
}
}

@ -379,41 +379,6 @@ packages:
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "6.1.2" version: "6.1.2"
firebase_core:
dependency: "direct main"
description:
name: firebase_core
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.4.0"
firebase_core_platform_interface:
dependency: transitive
description:
name: firebase_core_platform_interface
url: "https://pub.flutter-io.cn"
source: hosted
version: "4.0.1"
firebase_core_web:
dependency: transitive
description:
name: firebase_core_web
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.1.0"
firebase_crashlytics:
dependency: "direct main"
description:
name: firebase_crashlytics
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.1.1"
firebase_crashlytics_platform_interface:
dependency: transitive
description:
name: firebase_crashlytics_platform_interface
url: "https://pub.flutter-io.cn"
source: hosted
version: "3.1.0"
fixnum: fixnum:
dependency: transitive dependency: transitive
description: description:

@ -88,9 +88,9 @@ dependencies:
amap_flutter_base: ^2.0.0 amap_flutter_base: ^2.0.0
#动态文字 #动态文字
animated_text_kit: ^4.2.1 animated_text_kit: ^4.2.1
#谷歌崩溃记录分析 # #谷歌崩溃记录分析
firebase_core: ^1.1.1 # firebase_core: ^1.1.1
firebase_crashlytics: ^2.0.3 # firebase_crashlytics: ^2.0.3
#分享功能 #分享功能
share: ^2.0.1 share: ^2.0.1
collection: ^1.15.0 collection: ^1.15.0

Loading…
Cancel
Save