|
@@ -1,73 +1,127 @@
|
1
|
1
|
import 'package:flutter/material.dart';
|
2
|
2
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
3
|
3
|
|
|
4
|
+class TypeHeader extends StatefulWidget {
|
|
5
|
+ TypeHeader({Key? key, required this.type}) : super(key: key);
|
4
|
6
|
|
5
|
|
-class headers extends StatelessWidget {
|
6
|
|
- const headers({Key? key}) : super(key: key);
|
|
7
|
+ final bool type;
|
7
|
8
|
|
|
9
|
+ @override
|
|
10
|
+ State<TypeHeader> createState() => _TypeHeaderState();
|
|
11
|
+}
|
|
12
|
+
|
|
13
|
+class _TypeHeaderState extends State<TypeHeader> {
|
8
|
14
|
@override
|
9
|
15
|
Widget build(BuildContext context) {
|
10
|
|
- return Container(
|
11
|
|
- child: Row(
|
12
|
|
- children: [
|
13
|
|
- Container(
|
14
|
|
- height: 32.w,
|
15
|
|
- decoration: BoxDecoration(
|
16
|
|
- color: Colors.white
|
17
|
|
- ),
|
18
|
|
- child: Row(
|
19
|
|
- children: [
|
20
|
|
- Image(
|
21
|
|
- image: AssetImage('images/gpsImgae.png'),
|
22
|
|
- fit: BoxFit.cover,
|
23
|
|
- width: 14.w,
|
24
|
|
- height: 17.h,
|
25
|
|
- ),
|
26
|
|
- Padding(padding: EdgeInsets.fromLTRB(5, 0, 0, 0),
|
27
|
|
- child: Text('邓州市',
|
28
|
|
- style: TextStyle(
|
29
|
|
- color: Color(0xff202020),
|
30
|
|
- fontSize: 16.sp,
|
31
|
|
- fontWeight: FontWeight.bold,
|
|
16
|
+ if (widget.type) {
|
|
17
|
+ return Container(
|
|
18
|
+ child: Row(
|
|
19
|
+ children: [
|
|
20
|
+ Container(
|
|
21
|
+ height: 32.w,
|
|
22
|
+ decoration: BoxDecoration(color: Colors.white),
|
|
23
|
+ child: Row(
|
|
24
|
+ children: [
|
|
25
|
+ Image(
|
|
26
|
+ image: AssetImage('images/gpsImgae.png'),
|
|
27
|
+ fit: BoxFit.cover,
|
|
28
|
+ width: 14.w,
|
|
29
|
+ height: 17.h,
|
|
30
|
+ ),
|
|
31
|
+ Padding(
|
|
32
|
+ padding: EdgeInsets.fromLTRB(5, 0, 0, 0),
|
|
33
|
+ child: Text(
|
|
34
|
+ '邓州市',
|
|
35
|
+ style: TextStyle(
|
|
36
|
+ color: Color(0xff202020),
|
|
37
|
+ fontSize: 16.sp,
|
|
38
|
+ fontWeight: FontWeight.bold,
|
|
39
|
+ ),
|
32
|
40
|
),
|
33
|
41
|
),
|
34
|
|
- ),
|
35
|
|
- const Icon(Icons.arrow_drop_down)
|
36
|
|
- ],
|
37
|
|
-
|
38
|
|
- ),
|
39
|
|
- ),
|
40
|
|
- Container(
|
41
|
|
- padding: EdgeInsets.fromLTRB(15.w, 0, 0, 0),
|
42
|
|
- width: 260.w,
|
43
|
|
- height: 32.w,
|
44
|
|
- decoration: const BoxDecoration(
|
45
|
|
- color: Colors.white
|
|
42
|
+ const Icon(Icons.arrow_drop_down),
|
|
43
|
+ Container(
|
|
44
|
+ padding: EdgeInsets.fromLTRB(15.w, 0, 0, 0),
|
|
45
|
+ width: 260.w,
|
|
46
|
+ height: 32.w,
|
|
47
|
+ decoration: const BoxDecoration(color: Colors.white),
|
|
48
|
+ child: GestureDetector(
|
|
49
|
+ onTap: () {
|
|
50
|
+ print('点击了搜索');
|
|
51
|
+ },
|
|
52
|
+ child: Container(
|
|
53
|
+ decoration: const BoxDecoration(
|
|
54
|
+ // color: Colors.red,
|
|
55
|
+ color: Color(0x30cccccc),
|
|
56
|
+ borderRadius:
|
|
57
|
+ BorderRadius.all(Radius.circular(25)),
|
|
58
|
+ ),
|
|
59
|
+ child: Row(
|
|
60
|
+ children: [
|
|
61
|
+ Padding(
|
|
62
|
+ padding: EdgeInsets.fromLTRB(15, 0, 5, 0),
|
|
63
|
+ child: Icon(
|
|
64
|
+ Icons.search,
|
|
65
|
+ size: 19,
|
|
66
|
+ color: Color(0xff666666),
|
|
67
|
+ ),
|
|
68
|
+ ),
|
|
69
|
+ Text(
|
|
70
|
+ '请输入关键字查询',
|
|
71
|
+ style: TextStyle(
|
|
72
|
+ color: Color(0xff666666), fontSize: 14),
|
|
73
|
+ )
|
|
74
|
+ ],
|
|
75
|
+ ),
|
|
76
|
+ )
|
|
77
|
+ // Search(),
|
|
78
|
+ )),
|
|
79
|
+ ],
|
46
|
80
|
),
|
47
|
|
- child: GestureDetector(
|
48
|
|
- onTap: (){
|
49
|
|
- print('点击了搜索');
|
50
|
|
- },
|
51
|
|
- child: Container(
|
52
|
|
- decoration: const BoxDecoration(
|
53
|
|
- // color: Colors.red,
|
54
|
|
- color: Color(0x30cccccc),
|
55
|
|
- borderRadius: BorderRadius.all(Radius.circular(25)),
|
56
|
|
- ),
|
57
|
|
- child: Row(
|
58
|
|
- children: [
|
59
|
|
- Padding(padding: EdgeInsets.fromLTRB(15, 0, 5, 0),
|
60
|
|
- child: Icon(Icons.search,size: 19,color:Color(0xff666666) ,),
|
61
|
|
- ),
|
62
|
|
- Text('请输入关键字查询',style: TextStyle(color: Color(0xff666666),fontSize: 14),)
|
63
|
|
- ],
|
|
81
|
+ ),
|
|
82
|
+ ],
|
|
83
|
+ ),
|
|
84
|
+ );
|
|
85
|
+ } else {
|
|
86
|
+ return Container(
|
|
87
|
+ padding: EdgeInsets.fromLTRB(15.w, 0, 0, 0),
|
|
88
|
+ width: 260.w,
|
|
89
|
+ height: 32.w,
|
|
90
|
+ decoration: const BoxDecoration(color: Colors.white),
|
|
91
|
+ child: GestureDetector(
|
|
92
|
+ onTap: () {
|
|
93
|
+ print('点击了搜索');
|
|
94
|
+ },
|
|
95
|
+ child: Container(
|
|
96
|
+ decoration: const BoxDecoration(
|
|
97
|
+ // color: Colors.red,
|
|
98
|
+ color: Color(0x30cccccc),
|
|
99
|
+ borderRadius: BorderRadius.all(Radius.circular(25)),
|
|
100
|
+ ),
|
|
101
|
+ child: Row(
|
|
102
|
+ children: [
|
|
103
|
+ Padding(
|
|
104
|
+ padding: EdgeInsets.fromLTRB(15, 0, 5, 0),
|
|
105
|
+ child: Icon(
|
|
106
|
+ Icons.search,
|
|
107
|
+ size: 19,
|
|
108
|
+ color: Color(0xff666666),
|
|
109
|
+ ),
|
64
|
110
|
),
|
65
|
|
- )
|
66
|
|
- // Search(),
|
|
111
|
+ Text(
|
|
112
|
+ '请输入关键字查询',
|
|
113
|
+ style: TextStyle(color: Color(0xff666666), fontSize: 14),
|
|
114
|
+ )
|
|
115
|
+ ],
|
|
116
|
+ ),
|
67
|
117
|
)
|
68
|
|
- )
|
69
|
|
- ],
|
70
|
|
- ),
|
71
|
|
- );
|
|
118
|
+ // Search(),
|
|
119
|
+ ));
|
|
120
|
+ }
|
72
|
121
|
}
|
73
|
122
|
}
|
|
123
|
+
|
|
124
|
+// Widget _initWidget (TypeHeader flag) {
|
|
125
|
+//
|
|
126
|
+//
|
|
127
|
+// }
|