As of dart milestone 8, it is not possible to alert the user before (s)he navigates away from the page by the following method:
window.onBeforeUnload.listen((BeforeUnloadEvent event) {
event.returnValue = 'Are you sure you want to leave?';
});
since the Event.returnValue field has been removed. How do you accomplish this effect with the new API?
This is how it's done with jQuery:
$(window).on('beforeunload', function(){
return 'Are you sure you want to leave?';
});