onResume method
Callback when this executor is resumed. Returns true if successfully resumed, false otherwise.
Implementation
@override
Future<bool> onResume() async {
// when an app task is started, create a new UserTask by adding it to the queue
UserTask? userTask = await AppTaskController().enqueue(this);
// automatically stop this executor again to be reused later
// issue => https://github.com/cph-cachet/carp.sensing-flutter/issues/429
Future.delayed(const Duration(seconds: 5), () => pause());
return userTask != null;
}