sms_recharge_item_page.dart
5.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:one_key/models/sms_info.dart';
import 'package:one_key/res/colors.dart';
import 'package:one_key/utils/utils.dart';
import 'package:one_key/widgets/v_empty_view.dart';
class SmsRechargeItemPage extends StatefulWidget {
Meals meals;
GestureTapCallback callback;
SmsRechargeItemPage({Key key, this.meals, this.callback}) : super(key: key);
@override
_SmsRechargeItemPageState createState() => _SmsRechargeItemPageState();
}
class _SmsRechargeItemPageState extends State<SmsRechargeItemPage> {
@override
Widget build(BuildContext context) {
return InkWell(
onTap: widget.callback,
child: Stack(
clipBehavior: Clip.none,
children: [
Container(
decoration: BoxDecoration(
color: widget.meals.selected
? MyColours.color_199095
: MyColours.color_ffffff,
borderRadius:
BorderRadius.circular(ScreenUtil().setWidth(10)),
border: Border.all(
width: ScreenUtil().setWidth(2),
color: MyColours.color_E0E0E0,
)),
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(30),
vertical: ScreenUtil().setWidth(20)),
margin: EdgeInsets.only(bottom: ScreenUtil().setWidth(30)),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
Text(
'${widget.meals.total}条',
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: ScreenUtil().setSp(34),
color: widget.meals.selected
? MyColours.color_F0F0F0
: MyColours.color_333333),
),
VEmptyView(20),
Text('约${widget.meals.priceAve}元/条',
style: TextStyle(
fontSize: ScreenUtil().setSp(30),
color: widget.meals.selected
? MyColours.color_F0F0F0
: MyColours.color_333333)),
],
),
Expanded(
child: Container(
// width: ScreenUtil().setWidth(150),
alignment: Alignment.centerRight,
margin: EdgeInsets.only(top: ScreenUtil().setWidth(30)),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
Text(
'¥${widget.meals.price}',
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: ScreenUtil().setSp(34),
color: widget.meals.selected
? MyColours.color_F0F0F0
: MyColours.color_333333),
),
widget.meals.price == widget.meals.priceOld
? SizedBox()
: Text('¥${widget.meals.priceOld}',
style: TextStyle(
decoration: TextDecoration.lineThrough,
fontSize: ScreenUtil().setSp(30),
color: widget.meals.selected
? MyColours.color_F0F0F0
: MyColours.color_999999)),
],
),
)),
],
)),
widget.meals.discount == '0'
? SizedBox()
: Positioned(
top: -5,
right: -2,
child: Container(
// padding: EdgeInsets.symmetric(horizontal: ScreenUtil().setWidth(16),vertical: ScreenUtil().setWidth(4)),
padding: EdgeInsets.only(
left: ScreenUtil().setWidth(6),
bottom: ScreenUtil().setWidth(10)),
alignment: Alignment.center,
width: ScreenUtil().setWidth(44 * 2),
height: ScreenUtil().setWidth(61),
decoration: BoxDecoration(
// color: Colors.red,
image: DecorationImage(
image: ExactAssetImage(
Utils.getImgPath('sms_manager'),
),
fit: BoxFit.cover,
),
),
child: Text(
'${widget.meals.discount}折',
style: TextStyle(
color: MyColours.color_fefefe,
fontSize: ScreenUtil().setSp(24)),
)))
],
),
);
}
}