I am building a chat app in Flutter Web, and would like to add a feature for flagging when the user is "Online".
I want to send a bool
to Firebase Firestore
whenever the user launches and closes the app (for example, when the user launches the Flutter Web URL = true
is being sent to Firestore
for isOnline
flag. And when the user closes the tap = false
is being sent to isOnline
).
For that, I would need a way to detect the lifecycle of the Flutter Web app, and to check whether the app is currently actively running or not.
Does anyone know what is the best way of doing that?
Thank you!