Dart’s single-threaded model doesn’t mean you are
required to run everything as a blocking operation
that causes the UI to freeze. Instead,
use the asynchronous facilities that the Dart language provides,
such as async/await, to perform asynchronous work.

For example, you can run network code without causing the
UI to hang by using async/await and letting Dart do
the heavy lifting:

Once the awaited network call is done,
update the UI by calling setState(),
which triggers a rebuild of the widget sub-tree
and updates the data.

The following example loads data asynchronously and
displays it in a ListView:

Refer to the next section for more information on doing work
in the background, and how Flutter differs from iOS.

Moving to the background thread