I have a project that need to prevent user to refresh page with some conditions using flutter for web.
I already search and try the solution in this How to disable reloading or refresh button in browser in flutter web?
but i'm failed to cancel the refresh action.
here is my code to handling
html.window.onBeforeUnload.listen((event) async {
if(true){
event.preventDefault();
}
});
Is there a way to cancel the refresh action?