phase3: nullable fields/methods, casts, ?.call, pinput/YoutubePlayer v5, buttonColor, dead-code removal. 72->16

This commit is contained in:
2026-08-01 01:21:37 +08:00
parent 137eca4c69
commit 7c69197396
39 changed files with 107 additions and 113 deletions

View File

@@ -41,7 +41,7 @@ class ShoppingCartBarState extends State<ShoppingCartBar> {
@override
Widget build(BuildContext context) {
totalPrice = 0.0;
cartInfo = Utils.getCartInfoByBusiness(store.state.cartInfos, widget.business);
cartInfo = Utils.getCartInfoByBusiness(store.state.cartInfos, widget.business)!;
if (cartInfo != null && cartInfo.businessInfo!.id == widget.business.id) {
totalPrice = cartInfo.getTotalPrice();
}
@@ -86,7 +86,7 @@ class ShoppingCartBarState extends State<ShoppingCartBar> {
onTap: () {
Utils.clearCart(context, cartInfo, onComplete: (_) {
if (widget.onEmptyCartListener != null) {
widget.onEmptyCartListener();
widget.onEmptyCartListener?.call();
}
});
},
@@ -198,7 +198,7 @@ class ShoppingCartBarState extends State<ShoppingCartBar> {
),
onTap: () {
if (widget.onPanelOpenCloseRequest != null) {
widget.onPanelOpenCloseRequest();
widget.onPanelOpenCloseRequest?.call();
}
},
),