如何在Flutter Web中检测Chrome标签的变化。我一直在搜索,但没有找到任何相关的东西。
nqwrtyyt1#
我猜您将需要一个如下所示的eventListener:
document.addEventListener("visibilitychange", (event) => { if (document.visibilityState == "visible") { console.log("tab is active") } else { console.log("tab is inactive") } });
在你的 dart 代码里你必须倾听变化Flutter (Web) how to listen to javascript event or pass javascript data to flutter?
1条答案
按热度按时间nqwrtyyt1#
我猜您将需要一个如下所示的eventListener:
在你的 dart 代码里你必须倾听变化
Flutter (Web) how to listen to javascript event or pass javascript data to flutter?