In Flutter, you construct a new widget every time its contents change.
Instead of MyCart.updateWith(somethingNew) (a method call)
you use MyCart(contents) (a constructor). Because you can only
construct new widgets in the build methods of their parents,
if you want to change contents, it needs to live in MyCart’s
parent or above.

Now MyCart has only one code path for building any version of the UI.

This is what we mean when we say that widgets are immutable.
They don’t change—they get replaced.

Now that we know where to put the state of the cart, let’s see how
to access it.

Accessing the state

When a user clicks on one of the items in the catalog,
it’s added to the cart. But since the cart lives above MyListItem,
how do we do that?