phase3: precise nullable-condition fixes (if(x)->if(x==true), analyzer-driven). 399->379

This commit is contained in:
2026-07-26 10:46:26 +08:00
parent 97e4908126
commit 3ed58e1596
6 changed files with 20 additions and 20 deletions

View File

@@ -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!;