FinchCron constructor

FinchCron({
  1. required Future onCron(
    1. int count,
    2. FinchCron cron
    ),
  2. required String schedule,
  3. bool delayFirstMoment = true,
})

Creates an instance of FinchCron.

onCron is required and specifies the callback function to be executed on each cron tick. schedule is required and specifies the cron schedule. delayFirstMoment is optional and defaults to true. When false, the first tick runs immediately.

Implementation

FinchCron({
  required this.onCron,
  required this.schedule,
  this.delayFirstMoment = true,
}) {
  registerTime = DateTime.now().microsecondsSinceEpoch;
}