5 User Interaction: Forms and Gestures
In this chapter:
- User interaction with GestureDetectors
- Special interaction widgets like
Dismissible
- Flutter forms
- Text input, dropdown lists, and more form elements
- Using Keys to manage Flutter forms
This chapter is going to be the shortest, most succinct chapter. That doesn’t mean it’s not important though. This chapter is about letting users interact with your Flutter app. At the end of the day, it seems like all mobile apps basically have one job: to make it easy for a human to interact with a giant amount of data. And half of that interaction is allowing users not only to look at data, but also add to it and change it. This chapter is about that: letting users add and change data in your app. Specifically, this covers two different kinds of interaction: gestures and forms.
Gestures are any kind of interaction event: taps, drags, pans, etc. I’ll cover that first. To be honest, though, there isn’t much involved here. Flutter, of course, has a convenience widget that allows you to add gesture detectors to whichever portions of your widget tree that you’d like.
You’ve already used many gestures. All the button widgets that have onPressed and onTap are just convenient wrappers around gesture detectors.