diff --git a/lib/flutter_calendar_carousel.dart b/lib/flutter_calendar_carousel.dart index f6beafe..683ecdb 100644 --- a/lib/flutter_calendar_carousel.dart +++ b/lib/flutter_calendar_carousel.dart @@ -908,6 +908,7 @@ class _CalendarState extends State> { widget.markedDatesMap.getEvents(now).length > 0) { List tmp = []; int count = 0; + int event_index = 0; double offset = 0.0; double padding = widget.markedDateIconMargin; widget.markedDatesMap.getEvents(now).forEach((event) { @@ -964,12 +965,28 @@ class _CalendarState extends State> { ); } } else { - if (widget.markedDateWidget != null) { - tmp.add(widget.markedDateWidget); - } else { - tmp.add(defaultMarkedDateWidget); + + + //max 5 dots + if(event_index < 5) { + if (widget.markedDateIconBuilder != null) { + tmp.add(widget.markedDateIconBuilder(event)); + } + else { + if (widget.markedDateWidget != null) { + tmp.add(widget.markedDateWidget); + } else { + tmp.add(defaultMarkedDateWidget); + } + } } + + + } + + event_index++; + }); return tmp; }