11Applying Interactivity
WHAT YOU WILL LEARN IN THIS CHAPTER
- How to use
GestureDetector, which recognizes gestures such as tap, double tap, long press, pan, vertical drag, horizontal drag, and scale. - How to use the
Draggablewidget that is dragged to aDragTarget. - How to use the
DragTargetwidget that receives data from aDraggable. - How to use the
InkWellandInkResponsewidgets. You will learn thatInkWellis a rectangular area that responds to touch and clips splashes within its area. You'll learn thatInkResponseresponds to touch and that splashes expand outside its area. - How to use the
Dismissiblewidget that is dismissed by dragging.
In this chapter, you'll learn how to add interactivity to an app by using gestures. In a mobile application, gestures are the heart of listening to user interaction. Making use of gestures can define an app with a great UX. Overusing gestures when they don't add value or convey an action creates a poor UX. You'll take a closer look at how to find a balance by using the correct gesture for the task at hand.
SETTING UP GESTUREDETECTOR: THE BASICS
The GestureDetector widget detects gestures such as tap, double tap, long press, pan, vertical drag, horizontal drag, and scale. It has an optional child property, and if a child widget is specified, the gestures apply only to the child widget. If the child widget is omitted, then the GestureDetector fills the entire parent instead. If you need to catch vertical drag and horizontal drag at the same ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access