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

@@ -61,7 +61,7 @@ class AddRemoveButtonState extends State<AddRemoveButton> {
Widget build(BuildContext context) {
if (widget.product!.leftNum == null) {
_qty = 0;
cartInfo = Utils.getCartInfoByBusiness(store.state.cartInfos, widget.business!);
cartInfo = Utils.getCartInfoByBusiness(store.state.cartInfos, widget.business!)!;
if (cartInfo != null) {
for (var i = 0; i < cartInfo.productList!.length; i++) {
if (cartInfo.productList![i].product!.id == widget.product!.id
@@ -102,7 +102,7 @@ class AddRemoveButtonState extends State<AddRemoveButton> {
}
if (widget.addToBasket) {
_qty = 0;
cartInfo = Utils.getCartInfoByBusiness(store.state.cartInfos, widget.business!);
cartInfo = Utils.getCartInfoByBusiness(store.state.cartInfos, widget.business!)!;
if (cartInfo != null) {
for (var i = 0; i < cartInfo.productList!.length; i++) {
if (cartInfo.productList![i].product!.id == widget.product!.id) {
@@ -194,7 +194,7 @@ class AddRemoveButtonState extends State<AddRemoveButton> {
);
} else {
_qty = 0;
cartInfo = Utils.getCartInfoByBusiness(store.state.cartInfos, widget.business!);
cartInfo = Utils.getCartInfoByBusiness(store.state.cartInfos, widget.business!)!;
if (cartInfo != null) {
for (var i = 0; i < cartInfo.productList!.length; i++) {
if (cartInfo.productList![i].product!.id == widget.product!.id) {