In this chapter, you've built a simple game, based on animation and on detecting a user's gestures.
Animations in Flutter are fast and relatively easy to implement. The moving parts involved in the animation are the Animation class, which takes in some values and translates them into animations, AnimationController, which controls the animation objects, Tween, which contains the value of the property that needs to change during the animation, and Ticker, which calls its callback once per animation frame.
Enclosing any widget in a GestureDetector will allow you to listen to several gestures the user performs over your user interface. This allowed a moving bat to be constructed on the screen, leveraging the onHorizontalDragUpdate property of GestureDetector.
Adding some randomness generally makes a game more interesting. We've also seen how to use the Random...