w-R
3 years ago
11 changed files with 637 additions and 798 deletions
@ -1,203 +0,0 @@
|
||||
import 'package:flutter/material.dart'; |
||||
import 'package:huixiang/retrofit/retrofit_api.dart'; |
||||
import 'package:huixiang/utils/font_weight.dart'; |
||||
import 'package:huixiang/view_widget/classic_header.dart'; |
||||
import 'package:huixiang/view_widget/my_footer.dart'; |
||||
import 'package:pull_to_refresh/pull_to_refresh.dart'; |
||||
import 'package:flutter_screenutil/flutter_screenutil.dart'; |
||||
class CartGoodsList extends StatefulWidget { |
||||
|
||||
@override |
||||
State<StatefulWidget> createState() { |
||||
return _CartGoodsList(); |
||||
} |
||||
} |
||||
|
||||
class _CartGoodsList extends State<CartGoodsList> { |
||||
RefreshController refreshController = RefreshController(); |
||||
ApiService apiService; |
||||
int pageNum = 0; |
||||
|
||||
@override |
||||
void initState() { |
||||
super.initState(); |
||||
_onRefresh(); |
||||
} |
||||
|
||||
_onRefresh() async { |
||||
pageNum = 0; |
||||
setState(() {}); |
||||
} |
||||
|
||||
@override |
||||
Widget build(BuildContext context) { |
||||
return Container( |
||||
height: MediaQuery.of(context).size.height - |
||||
103.h - |
||||
MediaQuery.of(context).padding.top, |
||||
child: SmartRefresher( |
||||
controller: refreshController, |
||||
enablePullUp: false, |
||||
enablePullDown: true, |
||||
physics: BouncingScrollPhysics(), |
||||
header: MyHeader(), |
||||
onRefresh: () { |
||||
}, |
||||
child: ListView.builder( |
||||
itemCount:6, |
||||
padding: EdgeInsets.only( |
||||
top: 8.h, |
||||
bottom: 84.h, /* + (375.h - 88.h) + 4.h*/ |
||||
), |
||||
physics: NeverScrollableScrollPhysics(), |
||||
itemBuilder: (context, position) { |
||||
return InkWell( |
||||
onTap: () { |
||||
}, |
||||
child: cartGoodsItem(), |
||||
); |
||||
}), |
||||
), |
||||
); |
||||
} |
||||
|
||||
Widget cartGoodsItem() { |
||||
return Container( |
||||
margin: EdgeInsets.all(16), |
||||
padding: EdgeInsets.all(16), |
||||
decoration: BoxDecoration( |
||||
borderRadius: BorderRadius.circular(8), |
||||
boxShadow: [ |
||||
BoxShadow( |
||||
color: Colors.black.withAlpha(12), |
||||
offset: Offset(0, 3), |
||||
blurRadius: 14, |
||||
spreadRadius: 0, |
||||
), |
||||
], |
||||
color: Colors.white, |
||||
), |
||||
child: Row( |
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween, |
||||
crossAxisAlignment: CrossAxisAlignment.center, |
||||
children: [ |
||||
Image.asset( |
||||
// ? "assets/image/icon_radio_selected.png" : |
||||
"assets/image/icon_radio_unselected.png", |
||||
width:16, |
||||
height:16, |
||||
), |
||||
SizedBox(width: 16.w), |
||||
// MImage( |
||||
// "assets/image/icon_story_td.png", |
||||
// isCircle: true, |
||||
// width:81, |
||||
// height:81, |
||||
// fit: BoxFit.cover, |
||||
// errorSrc: "assets/image/default_1.png", |
||||
// fadeSrc: "assets/image/default_1.png", |
||||
// ), |
||||
Image.asset( |
||||
"assets/image/icon_story_td.png", |
||||
width: 81, |
||||
height: 81, |
||||
fit: BoxFit.cover, |
||||
), |
||||
SizedBox(width: 10.w), |
||||
Expanded(child: |
||||
Container( |
||||
height:81.h,child:Column( |
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween, |
||||
crossAxisAlignment: CrossAxisAlignment.start, |
||||
children: [ |
||||
Text( |
||||
"[生态小农]山林放养鸡蛋30枚/盒", |
||||
maxLines: 2, |
||||
overflow: TextOverflow.ellipsis, |
||||
style: TextStyle( |
||||
fontSize: 14.sp, |
||||
fontWeight: MyFontWeight.medium, |
||||
color: Color(0xFF353535), |
||||
), |
||||
), |
||||
// SizedBox(height: 5.h), |
||||
Text( |
||||
"套盒装", |
||||
style: TextStyle( |
||||
fontSize: 10.sp, |
||||
fontWeight: MyFontWeight.medium, |
||||
color: Color(0xFF727272), |
||||
), |
||||
), |
||||
// SizedBox(height: 5.h), |
||||
Row( |
||||
mainAxisAlignment: MainAxisAlignment.center, |
||||
crossAxisAlignment: CrossAxisAlignment.end, |
||||
children: [ |
||||
Expanded(child:Text.rich( |
||||
TextSpan( |
||||
children: [ |
||||
TextSpan( |
||||
text: "¥", |
||||
style: TextStyle( |
||||
fontSize: 10.sp, |
||||
fontWeight: MyFontWeight.semi_bold, |
||||
color: Color(0xFF32A060), |
||||
), |
||||
), |
||||
TextSpan( |
||||
text: "58.2", |
||||
style: TextStyle( |
||||
fontSize: 14.sp, |
||||
fontWeight: MyFontWeight.semi_bold, |
||||
color: Color(0xFF32A060), |
||||
), |
||||
), |
||||
], |
||||
), |
||||
)), |
||||
Row( |
||||
mainAxisAlignment: MainAxisAlignment.center, |
||||
crossAxisAlignment: CrossAxisAlignment.center,children: [ |
||||
InkWell( |
||||
onTap: () { |
||||
setState(() { |
||||
}); |
||||
}, |
||||
child: Image.asset( |
||||
"assets/image/reduce.png", |
||||
width: 22, |
||||
height: 22, |
||||
), |
||||
), |
||||
Container( |
||||
width: 30, |
||||
alignment: Alignment.center, |
||||
child: Text( |
||||
"1", |
||||
style: TextStyle( |
||||
color: Colors.black, |
||||
fontSize: 14.sp, |
||||
fontWeight: MyFontWeight.medium, |
||||
), |
||||
), |
||||
), |
||||
InkWell( |
||||
onTap: () { |
||||
}, |
||||
child: Image.asset( |
||||
"assets/image/add.png", |
||||
width: 22, |
||||
height: 22, |
||||
), |
||||
), |
||||
],) |
||||
], |
||||
), |
||||
], |
||||
)),), |
||||
], |
||||
), |
||||
); |
||||
} |
||||
} |
Loading…
Reference in new issue