Mikkel Troels Kongsted 17f2392ab6 Store prices as DkkCents and format kr
Co-authored-by: SimonFJ20 <simonfromjakobsen@gmail.com>
2025-03-04 09:28:00 +01:00

43 lines
1.0 KiB
Dart

import 'package:flutter/material.dart';
import 'package:mobile/utils/price.dart';
class ReceiptItemView extends StatelessWidget {
final int pricePerAmount;
final String name;
final int amount;
const ReceiptItemView(
{super.key,
required this.pricePerAmount,
required this.name,
required this.amount});
@override
Widget build(BuildContext context) {
return Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(name),
Row(
children: [
SizedBox(
width: 80,
child: Text(
"$amount stk",
textAlign: TextAlign.end,
overflow: TextOverflow.ellipsis,
)),
SizedBox(
width: 80,
child: Text(
formatDkkCents(pricePerAmount * amount),
textAlign: TextAlign.end,
overflow: TextOverflow.ellipsis,
))
],
),
],
);
}
}