李卓原

优化示例和图片

163 KB | W: | H:

67.8 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin

162 KB | W: | H:

67.6 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin
@@ -67,7 +67,7 @@ class _MyHomePageState extends State<MyHomePage> { @@ -67,7 +67,7 @@ class _MyHomePageState extends State<MyHomePage> {
67 'My width:${ScreenUtil().setWidth(375)}dp', 67 'My width:${ScreenUtil().setWidth(375)}dp',
68 style: TextStyle( 68 style: TextStyle(
69 color: Colors.white, 69 color: Colors.white,
70 - fontSize: ScreenUtil().setSp(12, false)), 70 + fontSize: ScreenUtil().setSp(24, false)),
71 ), 71 ),
72 ), 72 ),
73 Container( 73 Container(
@@ -77,7 +77,7 @@ class _MyHomePageState extends State<MyHomePage> { @@ -77,7 +77,7 @@ class _MyHomePageState extends State<MyHomePage> {
77 child: Text('My width:${ScreenUtil().setWidth(375)}dp', 77 child: Text('My width:${ScreenUtil().setWidth(375)}dp',
78 style: TextStyle( 78 style: TextStyle(
79 color: Colors.white, 79 color: Colors.white,
80 - fontSize: ScreenUtil().setSp(12, false))), 80 + fontSize: ScreenUtil().setSp(24, false))),
81 ), 81 ),
82 ], 82 ],
83 ), 83 ),
@@ -110,16 +110,16 @@ class _MyHomePageState extends State<MyHomePage> { @@ -110,16 +110,16 @@ class _MyHomePageState extends State<MyHomePage> {
110 crossAxisAlignment: CrossAxisAlignment.start, 110 crossAxisAlignment: CrossAxisAlignment.start,
111 children: <Widget>[ 111 children: <Widget>[
112 Text( 112 Text(
113 - 'My font size is 14px on the design draft and will not change with the system.', 113 + 'My font size is 24px on the design draft and will not change with the system.',
114 style: TextStyle( 114 style: TextStyle(
115 color: Colors.black, 115 color: Colors.black,
116 - fontSize: ScreenUtil().setSp(14, false), 116 + fontSize: ScreenUtil().setSp(24, false),
117 )), 117 )),
118 Text( 118 Text(
119 - 'My font size is 14px on the design draft and will change with the system.', 119 + 'My font size is 24px on the design draft and will change with the system.',
120 style: TextStyle( 120 style: TextStyle(
121 color: Colors.black, 121 color: Colors.black,
122 - fontSize: ScreenUtil().setSp(14), 122 + fontSize: ScreenUtil().setSp(24),
123 )), 123 )),
124 ], 124 ],
125 ) 125 )
@@ -28,7 +28,6 @@ class MyHomePage extends StatefulWidget { @@ -28,7 +28,6 @@ class MyHomePage extends StatefulWidget {
28 } 28 }
29 29
30 class _MyHomePageState extends State<MyHomePage> { 30 class _MyHomePageState extends State<MyHomePage> {
31 -  
32 @override 31 @override
33 Widget build(BuildContext context) { 32 Widget build(BuildContext context) {
34 //设置适配尺寸 (填入设计稿中设备的屏幕尺寸) 假如设计稿是按iPhone6的尺寸设计的(iPhone6 750*1334) 33 //设置适配尺寸 (填入设计稿中设备的屏幕尺寸) 假如设计稿是按iPhone6的尺寸设计的(iPhone6 750*1334)
@@ -46,8 +45,7 @@ class _MyHomePageState extends State<MyHomePage> { @@ -46,8 +45,7 @@ class _MyHomePageState extends State<MyHomePage> {
46 45
47 print( 46 print(
48 '宽度和字体相对于设计稿放大的比例:${ScreenUtil().scaleWidth * ScreenUtil.pixelRatio}'); 47 '宽度和字体相对于设计稿放大的比例:${ScreenUtil().scaleWidth * ScreenUtil.pixelRatio}');
49 - print(  
50 - '高度相对于设计稿放大的比例:${ScreenUtil().scaleHeight * ScreenUtil.pixelRatio}'); 48 + print('高度相对于设计稿放大的比例:${ScreenUtil().scaleHeight * ScreenUtil.pixelRatio}');
51 print('系统的字体缩放比例:${ScreenUtil.textScaleFactory}'); 49 print('系统的字体缩放比例:${ScreenUtil.textScaleFactory}');
52 50
53 return new Scaffold( 51 return new Scaffold(
@@ -68,7 +66,7 @@ class _MyHomePageState extends State<MyHomePage> { @@ -68,7 +66,7 @@ class _MyHomePageState extends State<MyHomePage> {
68 '我的宽度:${ScreenUtil().setWidth(375)}dp', 66 '我的宽度:${ScreenUtil().setWidth(375)}dp',
69 style: TextStyle( 67 style: TextStyle(
70 color: Colors.white, 68 color: Colors.white,
71 - fontSize: ScreenUtil().setSp(12, false), 69 + fontSize: ScreenUtil().setSp(24, false),
72 ), 70 ),
73 ), 71 ),
74 ), 72 ),
@@ -79,7 +77,7 @@ class _MyHomePageState extends State<MyHomePage> { @@ -79,7 +77,7 @@ class _MyHomePageState extends State<MyHomePage> {
79 child: Text('我的宽度:${ScreenUtil().setWidth(375)}dp', 77 child: Text('我的宽度:${ScreenUtil().setWidth(375)}dp',
80 style: TextStyle( 78 style: TextStyle(
81 color: Colors.white, 79 color: Colors.white,
82 - fontSize: ScreenUtil().setSp(12, false), 80 + fontSize: ScreenUtil().setSp(24, false),
83 )), 81 )),
84 ), 82 ),
85 ], 83 ],
@@ -112,13 +110,13 @@ class _MyHomePageState extends State<MyHomePage> { @@ -112,13 +110,13 @@ class _MyHomePageState extends State<MyHomePage> {
112 Column( 110 Column(
113 crossAxisAlignment: CrossAxisAlignment.start, 111 crossAxisAlignment: CrossAxisAlignment.start,
114 children: <Widget>[ 112 children: <Widget>[
115 - Text('我的文字大小在设计稿上是14px,不会随着系统的文字缩放比例变化', 113 + Text('我的文字大小在设计稿上是25px,不会随着系统的文字缩放比例变化',
116 style: TextStyle( 114 style: TextStyle(
117 color: Colors.black, 115 color: Colors.black,
118 - fontSize: ScreenUtil().setSp(14, false))),  
119 - Text('我的文字大小在设计稿上是14px,会随着系统的文字缩放比例变化', 116 + fontSize: ScreenUtil().setSp(24, false))),
  117 + Text('我的文字大小在设计稿上是25px,会随着系统的文字缩放比例变化',
120 style: TextStyle( 118 style: TextStyle(
121 - color: Colors.black, fontSize: ScreenUtil().setSp(14))), 119 + color: Colors.black, fontSize: ScreenUtil().setSp(24))),
122 ], 120 ],
123 ) 121 )
124 ], 122 ],
1 # Generated by pub 1 # Generated by pub
2 # See https://www.dartlang.org/tools/pub/glossary#lockfile 2 # See https://www.dartlang.org/tools/pub/glossary#lockfile
3 packages: 3 packages:
4 - analyzer:  
5 - dependency: transitive  
6 - description:  
7 - name: analyzer  
8 - url: "https://pub.dartlang.org"  
9 - source: hosted  
10 - version: "0.32.4"  
11 - args:  
12 - dependency: transitive  
13 - description:  
14 - name: args  
15 - url: "https://pub.dartlang.org"  
16 - source: hosted  
17 - version: "1.5.0"  
18 async: 4 async:
19 dependency: transitive 5 dependency: transitive
20 description: 6 description:
@@ -43,27 +29,6 @@ packages: @@ -43,27 +29,6 @@ packages:
43 url: "https://pub.dartlang.org" 29 url: "https://pub.dartlang.org"
44 source: hosted 30 source: hosted
45 version: "1.14.11" 31 version: "1.14.11"
46 - convert:  
47 - dependency: transitive  
48 - description:  
49 - name: convert  
50 - url: "https://pub.dartlang.org"  
51 - source: hosted  
52 - version: "2.0.2"  
53 - crypto:  
54 - dependency: transitive  
55 - description:  
56 - name: crypto  
57 - url: "https://pub.dartlang.org"  
58 - source: hosted  
59 - version: "2.0.6"  
60 - csslib:  
61 - dependency: transitive  
62 - description:  
63 - name: csslib  
64 - url: "https://pub.dartlang.org"  
65 - source: hosted  
66 - version: "0.14.5"  
67 cupertino_icons: 32 cupertino_icons:
68 dependency: "direct main" 33 dependency: "direct main"
69 description: 34 description:
@@ -82,89 +47,12 @@ packages: @@ -82,89 +47,12 @@ packages:
82 path: ".." 47 path: ".."
83 relative: true 48 relative: true
84 source: path 49 source: path
85 - version: "0.4.0" 50 + version: "0.4.1"
86 flutter_test: 51 flutter_test:
87 dependency: "direct dev" 52 dependency: "direct dev"
88 description: flutter 53 description: flutter
89 source: sdk 54 source: sdk
90 version: "0.0.0" 55 version: "0.0.0"
91 - front_end:  
92 - dependency: transitive  
93 - description:  
94 - name: front_end  
95 - url: "https://pub.dartlang.org"  
96 - source: hosted  
97 - version: "0.1.4"  
98 - glob:  
99 - dependency: transitive  
100 - description:  
101 - name: glob  
102 - url: "https://pub.dartlang.org"  
103 - source: hosted  
104 - version: "1.1.7"  
105 - html:  
106 - dependency: transitive  
107 - description:  
108 - name: html  
109 - url: "https://pub.dartlang.org"  
110 - source: hosted  
111 - version: "0.13.3+3"  
112 - http:  
113 - dependency: transitive  
114 - description:  
115 - name: http  
116 - url: "https://pub.dartlang.org"  
117 - source: hosted  
118 - version: "0.11.3+17"  
119 - http_multi_server:  
120 - dependency: transitive  
121 - description:  
122 - name: http_multi_server  
123 - url: "https://pub.dartlang.org"  
124 - source: hosted  
125 - version: "2.0.5"  
126 - http_parser:  
127 - dependency: transitive  
128 - description:  
129 - name: http_parser  
130 - url: "https://pub.dartlang.org"  
131 - source: hosted  
132 - version: "3.1.3"  
133 - io:  
134 - dependency: transitive  
135 - description:  
136 - name: io  
137 - url: "https://pub.dartlang.org"  
138 - source: hosted  
139 - version: "0.3.3"  
140 - js:  
141 - dependency: transitive  
142 - description:  
143 - name: js  
144 - url: "https://pub.dartlang.org"  
145 - source: hosted  
146 - version: "0.6.1+1"  
147 - json_rpc_2:  
148 - dependency: transitive  
149 - description:  
150 - name: json_rpc_2  
151 - url: "https://pub.dartlang.org"  
152 - source: hosted  
153 - version: "2.0.9"  
154 - kernel:  
155 - dependency: transitive  
156 - description:  
157 - name: kernel  
158 - url: "https://pub.dartlang.org"  
159 - source: hosted  
160 - version: "0.3.4"  
161 - logging:  
162 - dependency: transitive  
163 - description:  
164 - name: logging  
165 - url: "https://pub.dartlang.org"  
166 - source: hosted  
167 - version: "0.11.3+2"  
168 matcher: 56 matcher:
169 dependency: transitive 57 dependency: transitive
170 description: 58 description:
@@ -179,41 +67,6 @@ packages: @@ -179,41 +67,6 @@ packages:
179 url: "https://pub.dartlang.org" 67 url: "https://pub.dartlang.org"
180 source: hosted 68 source: hosted
181 version: "1.1.6" 69 version: "1.1.6"
182 - mime:  
183 - dependency: transitive  
184 - description:  
185 - name: mime  
186 - url: "https://pub.dartlang.org"  
187 - source: hosted  
188 - version: "0.9.6+2"  
189 - multi_server_socket:  
190 - dependency: transitive  
191 - description:  
192 - name: multi_server_socket  
193 - url: "https://pub.dartlang.org"  
194 - source: hosted  
195 - version: "1.0.2"  
196 - node_preamble:  
197 - dependency: transitive  
198 - description:  
199 - name: node_preamble  
200 - url: "https://pub.dartlang.org"  
201 - source: hosted  
202 - version: "1.4.4"  
203 - package_config:  
204 - dependency: transitive  
205 - description:  
206 - name: package_config  
207 - url: "https://pub.dartlang.org"  
208 - source: hosted  
209 - version: "1.0.5"  
210 - package_resolver:  
211 - dependency: transitive  
212 - description:  
213 - name: package_resolver  
214 - url: "https://pub.dartlang.org"  
215 - source: hosted  
216 - version: "1.0.4"  
217 path: 70 path:
218 dependency: transitive 71 dependency: transitive
219 description: 72 description:
@@ -221,81 +74,18 @@ packages: @@ -221,81 +74,18 @@ packages:
221 url: "https://pub.dartlang.org" 74 url: "https://pub.dartlang.org"
222 source: hosted 75 source: hosted
223 version: "1.6.2" 76 version: "1.6.2"
224 - plugin:  
225 - dependency: transitive  
226 - description:  
227 - name: plugin  
228 - url: "https://pub.dartlang.org"  
229 - source: hosted  
230 - version: "0.2.0+3"  
231 - pool:  
232 - dependency: transitive  
233 - description:  
234 - name: pool  
235 - url: "https://pub.dartlang.org"  
236 - source: hosted  
237 - version: "1.3.6"  
238 - pub_semver:  
239 - dependency: transitive  
240 - description:  
241 - name: pub_semver  
242 - url: "https://pub.dartlang.org"  
243 - source: hosted  
244 - version: "1.4.2"  
245 quiver: 77 quiver:
246 dependency: transitive 78 dependency: transitive
247 description: 79 description:
248 name: quiver 80 name: quiver
249 url: "https://pub.dartlang.org" 81 url: "https://pub.dartlang.org"
250 source: hosted 82 source: hosted
251 - version: "2.0.0+1"  
252 - shelf:  
253 - dependency: transitive  
254 - description:  
255 - name: shelf  
256 - url: "https://pub.dartlang.org"  
257 - source: hosted  
258 - version: "0.7.3+3"  
259 - shelf_packages_handler:  
260 - dependency: transitive  
261 - description:  
262 - name: shelf_packages_handler  
263 - url: "https://pub.dartlang.org"  
264 - source: hosted  
265 - version: "1.0.4"  
266 - shelf_static:  
267 - dependency: transitive  
268 - description:  
269 - name: shelf_static  
270 - url: "https://pub.dartlang.org"  
271 - source: hosted  
272 - version: "0.2.8"  
273 - shelf_web_socket:  
274 - dependency: transitive  
275 - description:  
276 - name: shelf_web_socket  
277 - url: "https://pub.dartlang.org"  
278 - source: hosted  
279 - version: "0.2.2+4" 83 + version: "2.0.1"
280 sky_engine: 84 sky_engine:
281 dependency: transitive 85 dependency: transitive
282 description: flutter 86 description: flutter
283 source: sdk 87 source: sdk
284 version: "0.0.99" 88 version: "0.0.99"
285 - source_map_stack_trace:  
286 - dependency: transitive  
287 - description:  
288 - name: source_map_stack_trace  
289 - url: "https://pub.dartlang.org"  
290 - source: hosted  
291 - version: "1.1.5"  
292 - source_maps:  
293 - dependency: transitive  
294 - description:  
295 - name: source_maps  
296 - url: "https://pub.dartlang.org"  
297 - source: hosted  
298 - version: "0.10.7"  
299 source_span: 89 source_span:
300 dependency: transitive 90 dependency: transitive
301 description: 91 description:
@@ -331,13 +121,13 @@ packages: @@ -331,13 +121,13 @@ packages:
331 url: "https://pub.dartlang.org" 121 url: "https://pub.dartlang.org"
332 source: hosted 122 source: hosted
333 version: "1.0.1" 123 version: "1.0.1"
334 - test: 124 + test_api:
335 dependency: transitive 125 dependency: transitive
336 description: 126 description:
337 - name: test 127 + name: test_api
338 url: "https://pub.dartlang.org" 128 url: "https://pub.dartlang.org"
339 source: hosted 129 source: hosted
340 - version: "1.3.0" 130 + version: "0.2.1"
341 typed_data: 131 typed_data:
342 dependency: transitive 132 dependency: transitive
343 description: 133 description:
@@ -345,13 +135,6 @@ packages: @@ -345,13 +135,6 @@ packages:
345 url: "https://pub.dartlang.org" 135 url: "https://pub.dartlang.org"
346 source: hosted 136 source: hosted
347 version: "1.1.6" 137 version: "1.1.6"
348 - utf:  
349 - dependency: transitive  
350 - description:  
351 - name: utf  
352 - url: "https://pub.dartlang.org"  
353 - source: hosted  
354 - version: "0.9.0+5"  
355 vector_math: 138 vector_math:
356 dependency: transitive 139 dependency: transitive
357 description: 140 description:
@@ -359,33 +142,5 @@ packages: @@ -359,33 +142,5 @@ packages:
359 url: "https://pub.dartlang.org" 142 url: "https://pub.dartlang.org"
360 source: hosted 143 source: hosted
361 version: "2.0.8" 144 version: "2.0.8"
362 - vm_service_client:  
363 - dependency: transitive  
364 - description:  
365 - name: vm_service_client  
366 - url: "https://pub.dartlang.org"  
367 - source: hosted  
368 - version: "0.2.6"  
369 - watcher:  
370 - dependency: transitive  
371 - description:  
372 - name: watcher  
373 - url: "https://pub.dartlang.org"  
374 - source: hosted  
375 - version: "0.9.7+10"  
376 - web_socket_channel:  
377 - dependency: transitive  
378 - description:  
379 - name: web_socket_channel  
380 - url: "https://pub.dartlang.org"  
381 - source: hosted  
382 - version: "1.0.9"  
383 - yaml:  
384 - dependency: transitive  
385 - description:  
386 - name: yaml  
387 - url: "https://pub.dartlang.org"  
388 - source: hosted  
389 - version: "2.1.15"  
390 sdks: 145 sdks:
391 - dart: ">=2.0.0-dev.68.0 <3.0.0" 146 + dart: ">=2.0.0 <3.0.0"