Skip to content

RecurrenceRule

Represents the iCalendar RFC 5545 standard recurrence rule to specify repeating events: https://tools.ietf.org/html/rfc5545#section-3.3.10

However, since date times are relative to the start time of a study, they are replaced with time spans representing elapsed time since the start of the study.

Annotations

Constructors

RecurrenceRule.fromJson

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

RecurrenceRule.fromString

RecurrenceRule.fromString(
  1. String rrule
)

Initialize a RecurrenceRule based on a rrule string, as produced by toString.

UNTIL is read as milliseconds after the study start, not as a date. Unknown parts are ignored; frequency defaults to Frequency.DAILY.

RecurrenceRule

RecurrenceRule(
  1. Frequency frequency, {
  2. int interval = 1,
  3. End? end,
})

Create a rule repeating at frequency, every interval times, until end.

Properties

end

End end
getter/setter pair

Specifies when, if ever, to stop repeating events. Default recurrence is forever.

frequency

Frequency frequency
final

Specifies the type of interval at which to repeat events, or multiples thereof.

interval

int interval
getter/setter pair

The interval at which frequency repeats. The default is 1. For example, with Frequency.DAILY, a value of "8" means every eight days.

Methods

toJson

Map<String, dynamic> toJson()

toString

String toString()
override

A valid RFC 5545 string representation of this recurrence rule, except when end is of type EndType.UNTIL. In that case, 'UNTIL' holds the total number of milliseconds which need to be added to a desired start date. 'UNTIL' should be reassigned to a calculated end date time, formatted using the RFC 5545 specifications: https://tools.ietf.org/html/rfc5545#section-3.3.5