In the following example, the build function is separated into three different
functions. If showLoadingDialog is true (when widgets.isEmpty),
then render the ProgressIndicator. Otherwise, render the
ListView with the data returned from a network call.

Project structure & resources

Where do I store my resolution-dependent image files?

While Android treats resources and assets as distinct items,
Flutter apps have only assets. All resources that would live
in the res/drawable-* folders on Android,
are placed in an assets folder for Flutter.

Flutter follows a simple density-based format like iOS. Assets might be 1.0x,
2.0x, 3.0x, or any other multiplier. Flutter doesn’t have dps but there
are logical pixels, which are basically the same as device-independent pixels.
The so-called devicePixelRatio
expresses the ratio of physical pixels in a single logical pixel.

The equivalent to Android’s density buckets are:

ldpi