CronScheduledTrigger.parse constructor

CronScheduledTrigger.parse({
  1. required String cronExpression,
  2. Duration? duration,
})

Create a CronScheduledTrigger based on a cron-formatted string expression.

  • cronExpression - The cron expression as a String.
  • duration - The duration (until stopped) of the the sampling.

Cron format used is:

<minutes> <hours> <days> <months> <weekdays>

For example 42 19 * * * is "Everyday at 19:42".

See e.g. crontab guru for help in formatting cron jobs.

Implementation

factory CronScheduledTrigger.parse({
  required String cronExpression,
  Duration? duration,
}) =>
    CronScheduledTrigger._(cronExpression: cronExpression);