-
-
Save AbbasHoseini/382ab714ef755fbe32470ee75d807f9b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
return Consumer<CartModel>( | |
builder: (context, cart, 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(), | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment