Work with tabs

Create a nested navigation flow

Create a download button

Cookbook

Effects

Create a download button

Define a new stateless widget

Define the button’s possible visual states

Display the button shape

Display the button text

Display a spinner while fetching download

Display the progress and a stop button while downloading

Add button tap callbacks

Interactive example

Apps are filled with buttons that execute long-running behaviors.
For example, a button might trigger a download,
which starts a download process, receives data over time,
and then provides access to the downloaded asset. 
It’s helpful to show the user the progress of a
long-running process, and the button itself is a good place
to provide this feedback. In this recipe,
you’ll build a download button that transitions through
multiple visual states, based on the status of an app download.