Created
February 23, 2020 12:59
-
-
Save slamdon/511964f69b6a646658619a2270307cb4 to your computer and use it in GitHub Desktop.
Provider
This file contains hidden or 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
final _cart = Provider.of<CartProvider>(context); | |
... | |
FlatButton( | |
child: Text( | |
"${_cart.products.length}", | |
style: TextStyle(color: Colors.white, fontSize: 20), | |
), | |
onPressed: () { | |
Navigator.push(context, MaterialPageRoute(builder: (context){ | |
return CartPage(_cart.products); | |
})); | |
}, | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment