Moving to the background thread

Since Flutter is single threaded and runs an event loop
(like Node.js), you don’t have to worry about
thread management or spawning background threads.
If you’re doing I/O-bound work,
such as disk access or a network call,
then you can safely use async/await and you’re done.
If, on the other hand, you need to do computationally intensive
work that keeps the CPU busy, you want to move it to an
Isolate to avoid blocking the event loop.

For I/O-bound work, declare the function as an async function,
and await on long-running tasks inside the function:

This is how you typically do network or database calls,
which are both I/O operations.

However, there are times when you might be processing
a large amount of data and your UI hangs.
In Flutter, use Isolates to take advantage of
multiple CPU cores to do long-running or
computationally intensive tasks.