diff --git a/lib/src/month_view/month_view.dart b/lib/src/month_view/month_view.dart index e8ab9d46..7522543c 100644 --- a/lib/src/month_view/month_view.dart +++ b/lib/src/month_view/month_view.dart @@ -343,7 +343,20 @@ class MonthViewState extends State> { void onHorizontalDragStartEnd(DragEndDetails dragEndDetails, {required bool isFirstPage, required bool isLastPage}) { - if (isLastPage) { + if (isFirstPage && isLastPage) { + if (dragEndDetails.primaryVelocity! > 0) { + previousPage(); + } + if (dragEndDetails.primaryVelocity! < 0) { + widget.onHasReachedEnd?.call(_currentDate, _currentIndex); + } + if (dragEndDetails.primaryVelocity! < 0) { + nextPage(); + } + if (dragEndDetails.primaryVelocity! > 0) { + widget.onHasReachedStart?.call(_currentDate, _currentIndex); + } + } else if (isLastPage) { if (dragEndDetails.primaryVelocity! > 0) { previousPage(); }