Unverified Commit 4bed7675 authored by xubaolin's avatar xubaolin Committed by GitHub

Fix a `_WrappedScrollBehavior.shouldNotify` bug (#103267)

parent c6ced845
......@@ -348,7 +348,7 @@ class _WrappedScrollBehavior implements ScrollBehavior {
|| oldDelegate.overscroll != overscroll
|| oldDelegate.physics != physics
|| oldDelegate.platform != platform
|| setEquals<PointerDeviceKind>(oldDelegate.dragDevices, dragDevices)
|| !setEquals<PointerDeviceKind>(oldDelegate.dragDevices, dragDevices)
|| delegate.shouldNotify(oldDelegate.delegate);
}
......
......@@ -32,6 +32,14 @@ class TestScrollBehavior extends ScrollBehavior {
}
void main() {
// Regression test for https://github.com/flutter/flutter/issues/89681
testWidgets('_WrappedScrollBehavior shouldNotify test', (WidgetTester tester) async {
final ScrollBehavior behavior1 = const ScrollBehavior().copyWith();
final ScrollBehavior behavior2 = const ScrollBehavior().copyWith();
expect(behavior1.shouldNotify(behavior2), false);
});
testWidgets('Inherited ScrollConfiguration changed', (WidgetTester tester) async {
final GlobalKey key = GlobalKey(debugLabel: 'scrollable');
TestScrollBehavior? behavior;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment