diff --git a/packages/flutter_test/lib/src/binding.dart b/packages/flutter_test/lib/src/binding.dart index d8f3562d49..238af86db1 100644 --- a/packages/flutter_test/lib/src/binding.dart +++ b/packages/flutter_test/lib/src/binding.dart @@ -494,7 +494,8 @@ abstract class TestWidgetsFlutterBinding extends BindingBase /// /// When [handlePointerEvent] is called directly, [pointerEventSource] /// is [TestBindingEventSource.device]. - TestBindingEventSource pointerEventSource = TestBindingEventSource.device; + TestBindingEventSource get pointerEventSource => _pointerEventSource; + TestBindingEventSource _pointerEventSource = TestBindingEventSource.device; /// Dispatch an event to the targets found by a hit test on its position, /// and remember its source as [pointerEventSource]. @@ -529,12 +530,12 @@ abstract class TestWidgetsFlutterBinding extends BindingBase /// to the previous value. @protected void withPointerEventSource(TestBindingEventSource source, VoidCallback task) { - final TestBindingEventSource previousSource = pointerEventSource; - pointerEventSource = source; + final TestBindingEventSource previousSource = _pointerEventSource; + _pointerEventSource = source; try { task(); } finally { - pointerEventSource = previousSource; + _pointerEventSource = previousSource; } } diff --git a/packages/flutter_test/test/bindings_test.dart b/packages/flutter_test/test/bindings_test.dart index 418e1a7d59..c5a4b923db 100644 --- a/packages/flutter_test/test/bindings_test.dart +++ b/packages/flutter_test/test/bindings_test.dart @@ -31,11 +31,6 @@ void main() { binding.defaultTestTimeout = const test_package.Timeout(Duration(minutes: 5)); expect(binding.defaultTestTimeout.duration, const Duration(minutes: 5)); }); - - test('allows setting pointerEventSource to TestBindingEventSource.test', () { - binding.pointerEventSource = TestBindingEventSource.test; - expect(binding.pointerEventSource, TestBindingEventSource.test); - }); }); // The next three tests must run in order -- first using `test`, then `testWidgets`, then `test` again.