Skip to content

Commit

Permalink
Prevent scrolling beyond the maximum position
Browse files Browse the repository at this point in the history
  • Loading branch information
9AZX committed Oct 1, 2024
1 parent e44458d commit 9eacb88
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 9eacb88

Please sign in to comment.