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) { onChanged: (newValue) {
print('newValue $newValue'); print('newValue $newValue');
setState(() { setState(() {
selectedPlan = newValue; selectedPlan = newValue!;
price = selectedPlan.value['price']; price = selectedPlan.value['price'];
tax = selectedPlan.value['price'] * selectedPlan.value['tax']; tax = selectedPlan.value['price'] * selectedPlan.value['tax'];
paymentAmount = price + tax; paymentAmount = price + tax;

View File

@@ -319,7 +319,7 @@ class DesktopChangeMobileOrEmailState extends State<DesktopChangeMobileOrEmail>
} }
void register() { void register() {
final FormState form = _formKey.currentState; final FormState form = _formKey.currentState!;
if (form.validate()) { if (form.validate()) {
HttpUtil.httpPost('v1/users', (response) { HttpUtil.httpPost('v1/users', (response) {
Utils.showMessageDialog(context, Exception(S.of(context).update_success), title: S.of(context).success, onOk: () { 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() { void resetPassword() {
final FormState form = _formKey.currentState; final FormState form = _formKey.currentState!;
if (form.validate()) { if (form.validate()) {
HttpUtil.httpPost('v1/users', (response) { HttpUtil.httpPost('v1/users', (response) {
showDialog( showDialog(

View File

@@ -333,7 +333,7 @@ class DesktopCheckoutState extends State<DesktopCheckout> with SingleTickerProvi
onChanged: (newValue) { onChanged: (newValue) {
if (mounted) { if (mounted) {
setState(() { setState(() {
peopleCount = newValue; peopleCount = newValue!;
}); });
} }
}, },
@@ -414,7 +414,7 @@ class DesktopCheckoutState extends State<DesktopCheckout> with SingleTickerProvi
Container( Container(
margin: EdgeInsets.only(top: 10.0), margin: EdgeInsets.only(top: 10.0),
child: Text( child: Text(
cartInfo!.businessInfo!.name, cartInfo!.businessInfo!.name!,
style: TextStyle( style: TextStyle(
fontSize: 17.0, fontSize: 17.0,
), ),
@@ -423,7 +423,7 @@ class DesktopCheckoutState extends State<DesktopCheckout> with SingleTickerProvi
Container( Container(
margin: EdgeInsets.only(top: 5.0), margin: EdgeInsets.only(top: 5.0),
child: Text( child: Text(
cartInfo!.businessInfo!.address!.addressLine1, cartInfo!.businessInfo!.address!.addressLine1!,
style: TextStyle( style: TextStyle(
fontSize: 14.0, fontSize: 14.0,
color: Colors.black45, color: Colors.black45,
@@ -433,7 +433,7 @@ class DesktopCheckoutState extends State<DesktopCheckout> with SingleTickerProvi
Container( Container(
child: cartInfo!.businessInfo!.address!.addressLine2 != null child: cartInfo!.businessInfo!.address!.addressLine2 != null
&& cartInfo!.businessInfo!.address!.addressLine2!.length > 0 ? && cartInfo!.businessInfo!.address!.addressLine2!.length > 0 ?
Text(cartInfo!.businessInfo!.address!.addressLine2, Text(cartInfo!.businessInfo!.address!.addressLine2!,
style: TextStyle( style: TextStyle(
fontSize: 14.0, fontSize: 14.0,
color: Colors.black45, color: Colors.black45,
@@ -737,7 +737,7 @@ class DesktopCheckoutState extends State<DesktopCheckout> with SingleTickerProvi
width: double.infinity, width: double.infinity,
padding: EdgeInsets.only(bottom: 10.0), padding: EdgeInsets.only(bottom: 10.0),
child: Text( child: Text(
cartInfo!.businessInfo!.name, cartInfo!.businessInfo!.name!,
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
style: TextStyle( style: TextStyle(
fontSize: 16.0, fontSize: 16.0,
@@ -1917,7 +1917,7 @@ class DesktopCheckoutState extends State<DesktopCheckout> with SingleTickerProvi
if (coupon.isPercentage) { if (coupon.isPercentage) {
couponDiscountAmount = subtotal * coupon.valueAmount / 100.0; couponDiscountAmount = subtotal * coupon.valueAmount / 100.0;
} else { } else {
couponDiscountAmount = coupon.valueAmount; couponDiscountAmount = coupon.valueAmount!;
} }
}); });
panelController.close(); panelController.close();

View File

@@ -287,8 +287,8 @@ class DesktopContactUsState extends State<DesktopContactUs> {
_markers.clear(); _markers.clear();
_markers.add(Marker( _markers.add(Marker(
markerId: MarkerId('shop_position'), markerId: MarkerId('shop_position'),
position: LatLng(double.parse(widget.business.address!.lat), position: LatLng(double.parse(widget.business.address!.lat!),
double.parse(widget.business.address!.lng)), double.parse(widget.business.address!.lng!)),
infoWindow: InfoWindow( infoWindow: InfoWindow(
title: S title: S
.of(context) .of(context)
@@ -304,8 +304,8 @@ class DesktopContactUsState extends State<DesktopContactUs> {
onMapCreated: _onMapCreated, onMapCreated: _onMapCreated,
initialCameraPosition: CameraPosition( initialCameraPosition: CameraPosition(
target: LatLng( target: LatLng(
double.parse(widget.business.address!.lat), double.parse(widget.business.address!.lat!),
double.parse(widget.business.address!.lng)), double.parse(widget.business.address!.lng!)),
zoom: 14.0, zoom: 14.0,
), ),
onCameraMove: _onCameraMove, onCameraMove: _onCameraMove,

View File

@@ -286,7 +286,7 @@ class DesktopEditAddressState extends State<DesktopEditAddress> {
onChanged: (newValue) { onChanged: (newValue) {
if (mounted) { if (mounted) {
setState(() { setState(() {
_selectedProvince = newValue; _selectedProvince = newValue!;
}); });
} }
}, },
@@ -496,22 +496,22 @@ class DesktopEditAddressState extends State<DesktopEditAddress> {
super.initState(); super.initState();
setState(() { setState(() {
showLoading = false; showLoading = false;
_selectedProvince = widget.address.state; _selectedProvince = widget.address.state!;
cityController.text = widget.address.city; cityController.text = widget.address.city!;
postalCodeController.text = widget.address.zip; postalCodeController.text = widget.address.zip!;
streetLine1Controller.text = widget.address.addressLine1; streetLine1Controller.text = widget.address.addressLine1!;
streetLine2Controller.text = widget.address.addressLine2; streetLine2Controller.text = widget.address.addressLine2!;
_selectedGender = widget.address.gender == 1 ? Gender.Male : Gender.Female; _selectedGender = widget.address.gender == 1 ? Gender.Male : Gender.Female;
country = widget.address.country; country = widget.address.country!;
contactNameController.text = widget.address.contactName; contactNameController.text = widget.address.contactName!;
phoneController.text = widget.address.phone; phoneController.text = widget.address.phone!;
emailController.text = widget.address.email; emailController.text = widget.address.email!;
faxController.text = widget.address.fax; faxController.text = widget.address.fax!;
}); });
} }
void _saveEditAddress() { void _saveEditAddress() {
final FormState form = _formKey.currentState; final FormState form = _formKey.currentState!;
if (form.validate()) { if (form.validate()) {
if (mounted) { if (mounted) {
setState(() { setState(() {

View File

@@ -298,7 +298,7 @@ class DesktopForgotPasswordState extends State<DesktopForgotPassword> {
} }
void register() { void register() {
final FormState form = _formKey.currentState; final FormState form = _formKey.currentState!;
if (form.validate()) { if (form.validate()) {
HttpUtil.httpPost('v1/users', (response) { HttpUtil.httpPost('v1/users', (response) {
Routes.router.navigateTo(context, '/reset-password/${usernameController.text.trim()}/${codeController.text.trim()}', replace: true); 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() { void signIn() {
final FormState form = _formKey.currentState; final FormState form = _formKey.currentState!;
if (form.validate()) { if (form.validate()) {
if (mounted) { if (mounted) {
setState(() { setState(() {

View File

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

View File

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

View File

@@ -231,7 +231,7 @@ class DesktopNewAddressState extends State<DesktopNewAddress> {
onChanged: (newValue) { onChanged: (newValue) {
if (mounted) { if (mounted) {
setState(() { setState(() {
_selectedProvince = newValue; _selectedProvince = newValue!;
}); });
} }
}, },
@@ -378,14 +378,14 @@ class DesktopNewAddressState extends State<DesktopNewAddress> {
setState(() { setState(() {
if (widget.locatedAddress != null) { if (widget.locatedAddress != null) {
if (provinces.contains(widget.locatedAddress!.province)) { if (provinces.contains(widget.locatedAddress!.province)) {
_selectedProvince = widget.locatedAddress!.province; _selectedProvince = widget.locatedAddress!.province!;
} }
cityController.text = widget.locatedAddress!.city; cityController.text = widget.locatedAddress!.city!;
postalCodeController.text = widget.locatedAddress!.postalCode; postalCodeController.text = widget.locatedAddress!.postalCode!;
streetLine1Controller.text = (widget.locatedAddress!.streetNumber != null streetLine1Controller.text = (widget.locatedAddress!.streetNumber != null
&& widget.locatedAddress!.streetNumber!.isNotEmpty && widget.locatedAddress!.streetNumber!.isNotEmpty
? widget.locatedAddress!.streetNumber! + ' ' : '') ? widget.locatedAddress!.streetNumber! + ' ' : '')
+ widget.locatedAddress!.streetName; + widget.locatedAddress!.streetName!;
} else { } else {
_selectedProvince = 'Ontario'; _selectedProvince = 'Ontario';
} }
@@ -395,7 +395,7 @@ class DesktopNewAddressState extends State<DesktopNewAddress> {
} }
void _saveNewAddress() { void _saveNewAddress() {
final FormState form = _formKey.currentState; final FormState form = _formKey.currentState!;
if (form.validate()) { if (form.validate()) {
HttpUtil.httpPost('v1/addresses', (response) { HttpUtil.httpPost('v1/addresses', (response) {

View File

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

View File

@@ -295,7 +295,7 @@ class DesktopNewUserState extends State<DesktopNewUser> {
} }
void register() { void register() {
final FormState form = _formKey.currentState; final FormState form = _formKey.currentState!;
if (form.validate()) { if (form.validate()) {
HttpUtil.httpPost('v1/users', (response) { HttpUtil.httpPost('v1/users', (response) {
Routes.router.navigateTo(context, '/set-password/${usernameController.text.trim()}/${codeController.text.trim()}', replace: true); 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, width: double.infinity,
padding: EdgeInsets.only(top: 0.0, bottom: 16.0), padding: EdgeInsets.only(top: 0.0, bottom: 16.0),
child: Text( child: Text(
order.cartInfo!.businessInfo!.name, order.cartInfo!.businessInfo!.name!,
maxLines: 1, maxLines: 1,
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
style: TextStyle( style: TextStyle(
@@ -156,7 +156,7 @@ class DesktopOrderDetailState extends State<DesktopOrderDetail> {
child: GoogleMap( child: GoogleMap(
onMapCreated: _onMapCreated, onMapCreated: _onMapCreated,
initialCameraPosition: CameraPosition( 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, zoom: 11.0,
), ),
onCameraMove: _onCameraMove, onCameraMove: _onCameraMove,
@@ -173,8 +173,8 @@ class DesktopOrderDetailState extends State<DesktopOrderDetail> {
margin: EdgeInsets.only(bottom: 6.0), margin: EdgeInsets.only(bottom: 6.0),
child: Text( child: Text(
S.of(context).delivery_distance_token( S.of(context).delivery_distance_token(
order.deliveryDistance!.distance!.text, order.deliveryDistance!.distance!.text!,
order.deliveryDistance!.duration!.text order.deliveryDistance!.duration!.text!
), ),
), ),
decoration: BoxDecoration( decoration: BoxDecoration(
@@ -1092,12 +1092,12 @@ class DesktopOrderDetailState extends State<DesktopOrderDetail> {
if (!kIsWeb) { if (!kIsWeb) {
if (order.shippingMethod == 'store-delivery' && order.status != Constants.STATUS_COMPLETE && order.status != Constants.STATUS_CANCELLED) { if (order.shippingMethod == 'store-delivery' && order.status != Constants.STATUS_COMPLETE && order.status != Constants.STATUS_CANCELLED) {
storeLatLng = LatLng(double.parse(order.businessInfo!.address!.lat), storeLatLng = LatLng(double.parse(order.businessInfo!.address!.lat!),
double.parse(order.businessInfo!.address!.lng)); double.parse(order.businessInfo!.address!.lng!));
customerLatLng = LatLng(double.parse(order.shippingAddress!.lat), customerLatLng = LatLng(double.parse(order.shippingAddress!.lat!),
double.parse(order.shippingAddress!.lng)); double.parse(order.shippingAddress!.lng!));
deliveryLatLng = deliveryLatLng =
LatLng(order.shipperPosition!.lat, order.shipperPosition!.lng); LatLng(order.shipperPosition!.lat!, order.shipperPosition!.lng!);
_polyLine.clear(); _polyLine.clear();
_polyLine.add( _polyLine.add(

View File

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

View File

@@ -91,7 +91,7 @@ class DesktopProductItemState extends State<DesktopProductItem> {
), ),
), ),
Text( Text(
widget.product!.description, widget.product!.description!,
// overflow: kIsWeb ? null : TextOverflow.ellipsis, // overflow: kIsWeb ? null : TextOverflow.ellipsis,
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
maxLines: 2, maxLines: 2,
@@ -116,7 +116,7 @@ class DesktopProductItemState extends State<DesktopProductItem> {
) : SizedBox.shrink(), ) : SizedBox.shrink(),
), ),
ShowPrice( ShowPrice(
widget.product!.price, widget.product!.price!,
regularPrice: widget.product!.regularPrice, regularPrice: widget.product!.regularPrice,
currencySign: '\$', currencySign: '\$',
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
@@ -174,7 +174,7 @@ class DesktopProductItemState extends State<DesktopProductItem> {
), ),
Container( Container(
child: Text( child: Text(
widget.product!.description, widget.product!.description!,
// overflow: kIsWeb ? null : TextOverflow.ellipsis, // overflow: kIsWeb ? null : TextOverflow.ellipsis,
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
maxLines: 2, maxLines: 2,
@@ -200,7 +200,7 @@ class DesktopProductItemState extends State<DesktopProductItem> {
) : SizedBox.shrink(), ) : SizedBox.shrink(),
), ),
ShowPrice( ShowPrice(
widget.product!.price, widget.product!.price!,
regularPrice: widget.product!.regularPrice, regularPrice: widget.product!.regularPrice,
currencySign: '\$', currencySign: '\$',
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,

View File

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

View File

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

View File

@@ -347,7 +347,7 @@ class DesktopUserProfileState extends State<DesktopUserProfile> {
} else { } else {
print(store.state.user.toString()); print(store.state.user.toString());
setState(() { setState(() {
_user = store.state.user; _user = store.state.user!;
_showProgress = false; _showProgress = false;
_progress = 0.0; _progress = 0.0;
}); });
@@ -355,7 +355,7 @@ class DesktopUserProfileState extends State<DesktopUserProfile> {
eventBus.on<OnCurrentUserUpdated>().listen((event) { eventBus.on<OnCurrentUserUpdated>().listen((event) {
if (mounted) { if (mounted) {
setState(() { 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 GlobalKey<FormState> _formKey = GlobalKey<FormState>();
final nicknameController = TextEditingController(); final nicknameController = TextEditingController();
nicknameController.text = _user.nickname; nicknameController.text = _user.nickname!;
showDialog( showDialog(
context: context, context: context,
@@ -447,7 +447,7 @@ class DesktopUserProfileState extends State<DesktopUserProfile> {
S.of(context).submit_to_change, S.of(context).submit_to_change,
), ),
onPressed: () { onPressed: () {
final FormState form = _formKey.currentState; final FormState form = _formKey.currentState!;
if (form.validate()) { if (form.validate()) {
Utils.getBox().then((box) { Utils.getBox().then((box) {
int userId = box.get(Constants.KEY_USER_ID, defaultValue: 0); 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), padding: EdgeInsets.only(top: 16.0, bottom: 16.0, left: 16.0, right: 16.0),
child: SingleChildScrollView( child: SingleChildScrollView(
scrollDirection: Axis.horizontal, scrollDirection: Axis.horizontal,
child: showGalleryImages(mainContext, ticket.issue!.files), child: showGalleryImages(mainContext, ticket.issue!.files!),
), ),
decoration: BoxDecoration( decoration: BoxDecoration(
border: Border( border: Border(
@@ -673,7 +673,7 @@ class DesktopViewTicketState extends State<DesktopViewTicket> {
} }
void _submit() { void _submit() {
final FormState form = _formKey.currentState; final FormState form = _formKey.currentState!;
if (form.validate()) { if (form.validate()) {
setState(() { setState(() {
onSubmitting = true; onSubmitting = true;

View File

@@ -311,7 +311,7 @@ class AddRemoveButtonState extends State<AddRemoveButton> {
void _addToCart(BuildContext context) { void _addToCart(BuildContext context) {
if (widget.cartLineItemIndex != -1) { 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( Fluttertoast.showToast(
msg: S.of(context).product_insufficient, msg: S.of(context).product_insufficient,
toastLength: Toast.LENGTH_SHORT, toastLength: Toast.LENGTH_SHORT,
@@ -336,7 +336,7 @@ class AddRemoveButtonState extends State<AddRemoveButton> {
); );
} else { } else {
eventBus.fire(new OnProductWillAddToCart(widget.product!, {}, eventBus.fire(new OnProductWillAddToCart(widget.product!, {},
widget.product!.price, widget.product!.description, widget.product!.price!, widget.product!.description!,
widget.business!, buttonKey: startKey)); widget.business!, buttonKey: startKey));
} }
} }

View File

@@ -251,7 +251,7 @@ class CheckOptionsState extends OptionsBaseState<CheckOptions> {
bool disabled = optDisabled; bool disabled = optDisabled;
bool check = _checkOptionIsCheck(productOption.name!); bool check = _checkOptionIsCheck(productOption.name!);
Map<String, dynamic> extraJson = Utils.stringToJson(productOption.extra!); Map<String, dynamic> extraJson = Utils.stringToJson(productOption.extra!)!;
// Utils.jsonPrettyPrint(extraJson); // Utils.jsonPrettyPrint(extraJson);
double extraAdjustAmount = 0.0; double extraAdjustAmount = 0.0;

View File

@@ -259,7 +259,7 @@ class QtyOptionsState extends OptionsBaseState<QtyOptions> {
bool disabled = optDisabled; bool disabled = optDisabled;
bool check = _checkOptionIsCheck(productOption.name!); bool check = _checkOptionIsCheck(productOption.name!);
Map<String, dynamic> extraJson = Utils.stringToJson(productOption.extra!); Map<String, dynamic> extraJson = Utils.stringToJson(productOption.extra!)!;
// Utils.jsonPrettyPrint(extraJson); // Utils.jsonPrettyPrint(extraJson);
double extraAdjustAmount = 0.0; double extraAdjustAmount = 0.0;

View File

@@ -96,7 +96,7 @@ class RadioOptionsState extends OptionsBaseState<RadioOptions> {
} }
} }
Map<String, dynamic> extraJson = Utils.stringToJson(productOption.extra!); Map<String, dynamic> extraJson = Utils.stringToJson(productOption.extra!)!;
if (extraJson != null) { if (extraJson != null) {
Map<String, dynamic> exclusiveRule = Rule.getRule( Map<String, dynamic> exclusiveRule = Rule.getRule(
extraJson, Rule.RULE_EXCLUSIVE_SELECTION); extraJson, Rule.RULE_EXCLUSIVE_SELECTION);
@@ -163,7 +163,7 @@ class RadioOptionsState extends OptionsBaseState<RadioOptions> {
bool disabled = optDisabled; bool disabled = optDisabled;
bool check = _checkOptionIsCheck(productOption.name!); bool check = _checkOptionIsCheck(productOption.name!);
Map<String, dynamic> extraJson = Utils.stringToJson(productOption.extra!); Map<String, dynamic> extraJson = Utils.stringToJson(productOption.extra!)!;
// Utils.jsonPrettyPrint(extraJson); // Utils.jsonPrettyPrint(extraJson);
double extraAdjustAmount = 0.0; double extraAdjustAmount = 0.0;

View File

@@ -29,7 +29,7 @@ class ParabolicAnimationWidget extends AnimatedWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
_calPoints(); _calPoints();
final Animation<double> animation = listenable; final Animation<double> animation = listenable!;
final double time = animation.value; final double time = animation.value;
// 设time=1 已知两点坐标 和 初速度 可求出 加速度 a // 设time=1 已知两点坐标 和 初速度 可求出 加速度 a
@@ -66,17 +66,17 @@ class ParabolicAnimationWidget extends AnimatedWidget {
void _calPoints() { void _calPoints() {
if (_startOffset == null) { if (_startOffset == null) {
RenderBox stackBox = stackKey.currentContext!.findRenderObject(); RenderBox stackBox = stackKey.currentContext!.findRenderObject()!;
Offset stackBoxOffset = stackBox.globalToLocal(Offset.zero); Offset stackBoxOffset = stackBox.globalToLocal(Offset.zero);
EdgeInsets startMargin = _margin(startKey); EdgeInsets startMargin = _margin(startKey);
RenderBox startBox = startKey.currentContext!.findRenderObject(); RenderBox startBox = startKey.currentContext!.findRenderObject()!;
_startOffset = startBox.localToGlobal(Offset( _startOffset = startBox.localToGlobal(Offset(
startMargin.left + startAdjustOffset.dx, startMargin.left + startAdjustOffset.dx,
stackBoxOffset.dy + startMargin.top + startAdjustOffset.dy)); stackBoxOffset.dy + startMargin.top + startAdjustOffset.dy));
EdgeInsets endMargin = _margin(endKey); EdgeInsets endMargin = _margin(endKey);
RenderBox endBox = endKey.currentContext!.findRenderObject(); RenderBox endBox = endKey.currentContext!.findRenderObject()!;
_endOffset = endBox.localToGlobal(Offset( _endOffset = endBox.localToGlobal(Offset(
endMargin.left + endAdjustOffset.dx, endMargin.left + endAdjustOffset.dx,
stackBoxOffset.dy + endMargin.top + endAdjustOffset.dy)); stackBoxOffset.dy + endMargin.top + endAdjustOffset.dy));

View File

@@ -49,11 +49,11 @@ class PopupAnimationWidget extends AnimatedWidget {
void _calAnimation() { void _calAnimation() {
if (_startOffset == null) { if (_startOffset == null) {
final RenderBox stackBox = stackKey.currentContext!.findRenderObject(); final RenderBox stackBox = stackKey.currentContext!.findRenderObject()!;
final Offset stackBoxOffset = stackBox.globalToLocal(Offset.zero); final Offset stackBoxOffset = stackBox.globalToLocal(Offset.zero);
final EdgeInsets startMargin = _margin(startKey); final EdgeInsets startMargin = _margin(startKey);
final RenderBox startBox = startKey.currentContext!.findRenderObject(); final RenderBox startBox = startKey.currentContext!.findRenderObject()!;
_startOffset = startBox.localToGlobal(Offset( _startOffset = startBox.localToGlobal(Offset(
startMargin.left + popupOffset.dx, startMargin.left + popupOffset.dx,

View File

@@ -57,7 +57,7 @@ class ReadMoreTextState extends State<ReadMoreText> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final DefaultTextStyle defaultTextStyle = DefaultTextStyle.of(context); final DefaultTextStyle defaultTextStyle = DefaultTextStyle.of(context);
TextStyle effectiveTextStyle = widget.style; TextStyle effectiveTextStyle = widget.style!;
if (widget.style == null || widget.style!.inherit) { if (widget.style == null || widget.style!.inherit) {
effectiveTextStyle = defaultTextStyle.style.merge(widget.style); effectiveTextStyle = defaultTextStyle.style.merge(widget.style);
} }
@@ -122,7 +122,7 @@ class ReadMoreTextState extends State<ReadMoreText> {
textSize.width - linkSize.width, textSize.width - linkSize.width,
textSize.height, textSize.height,
)); ));
endIndex = textPainter.getOffsetBefore(pos.offset); endIndex = textPainter.getOffsetBefore(pos.offset)!;
} }
else { else {
var pos = textPainter.getPositionForOffset( var pos = textPainter.getPositionForOffset(

View File

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

View File

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

View File

@@ -256,7 +256,7 @@ class MobileChangeMobileOrEmailState extends State<MobileChangeMobileOrEmail> {
} }
void register() { void register() {
final FormState form = _formKey.currentState; final FormState form = _formKey.currentState!;
if (form.validate()) { if (form.validate()) {
HttpUtil.httpPost('v1/users', (response) { HttpUtil.httpPost('v1/users', (response) {
Utils.showMessageDialog(context, Exception(S.of(context).update_success), title: S.of(context).success, onOk: () { 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() { void resetPassword() {
final FormState form = _formKey.currentState; final FormState form = _formKey.currentState!;
if (form.validate()) { if (form.validate()) {
HttpUtil.httpPost('v1/users', (response) { HttpUtil.httpPost('v1/users', (response) {
showDialog( showDialog(

View File

@@ -308,7 +308,7 @@ class MobileCheckoutState extends State<MobileCheckout> with SingleTickerProvide
onChanged: (newValue) { onChanged: (newValue) {
if (mounted) { if (mounted) {
setState(() { setState(() {
peopleCount = newValue; peopleCount = newValue!;
}); });
} }
}, },
@@ -389,7 +389,7 @@ class MobileCheckoutState extends State<MobileCheckout> with SingleTickerProvide
Container( Container(
margin: EdgeInsets.only(top: 10.0), margin: EdgeInsets.only(top: 10.0),
child: Text( child: Text(
cartInfo.businessInfo!.name, cartInfo.businessInfo!.name!,
style: TextStyle( style: TextStyle(
fontSize: 17.0, fontSize: 17.0,
), ),
@@ -398,7 +398,7 @@ class MobileCheckoutState extends State<MobileCheckout> with SingleTickerProvide
Container( Container(
margin: EdgeInsets.only(top: 5.0), margin: EdgeInsets.only(top: 5.0),
child: Text( child: Text(
cartInfo.businessInfo!.address!.addressLine1, cartInfo.businessInfo!.address!.addressLine1!,
style: TextStyle( style: TextStyle(
fontSize: 14.0, fontSize: 14.0,
color: Colors.black45, color: Colors.black45,
@@ -408,7 +408,7 @@ class MobileCheckoutState extends State<MobileCheckout> with SingleTickerProvide
Container( Container(
child: cartInfo.businessInfo!.address!.addressLine2 != null child: cartInfo.businessInfo!.address!.addressLine2 != null
&& cartInfo.businessInfo!.address!.addressLine2!.length > 0 ? && cartInfo.businessInfo!.address!.addressLine2!.length > 0 ?
Text(cartInfo.businessInfo!.address!.addressLine2, Text(cartInfo.businessInfo!.address!.addressLine2!,
style: TextStyle( style: TextStyle(
fontSize: 14.0, fontSize: 14.0,
color: Colors.black45, color: Colors.black45,
@@ -712,7 +712,7 @@ class MobileCheckoutState extends State<MobileCheckout> with SingleTickerProvide
width: double.infinity, width: double.infinity,
padding: EdgeInsets.only(bottom: 10.0), padding: EdgeInsets.only(bottom: 10.0),
child: Text( child: Text(
cartInfo.businessInfo!.name, cartInfo.businessInfo!.name!,
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
style: TextStyle( style: TextStyle(
fontSize: 16.0, fontSize: 16.0,
@@ -1888,11 +1888,11 @@ class MobileCheckoutState extends State<MobileCheckout> with SingleTickerProvide
if (subtotal > coupon.minAmount && if (subtotal > coupon.minAmount &&
mounted) { mounted) {
setState(() { setState(() {
selectedCoupon = coupon.id; selectedCoupon = coupon.id!;
if (coupon.isPercentage) { if (coupon.isPercentage) {
couponDiscountAmount = subtotal * coupon.valueAmount / 100.0; couponDiscountAmount = subtotal * coupon.valueAmount / 100.0;
} else { } else {
couponDiscountAmount = coupon.valueAmount; couponDiscountAmount = coupon.valueAmount!;
} }
}); });
panelController.close(); panelController.close();

View File

@@ -273,8 +273,8 @@ class MobileContactUsState extends State<MobileContactUs> {
_markers.clear(); _markers.clear();
_markers.add(Marker( _markers.add(Marker(
markerId: MarkerId('shop_position'), markerId: MarkerId('shop_position'),
position: LatLng(double.parse(widget.business.address!.lat), position: LatLng(double.parse(widget.business.address!.lat!),
double.parse(widget.business.address!.lng)), double.parse(widget.business.address!.lng!)),
infoWindow: InfoWindow( infoWindow: InfoWindow(
title: S title: S
.of(context) .of(context)
@@ -290,8 +290,8 @@ class MobileContactUsState extends State<MobileContactUs> {
onMapCreated: _onMapCreated, onMapCreated: _onMapCreated,
initialCameraPosition: CameraPosition( initialCameraPosition: CameraPosition(
target: LatLng( target: LatLng(
double.parse(widget.business.address!.lat), double.parse(widget.business.address!.lat!),
double.parse(widget.business.address!.lng)), double.parse(widget.business.address!.lng!)),
zoom: 14.0, zoom: 14.0,
), ),
onCameraMove: _onCameraMove, onCameraMove: _onCameraMove,

View File

@@ -290,7 +290,7 @@ class MobileEditAddressState extends State<MobileEditAddress> {
onChanged: (newValue) { onChanged: (newValue) {
if (mounted) { if (mounted) {
setState(() { setState(() {
_selectedProvince = newValue; _selectedProvince = newValue!;
}); });
} }
}, },
@@ -472,22 +472,22 @@ class MobileEditAddressState extends State<MobileEditAddress> {
super.initState(); super.initState();
setState(() { setState(() {
showLoading = false; showLoading = false;
_selectedProvince = widget.address.state; _selectedProvince = widget.address.state!;
cityController.text = widget.address.city; cityController.text = widget.address.city!;
postalCodeController.text = widget.address.zip; postalCodeController.text = widget.address.zip!;
streetLine1Controller.text = widget.address.addressLine1; streetLine1Controller.text = widget.address.addressLine1!;
streetLine2Controller.text = widget.address.addressLine2; streetLine2Controller.text = widget.address.addressLine2!;
_selectedGender = widget.address.gender == 1 ? Gender.Male : Gender.Female; _selectedGender = widget.address.gender == 1 ? Gender.Male : Gender.Female;
country = widget.address.country; country = widget.address.country!;
contactNameController.text = widget.address.contactName; contactNameController.text = widget.address.contactName!;
phoneController.text = widget.address.phone; phoneController.text = widget.address.phone!;
emailController.text = widget.address.email; emailController.text = widget.address.email!;
faxController.text = widget.address.fax; faxController.text = widget.address.fax!;
}); });
} }
void _saveEditAddress() { void _saveEditAddress() {
final FormState form = _formKey.currentState; final FormState form = _formKey.currentState!;
if (form.validate()) { if (form.validate()) {
if (mounted) { if (mounted) {
setState(() { setState(() {

View File

@@ -239,7 +239,7 @@ class MobileForgotPasswordState extends State<MobileForgotPassword> {
} }
void register() { void register() {
final FormState form = _formKey.currentState; final FormState form = _formKey.currentState!;
if (form.validate()) { if (form.validate()) {
HttpUtil.httpPost('v1/users', (response) { HttpUtil.httpPost('v1/users', (response) {
Routes.router.navigateTo(context, '/reset-password/${usernameController.text.trim()}/${codeController.text.trim()}', replace: true); 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() { void signIn() {
final FormState form = _formKey.currentState; final FormState form = _formKey.currentState!;
if (form.validate()) { if (form.validate()) {
if (mounted) { if (mounted) {
setState(() { setState(() {

View File

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

View File

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

View File

@@ -230,7 +230,7 @@ class MobileNewAddressState extends State<MobileNewAddress> {
onChanged: (newValue) { onChanged: (newValue) {
if (mounted) { if (mounted) {
setState(() { setState(() {
_selectedProvince = newValue; _selectedProvince = newValue!;
}); });
} }
}, },
@@ -349,14 +349,14 @@ class MobileNewAddressState extends State<MobileNewAddress> {
setState(() { setState(() {
if (widget.locatedAddress != null) { if (widget.locatedAddress != null) {
if (provinces.contains(widget.locatedAddress!.province)) { if (provinces.contains(widget.locatedAddress!.province)) {
_selectedProvince = widget.locatedAddress!.province; _selectedProvince = widget.locatedAddress!.province!;
} }
cityController.text = widget.locatedAddress!.city; cityController.text = widget.locatedAddress!.city!;
postalCodeController.text = widget.locatedAddress!.postalCode; postalCodeController.text = widget.locatedAddress!.postalCode!;
streetLine1Controller.text = (widget.locatedAddress!.streetNumber != null streetLine1Controller.text = (widget.locatedAddress!.streetNumber != null
&& widget.locatedAddress!.streetNumber!.isNotEmpty && widget.locatedAddress!.streetNumber!.isNotEmpty
? widget.locatedAddress!.streetNumber! + ' ' : '') ? widget.locatedAddress!.streetNumber! + ' ' : '')
+ widget.locatedAddress!.streetName; + widget.locatedAddress!.streetName!;
} else { } else {
_selectedProvince = 'Ontario'; _selectedProvince = 'Ontario';
} }
@@ -366,7 +366,7 @@ class MobileNewAddressState extends State<MobileNewAddress> {
} }
void _saveNewAddress() { void _saveNewAddress() {
final FormState form = _formKey.currentState; final FormState form = _formKey.currentState!;
if (form.validate()) { if (form.validate()) {
HttpUtil.httpPost('v1/addresses', (response) { HttpUtil.httpPost('v1/addresses', (response) {

View File

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

View File

@@ -236,7 +236,7 @@ class MobileNewUserState extends State<MobileNewUser> {
} }
void register() { void register() {
final FormState form = _formKey.currentState; final FormState form = _formKey.currentState!;
if (form.validate()) { if (form.validate()) {
HttpUtil.httpPost('v1/users', (response) { HttpUtil.httpPost('v1/users', (response) {
Routes.router.navigateTo(context, '/set-password/${usernameController.text.trim()}/${codeController.text.trim()}', replace: true); 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, width: double.infinity,
padding: EdgeInsets.only(top: 0.0, bottom: 16.0), padding: EdgeInsets.only(top: 0.0, bottom: 16.0),
child: Text( child: Text(
order.cartInfo!.businessInfo!.name, order.cartInfo!.businessInfo!.name!,
maxLines: 1, maxLines: 1,
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
style: TextStyle( style: TextStyle(
@@ -170,8 +170,8 @@ class MobileOrderDetailState extends State<MobileOrderDetail> {
onMapCreated: _onMapCreated, onMapCreated: _onMapCreated,
initialCameraPosition: CameraPosition( initialCameraPosition: CameraPosition(
target: LatLng( target: LatLng(
double.parse(order.shippingAddress!.lat), double.parse(order.shippingAddress!.lat!),
double.parse(order.shippingAddress!.lng)), double.parse(order.shippingAddress!.lng!)),
zoom: 11.0, zoom: 11.0,
), ),
onCameraMove: _onCameraMove, onCameraMove: _onCameraMove,
@@ -188,8 +188,8 @@ class MobileOrderDetailState extends State<MobileOrderDetail> {
margin: EdgeInsets.only(bottom: 6.0), margin: EdgeInsets.only(bottom: 6.0),
child: Text( child: Text(
S.of(context).delivery_distance_token( S.of(context).delivery_distance_token(
order.deliveryDistance!.distance!.text, order.deliveryDistance!.distance!.text!,
order.deliveryDistance!.duration!.text order.deliveryDistance!.duration!.text!
), ),
), ),
decoration: BoxDecoration( decoration: BoxDecoration(
@@ -1060,12 +1060,12 @@ class MobileOrderDetailState extends State<MobileOrderDetail> {
if (!kIsWeb) { if (!kIsWeb) {
if (order.shippingMethod == 'store-delivery' && order.status != Constants.STATUS_COMPLETE && order.status != Constants.STATUS_CANCELLED) { if (order.shippingMethod == 'store-delivery' && order.status != Constants.STATUS_COMPLETE && order.status != Constants.STATUS_CANCELLED) {
storeLatLng = LatLng(double.parse(order.businessInfo!.address!.lat), storeLatLng = LatLng(double.parse(order.businessInfo!.address!.lat!),
double.parse(order.businessInfo!.address!.lng)); double.parse(order.businessInfo!.address!.lng!));
customerLatLng = LatLng(double.parse(order.shippingAddress!.lat), customerLatLng = LatLng(double.parse(order.shippingAddress!.lat!),
double.parse(order.shippingAddress!.lng)); double.parse(order.shippingAddress!.lng!));
deliveryLatLng = deliveryLatLng =
LatLng(order.shipperPosition!.lat, order.shipperPosition!.lng); LatLng(order.shipperPosition!.lat!, order.shipperPosition!.lng!);
_polyLine.clear(); _polyLine.clear();
_polyLine.add( _polyLine.add(

View File

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

View File

@@ -80,7 +80,7 @@ class MobileProductItemState extends State<MobileProductItem> {
), ),
), ),
new Text( new Text(
widget.product!.description, widget.product!.description!,
// overflow: kIsWeb ? null : TextOverflow.ellipsis, // overflow: kIsWeb ? null : TextOverflow.ellipsis,
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
maxLines: 2, maxLines: 2,
@@ -110,7 +110,7 @@ class MobileProductItemState extends State<MobileProductItem> {
textBaseline: TextBaseline.alphabetic, textBaseline: TextBaseline.alphabetic,
children: <Widget>[ children: <Widget>[
ShowPrice( ShowPrice(
widget.product!.price, widget.product!.price!,
regularPrice: widget.product!.regularPrice, regularPrice: widget.product!.regularPrice,
currencySign: '\$', currencySign: '\$',
), ),

View File

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

View File

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

View File

@@ -315,7 +315,7 @@ class MobileUserProfileState extends State<MobileUserProfile> {
} else { } else {
print(store.state.user.toString()); print(store.state.user.toString());
setState(() { setState(() {
_user = store.state.user; _user = store.state.user!;
_showProgress = false; _showProgress = false;
_progress = 0.0; _progress = 0.0;
}); });
@@ -323,7 +323,7 @@ class MobileUserProfileState extends State<MobileUserProfile> {
eventBus.on<OnCurrentUserUpdated>().listen((event) { eventBus.on<OnCurrentUserUpdated>().listen((event) {
if (mounted) { if (mounted) {
setState(() { 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 GlobalKey<FormState> _formKey = GlobalKey<FormState>();
final nicknameController = TextEditingController(); final nicknameController = TextEditingController();
nicknameController.text = _user.nickname; nicknameController.text = _user.nickname!;
showDialog( showDialog(
context: context, context: context,
@@ -415,7 +415,7 @@ class MobileUserProfileState extends State<MobileUserProfile> {
S.of(context).submit_to_change, S.of(context).submit_to_change,
), ),
onPressed: () { onPressed: () {
final FormState form = _formKey.currentState; final FormState form = _formKey.currentState!;
if (form.validate()) { if (form.validate()) {
Utils.getBox().then((box) { Utils.getBox().then((box) {
int userId = box.get(Constants.KEY_USER_ID, defaultValue: 0); int userId = box.get(Constants.KEY_USER_ID, defaultValue: 0);

View File

@@ -141,7 +141,7 @@ class MobileViewTicketState extends State<MobileViewTicket> {
Container( Container(
width: double.maxFinite, width: double.maxFinite,
padding: EdgeInsets.only(top: 16.0, bottom: 16.0, left: 16.0, right: 16.0), 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( decoration: BoxDecoration(
border: Border( border: Border(
bottom: BorderSide( bottom: BorderSide(
@@ -670,7 +670,7 @@ class MobileViewTicketState extends State<MobileViewTicket> {
} }
void _submit() { void _submit() {
final FormState form = _formKey.currentState; final FormState form = _formKey.currentState!;
if (form.validate()) { if (form.validate()) {
setState(() { setState(() {
onSubmitting = true; onSubmitting = true;

View File

@@ -774,7 +774,7 @@ class ShopState extends State<Shop>
addressColumn.children.add(new Text( addressColumn.children.add(new Text(
_business.address!.addressLine1! + _business.address!.addressLine1! +
(_business.address!.addressLine2!.isNotEmpty (_business.address!.addressLine2!.isNotEmpty
? ' ' + _business.address!.addressLine2 ? ' ' + _business.address!.addressLine2!
: ''), : ''),
style: new TextStyle(fontSize: 13.0, color: const Color(0xFFEEEEEE)), style: new TextStyle(fontSize: 13.0, color: const Color(0xFFEEEEEE)),
)); ));
@@ -783,7 +783,7 @@ class ShopState extends State<Shop>
', ' + ', ' +
_business.address!.state + _business.address!.state +
', ' + ', ' +
_business.address!.zip, _business.address!.zip!,
style: new TextStyle(fontSize: 13.0, color: const Color(0xFFEEEEEE)), style: new TextStyle(fontSize: 13.0, color: const Color(0xFFEEEEEE)),
)); ));

View File

@@ -121,7 +121,7 @@ def insert_arg_bang(line, col0):
elif ch in ')]}': elif ch in ')]}':
if depth==0: end=i; break if depth==0: end=i; break
depth-=1 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) if end is None: end=len(line)
# 值的实际末尾(跳过空白) # 值的实际末尾(跳过空白)
j=end-1 j=end-1
@@ -132,7 +132,7 @@ def insert_arg_bang(line, col0):
if not val: return None if not val: return None
if val[0] in '0123456789"\'': return None # 字面量跳过 if val[0] in '0123456789"\'': return None # 字面量跳过
if val in ('true','false','null'): 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:] return line[:j+1]+'!'+line[j+1:]
def make_field_nullable(lines, name): def make_field_nullable(lines, name):