From 3053246bb8a93a0eafec726e92fb6224a12b38fd Mon Sep 17 00:00:00 2001 From: peima Date: Fri, 31 Jul 2026 15:09:29 +0800 Subject: [PATCH] phase3: mobile/shop clean (categoryDescHeight double, FooterBuilder LoadStatus?, nullable fixes); edit_address .buttonColor->colorScheme.primary. 131->118 --- lib/widgets/desktop/desktop_edit_address.dart | 2 +- lib/widgets/mobile/mobile_edit_address.dart | 2 +- lib/widgets/mobile/shop.dart | 24 +++++++++---------- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/lib/widgets/desktop/desktop_edit_address.dart b/lib/widgets/desktop/desktop_edit_address.dart index 45a3eff..8c3f3d6 100644 --- a/lib/widgets/desktop/desktop_edit_address.dart +++ b/lib/widgets/desktop/desktop_edit_address.dart @@ -430,7 +430,7 @@ class DesktopEditAddressState extends State { padding: EdgeInsets.all(8.0), color: Theme .of(context) - .buttonColor, + .colorScheme.primary, child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ diff --git a/lib/widgets/mobile/mobile_edit_address.dart b/lib/widgets/mobile/mobile_edit_address.dart index 936edfe..d9e9160 100644 --- a/lib/widgets/mobile/mobile_edit_address.dart +++ b/lib/widgets/mobile/mobile_edit_address.dart @@ -406,7 +406,7 @@ class MobileEditAddressState extends State { padding: EdgeInsets.all(8.0), color: Theme .of(context) - .buttonColor, + .colorScheme.primary, child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ diff --git a/lib/widgets/mobile/shop.dart b/lib/widgets/mobile/shop.dart index e49b499..1240685 100644 --- a/lib/widgets/mobile/shop.dart +++ b/lib/widgets/mobile/shop.dart @@ -70,7 +70,7 @@ class ShopState extends State int _productCurrentPage = 1; static const num _categoryHeight = 50.0; - static const num _categoryDescHeight = 50.0; + static const double _categoryDescHeight = 50.0; static const num _productHeight = Constants.PRODUCT_ITEM_HEIGHT_H; int _categoryIndex = 0; @@ -409,7 +409,7 @@ class ShopState extends State ), ], title: Text( - _business != null ? _business.name : '', + _business != null ? _business.name! : '', style: TextStyle( color: Colors.white, ), @@ -725,7 +725,7 @@ class ShopState extends State enablePullDown: true, header: WaterDropHeader(), footer: CustomFooter( - builder: (BuildContext context, LoadStatus mode) { + builder: (BuildContext context, LoadStatus? mode) { Widget footer; if (mode == LoadStatus.idle) { footer = Text(S.of(context).pull_up_to_load_more); @@ -781,7 +781,7 @@ class ShopState extends State addressColumn.children.add(new Text( _business.address!.city! + ', ' + - _business.address!.state + + _business.address!.state! + ', ' + _business.address!.zip!, style: new TextStyle(fontSize: 13.0, color: const Color(0xFFEEEEEE)), @@ -801,7 +801,7 @@ class ShopState extends State )); distanceRow.children.add(new Text( _business.distanceInfo!.distance != null - ? _business.distanceInfo!.distance!.text + ? _business.distanceInfo!.distance!.text! : '***' + ' / ', style: new TextStyle(color: const Color(0xFFEEEEEE), fontSize: 13.0), )); @@ -912,7 +912,7 @@ class ShopState extends State new Text( _business.openingTime![0].openTime! + ':00 - ' + - _business.openingTime![0].closeTime + + _business.openingTime![0].closeTime! + ':00', style: new TextStyle( fontSize: 13.0, color: const Color(0xFFEEEEEE)), @@ -956,7 +956,7 @@ class ShopState extends State width: mediaQuery.size.width - 30.0, padding: EdgeInsets.only(right: 10.0, bottom: 10.0), child: new Text( - _business.bulletin!.isEmpty ? '' : _business.bulletin, + _business.bulletin!.isEmpty ? '' : _business.bulletin!, softWrap: true, style: new TextStyle( fontSize: 12.0, color: const Color(0xFFDDDDDD)), @@ -1137,7 +1137,7 @@ class ShopState extends State CategoryProducts cp = _categoryProducts[i]; int qtyInCategory = 0; CartInfo cartInfo = - Utils.getCartInfoByBusiness(store.state.cartInfos, _business); + Utils.getCartInfoByBusiness(store.state.cartInfos, _business)!; if (cartInfo != null && cartInfo.businessInfo!.id == _business.id && cartInfo.productList != null) { @@ -1245,7 +1245,7 @@ class ShopState extends State } } - CategoryProducts getCategoryProductByCategoryId(int cid) { + CategoryProducts? getCategoryProductByCategoryId(int cid) { for (CategoryProducts cp in _categoryProducts) { if (cp.id == cid) { return cp; @@ -1371,7 +1371,7 @@ class ShopState extends State children: [], ); col.children.add(new Container( - height: _categoryDescHeight!, + height: _categoryDescHeight, padding: new EdgeInsets.symmetric(horizontal: 10.0), color: new Color(0xFFF5F5F5), child: new Row( @@ -1629,7 +1629,7 @@ class ShopState extends State S.of(context).pull_up_to_load_more; } CategoryProducts currentCp = - getCategoryProductByCategoryId(categoryId); + getCategoryProductByCategoryId(categoryId)!; if (currentCp != null) { currentCp.products!.addAll(moreCategoryProducts[0].products!); } else { @@ -1843,7 +1843,7 @@ class ShopState extends State }); } else { DateTime now = DateTime.now(); - if (!(now.hour >= business.todayOpen && + if (!(now.hour >= business.todayOpen! && now.hour <= business.todayClose!)) { showDialog( context: context,