Future<void> notifiedTimeout(Duration d) { final (fut, cancel) = notified(); return fut.timeout(d, onTimeout: () { cancel(); throw TimeoutException('Notify.wait timed out after $d'); }); }