Skip to content
masterclass Buddy

Flutter & Dart · Component

GestureDetector

GestureDetector recognizes configured gestures and calls their callbacks. Its child determines its size; without a child, it fills the parent’s available size.

Last updated

Syntax

GestureDetector({
  Key? key,
  Widget? child,
  GestureTapCallback? onTap,
  HitTestBehavior? behavior,
  bool excludeFromSemantics = false,
  DragStartBehavior dragStartBehavior = DragStartBehavior.start,
  Set<PointerDeviceKind>? supportedDevices,
})

In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.

Subscribe
  • Listener
  • MouseRegion
  • InkWell
  • TextSelectionGestureDetector

Source: GestureDetector class - widgets library - Dart API. Checked 2026-11-03.