Types can be used to help developers catch programming
errors early. The Flutter framework uses generic programming to
help in this regard. For example, the State
class is parameterized in terms of the type of its
associated widget, so that the Dart analyzer can catch
mismatches of states and widgets. Similarly, the
GlobalKey class takes a type parameter so that it
can access a remote widget’s state in a type-safe manner
(using runtime checking), the Route interface is
parameterized with the type that it is expected to use when
popped, and collections such as Lists, Maps,
and Sets are all parameterized so that mismatched
elements can be caught early either during analysis or at
runtime during debugging.

Flutter makes heavy use of Futures and other
asynchronous APIs. For example, the animation system reports
when an animation is finished by completing a future.
The image loading system similarly uses futures to report
when a load is complete.