userInterations function
Implementation
bool? userInterations() {
// return true if user didn't interact with the app for 5 minutes
DateTime lastInteractionTime = DateTime.now(); // initialize with current time
Duration idleDuration = DateTime.now().difference(lastInteractionTime);
if (idleDuration.inMinutes >= 5) {
return true;
} else {
return false;
}
}