Chapter 9

Moving Right Along …

IN THIS CHAPTER

Bullet Creating animation

Bullet Mixing other people's code with your own code

Bullet Animating size and color changes

Bullet Dragging widgets without dropping them or breaking them

This chapter is about animation — making things change right before the user's eyes. When I think about animation, I immediately think of movement, but Flutter provides a much broader definition of animation. With Flutter, you can change almost any property of a widget on almost any time scale.

Setting the Stage for Flutter Animation

This chapter's first listing has a bunch of reusable code. Subsequent listings contain code that works cooperatively with the code in the first listing. Thanks to Dart's extensions feature, each new listing can create methods belonging to the first listing's classes. You can read all about Dart extensions in Book 4, Chapter 8.

The code in Listing 9-1 can't do anything on its own. Instead, this code relies on declarations in the chapter's other listings.

LISTING 9-1: Reuse This Code

// app09main.dartimport 'package:flutter/material.dart';import 'app0902.dart'; ...

Get Coding All-in-One For Dummies, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.