onResume method

  1. @override
Future<bool> onResume()
override

Callback when this executor is resumed. Returns true if successfully resumed, false otherwise.

Implementation

@override
Future<bool> onResume() async {
  // create a recurrent timer that resume periodically
  timer = Timer.periodic(configuration!.period, (t) {
    super.onResume();
    // create a timer that pause the sampling after the specified duration.
    Timer(configuration!.duration, () {
      super.onPause();
    });
  });
  return true;
}