I want to detect if app is closed or suspended but not when the phone is closed. I have used AppLifecycleState but it detected app close and phone close as the same thing
I'm making a chat app.
for example:
if app closed close the chat but if phone is closed nothing will happen and the chat will remain as it is.