Articles in this section
Category / Section

How to change all-day panel background color in Flutter Calendar?

2 mins read

In the Flutter Calendar, you can customize the background color for the all-day panel.

By using the allDayPanelColor property of the timeSlotViewSettings.

child: SfCalendar(
  allowedViews: const [CalendarView.day,CalendarView.workWeek,CalendarView.week],
  timeSlotViewSettings: const TimeSlotViewSettings(allDayPanelColor: Colors.deepPurple),
  dataSource: _getCalendarDataSource(),
  view: CalendarView.day,
)
 
_DataSource _getCalendarDataSource() {
  List<Meeting> appointments = <Meeting>[];
  appointments.add(Meeting(
      from: DateTime.now(),
      to: DateTime.now().add(const Duration(minutes: 20)),
      content: 'Meeting',
      background: Colors.greenAccent,
      isAllDay: true
  ));
  appointments.add(Meeting(
    from: DateTime.now().add(const Duration(days: 1)),
    to: DateTime.now().add(const Duration(hours: 2, days: 1)),
    content: 'Planning',
    background: Colors.deepPurple,
  ));
 
  appointments.add(Meeting(
    from: DateTime.now().add(const Duration(days: -2, hours: 2)),
    to: DateTime.now().add(const Duration(hours: 3, days: -2)),
    content: 'Retrospective',
    background: Colors.amber,
  ));
 
  appointments.add(Meeting(
      from: DateTime.now().add(const Duration(days: -5, hours: 2)),
      to: DateTime.now().add(const Duration(hours: 3, days: -5)),
      content: 'Anniversary',
      background: Colors.green,
      isAllDay: true));
 
  appointments.add(Meeting(
    from: DateTime.now().add(const Duration(days: -2, hours: 5)),
    to: DateTime.now().add(const Duration(hours: 6, days: -2)),
    content: 'Sprint planning',
    background: Colors.red,
  ));
 
  return _DataSource(appointments);
}

View the GitHub sample here

Flutter Calendar all day panel background

Conclusion

I hope you enjoyed learning how to change all-day panel background color in Flutter Calendar.

You can refer to our Flutter Calendar feature tour page to know about its other groundbreaking feature representations and documentation, to understand how to create and manipulate data.

For current customers, you can check out our WinForms components from the License and Downloads page. If you are new to Syncfusion®, you can try our 30-day free trial to check out our WinForms Edit control and other WinForms components.

If you have any queries or require clarifications, please let us know in comments below. You can also contact us through our support forumsDirect-Trac, or feedback portal. We are always happy to assist you!

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please  to leave a comment
Access denied
Access denied