diff --git a/lib/widgets/desktop/desktop_checkout.dart b/lib/widgets/desktop/desktop_checkout.dart index 13ee3ac..a7c039c 100644 --- a/lib/widgets/desktop/desktop_checkout.dart +++ b/lib/widgets/desktop/desktop_checkout.dart @@ -366,7 +366,7 @@ class DesktopCheckoutState extends State with SingleTickerProvi ); switch (position) { case 0: - if (cartInfo!.businessInfo!.deliveryPickup) { + if (cartInfo!.businessInfo!.deliveryPickup == true) { return Container( padding: EdgeInsets.only( top: 16.0, bottom: 16.0, left: 16.0, right: 16.0), @@ -608,7 +608,7 @@ class DesktopCheckoutState extends State with SingleTickerProvi }, ); } - if (!cartInfo!.businessInfo!.instanceDelivery) { + if (cartInfo!.businessInfo!.instanceDelivery != true) { return Container( padding: EdgeInsets.only(left: 16.0, right: 16.0, top: 0.0, bottom: 16.0), child: Text(S.of(context).no_instance_delivery_desc), @@ -1099,7 +1099,7 @@ class DesktopCheckoutState extends State with SingleTickerProvi shippingRates = (response.data['shipping_rates'] as List).map((e) => ShippingRate.fromJson(e)).toList(); selectedShippingRate = (response.data['selected_shipping_rate'] as String).length > 0 ? ShippingRate.fromJson(json.decode(response.data['selected_shipping_rate'])) : null; int i = 0; - if (cartInfo!.businessInfo!.deliveryStoreDelivery) { + if (cartInfo!.businessInfo!.deliveryStoreDelivery == true) { shippingMethodLabels.add(S.of(context).delivery); shippingMethodIcons.add(Icons.directions_car); if (deliveryMethod == 'store-delivery') { @@ -1107,7 +1107,7 @@ class DesktopCheckoutState extends State with SingleTickerProvi } i++; } - if (cartInfo!.businessInfo!.deliveryCanadaPost) { + if (cartInfo!.businessInfo!.deliveryCanadaPost == true) { shippingMethodLabels.add(S.of(context).canada_post); shippingMethodIcons.add(Icons.local_shipping); if (deliveryMethod == 'canada-post') { @@ -1115,7 +1115,7 @@ class DesktopCheckoutState extends State with SingleTickerProvi } i++; } - if (cartInfo!.businessInfo!.deliveryPickup) { + if (cartInfo!.businessInfo!.deliveryPickup == true) { shippingMethodLabels.add(S.of(context).pickup); shippingMethodIcons.add(Icons.store); if (deliveryMethod == 'pickup') { @@ -1580,7 +1580,7 @@ class DesktopCheckoutState extends State with SingleTickerProvi } else { for (var i = 0; i < coupons!.length; i++) { if (selectedCoupon == coupons![i].id) { - if (coupons![i].isPercentage) { + if (coupons![i].isPercentage == true) { return S.of(context).percentage_discount_token2(couponDiscountAmount.toStringAsFixed(2), coupons![i].valueAmount); } else { return S.of(context).discount_amount_token(couponDiscountAmount.toStringAsFixed(2)); @@ -1914,7 +1914,7 @@ class DesktopCheckoutState extends State with SingleTickerProvi mounted) { setState(() { selectedCoupon = coupon.id; - if (coupon.isPercentage) { + if (coupon.isPercentage == true) { couponDiscountAmount = subtotal * coupon.valueAmount / 100.0; } else { couponDiscountAmount = coupon.valueAmount!; diff --git a/lib/widgets/general/attribute/radio_options.dart b/lib/widgets/general/attribute/radio_options.dart index d888c63..0a909ba 100644 --- a/lib/widgets/general/attribute/radio_options.dart +++ b/lib/widgets/general/attribute/radio_options.dart @@ -85,7 +85,7 @@ class RadioOptionsState extends OptionsBaseState { 'adjust_amount': adjustAmount }; var cloneSelections = json.decode(json.encode(selections)); - if (product.productAttributes![index].required) { + if (product.productAttributes![index].required == true) { cloneSelections[product.productAttributes![index].name!.toUpperCase()] = [opt]; } else { if (cloneSelections.containsKey(product.productAttributes![index].name!.toUpperCase()) diff --git a/lib/widgets/mobile/mobile_attribute_selection.dart b/lib/widgets/mobile/mobile_attribute_selection.dart index 804cdd7..9cd560b 100644 --- a/lib/widgets/mobile/mobile_attribute_selection.dart +++ b/lib/widgets/mobile/mobile_attribute_selection.dart @@ -240,10 +240,10 @@ class MobileAttributeSelectionState extends State { Widget optionsView; ProductAttribute productAttribute = product.productAttributes![index]; - if (productAttribute.byQuantity) { + if (productAttribute.byQuantity == true) { optionsView = new QtyOptions(product: product, index: index, selections: selections); } else { - if (productAttribute.singleSelection) { + if (productAttribute.singleSelection == true) { optionsView = new RadioOptions(product: product, index: index, selections: selections); } else { optionsView = new CheckOptions(product: product, index: index, selections: selections); diff --git a/lib/widgets/mobile/mobile_checkout.dart b/lib/widgets/mobile/mobile_checkout.dart index 850ac29..8ffcf7c 100644 --- a/lib/widgets/mobile/mobile_checkout.dart +++ b/lib/widgets/mobile/mobile_checkout.dart @@ -341,7 +341,7 @@ class MobileCheckoutState extends State with SingleTickerProvide ); switch (position) { case 0: - if (cartInfo.businessInfo!.deliveryPickup) { + if (cartInfo.businessInfo!.deliveryPickup == true) { return Container( padding: EdgeInsets.only( top: 16.0, bottom: 16.0, left: 16.0, right: 16.0), @@ -583,7 +583,7 @@ class MobileCheckoutState extends State with SingleTickerProvide }, ); } - if (!cartInfo.businessInfo!.instanceDelivery) { + if (cartInfo.businessInfo!.instanceDelivery != true) { return Container( padding: EdgeInsets.only(left: 16.0, right: 16.0, top: 0.0, bottom: 16.0), child: Text(S.of(context).no_instance_delivery_desc), @@ -1074,7 +1074,7 @@ class MobileCheckoutState extends State with SingleTickerProvide shippingRates = (response.data['shipping_rates'] as List).map((e) => ShippingRate.fromJson(e)).toList(); selectedShippingRate = (response.data['selected_shipping_rate'] as String).length > 0 ? ShippingRate.fromJson(json.decode(response.data['selected_shipping_rate'])) : null; int i = 0; - if (cartInfo.businessInfo!.deliveryStoreDelivery) { + if (cartInfo.businessInfo!.deliveryStoreDelivery == true) { shippingMethodLabels.add(S.of(context).delivery); shippingMethodIcons.add(Icons.directions_car); if (deliveryMethod == 'store-delivery') { @@ -1082,7 +1082,7 @@ class MobileCheckoutState extends State with SingleTickerProvide } i++; } - if (cartInfo.businessInfo!.deliveryCanadaPost) { + if (cartInfo.businessInfo!.deliveryCanadaPost == true) { shippingMethodLabels.add(S.of(context).canada_post); shippingMethodIcons.add(Icons.local_shipping); if (deliveryMethod == 'canada-post') { @@ -1090,7 +1090,7 @@ class MobileCheckoutState extends State with SingleTickerProvide } i++; } - if (cartInfo.businessInfo!.deliveryPickup) { + if (cartInfo.businessInfo!.deliveryPickup == true) { shippingMethodLabels.add(S.of(context).pickup); shippingMethodIcons.add(Icons.store); if (deliveryMethod == 'pickup') { @@ -1555,7 +1555,7 @@ class MobileCheckoutState extends State with SingleTickerProvide } else { for (var i = 0; i < coupons.length; i++) { if (selectedCoupon == coupons[i].id) { - if (coupons[i].isPercentage) { + if (coupons[i].isPercentage == true) { return S.of(context).percentage_discount_token2(couponDiscountAmount.toStringAsFixed(2), coupons[i].valueAmount!); } else { return S.of(context).discount_amount_token(couponDiscountAmount.toStringAsFixed(2)); @@ -1889,7 +1889,7 @@ class MobileCheckoutState extends State with SingleTickerProvide mounted) { setState(() { selectedCoupon = coupon.id!; - if (coupon.isPercentage) { + if (coupon.isPercentage == true) { couponDiscountAmount = subtotal * coupon.valueAmount / 100.0; } else { couponDiscountAmount = coupon.valueAmount!; diff --git a/lib/widgets/mobile/mobile_view_ticket.dart b/lib/widgets/mobile/mobile_view_ticket.dart index 60698eb..dbca2b2 100644 --- a/lib/widgets/mobile/mobile_view_ticket.dart +++ b/lib/widgets/mobile/mobile_view_ticket.dart @@ -375,7 +375,7 @@ class MobileViewTicketState extends State { ); } - if (ticket.isClosed) { + if (ticket.isClosed == true) { view.children.add( Container( padding: EdgeInsets.symmetric(horizontal: 20.0, vertical: 20.0), diff --git a/lib/widgets/mobile/shop.dart b/lib/widgets/mobile/shop.dart index ff3b875..5740bfe 100644 --- a/lib/widgets/mobile/shop.dart +++ b/lib/widgets/mobile/shop.dart @@ -508,7 +508,7 @@ class ShopState extends State stack.children.addAll(children); - if (!_business.isPublic) { + if (_business.isPublic != true) { stack.children.add( Positioned( top: 0, @@ -1821,7 +1821,7 @@ class ShopState extends State return; } checkCloseFlag = true; - if (business.forceClose) { + if (business.forceClose == true) { showDialog( context: context, builder: (BuildContext context) {