search_page.dart
4.45 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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
import 'package:flutter/material.dart';
import 'package:Parlando/tiktok/style/style.dart';
import 'package:tapped/tapped.dart';
import 'package:Parlando/extension/int_extension.dart';
class SearchPage extends StatefulWidget {
final Function? onPop;
const SearchPage({
Key? key,
this.onPop,
}) : super(key: key);
@override
_SearchPageState createState() => _SearchPageState();
}
class _SearchPageState extends State<SearchPage> {
@override
Widget build(BuildContext context) {
Widget head = Container(
padding: EdgeInsets.only(top: MediaQuery.of(context).padding.top),
color: ColorPlate.back2,
width: double.infinity,
alignment: Alignment.center,
child: Container(
padding: EdgeInsets.symmetric(
horizontal: 16.px,
vertical: 12.px,
),
child: Row(
children: <Widget>[
Icon(
Icons.fullscreen,
size: 24.px,
color: Colors.white,
),
Expanded(
child: Container(
height: 32.px,
margin: EdgeInsets.only(right: 20.px, left: 12.px),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(4.px),
),
padding: EdgeInsets.only(left: 12.px),
child: Opacity(
opacity: 0.3,
child: Row(
children: <Widget>[
Icon(
Icons.search,
size: 20.px,
),
Container(
padding: EdgeInsets.only(
left: 2.px,
bottom: 2.px,
),
child: const Text(
'搜索内容',
style: StandardTextStyle.normal,
),
)
],
),
),
),
),
Tapped(
child: Text(
'取消',
style: StandardTextStyle.normal.apply(color: ColorPlate.orange),
),
onTap: widget.onPop,
),
],
),
),
);
Widget body = ListView(
padding: EdgeInsets.zero,
children: <Widget>[
const _SearchSelectRow(),
const _SearchSelectRow(),
Opacity(
opacity: 0.6,
child: SizedBox(
height: 46.px,
child: const Center(child: Text('全部搜索记录')),
),
),
Container(
margin: EdgeInsets.symmetric(horizontal: 12.px, vertical: 16.px),
child: AspectRatio(
aspectRatio: 4.px,
child: Container(
decoration: BoxDecoration(
color: Colors.white,
border: Border.all(color: Colors.black),
borderRadius: BorderRadius.circular(8.px),
),
alignment: Alignment.center,
child: Text(
'预留轮播图',
style: TextStyle(
color: Colors.black45,
fontSize: 18.px,
fontWeight: FontWeight.w900,
),
),
),
),
),
],
);
return Scaffold(
body: Container(
color: Colors.white,
height: double.infinity,
width: double.infinity,
child: Column(
children: <Widget>[
head,
Expanded(child: body),
],
),
),
);
}
}
class _SearchSelectRow extends StatelessWidget {
const _SearchSelectRow({
Key? key,
}) : super(key: key);
@override
Widget build(BuildContext context) {
return Container(
padding: EdgeInsets.symmetric(horizontal: 20.px, vertical: 10.px),
child: Row(
children: <Widget>[
Icon(
Icons.timelapse,
size: 20.px,
),
Expanded(
child: Container(
padding: EdgeInsets.only(left: 8.px, bottom: 1.px),
child: const Text(
'搜索唐诗宋词元曲3000首',
style: StandardTextStyle.normal,
),
),
),
Icon(
Icons.clear,
size: 20.px,
),
],
),
);
}
}