AssetImage using
This commit is contained in:
@@ -14,9 +14,10 @@ class GymLinkAppBar extends StatelessWidget implements PreferredSizeWidget {
|
||||
title: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(right: 8),
|
||||
child: Image.asset('logo.png', width: 24, height: 24),
|
||||
const Padding(
|
||||
padding: EdgeInsets.only(right: 8),
|
||||
child: Image(
|
||||
image: AssetImage('assets/logo.png'), width: 24, height: 24),
|
||||
),
|
||||
Align(
|
||||
alignment: Alignment.centerRight,
|
||||
|
||||
@@ -224,8 +224,8 @@ class _BasketPageState extends State<BasketPage> {
|
||||
name: item['name'],
|
||||
price: item['price'],
|
||||
id: item['id'],
|
||||
image: Image.asset(
|
||||
item['image'],
|
||||
image: Image(
|
||||
image: AssetImage('assets/${item['image']}'),
|
||||
width: 50,
|
||||
),
|
||||
onTapPlus: () => addItem(item['id'].toString()),
|
||||
|
||||
@@ -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),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -89,7 +89,10 @@ class _OrderConfirmationPageState extends State<OrderConfirmationPage> {
|
||||
final item = cartItems[index];
|
||||
return OrderConfirmItemCard(
|
||||
name: item['name'],
|
||||
image: Image.asset(item['image'], width: 50, height: 50),
|
||||
image: Image(
|
||||
image: AssetImage('assets/${item['image']}'),
|
||||
width: 50,
|
||||
height: 50),
|
||||
price: double.parse(item['price']),
|
||||
count: item['count'],
|
||||
);
|
||||
@@ -126,7 +129,16 @@ class _OrderConfirmationPageState extends State<OrderConfirmationPage> {
|
||||
),
|
||||
ElevatedButton(
|
||||
onPressed: () {
|
||||
debugPrint('Order confirmed');
|
||||
print('debugprint');
|
||||
// if (kIsWeb) {
|
||||
// Navigator.of(context).push(
|
||||
// MaterialPageRoute(
|
||||
// builder: (context) => const OrderPayPage(),
|
||||
// ),
|
||||
// );
|
||||
// } else {
|
||||
// debugPrint('test');
|
||||
// }
|
||||
},
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: Theme.of(context).primaryColor,
|
||||
|
||||
@@ -60,8 +60,8 @@ class HistoryPage extends StatelessWidget {
|
||||
id: item['id']!,
|
||||
cost: item['price']!,
|
||||
date: item['date']!,
|
||||
image: Image.asset(
|
||||
item['image']!,
|
||||
image: Image(
|
||||
image: AssetImage('assets/${item['image']!}'),
|
||||
width: 50,
|
||||
),
|
||||
status: OrderStatus.completed,
|
||||
|
||||
Reference in New Issue
Block a user