Skip to content

Commit

Permalink
markersMaxAmount no longer affects markersBuilder
Browse files Browse the repository at this point in the history
  • Loading branch information
aleksanderwozniak committed Sep 29, 2019
1 parent 1629bc8 commit 074c363
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions lib/src/calendar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -464,9 +464,7 @@ class _TableCalendarState extends State<TableCalendar> with SingleTickerProvider

if (key != null) {
final children = <Widget>[content];
final events = eventKey != null
? widget.calendarController.visibleEvents[eventKey].take(widget.calendarStyle.markersMaxAmount)
: [];
final events = eventKey != null ? widget.calendarController.visibleEvents[eventKey] : [];
final holidays = holidayKey != null ? widget.calendarController.visibleHolidays[holidayKey] : [];

if (!_isDayUnavailable(date)) {
Expand All @@ -475,7 +473,7 @@ class _TableCalendarState extends State<TableCalendar> with SingleTickerProvider
widget.builders.markersBuilder(
context,
key,
events.toList(),
events,
holidays,
),
);
Expand All @@ -488,7 +486,10 @@ class _TableCalendarState extends State<TableCalendar> with SingleTickerProvider
right: widget.calendarStyle.markersPositionRight,
child: Row(
mainAxisSize: MainAxisSize.min,
children: events.map((event) => _buildMarker(eventKey, event)).toList(),
children: events
.take(widget.calendarStyle.markersMaxAmount)
.map((event) => _buildMarker(eventKey, event))
.toList(),
),
),
);
Expand Down

0 comments on commit 074c363

Please sign in to comment.