waitDestroyed method
Waits for this window to be destroyed.
- If
timeout
is defined it will returnfalse
on timeout.
Implementation
Future<bool> waitDestroyed({Duration? timeout}) {
if (_destroyed) return Future.value(true);
var waitingDestroyed = _waitingDestroyed ??= Completer();
var future = waitingDestroyed.future;
if (timeout != null) {
future = future.timeout(timeout, onTimeout: () => false);
}
return future;
}