0PricingLogin
Dart Academy · Lesson

Creating and Awaiting Futures

Produce and consume Future values.

A Promise of a Value

A Future represents a value that is not ready yet but will arrive later, like a receipt you redeem when your order is done.

Future of a Type

A future is always typed by what it will deliver. A Future<int> promises an int once the async work completes.

Future<int> fetchScore() async {
  return 42;
}

All lessons in this course

  1. The Event Loop and Microtasks
  2. Creating and Awaiting Futures
  3. Error Handling in async Code
  4. Future.wait and Parallel Work
← Back to Dart Academy