FadyFayezYounan / easy_date_timeline

The "easy_date_timeline" package is a customizable Flutter widget that displays a timeline of dates in a horizontal timeline.
MIT License
96 stars 46 forks source link

How to show dates marked on the calendar separate from selectedDate? #4

Open DitoXD opened 1 year ago

DitoXD commented 1 year ago

I'd like to mark dates before and after DateTime.now() but I'm not sure how to go about that. I'd like to mark multiple dates across the calendar and be able to set props for those dates differently before and after DateTime.now(). Any assistance or recommendations for it?

CyMathew commented 1 year ago

You could use itemBuilder to specify styling on certain dates. itemBuilder provides fullDate so you can do something like

itemBuilder: (context, dayNumber, dayName, monthName, fullDate, isSelected) {
  if((DateUtils.isSameDay(fullDate, YourMarkedDate)) { 
    return customMarkedDateWidget;
  }
  return regularDayWidget;
}