1
0
Fork 0
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
thesis_shop/lib/screens/product_list/product_item.dart

22 lines
753 B

import 'package:flutter/material.dart';
import 'package:thesis_shop/models/product.dart';
import 'package:thesis_shop/stores/cart_store.dart';
import 'package:thesis_shop/widgets/number_picker.dart';
class ProductItem extends StatelessWidget {
final Product product;
const ProductItem({Key? key, required this.product}) : super(key: key);
@override
Widget build(BuildContext context) {
final cartStore = CartStore.of(context);
return ListTile(
title: Text('${product.title} (${product.priceAsString}€/Stück)'),
trailing: NumberPicker(
value: cartStore.amountOfProduct(product),
onUp: () => cartStore.increaseAmount(product),
onDown: () => cartStore.decreaseAmount(product),
),
);
}
}