CronScheduledTrigger.parse constructor
Create a CronScheduledTrigger based on a cron-formatted string expression.
cronExpression- The cron expression as aString.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".0 9 * * 1is "Every Monday at 09:00".0 0 1 * *is "The first day of every month at midnight".
Note the following:
- the fields are separated by spaces
- that
*is used to signify "match all" - that the weekday field uses
0for Sunday - that the number fields are numbered from
0(minutes, weekdays) or1(hours, days, months) - that numbers are single values - ranges and lists are not supported
- that number are to be stated as integers, and not a string with leading zeros (e.g., use
9and not09for 9 o'clock)
See e.g. crontab guru for help in formatting cron jobs.
Implementation
factory CronScheduledTrigger.parse({
required String cronExpression,
Duration? duration,
}) => CronScheduledTrigger._(cronExpression: cronExpression);