mirror of
https://github.com/Mercantec-GHC/h4-projekt-gruppe-0-sm.git
synced 2025-04-28 00:34:06 +02:00
remove card from product page
This commit is contained in:
parent
aefcac742b
commit
3339857580
@ -17,10 +17,8 @@ class ProductPage extends StatelessWidget {
|
||||
final AddToCartStateRepo addToCartStateRepo =
|
||||
context.watch<AddToCartStateRepo>();
|
||||
return Scaffold(
|
||||
backgroundColor: Colors.white,
|
||||
body: SafeArea(
|
||||
child: Card(
|
||||
color: Colors.white,
|
||||
margin: const EdgeInsets.all(10),
|
||||
child: Container(
|
||||
padding: const EdgeInsets.symmetric(vertical: 10),
|
||||
child: Column(children: [
|
||||
@ -57,8 +55,7 @@ class ProductPage extends StatelessWidget {
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
Image(
|
||||
image:
|
||||
AssetImage("assets/products/${product.name}.png"),
|
||||
image: AssetImage("assets/products/${product.name}.png"),
|
||||
errorBuilder: (_, __, ___) => const Image(
|
||||
image: AssetImage("assets/placeholder.png")),
|
||||
height: 250,
|
||||
@ -92,12 +89,10 @@ class ProductPage extends StatelessWidget {
|
||||
'Tilføjet ${addToCartStateRepo.currentAmount} ${product.name} til kurven'),
|
||||
duration: const Duration(seconds: 2),
|
||||
);
|
||||
ScaffoldMessenger.of(context)
|
||||
.removeCurrentSnackBar();
|
||||
ScaffoldMessenger.of(context).removeCurrentSnackBar();
|
||||
final cartRepo = context.read<CartRepo>();
|
||||
cartRepo.addToCart(product);
|
||||
ScaffoldMessenger.of(context)
|
||||
.showSnackBar(snackBar);
|
||||
ScaffoldMessenger.of(context).showSnackBar(snackBar);
|
||||
},
|
||||
child: const Text("Tilføj til indkøbskurv")),
|
||||
],
|
||||
@ -107,7 +102,6 @@ class ProductPage extends StatelessWidget {
|
||||
]),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user