Fixed a bug where the current payment method is duplicated in the payment selection list
This commit is contained in:
@ -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,
|
||||
|
||||
Reference in New Issue
Block a user