|
@@ -2,7 +2,7 @@ import 'package:farmer_client/models/entities/Address.dart';
|
2
|
2
|
import 'package:flutter/material.dart';
|
3
|
3
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
4
|
4
|
|
5
|
|
-class AddressCard extends StatefulWidget {
|
|
5
|
+class AddressCard extends StatelessWidget {
|
6
|
6
|
final Address item;
|
7
|
7
|
final int No;
|
8
|
8
|
final bool isBack;
|
|
@@ -21,22 +21,6 @@ class AddressCard extends StatefulWidget {
|
21
|
21
|
required this.onBack})
|
22
|
22
|
: super(key: key);
|
23
|
23
|
|
24
|
|
- @override
|
25
|
|
- _AddressCard createState() =>
|
26
|
|
- _AddressCard(item, No, onChange, onDelete, onEdit, isBack, onBack);
|
27
|
|
-}
|
28
|
|
-
|
29
|
|
-class _AddressCard extends State<AddressCard> {
|
30
|
|
- final Address item;
|
31
|
|
- final int No;
|
32
|
|
- final bool isBack;
|
33
|
|
- final GestureTapCallback onChange;
|
34
|
|
- final GestureTapCallback onDelete;
|
35
|
|
- final GestureTapCallback onEdit;
|
36
|
|
- final GestureTapCallback onBack;
|
37
|
|
- _AddressCard(this.item, this.No, this.onChange, this.onDelete, this.onEdit,
|
38
|
|
- this.isBack, this.onBack);
|
39
|
|
-
|
40
|
24
|
@override
|
41
|
25
|
Widget build(BuildContext context) {
|
42
|
26
|
return Container(
|
|
@@ -64,7 +48,7 @@ class _AddressCard extends State<AddressCard> {
|
64
|
48
|
Container(
|
65
|
49
|
margin: EdgeInsets.fromLTRB(0, 0, 5.w, 0),
|
66
|
50
|
padding:
|
67
|
|
- EdgeInsets.symmetric(vertical: 1.w, horizontal: 5.w),
|
|
51
|
+ EdgeInsets.symmetric(vertical: 1.w, horizontal: 5.w),
|
68
|
52
|
decoration: BoxDecoration(
|
69
|
53
|
color: const Color(0xffff0000),
|
70
|
54
|
borderRadius: BorderRadius.all(Radius.circular(5.w)),
|
|
@@ -81,7 +65,7 @@ class _AddressCard extends State<AddressCard> {
|
81
|
65
|
Text(
|
82
|
66
|
'我的地址' + No.toString(),
|
83
|
67
|
style:
|
84
|
|
- TextStyle(fontSize: 15.sp, fontWeight: FontWeight.w700),
|
|
68
|
+ TextStyle(fontSize: 15.sp, fontWeight: FontWeight.w700),
|
85
|
69
|
),
|
86
|
70
|
],
|
87
|
71
|
),
|
|
@@ -137,7 +121,7 @@ class _AddressCard extends State<AddressCard> {
|
137
|
121
|
child: Text(
|
138
|
122
|
'选择此地址',
|
139
|
123
|
style:
|
140
|
|
- TextStyle(fontSize: 17.sp, fontWeight: FontWeight.w800),
|
|
124
|
+ TextStyle(fontSize: 17.sp, fontWeight: FontWeight.w800),
|
141
|
125
|
),
|
142
|
126
|
),
|
143
|
127
|
),
|
|
@@ -179,4 +163,5 @@ class _AddressCard extends State<AddressCard> {
|
179
|
163
|
),
|
180
|
164
|
);
|
181
|
165
|
}
|
|
166
|
+
|
182
|
167
|
}
|