OLD | NEW |
1 --- | 1 --- |
2 layout: default | 2 layout: default |
3 title: "A Game of Darts—Tutorials" | |
4 description: "A beginner's guide to building web apps with Dart." | 3 description: "A beginner's guide to building web apps with Dart." |
5 has-permalinks: true | 4 has-permalinks: true |
6 rel: | 5 rel: |
7 author: | 6 author: |
8 - mary-campione | 7 - mary-campione |
9 tutorial: | 8 tutorial: |
10 id: tut-home | 9 id: tut-home |
11 article: | 10 article: |
12 written_on: 2012-10-01 | 11 written_on: 2012-10-01 |
13 updated_on: 2013-07-01 | 12 updated_on: 2013-07-01 |
14 collection: everyday-dart | 13 collection: everyday-dart |
15 next: get-started | 14 next: get-started |
16 next-title: "Get Started" | 15 next-title: "Get Started" |
17 --- | 16 --- |
18 | 17 |
19 {% capture whats_the_point %} | 18 {% capture content %} |
20 | 19 |
21 * This blue box shows page highlights. | 20 <img src="images/banner.png"> |
22 * Learn Dart here: No web experience required. | 21 |
23 * Dart is an open-source platform for building structured HTML5 web apps. | 22 **A Game of Darts** |
| 23 is a collection of tutorials, _targets_, |
| 24 that teaches you how to build mobile web applications |
| 25 using the Dart language, tools, and APIs. |
| 26 |
| 27 <strong>Who are you?</strong> |
| 28 <ul> |
| 29 <li> You already know how to program in a structured language like C or Java.</l
i> |
| 30 <li> You are familiar with object-oriented programming.</li> |
| 31 <li> You might not know how to program the browser through the DOM (Document Obj
ect Model).</li> |
| 32 </ul> |
| 33 |
| 34 <strong>Let's go!</strong> Follow the targets in order from left to right...or c
hoose just the ones you need. |
| 35 |
| 36 <div class="tute-tabs"> |
| 37 <div class="tabbable"> |
| 38 <ul class="nav nav-tabs"> |
| 39 <li class="active"><a href="#basics" data-toggle="tab">Basics</a></li> |
| 40 <li><a href="#dom" data-toggle="tab">Browser</a></li> |
| 41 <li><a href="#packages" data-toggle="tab">Packages</a></li> |
| 42 <li><a href="#webui" data-toggle="tab">Web UI</a></li> |
| 43 <!--<li><a href="#polymer" data-toggle="tab">Polymer</a></li>--> |
| 44 <li><a href="#forms" data-toggle="tab">Forms & Data</a></li> |
| 45 <!--<li><a href="#mobile" data-toggle="tab">Mobile</a></li>--> |
| 46 </ul> |
| 47 |
| 48 <div class="tab-content"> |
| 49 |
| 50 <!-- BASICS TAB --> |
| 51 <div class="tab-pane active" id="basics"> |
| 52 |
| 53 These two targets give a gentle introduction to writing Dart apps. |
| 54 Download the software and |
| 55 discover which tools and libraries you get with the bundle. |
| 56 Run two sample apps. |
| 57 Learn how to embed Dart code in an HTML web page, |
| 58 to provide it with an interactive user interface and dynamic functionality
. |
| 59 |
| 60 <div class="row-fluid"> |
| 61 |
| 62 <!-- Getting Started --> |
| 63 <div class="span6" style="border-right:1px solid Lavender"> |
| 64 <section> |
| 65 <h4><a href="get-started/"><img src="images/target.png" height="20" wi
dth="20"> Get Started</a></h4> |
| 66 <p>Get Dart. Run two apps. |
| 67 </p> |
| 68 <img src="images/clickme-screenshot.png" width="300"> |
| 69 </section> |
| 70 </div> |
| 71 |
| 72 <!-- Connect Dart & HTML --> |
| 73 <div class="span6"> |
| 74 <section> |
| 75 <h4><a href="connect-dart-html/"><img src="images/target.png" height="
20" width="20"> Connect Dart & HTML</a></h4> |
| 76 <p>Embed Dart in a web page. |
| 77 </p> |
| 78 <img src="images/miniapp-screenshot.png" width="300"> |
| 79 </section> |
| 80 </div> |
| 81 |
| 82 </div> <!-- end row-fluid --> |
| 83 </div> <!-- end Getting Started tab --> |
| 84 |
| 85 <!-- DOM TAB --> |
| 86 <div class="tab-pane" id="dom"> |
| 87 |
| 88 Web pages are programmed in HTML and represented |
| 89 within the browser as a tree structure |
| 90 called the DOM (Document Object Model). |
| 91 Dart apps can modify the DOM programmatically, |
| 92 thus dynamically changing the web page |
| 93 and responding to user input. |
| 94 Learn how to add, move, and remove DOM elements |
| 95 in these two targets. |
| 96 |
| 97 <div class="row-fluid"> |
| 98 |
| 99 <!-- Add Elements --> |
| 100 <div class="span6" style="border-right:1px solid Lavender"> |
| 101 <section> |
| 102 <h4><a href="add-elements/"><img src="images/target.png" height="20" w
idth="20"> Add Elements to the DOM</a></h4> |
| 103 <p>Add elements to the web page, move them...</p> |
| 104 <img src="images/todo-screenshot.png" width="300"> |
| 105 </section> |
| 106 </div> |
| 107 |
| 108 <!-- Remove Elements --> |
| 109 <div class="span6"> |
| 110 <section> |
| 111 <h4><a href="remove-elements/"><img src="images/target.png" height="20
" width="20"> Remove DOM Elements</a></h4> |
| 112 <p>... and delete them.</p> |
| 113 <img src="images/todo-with-delete-screenshot.png" width="300"> |
| 114 </section> |
| 115 </div> |
| 116 |
| 117 </div> <!-- end row-fluid --> |
| 118 </div> <!-- end DOM tab --> |
| 119 |
| 120 <!-- PACKAGES TAB --> |
| 121 <div class="tab-pane" id="packages"> |
| 122 |
| 123 Dart developers have been busy creating code libraries that can help you b
e more productive. |
| 124 Leverage that code or put your code out in the world to share with others. |
| 125 |
| 126 <div class="row-fluid"> |
| 127 |
| 128 <!-- Packages --> |
| 129 <div class="span6" style="border-right:1px solid Lavender"> |
| 130 <section> |
| 131 <h4><a href="packages/"><img src="images/target.png" height="20" width
="20"> Install Shared Packages</a></h4> |
| 132 <p>Organize and share code at <a href="http://pub.dartlang.org/">pub.d
artlang.org</a>.</p> |
| 133 <img src="images/add-packages-screenshot.png" width="300"> |
| 134 </section> |
| 135 </div> |
| 136 <div class="span6"> |
| 137 |
| 138 </div> |
| 139 </div> |
| 140 </div> <!-- end Packages tab --> |
| 141 |
| 142 <!-- WEB UI TAB --> |
| 143 <div class="tab-pane" id="webui"> |
| 144 |
| 145 Web components and templates are the next great ideas in web application d
evelopment. |
| 146 Together they provide the building blocks to create richer and more dynami
c web applications. |
| 147 With the Dart team’s <a href="http://pub.dartlang.org/packages/web_ui">Web
UI package</a>, |
| 148 you can get started using web components and templates now. |
| 149 |
| 150 <!-- |
| 151 <aside class="alert"> |
| 152 <strong>To be deprecated.</strong> <i>Use the new polymer packages inste
ad.</i> |
| 153 Learn all about it in the <a href="polymer/">Polymer target</a>.<br> |
| 154 </aside> |
| 155 --> |
| 156 |
| 157 <div class="row-fluid"> |
| 158 |
| 159 <!-- Get Started Web UI --> |
| 160 <div class="span6" style="border-right:1px solid Lavender"> |
| 161 <section> |
| 162 <h4><a href="web-ui/"><img src="images/target.png" height="20" width="
20"> Get Started with Web UI</a></h4> |
| 163 <p>Bind Dart variables to UI elements.</p> |
| 164 <img src="images/shout-screenshot.png" width="300"> |
| 165 </section> |
| 166 </div> |
| 167 |
| 168 <!-- Templates --> |
| 169 <div class="span6" style="border-right:1px solid Lavender"> |
| 170 <section> |
| 171 <h4><a href="templates/"><img src="images/target.png" height="20" widt
h="20"> Use Templates</a></h4> |
| 172 <p>Activate UI elements with loops and conditionals.</p> |
| 173 <img src="images/hangman-screenshot.png" width="300"> |
| 174 </section> |
| 175 </div> |
| 176 </div> <!-- end row-fluid --> |
| 177 |
| 178 <div class="row-fluid"> |
| 179 <!-- Custom Elements --> |
| 180 <div class="span6"> |
| 181 <section> |
| 182 <h4><a href="custom-elements"><img src="images/target.png" height="20"
width="20"> Define a Custom DOM Tag</a></h4> |
| 183 <p>Create new HTML tags with custom elements.</p> |
| 184 <img src="images/convert-screenshot.png" width="300"> |
| 185 </section> |
| 186 </div> |
| 187 <div class="span6"> |
| 188 </div> |
| 189 </div> <!-- end row-fluid --> |
| 190 </div> <!-- end WEB UI tab --> |
| 191 |
| 192 <!-- POLYMER TAB --> |
| 193 <!-- |
| 194 <div class="tab-pane" id="polymer"> |
| 195 <div class="row-fluid"> |
| 196 |
| 197 <div class="span6" style="border-right:1px solid Lavender"> |
| 198 <section> |
| 199 <h4><a href="polymer"><img src="images/target.png" height="20" width="
20"> Polymer</a></h4> |
| 200 <p>Polymer - a shiny new package!</p> |
| 201 <img src="images/countdown-screenshot.png" width="300"> |
| 202 </section> |
| 203 </div> |
| 204 |
| 205 <div class="span6"> |
| 206 </div> |
| 207 |
| 208 </div> |
| 209 </div> |
| 210 --> |
| 211 |
| 212 <!-- FORMS TAB --> |
| 213 <div class="tab-pane" id="forms"> |
| 214 |
| 215 Various classes in the Dart libraries help you get, send and receive, |
| 216 and save user data. |
| 217 You can use input elements within forms to get data from users. |
| 218 You can use JSON to format data and HttpRequest to send requests and recei
ve responses. |
| 219 And, finally, you can save data on the client with IndexedDB. |
| 220 |
| 221 <div class="row-fluid"> |
| 222 |
| 223 <!-- Fetch Data --> |
| 224 <div class="span6" style="border-right:1px solid Lavender"> |
| 225 <section> |
| 226 <h4><a href="fetchdata"><img src="images/target.png" height="20" width
="20"> Fetch Data Dynamically</a></h4> |
| 227 <p>Load data from a static file or from a server.</p> |
| 228 <img src="images/allaboutyou-screenshot.png" width="300"> |
| 229 </section> |
| 230 </div> |
| 231 |
| 232 <!-- Forms --> |
| 233 <div class="span6" style="border-right:1px solid Lavender"> |
| 234 <section> |
| 235 <h4><a href="forms/"><img src="images/target.png" height="20" width="2
0"> Get Input from a Form</a></h4> |
| 236 <p>Use forms and input elements to get data.</p> |
| 237 <img src="images/slambook-screenshot.png" width="300"> |
| 238 </section> |
| 239 </div> |
| 240 </div> <!-- end row-fluid --> |
| 241 |
| 242 <div class="row-fluid"> |
| 243 <!-- IndexedDB --> |
| 244 <div class="span6"> |
| 245 <section> |
| 246 <h4><a href="indexeddb/"><img src="images/target.png" height="20" widt
h="20"> Use IndexedDB</a></h4> |
| 247 <p>Save data on the client with IndexedDB!</p> |
| 248 <img src="images/countdown-screenshot.png" width="300"> |
| 249 </section> |
| 250 </div> |
| 251 <div class="span6"> |
| 252 </div> |
| 253 </div> <!-- end row-fluid --> |
| 254 </div> <!-- end FORMS tab --> |
| 255 |
| 256 <!-- MOBILE TAB --> |
| 257 <!-- |
| 258 <div class="tab-pane" id="mobile"> |
| 259 <div class="row-fluid"> |
| 260 |
| 261 <div class="span6" style="border-right:1px solid Lavender"> |
| 262 <section> |
| 263 <h4><a href="mobile"><img src="images/target.png" height="20" width="2
0"> Write for Mobile Devices</a></h4> |
| 264 <p>Mobile devices are taking over the world!</p> |
| 265 <img src="images/countdown-screenshot.png" width="300"> |
| 266 </section> |
| 267 </div> |
| 268 |
| 269 <div class="span6"> |
| 270 </div> |
| 271 |
| 272 </div> |
| 273 </div> |
| 274 --> |
| 275 |
| 276 </div> <!-- end tab content--> |
| 277 </div> <!--end tabbable --> |
| 278 </div> <!-- end of tute-tabs --> |
24 | 279 |
25 {% endcapture %} | 280 {% endcapture %} |
26 | 281 |
27 {% capture sample_links %} | 282 {% include tutorial_main_page.html %} |
28 | |
29 <ul> | |
30 <li> | |
31 Get the source code for all the tutorial examples from | |
32 <a href="https://github.com/dart-lang/dart-tutorials-samples" | |
33 target="_blank">github</a>. | |
34 </li> | |
35 | |
36 <li> | |
37 Run the examples from the | |
38 <a href="http://dart-lang.github.com/dart-tutorials-samples/" | |
39 target="_blank">index</a>. | |
40 </li> | |
41 </ul> | |
42 | |
43 {% endcapture %} | |
44 | |
45 {% capture content %} | |
46 | |
47 Welcome to | |
48 your guide to building great web apps using Dart. | |
49 | |
50 *A Game of Darts* is a collection of tutorials, _targets_, | |
51 that teaches you how to build web programs | |
52 using the Dart language, tools, and APIs. | |
53 You can either follow the targets in order, | |
54 building your knowledge of Dart and web programming | |
55 from the ground up, | |
56 or customize your learning experience by | |
57 choosing just the targets you need. | |
58 | |
59 You should already know how to program in a structured language | |
60 like C or Java. | |
61 It helps to be familiar with object-oriented programming. | |
62 | |
63 You don't need to know JavaScript or the DOM | |
64 (Document Object Model) to use these tutorials. | |
65 The DOM is key to web programming | |
66 and you will learn about it here, | |
67 starting with the basic concepts in Target 2. | |
68 | |
69 <hr> | |
70 | |
71 <div id="target-group" markdown="1"> | |
72 <i class="icon-star"> Check out the newest target on IndexedDB. | |
73 This target shows you how to give your app persistence | |
74 and offline capability by saving data on the client side. | |
75 [Target 11: Use IndexedDB](indexeddb/). | |
76 </div> | |
77 | |
78 <hr> | |
79 | |
80 <img src="/imgs/Dart_Logo_21.png" width="21" height="21" alt="Dart"> [ Target 1:
Get Started](get-started/) | |
81 : Download the Dart software bundle, | |
82 discover which tools and libraries come with the Dart software, | |
83 and use Dart Editor to run two apps. | |
84 | |
85 <hr> | |
86 | |
87 <img src="/imgs/Dart_Logo_21.png" width="21" height="21" alt="Dart"> [ Target 2:
Connect Dart & HTML](connect-dart-html/) | |
88 : Use Dart Editor to create | |
89 a stripped-down Dart program | |
90 that simply puts text on a browser page. | |
91 Though simple, | |
92 this tiny program | |
93 shows you how to host a Dart program on a web page | |
94 and one way to manipulate the DOM. | |
95 You will also begin learning about the Dart language, | |
96 Dart Editor, HTML, and CSS. | |
97 | |
98 <hr> | |
99 | |
100 <img src="/imgs/Dart_Logo_21.png" width="21" height="21" alt="Dart"> [ Target 3:
Add an Element to the DOM](add-elements/) | |
101 : The small app in this target | |
102 responds to a user-generated event | |
103 by adding an Element to the DOM. | |
104 | |
105 <hr> | |
106 | |
107 <img src="/imgs/Dart_Logo_21.png" width="21" height="21" alt="Dart"> [ Target 4:
Remove DOM Elements](remove-elements/) | |
108 : In this target, | |
109 you will modify the little todo app from Target 3 | |
110 to remove elements from the DOM. | |
111 | |
112 <hr> | |
113 | |
114 <img src="/imgs/Dart_Logo_21.png" width="21" height="21" alt="Dart"> [ Target 5:
Install Shared Packages](packages/) | |
115 : Packages help programmers to organize and share code. | |
116 Many open-source Dart packages are hosted at the | |
117 <a href="http://pub.dartlang.org/">pub.dartlang.org</a> | |
118 repository. | |
119 This target walks you through the steps to install one of those packages. | |
120 | |
121 <hr> | |
122 | |
123 <div id="target-group" markdown="1"> | |
124 <h3> <i class="icon-magic"> </i> Dart's Web UI package</h3> | |
125 Web components and templates | |
126 are the next great ideas in web application development. | |
127 Together they provide the building blocks to | |
128 create richer and more dynamic web applications. | |
129 With the Dart team's Web UI package, | |
130 you can get started using web components and templates now. | |
131 | |
132 <hr> | |
133 | |
134 <img src="web-ui-icon.png" width="48" height="48"> [ Target 6: Get Started with
Web UI](web-ui/) | |
135 : This target starts with the logistics | |
136 of installing the Web UI package and | |
137 setting up Dart Editor to automate the build process. | |
138 Then it shows you how to use one- and two- way data binding | |
139 to synchronize Dart data with UI elements. | |
140 Finally, you learn about template expressions | |
141 and declaratively attaching event handlers to UI elements. | |
142 | |
143 <hr> | |
144 | |
145 <img src="web-ui-icon.png" width="48" height="48"> [ Target 7: Use <template&
gt;](templates/) | |
146 : This target shows how to use Web UI templates | |
147 to conditionally activate UI elements. | |
148 It also shows you how to use template loops to | |
149 create a UI based on an Iterable Dart object, such as a list or map. | |
150 <hr> | |
151 | |
152 <img src="web-ui-icon.png" width="48" height="48"> [ Target 8: Define a Custom D
OM Tag](custom-elements/) | |
153 : Continuing your introduction to the Web UI package, | |
154 this target shows you how to use custom elements to | |
155 define a new DOM tag. | |
156 | |
157 </div> | |
158 <hr> | |
159 | |
160 <img src="/imgs/Dart_Logo_21.png" width="21" height="21" alt="Dart"> [ Target 9:
Fetch Data Dynamically](fetchdata/) | |
161 : Your Dart web app can load data dynamically, | |
162 either from a static file or from a server. | |
163 Web data are often formatted using JSON (JavaScript Object Notation)—a | |
164 text based, human friendly data format. | |
165 | |
166 <hr> | |
167 | |
168 <img src="/imgs/Dart_Logo_21.png" width="21" height="21" alt="Dart"> [ Target 10
: Get input from a form](forms/) | |
169 : Most Web apps use forms and input elements to | |
170 gather data from the user and submit that data to a server. | |
171 The example in this target has a client-server pair | |
172 that shows how to use forms and input elements, | |
173 and how clients and servers use the classes | |
174 in the Dart libraries to communicate. | |
175 This target brings together a lot of the information you learned in | |
176 the other targets, including the use of Web UI to sync | |
177 the data in the form with Dart data. | |
178 | |
179 <hr> | |
180 | |
181 <img src="new-icon.png" width="48" height="48" alt="Dart"> [ Target 11: Use Inde
xedDB](indexeddb/) | |
182 : Learn about IndexedDB here! | |
183 | |
184 <div> | |
185 <hr> | |
186 <div class="row"> | |
187 <div class="span1"> | |
188 <font size="24"> | |
189 <i class="icon-bullhorn"> </i> | |
190 </font> | |
191 </div> | |
192 <div class="span8"> | |
193 ...more targets coming... | |
194 </div> | |
195 </div> | |
196 </div> | |
197 | |
198 {% endcapture %} | |
199 | |
200 {% include tutorial-main-page.html %} | |
OLD | NEW |