AssetImage using
This commit is contained in:
@@ -179,8 +179,8 @@ class _MainPageState extends State<MainPage> {
|
||||
itemBuilder: (context, index) {
|
||||
final product = testData[index];
|
||||
return ProductCard(
|
||||
imagePath: Image.asset(
|
||||
product['image']!,
|
||||
imagePath: Image(
|
||||
image: AssetImage('assets/${product['image']!}'),
|
||||
width: 100,
|
||||
),
|
||||
name: product['name']!,
|
||||
@@ -192,7 +192,10 @@ class _MainPageState extends State<MainPage> {
|
||||
description: product['details']!,
|
||||
price: product['price']!,
|
||||
id: product['id']!,
|
||||
image: Image.asset(product['image']!, width: 300),
|
||||
image: Image(
|
||||
image:
|
||||
AssetImage('assets/${product['image']!}'),
|
||||
width: 300),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user