wurong
2 years ago
7 changed files with 307 additions and 122 deletions
After Width: | Height: | Size: 794 B |
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 642 B |
@ -0,0 +1,154 @@
|
||||
import 'package:flutter/material.dart'; |
||||
import 'package:huixiang/retrofit/retrofit_api.dart'; |
||||
import 'package:huixiang/utils/font_weight.dart'; |
||||
import 'package:huixiang/view_widget/my_appbar.dart'; |
||||
import 'package:pull_to_refresh/pull_to_refresh.dart'; |
||||
import 'package:flutter_screenutil/flutter_screenutil.dart'; |
||||
|
||||
import '../../generated/l10n.dart'; |
||||
import '../../view_widget/classic_header.dart'; |
||||
import '../../view_widget/my_footer.dart'; |
||||
|
||||
class SelectShop extends StatefulWidget { |
||||
@override |
||||
State<StatefulWidget> createState() { |
||||
return _SelectShop(); |
||||
} |
||||
} |
||||
|
||||
class _SelectShop extends State<SelectShop> { |
||||
ApiService apiService; |
||||
final RefreshController refreshController = RefreshController(); |
||||
|
||||
@override |
||||
void initState() { |
||||
super.initState(); |
||||
} |
||||
|
||||
@override |
||||
Widget build(BuildContext context) { |
||||
return |
||||
Scaffold( |
||||
backgroundColor: Colors.white, |
||||
appBar: MyAppBar( |
||||
title: "选择门店", |
||||
titleColor: Colors.black, |
||||
background: Colors.white, |
||||
leadingColor: Colors.black, |
||||
brightness: Brightness.dark, |
||||
), |
||||
body: SmartRefresher( |
||||
controller: refreshController, |
||||
enablePullDown: true, |
||||
enablePullUp: false, |
||||
header: MyHeader( |
||||
color: Colors.white, |
||||
), |
||||
footer: CustomFooter( |
||||
builder: (context, mode) { |
||||
return MyFooter(mode); |
||||
}, |
||||
), |
||||
onRefresh: () { |
||||
}, |
||||
physics: BouncingScrollPhysics(), |
||||
scrollController: ScrollController(), |
||||
child: Container( |
||||
height: double.infinity, |
||||
padding: EdgeInsets.only(top: 13.h,left:16.w,right:16.w), |
||||
child:Column( |
||||
children: [ |
||||
Row( |
||||
children: [ |
||||
Image.asset( |
||||
"assets/image/bs_switch_shop.webp", |
||||
width:24, |
||||
height:24, |
||||
), |
||||
SizedBox(width: 4.w,), |
||||
Text("门店切换", |
||||
style: TextStyle( |
||||
fontSize: 15.sp, |
||||
fontWeight: MyFontWeight.semi_bold, |
||||
color: Color(0xFF1A1A1A) |
||||
),), |
||||
], |
||||
), |
||||
SizedBox(height:20.h,), |
||||
Expanded(child: ListView.builder( |
||||
padding: EdgeInsets.zero, |
||||
itemCount:20, |
||||
scrollDirection: Axis.vertical, |
||||
shrinkWrap: true, |
||||
physics: BouncingScrollPhysics(), |
||||
itemBuilder: (context, position) { |
||||
return GestureDetector( |
||||
onTap: () { |
||||
}, |
||||
child: shopsItem(), |
||||
); |
||||
}, |
||||
)), |
||||
Container( |
||||
width: double.infinity, |
||||
padding: EdgeInsets.symmetric(vertical:16.h), |
||||
margin: EdgeInsets.only(bottom:34.h,top: 10.h), |
||||
alignment: Alignment.center, |
||||
decoration: BoxDecoration( |
||||
color: Color(0xFF30415B), |
||||
borderRadius: BorderRadius.circular(27.w), |
||||
), |
||||
child:Text( |
||||
S.of(context).queding, |
||||
style: TextStyle( |
||||
fontWeight: MyFontWeight.bold, |
||||
fontSize: 16.sp, |
||||
color: Colors.white, |
||||
), |
||||
), |
||||
), |
||||
], |
||||
), |
||||
), |
||||
), |
||||
); |
||||
} |
||||
|
||||
Widget shopsItem(){ |
||||
return Container( |
||||
height: 52.h, |
||||
margin: EdgeInsets.only(bottom: 12), |
||||
child: Stack( |
||||
alignment: Alignment.bottomRight, |
||||
children: [ |
||||
Container( |
||||
height: 52.h, |
||||
width: double.infinity, |
||||
decoration: BoxDecoration( |
||||
color: Color(0xFFEFF5FF), |
||||
borderRadius: BorderRadius.circular(4.w), |
||||
border: Border.all( |
||||
color: Color(0xFF30415B), |
||||
width: 1.w, |
||||
), |
||||
), |
||||
padding: EdgeInsets.only(top:16.h,bottom:16.h,left: 16.w,right: 17.w), |
||||
child: Text("前进麦味烘焙*海峡姐妹茶(哈乐城店)", |
||||
style: TextStyle( |
||||
fontSize: 14.sp, |
||||
fontWeight: MyFontWeight.medium, |
||||
color: Color(0xFF30415B) |
||||
),), |
||||
), |
||||
Image.asset( |
||||
"assets/image/bs_shop.webp", |
||||
width: 20, |
||||
height: 20, |
||||
fit: BoxFit.fill, |
||||
), |
||||
], |
||||
), |
||||
); |
||||
} |
||||
|
||||
} |
Loading…
Reference in new issue