Issue
I have an exam with a timer inside a widget I want to prevent users from reloading or show a confirmation dialog
Solution
I didn’t find a solution but I found that I can excute some code before reloading:
import 'dart:html' as html;
html.window.onUnload.listen((event) async {
print('Reloaded');
});
Answered By – Abdelrahman Tareq
Answer Checked By – Mary Flores (FlutterFixes Volunteer)