Skip to content

Commit

Permalink
only_one_page
Browse files Browse the repository at this point in the history
  • Loading branch information
antoniommrabelo committed Jan 13, 2025
1 parent 77f5714 commit e6a9b9c
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion lib/src/month_view/month_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,20 @@ class MonthViewState<T extends Object?> extends State<MonthView<T>> {

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();
}
Expand Down

0 comments on commit e6a9b9c

Please sign in to comment.