|
@@ -1,12 +1,11 @@
|
1
|
|
-
|
2
|
1
|
import 'package:flutter/material.dart';
|
3
|
2
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
3
|
+import 'package:get/get.dart';
|
4
|
4
|
|
5
|
5
|
import '../../widgets/CarsCard.dart';
|
6
|
6
|
import '../../widgets/Search.dart';
|
7
|
7
|
import '../TabBar/widgets/home/widgets/headers.dart';
|
8
|
8
|
|
9
|
|
-
|
10
|
9
|
class MoreCars extends StatefulWidget {
|
11
|
10
|
const MoreCars({Key? key}) : super(key: key);
|
12
|
11
|
|
|
@@ -14,115 +13,111 @@ class MoreCars extends StatefulWidget {
|
14
|
13
|
State<MoreCars> createState() => _MoreCarsState();
|
15
|
14
|
}
|
16
|
15
|
|
17
|
|
-class _MoreCarsState extends State<MoreCars> with TickerProviderStateMixin {
|
18
|
|
-
|
19
|
|
- late TabController _controller = TabController(length: tabText.length, vsync: this);
|
20
|
|
- List<String> tabText= [
|
21
|
|
- '全部',
|
22
|
|
- '播种机',
|
23
|
|
- '收割机',
|
24
|
|
- '挺长名字的农机选项分类',
|
|
16
|
+class _MoreCarsState extends State<MoreCars> with TickerProviderStateMixin {
|
|
17
|
+ late TabController _controller =
|
|
18
|
+ TabController(length: tabText.length, vsync: this);
|
|
19
|
+ List<String> tabText = [
|
|
20
|
+ '全部',
|
|
21
|
+ '播种机',
|
|
22
|
+ '收割机',
|
|
23
|
+ '挺长名字的农机选项分类',
|
25
|
24
|
];
|
26
|
25
|
|
27
|
|
-
|
28
|
|
-
|
29
|
26
|
@override
|
30
|
27
|
void initState() {
|
31
|
28
|
// TODO: implement initState
|
32
|
29
|
super.initState();
|
33
|
30
|
}
|
|
31
|
+
|
34
|
32
|
@override
|
35
|
33
|
Widget build(BuildContext context) {
|
36
|
34
|
// _controller=TabController(length: tabText.length, vsync: this);
|
37
|
35
|
return Scaffold(
|
38
|
|
- resizeToAvoidBottomInset: false,
|
39
|
|
- appBar: AppBar(
|
40
|
|
- elevation: 0,
|
41
|
|
- centerTitle: true,
|
42
|
|
- backgroundColor: Colors.white,
|
43
|
|
- title:Text(
|
44
|
|
- '更多',
|
45
|
|
- style: TextStyle(
|
46
|
|
- color: Colors.black,
|
47
|
|
- fontSize: 17.sp,
|
48
|
|
- letterSpacing: 2,
|
49
|
|
- fontWeight: FontWeight.bold),
|
|
36
|
+ resizeToAvoidBottomInset: false,
|
|
37
|
+ appBar: AppBar(
|
|
38
|
+ elevation: 0,
|
|
39
|
+ centerTitle: true,
|
|
40
|
+ backgroundColor: Colors.white,
|
|
41
|
+ title: Text(
|
|
42
|
+ '更多',
|
|
43
|
+ style: TextStyle(
|
|
44
|
+ color: Colors.black,
|
|
45
|
+ fontSize: 17.sp,
|
|
46
|
+ letterSpacing: 2,
|
|
47
|
+ fontWeight: FontWeight.bold),
|
|
48
|
+ ),
|
50
|
49
|
),
|
51
|
|
-
|
52
|
|
- ),
|
53
|
|
- body: ListView(
|
54
|
|
- children: [Column(
|
55
|
|
- children: [
|
56
|
|
- Container(
|
57
|
|
- padding: EdgeInsets.fromLTRB(20, 15, 20, 15),
|
58
|
|
-
|
59
|
|
- decoration: BoxDecoration(
|
60
|
|
- color: Colors.white
|
|
50
|
+ body: ListView(children: [
|
|
51
|
+ Column(
|
|
52
|
+ children: [
|
|
53
|
+ Container(
|
|
54
|
+ padding: EdgeInsets.fromLTRB(20, 15, 20, 15),
|
|
55
|
+
|
|
56
|
+ decoration: BoxDecoration(color: Colors.white),
|
|
57
|
+ // child:Search(),
|
|
58
|
+ child: Container(
|
|
59
|
+ height: 32.w,
|
|
60
|
+ decoration: const BoxDecoration(color: Colors.white),
|
|
61
|
+ child: GestureDetector(
|
|
62
|
+ onTap: () {
|
|
63
|
+ Get.toNamed('/searchPage');
|
|
64
|
+ },
|
|
65
|
+ child: Container(
|
|
66
|
+ decoration: const BoxDecoration(
|
|
67
|
+ // color: Colors.red,
|
|
68
|
+ color: Color(0x30cccccc),
|
|
69
|
+ borderRadius: BorderRadius.all(Radius.circular(25)),
|
|
70
|
+ ),
|
|
71
|
+ child: Row(
|
|
72
|
+ children: [
|
|
73
|
+ Padding(
|
|
74
|
+ padding: EdgeInsets.fromLTRB(15, 0, 5, 0),
|
|
75
|
+ child: Icon(
|
|
76
|
+ Icons.search,
|
|
77
|
+ size: 19,
|
|
78
|
+ color: Color(0xff666666),
|
|
79
|
+ ),
|
|
80
|
+ ),
|
|
81
|
+ Text(
|
|
82
|
+ '请输入关键字查询',
|
|
83
|
+ style: TextStyle(
|
|
84
|
+ color: Color(0xff666666), fontSize: 14),
|
|
85
|
+ )
|
|
86
|
+ ],
|
|
87
|
+ ),
|
|
88
|
+ )
|
|
89
|
+ // Search(),
|
|
90
|
+ )),
|
61
|
91
|
),
|
62
|
|
- // child:Search(),
|
63
|
|
- child: Container(
|
64
|
|
- height: 32.w,
|
65
|
|
- decoration: const BoxDecoration(
|
66
|
|
- color: Colors.white
|
67
|
|
- ),
|
68
|
|
- child: GestureDetector(
|
69
|
|
- onTap: (){
|
70
|
|
- print('点击了搜索');
|
71
|
|
- },
|
72
|
|
- child: Container(
|
73
|
|
- decoration: const BoxDecoration(
|
74
|
|
- // color: Colors.red,
|
75
|
|
- color: Color(0x30cccccc),
|
76
|
|
- borderRadius: BorderRadius.all(Radius.circular(25)),
|
77
|
|
- ),
|
78
|
|
- child: Row(
|
79
|
|
- children: [
|
80
|
|
- Padding(padding: EdgeInsets.fromLTRB(15, 0, 5, 0),
|
81
|
|
- child: Icon(Icons.search,size: 19,color:Color(0xff666666) ,),
|
82
|
|
- ),
|
83
|
|
- Text('请输入关键字查询',style: TextStyle(color: Color(0xff666666),fontSize: 14),)
|
84
|
|
- ],
|
85
|
|
- ),
|
86
|
|
- )
|
87
|
|
- // Search(),
|
88
|
|
- )
|
|
92
|
+ TabBar(
|
|
93
|
+ labelStyle: TextStyle(
|
|
94
|
+ fontSize: ScreenUtil().setSp(19),
|
|
95
|
+ fontWeight: FontWeight.bold), //选中的样式
|
|
96
|
+ unselectedLabelStyle:
|
|
97
|
+ TextStyle(fontSize: ScreenUtil().setSp(16)), //未选中的样式
|
|
98
|
+ controller: _controller,
|
|
99
|
+ isScrollable: true, //可滚动
|
|
100
|
+ indicatorColor: Colors.black, //指示器的颜色
|
|
101
|
+ labelColor: Colors.black, //选中文字颜色
|
|
102
|
+ unselectedLabelColor: Color(0xffadadad),
|
|
103
|
+ // indicatorSize: TabBarIndicatorSize.label, //指示器与文字等宽
|
|
104
|
+ tabs: tabText.map((e) => Tab(text: e)).toList(),
|
|
105
|
+ onTap: (int i) {
|
|
106
|
+ print('当前+${i}');
|
|
107
|
+ },
|
89
|
108
|
),
|
90
|
|
- ),
|
91
|
|
-
|
92
|
|
- TabBar(
|
93
|
|
- labelStyle: TextStyle(fontSize: ScreenUtil().setSp(19),fontWeight: FontWeight.bold), //选中的样式
|
94
|
|
- unselectedLabelStyle: TextStyle(fontSize:ScreenUtil().setSp(16)), //未选中的样式
|
95
|
|
- controller: _controller,
|
96
|
|
- isScrollable: true, //可滚动
|
97
|
|
- indicatorColor: Colors.black, //指示器的颜色
|
98
|
|
- labelColor: Colors.black, //选中文字颜色
|
99
|
|
- unselectedLabelColor: Color(0xffadadad),
|
100
|
|
- // indicatorSize: TabBarIndicatorSize.label, //指示器与文字等宽
|
101
|
|
- tabs: tabText.map((e) => Tab(text: e)).toList(),
|
102
|
|
- onTap: (int i) {
|
103
|
|
- print('当前+${i}');
|
104
|
|
- },
|
105
|
|
-
|
106
|
|
- ),
|
107
|
|
- Container(
|
108
|
|
- child: Column(
|
109
|
|
- children: [
|
110
|
|
- CarsCard(),
|
111
|
|
- CarsCard(),
|
112
|
|
- CarsCard(),
|
113
|
|
- CarsCard(),
|
114
|
|
- ],
|
|
109
|
+ Container(
|
|
110
|
+ child: Column(
|
|
111
|
+ children: [
|
|
112
|
+ CarsCard(),
|
|
113
|
+ CarsCard(),
|
|
114
|
+ CarsCard(),
|
|
115
|
+ CarsCard(),
|
|
116
|
+ ],
|
|
117
|
+ ),
|
115
|
118
|
)
|
116
|
|
- ,
|
117
|
|
- )
|
118
|
|
-
|
119
|
|
-
|
120
|
|
- ],
|
121
|
|
- )]
|
122
|
|
-
|
123
|
|
- )
|
124
|
|
-
|
125
|
|
- );
|
|
119
|
+ ],
|
|
120
|
+ )
|
|
121
|
+ ]));
|
126
|
122
|
}
|
127
|
123
|
}
|
128
|
|
-
|