How to use window.onload in dart?

Viewed 158
window.onload = function() {
 document.addEventListener("visibilitychange", () => {
    const video = document.getElementById("my-video");
    console.log(document.hidden);
    return document.hidden ? video.pause() : video.play();
  });
};

Suppose i have this in JS i wish to perform similar action in dart? Issue here Function Definition

0 Answers
Related