AssetImage using

This commit is contained in:
2024-05-11 22:48:46 +03:00
parent b4092837d2
commit 57ff8a59e8
5 changed files with 28 additions and 12 deletions

View File

@@ -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),
),
),
),