From ad407e0ab4dda3f58661ec748ea872e7108b26e5 Mon Sep 17 00:00:00 2001 From: Semyon Babushkin Date: Mon, 13 Nov 2017 12:33:32 +0300 Subject: [PATCH] hide coupons if flavor=autobonus --- lib/screens/purchase.dart | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/lib/screens/purchase.dart b/lib/screens/purchase.dart index 7e5ac13..646c38d 100644 --- a/lib/screens/purchase.dart +++ b/lib/screens/purchase.dart @@ -77,26 +77,28 @@ class PurchaseScreenState extends BaseState { widgetList.add(getInputField()); // Нельзя добавить еще одно поле таким же способом - if (this.loyalityType == 'bonus') { - if (this.flavor != 'autobonus') { + + + if (this.flavor != 'autobonus') { + if (this.loyalityType == 'bonus') { widgetList.add(getBonusInputField()); } - } - if (this.coupons.length > 0) { - widgetList.add(getItemTitle(StringsLocalization.selectCoupons())); - this.coupons.forEach((couponItem) { - widgetList.add(getItemToggleSwitch( - couponItem['offer_name'], - couponItem['coupon_condition'], - couponItem['isSet'], - (val) { - setState(() { - couponItem['isSet'] = val; - }); - } - )); - }); + if (this.coupons.length > 0) { + widgetList.add(getItemTitle(StringsLocalization.selectCoupons())); + this.coupons.forEach((couponItem) { + widgetList.add(getItemToggleSwitch( + couponItem['offer_name'], + couponItem['coupon_condition'], + couponItem['isSet'], + (val) { + setState(() { + couponItem['isSet'] = val; + }); + } + )); + }); + } } widgetList.add(wrapButton(getScreenMargins(36.0), getCompleteButton()));