From a0862f1c3f9885136ff986aa75de1aa9bf8e61e0 Mon Sep 17 00:00:00 2001 From: Jonah Williams Date: Wed, 30 Aug 2023 18:58:42 -0700 Subject: [PATCH] [framework] use ImageFilter for stretch overscroll. (#133613) Rather than changing the size of the child elements (relaying out text and potentially changing glyph shape and position due to pixel snapping), apply the stretch effect as a compositing effect - render the children to a texture and stretch the texture. If we end up using an image shader to apply an custom shader we'll need to do this anyway. Fixes https://github.com/flutter/flutter/issues/129528 ### Before https://github.com/flutter/flutter/assets/8975114/16e9eb57-f864-4093-b4a4-461082b89b43 ### After https://github.com/flutter/flutter/assets/8975114/14cf0167-8922-4876-a325-e3bc154b084f --- .../lib/src/widgets/overscroll_indicator.dart | 2 +- .../overscroll_stretch_indicator_test.dart | 25 +++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/packages/flutter/lib/src/widgets/overscroll_indicator.dart b/packages/flutter/lib/src/widgets/overscroll_indicator.dart index 2b65fd3f31..810cbf6fab 100644 --- a/packages/flutter/lib/src/widgets/overscroll_indicator.dart +++ b/packages/flutter/lib/src/widgets/overscroll_indicator.dart @@ -786,10 +786,10 @@ class _StretchingOverscrollIndicatorState extends State()))); + + final TestGesture gesture = await tester.startGesture(tester.getCenter(find.byType(CustomScrollView))); + // Overscroll + await gesture.moveBy(const Offset(200.0, 0.0)); + await tester.pumpAndSettle(); + + expect(tester.layers, contains(isA())); + }); }