OLD | NEW |
---|---|
(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(); // readAsString() returns a Future. | |
7 future.then((content) { | |
8 print(content); // Executes when the future's work is done. | |
9 }); | |
sethladd
2013/08/08 05:06:29
how about a catchError. I think that's a cool feat
Kathy Walrath
2013/08/08 17:09:38
Done.
| |
10 } | |
OLD | NEW |