RandomRecurrentTrigger constructor
RandomRecurrentTrigger({})
Create a RandomRecurrentTrigger.
minNumberOfTriggers and maxNumberOfTriggers specified the range of the random samples (e.g., between 3 and 8 times pr. day). startTime and endTime specified the period within a day the sampling should take place (e.g., between 08:00 and 20:00).
Implementation
RandomRecurrentTrigger({
this.minNumberOfTriggers = 0,
this.maxNumberOfTriggers = 1,
required this.startTime,
required this.endTime,
Duration? duration,
}) : super() {
assert(startTime.isBefore(endTime),
'startTime must be before endTime with a 24 hour period.');
this.duration = duration ?? const Duration(seconds: 1);
}