Skip to content

Commit

Permalink
Prevent scrolling beyond the maximum position (#427)
Browse files Browse the repository at this point in the history
  • Loading branch information
9AZX authored Nov 18, 2024
1 parent 19471c1 commit ac1ddc8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions sheet/lib/src/physics.dart
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,10 @@ class BouncingSheetPhysics extends ScrollPhysics with SheetPhysics {
}
return true;
}());
// Prevent scrolling beyond the maximum position
if (value > position.maxScrollExtent) {
return value - position.maxScrollExtent;
}
if (!overflowViewport) {
// overscroll
if (position.viewportDimension <= position.pixels &&
Expand Down

0 comments on commit ac1ddc8

Please sign in to comment.