Advertisement
Guest User

Untitled

a guest
Mar 25th, 2019
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.25 KB | None | 0 0
  1. import 'dart:async';
  2.  
  3. main() async {
  4. print('About to fetch data...');
  5. var result = await get('bla');
  6. print(result);
  7. }
  8.  
  9. Future<String> get(String url) {
  10. return new Future.delayed(new Duration(seconds: 3), () {
  11. return 'Got the data!';
  12. });
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement