not knowing how to change the indicator color in Sfcalender

44 Views Asked by At

Am using Sfcalender as a calender for my app, and am having trouble changing the blue color of the blue meeting indicator The UI where you could see the blue indicator that I want to change it color enter image description here

1

There are 1 best solutions below

0
nialegu On

You need to override the method getColor() in your event class which extends CalendarDataSource. Also you can put different colors to your events.

class EventDataSource extends CalendarDataSource {
  EventDataSource(List<Event> appointments) {
    this.appointments = appointments;
  }
  Event getAppointments(int index) => appointments![index] as Event;
    
@override
Color getColor(int index) => *color*;

In this class you also can override every method from absctract CalendarDataSource class. Check documentation of this class to look for all methods.