RecurrentScheduledTrigger constructor
RecurrentScheduledTrigger({})
Create a trigger that triggers based on a recurrent scheduled date and time.
Implementation
RecurrentScheduledTrigger({
required this.type,
required this.time,
this.end,
this.separationCount = 0,
this.maxNumberOfSampling,
this.dayOfWeek,
this.weekOfMonth,
this.dayOfMonth,
Duration? duration,
}) : super(period: const Duration(seconds: 1)) {
assert(separationCount >= 0, 'Separation count must be zero or positive.');
if (type == RecurrentType.weekly) {
assert(dayOfWeek != null,
'dayOfWeek must be specified in a weekly recurrence.');
} else if (type == RecurrentType.monthly) {
assert(weekOfMonth != null || dayOfMonth != null,
'Specify monthly recurrence using either dayOfMonth or weekOfMonth');
assert(dayOfMonth == null || (dayOfMonth! >= 1 && dayOfMonth! <= 31),
'dayOfMonth must be in the range [1-31]');
assert(weekOfMonth == null || (weekOfMonth! >= 1 && weekOfMonth! <= 4),
'weekOfMonth must be in the range [1-4]');
}
}