onPause method

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

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

Implementation

@override
Future<bool> onPause() async {
  // cancel all the timers that might have been started
  for (var timer in _timers) {
    timer.cancel();
  }
  // cancel the daily cron job
  await _scheduledTask.cancel();
  return await super.onPause();
}