setContent method
Parameters:
html
: HTML markup to assign to the page.timeout
: Maximum time in milliseconds for resources to load, defaults to 30 seconds, pass0
to disable timeout. The default value can be changed by using thepage.defaultNavigationTimeout
orpage.defaultTimeout
.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
Implementation
Future<void> setContent(String html, {Duration? timeout, Until? wait}) {
return mainFrame.setContent(html, timeout: timeout, wait: wait);
}