Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(21)

Side by Side Diff: src/site/articles/using-future-based-apis/code/example2.dart

Issue 99503002: appropriating Shailen's excellent Futures intro into tutorial (Closed) Base URL: https://github.com/dart-lang/dartlang.org.git@master
Patch Set: another pesky file Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 import 'dart:io';
2 import 'dart:async';
3
4 void printDailyNewsDigest() {
5 File file = new File("dailyNewsDigest.txt");
6 Future future = file.readAsString();
7 future.then((content) {
8 print(content);
9 });
10 }
11
12 void main() {
13 printDailyNewsDigest();
14 printWinningLotteryNumbers();
15 printWeatherForecast();
16 printBaseballScore();
17 }
18
19 printWinningLotteryNumbers() {
20 print('Winning lotto numbers: [23, 63, 87, 26, 2]');
21 }
22
23 printWeatherForecast() {
24 print('Tomorrow\'s forecast: 70F, sunny.');
25 }
26
27 printBaseballScore() {
28 print('Baseball score: Red Sox 10, Yankees 0');
29 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698