phase3: precise nullable-condition fixes (if(x)->if(x==true), analyzer-driven). 399->379
This commit is contained in:
@@ -240,10 +240,10 @@ class MobileAttributeSelectionState extends State<MobileAttributeSelection> {
|
||||
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);
|
||||
|
||||
@@ -341,7 +341,7 @@ class MobileCheckoutState extends State<MobileCheckout> 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<MobileCheckout> 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<MobileCheckout> 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<MobileCheckout> 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<MobileCheckout> 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<MobileCheckout> 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<MobileCheckout> with SingleTickerProvide
|
||||
mounted) {
|
||||
setState(() {
|
||||
selectedCoupon = coupon.id!;
|
||||
if (coupon.isPercentage) {
|
||||
if (coupon.isPercentage == true) {
|
||||
couponDiscountAmount = subtotal * coupon.valueAmount / 100.0;
|
||||
} else {
|
||||
couponDiscountAmount = coupon.valueAmount!;
|
||||
|
||||
@@ -375,7 +375,7 @@ class MobileViewTicketState extends State<MobileViewTicket> {
|
||||
);
|
||||
}
|
||||
|
||||
if (ticket.isClosed) {
|
||||
if (ticket.isClosed == true) {
|
||||
view.children.add(
|
||||
Container(
|
||||
padding: EdgeInsets.symmetric(horizontal: 20.0, vertical: 20.0),
|
||||
|
||||
@@ -508,7 +508,7 @@ class ShopState extends State<Shop>
|
||||
|
||||
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<Shop>
|
||||
return;
|
||||
}
|
||||
checkCloseFlag = true;
|
||||
if (business.forceClose) {
|
||||
if (business.forceClose == true) {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (BuildContext context) {
|
||||
|
||||
Reference in New Issue
Block a user