phase3: nullfix arg-bang handler (argument_type/invalid_assignment). 872 -> 621

This commit is contained in:
2026-07-25 18:16:40 +08:00
parent c21ccbd54d
commit a76b872966
65 changed files with 282 additions and 257 deletions

View File

@@ -281,7 +281,7 @@ class MobileCheckoutState extends State<MobileCheckout> with SingleTickerProvide
mainAxisSize: MainAxisSize.min,
children: [
Text(
S.of(context).table_token(store.state.tableNumber),
S.of(context).table_token(store.state.tableNumber!),
style: TextStyle(
fontSize: 20.0,
fontWeight: FontWeight.bold,
@@ -333,7 +333,7 @@ class MobileCheckoutState extends State<MobileCheckout> with SingleTickerProvide
icons: shippingMethodIcons,
onToggle: (index) {
selectedShippingRate = null;
deliveryMethod = getShippingMethod(index);
deliveryMethod = getShippingMethod(index!);
check();
},
initialLabelIndex: deliveryMethodIndex,
@@ -627,7 +627,7 @@ class MobileCheckoutState extends State<MobileCheckout> with SingleTickerProvide
children: <Widget>[
Container(
child: Text(
bookingTimeList.length > 0 ? '${Utils.timestampToString(context, bookingTimeList[bookingTimeIndex].unixTime)}'
bookingTimeList.length > 0 ? '${Utils.timestampToString(context, bookingTimeList[bookingTimeIndex].unixTime!)}'
: ((bookingTimeList.length == 0 && bookingDateTimeList.length == 0) ? ''
: bookingDateTimeList[bookingDateIndex].viewDate! + ' ' + (bookingDateTimeList[bookingDateIndex].bookTimes!.length > 0 ? bookingDateTimeList[bookingDateIndex].bookTimes![bookingTimeIndex].viewTime : '')),
),
@@ -681,7 +681,7 @@ class MobileCheckoutState extends State<MobileCheckout> with SingleTickerProvide
children: <Widget>[
Container(
child: Text(
paymentPlatforms.length == 0 ? S.of(context).pay_on_deliery : PaymentPlatform.getPaymentPlatformName(context, paymentPlatforms[paymentPlatformIndex].code),
paymentPlatforms.length == 0 ? S.of(context).pay_on_deliery : PaymentPlatform.getPaymentPlatformName(context, paymentPlatforms[paymentPlatformIndex].code!),
),
),
Container(
@@ -988,14 +988,14 @@ class MobileCheckoutState extends State<MobileCheckout> with SingleTickerProvide
children: <Widget>[
Container(
child: Text(
Utils.knownName(context, cartLineItem.name),
Utils.knownName(context, cartLineItem.name!),
maxLines: 1,
overflow: TextOverflow.ellipsis,
),
),
Container(
child: Text(
cartLineItem.description,
cartLineItem.description!,
style: TextStyle(
fontSize: 12.0,
color: Colors.black38,
@@ -1155,7 +1155,7 @@ class MobileCheckoutState extends State<MobileCheckout> with SingleTickerProvide
column.children.add(Container(
padding: EdgeInsets.only(left: 0.0, right: 0.0, top: 10.0, bottom: 0.0),
child: Text(
Utils.errorMsg2(context, messages[i].code, messages[i].string),
Utils.errorMsg2(context, messages[i].code!, messages[i].string!),
),
));
}
@@ -1215,7 +1215,7 @@ class MobileCheckoutState extends State<MobileCheckout> with SingleTickerProvide
child: Container(
padding: EdgeInsets.only(left: 16.0, right: 16.0, bottom: 10.0, top: 10.0),
child: Text(
'${Utils.timestampToString(context, bookingTime.unixTime)}',
'${Utils.timestampToString(context, bookingTime.unixTime!)}',
),
decoration: BoxDecoration(
border: Border(
@@ -1290,7 +1290,7 @@ class MobileCheckoutState extends State<MobileCheckout> with SingleTickerProvide
padding: EdgeInsets.only(left: 10.0, right: 10.0, top: 10.0, bottom: 10.0),
child: Center(
child: Text(
'${bookingDateTime.viewDate} (${Utils.getWeekDayName(context, bookingDateTime.unixTime, true)})',
'${bookingDateTime.viewDate} (${Utils.getWeekDayName(context, bookingDateTime.unixTime!, true)})',
),
),
),
@@ -1494,7 +1494,7 @@ class MobileCheckoutState extends State<MobileCheckout> with SingleTickerProvide
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Container(
child: Util.showImage(paymentPlatform.icon,
child: Util.showImage(paymentPlatform.icon!,
errorWidget: (context, url, error) => Icon(Icons.broken_image, size: 50.0, color: Colors.transparent,),
fit: BoxFit.cover,
width: 50.0,
@@ -1504,7 +1504,7 @@ class MobileCheckoutState extends State<MobileCheckout> with SingleTickerProvide
Container(
margin: EdgeInsets.only(left: 10.0),
child: Text(
PaymentPlatform.getPaymentPlatformName(context, paymentPlatform.code),
PaymentPlatform.getPaymentPlatformName(context, paymentPlatform.code!),
style: TextStyle(
fontSize: 18.0,
fontWeight: FontWeight.bold,
@@ -1556,7 +1556,7 @@ class MobileCheckoutState extends State<MobileCheckout> with SingleTickerProvide
for (var i = 0; i < coupons.length; i++) {
if (selectedCoupon == coupons[i].id) {
if (coupons[i].isPercentage) {
return S.of(context).percentage_discount_token2(couponDiscountAmount.toStringAsFixed(2), coupons[i].valueAmount);
return S.of(context).percentage_discount_token2(couponDiscountAmount.toStringAsFixed(2), coupons[i].valueAmount!);
} else {
return S.of(context).discount_amount_token(couponDiscountAmount.toStringAsFixed(2));
}
@@ -1782,7 +1782,7 @@ class MobileCheckoutState extends State<MobileCheckout> with SingleTickerProvide
Container(
padding: EdgeInsets.only(right: 5.0),
child: Text(
'${Utils.smartRound(coupon.valueAmount, 2)}',
'${Utils.smartRound(coupon.valueAmount!, 2)}',
style: TextStyle(
fontSize: 30.0,
color: Colors.redAccent,
@@ -1818,7 +1818,7 @@ class MobileCheckoutState extends State<MobileCheckout> with SingleTickerProvide
),
Container(
child: Text(
'${Utils.smartRound(coupon.valueAmount, 2)}',
'${Utils.smartRound(coupon.valueAmount!, 2)}',
style: TextStyle(
fontSize: 30.0,
color: Colors.redAccent,
@@ -1846,7 +1846,7 @@ class MobileCheckoutState extends State<MobileCheckout> with SingleTickerProvide
child: Text(
coupon.expirationDate != null ?
S.of(context).expiration_date_token(
coupon.expirationDate) :
coupon.expirationDate!) :
S.of(context)
.no_expiration,
style: TextStyle(
@@ -1859,7 +1859,7 @@ class MobileCheckoutState extends State<MobileCheckout> with SingleTickerProvide
child: Text(
coupon.minAmount! > 0 ?
S.of(context).min_order_amount_token(
coupon.minAmount) :
coupon.minAmount!) :
S.of(context)
.no_restriction,
style: TextStyle(
@@ -2101,7 +2101,7 @@ class MobileCheckoutState extends State<MobileCheckout> with SingleTickerProvide
left: 16.0, top: 16.0, right: 16.0, bottom: 16.0),
child: Container(
child: Text(
shippingRate.name,
shippingRate.name!,
style: TextStyle(
fontSize: 20.0,
),