tablePricesV4 function
dynamic
tablePricesV4()
Implementation
tablePricesV4(List<Widget> list, List<ProductData> _cart,
String stringAddons, /// strings.get(221) /// "Addons"
String stringSubtotal, /// strings.get(235) /// "Subtotal"
String stringDiscount, /// strings.get(236) /// "Discount"
String stringVaT, /// strings.get(276) /// "VAT/TAX"
String stringTotal /// strings.get(263) /// "Total amount"
){
List<Widget> listPrices = [];
for (var item in cartGetPriceForAllServices2(_cart)){
listPrices.add(Column(
children: [
SizedBox(height: 10,),
Row(
children: [
Expanded(child: Text(item.name, style: aTheme.style13W400,)),
Text(item.priceString, style: aTheme.style13W400,)
],
),
if (item.priceAddons != 0)
SizedBox(height: 10,),
if (item.priceAddons != 0)
Row(
children: [
Expanded(child: Text(stringAddons, style: aTheme.style13W400,)), /// "Addons"
Text("(+) ${item.priceAddons}", style: aTheme.style13W400,)
],
),
if (!item.isArticle && item.subTotal != item.priceWithCount)
SizedBox(height: 10,),
if (!item.isArticle && item.subTotal != item.priceWithCount)
Row(
children: [
Expanded(child: Text(stringSubtotal, style: aTheme.style13W400,)), /// "Subtotal"
Text(item.subTotalString, style: aTheme.style13W400,)
],
),
SizedBox(height: 10,),
Divider(height: 0.5, color: Colors.grey,),
// SizedBox(height: 10,),
],
));
}
var _totalPrice = cartGetTotalForAllServices2(_cart);
list.add(Container(
color: (aTheme.darkMode) ? Colors.black : Colors.white,
child: Container(
padding: EdgeInsets.all(10),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(height: 10,),
//
// price
//
...listPrices,
SizedBox(height: 10,),
Row(
children: [
Expanded(child: Text(stringDiscount, style: aTheme.style13W400,)), /// "Discount"
Text("(-) ${_totalPrice.discountString}", style: aTheme.style13W400,)
],
),
SizedBox(height: 10,),
Row(
children: [
Expanded(child: Text(stringVaT, style: aTheme.style13W400,)), /// "VAT/TAX"
Text("(+) ${_totalPrice.taxString}", style: aTheme.style13W400,)
],
),
SizedBox(height: 10,),
Divider(height: 0.5, color: Colors.grey,),
SizedBox(height: 10,),
Row(
children: [
Expanded(child: Text(stringTotal, style: aTheme.style14W800MainColor,)), /// "Total amount"
Text(_totalPrice.totalString, style: aTheme.style14W800MainColor,)
],
),
SizedBox(height: 10,),
],
)
)));
}