1
+ import 'package:flutter/material.dart' ;
2
+
3
+ void main () => runApp (MyApp ());
4
+
5
+ class MyApp extends StatelessWidget {
6
+ @override
7
+ Widget build (BuildContext context) {
8
+ return MaterialApp (
9
+ title: 'Flutter 打造 Adobe 全家桶' ,
10
+ theme: ThemeData (
11
+ primarySwatch: Colors .blue,
12
+ ),
13
+ home: MyHomePage (title: 'Flutter 打造 Adobe 全家桶' ),
14
+ );
15
+ }
16
+ }
17
+
18
+ class MyHomePage extends StatefulWidget {
19
+ MyHomePage ({Key key, this .title}) : super (key: key);
20
+
21
+ final String title;
22
+
23
+ @override
24
+ _MyHomePageState createState () => _MyHomePageState ();
25
+ }
26
+
27
+ class _MyHomePageState extends State <MyHomePage > {
28
+
29
+ @override
30
+ void initState () {
31
+ super .initState ();
32
+ }
33
+
34
+ Widget buildItems (
35
+ String text, Color textColor, Color borderColor, Color bgColor,
36
+ {bool showRectRadis = false }) {
37
+ return Padding (
38
+ padding: EdgeInsets .all (15 ),
39
+ child: Container (
40
+ decoration: BoxDecoration (
41
+ color: bgColor,
42
+ border: Border .all (color: borderColor, width: 5 ),
43
+ borderRadius: showRectRadis == true
44
+ ? BorderRadius .circular (15 )
45
+ : BorderRadius .circular (0 ),
46
+ ),
47
+ child: Center (
48
+ child: Text (
49
+ text,
50
+ style: TextStyle (
51
+ fontSize: 35.0 ,
52
+ color: textColor,
53
+ fontWeight: FontWeight .bold,
54
+ ),
55
+ ),
56
+ ),
57
+ ),
58
+ );
59
+ }
60
+
61
+ @override
62
+ Widget build (BuildContext context) {
63
+ return Scaffold (
64
+ backgroundColor: Colors .grey[300 ],
65
+ appBar: AppBar (
66
+ title: Text (widget.title),
67
+ ),
68
+ body: GridView .count (
69
+ crossAxisCount: 4 ,
70
+ crossAxisSpacing: 5.0 ,
71
+ mainAxisSpacing: 5.0 ,
72
+ children: [
73
+
74
+ buildItems (
75
+ 'Ps' ,
76
+ const Color (0XFF00C8FD ),
77
+ const Color (0XFF00C8FD ),
78
+ const Color (0XFF001C25 ),
79
+ showRectRadis: true ,
80
+ ),
81
+ buildItems (
82
+ 'Ai' ,
83
+ const Color (0XFFFF7C00 ),
84
+ const Color (0XFFFF7C00 ),
85
+ const Color (0XFF271403 ),
86
+ ),
87
+ buildItems (
88
+ 'Id' ,
89
+ const Color (0XFFDA007A ),
90
+ const Color (0XFFDA007A ),
91
+ const Color (0XFF412E34 ),
92
+ ),
93
+ buildItems (
94
+ 'Xd' ,
95
+ const Color (0XFFFE2BC0 ),
96
+ const Color (0XFFFE2BC0 ),
97
+ const Color (0XFF2D001D ),
98
+ showRectRadis: true ,
99
+ ),
100
+ buildItems (
101
+ 'Dw' ,
102
+ const Color (0XFF35F900 ),
103
+ const Color (0XFF35F900 ),
104
+ const Color (0XFF072600 ),
105
+ ),
106
+ buildItems (
107
+ 'Bē' ,
108
+ const Color (0XFFFFFFFF ),
109
+ const Color (0XFFFFFFFF ),
110
+ const Color (0XFF02ABF4 ),
111
+ ),
112
+ buildItems (
113
+ 'Br' ,
114
+ const Color (0XFFFB9300 ),
115
+ const Color (0XFFFB9300 ),
116
+ const Color (0XFF261C00 ),
117
+ ),
118
+ buildItems (
119
+ 'Ch' ,
120
+ const Color (0XFFDA91FF ),
121
+ const Color (0XFFDA91FF ),
122
+ const Color (0XFF26003B ),
123
+ ),
124
+ buildItems (
125
+ 'Ic' ,
126
+ const Color (0XFFFF5FF8 ),
127
+ const Color (0XFFFF5FF8 ),
128
+ const Color (0XFF2B0028 ),
129
+ ),
130
+ buildItems (
131
+ 'Lr' ,
132
+ const Color (0XFF3CEEED ),
133
+ const Color (0XFF3CEEED ),
134
+ const Color (0XFF012225 ),
135
+ ),
136
+ buildItems (
137
+ 'Pr' ,
138
+ const Color (0XFFEA77FE ),
139
+ const Color (0XFFEA77FE ),
140
+ const Color (0XFF290034 ),
141
+ ),
142
+ buildItems (
143
+ 'Ae' ,
144
+ const Color (0XFFD190FE ),
145
+ const Color (0XFFD190FE ),
146
+ const Color (0XFF1F003F ),
147
+ ),
148
+ buildItems (
149
+ 'Au' ,
150
+ const Color (0XFF01E4BA ),
151
+ const Color (0XFF01E4BA ),
152
+ const Color (0XFF00251E ),
153
+ ),
154
+ buildItems (
155
+ 'Pl' ,
156
+ const Color (0XFF00DBFF ),
157
+ const Color (0XFF00DBFF ),
158
+ const Color (0XFF002026 ),
159
+ ),
160
+ buildItems (
161
+ 'An' ,
162
+ const Color (0XFFFF4A19 ),
163
+ const Color (0XFFFF4A19 ),
164
+ const Color (0XFF260600 ),
165
+ ),
166
+ buildItems (
167
+ 'Cf' ,
168
+ const Color (0XFFCADBFE ),
169
+ const Color (0XFFCADBFE ),
170
+ const Color (0XFF000F34 ),
171
+ ),
172
+ buildItems (
173
+ 'Cp' ,
174
+ const Color (0XFF00E778 ),
175
+ const Color (0XFF00E778 ),
176
+ const Color (0XFF00120A ),
177
+ ),
178
+ buildItems (
179
+ 'Sp' ,
180
+ const Color (0XFFFFF7CC ),
181
+ const Color (0XFFFFD70D ),
182
+ const Color (0XFF262002 ),
183
+ showRectRadis: true ,
184
+ ),
185
+ buildItems (
186
+ 'Dn' ,
187
+ const Color (0XFFD4FCEF ),
188
+ const Color (0XFF3CF2A6 ),
189
+ const Color (0XFF00261A ),
190
+ showRectRadis: true ,
191
+ ),
192
+ buildItems (
193
+ 'St' ,
194
+ const Color (0XFFFD4286 ),
195
+ const Color (0XFFFD4286 ),
196
+ const Color (0XFF1F0101 ),
197
+ ),
198
+ buildItems (
199
+ 'Ru' ,
200
+ const Color (0XFFECD9FF ),
201
+ const Color (0XFFC993FF ),
202
+ const Color (0XFF260D40 ),
203
+ showRectRadis: true ,
204
+ ),
205
+ buildItems (
206
+ 'Sc' ,
207
+ const Color (0XFFC1B2D2 ),
208
+ const Color (0XFFC1B2D2 ),
209
+ const Color (0XFF302A36 ),
210
+ ),
211
+ buildItems (
212
+ 'Fb' ,
213
+ const Color (0XFFD1C4C3 ),
214
+ const Color (0XFFD1C4C3 ),
215
+ const Color (0XFF2B2728 ),
216
+ ),
217
+ buildItems (
218
+ 'Fw' ,
219
+ const Color (0XFFE4EB00 ),
220
+ const Color (0XFFE4EB00 ),
221
+ const Color (0XFF3E3A26 ),
222
+ ),
223
+ buildItems (
224
+ 'Sg' ,
225
+ const Color (0XFF04F7F6 ),
226
+ const Color (0XFF04F7F6 ),
227
+ const Color (0XFF002726 ),
228
+ ),
229
+ buildItems (
230
+ 'Fs' ,
231
+ const Color (0XFFF98A00 ),
232
+ const Color (0XFFF98A00 ),
233
+ const Color (0XFF261600 ),
234
+ ),
235
+ buildItems (
236
+ 'Mu' ,
237
+ const Color (0XFFC1E702 ),
238
+ const Color (0XFFC1E702 ),
239
+ const Color (0XFF1D2304 ),
240
+ ),
241
+ buildItems (
242
+ 'Fl' ,
243
+ const Color (0XFFF1201B ),
244
+ const Color (0XFFF1201B ),
245
+ const Color (0XFF482D29 ),
246
+ ),
247
+ buildItems (
248
+ 'Ul' ,
249
+ const Color (0XFFF2F7F2 ),
250
+ const Color (0XFF35811F ),
251
+ const Color (0XFF35811F ),
252
+ ),
253
+ buildItems (
254
+ 'PM' ,
255
+ const Color (0XFF434646 ),
256
+ const Color (0XFF969B37 ),
257
+ const Color (0XFF969B37 ),
258
+ ),
259
+ buildItems (
260
+ 'Sb' ,
261
+ const Color (0XFFF3F3EF ),
262
+ const Color (0XFF605B3A ),
263
+ const Color (0XFF605B3A ),
264
+ showRectRadis: true ,
265
+ ),
266
+
267
+ ],
268
+ ),
269
+ );
270
+ }
271
+
272
+ }
0 commit comments