onLoaded method

Future<Object> onLoaded(
  1. dynamic onLoadedCallback(
    1. String message
    )
)

Event fires when the entire page (including all its resources like images, scripts, and stylesheets) has finished loading.

Implementation

Future<Object> onLoaded(Function(String message) onLoadedCallback) async {
  super.addJavaScriptChannel("OnLoadedCallback", onMessageReceived: (msg) {
    onLoadedCallback(msg.message);
  });
  return await super.runJavaScriptReturningResult(
      """window.onload = function () {OnLoadedCallback.postMessage("Page Loaded...!");}""");
}