Loading...
Inside the product_screen.dart file under src/product/view/products/ add the following code:
class _ProductsGridView extends StatelessWidget { final List<Product> products; const _ProductsGridView({Key key, @required this.products}) : assert(products != null), super(key: key); @override Widget build(BuildContext context) { return GridView.builder( gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount( crossAxisCount: 2, mainAxisSpacing: 8, crossAxisSpacing: 8, childAspectRatio: 1 / 1.2, ), padding: const EdgeInsets.all(8), itemCount: products.length, physics: const BouncingScrollPhysics(), itemBuilder: (_, index) => _ProductItem(product: products[index]), ); } }