The third argument is child, which is there for optimization.
If you have a large widget subtree under your Consumer
that doesn’t change when the model changes, you can construct it
once and get it through the builder.

child) => Stack(
    children: [
      // Use SomeExpensiveWidget here, without rebuilding every time.
      if (

child != null)

child,
      Text('Total price: ${cart.totalPrice}'),
    ],
  ),
  // Build the expensive widget here.

child: const SomeExpensiveWidget(),
);

It is best practice to put your Consumer widgets as deep in the tree
as possible. You don’t want to rebuild large portions of the UI
just because some detail somewhere changed.

Instead:

Provider.of