Fixed a bug where the current payment method is duplicated in the payment selection list

This commit is contained in:
Dennis Nemec
2026-01-09 13:02:38 +01:00
parent da0f77e35d
commit 3b5d58eb9d

View File

@ -24,10 +24,13 @@ class _DeliverySummaryState extends State<DeliverySummary> {
super.initState();
final tourState = context.read<TourBloc>().state as TourLoaded;
_paymentMethods = [
widget.delivery.payment,
...tourState.paymentOptions,
];
_paymentMethods = [...tourState.paymentOptions];
if (!_paymentMethods.any(
(payment) => payment.id == widget.delivery.payment.id,
)) {
_paymentMethods.add(widget.delivery.payment);
}
}
Widget _deliveredArticles() {
@ -90,8 +93,6 @@ class _DeliverySummaryState extends State<DeliverySummary> {
)
.toList();
debugPrint(widget.delivery.payment.id);
return DropdownMenu(
dropdownMenuEntries: entries,
initialSelection: widget.delivery.payment.id,