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

@@ -116,7 +116,7 @@ class DesktopBuyServiceState extends State<DesktopBuyService> {
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

@@ -319,7 +319,7 @@ class DesktopChangeMobileOrEmailState extends State<DesktopChangeMobileOrEmail>
}
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

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

View File

@@ -333,7 +333,7 @@ class DesktopCheckoutState extends State<DesktopCheckout> with SingleTickerProvi
onChanged: (newValue) {
if (mounted) {
setState(() {
peopleCount = newValue;
peopleCount = newValue!;
});
}
},
@@ -414,7 +414,7 @@ class DesktopCheckoutState extends State<DesktopCheckout> 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<DesktopCheckout> 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<DesktopCheckout> 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<DesktopCheckout> 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<DesktopCheckout> with SingleTickerProvi
if (coupon.isPercentage) {
couponDiscountAmount = subtotal * coupon.valueAmount / 100.0;
} else {
couponDiscountAmount = coupon.valueAmount;
couponDiscountAmount = coupon.valueAmount!;
}
});
panelController.close();

View File

@@ -287,8 +287,8 @@ class DesktopContactUsState extends State<DesktopContactUs> {
_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<DesktopContactUs> {
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

@@ -286,7 +286,7 @@ class DesktopEditAddressState extends State<DesktopEditAddress> {
onChanged: (newValue) {
if (mounted) {
setState(() {
_selectedProvince = newValue;
_selectedProvince = newValue!;
});
}
},
@@ -496,22 +496,22 @@ class DesktopEditAddressState extends State<DesktopEditAddress> {
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

@@ -298,7 +298,7 @@ class DesktopForgotPasswordState extends State<DesktopForgotPassword> {
}
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

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -295,7 +295,7 @@ class DesktopNewUserState extends State<DesktopNewUser> {
}
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

@@ -110,7 +110,7 @@ class DesktopOrderDetailState extends State<DesktopOrderDetail> {
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<DesktopOrderDetail> {
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<DesktopOrderDetail> {
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<DesktopOrderDetail> {
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

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

View File

@@ -91,7 +91,7 @@ class DesktopProductItemState extends State<DesktopProductItem> {
),
),
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<DesktopProductItem> {
) : 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<DesktopProductItem> {
),
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<DesktopProductItem> {
) : SizedBox.shrink(),
),
ShowPrice(
widget.product!.price,
widget.product!.price!,
regularPrice: widget.product!.regularPrice,
currencySign: '\$',
fontWeight: FontWeight.bold,

View File

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

View File

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

View File

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

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