You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
242 lines
8.4 KiB
242 lines
8.4 KiB
import 'package:dio/dio.dart'; |
|
import 'package:flutter/cupertino.dart'; |
|
import 'package:flutter/material.dart'; |
|
import 'package:huixiang/retrofit/retrofit_api.dart'; |
|
import 'package:huixiang/utils/font_weight.dart'; |
|
import 'package:flutter_screenutil/flutter_screenutil.dart'; |
|
|
|
class ShortcutOperation extends StatefulWidget { |
|
final Function goToOrder; |
|
|
|
ShortcutOperation(this.goToOrder); |
|
|
|
@override |
|
State<StatefulWidget> createState() { |
|
return _ShortcutOperation(); |
|
} |
|
} |
|
|
|
class _ShortcutOperation extends State<ShortcutOperation> { |
|
ApiService apiService; |
|
|
|
@override |
|
void initState() { |
|
super.initState(); |
|
} |
|
|
|
@override |
|
Widget build(BuildContext context) { |
|
return Container( |
|
height: 70.h, |
|
width: double.infinity, |
|
margin: EdgeInsets.only(bottom: 15.h, left: 9.w, right: 9.w), |
|
child: Row( |
|
crossAxisAlignment: CrossAxisAlignment.center, |
|
mainAxisAlignment: MainAxisAlignment.center, |
|
children: [ |
|
Expanded( |
|
child: GestureDetector( |
|
onTap: () { |
|
widget.goToOrder(0); |
|
}, |
|
child: Container( |
|
width: double.infinity, |
|
margin: EdgeInsets.symmetric(horizontal: 5), |
|
padding: EdgeInsets.all(10.h), |
|
decoration: BoxDecoration( |
|
gradient: new LinearGradient( |
|
begin: Alignment.centerLeft, |
|
end: Alignment.centerRight, |
|
colors: [ |
|
Color(0xFFD1E8D9), |
|
Color(0xFFE4F7EA), |
|
]), |
|
boxShadow: [ |
|
BoxShadow( |
|
color: Colors.black.withAlpha(12), |
|
offset: Offset(0, 2), |
|
blurRadius: 4, |
|
spreadRadius: 1, |
|
) |
|
], |
|
borderRadius: BorderRadius.circular(6), |
|
), |
|
child: Row( |
|
mainAxisAlignment: MainAxisAlignment.center, |
|
crossAxisAlignment: CrossAxisAlignment.center, |
|
children: [ |
|
Column( |
|
mainAxisAlignment: MainAxisAlignment.center, |
|
crossAxisAlignment: CrossAxisAlignment.start, |
|
children: [ |
|
Text( |
|
"联盟", |
|
style: TextStyle( |
|
fontWeight: MyFontWeight.semi_bold, |
|
fontSize: 14.sp, |
|
color: Color(0xFF32A060), |
|
), |
|
), |
|
SizedBox(height: 5.h), |
|
Text( |
|
"下单赚积分", |
|
style: TextStyle( |
|
fontWeight: MyFontWeight.regular, |
|
fontSize: 12.sp, |
|
color: Color(0xFF61836F), |
|
), |
|
), |
|
], |
|
), |
|
SizedBox(width: 3.w), |
|
Expanded( |
|
child: Image.asset( |
|
"assets/image/home_lm.webp", |
|
width: 36.w, |
|
height: 36.h, |
|
), |
|
), |
|
], |
|
), |
|
), |
|
)), |
|
Expanded( |
|
child: GestureDetector( |
|
onTap: () { |
|
Navigator.of(context).pushNamed('/router/recharge_page'); |
|
}, |
|
child: Container( |
|
width: double.infinity, |
|
margin: EdgeInsets.symmetric(horizontal: 5.w), |
|
padding: EdgeInsets.all(10.h), |
|
decoration: BoxDecoration( |
|
gradient: new LinearGradient( |
|
begin: Alignment.centerLeft, |
|
end: Alignment.centerRight, |
|
colors: [ |
|
Color(0xFFFAEDCB), |
|
Color(0xFFFAF4E2), |
|
]), |
|
boxShadow: [ |
|
BoxShadow( |
|
color: Colors.black.withAlpha(12), |
|
offset: Offset(0, 2), |
|
blurRadius: 4, |
|
spreadRadius: 1, |
|
) |
|
], |
|
borderRadius: BorderRadius.circular(6.r), |
|
), |
|
child: Row( |
|
mainAxisAlignment: MainAxisAlignment.center, |
|
crossAxisAlignment: CrossAxisAlignment.center, |
|
children: [ |
|
Column( |
|
mainAxisAlignment: MainAxisAlignment.center, |
|
crossAxisAlignment: CrossAxisAlignment.start, |
|
children: [ |
|
Text( |
|
"充值", |
|
style: TextStyle( |
|
fontWeight: MyFontWeight.semi_bold, |
|
fontSize: 14.sp, |
|
color: Color(0xFFFFBA1B), |
|
), |
|
), |
|
SizedBox(height: 5.h), |
|
Text( |
|
"充值福利多", |
|
style: TextStyle( |
|
fontWeight: MyFontWeight.regular, |
|
fontSize: 12.sp, |
|
color: Color(0xFFA59162), |
|
), |
|
), |
|
], |
|
), |
|
SizedBox(width: 3.w), |
|
Expanded( |
|
child: Image.asset( |
|
"assets/image/home_recharge.webp", |
|
width: 36.w, |
|
height: 36.h, |
|
), |
|
), |
|
], |
|
), |
|
), |
|
), |
|
), |
|
Expanded( |
|
child: GestureDetector( |
|
onTap: () { |
|
// Navigator.of(context).pushNamed('/router/roll_center_page'); |
|
Navigator.of(context).pushNamed('/router/welfare_page'); |
|
}, |
|
child: Container( |
|
width: double.infinity, |
|
margin: EdgeInsets.symmetric(horizontal: 5.w), |
|
padding: EdgeInsets.all(10.h), |
|
decoration: BoxDecoration( |
|
gradient: new LinearGradient( |
|
begin: Alignment.centerLeft, |
|
end: Alignment.centerRight, |
|
colors: [ |
|
Color(0xFFFAE5CB), |
|
Color(0xFFFAF1E4), |
|
]), |
|
boxShadow: [ |
|
BoxShadow( |
|
color: Colors.black.withAlpha(12), |
|
offset: Offset(0, 2), |
|
blurRadius: 4, |
|
spreadRadius: 1, |
|
) |
|
], |
|
borderRadius: BorderRadius.circular(6.r), |
|
), |
|
child: Row( |
|
mainAxisAlignment: MainAxisAlignment.center, |
|
crossAxisAlignment: CrossAxisAlignment.center, |
|
children: [ |
|
Column( |
|
mainAxisAlignment: MainAxisAlignment.center, |
|
crossAxisAlignment: CrossAxisAlignment.start, |
|
children: [ |
|
Text( |
|
"福利中心", |
|
style: TextStyle( |
|
fontWeight: MyFontWeight.semi_bold, |
|
fontSize: 14.sp, |
|
color: Color(0xFFFF910F), |
|
), |
|
), |
|
SizedBox(height: 5.h), |
|
Text( |
|
"天天得福利", |
|
style: TextStyle( |
|
fontWeight: MyFontWeight.regular, |
|
fontSize: 12.sp, |
|
color: Color(0xFF89755D), |
|
), |
|
), |
|
], |
|
), |
|
SizedBox(width: 3.w), |
|
Expanded( |
|
child: Image.asset( |
|
"assets/image/home_welfare.webp", |
|
width: 36.w, |
|
height: 36.h, |
|
), |
|
), |
|
], |
|
), |
|
), |
|
), |
|
), |
|
], |
|
), |
|
); |
|
} |
|
}
|
|
|