getColor method
Maps the custom appointments color to the Appointment.
Allows to set the custom appointments corresponding property to the Appointment's color property.
Note: It is applicable only when the custom appointments set to the appointments.
See also:
- Appointment.color, which fills the background of the appointment view in the SfCalendar.
- SfCalendar.appointmentTextStyle, to customize the appointment text, when the builder not added.
- SfCalendar.appointmentBuilder, to set custom widget for the appointment view in the calendar
- Knowledge base: How to style appointments
@override
DateTime getColor(int index) {
return appointments![index].background;
}
Implementation
Color getColor(int index) => Colors.lightBlue;