diff --git a/CHANGELOG.md b/CHANGELOG.md index 4626e4d..35ce196 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +# 0.2.5 + +Fixed issue where the `maxPaintExtent` was not calculated correctly in some rare cases. + # 0.2.4 Fixed formatting for pub analysis. diff --git a/lib/src/rendering/multi_sliver.dart b/lib/src/rendering/multi_sliver.dart index ffb2a4c..5f885b2 100644 --- a/lib/src/rendering/multi_sliver.dart +++ b/lib/src/rendering/multi_sliver.dart @@ -200,7 +200,7 @@ class RenderMultiSliver extends RenderSliver maxPaintOffset); maxPaintExtent = max( maxPaintExtent, - layoutOffset + + effectiveLayoutOffset + childParentData.geometry.maxPaintExtent + constraints.scrollOffset - childParentData.constraints.scrollOffset, diff --git a/pubspec.yaml b/pubspec.yaml index 17ec330..1d1ea40 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: sliver_tools description: A set of useful sliver tools that are missing from the flutter framework -version: 0.2.4 +version: 0.2.5 homepage: https://github.com/Kavantix repository: https://github.com/Kavantix/sliver_tools issue_tracker: https://github.com/Kavantix/sliver_tools/issues diff --git a/test/multi_sliver_test.dart b/test/multi_sliver_test.dart index 991ebd4..2c3f6de 100644 --- a/test/multi_sliver_test.dart +++ b/test/multi_sliver_test.dart @@ -13,6 +13,7 @@ void main() => multiSliverTests(); Widget box(Key? key, String title, {required double height}) { return Container( key: key, + color: const Color(0xFF000000), alignment: Alignment.center, height: height, width: double.infinity, @@ -322,10 +323,10 @@ void multiSliverTests() { [ const SizedBox(height: 100), GestureDetector( - behavior: HitTestBehavior.opaque, onTap: () => taps++, - child: const SizedBox( + child: Container( key: boxKey, + color: const Color(0xFF000000), height: 1, ), ), @@ -361,7 +362,6 @@ void multiSliverTests() { children: [ const SliverToBoxAdapter(child: SizedBox(height: 400)), GestureDetector( - behavior: HitTestBehavior.opaque, onTap: () => taps++, child: box(boxKey, 'Title', height: 1), ), @@ -390,7 +390,6 @@ void multiSliverTests() { MultiSliver( children: [ GestureDetector( - behavior: HitTestBehavior.opaque, onTap: () => taps++, child: box(UniqueKey(), 'Title', height: 200), ), @@ -407,7 +406,7 @@ void multiSliverTests() { )); expect(taps, 0); final thebox = find.byKey(boxKey); - await tester.tap(thebox); + await tester.tap(thebox, warnIfMissed: false); expect(taps, 0); }); diff --git a/test/sliver_stack_test.dart b/test/sliver_stack_test.dart index 6bccd7d..79551e6 100644 --- a/test/sliver_stack_test.dart +++ b/test/sliver_stack_test.dart @@ -28,6 +28,7 @@ void sliverStackTests() { Widget box(Key? key, {double? size}) { return Container( key: key, + color: const Color(0xFF000000), height: size, width: size, ); @@ -329,7 +330,6 @@ void sliverStackTests() { right: right, bottom: bottom, child: GestureDetector( - behavior: HitTestBehavior.opaque, onTap: () => tapped++, child: child, ),