Without keys, the first entry in the current build
would always sync with the first entry in the previous build,
even if, semantically, the first entry in the list just
scrolled off screen and is no longer visible in the viewport.

By assigning each entry in the list a “semantic” key,
the infinite list can be more efficient because the
framework syncs entries with matching semantic keys
and therefore similar (or identical) visual appearances.
Moreover, syncing the entries semantically means that
state retained in stateful child widgets remains attached
to the same semantic entry rather than the entry in the
same numerical position in the viewport.

For more information, see the Key API.

Global keys

Use global keys to uniquely identify child widgets.
Global keys must be globally unique across the entire
widget hierarchy, unlike local keys which need
only be unique among siblings. Because they are
globally unique, a global key can be used to
retrieve the state associated with a widget.