Create a Repeating Appointment Using the Recurrence Rule in Flutter Event Calendar
Tags: flutter, dart, webdev, mobile
Published: 2022-02-09 13:02:48

---
title: Create a Repeating Appointment Using the Recurrence Rule in Flutter Event Calendar
published: true
date: 2022-02-09 11:00:52 UTC
tags: flutter, dart, webdev, mobile
canonical_url: https://www.syncfusion.com/blogs/post/create-a-repeating-appointment-using-the-recurrence-rule-in-flutter-event-calendar.aspx
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/c8js6cq4f7tezajwkqoh.png
---

A recurring appointment or event repeats at a regular interval. For example, weekly classes or daily scrum meetings.

Our Syncfusion [Flutter event Calendar](https://www.syncfusion.com/flutter-widgets/flutter-calendar "Flutter Calendar widget") provides basic functionalities for scheduling, managing, and representing appointments efficiently. It also provides support to create recurring appointments. This feature removes multiple instances of the same repeating appointments in the data source. Thus, it helps to enhance our productivity.

By setting the frequency of appointments with a recurrence rule, we can easily add those repeating events to the Flutter Calendar. Then, we can add other basic details like the start and end times, subject, and location.

In this blog, we’ll see how to use the recurrence rule feature in the Flutter event Calendar to create recurring appointments.

**Note: ** If you are new to our Flutter Calendar, then please read the [Getting Started with Flutter Calendar](https://help.syncfusion.com/flutter/calendar/getting-started "Getting started with Flutter Event Calendar documentation") documentation before proceeding.

## Recurrence rule

The recurrence rule specifies the pattern for an appointment’s occurrence. This pattern defines:

- **Recurrence type** —defines the type of recurrence like daily, weekly, monthly, or yearly.
- **Recurrence range** —defines the occurrence end details of a recurring appointment like count, end date (until), and no end date (never ending).
- **Interval** —defines the interval between the occurrences of a recurring appointment.
- **Recurrence details** —defines the day, weekday, month, and position for the occurrence of a recurring appointment.

The appointments will repeat based on the frequency type specified in the recurrence rule.

Refer to the following table.

<table style="width: 706px;">
<tbody>
<tr>
<td style="width: 119px;" width="108"><strong>Property Name</strong></td>
<td style="width: 587px;" width="516"><strong>Purpose</strong></td>
</tr>
<tr>
<td style="width: 119px;" width="108">FREQ</td>
<td style="width: 587px;" width="516">Maintains the repeat type value of an appointment (daily, weekly, monthly, yearly).

Example: FREQ=DAILY;INTERVAL=1</td>
</tr>
<tr>
<td style="width: 119px;" width="108">INTERVAL</td>
<td style="width: 587px;" width="516">Maintains the interval value of the appointments.

Example: To create an appointment for every day, we need to set the following:

FREQ=DAILY;INTERVAL=1</td>
</tr>
<tr>
<td style="width: 119px;" width="108">COUNT</td>
<td style="width: 587px;" width="516">Specifies the recurrence range of an appointment and maintains the count value or occurrence count of the appointment.

For example: To create an appointment that repeats every 10 days, we need to set the following:

FREQ=DAILY;INTERVAL=1;COUNT=10</td>
</tr>
<tr>
<td style="width: 119px;" width="108">UNTIL</td>
<td style="width: 587px;" width="516">Specifies the recurrence range and maintains the occurrence end date value of the appointment.

For example: To create a daily appointment that will repeat until 6/30/2020, set the following:

FREQ=DAILY;INTERVAL=1;UNTIL=20200630T183000Z</td>
</tr>
<tr>
<td style="width: 119px;" width="108">BYDAY</td>
<td style="width: 587px;" width="516">Specifies the recurrence detail to maintain the appointment occurrence day of the week (Monday/Tuesday/Wednesday/Thursday/Friday/Saturday/Sunday). Note: Not applicable for daily recurrence types.

For example: To create an appointment that will repeat on Monday and Wednesday of a week, set the following:

FREQ=WEEKLY;INTERVAL=1;BYDAY=MO,WE;COUNT=10</td>
</tr>
<tr>
<td style="width: 119px;" width="108">BYMONTHDAY</td>
<td style="width: 587px;" width="516">Specifies the recurrence details to maintain the appointment occurrence day of the month. Note: Not applicable for daily and weekly recurrence types.

For example: To create an appointment that will repeat on the third day of each month, set the following:

Example: FREQ=MONTHLY;BYMONTHDAY=3;INTERVAL=1;COUNT=10</td>
</tr>
<tr>
<td style="width: 119px;" width="108">BYMONTH</td>
<td style="width: 587px;" width="516">Specifies the recurrence details to maintain the occurrence month of the appointment. Note: Only applicable for yearly recurrence types.

For example: To create an appointment that will repeat on the third of June every year, set the following: FREQ=YEARLY;BYMONTHDAY=3;BYMONTH=6;INTERVAL=1;COUNT=10</td>
</tr>
<tr>
<td style="width: 119px;" width="108">BYSETPOS</td>
<td style="width: 587px;" width="516">Specifies the recurrence details to maintain the week number of the month of an appointment. Note: Not applicable for daily and weekly recurrence types.

If it maintains a -1 value, then it denotes the last week of the month. The -2 value denotes the second to last week of the month.

For example: To create an appointment that will repeat on the second Monday of a month, set the following: FREQ=MONTHLY;BYDAY=MO;BYSETPOS=2;UNTIL=20200810T183000Z .</td>
</tr>
</tbody>
</table>

Refer to the following code example.

```dart
 final Appointment dailyMeeting = Appointment(
        startTime: DateTime(2019, 01, 01, 09),
        endTime: DateTime(2019, 01, 01, 10),
        subject: ‘Daily recurring meeting’,
        color: Colors.blue,
        recurrenceRule: “FREQ=DAILY;INTERVAL=1;COUNT=10”);
```

![Daily Recurring Appointments in Flutter Event Calendar](https://www.syncfusion.com/blogs/wp-content/uploads/2022/02/Daily-Recurring-Appointments-in-Flutter-Event-Calendar.png)
<figcaption>Daily Recurring Appointments in Flutter Event Calendar</figcaption>

**Note:** For more details, refer to the [Recurrence appointment in Flutter Event Calendar documentation](https://help.syncfusion.com/flutter/calendar/appointments#recurrence-appointment "Recurrence appointment in Flutter Event Calendar documentation").

## Recurrence exception

The Flutter Calendar supports recurrence exceptions to remove an occurrence of an appointment. This feature also enables us to adjust the date, time, and other details of the recurring appointment series.

For some situations, like holidays, we might change or delete the occurrence of an appointment. This is known as an exception appointment from the series.

We can easily remove an occurrence of a repeating appointment on specific dates using the [RecurrenceExceptionDates](https://pub.dev/documentation/syncfusion_flutter_calendar/latest/calendar/Appointment/recurrenceExceptionDates.html "recurrenceExceptionDates property of Flutter Calendar") property.

Refer to the following code example.

```dart
DateTime exceptionDate = DateTime(2019, 12, 20);
  final Appointment dailyAppointment = appointments.add(Appointment(
      startTime: DateTime(2019, 12, 16, 10),
      endTime: DateTime(2019, 12, 16, 12),
      subject: ‘Occurs daily’,
      color: Colors.red,
      recurrenceRule: ‘FREQ=DAILY;COUNT=20’,
      recurrenceExceptionDates: <DateTime>[exceptionDate]));
```

![Deleting an Appointment from the Recurring Series in Flutter Event Calendar](https://www.syncfusion.com/blogs/wp-content/uploads/2022/02/Deleting-an-Appointment-from-the-Recurring-Series-in-Flutter-Event-Calendar.png)
<figcaption>Deleting an Appointment from the Recurring Series in Flutter Event Calendar</figcaption>

Also, we can change the occurrence of a repeating appointment on any specific date without removing it. To do so, use the [recurrenceExceptionDates](https://pub.dev/documentation/syncfusion_flutter_calendar/latest/calendar/Appointment/recurrenceExceptionDates.html "recurrenceExceptionDates property of Flutter Calendar") and [recurrenceId](https://pub.dev/documentation/syncfusion_flutter_calendar/latest/calendar/Appointment/recurrenceId.html "recurrenceId property of Flutter Calendar") properties of the appointment.

The [recurrenceId](https://pub.dev/documentation/syncfusion_flutter_calendar/latest/calendar/Appointment/recurrenceId.html "recurrenceId property of Flutter Calendar") of the changed occurrence should hold the exact recurrence appointment [ID](https://pub.dev/documentation/syncfusion_flutter_calendar/latest/calendar/Appointment/id.html "id property of Flutter Calendar").

Refer to the following code example.

```dart
Final DateTime exceptionDate = DateTime((2021, 04, 14);

  final Appointment recurrenceAppointment = Appointment(
      startTime: DateTime(2021, 04, 12, 10),
      endTime: DateTime(2021, 04, 12, 12),
      subject: ‘Daily scrum meeting’,
      id: ‘01’,
       ecurrenceRule: ‘FREQ=DAILY;INTERVAL=1;COUNT=10’,
      color: Colors.lightGreen,
      recurrenceExceptionDates: <DateTime>[exceptionDate],
    );

  final Appointment exceptionAppointment = Appointment(
        recurrenceId: 01,
        startTime: DateTime(2021, 04, 14, 13),
        endTime: DateTime(2021, 04, 14, 14),
        subject: ‘Scrum meeting – Changed Occurrence’,
        color: Colors.greenAccent);
```

![Changing the Occurrence Details of a Recurring Appointment in Flutter Event Calendar](https://www.syncfusion.com/blogs/wp-content/uploads/2022/02/Changing-the-Occurrence-Details-of-a-Recurring-Appointment-in-Flutter-Event-Calendar.png)
<figcaption>Changing the Occurrence Details of a Recurring Appointment in Flutter Event Calendar</figcaption>

**Note:** For more details, refer to the [Recurrence pattern exceptions in Flutter Event Calendar documentation](https://help.syncfusion.com/flutter/calendar/appointments#recurrence-pattern-exceptions "Recurrence pattern exceptions in Flutter Calendar documentation").

## GitHub reference

Also, check out the example for [creating repeating appointments with the recurrence rule in Flutter Calendar on GitHub](https://github.com/SyncfusionExamples/repeating-appointment-using-recurrence-rule "Creating repeating appointments using recurrence rule in Flutter Calendar demo on GitHub").

## Conclusion

Thanks for reading! In this blog, we have seen how to create a recurring appointment by setting the recurrence rule in the [Flutter event Calendar](https://www.syncfusion.com/flutter-widgets/flutter-calendar "Flutter Event Calendar") widget. With this, you can easily create and manage your repeating appointments and enhance your productivity.

Explore our [Flutter Calendar documentation](https://help.syncfusion.com/flutter/calendar/overview "Flutter Event Calendar documentation") and [GitHub demos](https://github.com/syncfusion/flutter-examples "Syncfusion Flutter Examples on GitHub") to learn about other user-friendly features. Please share your feedback in the comments section below!

Also, you can contact us through our [support forum](https://www.syncfusion.com/forums "Syncfusion support forum"), [support portal](https://support.syncfusion.com/ "Syncfusion support portal"), or [feedback portal](https://www.syncfusion.com/feedback/home "Syncfusion Feedback Portal"). As always, we are happy to assist you!

## Related blogs

- [Simple Steps to Create an Investment (SIP) Calculator in Flutter](https://www.syncfusion.com/blogs/post/simple-steps-to-create-an-investment-sip-calculator-in-flutter.aspx "Simple Steps to Create an Investment (SIP) Calculator in Flutter blog")
- [What’s New in 2021 Volume 4: Flutter](https://www.syncfusion.com/blogs/post/whats-new-in-2021-volume-4-flutter.aspx "What’s New in 2021 Volume 4: Flutter blog")
- [Create a Meeting Room Calendar Using Flutter Event Calendar](https://www.syncfusion.com/blogs/post/create-a-meeting-room-calendar-using-flutter-event-calendar.aspx "Create a Meeting Room Calendar Using Flutter Event Calendar blog")
- [Easily Export DataGrid to Excel and PDF in Flutter](https://www.syncfusion.com/blogs/post/easily-export-datagrid-to-excel-and-pdf-in-flutter.aspx "Easily Export DataGrid to Excel and PDF in Flutter blog")