generateRRule method Null safety

String generateRRule(
  1. RecurrenceProperties recurrenceProperties,
  2. DateTime appStartTime,
  3. DateTime appEndTime
)

Generates the recurrence rule based on the given recurrence properties and the start date and end date of the recurrence appointment.

Used to generate recurrence rule based on the recurrence properties.

  • recurrenceProperties - required - the recurrence properties to generate the recurrence rule.
  • appStartTime - required - the recurrence appointment start time.
  • appEndTime - required - the recurrence appointment end time.

returns String.


RecurrenceProperties recurrenceProperties =
RecurrenceProperties(startDate: DateTime.now());
recurrenceProperties.recurrenceType = RecurrenceType.daily;
recurrenceProperties.recurrenceRange = RecurrenceRange.count;
recurrenceProperties.interval = 2;
recurrenceProperties.recurrenceCount = 10;

Appointment appointment = Appointment(
   startTime: DateTime(2019, 12, 16, 10),
   endTime: DateTime(2019, 12, 16, 12),
   subject: 'Meeting',
   color: Colors.blue,
   recurrenceRule: SfCalendar.generateRRule(recurrenceProperties,
       DateTime(2019, 12, 16, 10), DateTime(2019, 12, 16, 12)));

Implementation

static String generateRRule(RecurrenceProperties recurrenceProperties,
    DateTime appStartTime, DateTime appEndTime) {
  return RecurrenceHelper.generateRRule(
      recurrenceProperties, appStartTime, appEndTime);
}