task

await

viewModel

load

()

In Dart, all work runs on the main isolate by default. 
To implement the same example in Dart, 
first, create the Weather enum:

Then, define a simple view model (similar to what was created in SwiftUI), 
to fetch the weather. In Dart, a Future object represents a value to be
provided in the future. A Future is similar to Swift’s ObservableObject. 
In this example, a function within the view model returns a Future<Weather> object:

The load() function in this example shares 
similarities with the Swift code. 
The Dart function is marked as async because
it uses the await keyword.

Additionally, a Dart function marked as async
automatically returns a Future.
In other words, you don’t have to create a 
Future instance manually 
inside functions marked as async.