From acf0f8201a169663ae8e809f134a939e08a6b752 Mon Sep 17 00:00:00 2001 From: zmtzawqlp Date: Tue, 26 Dec 2023 22:11:01 +0800 Subject: [PATCH] Remove unnecessary assert(fix #149) --- CHANGELOG.md | 5 +++++ lib/src/extended_nested_scroll_view.dart | 15 +++++++-------- pubspec.yaml | 2 +- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7e5b8f8..76c67e8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +## 6.2.1 + +* Remove unnecessary assert(fix #149) + + ## 6.2.0 * Merge code from https://github.com/flutter/flutter/pull/123109 (fix #148) diff --git a/lib/src/extended_nested_scroll_view.dart b/lib/src/extended_nested_scroll_view.dart index 50ae83c..49c67de 100644 --- a/lib/src/extended_nested_scroll_view.dart +++ b/lib/src/extended_nested_scroll_view.dart @@ -1042,10 +1042,11 @@ class _NestedScrollCoordinator return; } innerCanDrag = innerCanDrag - // This refers to the physics of the actual inner scroll position, not - // the whole NestedScrollView, since it is possible to have different - // ScrollPhysics for the inner and outer positions. - || position.physics.shouldAcceptUserOffset(position); + // This refers to the physics of the actual inner scroll position, not + // the whole NestedScrollView, since it is possible to have different + // ScrollPhysics for the inner and outer positions. + || + position.physics.shouldAcceptUserOffset(position); } _outerPosition!.updateCanDrag(innerCanDrag); } @@ -1618,7 +1619,6 @@ class _NestedScrollPosition extends ScrollPosition return coordinator.pointerScroll(delta); } - @override void jumpToWithoutSettling(double value) { assert(false); @@ -1642,13 +1642,12 @@ class _NestedScrollPosition extends ScrollPosition void updateCanDrag(bool innerCanDrag) { // This is only called for the outer position - assert(coordinator._outerPosition == this); + // assert(coordinator._outerPosition == this); context.setCanDrag( // This refers to the physics of the actual outer scroll position, not // the whole NestedScrollView, since it is possible to have different // ScrollPhysics for the inner and outer positions. - physics.shouldAcceptUserOffset(this) - || innerCanDrag, + physics.shouldAcceptUserOffset(this) || innerCanDrag, ); } diff --git a/pubspec.yaml b/pubspec.yaml index bcb4356..747a190 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: extended_nested_scroll_view description: extended nested scroll view to fix pinned header and inner scrollables sync issues. -version: 6.2.0 +version: 6.2.1 repository: https://github.com/fluttercandies/extended_nested_scroll_view issue_tracker: https://github.com/fluttercandies/extended_nested_scroll_view/issues