From a5fa083906fcaf88b039a717c6e78b9814f3a77c Mon Sep 17 00:00:00 2001 From: "Ming Lyu (CareF)" Date: Wed, 8 Jul 2020 18:37:33 -0400 Subject: [PATCH] Add comment explain dispatchEvent override (#60734) --- packages/flutter_test/lib/src/binding.dart | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/flutter_test/lib/src/binding.dart b/packages/flutter_test/lib/src/binding.dart index 332088584ec..2372683eb84 100644 --- a/packages/flutter_test/lib/src/binding.dart +++ b/packages/flutter_test/lib/src/binding.dart @@ -467,6 +467,11 @@ abstract class TestWidgetsFlutterBinding extends BindingBase HitTestResult hitTestResult, { TestBindingEventSource source = TestBindingEventSource.device, }) { + // This override disables calling this method from base class + // [GestureBinding] when the runtime type is [TestWidgetsFlutterBinding], + // while enables sub class [LiveTestWidgetsFlutterBinding] to override + // this behavior and use this argument to determine the souce of the event + // especially when the test app is running on a device. assert(source == TestBindingEventSource.test); super.dispatchEvent(event, hitTestResult); }