reload method
Parameters:
timeout
Maximum navigation time in milliseconds, defaults to 30 seconds, pass Duration.zero to disable timeout. The default value can be changed by using the Page.defaultNavigationTimeout or Page.defaultTimeout properties.wait
When to consider navigation succeeded, defaults to Until.load. Given an array of event strings, navigation is considered to be successful after all events have been fired. Events can be either:- Until.load - consider navigation to be finished when the
load
event is fired. - Until.domContentLoaded - consider navigation to be finished when the
DOMContentLoaded
event is fired. - Until.networkIdle - consider navigation to be finished when there
are no more than 0 network connections for at least
500
ms. - Until.networkAlmostIdle - consider navigation to be finished when
there are no more than 2 network connections for at least
500
ms.
- Until.load - consider navigation to be finished when the
referrer
Referer header value. If provided it will take preference over the referer header value set by Page.setExtraHTTPHeaders.
Returns: Future which resolves to the main resource response. In case of multiple redirects, the navigation will resolve with the response of the last redirect.
Implementation
Future<Response> reload({Duration? timeout, Until? wait}) async {
var responseFuture = waitForNavigation(timeout: timeout, wait: wait);
await devTools.page.reload();
return await responseFuture;
}