I like to simulate an asynchronous web service call in my Dart application for testing. To simulate the randomness of these mock calls responding (possibly out of order) I\
2019 edition:
await Future.delayed(Duration(seconds: 1));
import 'dart:io';
sleep(Duration(seconds:1));
Note: This blocks the entire process (isolate), so other async functions will not be processed. It's also not available on the web because Javascript is really async-only.