Future<void> sleep(Duration d) { final c = Completer<void>(); Timer(d, () => c.complete()); return c.future; }