Skip to content

Commit 4bed767

Browse files
authored
Fix a _WrappedScrollBehavior.shouldNotify bug (flutter#103267)
1 parent c6ced84 commit 4bed767

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

packages/flutter/lib/src/widgets/scroll_configuration.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ class _WrappedScrollBehavior implements ScrollBehavior {
348348
|| oldDelegate.overscroll != overscroll
349349
|| oldDelegate.physics != physics
350350
|| oldDelegate.platform != platform
351-
|| setEquals<PointerDeviceKind>(oldDelegate.dragDevices, dragDevices)
351+
|| !setEquals<PointerDeviceKind>(oldDelegate.dragDevices, dragDevices)
352352
|| delegate.shouldNotify(oldDelegate.delegate);
353353
}
354354

packages/flutter/test/widgets/scroll_behavior_test.dart

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,14 @@ class TestScrollBehavior extends ScrollBehavior {
3232
}
3333

3434
void main() {
35+
// Regression test for https://github.com/flutter/flutter/issues/89681
36+
testWidgets('_WrappedScrollBehavior shouldNotify test', (WidgetTester tester) async {
37+
final ScrollBehavior behavior1 = const ScrollBehavior().copyWith();
38+
final ScrollBehavior behavior2 = const ScrollBehavior().copyWith();
39+
40+
expect(behavior1.shouldNotify(behavior2), false);
41+
});
42+
3543
testWidgets('Inherited ScrollConfiguration changed', (WidgetTester tester) async {
3644
final GlobalKey key = GlobalKey(debugLabel: 'scrollable');
3745
TestScrollBehavior? behavior;

0 commit comments

Comments
 (0)