With Flutter Android and iOS modules you can use AppLifeCycleState to detect when the app is put into the background.
Is there something similar for Flutter Web where I can detect the browser/tab closing or refreshing?
I essentially want to run a Firestore command if the person closes their browser or refreshes.