Q: Do you know how to show lock screen?
A: Yes, I already have the lock screen done.
Q: Do you know how to count 10 minutes?
A: Yes and no. The problem here is to save the date/time of the last user activity. Actually, I have to update dateTimeOfLastActivity every time when a user does something (key stroke, scrolling, navigation, etc.) and that's where the problem is.
A: Do you know how to reset the timer when a user interacts your app?
Q: As I said above, yes and no. It depends. I can do something like here
await Future.delayed(Duration(minutes: 10), () {
// popup the lock screen
});
but the problem is how to detect all the users activities.