RandomRecurrentTrigger constructor

RandomRecurrentTrigger({
  1. int minNumberOfTriggers = 0,
  2. int maxNumberOfTriggers = 1,
  3. required TimeOfDay startTime,
  4. required TimeOfDay endTime,
})

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,
}) : super() {
  assert(startTime.isBefore(endTime),
      'startTime must be before endTime with a 24 hour period.');
}