Recall & Review
beginner
What is the purpose of the
GestureDetector widget in Flutter?The
GestureDetector widget detects gestures like taps, drags, and swipes on its child widget and lets you respond to them.Click to reveal answer
beginner
Which property of
GestureDetector handles a tap event?The
onTap property is a callback that runs when the user taps the widget.Click to reveal answer
beginner
How do you make a widget respond to a double tap using
GestureDetector?Use the
onDoubleTap property and provide a function to run when the user double taps the widget.Click to reveal answer
intermediate
Can
GestureDetector detect drag gestures? If yes, which callback is used?Yes, it can detect drag gestures using callbacks like
onPanUpdate which gives the drag movement details.Click to reveal answer
intermediate
What happens if you wrap a button with
GestureDetector and use onTap?The
GestureDetector will detect taps on the button and run your onTap code, allowing you to customize tap behavior.Click to reveal answer
Which
GestureDetector property detects a single tap?✗ Incorrect
The
onTap callback runs when the user taps once on the widget.What type of widget must
GestureDetector have inside it?✗ Incorrect
GestureDetector wraps a child widget to detect gestures on that widget.Which callback detects when the user drags their finger across the screen?
✗ Incorrect
onPanUpdate detects drag movements and provides details about the drag.If you want to detect a long press, which
GestureDetector property do you use?✗ Incorrect
onLongPress runs when the user presses and holds on the widget.What happens if you do not provide any gesture callbacks to
GestureDetector?✗ Incorrect
Without callbacks,
GestureDetector does not respond to gestures.Explain how to use
GestureDetector to detect a tap and change the color of a box.Think about wrapping a colored box and changing its color inside onTap.
You got /4 concepts.
Describe the difference between
onTap and onDoubleTap in GestureDetector.Consider how users interact with buttons or images differently.
You got /4 concepts.