From 154d696e70cbc658bf032f0e552f96b8b3b5a983 Mon Sep 17 00:00:00 2001 From: peima Date: Sun, 26 Jul 2026 10:41:02 +0800 Subject: [PATCH] phase3: improve arg-bang handler (allow ! in chains, ; terminator). 574->440 --- lib/widgets/desktop/desktop_buy_service.dart | 2 +- .../desktop_change_mobile_or_email.dart | 2 +- .../desktop/desktop_change_password.dart | 2 +- lib/widgets/desktop/desktop_checkout.dart | 12 +++++----- lib/widgets/desktop/desktop_contact_us.dart | 8 +++---- lib/widgets/desktop/desktop_edit_address.dart | 24 +++++++++---------- .../desktop/desktop_forgot_password.dart | 2 +- lib/widgets/desktop/desktop_login.dart | 2 +- lib/widgets/desktop/desktop_me.dart | 2 +- lib/widgets/desktop/desktop_my_support.dart | 2 +- lib/widgets/desktop/desktop_new_address.dart | 12 +++++----- lib/widgets/desktop/desktop_new_ticket.dart | 2 +- lib/widgets/desktop/desktop_new_user.dart | 2 +- lib/widgets/desktop/desktop_order_detail.dart | 18 +++++++------- .../desktop/desktop_product_detail_page.dart | 2 +- lib/widgets/desktop/desktop_product_item.dart | 8 +++---- .../desktop/desktop_reset_password.dart | 2 +- lib/widgets/desktop/desktop_set_password.dart | 2 +- lib/widgets/desktop/desktop_user_profile.dart | 8 +++---- lib/widgets/desktop/desktop_view_ticket.dart | 4 ++-- lib/widgets/general/add_remove_button.dart | 4 ++-- .../general/attribute/check_options.dart | 2 +- .../general/attribute/qty_options.dart | 2 +- .../general/attribute/radio_options.dart | 4 ++-- .../general/parabolic_animation_widget.dart | 8 +++---- .../general/popup_animation_widget.dart | 4 ++-- lib/widgets/general/read_more_text.dart | 4 ++-- .../mobile/mobile_attribute_selection.dart | 4 ++-- lib/widgets/mobile/mobile_buy_service.dart | 2 +- .../mobile/mobile_change_mobile_or_email.dart | 2 +- .../mobile/mobile_change_password.dart | 2 +- lib/widgets/mobile/mobile_checkout.dart | 14 +++++------ lib/widgets/mobile/mobile_contact_us.dart | 8 +++---- lib/widgets/mobile/mobile_edit_address.dart | 24 +++++++++---------- .../mobile/mobile_forgot_password.dart | 2 +- lib/widgets/mobile/mobile_login.dart | 2 +- lib/widgets/mobile/mobile_me.dart | 2 +- lib/widgets/mobile/mobile_my_support.dart | 2 +- lib/widgets/mobile/mobile_new_address.dart | 12 +++++----- lib/widgets/mobile/mobile_new_ticket.dart | 2 +- lib/widgets/mobile/mobile_new_user.dart | 2 +- lib/widgets/mobile/mobile_order_detail.dart | 20 ++++++++-------- .../mobile/mobile_product_detail_page.dart | 2 +- lib/widgets/mobile/mobile_product_item.dart | 4 ++-- lib/widgets/mobile/mobile_reset_password.dart | 2 +- lib/widgets/mobile/mobile_set_password.dart | 2 +- lib/widgets/mobile/mobile_user_profile.dart | 8 +++---- lib/widgets/mobile/mobile_view_ticket.dart | 4 ++-- lib/widgets/mobile/shop.dart | 4 ++-- tools/nullfix.py | 4 ++-- 50 files changed, 138 insertions(+), 138 deletions(-) diff --git a/lib/widgets/desktop/desktop_buy_service.dart b/lib/widgets/desktop/desktop_buy_service.dart index 0d2b6c7..1848f44 100644 --- a/lib/widgets/desktop/desktop_buy_service.dart +++ b/lib/widgets/desktop/desktop_buy_service.dart @@ -116,7 +116,7 @@ class DesktopBuyServiceState extends State { onChanged: (newValue) { print('newValue $newValue'); setState(() { - selectedPlan = newValue; + selectedPlan = newValue!; price = selectedPlan.value['price']; tax = selectedPlan.value['price'] * selectedPlan.value['tax']; paymentAmount = price + tax; diff --git a/lib/widgets/desktop/desktop_change_mobile_or_email.dart b/lib/widgets/desktop/desktop_change_mobile_or_email.dart index 4d31a5c..0ad25b1 100644 --- a/lib/widgets/desktop/desktop_change_mobile_or_email.dart +++ b/lib/widgets/desktop/desktop_change_mobile_or_email.dart @@ -319,7 +319,7 @@ class DesktopChangeMobileOrEmailState extends State } void register() { - final FormState form = _formKey.currentState; + final FormState form = _formKey.currentState!; if (form.validate()) { HttpUtil.httpPost('v1/users', (response) { Utils.showMessageDialog(context, Exception(S.of(context).update_success), title: S.of(context).success, onOk: () { diff --git a/lib/widgets/desktop/desktop_change_password.dart b/lib/widgets/desktop/desktop_change_password.dart index 197821e..06f5a97 100644 --- a/lib/widgets/desktop/desktop_change_password.dart +++ b/lib/widgets/desktop/desktop_change_password.dart @@ -311,7 +311,7 @@ class DesktopChangePasswordState extends State { } void resetPassword() { - final FormState form = _formKey.currentState; + final FormState form = _formKey.currentState!; if (form.validate()) { HttpUtil.httpPost('v1/users', (response) { showDialog( diff --git a/lib/widgets/desktop/desktop_checkout.dart b/lib/widgets/desktop/desktop_checkout.dart index 7e52f87..13ee3ac 100644 --- a/lib/widgets/desktop/desktop_checkout.dart +++ b/lib/widgets/desktop/desktop_checkout.dart @@ -333,7 +333,7 @@ class DesktopCheckoutState extends State with SingleTickerProvi onChanged: (newValue) { if (mounted) { setState(() { - peopleCount = newValue; + peopleCount = newValue!; }); } }, @@ -414,7 +414,7 @@ class DesktopCheckoutState extends State with SingleTickerProvi Container( margin: EdgeInsets.only(top: 10.0), child: Text( - cartInfo!.businessInfo!.name, + cartInfo!.businessInfo!.name!, style: TextStyle( fontSize: 17.0, ), @@ -423,7 +423,7 @@ class DesktopCheckoutState extends State with SingleTickerProvi Container( margin: EdgeInsets.only(top: 5.0), child: Text( - cartInfo!.businessInfo!.address!.addressLine1, + cartInfo!.businessInfo!.address!.addressLine1!, style: TextStyle( fontSize: 14.0, color: Colors.black45, @@ -433,7 +433,7 @@ class DesktopCheckoutState extends State with SingleTickerProvi Container( child: cartInfo!.businessInfo!.address!.addressLine2 != null && cartInfo!.businessInfo!.address!.addressLine2!.length > 0 ? - Text(cartInfo!.businessInfo!.address!.addressLine2, + Text(cartInfo!.businessInfo!.address!.addressLine2!, style: TextStyle( fontSize: 14.0, color: Colors.black45, @@ -737,7 +737,7 @@ class DesktopCheckoutState extends State with SingleTickerProvi width: double.infinity, padding: EdgeInsets.only(bottom: 10.0), child: Text( - cartInfo!.businessInfo!.name, + cartInfo!.businessInfo!.name!, overflow: TextOverflow.ellipsis, style: TextStyle( fontSize: 16.0, @@ -1917,7 +1917,7 @@ class DesktopCheckoutState extends State with SingleTickerProvi if (coupon.isPercentage) { couponDiscountAmount = subtotal * coupon.valueAmount / 100.0; } else { - couponDiscountAmount = coupon.valueAmount; + couponDiscountAmount = coupon.valueAmount!; } }); panelController.close(); diff --git a/lib/widgets/desktop/desktop_contact_us.dart b/lib/widgets/desktop/desktop_contact_us.dart index 157b5f3..f0dee6d 100644 --- a/lib/widgets/desktop/desktop_contact_us.dart +++ b/lib/widgets/desktop/desktop_contact_us.dart @@ -287,8 +287,8 @@ class DesktopContactUsState extends State { _markers.clear(); _markers.add(Marker( markerId: MarkerId('shop_position'), - position: LatLng(double.parse(widget.business.address!.lat), - double.parse(widget.business.address!.lng)), + position: LatLng(double.parse(widget.business.address!.lat!), + double.parse(widget.business.address!.lng!)), infoWindow: InfoWindow( title: S .of(context) @@ -304,8 +304,8 @@ class DesktopContactUsState extends State { onMapCreated: _onMapCreated, initialCameraPosition: CameraPosition( target: LatLng( - double.parse(widget.business.address!.lat), - double.parse(widget.business.address!.lng)), + double.parse(widget.business.address!.lat!), + double.parse(widget.business.address!.lng!)), zoom: 14.0, ), onCameraMove: _onCameraMove, diff --git a/lib/widgets/desktop/desktop_edit_address.dart b/lib/widgets/desktop/desktop_edit_address.dart index eab0b42..45a3eff 100644 --- a/lib/widgets/desktop/desktop_edit_address.dart +++ b/lib/widgets/desktop/desktop_edit_address.dart @@ -286,7 +286,7 @@ class DesktopEditAddressState extends State { onChanged: (newValue) { if (mounted) { setState(() { - _selectedProvince = newValue; + _selectedProvince = newValue!; }); } }, @@ -496,22 +496,22 @@ class DesktopEditAddressState extends State { super.initState(); setState(() { showLoading = false; - _selectedProvince = widget.address.state; - cityController.text = widget.address.city; - postalCodeController.text = widget.address.zip; - streetLine1Controller.text = widget.address.addressLine1; - streetLine2Controller.text = widget.address.addressLine2; + _selectedProvince = widget.address.state!; + cityController.text = widget.address.city!; + postalCodeController.text = widget.address.zip!; + streetLine1Controller.text = widget.address.addressLine1!; + streetLine2Controller.text = widget.address.addressLine2!; _selectedGender = widget.address.gender == 1 ? Gender.Male : Gender.Female; - country = widget.address.country; - contactNameController.text = widget.address.contactName; - phoneController.text = widget.address.phone; - emailController.text = widget.address.email; - faxController.text = widget.address.fax; + country = widget.address.country!; + contactNameController.text = widget.address.contactName!; + phoneController.text = widget.address.phone!; + emailController.text = widget.address.email!; + faxController.text = widget.address.fax!; }); } void _saveEditAddress() { - final FormState form = _formKey.currentState; + final FormState form = _formKey.currentState!; if (form.validate()) { if (mounted) { setState(() { diff --git a/lib/widgets/desktop/desktop_forgot_password.dart b/lib/widgets/desktop/desktop_forgot_password.dart index b3f4817..4584d56 100644 --- a/lib/widgets/desktop/desktop_forgot_password.dart +++ b/lib/widgets/desktop/desktop_forgot_password.dart @@ -298,7 +298,7 @@ class DesktopForgotPasswordState extends State { } void register() { - final FormState form = _formKey.currentState; + final FormState form = _formKey.currentState!; if (form.validate()) { HttpUtil.httpPost('v1/users', (response) { Routes.router.navigateTo(context, '/reset-password/${usernameController.text.trim()}/${codeController.text.trim()}', replace: true); diff --git a/lib/widgets/desktop/desktop_login.dart b/lib/widgets/desktop/desktop_login.dart index 5c17d3e..f97c59f 100644 --- a/lib/widgets/desktop/desktop_login.dart +++ b/lib/widgets/desktop/desktop_login.dart @@ -286,7 +286,7 @@ class DesktopLoginState extends State { } void signIn() { - final FormState form = _formKey.currentState; + final FormState form = _formKey.currentState!; if (form.validate()) { if (mounted) { setState(() { diff --git a/lib/widgets/desktop/desktop_me.dart b/lib/widgets/desktop/desktop_me.dart index 19b6ea4..46ad599 100644 --- a/lib/widgets/desktop/desktop_me.dart +++ b/lib/widgets/desktop/desktop_me.dart @@ -432,7 +432,7 @@ class DesktopMeState extends State { if (mounted) { setState(() { isLoading = false; - _user = store.state.user; + _user = store.state.user!; }); } }); diff --git a/lib/widgets/desktop/desktop_my_support.dart b/lib/widgets/desktop/desktop_my_support.dart index b265130..b339680 100644 --- a/lib/widgets/desktop/desktop_my_support.dart +++ b/lib/widgets/desktop/desktop_my_support.dart @@ -218,7 +218,7 @@ class DesktopMySupportState extends State { children: [ Container( child: Text( - ticket.issue!.msg, + ticket.issue!.msg!, style: TextStyle( fontSize: 19.0, ), diff --git a/lib/widgets/desktop/desktop_new_address.dart b/lib/widgets/desktop/desktop_new_address.dart index b8d3311..1da8c11 100644 --- a/lib/widgets/desktop/desktop_new_address.dart +++ b/lib/widgets/desktop/desktop_new_address.dart @@ -231,7 +231,7 @@ class DesktopNewAddressState extends State { onChanged: (newValue) { if (mounted) { setState(() { - _selectedProvince = newValue; + _selectedProvince = newValue!; }); } }, @@ -378,14 +378,14 @@ class DesktopNewAddressState extends State { setState(() { if (widget.locatedAddress != null) { if (provinces.contains(widget.locatedAddress!.province)) { - _selectedProvince = widget.locatedAddress!.province; + _selectedProvince = widget.locatedAddress!.province!; } - cityController.text = widget.locatedAddress!.city; - postalCodeController.text = widget.locatedAddress!.postalCode; + cityController.text = widget.locatedAddress!.city!; + postalCodeController.text = widget.locatedAddress!.postalCode!; streetLine1Controller.text = (widget.locatedAddress!.streetNumber != null && widget.locatedAddress!.streetNumber!.isNotEmpty ? widget.locatedAddress!.streetNumber! + ' ' : '') - + widget.locatedAddress!.streetName; + + widget.locatedAddress!.streetName!; } else { _selectedProvince = 'Ontario'; } @@ -395,7 +395,7 @@ class DesktopNewAddressState extends State { } void _saveNewAddress() { - final FormState form = _formKey.currentState; + final FormState form = _formKey.currentState!; if (form.validate()) { HttpUtil.httpPost('v1/addresses', (response) { diff --git a/lib/widgets/desktop/desktop_new_ticket.dart b/lib/widgets/desktop/desktop_new_ticket.dart index 5f48239..56a3c66 100644 --- a/lib/widgets/desktop/desktop_new_ticket.dart +++ b/lib/widgets/desktop/desktop_new_ticket.dart @@ -429,7 +429,7 @@ class DesktopNewTicketState extends State { } void _submit() { - final FormState form = _formKey.currentState; + final FormState form = _formKey.currentState!; if (form.validate()) { setState(() { onSubmitting = true; diff --git a/lib/widgets/desktop/desktop_new_user.dart b/lib/widgets/desktop/desktop_new_user.dart index b11fca5..cf07ca3 100644 --- a/lib/widgets/desktop/desktop_new_user.dart +++ b/lib/widgets/desktop/desktop_new_user.dart @@ -295,7 +295,7 @@ class DesktopNewUserState extends State { } void register() { - final FormState form = _formKey.currentState; + final FormState form = _formKey.currentState!; if (form.validate()) { HttpUtil.httpPost('v1/users', (response) { Routes.router.navigateTo(context, '/set-password/${usernameController.text.trim()}/${codeController.text.trim()}', replace: true); diff --git a/lib/widgets/desktop/desktop_order_detail.dart b/lib/widgets/desktop/desktop_order_detail.dart index 0bd2807..f07d066 100644 --- a/lib/widgets/desktop/desktop_order_detail.dart +++ b/lib/widgets/desktop/desktop_order_detail.dart @@ -110,7 +110,7 @@ class DesktopOrderDetailState extends State { width: double.infinity, padding: EdgeInsets.only(top: 0.0, bottom: 16.0), child: Text( - order.cartInfo!.businessInfo!.name, + order.cartInfo!.businessInfo!.name!, maxLines: 1, overflow: TextOverflow.ellipsis, style: TextStyle( @@ -156,7 +156,7 @@ class DesktopOrderDetailState extends State { child: GoogleMap( onMapCreated: _onMapCreated, initialCameraPosition: CameraPosition( - target: new LatLng(double.parse(order.shippingAddress!.lat), double.parse(order.shippingAddress!.lng)), + target: new LatLng(double.parse(order.shippingAddress!.lat!), double.parse(order.shippingAddress!.lng!)!), zoom: 11.0, ), onCameraMove: _onCameraMove, @@ -173,8 +173,8 @@ class DesktopOrderDetailState extends State { margin: EdgeInsets.only(bottom: 6.0), child: Text( S.of(context).delivery_distance_token( - order.deliveryDistance!.distance!.text, - order.deliveryDistance!.duration!.text + order.deliveryDistance!.distance!.text!, + order.deliveryDistance!.duration!.text! ), ), decoration: BoxDecoration( @@ -1092,12 +1092,12 @@ class DesktopOrderDetailState extends State { if (!kIsWeb) { if (order.shippingMethod == 'store-delivery' && order.status != Constants.STATUS_COMPLETE && order.status != Constants.STATUS_CANCELLED) { - storeLatLng = LatLng(double.parse(order.businessInfo!.address!.lat), - double.parse(order.businessInfo!.address!.lng)); - customerLatLng = LatLng(double.parse(order.shippingAddress!.lat), - double.parse(order.shippingAddress!.lng)); + storeLatLng = LatLng(double.parse(order.businessInfo!.address!.lat!), + double.parse(order.businessInfo!.address!.lng!)); + customerLatLng = LatLng(double.parse(order.shippingAddress!.lat!), + double.parse(order.shippingAddress!.lng!)); deliveryLatLng = - LatLng(order.shipperPosition!.lat, order.shipperPosition!.lng); + LatLng(order.shipperPosition!.lat!, order.shipperPosition!.lng!); _polyLine.clear(); _polyLine.add( diff --git a/lib/widgets/desktop/desktop_product_detail_page.dart b/lib/widgets/desktop/desktop_product_detail_page.dart index 9924de7..b6eac17 100644 --- a/lib/widgets/desktop/desktop_product_detail_page.dart +++ b/lib/widgets/desktop/desktop_product_detail_page.dart @@ -366,7 +366,7 @@ class DesktopProductDetailPageState extends State child: Container( padding: EdgeInsets.only(left: 12, top: 5), child: Text( - subproduct.product!.name, + subproduct.product!.name!, style: TextStyle( fontSize: 15.0, ), diff --git a/lib/widgets/desktop/desktop_product_item.dart b/lib/widgets/desktop/desktop_product_item.dart index 561c986..fa6bada 100644 --- a/lib/widgets/desktop/desktop_product_item.dart +++ b/lib/widgets/desktop/desktop_product_item.dart @@ -91,7 +91,7 @@ class DesktopProductItemState extends State { ), ), Text( - widget.product!.description, + widget.product!.description!, // overflow: kIsWeb ? null : TextOverflow.ellipsis, overflow: TextOverflow.ellipsis, maxLines: 2, @@ -116,7 +116,7 @@ class DesktopProductItemState extends State { ) : SizedBox.shrink(), ), ShowPrice( - widget.product!.price, + widget.product!.price!, regularPrice: widget.product!.regularPrice, currencySign: '\$', fontWeight: FontWeight.bold, @@ -174,7 +174,7 @@ class DesktopProductItemState extends State { ), Container( child: Text( - widget.product!.description, + widget.product!.description!, // overflow: kIsWeb ? null : TextOverflow.ellipsis, overflow: TextOverflow.ellipsis, maxLines: 2, @@ -200,7 +200,7 @@ class DesktopProductItemState extends State { ) : SizedBox.shrink(), ), ShowPrice( - widget.product!.price, + widget.product!.price!, regularPrice: widget.product!.regularPrice, currencySign: '\$', fontWeight: FontWeight.bold, diff --git a/lib/widgets/desktop/desktop_reset_password.dart b/lib/widgets/desktop/desktop_reset_password.dart index 138ca1c..4bbaac2 100644 --- a/lib/widgets/desktop/desktop_reset_password.dart +++ b/lib/widgets/desktop/desktop_reset_password.dart @@ -268,7 +268,7 @@ class DesktopResetPasswordState extends State { void resetPassword() { - final FormState form = _formKey.currentState; + final FormState form = _formKey.currentState!; if (form.validate()) { HttpUtil.httpPost('v1/users', (response) { showDialog( diff --git a/lib/widgets/desktop/desktop_set_password.dart b/lib/widgets/desktop/desktop_set_password.dart index d9cdb4b..ee047a8 100644 --- a/lib/widgets/desktop/desktop_set_password.dart +++ b/lib/widgets/desktop/desktop_set_password.dart @@ -268,7 +268,7 @@ class DesktopSetPasswordState extends State { void resetPassword() { - final FormState form = _formKey.currentState; + final FormState form = _formKey.currentState!; if (form.validate()) { HttpUtil.httpPost('v1/users', (response) { showDialog( diff --git a/lib/widgets/desktop/desktop_user_profile.dart b/lib/widgets/desktop/desktop_user_profile.dart index 4f7d77f..b7f9b69 100644 --- a/lib/widgets/desktop/desktop_user_profile.dart +++ b/lib/widgets/desktop/desktop_user_profile.dart @@ -347,7 +347,7 @@ class DesktopUserProfileState extends State { } else { print(store.state.user.toString()); setState(() { - _user = store.state.user; + _user = store.state.user!; _showProgress = false; _progress = 0.0; }); @@ -355,7 +355,7 @@ class DesktopUserProfileState extends State { eventBus.on().listen((event) { if (mounted) { setState(() { - _user = store.state.user; + _user = store.state.user!; }); } }); @@ -393,7 +393,7 @@ class DesktopUserProfileState extends State { final GlobalKey _formKey = GlobalKey(); final nicknameController = TextEditingController(); - nicknameController.text = _user.nickname; + nicknameController.text = _user.nickname!; showDialog( context: context, @@ -447,7 +447,7 @@ class DesktopUserProfileState extends State { S.of(context).submit_to_change, ), onPressed: () { - final FormState form = _formKey.currentState; + final FormState form = _formKey.currentState!; if (form.validate()) { Utils.getBox().then((box) { int userId = box.get(Constants.KEY_USER_ID, defaultValue: 0); diff --git a/lib/widgets/desktop/desktop_view_ticket.dart b/lib/widgets/desktop/desktop_view_ticket.dart index be65d62..1b6b3f8 100644 --- a/lib/widgets/desktop/desktop_view_ticket.dart +++ b/lib/widgets/desktop/desktop_view_ticket.dart @@ -260,7 +260,7 @@ class DesktopViewTicketState extends State { padding: EdgeInsets.only(top: 16.0, bottom: 16.0, left: 16.0, right: 16.0), child: SingleChildScrollView( scrollDirection: Axis.horizontal, - child: showGalleryImages(mainContext, ticket.issue!.files), + child: showGalleryImages(mainContext, ticket.issue!.files!), ), decoration: BoxDecoration( border: Border( @@ -673,7 +673,7 @@ class DesktopViewTicketState extends State { } void _submit() { - final FormState form = _formKey.currentState; + final FormState form = _formKey.currentState!; if (form.validate()) { setState(() { onSubmitting = true; diff --git a/lib/widgets/general/add_remove_button.dart b/lib/widgets/general/add_remove_button.dart index 27e486a..eaf64b0 100644 --- a/lib/widgets/general/add_remove_button.dart +++ b/lib/widgets/general/add_remove_button.dart @@ -311,7 +311,7 @@ class AddRemoveButtonState extends State { void _addToCart(BuildContext context) { if (widget.cartLineItemIndex != -1) { - if (cartInfo.productList![widget.cartLineItemIndex].quantity! + 1.0 > widget.product!.leftNum) { + if (cartInfo.productList![widget.cartLineItemIndex].quantity! + 1.0 > widget.product!.leftNum!) { Fluttertoast.showToast( msg: S.of(context).product_insufficient, toastLength: Toast.LENGTH_SHORT, @@ -336,7 +336,7 @@ class AddRemoveButtonState extends State { ); } else { eventBus.fire(new OnProductWillAddToCart(widget.product!, {}, - widget.product!.price, widget.product!.description, + widget.product!.price!, widget.product!.description!, widget.business!, buttonKey: startKey)); } } diff --git a/lib/widgets/general/attribute/check_options.dart b/lib/widgets/general/attribute/check_options.dart index 2965d58..692f4e0 100644 --- a/lib/widgets/general/attribute/check_options.dart +++ b/lib/widgets/general/attribute/check_options.dart @@ -251,7 +251,7 @@ class CheckOptionsState extends OptionsBaseState { bool disabled = optDisabled; bool check = _checkOptionIsCheck(productOption.name!); - Map extraJson = Utils.stringToJson(productOption.extra!); + Map extraJson = Utils.stringToJson(productOption.extra!)!; // Utils.jsonPrettyPrint(extraJson); double extraAdjustAmount = 0.0; diff --git a/lib/widgets/general/attribute/qty_options.dart b/lib/widgets/general/attribute/qty_options.dart index c7e902b..4f7df10 100644 --- a/lib/widgets/general/attribute/qty_options.dart +++ b/lib/widgets/general/attribute/qty_options.dart @@ -259,7 +259,7 @@ class QtyOptionsState extends OptionsBaseState { bool disabled = optDisabled; bool check = _checkOptionIsCheck(productOption.name!); - Map extraJson = Utils.stringToJson(productOption.extra!); + Map extraJson = Utils.stringToJson(productOption.extra!)!; // Utils.jsonPrettyPrint(extraJson); double extraAdjustAmount = 0.0; diff --git a/lib/widgets/general/attribute/radio_options.dart b/lib/widgets/general/attribute/radio_options.dart index f5e5be6..d888c63 100644 --- a/lib/widgets/general/attribute/radio_options.dart +++ b/lib/widgets/general/attribute/radio_options.dart @@ -96,7 +96,7 @@ class RadioOptionsState extends OptionsBaseState { } } - Map extraJson = Utils.stringToJson(productOption.extra!); + Map extraJson = Utils.stringToJson(productOption.extra!)!; if (extraJson != null) { Map exclusiveRule = Rule.getRule( extraJson, Rule.RULE_EXCLUSIVE_SELECTION); @@ -163,7 +163,7 @@ class RadioOptionsState extends OptionsBaseState { bool disabled = optDisabled; bool check = _checkOptionIsCheck(productOption.name!); - Map extraJson = Utils.stringToJson(productOption.extra!); + Map extraJson = Utils.stringToJson(productOption.extra!)!; // Utils.jsonPrettyPrint(extraJson); double extraAdjustAmount = 0.0; diff --git a/lib/widgets/general/parabolic_animation_widget.dart b/lib/widgets/general/parabolic_animation_widget.dart index a2fa1f8..8ec0c1b 100644 --- a/lib/widgets/general/parabolic_animation_widget.dart +++ b/lib/widgets/general/parabolic_animation_widget.dart @@ -29,7 +29,7 @@ class ParabolicAnimationWidget extends AnimatedWidget { Widget build(BuildContext context) { _calPoints(); - final Animation animation = listenable; + final Animation animation = listenable!; final double time = animation.value; // 设time=1 已知两点坐标 和 初速度 可求出 加速度 a @@ -66,17 +66,17 @@ class ParabolicAnimationWidget extends AnimatedWidget { void _calPoints() { if (_startOffset == null) { - RenderBox stackBox = stackKey.currentContext!.findRenderObject(); + RenderBox stackBox = stackKey.currentContext!.findRenderObject()!; Offset stackBoxOffset = stackBox.globalToLocal(Offset.zero); EdgeInsets startMargin = _margin(startKey); - RenderBox startBox = startKey.currentContext!.findRenderObject(); + RenderBox startBox = startKey.currentContext!.findRenderObject()!; _startOffset = startBox.localToGlobal(Offset( startMargin.left + startAdjustOffset.dx, stackBoxOffset.dy + startMargin.top + startAdjustOffset.dy)); EdgeInsets endMargin = _margin(endKey); - RenderBox endBox = endKey.currentContext!.findRenderObject(); + RenderBox endBox = endKey.currentContext!.findRenderObject()!; _endOffset = endBox.localToGlobal(Offset( endMargin.left + endAdjustOffset.dx, stackBoxOffset.dy + endMargin.top + endAdjustOffset.dy)); diff --git a/lib/widgets/general/popup_animation_widget.dart b/lib/widgets/general/popup_animation_widget.dart index 8f3ab03..f70ba96 100644 --- a/lib/widgets/general/popup_animation_widget.dart +++ b/lib/widgets/general/popup_animation_widget.dart @@ -49,11 +49,11 @@ class PopupAnimationWidget extends AnimatedWidget { void _calAnimation() { if (_startOffset == null) { - final RenderBox stackBox = stackKey.currentContext!.findRenderObject(); + final RenderBox stackBox = stackKey.currentContext!.findRenderObject()!; final Offset stackBoxOffset = stackBox.globalToLocal(Offset.zero); final EdgeInsets startMargin = _margin(startKey); - final RenderBox startBox = startKey.currentContext!.findRenderObject(); + final RenderBox startBox = startKey.currentContext!.findRenderObject()!; _startOffset = startBox.localToGlobal(Offset( startMargin.left + popupOffset.dx, diff --git a/lib/widgets/general/read_more_text.dart b/lib/widgets/general/read_more_text.dart index 8e61396..5c3dc63 100644 --- a/lib/widgets/general/read_more_text.dart +++ b/lib/widgets/general/read_more_text.dart @@ -57,7 +57,7 @@ class ReadMoreTextState extends State { @override Widget build(BuildContext context) { final DefaultTextStyle defaultTextStyle = DefaultTextStyle.of(context); - TextStyle effectiveTextStyle = widget.style; + TextStyle effectiveTextStyle = widget.style!; if (widget.style == null || widget.style!.inherit) { effectiveTextStyle = defaultTextStyle.style.merge(widget.style); } @@ -122,7 +122,7 @@ class ReadMoreTextState extends State { textSize.width - linkSize.width, textSize.height, )); - endIndex = textPainter.getOffsetBefore(pos.offset); + endIndex = textPainter.getOffsetBefore(pos.offset)!; } else { var pos = textPainter.getPositionForOffset( diff --git a/lib/widgets/mobile/mobile_attribute_selection.dart b/lib/widgets/mobile/mobile_attribute_selection.dart index 1ebbef2..804cdd7 100644 --- a/lib/widgets/mobile/mobile_attribute_selection.dart +++ b/lib/widgets/mobile/mobile_attribute_selection.dart @@ -96,8 +96,8 @@ class MobileAttributeSelectionState extends State { product = widget.product; previousButtonEnable = false; nextButtonEnable = false; - productDesc = product.description; - productPrice = product.price; + productDesc = product.description!; + productPrice = product.price!; }); eventBus.on().listen((event) { diff --git a/lib/widgets/mobile/mobile_buy_service.dart b/lib/widgets/mobile/mobile_buy_service.dart index 143c203..43b56e1 100644 --- a/lib/widgets/mobile/mobile_buy_service.dart +++ b/lib/widgets/mobile/mobile_buy_service.dart @@ -96,7 +96,7 @@ class MobileBuyServiceState extends State { onChanged: (newValue) { print('newValue $newValue'); setState(() { - selectedPlan = newValue; + selectedPlan = newValue!; price = selectedPlan.value['price']; tax = selectedPlan.value['price'] * selectedPlan.value['tax']; paymentAmount = price + tax; diff --git a/lib/widgets/mobile/mobile_change_mobile_or_email.dart b/lib/widgets/mobile/mobile_change_mobile_or_email.dart index 893ec13..9a464c8 100644 --- a/lib/widgets/mobile/mobile_change_mobile_or_email.dart +++ b/lib/widgets/mobile/mobile_change_mobile_or_email.dart @@ -256,7 +256,7 @@ class MobileChangeMobileOrEmailState extends State { } void register() { - final FormState form = _formKey.currentState; + final FormState form = _formKey.currentState!; if (form.validate()) { HttpUtil.httpPost('v1/users', (response) { Utils.showMessageDialog(context, Exception(S.of(context).update_success), title: S.of(context).success, onOk: () { diff --git a/lib/widgets/mobile/mobile_change_password.dart b/lib/widgets/mobile/mobile_change_password.dart index 07881b4..d9c8538 100644 --- a/lib/widgets/mobile/mobile_change_password.dart +++ b/lib/widgets/mobile/mobile_change_password.dart @@ -249,7 +249,7 @@ class MobileChangePasswordState extends State { } void resetPassword() { - final FormState form = _formKey.currentState; + final FormState form = _formKey.currentState!; if (form.validate()) { HttpUtil.httpPost('v1/users', (response) { showDialog( diff --git a/lib/widgets/mobile/mobile_checkout.dart b/lib/widgets/mobile/mobile_checkout.dart index 6643edf..850ac29 100644 --- a/lib/widgets/mobile/mobile_checkout.dart +++ b/lib/widgets/mobile/mobile_checkout.dart @@ -308,7 +308,7 @@ class MobileCheckoutState extends State with SingleTickerProvide onChanged: (newValue) { if (mounted) { setState(() { - peopleCount = newValue; + peopleCount = newValue!; }); } }, @@ -389,7 +389,7 @@ class MobileCheckoutState extends State with SingleTickerProvide Container( margin: EdgeInsets.only(top: 10.0), child: Text( - cartInfo.businessInfo!.name, + cartInfo.businessInfo!.name!, style: TextStyle( fontSize: 17.0, ), @@ -398,7 +398,7 @@ class MobileCheckoutState extends State with SingleTickerProvide Container( margin: EdgeInsets.only(top: 5.0), child: Text( - cartInfo.businessInfo!.address!.addressLine1, + cartInfo.businessInfo!.address!.addressLine1!, style: TextStyle( fontSize: 14.0, color: Colors.black45, @@ -408,7 +408,7 @@ class MobileCheckoutState extends State with SingleTickerProvide Container( child: cartInfo.businessInfo!.address!.addressLine2 != null && cartInfo.businessInfo!.address!.addressLine2!.length > 0 ? - Text(cartInfo.businessInfo!.address!.addressLine2, + Text(cartInfo.businessInfo!.address!.addressLine2!, style: TextStyle( fontSize: 14.0, color: Colors.black45, @@ -712,7 +712,7 @@ class MobileCheckoutState extends State with SingleTickerProvide width: double.infinity, padding: EdgeInsets.only(bottom: 10.0), child: Text( - cartInfo.businessInfo!.name, + cartInfo.businessInfo!.name!, overflow: TextOverflow.ellipsis, style: TextStyle( fontSize: 16.0, @@ -1888,11 +1888,11 @@ class MobileCheckoutState extends State with SingleTickerProvide if (subtotal > coupon.minAmount && mounted) { setState(() { - selectedCoupon = coupon.id; + selectedCoupon = coupon.id!; if (coupon.isPercentage) { couponDiscountAmount = subtotal * coupon.valueAmount / 100.0; } else { - couponDiscountAmount = coupon.valueAmount; + couponDiscountAmount = coupon.valueAmount!; } }); panelController.close(); diff --git a/lib/widgets/mobile/mobile_contact_us.dart b/lib/widgets/mobile/mobile_contact_us.dart index 395cf73..76da91c 100644 --- a/lib/widgets/mobile/mobile_contact_us.dart +++ b/lib/widgets/mobile/mobile_contact_us.dart @@ -273,8 +273,8 @@ class MobileContactUsState extends State { _markers.clear(); _markers.add(Marker( markerId: MarkerId('shop_position'), - position: LatLng(double.parse(widget.business.address!.lat), - double.parse(widget.business.address!.lng)), + position: LatLng(double.parse(widget.business.address!.lat!), + double.parse(widget.business.address!.lng!)), infoWindow: InfoWindow( title: S .of(context) @@ -290,8 +290,8 @@ class MobileContactUsState extends State { onMapCreated: _onMapCreated, initialCameraPosition: CameraPosition( target: LatLng( - double.parse(widget.business.address!.lat), - double.parse(widget.business.address!.lng)), + double.parse(widget.business.address!.lat!), + double.parse(widget.business.address!.lng!)), zoom: 14.0, ), onCameraMove: _onCameraMove, diff --git a/lib/widgets/mobile/mobile_edit_address.dart b/lib/widgets/mobile/mobile_edit_address.dart index a46aed4..936edfe 100644 --- a/lib/widgets/mobile/mobile_edit_address.dart +++ b/lib/widgets/mobile/mobile_edit_address.dart @@ -290,7 +290,7 @@ class MobileEditAddressState extends State { onChanged: (newValue) { if (mounted) { setState(() { - _selectedProvince = newValue; + _selectedProvince = newValue!; }); } }, @@ -472,22 +472,22 @@ class MobileEditAddressState extends State { super.initState(); setState(() { showLoading = false; - _selectedProvince = widget.address.state; - cityController.text = widget.address.city; - postalCodeController.text = widget.address.zip; - streetLine1Controller.text = widget.address.addressLine1; - streetLine2Controller.text = widget.address.addressLine2; + _selectedProvince = widget.address.state!; + cityController.text = widget.address.city!; + postalCodeController.text = widget.address.zip!; + streetLine1Controller.text = widget.address.addressLine1!; + streetLine2Controller.text = widget.address.addressLine2!; _selectedGender = widget.address.gender == 1 ? Gender.Male : Gender.Female; - country = widget.address.country; - contactNameController.text = widget.address.contactName; - phoneController.text = widget.address.phone; - emailController.text = widget.address.email; - faxController.text = widget.address.fax; + country = widget.address.country!; + contactNameController.text = widget.address.contactName!; + phoneController.text = widget.address.phone!; + emailController.text = widget.address.email!; + faxController.text = widget.address.fax!; }); } void _saveEditAddress() { - final FormState form = _formKey.currentState; + final FormState form = _formKey.currentState!; if (form.validate()) { if (mounted) { setState(() { diff --git a/lib/widgets/mobile/mobile_forgot_password.dart b/lib/widgets/mobile/mobile_forgot_password.dart index db2f464..9817fc9 100644 --- a/lib/widgets/mobile/mobile_forgot_password.dart +++ b/lib/widgets/mobile/mobile_forgot_password.dart @@ -239,7 +239,7 @@ class MobileForgotPasswordState extends State { } void register() { - final FormState form = _formKey.currentState; + final FormState form = _formKey.currentState!; if (form.validate()) { HttpUtil.httpPost('v1/users', (response) { Routes.router.navigateTo(context, '/reset-password/${usernameController.text.trim()}/${codeController.text.trim()}', replace: true); diff --git a/lib/widgets/mobile/mobile_login.dart b/lib/widgets/mobile/mobile_login.dart index d95457d..142d4f5 100644 --- a/lib/widgets/mobile/mobile_login.dart +++ b/lib/widgets/mobile/mobile_login.dart @@ -226,7 +226,7 @@ class MobileLoginState extends State { } void signIn() { - final FormState form = _formKey.currentState; + final FormState form = _formKey.currentState!; if (form.validate()) { if (mounted) { setState(() { diff --git a/lib/widgets/mobile/mobile_me.dart b/lib/widgets/mobile/mobile_me.dart index e035d1c..8d32b94 100644 --- a/lib/widgets/mobile/mobile_me.dart +++ b/lib/widgets/mobile/mobile_me.dart @@ -784,7 +784,7 @@ class MobileMeState extends State { if (mounted) { setState(() { isLoading = false; - _user = store.state.user; + _user = store.state.user!; }); } }); diff --git a/lib/widgets/mobile/mobile_my_support.dart b/lib/widgets/mobile/mobile_my_support.dart index b7ef111..3962fbf 100644 --- a/lib/widgets/mobile/mobile_my_support.dart +++ b/lib/widgets/mobile/mobile_my_support.dart @@ -179,7 +179,7 @@ class MobileMySupportState extends State { children: [ Container( child: Text( - ticket.issue!.msg, + ticket.issue!.msg!, style: TextStyle( fontSize: 19.0, ), diff --git a/lib/widgets/mobile/mobile_new_address.dart b/lib/widgets/mobile/mobile_new_address.dart index dd19728..1d8dd11 100644 --- a/lib/widgets/mobile/mobile_new_address.dart +++ b/lib/widgets/mobile/mobile_new_address.dart @@ -230,7 +230,7 @@ class MobileNewAddressState extends State { onChanged: (newValue) { if (mounted) { setState(() { - _selectedProvince = newValue; + _selectedProvince = newValue!; }); } }, @@ -349,14 +349,14 @@ class MobileNewAddressState extends State { setState(() { if (widget.locatedAddress != null) { if (provinces.contains(widget.locatedAddress!.province)) { - _selectedProvince = widget.locatedAddress!.province; + _selectedProvince = widget.locatedAddress!.province!; } - cityController.text = widget.locatedAddress!.city; - postalCodeController.text = widget.locatedAddress!.postalCode; + cityController.text = widget.locatedAddress!.city!; + postalCodeController.text = widget.locatedAddress!.postalCode!; streetLine1Controller.text = (widget.locatedAddress!.streetNumber != null && widget.locatedAddress!.streetNumber!.isNotEmpty ? widget.locatedAddress!.streetNumber! + ' ' : '') - + widget.locatedAddress!.streetName; + + widget.locatedAddress!.streetName!; } else { _selectedProvince = 'Ontario'; } @@ -366,7 +366,7 @@ class MobileNewAddressState extends State { } void _saveNewAddress() { - final FormState form = _formKey.currentState; + final FormState form = _formKey.currentState!; if (form.validate()) { HttpUtil.httpPost('v1/addresses', (response) { diff --git a/lib/widgets/mobile/mobile_new_ticket.dart b/lib/widgets/mobile/mobile_new_ticket.dart index cccb9e8..27354f6 100644 --- a/lib/widgets/mobile/mobile_new_ticket.dart +++ b/lib/widgets/mobile/mobile_new_ticket.dart @@ -221,7 +221,7 @@ class MobileNewTicketState extends State { } void _submit() { - final FormState form = _formKey.currentState; + final FormState form = _formKey.currentState!; if (form.validate()) { setState(() { onSubmitting = true; diff --git a/lib/widgets/mobile/mobile_new_user.dart b/lib/widgets/mobile/mobile_new_user.dart index 4d0c68b..278355f 100644 --- a/lib/widgets/mobile/mobile_new_user.dart +++ b/lib/widgets/mobile/mobile_new_user.dart @@ -236,7 +236,7 @@ class MobileNewUserState extends State { } void register() { - final FormState form = _formKey.currentState; + final FormState form = _formKey.currentState!; if (form.validate()) { HttpUtil.httpPost('v1/users', (response) { Routes.router.navigateTo(context, '/set-password/${usernameController.text.trim()}/${codeController.text.trim()}', replace: true); diff --git a/lib/widgets/mobile/mobile_order_detail.dart b/lib/widgets/mobile/mobile_order_detail.dart index 8e88b7f..dab1eb2 100644 --- a/lib/widgets/mobile/mobile_order_detail.dart +++ b/lib/widgets/mobile/mobile_order_detail.dart @@ -123,7 +123,7 @@ class MobileOrderDetailState extends State { width: double.infinity, padding: EdgeInsets.only(top: 0.0, bottom: 16.0), child: Text( - order.cartInfo!.businessInfo!.name, + order.cartInfo!.businessInfo!.name!, maxLines: 1, overflow: TextOverflow.ellipsis, style: TextStyle( @@ -170,8 +170,8 @@ class MobileOrderDetailState extends State { onMapCreated: _onMapCreated, initialCameraPosition: CameraPosition( target: LatLng( - double.parse(order.shippingAddress!.lat), - double.parse(order.shippingAddress!.lng)), + double.parse(order.shippingAddress!.lat!), + double.parse(order.shippingAddress!.lng!)), zoom: 11.0, ), onCameraMove: _onCameraMove, @@ -188,8 +188,8 @@ class MobileOrderDetailState extends State { margin: EdgeInsets.only(bottom: 6.0), child: Text( S.of(context).delivery_distance_token( - order.deliveryDistance!.distance!.text, - order.deliveryDistance!.duration!.text + order.deliveryDistance!.distance!.text!, + order.deliveryDistance!.duration!.text! ), ), decoration: BoxDecoration( @@ -1060,12 +1060,12 @@ class MobileOrderDetailState extends State { if (!kIsWeb) { if (order.shippingMethod == 'store-delivery' && order.status != Constants.STATUS_COMPLETE && order.status != Constants.STATUS_CANCELLED) { - storeLatLng = LatLng(double.parse(order.businessInfo!.address!.lat), - double.parse(order.businessInfo!.address!.lng)); - customerLatLng = LatLng(double.parse(order.shippingAddress!.lat), - double.parse(order.shippingAddress!.lng)); + storeLatLng = LatLng(double.parse(order.businessInfo!.address!.lat!), + double.parse(order.businessInfo!.address!.lng!)); + customerLatLng = LatLng(double.parse(order.shippingAddress!.lat!), + double.parse(order.shippingAddress!.lng!)); deliveryLatLng = - LatLng(order.shipperPosition!.lat, order.shipperPosition!.lng); + LatLng(order.shipperPosition!.lat!, order.shipperPosition!.lng!); _polyLine.clear(); _polyLine.add( diff --git a/lib/widgets/mobile/mobile_product_detail_page.dart b/lib/widgets/mobile/mobile_product_detail_page.dart index e9dd65e..2d0dbb5 100644 --- a/lib/widgets/mobile/mobile_product_detail_page.dart +++ b/lib/widgets/mobile/mobile_product_detail_page.dart @@ -363,7 +363,7 @@ class MobileProductDetailPageState extends State child: Container( padding: EdgeInsets.only(left: 12, top: 5), child: Text( - subproduct.product!.name, + subproduct.product!.name!, style: TextStyle( fontSize: 15.0, ), diff --git a/lib/widgets/mobile/mobile_product_item.dart b/lib/widgets/mobile/mobile_product_item.dart index 0bf2479..8f5d695 100644 --- a/lib/widgets/mobile/mobile_product_item.dart +++ b/lib/widgets/mobile/mobile_product_item.dart @@ -80,7 +80,7 @@ class MobileProductItemState extends State { ), ), new Text( - widget.product!.description, + widget.product!.description!, // overflow: kIsWeb ? null : TextOverflow.ellipsis, overflow: TextOverflow.ellipsis, maxLines: 2, @@ -110,7 +110,7 @@ class MobileProductItemState extends State { textBaseline: TextBaseline.alphabetic, children: [ ShowPrice( - widget.product!.price, + widget.product!.price!, regularPrice: widget.product!.regularPrice, currencySign: '\$', ), diff --git a/lib/widgets/mobile/mobile_reset_password.dart b/lib/widgets/mobile/mobile_reset_password.dart index 8d53b32..e8bbcff 100644 --- a/lib/widgets/mobile/mobile_reset_password.dart +++ b/lib/widgets/mobile/mobile_reset_password.dart @@ -212,7 +212,7 @@ class MobileResetPasswordState extends State { } void resetPassword() { - final FormState form = _formKey.currentState; + final FormState form = _formKey.currentState!; if (form.validate()) { HttpUtil.httpPost('v1/users', (response) { showDialog( diff --git a/lib/widgets/mobile/mobile_set_password.dart b/lib/widgets/mobile/mobile_set_password.dart index d2c4ab2..21a00b1 100644 --- a/lib/widgets/mobile/mobile_set_password.dart +++ b/lib/widgets/mobile/mobile_set_password.dart @@ -213,7 +213,7 @@ class MobileSetPasswordState extends State { } void resetPassword() { - final FormState form = _formKey.currentState; + final FormState form = _formKey.currentState!; if (form.validate()) { HttpUtil.httpPost('v1/users', (response) { showDialog( diff --git a/lib/widgets/mobile/mobile_user_profile.dart b/lib/widgets/mobile/mobile_user_profile.dart index d922956..ea542c7 100644 --- a/lib/widgets/mobile/mobile_user_profile.dart +++ b/lib/widgets/mobile/mobile_user_profile.dart @@ -315,7 +315,7 @@ class MobileUserProfileState extends State { } else { print(store.state.user.toString()); setState(() { - _user = store.state.user; + _user = store.state.user!; _showProgress = false; _progress = 0.0; }); @@ -323,7 +323,7 @@ class MobileUserProfileState extends State { eventBus.on().listen((event) { if (mounted) { setState(() { - _user = store.state.user; + _user = store.state.user!; }); } }); @@ -361,7 +361,7 @@ class MobileUserProfileState extends State { final GlobalKey _formKey = GlobalKey(); final nicknameController = TextEditingController(); - nicknameController.text = _user.nickname; + nicknameController.text = _user.nickname!; showDialog( context: context, @@ -415,7 +415,7 @@ class MobileUserProfileState extends State { S.of(context).submit_to_change, ), onPressed: () { - final FormState form = _formKey.currentState; + final FormState form = _formKey.currentState!; if (form.validate()) { Utils.getBox().then((box) { int userId = box.get(Constants.KEY_USER_ID, defaultValue: 0); diff --git a/lib/widgets/mobile/mobile_view_ticket.dart b/lib/widgets/mobile/mobile_view_ticket.dart index 348ebe1..60698eb 100644 --- a/lib/widgets/mobile/mobile_view_ticket.dart +++ b/lib/widgets/mobile/mobile_view_ticket.dart @@ -141,7 +141,7 @@ class MobileViewTicketState extends State { Container( width: double.maxFinite, padding: EdgeInsets.only(top: 16.0, bottom: 16.0, left: 16.0, right: 16.0), - child: showGalleryImages(mainContext, ticket.issue!.files), + child: showGalleryImages(mainContext, ticket.issue!.files!), decoration: BoxDecoration( border: Border( bottom: BorderSide( @@ -670,7 +670,7 @@ class MobileViewTicketState extends State { } void _submit() { - final FormState form = _formKey.currentState; + final FormState form = _formKey.currentState!; if (form.validate()) { setState(() { onSubmitting = true; diff --git a/lib/widgets/mobile/shop.dart b/lib/widgets/mobile/shop.dart index f3e3c68..ff3b875 100644 --- a/lib/widgets/mobile/shop.dart +++ b/lib/widgets/mobile/shop.dart @@ -774,7 +774,7 @@ class ShopState extends State addressColumn.children.add(new Text( _business.address!.addressLine1! + (_business.address!.addressLine2!.isNotEmpty - ? ' ' + _business.address!.addressLine2 + ? ' ' + _business.address!.addressLine2! : ''), style: new TextStyle(fontSize: 13.0, color: const Color(0xFFEEEEEE)), )); @@ -783,7 +783,7 @@ class ShopState extends State ', ' + _business.address!.state + ', ' + - _business.address!.zip, + _business.address!.zip!, style: new TextStyle(fontSize: 13.0, color: const Color(0xFFEEEEEE)), )); diff --git a/tools/nullfix.py b/tools/nullfix.py index 474715a..d2250a6 100644 --- a/tools/nullfix.py +++ b/tools/nullfix.py @@ -121,7 +121,7 @@ def insert_arg_bang(line, col0): elif ch in ')]}': if depth==0: end=i; break depth-=1 - elif ch==',' and depth==0: end=i; break + elif ch in ',;}' and depth==0: end=i; break if end is None: end=len(line) # 值的实际末尾(跳过空白) j=end-1 @@ -132,7 +132,7 @@ def insert_arg_bang(line, col0): if not val: return None if val[0] in '0123456789"\'': return None # 字面量跳过 if val in ('true','false','null'): return None - if not re.fullmatch(r'[\w.\[\]()]+', val): return None # 含运算符等跳过 + if not re.fullmatch(r'[\w.\[\()!]+', val): return None # 含运算符/空格跳过 return line[:j+1]+'!'+line[j+1:] def make_field_nullable(lines, name):