How to disable reloading or refresh button in browser in flutter web?


I have an exam with a timer inside a widget I want to prevent users from reloading or show a confirmation dialog


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 {

Answered By – Abdelrahman Tareq

Answer Checked By – Mary Flores (FlutterFixes Volunteer)

Leave a Reply

Your email address will not be published. Required fields are marked *