Skip to content

ScheduledTrigger

A trigger which starts a task according to a recurring schedule starting on the date that the study starts.

The iCalendar RFC 5545 standard is used to specify the recurrence rule: https://tools.ietf.org/html/rfc5545#section-3.3.10

This trigger needs to be evaluated on a primary device since it is time bound and therefore requires a task scheduler.

// Every day at 8:30.
ScheduledTrigger(
  time: const TimeOfDay(hour: 8, minute: 30),
  recurrenceRule: RecurrenceRule(Frequency.DAILY),
);
Inheritance
Implemented types
Annotations

Constructors

ScheduledTrigger.fromJson

ScheduledTrigger.fromJson(
  1. Map<String, dynamic> json
)

ScheduledTrigger

ScheduledTrigger({
  1. String? sourceDeviceRoleName,
  2. bool? requiresPrimaryDevice = false,
  3. required TimeOfDay time,
  4. required RecurrenceRule recurrenceRule,
})

Create a trigger that is scheduled at time and repeats according to the recurrenceRule.

Properties

fromJsonFunction

Function get fromJsonFunction
override

The function which can convert a JSON string to an object of this type.

recurrenceRule

RecurrenceRule recurrenceRule
getter/setter pair

Recurrence rule according to the iCalendar RFC 5545 standard.

time

TimeOfDay time
getter/setter pair

The time of the day to trigger.

Methods

toJson

Map<String, dynamic> toJson()
override

Return a JSON encoding of this object.

toString

String toString()
override

A string representation of this object.

Some classes have a default textual representation, often paired with a static parse function (like int.parse). These classes will provide the textual representation as their string representation.

Other classes have no meaningful textual representation that a program will care about. Such classes will typically override toString to provide useful information when inspecting the object, mainly for debugging or logging.