Skip to content

Instantly share code, notes, and snippets.

@rohan20
Created August 7, 2018 08:08
Show Gist options
  • Select an option

  • Save rohan20/6633a360744986f8c7f77cd838ae6b32 to your computer and use it in GitHub Desktop.

Select an option

Save rohan20/6633a360744986f8c7f77cd838ae6b32 to your computer and use it in GitHub Desktop.
E-Commerce app using Flutter - Part 3: Remote data
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