phase3: improve arg-bang handler (allow ! in chains, ; terminator). 574->440
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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: () {
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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(() {
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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(() {
|
||||
|
||||
@@ -432,7 +432,7 @@ class DesktopMeState extends State<DesktopMe> {
|
||||
if (mounted) {
|
||||
setState(() {
|
||||
isLoading = false;
|
||||
_user = store.state.user;
|
||||
_user = store.state.user!;
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
@@ -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,
|
||||
),
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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,
|
||||
),
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -311,7 +311,7 @@ class AddRemoveButtonState extends State<AddRemoveButton> {
|
||||
|
||||
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<AddRemoveButton> {
|
||||
);
|
||||
} else {
|
||||
eventBus.fire(new OnProductWillAddToCart(widget.product!, {},
|
||||
widget.product!.price, widget.product!.description,
|
||||
widget.product!.price!, widget.product!.description!,
|
||||
widget.business!, buttonKey: startKey));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -251,7 +251,7 @@ class CheckOptionsState extends OptionsBaseState<CheckOptions> {
|
||||
bool disabled = optDisabled;
|
||||
bool check = _checkOptionIsCheck(productOption.name!);
|
||||
|
||||
Map<String, dynamic> extraJson = Utils.stringToJson(productOption.extra!);
|
||||
Map<String, dynamic> extraJson = Utils.stringToJson(productOption.extra!)!;
|
||||
// Utils.jsonPrettyPrint(extraJson);
|
||||
|
||||
double extraAdjustAmount = 0.0;
|
||||
|
||||
@@ -259,7 +259,7 @@ class QtyOptionsState extends OptionsBaseState<QtyOptions> {
|
||||
bool disabled = optDisabled;
|
||||
bool check = _checkOptionIsCheck(productOption.name!);
|
||||
|
||||
Map<String, dynamic> extraJson = Utils.stringToJson(productOption.extra!);
|
||||
Map<String, dynamic> extraJson = Utils.stringToJson(productOption.extra!)!;
|
||||
// Utils.jsonPrettyPrint(extraJson);
|
||||
|
||||
double extraAdjustAmount = 0.0;
|
||||
|
||||
@@ -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) {
|
||||
Map<String, dynamic> exclusiveRule = Rule.getRule(
|
||||
extraJson, Rule.RULE_EXCLUSIVE_SELECTION);
|
||||
@@ -163,7 +163,7 @@ class RadioOptionsState extends OptionsBaseState<RadioOptions> {
|
||||
bool disabled = optDisabled;
|
||||
bool check = _checkOptionIsCheck(productOption.name!);
|
||||
|
||||
Map<String, dynamic> extraJson = Utils.stringToJson(productOption.extra!);
|
||||
Map<String, dynamic> extraJson = Utils.stringToJson(productOption.extra!)!;
|
||||
// Utils.jsonPrettyPrint(extraJson);
|
||||
|
||||
double extraAdjustAmount = 0.0;
|
||||
|
||||
@@ -29,7 +29,7 @@ class ParabolicAnimationWidget extends AnimatedWidget {
|
||||
Widget build(BuildContext context) {
|
||||
_calPoints();
|
||||
|
||||
final Animation<double> animation = listenable;
|
||||
final Animation<double> 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));
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -57,7 +57,7 @@ class ReadMoreTextState extends State<ReadMoreText> {
|
||||
@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<ReadMoreText> {
|
||||
textSize.width - linkSize.width,
|
||||
textSize.height,
|
||||
));
|
||||
endIndex = textPainter.getOffsetBefore(pos.offset);
|
||||
endIndex = textPainter.getOffsetBefore(pos.offset)!;
|
||||
}
|
||||
else {
|
||||
var pos = textPainter.getPositionForOffset(
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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: () {
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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(() {
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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(() {
|
||||
|
||||
@@ -784,7 +784,7 @@ class MobileMeState extends State<MobileMe> {
|
||||
if (mounted) {
|
||||
setState(() {
|
||||
isLoading = false;
|
||||
_user = store.state.user;
|
||||
_user = store.state.user!;
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
@@ -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,
|
||||
),
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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,
|
||||
),
|
||||
|
||||
@@ -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: '\$',
|
||||
),
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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)),
|
||||
));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user