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/cart/cart_item_list.dart

32 lines
1011 B

import 'package:flutter/material.dart';
import 'package:thesis_shop/models/cart_item.dart';
class CartItemList extends StatelessWidget {
final List<CartItem> items;
const CartItemList({Key? key, required this.items}) : super(key: key);
@override
Widget build(BuildContext context) {
return DefaultTextStyle.merge(
style: const TextStyle(fontSize: 16, height: 2.5),
child: Padding(
padding: const EdgeInsets.all(16.0),
child: Table(
columnWidths: const {
0: FlexColumnWidth(),
1: FixedColumnWidth(128),
2: IntrinsicColumnWidth(),
},
children: items
.map(
(item) => TableRow(children: [
Text(item.product.title),
Text("${item.amount}*${item.product.priceAsString}"),
Text('${item.totalPriceAsString}'),
]),
)
.toList()),
),
);
}
}