diff --git a/lib/scripts/scroll_position.patch b/lib/scripts/scroll_position.patch index ab2a34d1a..9c12f15f5 100644 --- a/lib/scripts/scroll_position.patch +++ b/lib/scripts/scroll_position.patch @@ -1,16 +1,18 @@ diff --git a/packages/flutter/lib/src/widgets/scroll_position_with_single_context.dart b/packages/flutter/lib/src/widgets/scroll_position_with_single_context.dart -index 96d77f67008..533fa0eecaf 100644 +index 96d77f67008..85e42540728 100644 --- a/packages/flutter/lib/src/widgets/scroll_position_with_single_context.dart +++ b/packages/flutter/lib/src/widgets/scroll_position_with_single_context.dart -@@ -127,8 +127,10 @@ class ScrollPositionWithSingleContext extends ScrollPosition implements ScrollAc +@@ -127,8 +127,12 @@ class ScrollPositionWithSingleContext extends ScrollPosition implements ScrollAc @override void applyUserOffset(double delta) { - updateUserScrollDirection(delta > 0.0 ? ScrollDirection.forward : ScrollDirection.reverse); - setPixels(pixels - physics.applyPhysicsToUserOffset(this, delta)); + final newPixels = pixels - physics.applyPhysicsToUserOffset(this, delta); -+ if (newPixels != setPixels(newPixels) || _userScrollDirection == ScrollDirection.idle) { -+ updateUserScrollDirection(delta > 0.0 ? ScrollDirection.forward : ScrollDirection.reverse); ++ if (_userScrollDirection == ScrollDirection.idle || (newPixels != setPixels(newPixels) && newPixels >= 0)) { ++ updateUserScrollDirection( ++ delta > 0.0 ? ScrollDirection.forward : ScrollDirection.reverse, ++ ); + } } diff --git a/pubspec.lock b/pubspec.lock index 164c9c6a5..d5bef5682 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -477,7 +477,7 @@ packages: description: path: "." ref: dev - resolved-ref: de88c222852c33b3203b868794ac45734c8bcec2 + resolved-ref: "6f7e69c7930428f15edb1e9dc3213d220b867976" url: "https://github.com/bggRGjQaUbCoE/extended_nested_scroll_view.git" source: git version: "6.2.1"