Step 1 / 4
GestureDetector wraps anything
Most widgets don't handle touches themselves. Wrap one in GestureDetector and pass the callbacks you need.
Detect taps, long presses and drags, give Material ripple feedback, and keep targets accessible.
1GestureDetector(2 onTap: () => debugPrint('tap'),3 onDoubleTap: like,4 onLongPress: showOptions,5 onPanUpdate: (d) => setState(() => offset += d.delta),6 child: const Card(child: Text('Drag me')),7)89InkWell(10 onTap: openDetails,11 borderRadius: BorderRadius.circular(12),12 child: const ListTile(title: Text('With ripple')),13)
Tap, double-tap, long-press or drag the card.
Most widgets don't handle touches themselves. Wrap one in GestureDetector and pass the callbacks you need.