From bf0f4e6b2e6a05fb32a5eff882ee19d36be13906 Mon Sep 17 00:00:00 2001 From: Michael Goderbauer Date: Wed, 23 May 2018 17:01:19 -0700 Subject: [PATCH] Document defaults of GestureDetector.behavior and link to debugging options (#17785) --- .../flutter/lib/src/widgets/gesture_detector.dart | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/packages/flutter/lib/src/widgets/gesture_detector.dart b/packages/flutter/lib/src/widgets/gesture_detector.dart index 8cebe17a62..7c92d6958d 100644 --- a/packages/flutter/lib/src/widgets/gesture_detector.dart +++ b/packages/flutter/lib/src/widgets/gesture_detector.dart @@ -124,6 +124,11 @@ class GestureRecognizerFactoryWithHandlers extends /// ), /// ) /// ``` +/// +/// ## Debugging +/// +/// To see how large the hit test box of a [GestureDetector] is for debugging +/// purposes, set [debugPaintPointersEnabled] to true. class GestureDetector extends StatelessWidget { /// Creates a widget that detects gestures. /// @@ -286,6 +291,9 @@ class GestureDetector extends StatelessWidget { final GestureScaleEndCallback onScaleEnd; /// How this gesture detector should behave during hit testing. + /// + /// This defaults to [HitTestBehavior.deferToChild] if [child] is not null and + /// [HitTestBehavior.translucent] if child is null. final HitTestBehavior behavior; /// Whether to exclude these gestures from the semantics tree. For @@ -477,6 +485,9 @@ class RawGestureDetector extends StatefulWidget { final Map gestures; /// How this gesture detector should behave during hit testing. + /// + /// This defaults to [HitTestBehavior.deferToChild] if [child] is not null and + /// [HitTestBehavior.translucent] if child is null. final HitTestBehavior behavior; /// Whether to exclude these gestures from the semantics tree. For