phase3: improve arg-bang handler (allow ! in chains, ; terminator). 574->440

This commit is contained in:
2026-07-26 10:41:02 +08:00
parent 36f36b815f
commit 154d696e70
50 changed files with 138 additions and 138 deletions

View File

@@ -96,8 +96,8 @@ class MobileAttributeSelectionState extends State<MobileAttributeSelection> {
product = widget.product;
previousButtonEnable = false;
nextButtonEnable = false;
productDesc = product.description;
productPrice = product.price;
productDesc = product.description!;
productPrice = product.price!;
});
eventBus.on<OnAttributeSelectionsChanged>().listen((event) {

View File

@@ -96,7 +96,7 @@ class MobileBuyServiceState extends State<MobileBuyService> {
onChanged: (newValue) {
print('newValue $newValue');
setState(() {
selectedPlan = newValue;
selectedPlan = newValue!;
price = selectedPlan.value['price'];
tax = selectedPlan.value['price'] * selectedPlan.value['tax'];
paymentAmount = price + tax;

View File

@@ -256,7 +256,7 @@ class MobileChangeMobileOrEmailState extends State<MobileChangeMobileOrEmail> {
}
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: () {

View File

@@ -249,7 +249,7 @@ class MobileChangePasswordState extends State<MobileChangePassword> {
}
void resetPassword() {
final FormState form = _formKey.currentState;
final FormState form = _formKey.currentState!;
if (form.validate()) {
HttpUtil.httpPost('v1/users', (response) {
showDialog(

View File

@@ -308,7 +308,7 @@ class MobileCheckoutState extends State<MobileCheckout> with SingleTickerProvide
onChanged: (newValue) {
if (mounted) {
setState(() {
peopleCount = newValue;
peopleCount = newValue!;
});
}
},
@@ -389,7 +389,7 @@ class MobileCheckoutState extends State<MobileCheckout> 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<MobileCheckout> 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<MobileCheckout> 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<MobileCheckout> 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<MobileCheckout> 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();

View File

@@ -273,8 +273,8 @@ class MobileContactUsState extends State<MobileContactUs> {
_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<MobileContactUs> {
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,

View File

@@ -290,7 +290,7 @@ class MobileEditAddressState extends State<MobileEditAddress> {
onChanged: (newValue) {
if (mounted) {
setState(() {
_selectedProvince = newValue;
_selectedProvince = newValue!;
});
}
},
@@ -472,22 +472,22 @@ class MobileEditAddressState extends State<MobileEditAddress> {
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(() {

View File

@@ -239,7 +239,7 @@ class MobileForgotPasswordState extends State<MobileForgotPassword> {
}
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);

View File

@@ -226,7 +226,7 @@ class MobileLoginState extends State<MobileLogin> {
}
void signIn() {
final FormState form = _formKey.currentState;
final FormState form = _formKey.currentState!;
if (form.validate()) {
if (mounted) {
setState(() {

View File

@@ -784,7 +784,7 @@ class MobileMeState extends State<MobileMe> {
if (mounted) {
setState(() {
isLoading = false;
_user = store.state.user;
_user = store.state.user!;
});
}
});

View File

@@ -179,7 +179,7 @@ class MobileMySupportState extends State<MobileMySupport> {
children: <Widget>[
Container(
child: Text(
ticket.issue!.msg,
ticket.issue!.msg!,
style: TextStyle(
fontSize: 19.0,
),

View File

@@ -230,7 +230,7 @@ class MobileNewAddressState extends State<MobileNewAddress> {
onChanged: (newValue) {
if (mounted) {
setState(() {
_selectedProvince = newValue;
_selectedProvince = newValue!;
});
}
},
@@ -349,14 +349,14 @@ class MobileNewAddressState extends State<MobileNewAddress> {
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<MobileNewAddress> {
}
void _saveNewAddress() {
final FormState form = _formKey.currentState;
final FormState form = _formKey.currentState!;
if (form.validate()) {
HttpUtil.httpPost('v1/addresses', (response) {

View File

@@ -221,7 +221,7 @@ class MobileNewTicketState extends State<MobileNewTicket> {
}
void _submit() {
final FormState form = _formKey.currentState;
final FormState form = _formKey.currentState!;
if (form.validate()) {
setState(() {
onSubmitting = true;

View File

@@ -236,7 +236,7 @@ class MobileNewUserState extends State<MobileNewUser> {
}
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);

View File

@@ -123,7 +123,7 @@ class MobileOrderDetailState extends State<MobileOrderDetail> {
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<MobileOrderDetail> {
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<MobileOrderDetail> {
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<MobileOrderDetail> {
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(

View File

@@ -363,7 +363,7 @@ class MobileProductDetailPageState extends State<MobileProductDetailPage>
child: Container(
padding: EdgeInsets.only(left: 12, top: 5),
child: Text(
subproduct.product!.name,
subproduct.product!.name!,
style: TextStyle(
fontSize: 15.0,
),

View File

@@ -80,7 +80,7 @@ class MobileProductItemState extends State<MobileProductItem> {
),
),
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<MobileProductItem> {
textBaseline: TextBaseline.alphabetic,
children: <Widget>[
ShowPrice(
widget.product!.price,
widget.product!.price!,
regularPrice: widget.product!.regularPrice,
currencySign: '\$',
),

View File

@@ -212,7 +212,7 @@ class MobileResetPasswordState extends State<MobileResetPassword> {
}
void resetPassword() {
final FormState form = _formKey.currentState;
final FormState form = _formKey.currentState!;
if (form.validate()) {
HttpUtil.httpPost('v1/users', (response) {
showDialog(

View File

@@ -213,7 +213,7 @@ class MobileSetPasswordState extends State<MobileSetPassword> {
}
void resetPassword() {
final FormState form = _formKey.currentState;
final FormState form = _formKey.currentState!;
if (form.validate()) {
HttpUtil.httpPost('v1/users', (response) {
showDialog(

View File

@@ -315,7 +315,7 @@ class MobileUserProfileState extends State<MobileUserProfile> {
} 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<MobileUserProfile> {
eventBus.on<OnCurrentUserUpdated>().listen((event) {
if (mounted) {
setState(() {
_user = store.state.user;
_user = store.state.user!;
});
}
});
@@ -361,7 +361,7 @@ class MobileUserProfileState extends State<MobileUserProfile> {
final GlobalKey<FormState> _formKey = GlobalKey<FormState>();
final nicknameController = TextEditingController();
nicknameController.text = _user.nickname;
nicknameController.text = _user.nickname!;
showDialog(
context: context,
@@ -415,7 +415,7 @@ class MobileUserProfileState extends State<MobileUserProfile> {
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);

View File

@@ -141,7 +141,7 @@ class MobileViewTicketState extends State<MobileViewTicket> {
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<MobileViewTicket> {
}
void _submit() {
final FormState form = _formKey.currentState;
final FormState form = _formKey.currentState!;
if (form.validate()) {
setState(() {
onSubmitting = true;

View File

@@ -774,7 +774,7 @@ class ShopState extends State<Shop>
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<Shop>
', ' +
_business.address!.state +
', ' +
_business.address!.zip,
_business.address!.zip!,
style: new TextStyle(fontSize: 13.0, color: const Color(0xFFEEEEEE)),
));