Many non-trivial mobile apps require interaction with backend services. This chapter covers essential concepts related to service interactions in Flutter.
9.1 Working with Futures
Problem
You want to work with Future objects .
Solution
Use then() and catchError() methods to handle results of Future objects.
Discussion
When using code from Flutter and Dart libraries, you may encounter functions that return Future objects. Future<T> class from dart:async library is a representation of delayed computations. A Future object represents a potential value or error that will be available in the future. When ...