Created
August 7, 2018 08:08
-
-
Save rohan20/6633a360744986f8c7f77cd838ae6b32 to your computer and use it in GitHub Desktop.
E-Commerce app using Flutter - Part 3: Remote data
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
| class ProductsListItem extends StatelessWidget { | |
| final Product product1; | |
| final Product product2; | |
| ProductsListItem({ | |
| @required this.product1, | |
| @required this.product2, | |
| }); | |
| @override | |
| Widget build(BuildContext context) { | |
| return Row( | |
| mainAxisSize: MainAxisSize.max, | |
| mainAxisAlignment: MainAxisAlignment.center, | |
| children: <Widget>[ | |
| _buildProductItemCard(context, product1), | |
| _buildProductItemCard(context, product2), | |
| ], | |
| ); | |
| } | |
| _buildProductItemCard(BuildContext context, Product product) { | |
| return InkWell( | |
| //Now, you can access the product's details using the product passed //in the arguments of this method | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment