keepActive method
- bool active = true
Keeps the _isActive
status as active
.
Implementation
void keepActive([bool active = true]) {
if (_isActive != active) {
_isActive = active;
_activityController?.add(active);
}
activityTimer?.cancel();
if (active) {
activityTimer = Timer(_activityTimeout, () {
_isActive = false;
_activityController?.add(false);
});
}
}