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();
|
super.initState();
|
||||||
|
|
||||||
final tourState = context.read<TourBloc>().state as TourLoaded;
|
final tourState = context.read<TourBloc>().state as TourLoaded;
|
||||||
_paymentMethods = [
|
_paymentMethods = [...tourState.paymentOptions];
|
||||||
widget.delivery.payment,
|
|
||||||
...tourState.paymentOptions,
|
if (!_paymentMethods.any(
|
||||||
];
|
(payment) => payment.id == widget.delivery.payment.id,
|
||||||
|
)) {
|
||||||
|
_paymentMethods.add(widget.delivery.payment);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _deliveredArticles() {
|
Widget _deliveredArticles() {
|
||||||
@ -90,8 +93,6 @@ class _DeliverySummaryState extends State<DeliverySummary> {
|
|||||||
)
|
)
|
||||||
.toList();
|
.toList();
|
||||||
|
|
||||||
debugPrint(widget.delivery.payment.id);
|
|
||||||
|
|
||||||
return DropdownMenu(
|
return DropdownMenu(
|
||||||
dropdownMenuEntries: entries,
|
dropdownMenuEntries: entries,
|
||||||
initialSelection: widget.delivery.payment.id,
|
initialSelection: widget.delivery.payment.id,
|
||||||
|
|||||||
Reference in New Issue
Block a user