李卓原

添加屏幕宽高(单位dp)的方法

1 -# Generated by pub on 2018-10-17 16:39:18.833879.  
2 -analyzer:file:///C:/Users/Frank/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/analyzer-0.32.4/lib/  
3 -args:file:///C:/Users/Frank/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/args-1.5.0/lib/  
4 -async:file:///C:/Users/Frank/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/async-2.0.8/lib/  
5 -boolean_selector:file:///C:/Users/Frank/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/boolean_selector-1.0.4/lib/  
6 -charcode:file:///C:/Users/Frank/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/charcode-1.1.2/lib/  
7 -collection:file:///C:/Users/Frank/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/collection-1.14.11/lib/  
8 -convert:file:///C:/Users/Frank/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/convert-2.0.2/lib/  
9 -crypto:file:///C:/Users/Frank/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/crypto-2.0.6/lib/  
10 -csslib:file:///C:/Users/Frank/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/csslib-0.14.5/lib/ 1 +# Generated by pub on 2018-11-19 10:56:16.589695.
  2 +async:file:///D:/flutter/.pub-cache/hosted/pub.dartlang.org/async-2.0.8/lib/
  3 +boolean_selector:file:///D:/flutter/.pub-cache/hosted/pub.dartlang.org/boolean_selector-1.0.4/lib/
  4 +charcode:file:///D:/flutter/.pub-cache/hosted/pub.dartlang.org/charcode-1.1.2/lib/
  5 +collection:file:///D:/flutter/.pub-cache/hosted/pub.dartlang.org/collection-1.14.11/lib/
11 flutter:file:///D:/flutter/packages/flutter/lib/ 6 flutter:file:///D:/flutter/packages/flutter/lib/
12 flutter_test:file:///D:/flutter/packages/flutter_test/lib/ 7 flutter_test:file:///D:/flutter/packages/flutter_test/lib/
13 -front_end:file:///C:/Users/Frank/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/front_end-0.1.4/lib/  
14 -glob:file:///C:/Users/Frank/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/glob-1.1.7/lib/  
15 -html:file:///C:/Users/Frank/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/html-0.13.3+3/lib/  
16 -http:file:///C:/Users/Frank/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/http-0.11.3+17/lib/  
17 -http_multi_server:file:///C:/Users/Frank/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/http_multi_server-2.0.5/lib/  
18 -http_parser:file:///C:/Users/Frank/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/http_parser-3.1.3/lib/  
19 -io:file:///C:/Users/Frank/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/io-0.3.3/lib/  
20 -js:file:///C:/Users/Frank/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/js-0.6.1+1/lib/  
21 -json_rpc_2:file:///C:/Users/Frank/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/json_rpc_2-2.0.9/lib/  
22 -kernel:file:///C:/Users/Frank/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/kernel-0.3.4/lib/  
23 -logging:file:///C:/Users/Frank/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/logging-0.11.3+2/lib/  
24 -matcher:file:///C:/Users/Frank/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/matcher-0.12.3+1/lib/  
25 -meta:file:///C:/Users/Frank/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/meta-1.1.6/lib/  
26 -mime:file:///C:/Users/Frank/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/mime-0.9.6+2/lib/  
27 -multi_server_socket:file:///C:/Users/Frank/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/multi_server_socket-1.0.2/lib/  
28 -node_preamble:file:///C:/Users/Frank/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/node_preamble-1.4.4/lib/  
29 -package_config:file:///C:/Users/Frank/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/package_config-1.0.5/lib/  
30 -package_resolver:file:///C:/Users/Frank/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/package_resolver-1.0.4/lib/  
31 -path:file:///C:/Users/Frank/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/path-1.6.2/lib/  
32 -plugin:file:///C:/Users/Frank/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/plugin-0.2.0+3/lib/  
33 -pool:file:///C:/Users/Frank/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/pool-1.3.6/lib/  
34 -pub_semver:file:///C:/Users/Frank/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/pub_semver-1.4.2/lib/  
35 -quiver:file:///C:/Users/Frank/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/quiver-2.0.0+1/lib/  
36 -shelf:file:///C:/Users/Frank/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/shelf-0.7.3+3/lib/  
37 -shelf_packages_handler:file:///C:/Users/Frank/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/shelf_packages_handler-1.0.4/lib/  
38 -shelf_static:file:///C:/Users/Frank/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/shelf_static-0.2.8/lib/  
39 -shelf_web_socket:file:///C:/Users/Frank/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/shelf_web_socket-0.2.2+4/lib/ 8 +matcher:file:///D:/flutter/.pub-cache/hosted/pub.dartlang.org/matcher-0.12.3+1/lib/
  9 +meta:file:///D:/flutter/.pub-cache/hosted/pub.dartlang.org/meta-1.1.6/lib/
  10 +path:file:///D:/flutter/.pub-cache/hosted/pub.dartlang.org/path-1.6.2/lib/
  11 +quiver:file:///D:/flutter/.pub-cache/hosted/pub.dartlang.org/quiver-2.0.1/lib/
40 sky_engine:file:///D:/flutter/bin/cache/pkg/sky_engine/lib/ 12 sky_engine:file:///D:/flutter/bin/cache/pkg/sky_engine/lib/
41 -source_map_stack_trace:file:///C:/Users/Frank/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/source_map_stack_trace-1.1.5/lib/  
42 -source_maps:file:///C:/Users/Frank/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/source_maps-0.10.7/lib/  
43 -source_span:file:///C:/Users/Frank/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/source_span-1.4.1/lib/  
44 -stack_trace:file:///C:/Users/Frank/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/stack_trace-1.9.3/lib/  
45 -stream_channel:file:///C:/Users/Frank/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/stream_channel-1.6.8/lib/  
46 -string_scanner:file:///C:/Users/Frank/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/string_scanner-1.0.4/lib/  
47 -term_glyph:file:///C:/Users/Frank/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/term_glyph-1.0.1/lib/  
48 -test:file:///C:/Users/Frank/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/test-1.3.0/lib/  
49 -typed_data:file:///C:/Users/Frank/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/typed_data-1.1.6/lib/  
50 -utf:file:///C:/Users/Frank/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/utf-0.9.0+5/lib/  
51 -vector_math:file:///C:/Users/Frank/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/vector_math-2.0.8/lib/  
52 -vm_service_client:file:///C:/Users/Frank/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/vm_service_client-0.2.6/lib/  
53 -watcher:file:///C:/Users/Frank/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/watcher-0.9.7+10/lib/  
54 -web_socket_channel:file:///C:/Users/Frank/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/web_socket_channel-1.0.9/lib/  
55 -yaml:file:///C:/Users/Frank/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/yaml-2.1.15/lib/ 13 +source_span:file:///D:/flutter/.pub-cache/hosted/pub.dartlang.org/source_span-1.4.1/lib/
  14 +stack_trace:file:///D:/flutter/.pub-cache/hosted/pub.dartlang.org/stack_trace-1.9.3/lib/
  15 +stream_channel:file:///D:/flutter/.pub-cache/hosted/pub.dartlang.org/stream_channel-1.6.8/lib/
  16 +string_scanner:file:///D:/flutter/.pub-cache/hosted/pub.dartlang.org/string_scanner-1.0.4/lib/
  17 +term_glyph:file:///D:/flutter/.pub-cache/hosted/pub.dartlang.org/term_glyph-1.0.1/lib/
  18 +test_api:file:///D:/flutter/.pub-cache/hosted/pub.dartlang.org/test_api-0.2.1/lib/
  19 +typed_data:file:///D:/flutter/.pub-cache/hosted/pub.dartlang.org/typed_data-1.1.6/lib/
  20 +vector_math:file:///D:/flutter/.pub-cache/hosted/pub.dartlang.org/vector_math-2.0.8/lib/
56 flutter_screenutil:lib/ 21 flutter_screenutil:lib/
@@ -13,3 +13,13 @@ Height is enlarged relative to the design draft => The ratio of height width to @@ -13,3 +13,13 @@ Height is enlarged relative to the design draft => The ratio of height width to
13 ## [0.4.0] - Optimize font adaptation method 13 ## [0.4.0] - Optimize font adaptation method
14 14
15 ## [0.4.1] - Fix font adaptation issues 15 ## [0.4.1] - Fix font adaptation issues
  16 +
  17 +## [0.4.2] - add two Properties
  18 +
  19 + ///Current device width dp
  20 + ///当前设备宽度 dp
  21 + ScreenUtil.screenWidthDp
  22 +
  23 + ///Current device height dp
  24 + ///当前设备高度 dp
  25 + ScreenUtil.screenHeightDp
@@ -50,6 +50,12 @@ class ScreenUtil { @@ -50,6 +50,12 @@ class ScreenUtil {
50 ///设备的像素密度 50 ///设备的像素密度
51 static double get pixelRatio => _pixelRatio; 51 static double get pixelRatio => _pixelRatio;
52 52
  53 + ///当前设备宽度 dp
  54 + static double get screenWidthDp => _screenWidth;
  55 +
  56 + ///当前设备高度 dp
  57 + static double get screenHeightDp => _screenHeight;
  58 +
53 ///当前设备宽度 px 59 ///当前设备宽度 px
54 static double get screenWidth => _screenWidth * _pixelRatio; 60 static double get screenWidth => _screenWidth * _pixelRatio;
55 61
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 flutter: 32 flutter:
68 dependency: "direct main" 33 dependency: "direct main"
69 description: flutter 34 description: flutter
@@ -74,83 +39,6 @@ packages: @@ -74,83 +39,6 @@ packages:
74 description: flutter 39 description: flutter
75 source: sdk 40 source: sdk
76 version: "0.0.0" 41 version: "0.0.0"
77 - front_end:  
78 - dependency: transitive  
79 - description:  
80 - name: front_end  
81 - url: "https://pub.dartlang.org"  
82 - source: hosted  
83 - version: "0.1.4"  
84 - glob:  
85 - dependency: transitive  
86 - description:  
87 - name: glob  
88 - url: "https://pub.dartlang.org"  
89 - source: hosted  
90 - version: "1.1.7"  
91 - html:  
92 - dependency: transitive  
93 - description:  
94 - name: html  
95 - url: "https://pub.dartlang.org"  
96 - source: hosted  
97 - version: "0.13.3+3"  
98 - http:  
99 - dependency: transitive  
100 - description:  
101 - name: http  
102 - url: "https://pub.dartlang.org"  
103 - source: hosted  
104 - version: "0.11.3+17"  
105 - http_multi_server:  
106 - dependency: transitive  
107 - description:  
108 - name: http_multi_server  
109 - url: "https://pub.dartlang.org"  
110 - source: hosted  
111 - version: "2.0.5"  
112 - http_parser:  
113 - dependency: transitive  
114 - description:  
115 - name: http_parser  
116 - url: "https://pub.dartlang.org"  
117 - source: hosted  
118 - version: "3.1.3"  
119 - io:  
120 - dependency: transitive  
121 - description:  
122 - name: io  
123 - url: "https://pub.dartlang.org"  
124 - source: hosted  
125 - version: "0.3.3"  
126 - js:  
127 - dependency: transitive  
128 - description:  
129 - name: js  
130 - url: "https://pub.dartlang.org"  
131 - source: hosted  
132 - version: "0.6.1+1"  
133 - json_rpc_2:  
134 - dependency: transitive  
135 - description:  
136 - name: json_rpc_2  
137 - url: "https://pub.dartlang.org"  
138 - source: hosted  
139 - version: "2.0.9"  
140 - kernel:  
141 - dependency: transitive  
142 - description:  
143 - name: kernel  
144 - url: "https://pub.dartlang.org"  
145 - source: hosted  
146 - version: "0.3.4"  
147 - logging:  
148 - dependency: transitive  
149 - description:  
150 - name: logging  
151 - url: "https://pub.dartlang.org"  
152 - source: hosted  
153 - version: "0.11.3+2"  
154 matcher: 42 matcher:
155 dependency: transitive 43 dependency: transitive
156 description: 44 description:
@@ -165,41 +53,6 @@ packages: @@ -165,41 +53,6 @@ packages:
165 url: "https://pub.dartlang.org" 53 url: "https://pub.dartlang.org"
166 source: hosted 54 source: hosted
167 version: "1.1.6" 55 version: "1.1.6"
168 - mime:  
169 - dependency: transitive  
170 - description:  
171 - name: mime  
172 - url: "https://pub.dartlang.org"  
173 - source: hosted  
174 - version: "0.9.6+2"  
175 - multi_server_socket:  
176 - dependency: transitive  
177 - description:  
178 - name: multi_server_socket  
179 - url: "https://pub.dartlang.org"  
180 - source: hosted  
181 - version: "1.0.2"  
182 - node_preamble:  
183 - dependency: transitive  
184 - description:  
185 - name: node_preamble  
186 - url: "https://pub.dartlang.org"  
187 - source: hosted  
188 - version: "1.4.4"  
189 - package_config:  
190 - dependency: transitive  
191 - description:  
192 - name: package_config  
193 - url: "https://pub.dartlang.org"  
194 - source: hosted  
195 - version: "1.0.5"  
196 - package_resolver:  
197 - dependency: transitive  
198 - description:  
199 - name: package_resolver  
200 - url: "https://pub.dartlang.org"  
201 - source: hosted  
202 - version: "1.0.4"  
203 path: 56 path:
204 dependency: transitive 57 dependency: transitive
205 description: 58 description:
@@ -207,81 +60,18 @@ packages: @@ -207,81 +60,18 @@ packages:
207 url: "https://pub.dartlang.org" 60 url: "https://pub.dartlang.org"
208 source: hosted 61 source: hosted
209 version: "1.6.2" 62 version: "1.6.2"
210 - plugin:  
211 - dependency: transitive  
212 - description:  
213 - name: plugin  
214 - url: "https://pub.dartlang.org"  
215 - source: hosted  
216 - version: "0.2.0+3"  
217 - pool:  
218 - dependency: transitive  
219 - description:  
220 - name: pool  
221 - url: "https://pub.dartlang.org"  
222 - source: hosted  
223 - version: "1.3.6"  
224 - pub_semver:  
225 - dependency: transitive  
226 - description:  
227 - name: pub_semver  
228 - url: "https://pub.dartlang.org"  
229 - source: hosted  
230 - version: "1.4.2"  
231 quiver: 63 quiver:
232 dependency: transitive 64 dependency: transitive
233 description: 65 description:
234 name: quiver 66 name: quiver
235 url: "https://pub.dartlang.org" 67 url: "https://pub.dartlang.org"
236 source: hosted 68 source: hosted
237 - version: "2.0.0+1"  
238 - shelf:  
239 - dependency: transitive  
240 - description:  
241 - name: shelf  
242 - url: "https://pub.dartlang.org"  
243 - source: hosted  
244 - version: "0.7.3+3"  
245 - shelf_packages_handler:  
246 - dependency: transitive  
247 - description:  
248 - name: shelf_packages_handler  
249 - url: "https://pub.dartlang.org"  
250 - source: hosted  
251 - version: "1.0.4"  
252 - shelf_static:  
253 - dependency: transitive  
254 - description:  
255 - name: shelf_static  
256 - url: "https://pub.dartlang.org"  
257 - source: hosted  
258 - version: "0.2.8"  
259 - shelf_web_socket:  
260 - dependency: transitive  
261 - description:  
262 - name: shelf_web_socket  
263 - url: "https://pub.dartlang.org"  
264 - source: hosted  
265 - version: "0.2.2+4" 69 + version: "2.0.1"
266 sky_engine: 70 sky_engine:
267 dependency: transitive 71 dependency: transitive
268 description: flutter 72 description: flutter
269 source: sdk 73 source: sdk
270 version: "0.0.99" 74 version: "0.0.99"
271 - source_map_stack_trace:  
272 - dependency: transitive  
273 - description:  
274 - name: source_map_stack_trace  
275 - url: "https://pub.dartlang.org"  
276 - source: hosted  
277 - version: "1.1.5"  
278 - source_maps:  
279 - dependency: transitive  
280 - description:  
281 - name: source_maps  
282 - url: "https://pub.dartlang.org"  
283 - source: hosted  
284 - version: "0.10.7"  
285 source_span: 75 source_span:
286 dependency: transitive 76 dependency: transitive
287 description: 77 description:
@@ -317,13 +107,13 @@ packages: @@ -317,13 +107,13 @@ packages:
317 url: "https://pub.dartlang.org" 107 url: "https://pub.dartlang.org"
318 source: hosted 108 source: hosted
319 version: "1.0.1" 109 version: "1.0.1"
320 - test: 110 + test_api:
321 dependency: transitive 111 dependency: transitive
322 description: 112 description:
323 - name: test 113 + name: test_api
324 url: "https://pub.dartlang.org" 114 url: "https://pub.dartlang.org"
325 source: hosted 115 source: hosted
326 - version: "1.3.0" 116 + version: "0.2.1"
327 typed_data: 117 typed_data:
328 dependency: transitive 118 dependency: transitive
329 description: 119 description:
@@ -331,13 +121,6 @@ packages: @@ -331,13 +121,6 @@ packages:
331 url: "https://pub.dartlang.org" 121 url: "https://pub.dartlang.org"
332 source: hosted 122 source: hosted
333 version: "1.1.6" 123 version: "1.1.6"
334 - utf:  
335 - dependency: transitive  
336 - description:  
337 - name: utf  
338 - url: "https://pub.dartlang.org"  
339 - source: hosted  
340 - version: "0.9.0+5"  
341 vector_math: 124 vector_math:
342 dependency: transitive 125 dependency: transitive
343 description: 126 description:
@@ -345,33 +128,5 @@ packages: @@ -345,33 +128,5 @@ packages:
345 url: "https://pub.dartlang.org" 128 url: "https://pub.dartlang.org"
346 source: hosted 129 source: hosted
347 version: "2.0.8" 130 version: "2.0.8"
348 - vm_service_client:  
349 - dependency: transitive  
350 - description:  
351 - name: vm_service_client  
352 - url: "https://pub.dartlang.org"  
353 - source: hosted  
354 - version: "0.2.6"  
355 - watcher:  
356 - dependency: transitive  
357 - description:  
358 - name: watcher  
359 - url: "https://pub.dartlang.org"  
360 - source: hosted  
361 - version: "0.9.7+10"  
362 - web_socket_channel:  
363 - dependency: transitive  
364 - description:  
365 - name: web_socket_channel  
366 - url: "https://pub.dartlang.org"  
367 - source: hosted  
368 - version: "1.0.9"  
369 - yaml:  
370 - dependency: transitive  
371 - description:  
372 - name: yaml  
373 - url: "https://pub.dartlang.org"  
374 - source: hosted  
375 - version: "2.1.15"  
376 sdks: 131 sdks:
377 - dart: ">=2.0.0-dev.68.0 <3.0.0" 132 + dart: ">=2.0.0 <3.0.0"
1 name: flutter_screenutil 1 name: flutter_screenutil
2 description: A flutter plugin for adapting screen and font size.Guaranteed to look good on different models 2 description: A flutter plugin for adapting screen and font size.Guaranteed to look good on different models
3 -version: 0.4.1 3 +version: 0.4.2
4 author: LiZhuoyuan <zhuoyuan93@gmail.com> 4 author: LiZhuoyuan <zhuoyuan93@gmail.com>
5 homepage: https://github.com/OpenFlutter/flutter_ScreenUtil 5 homepage: https://github.com/OpenFlutter/flutter_ScreenUtil
6 6