i am new to flutter and dart and i wanted to make a horizontal list with images that one can click and that will take them to the product page. i want the product details to be taken from the var product_list which i will use to make the product page. the below code runs but the list is not visible
import 'package:flutter/material.dart';
import 'package:app/pages/product_details.dart';
class Mostpop extends StatelessWidget {
final product_name;
final product_picture;
final product_price;
Mostpop({
this.product_name,
this.product_picture,
this.product_price
});
var product_list = [
{
"name": "The Bundle",
"picture": "images/thumbnails/t1.jpg",
"price": 99,
},
{
"name": "The Bundle",
"picture": "images/thumbnails/t1.jpg",
"price": 99,
},
{
"name": "The Bundle",
"picture": "images/thumbnails/t1.jpg",
"price": 99,
},
{
"name": "The Bundle",
"picture": "images/thumbnails/t1.jpg",
"price": 99,
},
];
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Horizontal ListView'),
),
body: Container(
padding: EdgeInsets.symmetric(),
height: MediaQuery.of(context).size.height * 0.35,
child: ListView.builder(
scrollDirection: Axis.horizontal,
itemCount: product_list.length, itemBuilder: (context, index) {
return Container(
width: MediaQuery.of(context).size.width * 0.6,
child: Card(
color: Colors.blue,
child: Container(
child: Center(child: Image.asset(product_picture,fit: BoxFit.cover,)),
),
),
);
}),
),
);
}
}