I am developing a flutter app where I want to display an Alert when there is no interaction with the app for some time (say 5 mins). How do I achieve this?
Solution
Here you go
setup a variable and initialize it with current time
when ever user interact with your app, (Gesture, button click etc.) simply update the current time to the variable that we setup on the step 1.
on each timer tick, check the difference between the current time and the time we noted on step 1 is equal to or grater than 5 mins, then present the dialog box to the user as per your requirement.