settle method

Future<void> settle({
  1. Duration? timeout,
})

Implementation

Future<void> settle({Duration? timeout}) async {
  return RunnerBenchmark.async('execution', 'settle', () async {
    try {
      await _settleFromEvents(timeout: timeout ?? config.settleTimeout);
    } catch (error) {
      if (!error.toString().contains('timed out') &&
          !error.toString().contains('timeout')) {
        rethrow;
      }
      // Background streams can keep the event loop active after the UI has
      // reached a stable state. The bounded wait is therefore best effort.
    }
    await _drainFlutterDiagnostics();
    await yieldToLiveApiWork();
  });
}