-
Notifications
You must be signed in to change notification settings - Fork 2
/
get-dart.html
852 lines (722 loc) · 35.6 KB
/
get-dart.html
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
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="Content-Language" content="en_US" />
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="获取 Dart SDK">
<title>获取 Dart SDK | Dart</title>
<!-- Favicon / Touch Icons -->
<link rel="icon" sizes="64x64" href="/assets/shared/dart/icon/64.png">
<link href="/assets/touch-icon-iphone-a46c306c4fbfae0b28d63f512b01d7cb2ccf1e4ca9d7f3aab15ba1170beed4a0.png" rel="apple-touch-icon">
<link href="/assets/touch-icon-ipad-d0181720760b3912858b6d40da1d5586b1e92c7c8656a485ea41005674401e6b.png" rel="apple-touch-icon" sizes="76x76">
<link href="/assets/touch-icon-iphone-retina-3d9821a631425376ac6203dea3c23c1940ab7b5c506a25406662fab76cee2e0b.png" rel="apple-touch-icon" sizes="120x120">
<link href="/assets/touch-icon-ipad-retina-b9715401952522f1daee2b4a4064a1bbfb5ffab78d0a47a7226dc87444d51c32.png" rel="apple-touch-icon" sizes="152x152">
<!-- Twitter Card -->
<meta name="twitter:card" content="summary" />
<meta name="twitter:site" content="@dart_lang" />
<meta name="twitter:title" content="获取 Dart SDK" />
<meta name="twitter:description" content="获取 Dart SDK" />
<!-- Open Graph -->
<meta property="og:title" content="获取 Dart SDK" />
<meta property="og:description" content="获取 Dart SDK" />
<meta property="og:url" content="https://www.dartlang.org/get-dart.html" />
<meta property="og:image" content="https://www.dartlang.org/assets/shared/dart-logo-for-shares.png?2" />
<link href="https://fonts.googleapis.com/css?family=Google+Sans:300,400,500|Google+Sans+Display:400|Roboto:300,400,500|Roboto+Mono:300,400,700|Material+Icons" rel="stylesheet">
<link rel="stylesheet" type="text/css" integrity="sha256-S0f9nOqFuIcXJSRb1Y4WwIH+QKL9f54WrcUkklWPM4k=" crossorigin="anonymous" href="/assets/main-4b47fd9cea85b8871725245bd58e16c081fe40a2fd7f9e16adc52492558f3389.css">
<script src="/assets/main-f7f2f2125f3c379daf0f5ca0ecf142cd2e10b030af396a510324fddb1682c5e2.js" integrity="sha256-9/LyEl88N52vD1yg7PFCzS4QsDCvOWpRAyT92xaCxeI=" crossorigin="anonymous" type="text/javascript"></script>
<script defer src="/tools/sdk/archive/assets/install.js"></script>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-26406144-4', 'auto');
ga('send', 'pageview');
</script>
</head>
<body class="default show_banner">
<header id="page-header" class="site-header">
<nav id="mainnav" class="site-header">
<div id="menu-toggle"><i class="icon icon-menu"></i></div>
<a href="/" class="brand" title="Dart">
<img src="/assets/shared/dart/logo+text/horizontal/white-e71fb382ad5229792cc704b3ee7a88f8013e986d6e34f0956d89c453b454d0a5.svg" alt="Dart">
</a>
<ul class="navbar">
<li class="mainnav__get-started">
<a href="/guides" class="nav-link"><span>文档</span></a>
</li>
<li>
<a href="/platforms" class="nav-link">平台</a>
</li>
<li>
<a href="/community" class="nav-link">社区</a>
</li>
<li>
<a href="https://dartpad.cn/" target="_blank" class="nav-link no-automatic-external">体验 Dart</a>
</li>
<li>
<a href="/get-dart" class="nav-link active">安装 Dart</a>
</li>
<li>
<a href="/about_zh_CN" class="nav-link">关于</a>
</li>
<li class="searchfield">
<form action="/search" class="site-header__search form-inline" id="cse-search-box">
<input type="hidden" name="cx" value="011220921317074318178:_yy-tmb5t_i">
<input type="hidden" name="ie" value="UTF-8">
<input type="hidden" name="hl" value="en">
<input class="site-header__searchfield form-control" type="search" name="q" id="q" autocomplete="off" placeholder="Search" aria-label="Search">
</form>
</li>
</ul>
</nav>
</header>
<div class="banner">
<p class="banner__text">
Dart 2.4.0 版本启动! 更多信息参见
<a class="external" href="https://github.com/dart-lang/sdk/blob/master/CHANGELOG.md#240---2019-06-27">更新日志</a>。
</p>
</div>
<div id="sidenav" class="">
<form action="/search/" class="site-header__search form-inline">
<input class="site-header__searchfield form-control" type="search" name="q" id="q" autocomplete="off" placeholder="Search" aria-label="Search">
</form>
<div class="site-sidebar">
<ul class="navbar-nav">
<li class="nav-item">
<a href="/platforms" class="nav-link">平台</a>
</li>
<li class="nav-item">
<a href="/community" class="nav-link">社区</a>
</li>
<li class="nav-item">
<a href="https://dartpad.cn" class="nav-link">体验 Dart</a>
</li>
<li class="nav-item">
<a href="/guides" class="nav-link">文档</a>
</li>
<li>
<a href="/about_zh_CN" class="nav-link">关于</a>
</li>
</ul>
<ul class="nav flex-column"><li class="nav-item">
<a class="nav-link collapsed" data-toggle="collapse" href="#sidenav-1" role="button"
aria-expanded="false" aria-controls="sidenav-1"
>示例 & 教程</a>
<ul class="nav flex-column flex-nowrap collapse " id="sidenav-1">
<li class="nav-item">
<a class="nav-link" href="/samples">示例程序</a>
</li><li class="nav-item">
<a class="nav-link collapsable"
data-toggle="collapse" data-target="#sidenav-1-2"
href="#sidenav-1-2" role="button"
aria-expanded="true" aria-controls="sidenav-1-2"
>Codelab
</a>
<ul class="nav flex-column flex-nowrap collapse show" id="sidenav-1-2">
<li class="nav-item">
<a class="nav-link" href="/codelabs">综述</a>
</li><li class="nav-item">
<a class="nav-link" href="/codelabs/dart-cheatsheet">Codelab 速查</a>
</li></ul>
</li>
<li class="nav-item">
<a class="nav-link" href="/tutorials">教程</a>
</li>
</ul>
</li><li class="nav-item">
<a class="nav-link collapsed" data-toggle="collapse" href="#sidenav-2" role="button"
aria-expanded="false" aria-controls="sidenav-2"
>语言</a>
<ul class="nav flex-column flex-nowrap collapse " id="sidenav-2">
<li class="nav-item">
<a class="nav-link" href="/guides/language/language-tour">概览</a>
</li><li class="nav-item">
<a class="nav-link" href="/guides/language/sound-dart">类型系统</a>
</li><li class="nav-item">
<a class="nav-link" href="/guides/language/spec">规范</a>
</li><li class="nav-item">
<a class="nav-link collapsable collapsed"
data-toggle="collapse" data-target="#sidenav-2-4"
href="#sidenav-2-4" role="button"
aria-expanded="false" aria-controls="sidenav-2-4"
>Effective Dart
</a>
<ul class="nav flex-column flex-nowrap collapse " id="sidenav-2-4">
<li class="nav-item">
<a class="nav-link" href="/guides/language/effective-dart">综述</a>
</li><li class="nav-item">
<a class="nav-link" href="/guides/language/effective-dart/style">风格</a>
</li><li class="nav-item">
<a class="nav-link" href="/guides/language/effective-dart/documentation">文档</a>
</li><li class="nav-item">
<a class="nav-link" href="/guides/language/effective-dart/usage">使用</a>
</li><li class="nav-item">
<a class="nav-link" href="/guides/language/effective-dart/design">设计</a>
</li></ul>
</li>
</ul>
</li><li class="nav-item">
<a class="nav-link collapsed" data-toggle="collapse" href="#sidenav-3" role="button"
aria-expanded="false" aria-controls="sidenav-3"
>核心库</a>
<ul class="nav flex-column flex-nowrap collapse " id="sidenav-3">
<li class="nav-item">
<a class="nav-link" href="/guides/libraries">综述</a>
</li><li class="nav-item">
<a class="nav-link" href="/guides/libraries/library-tour">概览</a>
</li><li class="nav-item">
<a class="nav-link collapsable collapsed"
data-toggle="collapse" data-target="#sidenav-3-3"
href="#sidenav-3-3" role="button"
aria-expanded="false" aria-controls="sidenav-3-3"
>文章
</a>
<ul class="nav flex-column flex-nowrap collapse " id="sidenav-3-3">
<li class="nav-item">
<a class="nav-link" href="/articles/libraries/dart-io">Intro to dart:io</a>
</li><li class="nav-item">
<a class="nav-link" href="/articles/libraries/creating-streams">Creating streams</a>
</li></ul>
</li>
</ul>
</li><li class="nav-item">
<a class="nav-link collapsed" data-toggle="collapse" href="#sidenav-4" role="button"
aria-expanded="false" aria-controls="sidenav-4"
>包</a>
<ul class="nav flex-column flex-nowrap collapse " id="sidenav-4">
<li class="nav-item">
<a class="nav-link" href="/guides/packages">如何使用包</a>
</li><li class="nav-item">
<a class="nav-link" href="/guides/libraries/useful-libraries">常用包</a>
</li><li class="nav-item">
<a class="nav-link" href="/guides/libraries/create-library-packages">创建包</a>
</li><li class="nav-item">
<a class="nav-link" href="/tools/pub/publishing">发布包</a>
</li><li class="nav-item">
<a class="nav-link collapsable collapsed"
data-toggle="collapse" data-target="#sidenav-4-5"
href="#sidenav-4-5" role="button"
aria-expanded="false" aria-controls="sidenav-4-5"
>引用包
</a>
<ul class="nav flex-column flex-nowrap collapse " id="sidenav-4-5">
<li class="nav-item">
<a class="nav-link" href="/tools/pub/dependencies">依赖</a>
</li><li class="nav-item">
<a class="nav-link" href="/tools/pub/glossary">术语</a>
</li><li class="nav-item">
<a class="nav-link" href="/tools/pub/package-layout">包的设计约定</a>
</li><li class="nav-item">
<a class="nav-link" href="/tools/pub/environment-variables">Pub 环境变量</a>
</li><li class="nav-item">
<a class="nav-link" href="/tools/pub/pubspec">Pubspec 文件</a>
</li><li class="nav-item">
<a class="nav-link" href="/tools/pub/troubleshoot">Pub 问题分析与解决</a>
</li><li class="nav-item">
<a class="nav-link" href="/tools/pub/versioning">版本</a>
</li></ul>
</li>
</ul>
</li><li class="nav-item">
<a class="nav-link collapsed" data-toggle="collapse" href="#sidenav-5" role="button"
aria-expanded="false" aria-controls="sidenav-5"
>开发</a>
<ul class="nav flex-column flex-nowrap collapse " id="sidenav-5">
<li class="nav-item">
<a class="nav-link" href="/tutorials/language/futures">Futures & Async-Await</a>
</li><li class="nav-item">
<a class="nav-link" href="/guides/json">使用 JSON</a>
</li><li class="nav-item">
<a class="nav-link" href="/tutorials/language/streams">Stream</a>
</li><li class="nav-item">
<a class="nav-link" href="/mobile">移动应用</a>
</li><li class="nav-item">
<a class="nav-link collapsable collapsed"
data-toggle="collapse" data-target="#sidenav-5-5"
href="#sidenav-5-5" role="button"
aria-expanded="false" aria-controls="sidenav-5-5"
>命令行应用 & 服务应用
</a>
<ul class="nav flex-column flex-nowrap collapse " id="sidenav-5-5">
<li class="nav-item">
<a class="nav-link" href="/server">综述</a>
</li><li class="nav-item">
<a class="nav-link" href="/tutorials/server/get-started">入门</a>
</li><li class="nav-item">
<a class="nav-link" href="/tutorials/server/cmdline">编写命令行应用</a>
</li><li class="nav-item">
<a class="nav-link" href="/tutorials/server/httpserver">编写 HTTP 客户端和服务端应用</a>
</li><li class="nav-item">
<a class="nav-link" href="/server/c-interop">C & C++ 交互</a>
</li><li class="nav-item">
<a class="nav-link" href="/server/libraries">库和包</a>
</li></ul>
</li>
<li class="nav-item">
<a class="nav-link collapsable collapsed"
data-toggle="collapse" data-target="#sidenav-5-6"
href="#sidenav-5-6" role="button"
aria-expanded="false" aria-controls="sidenav-5-6"
>Web 应用
</a>
<ul class="nav flex-column flex-nowrap collapse " id="sidenav-5-6">
<li class="nav-item">
<a class="nav-link" href="/web">综述</a>
</li><li class="nav-item">
<a class="nav-link" href="/tutorials/web/get-started">入门</a>
</li><li class="nav-item">
<a class="nav-link" href="/tutorials/web/fetch-data">动态获取数据</a>
</li><li class="nav-item">
<a class="nav-link collapsable collapsed"
data-toggle="collapse" data-target="#sidenav-5-6-4"
href="#sidenav-5-6-4" role="button"
aria-expanded="false" aria-controls="sidenav-5-6-4"
>底层 Web 编程
</a>
<ul class="nav flex-column flex-nowrap collapse " id="sidenav-5-6-4">
<li class="nav-item">
<a class="nav-link" href="/tutorials/web/low-level-html/connect-dart-html">Dart 和 HTML 关联</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/tutorials/web/low-level-html/add-elements">在 DOM 中增加 Element</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/tutorials/web/low-level-html/remove-elements">在 DOM 中移除 Element</a>
</li>
</ul>
</li>
<li class="nav-item">
<a class="nav-link" href="/web/js-interop">JS/TS 交互</a>
</li><li class="nav-item">
<a class="nav-link" href="/web/deployment">开发</a>
</li><li class="nav-item">
<a class="nav-link" href="/web/libraries">库和包</a>
</li></ul>
</li>
</ul>
</li><li class="nav-item">
<a class="nav-link collapsed" data-toggle="collapse" href="#sidenav-6" role="button"
aria-expanded="false" aria-controls="sidenav-6"
>工具 & 技巧</a>
<ul class="nav flex-column flex-nowrap collapse " id="sidenav-6">
<li class="nav-item">
<a class="nav-link" href="/tools">综述</a>
</li><li class="nav-item">
<a class="nav-link collapsable collapsed"
data-toggle="collapse" data-target="#sidenav-6-2"
href="#sidenav-6-2" role="button"
aria-expanded="false" aria-controls="sidenav-6-2"
>编辑 & 调试
</a>
<ul class="nav flex-column flex-nowrap collapse " id="sidenav-6-2">
<li class="nav-item">
<a class="nav-link" href="/tools/dart-devtools">Dart DevTool</a>
</li><li class="nav-item">
<a class="nav-link" href="/tools/dartpad">DartPad</a>
</li><li class="nav-item">
<a class="nav-link" href="/tools/jetbrains-plugin">IntelliJ & Android Studio</a>
</li><li class="nav-item">
<a class="nav-link" href="/tools/vs-code">VS Code</a>
</li></ul>
</li>
<li class="nav-item">
<a class="nav-link collapsable collapsed"
data-toggle="collapse" data-target="#sidenav-6-3"
href="#sidenav-6-3" role="button"
aria-expanded="false" aria-controls="sidenav-6-3"
>命令行工具
</a>
<ul class="nav flex-column flex-nowrap collapse " id="sidenav-6-3">
<li class="nav-item">
<a class="nav-link collapsable"
data-toggle="collapse" data-target="#sidenav-6-3-1"
href="#sidenav-6-3-1" role="button"
aria-expanded="true" aria-controls="sidenav-6-3-1"
>Dart SDK
</a>
<ul class="nav flex-column flex-nowrap collapse show" id="sidenav-6-3-1">
<li class="nav-item">
<a class="nav-link" href="/tools/sdk">综述</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/tools/dart-vm">dart (Dart VM)</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/tools/dart2aot">dart2aot & dartaotruntime</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/tools/dart2js">dart2js (prod JS)</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/tools/dartanalyzer">dartanalyzer</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/tools/dartdevc">dartdevc (dev JS)</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/tools/dartdoc">dartdoc</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/tools/dartfmt">dartfmt</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/tools/pub/cmd">pub</a>
</li>
</ul>
</li>
<li class="nav-item">
<a class="nav-link collapsable"
data-toggle="collapse" data-target="#sidenav-6-3-2"
href="#sidenav-6-3-2" role="button"
aria-expanded="true" aria-controls="sidenav-6-3-2"
>其他命令行工具
</a>
<ul class="nav flex-column flex-nowrap collapse show" id="sidenav-6-3-2">
<li class="nav-item">
<a class="nav-link" href="/tools/build_runner">build_runner</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/tools/webdev">webdev</a>
</li>
</ul>
</li>
</ul>
</li>
<li class="nav-item">
<a class="nav-link collapsable collapsed"
data-toggle="collapse" data-target="#sidenav-6-4"
href="#sidenav-6-4" role="button"
aria-expanded="false" aria-controls="sidenav-6-4"
>源码管理
</a>
<ul class="nav flex-column flex-nowrap collapse " id="sidenav-6-4">
<li class="nav-item">
<a class="nav-link" href="/guides/language/formatting">格式化代码</a>
</li><li class="nav-item">
<a class="nav-link" href="/guides/libraries/private-files">哪些内容不应该被提交</a>
</li></ul>
</li>
<li class="nav-item">
<a class="nav-link collapsable collapsed"
data-toggle="collapse" data-target="#sidenav-6-5"
href="#sidenav-6-5" role="button"
aria-expanded="false" aria-controls="sidenav-6-5"
>静态分析
</a>
<ul class="nav flex-column flex-nowrap collapse " id="sidenav-6-5">
<li class="nav-item">
<a class="nav-link" href="/guides/language/analysis-options">Customizing static analysis</a>
</li><li class="nav-item">
<a class="nav-link" href="/guides/language/sound-problems">Fixing common type problems</a>
</li></ul>
</li>
<li class="nav-item">
<a class="nav-link collapsable collapsed"
data-toggle="collapse" data-target="#sidenav-6-6"
href="#sidenav-6-6" role="button"
aria-expanded="false" aria-controls="sidenav-6-6"
>测试 & 优化
</a>
<ul class="nav flex-column flex-nowrap collapse " id="sidenav-6-6">
<li class="nav-item">
<a class="nav-link" href="/guides/testing">测试</a>
</li><li class="nav-item">
<a class="nav-link" href="/web/debugging">调试 Web 应用</a>
</li></ul>
</li>
</ul>
</li><li class="nav-item">
<a class="nav-link collapsed" data-toggle="collapse" href="#sidenav-7" role="button"
aria-expanded="false" aria-controls="sidenav-7"
>资源</a>
<ul class="nav flex-column flex-nowrap collapse " id="sidenav-7">
<li class="nav-item">
<a class="nav-link" href="/code-of-conduct">行为守则</a>
</li><li class="nav-item">
<a class="nav-link" href="/faq">FAQ</a>
</li><li class="nav-item">
<a class="nav-link collapsable collapsed"
data-toggle="collapse" data-target="#sidenav-7-3"
href="#sidenav-7-3" role="button"
aria-expanded="false" aria-controls="sidenav-7-3"
>历史
</a>
<ul class="nav flex-column flex-nowrap collapse " id="sidenav-7-3">
<li class="nav-item">
<a class="nav-link" href="/dart-2">迁移到 Dart 2</a>
</li><li class="nav-item">
<a class="nav-link" href="/web/dart-2">迁移 Web 应用到 Dart 2</a>
</li><li class="nav-item">
<a class="nav-link" href="/tools/pub/obsolete">过时的 Pub 功能</a>
</li></ul>
</li>
</ul>
</li><li class="nav-item">
<a class="nav-link collapsed" data-toggle="collapse" href="#sidenav-8" role="button"
aria-expanded="false" aria-controls="sidenav-8"
>相关网站</a>
<ul class="nav flex-column flex-nowrap collapse " id="sidenav-8">
<li class="nav-item">
<a class="nav-link" href="https://api.dart.dev" target="_blank" rel="noopener">API 参考<i class="fas fa-external-link-alt"></i></a>
</li><li class="nav-item">
<a class="nav-link" href="https://medium.com/dartlang" target="_blank" rel="noopener">Blog<i class="fas fa-external-link-alt"></i></a>
</li><li class="nav-item">
<a class="nav-link" href="https://dartpad.dartlang.org" target="_blank" rel="noopener">DartPad (在线编辑器)<i class="fas fa-external-link-alt"></i></a>
</li><li class="nav-item">
<a class="nav-link" href="https://flutter.dev" target="_blank" rel="noopener">Flutter<i class="fas fa-external-link-alt"></i></a>
</li><li class="nav-item">
<a class="nav-link" href="https://pub.dev" target="_blank" rel="noopener">Pub 包资源<i class="fas fa-external-link-alt"></i></a>
</li>
</ul>
</li><li class="nav-item">
<a class="nav-link " data-toggle="collapse" href="#sidenav-9" role="button"
aria-expanded="true" aria-controls="sidenav-9"
>关于</a>
<ul class="nav flex-column flex-nowrap collapse show" id="sidenav-9">
<li class="nav-item">
<a class="nav-link" href="/about_zh_CN">关于本站</a>
</li><li class="nav-item">
<a class="nav-link" href="/about_zh_CN/contributor-guide">贡献者指北</a>
</li><li class="nav-item">
<a class="nav-link" href="/about_zh_CN/chinese-copywriting-guidelines">中文排版指北</a>
</li>
</ul>
</li></ul>
</div>
</div>
<main id="page-content">
<div id="site-toc--side" class="site-toc ">
<header class="site-toc__title">
大纲
<button type="button" class="btn site-toc--button__page-top" aria-label="Page top"></button>
</header>
<ul class="section-nav nav">
<li class="toc-entry nav-item toc-h2"><a class="nav-link" href="#install">安装 Dart SDK</a>
<ul class="nav">
<li class="toc-entry nav-item toc-h3"><a class="nav-link" href="#section-1">升级</a></li>
<li class="toc-entry nav-item toc-h3"><a class="nav-link" href="#section-2">切换版本</a></li>
</ul>
</li>
<li class="toc-entry nav-item toc-h2"><a class="nav-link" href="#关于发布渠道和版本号">关于发布渠道和版本号</a></li>
</ul>
</div>
<article>
<div class="content">
<div>
<div id="page-github-links" class="btn-group" aria-label="Page GitHub links" role="group">
<a href="https://github.com/dartchina/site-www-cn/tree/src_zh_CN/src_zh_CN/get-dart.md" class="btn no-automatic-external" title="View page source" target="_blank" rel="noopener">
<i class="fas fa-file-alt fa-sm"></i>
</a>
<a href="https://github.com/dartchina/site-www-cn/issues/new?title='获取 Dart SDK' page issue&body=
Page URL: https://www.dartlang.org/get-dart.html%0D%0A
Page source: https://github.com/dartchina/site-www-cn/tree/src_zh_CN/src_zh_CN/get-dart.md%0D%0A
%0D%0A
Found a typo? You can fix it yourself by going to the page source and clicking the pencil icon. Or finish creating this issue.%0D%0A
%0D%0A
Description of issue:" class="btn no-automatic-external" title="Report an issue with this page"
target="_blank" rel="noopener">
<i class="fas fa-bug fa-sm"></i>
</a>
</div>
<h1>获取 Dart SDK</h1>
</div>
<div id="site-toc--inline" class="site-toc ">
<header class="site-toc__title">
大纲
<button type="button" class="btn site-toc--button__page-top" aria-label="Page top"></button>
</header>
<ul class="section-nav">
<li class="toc-entry toc-h2"><a href="#install">安装 Dart SDK</a>
<ul>
<li class="toc-entry toc-h3"><a href="#section-1">升级</a></li>
<li class="toc-entry toc-h3"><a href="#section-2">切换版本</a></li>
</ul>
</li>
<li class="toc-entry toc-h2"><a href="#关于发布渠道和版本号">关于发布渠道和版本号</a></li>
</ul>
</div>
<p>Dart SDK 包含开发 Web ,命令行,服务端应用所需要的库和命令行工具,
如果仅需要开发移动端应用,只要<a href="https://flutter.dev/docs/get-started/install">安装 Flutter</a> 即可,不需要 Dart SDK 。</p>
<p>要了解 Dart 开发中的其他可用工具,请参阅 <a href="/tools">Dart 工具</a> 。
要了解 SDK 中的内容,请参阅<a href="/tools/sdk">Dart SDK 概述</a>。</p>
<aside class="alert alert-info">
<p><strong>Note:</strong>
注意:本网站的文档和示例基于
<strong>Dart SDK</strong> <a href="https://api.dart.dev/stable/2.4/index.html" class="no-automatic-external">2.4</a>
版本。</p>
</aside>
<h2 id="install">
<a id="install" class="anchor" href="#install" aria-hidden="true"><span class="octicon octicon-link"></span></a>安装 Dart SDK</h2>
<p>如下介绍,可以使用包管理器轻松的安装更新 Dart SDK。也可以,从源代码<a href="https://github.com/dart-lang/sdk/wiki/Building">构建 SDK </a>或者<a href="/tools/sdk/archive">下载 SDK zip 包文件</a>。</p>
<aside class="alert alert-warning">
<p>Dart 工具可能会向 Google 发送使用指标和崩溃报告。
下载 Dart SDK,即表示您已同意
<a href="https://policies.google.com/terms">Google 服务条款</a>。
注意:<a href="https://policies.google.com/privacy">Google 隐私权政策</a>
介绍了在此服务中的数据被如何处理。</p>
</aside>
<ul class="tabs__top-bar">
<li class="tab-link current" data-tab="tab-sdk-install-windows">Windows</li>
<li class="tab-link" data-tab="tab-sdk-install-linux">Linux</li>
<li class="tab-link" data-tab="tab-sdk-install-mac">Mac</li>
</ul>
<div id="tab-sdk-install-windows" class="tabs__content current">
<p>选择以下一种方式安装:</p>
<h4 id="chocolatey-">使用 Chocolatey 安装</h4>
<p>使用 <a href="https://chocolatey.org">Chocolatey</a> 执行以下指令安装<strong>稳定版</strong> Dart SDK:</p>
<div class="language-terminal highlighter-rouge">
<div class="highlight"><pre class="highlight"><code><span class="gp">C:\></span> choco <span class="nb">install </span>dart-sdk
</code></pre></div> </div>
<p>执行以下指令安装<strong>开发板</strong>:</p>
<div class="language-terminal highlighter-rouge">
<div class="highlight"><pre class="highlight"><code><span class="gp">C:\></span> choco <span class="nb">install </span>dart-sdk <span class="nt">--pre</span>
</code></pre></div> </div>
<p>执行以下指令<strong>升级</strong> Dart SDK (升级开发板添加 <code class="highlighter-rouge">--pre</code> 参数):</p>
<div class="language-terminal highlighter-rouge">
<div class="highlight"><pre class="highlight"><code><span class="gp">C:\></span> choco upgrade dart-sdk
</code></pre></div> </div>
<h4 id="section">使用设置向导安装</h4>
<p>另外,你可以使用社区提供的
<a href="http://www.gekorm.com/dart-windows" target="_blank"> Windows 安装包</a>。
通过设置向导安装 <strong>稳定版</strong> 或者 <strong>开发版</strong> 的 Dart SDK 。</p>
<p><img src="/assets/shared/dart/installer-screenshot-no-272278ce31f0cd3b44fbd998c55b83c945cd6c1f774de0258bf81a6fa7dcc563.png" alt="Windows Dart Setup Wizard" class="text-center" width="250"></p>
</div>
<div id="tab-sdk-install-linux" class="tabs__content">
<p>如果是在 Debian/Ubuntu 系统的 AMD64 (64-bit Intel) 机器上,可选择以下一种方式安装,
两个方式都可以在发布新版本时自动更新 SDK 。</p>
<h4 id="apt-get-">使用 apt-get 安装</h4>
<p>执行以下<strong>一次性</strong>设置:</p>
<div class="language-terminal highlighter-rouge">
<div class="highlight"><pre class="highlight"><code><span class="gp">$</span> <span class="nb">sudo </span>apt-get update
<span class="gp">$</span> <span class="nb">sudo </span>apt-get <span class="nb">install </span>apt-transport-https
<span class="gp">$</span> <span class="nb">sudo </span>sh <span class="nt">-c</span> <span class="s1">'curl https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -'</span>
<span class="gp">$</span> <span class="nb">sudo </span>sh <span class="nt">-c</span> <span class="s1">'curl https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_stable.list > /etc/apt/sources.list.d/dart_stable.list'</span>
</code></pre></div> </div>
<p>然后安装
<strong>稳定版</strong>
Dart SDK :</p>
<div class="language-terminal highlighter-rouge">
<div class="highlight"><pre class="highlight"><code><span class="gp">$</span> <span class="nb">sudo </span>apt-get update
<span class="gp">$</span> <span class="nb">sudo </span>apt-get <span class="nb">install </span>dart
</code></pre></div> </div>
<p>或者,安装
<strong>开发板</strong>
Dart SDK ,
执行一次性设置命令:</p>
<div class="language-terminal highlighter-rouge">
<div class="highlight"><pre class="highlight"><code><span class="gp">$</span> <span class="nb">sudo </span>sh <span class="nt">-c</span> <span class="s1">'curl https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_unstable.list > /etc/apt/sources.list.d/dart_unstable.list'</span>
<span class="gp">$</span> <span class="nb">sudo </span>apt-get update
<span class="gp">$</span> <span class="nb">sudo </span>apt-get <span class="nb">install </span>dart
</code></pre></div> </div>
<h4 id="debian-">安装 Debian 包</h4>
<p>以.deb包格式</p>
<p>另外,可以下载 Debian <code class="highlighter-rouge">.deb</code> 格式的 Dart SDK 安装包。</p>
<ul class="downloads">
<li><a href="#" class="download-link" id="debian-link-stable" data-bits="64" data-os="debian" data-tool="sdk">Stable channel</a></li>
<li><a href="#" class="download-link" id="debian-link-dev" data-bits="64" data-os="debian" data-tool="sdk">Dev channel</a></li>
</ul>
<h4 id="dart-path">修改访问 Dart 库的环境变量(PATH)</h4>
<p>SDK 安装完成后,添加 SDK 的 bin 目录到环境变量中。例如:
使用以下命令更改当前终端会话中的环境变量:</p>
<div class="language-terminal highlighter-rouge">
<div class="highlight"><pre class="highlight"><code><span class="gp">$</span> <span class="nb">export </span><span class="nv">PATH</span><span class="o">=</span><span class="s2">"</span><span class="nv">$PATH</span><span class="s2">:/usr/lib/dart/bin"</span>
</code></pre></div> </div>
<p>要更改新建终端会话的环境变量,使用命令:</p>
<div class="language-terminal highlighter-rouge">
<div class="highlight"><pre class="highlight"><code><span class="gp">$</span> <span class="nb">echo</span> <span class="s1">'export PATH="$PATH:/usr/lib/dart/bin"'</span> <span class="o">>></span> ~/.profile
</code></pre></div> </div>
</div>
<div id="tab-sdk-install-mac" class="tabs__content">
<p><a href="http://brew.sh/">安装 homebrew</a>,然后执行以下命令:</p>
<div class="language-terminal highlighter-rouge">
<div class="highlight"><pre class="highlight"><code><span class="gp">$</span> brew tap dart-lang/dart
<span class="gp">$</span> brew <span class="nb">install </span>dart
</code></pre></div> </div>
<p>添加 <code class="highlighter-rouge">--devel</code> 参数安装<strong>稳定版</strong>:</p>
<div class="language-terminal highlighter-rouge">
<div class="highlight"><pre class="highlight"><code><span class="gp">$</span> brew <span class="nb">install </span>dart <span class="nt">--devel</span>
</code></pre></div> </div>
<h3 id="section-1">
<a id="section-1" class="anchor" href="#section-1" aria-hidden="true"><span class="octicon octicon-link"></span></a>升级</h3>
<p>升级 Dart 到一个新的可用版本:</p>
<div class="language-terminal highlighter-rouge">
<div class="highlight"><pre class="highlight"><code><span class="gp">$</span> brew upgrade dart
</code></pre></div> </div>
<p>如果当前有效版本为开发版,想要安装稳定版,执行:</p>
<div class="language-terminal highlighter-rouge">
<div class="highlight"><pre class="highlight"><code><span class="gp">$</span> brew <span class="nb">unlink </span>dart
<span class="gp">$</span> brew <span class="nb">install </span>dart
</code></pre></div> </div>
<p>如果当前有效版本为稳定版,要升级到开发版,执行:</p>
<div class="language-terminal highlighter-rouge">
<div class="highlight"><pre class="highlight"><code><span class="gp">$</span> brew upgrade dart <span class="nt">--devel</span> <span class="nt">--force</span>
</code></pre></div> </div>
<h3 id="section-2">
<a id="section-2" class="anchor" href="#section-2" aria-hidden="true"><span class="octicon octicon-link"></span></a>切换版本</h3>
<p>切换本地已安装 Dart 版本,执行 <code class="highlighter-rouge">brew switch dart <version></code> 。例如:</p>
<div class="language-terminal highlighter-rouge">
<div class="highlight"><pre class="highlight"><code><span class="gp">$</span> brew switch dart 1.24.3
<span class="gp">$</span> brew switch dart 2.1.0
</code></pre></div> </div>
<p>如果无法确定本地已安装了哪些版本,可执行:</p>
<div class="language-terminal highlighter-rouge">
<div class="highlight"><pre class="highlight"><code><span class="gp">$</span> brew info dart
</code></pre></div> </div>
<p>该指令在顶部会打印最新的稳定版和开发版,随后会列出本地已安装的版本。</p>
</div>
<h2 id="关于发布渠道和版本号">
<a id="关于发布渠道和版本号" class="anchor" href="#%E5%85%B3%E4%BA%8E%E5%8F%91%E5%B8%83%E6%B8%A0%E9%81%93%E5%92%8C%E7%89%88%E6%9C%AC%E5%8F%B7" aria-hidden="true"><span class="octicon octicon-link"></span></a>关于发布渠道和版本号</h2>
<p>Dart SDK 有两个发布渠道:</p>
<ul>
<li>
<strong>稳定版</strong> 渠道: <strong>稳定发行版</strong>,每六周更新一次;
当前版本 <code class="editor-build-rev-stable highlighter-rouge">[calculating]</code>.</li>
<li>
<strong>开发版</strong> 渠道: <strong>预览发行版</strong>,通常每周更新一次;
当前版本 <code class="editor-build-rev-dev highlighter-rouge">[calculating]</code>.</li>
</ul>
<aside class="alert alert-warning">
<p><strong>警告:</strong>
为了让开发者能够及早了解新功能和修复程序,发行的开发版并未经过像稳定版那样的严格测试。</p>
</aside>
<p><strong>稳定版</strong> 通道发行的 Dart SDK 版本具有 <code class="highlighter-rouge">1.24.3</code> 或 <code class="highlighter-rouge">2.1.0</code> 的版本号描述。
版本号是由点分隔的整数组成,不会包含连接符或字符。</p>
<p><strong>开发版</strong> 通道发行的 Dart SDK 版本(预览发行版)版本号中包含以连接符开始的其他字符。
例如:Dart 2 预览发行版的版本号 <code class="highlighter-rouge">2.0.0-dev.69.5</code> 是以 <code class="highlighter-rouge">2.0.0-dev</code> 开始,并附加数字版本。</p>
<p>更多内容, 参见<a href="/dart-2"> Dart 2 章节</a>。</p>
</div>
</article>
</main>
<footer id="page-footer">
<div class="container">
<div class="content">
<div class="text-center" martdown="1">
<style>.menu .material-icons { font-size: 14px; }</style><ul class="menu">
<li><a href="/terms">Terms</a></li>
<li><a href="/security">Security</a></li>
<li><a href="http://www.google.com/intl/en/policies/privacy/" class="no-automatic-external">Privacy</a></li>
<li>Site <a href="http://creativecommons.org/licenses/by/3.0/" class="no-automatic-external">CC BY 3.0</a></li>
<li><a href="/about_zh_CN">关于 dart.dev 中文版</a></li>
<li>
<a href="https://github.com/dartchina/site-www-cn"
title="该站在 GitHub 开源"
class="no-automatic-external"><i class="fab fa-github fa-sm"></i></a>
<a href="https://github.com/dartchina/site-www-cn/issues"
title="为该站提交 issue"
class="no-automatic-external"><i class="fas fa-bug fa-sm"></i></a>
<a
title="Site built on 2019/07/02 03:14 PDT"
class="no-automatic-external"><i class="fas fa-wrench fa-sm"></i></a>
</li>
</ul>
</div>
</div>
</div>
</footer>
</body>
</html>