| OLD | NEW |
| 1 --- | 1 --- |
| 2 layout: tutorial | 2 layout: tutorial |
| 3 title: "Use Future-Based APIs" | 3 title: "Use Future-Based APIs" |
| 4 description: "A first look at Futures and how to use them to make your asynchron
ous code better." | 4 description: "A first look at Futures and how to use them to make your asynchron
ous code better." |
| 5 has-permalinks: true | 5 has-permalinks: true |
| 6 tutorial: | 6 tutorial: |
| 7 id: futures | 7 id: futures |
| 8 next: streams/ | 8 next: streams/ |
| 9 next-title: "Use Streams for Data" | 9 next-title: "Use Streams for Data" |
| 10 prev: polymer-intro/ | 10 prev: polymer-intro/ |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 * Call `then()` to schedule code that runs when a Future completes. | 21 * Call `then()` to schedule code that runs when a Future completes. |
| 22 * Use `catchError()` to handle errors that occur within a Future. | 22 * Use `catchError()` to handle errors that occur within a Future. |
| 23 * You can chain Futures to run asynchronous functions in order. | 23 * You can chain Futures to run asynchronous functions in order. |
| 24 | 24 |
| 25 {% endcapture %} | 25 {% endcapture %} |
| 26 | 26 |
| 27 {% capture sample_links %} | 27 {% capture sample_links %} |
| 28 | 28 |
| 29 | 29 |
| 30 <p markdown="1"> This tutorial features these examples | 30 <p markdown="1"> This tutorial features these examples |
| 31 in the `bin` directory, | 31 in the `futures/bin` directory, |
| 32 all variations of the same example:</p> | 32 all variations of the same example:</p> |
| 33 | 33 |
| 34 * futures1 | 34 * futures1.dart |
| 35 * futures2 | 35 * futures2.dart |
| 36 * futures3 | 36 * futures3.dart |
| 37 * futures4 | 37 * futures4.dart |
| 38 * futures5 | 38 * futures5.dart |
| 39 | 39 |
| 40 <p> | 40 <p> |
| 41 Don't have the source code? | 41 Don't have the source code? |
| 42 <a href="https://github.com/dart-lang/dart-tutorials-samples/archive/master.zip"
> | 42 <a href="https://github.com/dart-lang/dart-tutorials-samples/archive/master.zip"
> |
| 43 Download it. | 43 Download it. |
| 44 </a> | 44 </a> |
| 45 | 45 |
| 46 {% endcapture %} | 46 {% endcapture %} |
| 47 | 47 |
| 48 {% capture content %} | 48 {% capture content %} |
| (...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 272 uses a Future when doing an HTTP request. | 272 uses a Future when doing an HTTP request. |
| 273 | 273 |
| 274 * The example featured in | 274 * The example featured in |
| 275 [Use IndexedDB](/docs/tutorials/indexeddb/) | 275 [Use IndexedDB](/docs/tutorials/indexeddb/) |
| 276 uses many Futures when interacting with the database. | 276 uses many Futures when interacting with the database. |
| 277 | 277 |
| 278 {% endcapture %} | 278 {% endcapture %} |
| 279 | 279 |
| 280 {% include tutorial.html %} | 280 {% include tutorial.html %} |
| 281 | 281 |
| OLD | NEW |