fix(runtime): 同类 nullfix 脚本误加 ! 全库修复 - getCartInfoByBusiness 返回可空但末尾误加 !, 后接 if(x!=null) 判空. 影响: shopping_cart_bar/shopping_cart_widget/desktop_shopping_cart_widget(可空目标去!); shop_products/mobile shop(非空声明改 CartInfo?)
This commit is contained in:
@@ -1136,8 +1136,8 @@ class ShopState extends State<Shop>
|
||||
itemBuilder: (BuildContext context, int i) {
|
||||
CategoryProducts cp = _categoryProducts![i];
|
||||
int qtyInCategory = 0;
|
||||
CartInfo cartInfo =
|
||||
Utils.getCartInfoByBusiness(store.state.cartInfos, _business!)!;
|
||||
CartInfo? cartInfo =
|
||||
Utils.getCartInfoByBusiness(store.state.cartInfos, _business!);
|
||||
if (cartInfo != null &&
|
||||
cartInfo.businessInfo!.id == _business!.id &&
|
||||
cartInfo.productList != null) {
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user