phase3: nullfix arg-bang handler (argument_type/invalid_assignment). 872 -> 621

This commit is contained in:
2026-07-25 18:16:40 +08:00
parent c21ccbd54d
commit a76b872966
65 changed files with 282 additions and 257 deletions

View File

@@ -240,7 +240,7 @@ class CreateOnlineStore1State extends State<CreateOnlineStore1> {
onPressed: () {
Navigator.pushReplacement(context, MaterialPageRoute(
builder: (BuildContext context) =>
BuyService(group.id, Constants.WEB_MINISTORE_SERVICE,
BuyService(group.id!, Constants.WEB_MINISTORE_SERVICE,
domain: existing_web_svc['domain'],
sid: existing_web_svc['store']['id'],
),
@@ -357,7 +357,7 @@ class CreateOnlineStore1State extends State<CreateOnlineStore1> {
onPressed: () {
Navigator.pushReplacement(context, MaterialPageRoute(
builder: (BuildContext context) =>
BuyService(group.id, Constants.WEB_MINISTORE_SERVICE,
BuyService(group.id!, Constants.WEB_MINISTORE_SERVICE,
domain: selectedDomain,
sid: selectedStore['id'],
),

View File

@@ -217,7 +217,7 @@ class DesktopBlogState extends State<DesktopBlog> {
children: <Widget>[
Container(
child: Text(
blog.title,
blog.title!,
style: TextStyle(
fontSize: 19.0,
),
@@ -226,7 +226,7 @@ class DesktopBlogState extends State<DesktopBlog> {
),
Container(
child: Text(
Utils.utcDatetimeStringToLocalDatetimeString(context, blog.createdAt,),
Utils.utcDatetimeStringToLocalDatetimeString(context, blog.createdAt!,),
style: TextStyle(
fontSize: 13.0,
color: Colors.grey,
@@ -266,7 +266,7 @@ class DesktopBlogState extends State<DesktopBlog> {
_loadingFinish = false;
HttpUtil.httpGet(
'v1/blogs',
businessId: widget.businessId,
businessId: widget.businessId!,
queryParameters: {
'page': _page.toString(),
'size': Constants.BLOG_PER_PAGE_DESKTOP.toString()

View File

@@ -106,7 +106,7 @@ class DesktopBuyServiceState extends State<DesktopBuyService> {
items: plans.map((e) {
return DropdownMenuItem<KeyValue>(
value: e,
child: Text(e.name),
child: Text(e.name!),
);
}).toList(),
isExpanded: true,

View File

@@ -306,7 +306,7 @@ class DesktopCheckoutState extends State<DesktopCheckout> with SingleTickerProvi
mainAxisSize: MainAxisSize.min,
children: [
Text(
S.of(context).table_token(store.state.tableNumber),
S.of(context).table_token(store.state.tableNumber!),
style: TextStyle(
fontSize: 20.0,
fontWeight: FontWeight.bold,
@@ -358,7 +358,7 @@ class DesktopCheckoutState extends State<DesktopCheckout> with SingleTickerProvi
icons: shippingMethodIcons,
onToggle: (index) {
selectedShippingRate = null;
deliveryMethod = getShippingMethod(index);
deliveryMethod = getShippingMethod(index!);
check();
},
initialLabelIndex: deliveryMethodIndex,
@@ -652,7 +652,7 @@ class DesktopCheckoutState extends State<DesktopCheckout> with SingleTickerProvi
children: <Widget>[
Container(
child: Text(
bookingTimeList.length > 0 ? '${Utils.timestampToString(context, bookingTimeList[bookingTimeIndex].unixTime)}'
bookingTimeList.length > 0 ? '${Utils.timestampToString(context, bookingTimeList[bookingTimeIndex].unixTime!)}'
: ((bookingTimeList.length == 0 && bookingDateTimeList.length == 0) ? ''
: bookingDateTimeList[bookingDateIndex].viewDate! + ' ' + (bookingDateTimeList[bookingDateIndex].bookTimes!.length > 0 ? bookingDateTimeList[bookingDateIndex].bookTimes![bookingTimeIndex].viewTime : '')),
),
@@ -706,7 +706,7 @@ class DesktopCheckoutState extends State<DesktopCheckout> with SingleTickerProvi
children: <Widget>[
Container(
child: Text(
paymentPlatforms.length == 0 ? S.of(context).pay_on_deliery : PaymentPlatform.getPaymentPlatformName(context, paymentPlatforms[paymentPlatformIndex].code),
paymentPlatforms.length == 0 ? S.of(context).pay_on_deliery : PaymentPlatform.getPaymentPlatformName(context, paymentPlatforms[paymentPlatformIndex].code!),
),
),
Container(
@@ -1013,14 +1013,14 @@ class DesktopCheckoutState extends State<DesktopCheckout> with SingleTickerProvi
children: <Widget>[
Container(
child: Text(
Utils.knownName(context, cartLineItem.name),
Utils.knownName(context, cartLineItem.name!),
maxLines: 1,
overflow: TextOverflow.ellipsis,
),
),
Container(
child: Text(
cartLineItem.description,
cartLineItem.description!,
style: TextStyle(
fontSize: 12.0,
color: Colors.black38,
@@ -1180,7 +1180,7 @@ class DesktopCheckoutState extends State<DesktopCheckout> with SingleTickerProvi
column.children.add(Container(
padding: EdgeInsets.only(left: 0.0, right: 0.0, top: 10.0, bottom: 0.0),
child: Text(
Utils.errorMsg2(context, messages[i].code, messages[i].string),
Utils.errorMsg2(context, messages[i].code!, messages[i].string!),
),
));
}
@@ -1240,7 +1240,7 @@ class DesktopCheckoutState extends State<DesktopCheckout> with SingleTickerProvi
child: Container(
padding: EdgeInsets.only(left: 16.0, right: 16.0, bottom: 10.0, top: 10.0),
child: Text(
'${Utils.timestampToString(context, bookingTime.unixTime)}',
'${Utils.timestampToString(context, bookingTime.unixTime!)}',
),
decoration: BoxDecoration(
border: Border(
@@ -1315,7 +1315,7 @@ class DesktopCheckoutState extends State<DesktopCheckout> with SingleTickerProvi
padding: EdgeInsets.only(left: 10.0, right: 10.0, top: 10.0, bottom: 10.0),
child: Center(
child: Text(
'${bookingDateTime.viewDate} (${Utils.getWeekDayName(context, bookingDateTime.unixTime, true)})',
'${bookingDateTime.viewDate} (${Utils.getWeekDayName(context, bookingDateTime.unixTime!, true)})',
),
),
),
@@ -1519,7 +1519,7 @@ class DesktopCheckoutState extends State<DesktopCheckout> with SingleTickerProvi
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Container(
child: Util.showImage(paymentPlatform.icon,
child: Util.showImage(paymentPlatform.icon!,
errorWidget: (context, url, error) => Icon(Icons.broken_image, size: 50.0, color: Colors.transparent,),
fit: BoxFit.cover,
width: 50.0,
@@ -1529,7 +1529,7 @@ class DesktopCheckoutState extends State<DesktopCheckout> with SingleTickerProvi
Container(
margin: EdgeInsets.only(left: 10.0),
child: Text(
PaymentPlatform.getPaymentPlatformName(context, paymentPlatform.code),
PaymentPlatform.getPaymentPlatformName(context, paymentPlatform.code!),
style: TextStyle(
fontSize: 18.0,
fontWeight: FontWeight.bold,
@@ -1807,7 +1807,7 @@ class DesktopCheckoutState extends State<DesktopCheckout> with SingleTickerProvi
Container(
padding: EdgeInsets.only(right: 5.0),
child: Text(
'${Utils.smartRound(coupon.valueAmount, 2)}',
'${Utils.smartRound(coupon.valueAmount!, 2)}',
style: TextStyle(
fontSize: 30.0,
color: Colors.redAccent,
@@ -1843,7 +1843,7 @@ class DesktopCheckoutState extends State<DesktopCheckout> with SingleTickerProvi
),
Container(
child: Text(
'${Utils.smartRound(coupon.valueAmount, 2)}',
'${Utils.smartRound(coupon.valueAmount!, 2)}',
style: TextStyle(
fontSize: 30.0,
color: Colors.redAccent,
@@ -1871,7 +1871,7 @@ class DesktopCheckoutState extends State<DesktopCheckout> with SingleTickerProvi
child: Text(
coupon.expirationDate != null ?
S.of(context).expiration_date_token(
coupon.expirationDate) :
coupon.expirationDate!) :
S.of(context)
.no_expiration,
style: TextStyle(
@@ -1884,7 +1884,7 @@ class DesktopCheckoutState extends State<DesktopCheckout> with SingleTickerProvi
child: Text(
coupon.minAmount! > 0 ?
S.of(context).min_order_amount_token(
coupon.minAmount) :
coupon.minAmount!) :
S.of(context)
.no_restriction,
style: TextStyle(
@@ -2126,7 +2126,7 @@ class DesktopCheckoutState extends State<DesktopCheckout> with SingleTickerProvi
left: 16.0, top: 16.0, right: 16.0, bottom: 16.0),
child: Container(
child: Text(
shippingRate.name,
shippingRate.name!,
style: TextStyle(
fontSize: 20.0,
),

View File

@@ -146,7 +146,7 @@ class DesktopCouponsState extends State<DesktopCoupons> {
overflow: TextOverflow.ellipsis,
),
Text(
coupon.description,
coupon.description!,
style: TextStyle(
fontSize: 12.0,
color: Colors.black26,
@@ -185,7 +185,7 @@ class DesktopCouponsState extends State<DesktopCoupons> {
),
Container(
child: Text(
'${Utils.smartRound(coupon.valueAmount, 2)}',
'${Utils.smartRound(coupon.valueAmount!, 2)}',
style: TextStyle(
fontSize: 28.0,
color: Colors.redAccent,
@@ -200,7 +200,7 @@ class DesktopCouponsState extends State<DesktopCoupons> {
children: <Widget>[
Container(
child: Text(
'${Utils.smartRound(coupon.valueAmount, 2)}',
'${Utils.smartRound(coupon.valueAmount!, 2)}',
style: TextStyle(
fontSize: 28.0,
color: Colors.redAccent,
@@ -222,7 +222,7 @@ class DesktopCouponsState extends State<DesktopCoupons> {
Container(
child: Text(
coupon.minAmount! > 0 ?
S.of(context).available_for_order_over_token(coupon.minAmount) :
S.of(context).available_for_order_over_token(coupon.minAmount!) :
S.of(context).no_restriction,
style: TextStyle(
fontSize: 10.0,
@@ -261,7 +261,7 @@ class DesktopCouponsState extends State<DesktopCoupons> {
child: Text(
coupon.expirationDate == null || coupon.expirationDate!.length == 0 ?
S.of(context).no_expiration :
S.of(context).expiration_date_token(coupon.expirationDate),
S.of(context).expiration_date_token(coupon.expirationDate!),
style: TextStyle(
color: Colors.black26,
fontSize: 15.0,

View File

@@ -303,7 +303,7 @@ class DesktopLoginState extends State<DesktopLogin> {
box.put(Constants.KEY_USER_ID, response.data['user_id']);
box.put(Constants.KEY_ACCESS_TOKEN, response.data['access_token']);
if (store.state.redirectRoute != null) {
Routes.router.navigateTo(context, store.state.redirectRoute,
Routes.router.navigateTo(context, store.state.redirectRoute!,
replace: true);
store.dispatch(UpdateRedirectRoute(null));
} else {

View File

@@ -125,7 +125,7 @@ class DesktopMeState extends State<DesktopMe> {
Container(
child: Text(
_user != null
? Utils.safePhoneNumber(_user.mobile)
? Utils.safePhoneNumber(_user.mobile!)
: '',
style: TextStyle(
color: Colors.black38,
@@ -493,7 +493,7 @@ class DesktopMeState extends State<DesktopMe> {
),
),
),
onTap: tap,
onTap: tap!,
),
);
return widget;

View File

@@ -147,7 +147,7 @@ class DesktopMyAddressesState extends State<DesktopMyAddresses> {
children: <Widget>[
Container(
child: Text(
address.addressLine1,
address.addressLine1!,
style: TextStyle(
fontSize: 19.0,
),
@@ -156,7 +156,7 @@ class DesktopMyAddressesState extends State<DesktopMyAddresses> {
),
Container(
child: Text(
address.addressLine2,
address.addressLine2!,
style: TextStyle(
fontSize: 13.0,
color: Colors.grey,
@@ -166,7 +166,7 @@ class DesktopMyAddressesState extends State<DesktopMyAddresses> {
Container(
margin: EdgeInsets.only(top: 10.0),
child: Text(
'${address.contactName} ${Utils.safePhoneNumber(address.phone)}',
'${address.contactName} ${Utils.safePhoneNumber(address.phone!)}',
style: TextStyle(
fontSize: 15.0,
color: Colors.black87,
@@ -202,7 +202,7 @@ class DesktopMyAddressesState extends State<DesktopMyAddresses> {
),
onPressed: () {
Navigator.push(context, MaterialPageRoute(
builder: (BuildContext context) => new EditAddress(address, businessId: widget.businessId,),
builder: (BuildContext context) => new EditAddress(address, businessId: widget.businessId!,),
));
},
),

View File

@@ -227,7 +227,7 @@ class DesktopMySupportState extends State<DesktopMySupport> {
),
Container(
child: Text(
Utils.utcDatetimeStringToLocalDatetimeString(context, ticket.createdAt, withTime: true),
Utils.utcDatetimeStringToLocalDatetimeString(context, ticket.createdAt!, withTime: true),
style: TextStyle(
fontSize: 13.0,
color: Colors.grey,
@@ -296,7 +296,7 @@ class DesktopMySupportState extends State<DesktopMySupport> {
void loadTicketes(bool isRefresh) {
HttpUtil.httpGet(
'v1/mysupport',
businessId: widget.businessId,
businessId: widget.businessId!,
queryParameters: {
'page': _page.toString(),
'size': Constants.TICKET_PER_PAGE_DESKTOP.toString(),

View File

@@ -253,7 +253,7 @@ class DesktopNewCommentState extends State<DesktopNewComment> {
child: Text(S.of(context).yes_i_am_sure),
onPressed: () {
Navigator.of(context).pop();
_deleteImage(image.id);
_deleteImage(image.id!);
},
),
],
@@ -305,7 +305,7 @@ class DesktopNewCommentState extends State<DesktopNewComment> {
context: mainContext,
barrierDismissible: true,
builder: (BuildContext context) {
return Util().getPicture(mainContext, store.state.user,
return Util().getPicture(mainContext, store.state.user!,
commentId: comment != null ? comment.id : 0,
orderId: widget.orderId);
}

View File

@@ -505,7 +505,7 @@ class DesktopOrderDetailState extends State<DesktopOrderDetail> {
margin: EdgeInsets.only(top: 10.0, bottom: 10.0),
alignment: Alignment.centerRight,
child: Text(
'${Utils.timestampToString(context, order.bookedAt, withTime: true)}',
'${Utils.timestampToString(context, order.bookedAt!, withTime: true)}',
style: TextStyle(
color: Colors.black38,
),
@@ -806,7 +806,7 @@ class DesktopOrderDetailState extends State<DesktopOrderDetail> {
margin: EdgeInsets.only(top: 10.0, bottom: 10.0),
alignment: Alignment.centerRight,
child: Text(
Utils.timestampToString(context, order.createdAt, withTime: true),
Utils.timestampToString(context, order.createdAt!, withTime: true),
style: TextStyle(
color: Colors.black38,
),
@@ -862,7 +862,7 @@ class DesktopOrderDetailState extends State<DesktopOrderDetail> {
),
),
Text(
Utils.getOrderStatus(context, order.status),
Utils.getOrderStatus(context, order.status!),
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
@@ -918,7 +918,7 @@ class DesktopOrderDetailState extends State<DesktopOrderDetail> {
),
Container(
child: Text(
'${Utils.utcDatetimeStringToLocalDatetimeString(context, fulfillment.createdAt, withTime: true)}',
'${Utils.utcDatetimeStringToLocalDatetimeString(context, fulfillment.createdAt!, withTime: true)}',
style: TextStyle(
fontSize: 12.0,
color: Colors.black26,
@@ -1053,7 +1053,7 @@ class DesktopOrderDetailState extends State<DesktopOrderDetail> {
),
),
onPressed: () {
Utils.orderAgain(context, order.cartInfo);
Utils.orderAgain(context, order.cartInfo!);
},
),
),

View File

@@ -193,7 +193,7 @@ class DesktopOrdersState extends State<DesktopOrders> with SingleTickerProviderS
if (order.cartInfo!.productList!.length > 1) {
row.children.add(Container(
child: Text(
S.of(context).and_more_item_token(Utils.getProductLineInOrder(order.cartInfo)),
S.of(context).and_more_item_token(Utils.getProductLineInOrder(order.cartInfo!)),
style: TextStyle(
fontSize: 12.0,
color: Colors.black26,
@@ -222,7 +222,7 @@ class DesktopOrdersState extends State<DesktopOrders> with SingleTickerProviderS
),
onPressed: () {
Navigator.push(context, MaterialPageRoute(
builder: (BuildContext context) => OrderDetail(order.id, fromOrders: true,),
builder: (BuildContext context) => OrderDetail(order.id!, fromOrders: true,),
));
},
),
@@ -281,7 +281,7 @@ class DesktopOrdersState extends State<DesktopOrders> with SingleTickerProviderS
backgroundColor: Theme.of(context).primaryColor,
),
onPressed: () {
Utils.orderAgain(context, order.cartInfo);
Utils.orderAgain(context, order.cartInfo!);
},
));
}
@@ -298,7 +298,7 @@ class DesktopOrdersState extends State<DesktopOrders> with SingleTickerProviderS
backgroundColor: Theme.of(context).primaryColor,
),
onPressed: () {
Utils.orderAgain(context, order.cartInfo);
Utils.orderAgain(context, order.cartInfo!);
},
));
}
@@ -346,7 +346,7 @@ class DesktopOrdersState extends State<DesktopOrders> with SingleTickerProviderS
),
Container(
child: Text(
'#${order.orderNum} ${Utils.timestampToString(context, order.createdAt, withTime: true)}',
'#${order.orderNum} ${Utils.timestampToString(context, order.createdAt!, withTime: true)}',
style: TextStyle(
fontSize: 12.0,
color: Colors.black26,
@@ -358,7 +358,7 @@ class DesktopOrdersState extends State<DesktopOrders> with SingleTickerProviderS
),
onTap: () {
Navigator.push(context, MaterialPageRoute(
builder: (BuildContext context) => OrderDetail(order.id, fromOrders: true,),
builder: (BuildContext context) => OrderDetail(order.id!, fromOrders: true,),
));
},
),
@@ -369,7 +369,7 @@ class DesktopOrdersState extends State<DesktopOrders> with SingleTickerProviderS
children: <Widget>[
Container(
child: Text(
'${Utils.getOrderStatus(context, order.status)}',
'${Utils.getOrderStatus(context, order.status!)}',
style: TextStyle(
fontSize: 15.0,
fontWeight: FontWeight.bold,
@@ -404,7 +404,7 @@ class DesktopOrdersState extends State<DesktopOrders> with SingleTickerProviderS
),
onTap: () {
Navigator.push(context, MaterialPageRoute(
builder: (BuildContext context) => OrderDetail(order.id, fromOrders: true,),
builder: (BuildContext context) => OrderDetail(order.id!, fromOrders: true,),
));
},
),

View File

@@ -174,7 +174,7 @@ class DesktopPayNowState extends State<DesktopPayNow> {
children: <Widget>[
Container(
padding: EdgeInsets.only(right: 10.0),
child: Util.showImage(paymentPlatform.icon,
child: Util.showImage(paymentPlatform.icon!,
errorWidget: (context, url, error) => Icon(Icons.broken_image, size: 50.0, color: Colors.transparent,),
fit: BoxFit.cover,
width: 50.0,
@@ -183,7 +183,7 @@ class DesktopPayNowState extends State<DesktopPayNow> {
),
Expanded(
child: Text(
S.of(context).pay_with_token(PaymentPlatform.getPaymentPlatformName(context, paymentPlatform.code)),
S.of(context).pay_with_token(PaymentPlatform.getPaymentPlatformName(context, paymentPlatform.code!)),
style: TextStyle(
fontSize: 18.0,
fontWeight: FontWeight.bold,

View File

@@ -43,7 +43,7 @@ class DesktopPlainPageState extends State<DesktopPlainPage> {
padding: EdgeInsets.only(top: 20, left: 16.0, right: 16.0, bottom: 16.0),
child: Center(
child: Text(
widget.blog.title,
widget.blog.title!,
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 20,
@@ -55,7 +55,7 @@ class DesktopPlainPageState extends State<DesktopPlainPage> {
padding: EdgeInsets.only(left: 16.0, right: 16.0, bottom: 20.0),
child: MarkdownBody(
shrinkWrap: true,
data: widget.blog.body,
data: widget.blog.body!,
),
));
@@ -64,7 +64,7 @@ class DesktopPlainPageState extends State<DesktopPlainPage> {
title: S.of(context).blog,
back: true,
breadCrumbs: [
BreadCrumb(widget.blog.title, null),
BreadCrumb(widget.blog.title!, null),
],
breadCrumbHeight: Constants.BREADCRUMB_HEIGHT,
),

View File

@@ -83,7 +83,7 @@ class DesktopProductDetailPageState extends State<DesktopProductDetailPage>
title: S.of(context).shop,
back: true,
breadCrumbs: [
BreadCrumb(productDetail.name, null),
BreadCrumb(productDetail.name!, null),
],
breadCrumbHeight: Constants.BREADCRUMB_HEIGHT,
// shoppingCart: DesktopShoppingCartWidget(business: widget.business,),
@@ -125,7 +125,7 @@ class DesktopProductDetailPageState extends State<DesktopProductDetailPage>
),
Container(
child: Text(
productDetail.name,
productDetail.name!,
overflow: TextOverflow.ellipsis,
maxLines: 2,
style: TextStyle(
@@ -163,7 +163,7 @@ class DesktopProductDetailPageState extends State<DesktopProductDetailPage>
crossAxisAlignment: CrossAxisAlignment.start,
children: [
ShowPrice(
productDetail.price,
productDetail.price!,
currencySign: '\$',
fontWeight: FontWeight.bold,
smallFontSize: 24,
@@ -208,13 +208,13 @@ class DesktopProductDetailPageState extends State<DesktopProductDetailPage>
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
(productDetail.subproducts!.length > 0) ?
subProducts(productDetail.subproducts) :
subProducts(productDetail.subproducts!) :
SizedBox.shrink(),
Container(
padding: EdgeInsets.only(
top: 10.0, left: 10.0, right: 10.0, bottom: 16.0),
child: Text(
productDetail.description,
productDetail.description!,
style: TextStyle(
fontSize: 14.0, color: Colors.black54),
),
@@ -253,7 +253,7 @@ class DesktopProductDetailPageState extends State<DesktopProductDetailPage>
children: <Widget>[
Container(
child: Text(
S.of(context).weight_token(productDetail.weight),
S.of(context).weight_token(productDetail.weight!),
style: TextStyle(
fontSize: 12.0,
color: Colors.black54,
@@ -263,9 +263,9 @@ class DesktopProductDetailPageState extends State<DesktopProductDetailPage>
Container(
child: Text(
S.of(context).dimentions_token(
productDetail.dimentionsLength,
productDetail.dimentionsWidth,
productDetail.dimentionsHeight),
productDetail.dimentionsLength!,
productDetail.dimentionsWidth!,
productDetail.dimentionsHeight!),
style: TextStyle(
fontSize: 12.0,
color: Colors.black54,
@@ -301,7 +301,7 @@ class DesktopProductDetailPageState extends State<DesktopProductDetailPage>
Widget getImage(double width) {
if (productDetail.images!.length <= 0) {
return Util.showImage(
productDetail.image,
productDetail.image!,
width: width,
height: width,
);
@@ -427,7 +427,7 @@ class DesktopProductDetailPageState extends State<DesktopProductDetailPage>
_tabController = TabController(vsync: this, length: 2);
HttpUtil.httpGet(
'v1/product-detail/${widget.product.id}',
businessId: widget.business.id,
businessId: widget.business.id!,
).then((value) {
print(value);
productDetail = ProductDetail.fromJson(value);
@@ -452,7 +452,7 @@ class DesktopProductDetailPageState extends State<DesktopProductDetailPage>
List<Widget> _getProductPictures(BuildContext context) {
var pages = <Widget>[];
List<String> images = [];
images.add(productDetail.image);
images.add(productDetail.image!);
for (var i = 0; i < productDetail.images!.length; i++) {
// print('>>https:' + productDetail.images[i].image);
images.add(productDetail.images![i].image);

View File

@@ -72,8 +72,8 @@ class DesktopSearchPlaceState extends State<DesktopSearchPlace> {
onSearch: search,
onItemFound: (LocatedAddress locatedAddress, int index) {
return ListTile(
title: Text(locatedAddress.streetName),
subtitle: Text(locatedAddress.formattedAddress),
title: Text(locatedAddress.streetName!),
subtitle: Text(locatedAddress.formattedAddress!),
onTap: () {
if (widget.businessId == 0) {
_selectPlace(locatedAddress);
@@ -130,7 +130,7 @@ class DesktopSearchPlaceState extends State<DesktopSearchPlace> {
if (result.response != null) {
throw RuntimeError(result.response!.data['message']);
} else {
throw RuntimeError(result.message);
throw RuntimeError(result.message!);
}
} else if (result != null && result is List) {
return result.map((e) => LocatedAddress.fromJson(e)).toList();

View File

@@ -59,7 +59,7 @@ class DesktopShoppingCartWidgetState extends State<DesktopShoppingCartWidget> {
child: row,
width: 160.0,
),
onTap: widget.onTap,
onTap: widget.onTap!,
),
);
}

View File

@@ -136,7 +136,7 @@ class DesktopStoreProductSearchState extends State<DesktopStoreProductSearch> {
if (result.response != null) {
throw RuntimeError(result.response!.data);
} else {
throw RuntimeError(result.message);
throw RuntimeError(result.message!);
}
} else if (result != null && result is List) {
lastBottomPosition = 0;

View File

@@ -153,7 +153,7 @@ class DesktopUserProfileState extends State<DesktopUserProfile> {
),
Container(
child: Text(
_user.nickname,
_user.nickname!,
style: TextStyle(
color: Colors.grey
),
@@ -253,7 +253,7 @@ class DesktopUserProfileState extends State<DesktopUserProfile> {
),
Container(
child: Text(
_user.mobile != null && _user.mobile!.isNotEmpty ? Utils.safePhoneNumber(_user.mobile) : S.of(context).not_binding,
_user.mobile != null && _user.mobile!.isNotEmpty ? Utils.safePhoneNumber(_user.mobile!) : S.of(context).not_binding,
style: TextStyle(
color: Colors.grey,
),
@@ -306,7 +306,7 @@ class DesktopUserProfileState extends State<DesktopUserProfile> {
),
Container(
child: Text(
_user.email != null && _user.email!.isNotEmpty ? Utils.safePhoneNumber(_user.email) : S.of(context).not_binding,
_user.email != null && _user.email!.isNotEmpty ? Utils.safePhoneNumber(_user.email!) : S.of(context).not_binding,
style: TextStyle(
color: Colors.grey,
),

View File

@@ -105,7 +105,7 @@ class DesktopViewBlogState extends State<DesktopViewBlog> {
),
),
Text(
Utils.utcDatetimeStringToLocalDatetimeString(context, blog.createdAt),
Utils.utcDatetimeStringToLocalDatetimeString(context, blog.createdAt!),
style: TextStyle(
fontSize: 14.0,
color: Colors.black38,

View File

@@ -220,14 +220,14 @@ class DesktopViewTicketState extends State<DesktopViewTicket> {
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Text(
S.of(context).ticket_number_token(ticket.id),
S.of(context).ticket_number_token(ticket.id!),
style: TextStyle(
fontSize: 24.0,
color: Colors.black
),
),
Text(
Utils.utcDatetimeStringToLocalDatetimeString(context, ticket.createdAt),
Utils.utcDatetimeStringToLocalDatetimeString(context, ticket.createdAt!),
style: TextStyle(
fontSize: 14.0,
color: Colors.black38,
@@ -331,7 +331,7 @@ class DesktopViewTicketState extends State<DesktopViewTicket> {
Text(
Utils.utcDatetimeStringToLocalDatetimeString(
context,
followUp.createdAt
followUp.createdAt!
),
style: TextStyle(
fontSize: 14.0,
@@ -364,7 +364,7 @@ class DesktopViewTicketState extends State<DesktopViewTicket> {
child: SingleChildScrollView(
scrollDirection: Axis.horizontal,
child: showGalleryImages(
mainContext, followUp.files,
mainContext, followUp.files!,
),
),
),

View File

@@ -125,7 +125,7 @@ class ProductItemState extends State<ProductItem> {
),
),
Text(
widget.product.description,
widget.product.description!,
// overflow: kIsWeb ? null : TextOverflow.ellipsis,
overflow: TextOverflow.ellipsis,
maxLines: 2,
@@ -150,7 +150,7 @@ class ProductItemState extends State<ProductItem> {
) : SizedBox.shrink(),
),
ShowPrice(
widget.product.price,
widget.product.price!,
regularPrice: widget.product.regularPrice,
currencySign: '\$',
fontWeight: FontWeight.bold,
@@ -212,7 +212,7 @@ class ProductItemState extends State<ProductItem> {
),
Container(
child: Text(
widget.product.description,
widget.product.description!,
// overflow: kIsWeb ? null : TextOverflow.ellipsis,
overflow: TextOverflow.ellipsis,
maxLines: 2,
@@ -238,7 +238,7 @@ class ProductItemState extends State<ProductItem> {
) : SizedBox.shrink(),
),
ShowPrice(
widget.product.price,
widget.product.price!,
regularPrice: widget.product.regularPrice,
currencySign: '\$',
fontWeight: FontWeight.bold,

View File

@@ -144,7 +144,7 @@ class ProductSearchState extends State<ProductSearch> {
if (result.response != null) {
throw RuntimeError(result.response!.data);
} else {
throw RuntimeError(result.message);
throw RuntimeError(result.message!);
}
} else if (result != null && result is List) {
lastBottomPosition = 0;

View File

@@ -206,7 +206,7 @@ class ShopState extends State<Shop> {
}
_productCurrentPage = 1;
Utils.loadProducts(
widget.businessId, categoryId, _productCurrentPage, false,
widget.businessId!, categoryId, _productCurrentPage, false,
(value) {
if (_isLoading) {
_isLoading = false;
@@ -251,7 +251,7 @@ class ShopState extends State<Shop> {
return;
}
_productCurrentPage += 1;
Utils.loadProducts(widget.businessId, categoryId, _productCurrentPage, true, (value) {
Utils.loadProducts(widget.businessId!, categoryId, _productCurrentPage, true, (value) {
if (_isLoading) {
_isLoading = false;
Navigator.of(context).pop();

View File

@@ -50,7 +50,7 @@ class ShopBulletinState extends State<ShopBulletin> {
decoration: BoxDecoration(
color: Colors.orangeAccent,
border: Border.all(
color: Colors.red[500],
color: Colors.red[500]!,
width: 1.0,
),
borderRadius: BorderRadius.all(Radius.circular(16)),

View File

@@ -135,7 +135,7 @@ class ShopProductsState extends State<ShopProducts> {
child: Container(
margin: EdgeInsets.only(top: 5.0, bottom: 5.0),
child: Text(
cp.name,
cp.name!,
style: TextStyle(
fontSize: 13.0,
fontWeight: (cp.id == Constants.FEATURED_PRODUCT_ID ||
@@ -182,7 +182,7 @@ class ShopProductsState extends State<ShopProducts> {
new BorderSide(color: new Color(0xFFEBEBEB)))),
child: categoryRow,
),
onTap: () => _selectCategory(cp.id),
onTap: () => _selectCategory(cp.id!),
);
}
),
@@ -207,7 +207,7 @@ class ShopProductsState extends State<ShopProducts> {
CategoryProducts cp = _categoryProducts[i];
if (cp.products!.length > 0) {
col.children.add(new Container(
height: _categoryDescHeight,
height: _categoryDescHeight!,
padding: new EdgeInsets.symmetric(horizontal: 10.0),
color: new Color(0xFFF5F5F5),
child: new Row(
@@ -221,7 +221,7 @@ class ShopProductsState extends State<ShopProducts> {
new Padding(
padding: new EdgeInsets.only(right: 5.0),
child: new Text(
cp.name,
cp.name!,
style: new TextStyle(
fontSize: 16.0,
fontWeight:
@@ -241,7 +241,7 @@ class ShopProductsState extends State<ShopProducts> {
new Visibility(
visible: cp.description!.isNotEmpty,
child: new Text(
cp.description,
cp.description!,
overflow: TextOverflow.ellipsis,
style: new TextStyle(
fontSize: 10.0,
@@ -388,7 +388,7 @@ class ShopProductsState extends State<ShopProducts> {
CategoryProducts currentCp =
getCategoryProductByCategoryId(categoryId);
if (currentCp != null) {
currentCp.products!.addAll(moreCategoryProducts[0].products);
currentCp.products!.addAll(moreCategoryProducts[0].products!);
} else {
displayProductByCategoryClickIndicator = S
.of(context)

View File

@@ -60,7 +60,7 @@ class ShoppingCartWidgetState extends State<ShoppingCartWidget> {
child: row,
width: 160.0,
),
onTap: widget.onTap,
onTap: widget.onTap!,
),
);
}

View File

@@ -61,7 +61,7 @@ class AddRemoveButtonState extends State<AddRemoveButton> {
Widget build(BuildContext context) {
if (widget.product!.leftNum == null) {
_qty = 0;
cartInfo = Utils.getCartInfoByBusiness(store.state.cartInfos, widget.business);
cartInfo = Utils.getCartInfoByBusiness(store.state.cartInfos, widget.business!);
if (cartInfo != null) {
for (var i = 0; i < cartInfo.productList!.length; i++) {
if (cartInfo.productList![i].product!.id == widget.product!.id
@@ -102,7 +102,7 @@ class AddRemoveButtonState extends State<AddRemoveButton> {
}
if (widget.addToBasket) {
_qty = 0;
cartInfo = Utils.getCartInfoByBusiness(store.state.cartInfos, widget.business);
cartInfo = Utils.getCartInfoByBusiness(store.state.cartInfos, widget.business!);
if (cartInfo != null) {
for (var i = 0; i < cartInfo.productList!.length; i++) {
if (cartInfo.productList![i].product!.id == widget.product!.id) {
@@ -195,7 +195,7 @@ class AddRemoveButtonState extends State<AddRemoveButton> {
);
} else {
_qty = 0;
cartInfo = Utils.getCartInfoByBusiness(store.state.cartInfos, widget.business);
cartInfo = Utils.getCartInfoByBusiness(store.state.cartInfos, widget.business!);
if (cartInfo != null) {
for (var i = 0; i < cartInfo.productList!.length; i++) {
if (cartInfo.productList![i].product!.id == widget.product!.id) {
@@ -336,9 +336,9 @@ class AddRemoveButtonState extends State<AddRemoveButton> {
product: widget.product, business: widget.business, startKey: startKey,)),
);
} else {
eventBus.fire(new OnProductWillAddToCart(widget.product, {},
eventBus.fire(new OnProductWillAddToCart(widget.product!, {},
widget.product!.price, widget.product!.description,
widget.business, buttonKey: startKey));
widget.business!, buttonKey: startKey));
}
}
}
@@ -375,7 +375,7 @@ class AddRemoveButtonState extends State<AddRemoveButton> {
}
} else {
eventBus.fire(new OnProductWillRemoveFromCart(
widget.product, -1, widget.business));
widget.product!, -1, widget.business!));
}
}

View File

@@ -24,7 +24,7 @@ class AnimationPointManager {
Animation animation = createAnimation(controller1);
AnimatedWidget animatedWidget = ParabolicAnimationWidget(
animation: animation,
animation: animation!,
stackKey: stackKey,
startKey: startKey,
endKey: endKey,
@@ -59,7 +59,7 @@ class AnimationPointManager {
Offset popupOffset = Offset.zero,
AnimationStatusListener? statusListener,
}) async {
controller2 = createController(vsync, duration);
controller2 = createController(vsync, duration!);
AnimatedWidget animatedWidget = PopupAnimationWidget(
animation: controller2.view,

View File

@@ -133,7 +133,7 @@ class CheckOptionsState extends OptionsBaseState<CheckOptions> {
if (selections.containsKey(product.productAttributes![index].name!.toUpperCase())) {
Map<String, dynamic> attrExtraJson = Utils.stringToJson(
Map<String, dynamic> attrExtraJson = Utils.stringToJson(!
product.productAttributes![index].extra);
if (attrExtraJson != null) {
var selectLimitIfFieldEqualsTo = Rule.getRule(
@@ -187,17 +187,17 @@ class CheckOptionsState extends OptionsBaseState<CheckOptions> {
}
for (var i = 0; i < productOptions.length; i++) {
Map<String, dynamic> extraJson = Utils.stringToJson(
productOptions[i].extra);
Map<String, dynamic> extraJson = Utils.stringToJson(!
productOptions[i].extra!);
if (extraJson != null) {
Map<String, dynamic> exclusiveRule = Rule.getRule(
extraJson, Rule.RULE_EXCLUSIVE_SELECTION);
Map<String, dynamic> multiItemRule = Rule.getRule(extraJson, Rule.RULE_ACTUAL_QTY_IS);
if (exclusiveRule != null) {
if (thisLimitQty > 0 && !_checkOptionIsCheck(productOptions[i].name)) {
if (thisLimitQty > 0 && !_checkOptionIsCheck(productOptions[i].name!)) {
optionsState[product.productAttributes![index].name][i]['disabled'] = true;
} else {
if (_checkOptionIsCheck(productOptions[i].name)) {
if (_checkOptionIsCheck(productOptions[i].name!)) {
setOptionsStateDisabled(
product.productAttributes![index].name, true);
optionsState[product.productAttributes![index]
@@ -207,7 +207,7 @@ class CheckOptionsState extends OptionsBaseState<CheckOptions> {
}
}
if (multiItemRule != null) {
if (_checkOptionIsCheck(productOptions[i].name)) {
if (_checkOptionIsCheck(productOptions[i].name!)) {
if (multiItemRule[Rule.RULE_ACTUAL_QTY_IS] > thisLimitQty - (selections[product.productAttributes![index].name!.toUpperCase()] as List).length) {
disableOptionIfNotSelected();
}
@@ -249,9 +249,9 @@ class CheckOptionsState extends OptionsBaseState<CheckOptions> {
Widget _getOptionCheck(ProductOption productOption, bool optDisabled, int optIndex) {
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);
double extraAdjustAmount = 0.0;
@@ -333,7 +333,7 @@ class CheckOptionsState extends OptionsBaseState<CheckOptions> {
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
new Text(
productOption.name,
productOption.name!,
style: new TextStyle(
fontSize: 14.0,
color: check ? selectedTextColor : deselectTextColor,

View File

@@ -131,7 +131,7 @@ class QtyOptionsState extends OptionsBaseState<QtyOptions> {
List<Map<String, dynamic>> optionState = [];
for (var i = 0; i < productOptions.length; i++) {
int qty = 0;
int idx = Utils.selectionsContains(selections, product.productAttributes![index].name, productOptions[i].name);
int idx = Utils.selectionsContains(selections, product.productAttributes![index].name, productOptions[i].name!);
if (idx != -1) {
qty = selections[product.productAttributes![index].name!.toUpperCase()][idx]['quantity'];
}
@@ -141,7 +141,7 @@ class QtyOptionsState extends OptionsBaseState<QtyOptions> {
}
if (selections.containsKey(product.productAttributes![index].name!.toUpperCase())) {
Map<String, dynamic> attrExtraJson = Utils.stringToJson(
Map<String, dynamic> attrExtraJson = Utils.stringToJson(!
product.productAttributes![index].extra);
if (attrExtraJson != null) {
var selectLimitIfFieldEqualsTo = Rule.getRule(
@@ -195,17 +195,17 @@ class QtyOptionsState extends OptionsBaseState<QtyOptions> {
}
for (var i = 0; i < productOptions.length; i++) {
Map<String, dynamic> extraJson = Utils.stringToJson(
productOptions[i].extra);
Map<String, dynamic> extraJson = Utils.stringToJson(!
productOptions[i].extra!);
if (extraJson != null) {
Map<String, dynamic> exclusiveRule = Rule.getRule(
extraJson, Rule.RULE_EXCLUSIVE_SELECTION);
Map<String, dynamic> multiItemRule = Rule.getRule(extraJson, Rule.RULE_ACTUAL_QTY_IS);
if (exclusiveRule != null) {
if (thisLimitQty > 0 && !_checkOptionIsCheck(productOptions[i].name)) {
if (thisLimitQty > 0 && !_checkOptionIsCheck(productOptions[i].name!)) {
optionsState[product.productAttributes![index].name][i]['disabled'] = true;
} else {
if (_checkOptionIsCheck(productOptions[i].name)) {
if (_checkOptionIsCheck(productOptions[i].name!)) {
setOptionsStateDisabled(
product.productAttributes![index].name, true);
optionsState[product.productAttributes![index]
@@ -215,7 +215,7 @@ class QtyOptionsState extends OptionsBaseState<QtyOptions> {
}
}
if (multiItemRule != null) {
if (_checkOptionIsCheck(productOptions[i].name)) {
if (_checkOptionIsCheck(productOptions[i].name!)) {
if (multiItemRule[Rule.RULE_ACTUAL_QTY_IS] > thisLimitQty - (selections[product.productAttributes![index].name!.toUpperCase()] as List).length) {
disableOptionIfNotSelected();
}
@@ -257,9 +257,9 @@ class QtyOptionsState extends OptionsBaseState<QtyOptions> {
Widget _getOptionQty(ProductOption productOption, bool optDisabled, int quantity, int optIndex) {
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);
double extraAdjustAmount = 0.0;
@@ -351,7 +351,7 @@ class QtyOptionsState extends OptionsBaseState<QtyOptions> {
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
new Text(
productOption.name,
productOption.name!,
style: new TextStyle(
fontSize: 14.0,
color: check ? selectedTextColor : deselectTextColor,

View File

@@ -96,12 +96,12 @@ 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);
if (exclusiveRule != null) {
if (_checkOptionIsCheck(productOption.name)) {
if (_checkOptionIsCheck(productOption.name!)) {
setOptionsStateDisabled(product.productAttributes![index].name, false);
}
}
@@ -129,12 +129,12 @@ class RadioOptionsState extends OptionsBaseState<RadioOptions> {
}
for (var i = 0; i < productOptions.length; i++) {
Map<String, dynamic> extraJson = Utils.stringToJson(productOptions[i].extra);
Map<String, dynamic> extraJson = Utils.stringToJson(productOptions[i].extra!);
if (extraJson != null) {
Map<String, dynamic> exclusiveRule = Rule.getRule(
extraJson, Rule.RULE_EXCLUSIVE_SELECTION);
if (exclusiveRule != null) {
if (_checkOptionIsCheck(productOptions[i].name)) {
if (_checkOptionIsCheck(productOptions[i].name!)) {
setOptionsStateDisabled(product.productAttributes![index].name, true);
optionsState[product.productAttributes![index].name][i]['disabled'] = false;
break;
@@ -161,9 +161,9 @@ class RadioOptionsState extends OptionsBaseState<RadioOptions> {
Widget _getOptionRadio(ProductOption productOption, bool optDisabled, int optIndex) {
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);
double extraAdjustAmount = 0.0;
@@ -245,7 +245,7 @@ class RadioOptionsState extends OptionsBaseState<RadioOptions> {
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
new Text(
productOption.name,
productOption.name!,
style: new TextStyle(
fontSize: 14.0,
color: check ? selectedTextColor : deselectTextColor,

View File

@@ -36,7 +36,7 @@ class ShowPrice extends StatelessWidget {
Container(
padding: EdgeInsets.only(top: largeFontSize / 10.0),
child: Text(
currencySign,
currencySign!,
style: TextStyle(
fontSize: smallFontSize,
color: color,

View File

@@ -258,7 +258,7 @@ class _SlidingUpPanelState extends State<SlidingUpPanel> with SingleTickerProvid
builder: (context, child){
return Positioned(
top: widget.parallaxEnabled ? _getParallax() : 0.0,
child: child,
child: child!,
);
},
child: Container(
@@ -334,14 +334,14 @@ class _SlidingUpPanelState extends State<SlidingUpPanel> with SingleTickerProvid
widget.header != null ? Positioned(
top: widget.slideDirection == SlideDirection.UP ? 0.0 : null,
bottom: widget.slideDirection == SlideDirection.DOWN ? 0.0 : null,
child: widget.header,
child: widget.header!,
) : Container(),
// footer
widget.footer != null ? Positioned(
top: widget.slideDirection == SlideDirection.UP ? null : 0.0,
bottom: widget.slideDirection == SlideDirection.DOWN ? null : 0.0,
child: widget.footer
child: widget.footer!
) : Container(),
// collapsed panel
@@ -471,7 +471,7 @@ class _SlidingUpPanelState extends State<SlidingUpPanel> with SingleTickerProvid
if(v.pixelsPerSecond.dy.abs() >= kSnap*minFlingVelocity || minDistance == d2Snap)
_ac.fling(velocity: visualVelocity);
else
_flingPanelToPosition(widget.snapPoint, visualVelocity);
_flingPanelToPosition(widget.snapPoint!, visualVelocity);
// no snap point exists
}else if(widget.panelSnapping){
@@ -495,7 +495,7 @@ class _SlidingUpPanelState extends State<SlidingUpPanel> with SingleTickerProvid
if(minDistance == d2Close){
_close();
}else if(minDistance == d2Snap){
_flingPanelToPosition(widget.snapPoint, visualVelocity);
_flingPanelToPosition(widget.snapPoint!, visualVelocity);
}else{
_open();
}
@@ -561,7 +561,7 @@ class _SlidingUpPanelState extends State<SlidingUpPanel> with SingleTickerProvid
//REQUIRES that widget.snapPoint != null
Future<void> _animatePanelToSnapPoint({Duration? duration, Curve curve = Curves.linear}){
assert(widget.snapPoint != null);
return _ac.animateTo(widget.snapPoint, duration: duration, curve: curve);
return _ac.animateTo(widget.snapPoint!, duration: duration, curve: curve);
}
//set the panel position to value - must

View File

@@ -187,7 +187,7 @@ class CreateOnlineStore1State extends State<CreateOnlineStore1> {
onPressed: () {
Navigator.pushReplacement(context, MaterialPageRoute(
builder: (BuildContext context) =>
BuyService(group.id, Constants.WEB_MINISTORE_SERVICE,
BuyService(group.id!, Constants.WEB_MINISTORE_SERVICE,
domain: existing_web_svc['domain'],
sid: existing_web_svc['store']['id'],
),
@@ -304,7 +304,7 @@ class CreateOnlineStore1State extends State<CreateOnlineStore1> {
onPressed: () {
Navigator.pushReplacement(context, MaterialPageRoute(
builder: (BuildContext context) =>
BuyService(group.id, Constants.WEB_MINISTORE_SERVICE,
BuyService(group.id!, Constants.WEB_MINISTORE_SERVICE,
domain: selectedDomain,
sid: selectedStore['id'],
),

View File

@@ -119,7 +119,7 @@ class MobileAttributeSelectionState extends State<MobileAttributeSelection> {
});
ProductAttribute pa = product.productAttributes![index];
if (pa.required && Utils.selectionsNotEmptyAt(selections, pa.name)) {
if (pa.required && Utils.selectionsNotEmptyAt(selections, pa.name!)) {
setState(() {
nextButtonEnable = true;
productDesc = product.description! + ', ' + extendDescription.join('; ');
@@ -143,7 +143,7 @@ class MobileAttributeSelectionState extends State<MobileAttributeSelection> {
bool _checkCanGoNext() {
ProductAttribute pa = product.productAttributes![index];
if (pa.required && Utils.selectionsNotEmptyAt(selections, pa.name)) {
if (pa.required && Utils.selectionsNotEmptyAt(selections, pa.name!)) {
return true;
} else if (!pa.required){
return true;
@@ -180,7 +180,7 @@ class MobileAttributeSelectionState extends State<MobileAttributeSelection> {
padding: new EdgeInsets.all(10.0),
width: 70.0,
height: 70.0,
child: Util.showImage(product.imagePath,
child: Util.showImage(product.imagePath!,
width: 70.0,
height: 70.0,
fit: BoxFit.fill,
@@ -194,7 +194,7 @@ class MobileAttributeSelectionState extends State<MobileAttributeSelection> {
new Container(
padding: new EdgeInsets.all(10.0).copyWith(left: 0.0).copyWith(bottom: 0.0),
child: new Text(
product.name,
product.name!,
style: new TextStyle(
fontSize: 15.0,
),

View File

@@ -165,7 +165,7 @@ class MobileBlogState extends State<MobileBlog> {
children: <Widget>[
Container(
child: Text(
blog.title,
blog.title!,
style: TextStyle(
fontSize: 19.0,
),
@@ -174,7 +174,7 @@ class MobileBlogState extends State<MobileBlog> {
),
Container(
child: Text(
Utils.utcDatetimeStringToLocalDatetimeString(context, blog.createdAt),
Utils.utcDatetimeStringToLocalDatetimeString(context, blog.createdAt!),
style: TextStyle(
fontSize: 13.0,
color: Colors.grey,
@@ -217,7 +217,7 @@ class MobileBlogState extends State<MobileBlog> {
_loadingFinish = false;
HttpUtil.httpGet(
'v1/blogs',
businessId: widget.businessId,
businessId: widget.businessId!,
queryParameters: {
'page': _page.toString(),
'size': Constants.BLOG_PER_PAGE_MOBILE.toString()

View File

@@ -86,7 +86,7 @@ class MobileBuyServiceState extends State<MobileBuyService> {
items: plans.map((e) {
return DropdownMenuItem<KeyValue>(
value: e,
child: Text(e.name),
child: Text(e.name!),
);
}).toList(),
isExpanded: true,

View File

@@ -281,7 +281,7 @@ class MobileCheckoutState extends State<MobileCheckout> with SingleTickerProvide
mainAxisSize: MainAxisSize.min,
children: [
Text(
S.of(context).table_token(store.state.tableNumber),
S.of(context).table_token(store.state.tableNumber!),
style: TextStyle(
fontSize: 20.0,
fontWeight: FontWeight.bold,
@@ -333,7 +333,7 @@ class MobileCheckoutState extends State<MobileCheckout> with SingleTickerProvide
icons: shippingMethodIcons,
onToggle: (index) {
selectedShippingRate = null;
deliveryMethod = getShippingMethod(index);
deliveryMethod = getShippingMethod(index!);
check();
},
initialLabelIndex: deliveryMethodIndex,
@@ -627,7 +627,7 @@ class MobileCheckoutState extends State<MobileCheckout> with SingleTickerProvide
children: <Widget>[
Container(
child: Text(
bookingTimeList.length > 0 ? '${Utils.timestampToString(context, bookingTimeList[bookingTimeIndex].unixTime)}'
bookingTimeList.length > 0 ? '${Utils.timestampToString(context, bookingTimeList[bookingTimeIndex].unixTime!)}'
: ((bookingTimeList.length == 0 && bookingDateTimeList.length == 0) ? ''
: bookingDateTimeList[bookingDateIndex].viewDate! + ' ' + (bookingDateTimeList[bookingDateIndex].bookTimes!.length > 0 ? bookingDateTimeList[bookingDateIndex].bookTimes![bookingTimeIndex].viewTime : '')),
),
@@ -681,7 +681,7 @@ class MobileCheckoutState extends State<MobileCheckout> with SingleTickerProvide
children: <Widget>[
Container(
child: Text(
paymentPlatforms.length == 0 ? S.of(context).pay_on_deliery : PaymentPlatform.getPaymentPlatformName(context, paymentPlatforms[paymentPlatformIndex].code),
paymentPlatforms.length == 0 ? S.of(context).pay_on_deliery : PaymentPlatform.getPaymentPlatformName(context, paymentPlatforms[paymentPlatformIndex].code!),
),
),
Container(
@@ -988,14 +988,14 @@ class MobileCheckoutState extends State<MobileCheckout> with SingleTickerProvide
children: <Widget>[
Container(
child: Text(
Utils.knownName(context, cartLineItem.name),
Utils.knownName(context, cartLineItem.name!),
maxLines: 1,
overflow: TextOverflow.ellipsis,
),
),
Container(
child: Text(
cartLineItem.description,
cartLineItem.description!,
style: TextStyle(
fontSize: 12.0,
color: Colors.black38,
@@ -1155,7 +1155,7 @@ class MobileCheckoutState extends State<MobileCheckout> with SingleTickerProvide
column.children.add(Container(
padding: EdgeInsets.only(left: 0.0, right: 0.0, top: 10.0, bottom: 0.0),
child: Text(
Utils.errorMsg2(context, messages[i].code, messages[i].string),
Utils.errorMsg2(context, messages[i].code!, messages[i].string!),
),
));
}
@@ -1215,7 +1215,7 @@ class MobileCheckoutState extends State<MobileCheckout> with SingleTickerProvide
child: Container(
padding: EdgeInsets.only(left: 16.0, right: 16.0, bottom: 10.0, top: 10.0),
child: Text(
'${Utils.timestampToString(context, bookingTime.unixTime)}',
'${Utils.timestampToString(context, bookingTime.unixTime!)}',
),
decoration: BoxDecoration(
border: Border(
@@ -1290,7 +1290,7 @@ class MobileCheckoutState extends State<MobileCheckout> with SingleTickerProvide
padding: EdgeInsets.only(left: 10.0, right: 10.0, top: 10.0, bottom: 10.0),
child: Center(
child: Text(
'${bookingDateTime.viewDate} (${Utils.getWeekDayName(context, bookingDateTime.unixTime, true)})',
'${bookingDateTime.viewDate} (${Utils.getWeekDayName(context, bookingDateTime.unixTime!, true)})',
),
),
),
@@ -1494,7 +1494,7 @@ class MobileCheckoutState extends State<MobileCheckout> with SingleTickerProvide
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Container(
child: Util.showImage(paymentPlatform.icon,
child: Util.showImage(paymentPlatform.icon!,
errorWidget: (context, url, error) => Icon(Icons.broken_image, size: 50.0, color: Colors.transparent,),
fit: BoxFit.cover,
width: 50.0,
@@ -1504,7 +1504,7 @@ class MobileCheckoutState extends State<MobileCheckout> with SingleTickerProvide
Container(
margin: EdgeInsets.only(left: 10.0),
child: Text(
PaymentPlatform.getPaymentPlatformName(context, paymentPlatform.code),
PaymentPlatform.getPaymentPlatformName(context, paymentPlatform.code!),
style: TextStyle(
fontSize: 18.0,
fontWeight: FontWeight.bold,
@@ -1556,7 +1556,7 @@ class MobileCheckoutState extends State<MobileCheckout> with SingleTickerProvide
for (var i = 0; i < coupons.length; i++) {
if (selectedCoupon == coupons[i].id) {
if (coupons[i].isPercentage) {
return S.of(context).percentage_discount_token2(couponDiscountAmount.toStringAsFixed(2), coupons[i].valueAmount);
return S.of(context).percentage_discount_token2(couponDiscountAmount.toStringAsFixed(2), coupons[i].valueAmount!);
} else {
return S.of(context).discount_amount_token(couponDiscountAmount.toStringAsFixed(2));
}
@@ -1782,7 +1782,7 @@ class MobileCheckoutState extends State<MobileCheckout> with SingleTickerProvide
Container(
padding: EdgeInsets.only(right: 5.0),
child: Text(
'${Utils.smartRound(coupon.valueAmount, 2)}',
'${Utils.smartRound(coupon.valueAmount!, 2)}',
style: TextStyle(
fontSize: 30.0,
color: Colors.redAccent,
@@ -1818,7 +1818,7 @@ class MobileCheckoutState extends State<MobileCheckout> with SingleTickerProvide
),
Container(
child: Text(
'${Utils.smartRound(coupon.valueAmount, 2)}',
'${Utils.smartRound(coupon.valueAmount!, 2)}',
style: TextStyle(
fontSize: 30.0,
color: Colors.redAccent,
@@ -1846,7 +1846,7 @@ class MobileCheckoutState extends State<MobileCheckout> with SingleTickerProvide
child: Text(
coupon.expirationDate != null ?
S.of(context).expiration_date_token(
coupon.expirationDate) :
coupon.expirationDate!) :
S.of(context)
.no_expiration,
style: TextStyle(
@@ -1859,7 +1859,7 @@ class MobileCheckoutState extends State<MobileCheckout> with SingleTickerProvide
child: Text(
coupon.minAmount! > 0 ?
S.of(context).min_order_amount_token(
coupon.minAmount) :
coupon.minAmount!) :
S.of(context)
.no_restriction,
style: TextStyle(
@@ -2101,7 +2101,7 @@ class MobileCheckoutState extends State<MobileCheckout> with SingleTickerProvide
left: 16.0, top: 16.0, right: 16.0, bottom: 16.0),
child: Container(
child: Text(
shippingRate.name,
shippingRate.name!,
style: TextStyle(
fontSize: 20.0,
),

View File

@@ -123,7 +123,7 @@ class MobileCouponsState extends State<MobileCoupons> {
overflow: TextOverflow.ellipsis,
),
Text(
coupon.description,
coupon.description!,
style: TextStyle(
fontSize: 12.0,
color: Colors.black26,
@@ -162,7 +162,7 @@ class MobileCouponsState extends State<MobileCoupons> {
),
Container(
child: Text(
'${Utils.smartRound(coupon.valueAmount, 2)}',
'${Utils.smartRound(coupon.valueAmount!, 2)}',
style: TextStyle(
fontSize: 28.0,
color: Colors.redAccent,
@@ -177,7 +177,7 @@ class MobileCouponsState extends State<MobileCoupons> {
children: <Widget>[
Container(
child: Text(
'${Utils.smartRound(coupon.valueAmount, 2)}',
'${Utils.smartRound(coupon.valueAmount!, 2)}',
style: TextStyle(
fontSize: 28.0,
color: Colors.redAccent,
@@ -199,7 +199,7 @@ class MobileCouponsState extends State<MobileCoupons> {
Container(
child: Text(
coupon.minAmount! > 0 ?
S.of(context).available_for_order_over_token(coupon.minAmount) :
S.of(context).available_for_order_over_token(coupon.minAmount!) :
S.of(context).no_restriction,
style: TextStyle(
fontSize: 10.0,
@@ -238,7 +238,7 @@ class MobileCouponsState extends State<MobileCoupons> {
child: Text(
coupon.expirationDate == null || coupon.expirationDate!.length == 0 ?
S.of(context).no_expiration :
S.of(context).expiration_date_token(coupon.expirationDate),
S.of(context).expiration_date_token(coupon.expirationDate!),
style: TextStyle(
color: Colors.black26,
fontSize: 15.0,

View File

@@ -243,7 +243,7 @@ class MobileLoginState extends State<MobileLogin> {
box.put(Constants.KEY_USER_ID, response.data['user_id']);
box.put(Constants.KEY_ACCESS_TOKEN, response.data['access_token']);
if (store.state.redirectRoute != null) {
Routes.router.navigateTo(context, store.state.redirectRoute, replace: true);
Routes.router.navigateTo(context, store.state.redirectRoute!, replace: true);
store.dispatch(UpdateRedirectRoute(null));
} else {
Routes.router.navigateTo(

View File

@@ -142,7 +142,7 @@ class MobileMeState extends State<MobileMe> {
Container(
child: Text(
_user != null
? Utils.safePhoneNumber(_user.mobile)
? Utils.safePhoneNumber(_user.mobile!)
: '',
style: TextStyle(
color:

View File

@@ -102,7 +102,7 @@ class MobileMyAddressesState extends State<MobileMyAddresses> {
children: <Widget>[
Container(
child: Text(
address.addressLine1,
address.addressLine1!,
style: TextStyle(
fontSize: 19.0,
),
@@ -110,7 +110,7 @@ class MobileMyAddressesState extends State<MobileMyAddresses> {
),
Container(
child: Text(
address.addressLine2,
address.addressLine2!,
style: TextStyle(
fontSize: 13.0,
color: Colors.grey,
@@ -120,7 +120,7 @@ class MobileMyAddressesState extends State<MobileMyAddresses> {
Container(
margin: EdgeInsets.only(top: 10.0),
child: Text(
'${address.contactName} ${Utils.safePhoneNumber(address.phone)}',
'${address.contactName} ${Utils.safePhoneNumber(address.phone!)}',
style: TextStyle(
fontSize: 15.0,
color: Colors.black87,
@@ -156,7 +156,7 @@ class MobileMyAddressesState extends State<MobileMyAddresses> {
),
onPressed: () {
Navigator.push(context, MaterialPageRoute(
builder: (BuildContext context) => new EditAddress(address, businessId: widget.businessId,),
builder: (BuildContext context) => new EditAddress(address, businessId: widget.businessId!,),
));
},
),

View File

@@ -188,7 +188,7 @@ class MobileMySupportState extends State<MobileMySupport> {
),
Container(
child: Text(
Utils.utcDatetimeStringToLocalDatetimeString(context, ticket.createdAt, withTime: true),
Utils.utcDatetimeStringToLocalDatetimeString(context, ticket.createdAt!, withTime: true),
style: TextStyle(
fontSize: 13.0,
color: Colors.grey,
@@ -247,7 +247,7 @@ class MobileMySupportState extends State<MobileMySupport> {
_loadingFinish = false;
HttpUtil.httpGet(
'v1/mysupport',
businessId: widget.businessId,
businessId: widget.businessId!,
queryParameters: {
'page': _page.toString(),
'size': Constants.TICKET_PER_PAGE_MOBILE.toString()

View File

@@ -217,7 +217,7 @@ class MobileNewCommentState extends State<MobileNewComment> {
child: Text(S.of(context).yes_i_am_sure),
onPressed: () {
Navigator.of(context).pop();
_deleteImage(image.id);
_deleteImage(image.id!);
},
),
],
@@ -269,7 +269,7 @@ class MobileNewCommentState extends State<MobileNewComment> {
context: mainContext,
barrierDismissible: true,
builder: (BuildContext context) {
return Util().getPicture(mainContext, store.state.user,
return Util().getPicture(mainContext, store.state.user!,
commentId: comment != null ? comment.id : 0,
orderId: widget.orderId);
}

View File

@@ -520,7 +520,7 @@ class MobileOrderDetailState extends State<MobileOrderDetail> {
margin: EdgeInsets.only(top: 10.0, bottom: 10.0),
alignment: Alignment.centerRight,
child: Text(
'${Utils.timestampToString(context, order.bookedAt, withTime: true)}',
'${Utils.timestampToString(context, order.bookedAt!, withTime: true)}',
style: TextStyle(
color: Colors.black38,
),
@@ -821,7 +821,7 @@ class MobileOrderDetailState extends State<MobileOrderDetail> {
margin: EdgeInsets.only(top: 10.0, bottom: 10.0),
alignment: Alignment.centerRight,
child: Text(
Utils.timestampToString(context, order.createdAt, withTime: true),
Utils.timestampToString(context, order.createdAt!, withTime: true),
style: TextStyle(
color: Colors.black38,
),
@@ -877,7 +877,7 @@ class MobileOrderDetailState extends State<MobileOrderDetail> {
),
),
Text(
Utils.getOrderStatus(context, order.status),
Utils.getOrderStatus(context, order.status!),
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
@@ -933,7 +933,7 @@ class MobileOrderDetailState extends State<MobileOrderDetail> {
),
Container(
child: Text(
'${Utils.utcDatetimeStringToLocalDatetimeString(context, fulfillment.createdAt, withTime: true)}',
'${Utils.utcDatetimeStringToLocalDatetimeString(context, fulfillment.createdAt!, withTime: true)}',
style: TextStyle(
fontSize: 12.0,
color: Colors.black26,
@@ -1021,7 +1021,7 @@ class MobileOrderDetailState extends State<MobileOrderDetail> {
S.of(context).order_again,
),
onPressed: () {
Utils.orderAgain(context, order.cartInfo);
Utils.orderAgain(context, order.cartInfo!);
},
),
),

View File

@@ -164,7 +164,7 @@ class MobileOrdersState extends State<MobileOrders> with SingleTickerProviderSta
if (order.cartInfo!.productList!.length > 1) {
row.children.add(Container(
child: Text(
S.of(context).and_more_item_token(Utils.getProductLineInOrder(order.cartInfo)),
S.of(context).and_more_item_token(Utils.getProductLineInOrder(order.cartInfo!)),
style: TextStyle(
fontSize: 12.0,
color: Colors.black26,
@@ -193,7 +193,7 @@ class MobileOrdersState extends State<MobileOrders> with SingleTickerProviderSta
),
onPressed: () {
Navigator.push(context, MaterialPageRoute(
builder: (BuildContext context) => OrderDetail(order.id, fromOrders: true,),
builder: (BuildContext context) => OrderDetail(order.id!, fromOrders: true,),
));
},
),
@@ -252,7 +252,7 @@ class MobileOrdersState extends State<MobileOrders> with SingleTickerProviderSta
backgroundColor: Theme.of(context).primaryColor,
),
onPressed: () {
Utils.orderAgain(context, order.cartInfo);
Utils.orderAgain(context, order.cartInfo!);
},
));
}
@@ -269,7 +269,7 @@ class MobileOrdersState extends State<MobileOrders> with SingleTickerProviderSta
backgroundColor: Theme.of(context).primaryColor,
),
onPressed: () {
Utils.orderAgain(context, order.cartInfo);
Utils.orderAgain(context, order.cartInfo!);
},
));
}
@@ -317,7 +317,7 @@ class MobileOrdersState extends State<MobileOrders> with SingleTickerProviderSta
),
Container(
child: Text(
'#${order.orderNum} ${Utils.timestampToString(context, order.createdAt, withTime: true)}',
'#${order.orderNum} ${Utils.timestampToString(context, order.createdAt!, withTime: true)}',
style: TextStyle(
fontSize: 12.0,
color: Colors.black26,
@@ -329,7 +329,7 @@ class MobileOrdersState extends State<MobileOrders> with SingleTickerProviderSta
),
onTap: () {
Navigator.push(context, MaterialPageRoute(
builder: (BuildContext context) => OrderDetail(order.id, fromOrders: true,),
builder: (BuildContext context) => OrderDetail(order.id!, fromOrders: true,),
));
},
),
@@ -340,7 +340,7 @@ class MobileOrdersState extends State<MobileOrders> with SingleTickerProviderSta
children: <Widget>[
Container(
child: Text(
'${Utils.getOrderStatus(context, order.status)}',
'${Utils.getOrderStatus(context, order.status!)}',
style: TextStyle(
fontSize: 15.0,
fontWeight: FontWeight.bold,
@@ -375,7 +375,7 @@ class MobileOrdersState extends State<MobileOrders> with SingleTickerProviderSta
),
onTap: () {
Navigator.push(context, MaterialPageRoute(
builder: (BuildContext context) => OrderDetail(order.id, fromOrders: true,),
builder: (BuildContext context) => OrderDetail(order.id!, fromOrders: true,),
));
},
),

View File

@@ -162,7 +162,7 @@ class MobilePayNowState extends State<MobilePayNow> {
children: <Widget>[
Container(
padding: EdgeInsets.only(right: 10.0),
child: Util.showImage(paymentPlatform.icon,
child: Util.showImage(paymentPlatform.icon!,
errorWidget: (context, url, error) => Icon(Icons.broken_image, size: 50.0, color: Colors.transparent,),
fit: BoxFit.cover,
width: 50.0,
@@ -171,7 +171,7 @@ class MobilePayNowState extends State<MobilePayNow> {
),
Expanded(
child: Text(
S.of(context).pay_with_token(PaymentPlatform.getPaymentPlatformName(context, paymentPlatform.code)),
S.of(context).pay_with_token(PaymentPlatform.getPaymentPlatformName(context, paymentPlatform.code!)),
style: TextStyle(
fontSize: 18.0,
fontWeight: FontWeight.bold,

View File

@@ -28,7 +28,7 @@ class MobilePlainPageState extends State<MobilePlainPage> {
padding: EdgeInsets.only(top: 20, left: 16.0, right: 16.0, bottom: 16.0),
child: Center(
child: Text(
widget.blog.title,
widget.blog.title!,
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 20,
@@ -40,7 +40,7 @@ class MobilePlainPageState extends State<MobilePlainPage> {
padding: EdgeInsets.only(left: 16.0, right: 16.0, bottom: 20.0),
child: MarkdownBody(
shrinkWrap: true,
data: widget.blog.body,
data: widget.blog.body!,
),
));
@@ -52,7 +52,7 @@ class MobilePlainPageState extends State<MobilePlainPage> {
Navigator.of(context).pop();
},
),
title: Text(widget.blog.title),
title: Text(widget.blog.title!),
backgroundColor: Theme.of(context).primaryColor,
),
body: SingleChildScrollView(

View File

@@ -133,7 +133,7 @@ class MobileProductDetailPageState extends State<MobileProductDetailPage>
padding:
EdgeInsets.only(left: 10.0, top: 5.0, right: 10.0),
child: Text(
productDetail.name,
productDetail.name!,
style: TextStyle(
fontSize: 15.0, fontWeight: FontWeight.bold),
maxLines: 1,
@@ -144,7 +144,7 @@ class MobileProductDetailPageState extends State<MobileProductDetailPage>
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
ShowPrice(
productDetail.price,
productDetail.price!,
currencySign: '\$',
fontWeight: FontWeight.bold,
smallFontSize: 14,
@@ -205,13 +205,13 @@ class MobileProductDetailPageState extends State<MobileProductDetailPage>
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
(productDetail.subproducts!.length > 0) ?
subProducts(productDetail.subproducts) :
subProducts(productDetail.subproducts!) :
SizedBox.shrink(),
Container(
padding: EdgeInsets.only(
top: 10.0, left: 10.0, right: 10.0),
child: Text(
productDetail.description,
productDetail.description!,
style: TextStyle(
fontSize: 14.0, color: Colors.black54),
),
@@ -250,7 +250,7 @@ class MobileProductDetailPageState extends State<MobileProductDetailPage>
children: <Widget>[
Container(
child: Text(
S.of(context).weight_token(productDetail.weight),
S.of(context).weight_token(productDetail.weight!),
style: TextStyle(
fontSize: 12.0,
color: Colors.black54,
@@ -260,9 +260,9 @@ class MobileProductDetailPageState extends State<MobileProductDetailPage>
Container(
child: Text(
S.of(context).dimentions_token(
productDetail.dimentionsLength,
productDetail.dimentionsWidth,
productDetail.dimentionsHeight),
productDetail.dimentionsLength!,
productDetail.dimentionsWidth!,
productDetail.dimentionsHeight!),
style: TextStyle(
fontSize: 12.0,
color: Colors.black54,
@@ -291,7 +291,7 @@ class MobileProductDetailPageState extends State<MobileProductDetailPage>
_tabController = TabController(vsync: this, length: 2);
HttpUtil.httpGet(
'v1/product-detail/${widget.product.id}',
businessId: widget.business.id,
businessId: widget.business.id!,
).then((value) {
productDetail = ProductDetail.fromJson(value);
setState(() {
@@ -418,7 +418,7 @@ class MobileProductDetailPageState extends State<MobileProductDetailPage>
List<Widget> _getProductPictures(BuildContext context) {
var pages = <Widget>[];
List<String> images = [];
images.add(productDetail.image);
images.add(productDetail.image!);
for (var i = 0; i < productDetail.images!.length; i++) {
// print('>>https:' + productDetail.images[i].image);
images.add(productDetail.images![i].image);

View File

@@ -55,8 +55,8 @@ class MobileSearchPlaceState extends State<MobileSearchPlace> {
onSearch: search,
onItemFound: (LocatedAddress locatedAddress, int index) {
return ListTile(
title: Text(locatedAddress.streetName),
subtitle: Text(locatedAddress.formattedAddress),
title: Text(locatedAddress.streetName!),
subtitle: Text(locatedAddress.formattedAddress!),
onTap: () {
if (widget.businessId == 0) {
_selectPlace(locatedAddress);
@@ -109,7 +109,7 @@ class MobileSearchPlaceState extends State<MobileSearchPlace> {
if (result.response != null) {
throw RuntimeError(result.response!.data['message']);
} else {
throw RuntimeError(result.message);
throw RuntimeError(result.message!);
}
} else if (result != null && result is List) {
return result.map((e) => LocatedAddress.fromJson(e)).toList();

View File

@@ -107,7 +107,7 @@ class MobileStoreProductSearchState extends State<MobileStoreProductSearch> {
if (result.response != null) {
throw RuntimeError(result.response!.data);
} else {
throw RuntimeError(result.message);
throw RuntimeError(result.message!);
}
} else if (result != null && result is List) {
lastBottomPosition = 0;

View File

@@ -129,7 +129,7 @@ class MobileUserProfileState extends State<MobileUserProfile> {
),
Container(
child: Text(
_user.nickname,
_user.nickname!,
style: TextStyle(
color: Colors.grey
),
@@ -229,7 +229,7 @@ class MobileUserProfileState extends State<MobileUserProfile> {
),
Container(
child: Text(
_user.mobile != null && _user.mobile!.isNotEmpty ? Utils.safePhoneNumber(_user.mobile) : S.of(context).not_binding,
_user.mobile != null && _user.mobile!.isNotEmpty ? Utils.safePhoneNumber(_user.mobile!) : S.of(context).not_binding,
style: TextStyle(
color: Colors.grey,
),
@@ -282,7 +282,7 @@ class MobileUserProfileState extends State<MobileUserProfile> {
),
Container(
child: Text(
_user.email != null && _user.email!.isNotEmpty ? Utils.safePhoneNumber(_user.email) : S.of(context).not_binding,
_user.email != null && _user.email!.isNotEmpty ? Utils.safePhoneNumber(_user.email!) : S.of(context).not_binding,
style: TextStyle(
color: Colors.grey,
),

View File

@@ -93,7 +93,7 @@ class MobileViewBlogState extends State<MobileViewBlog> {
),
),
Text(
Utils.utcDatetimeStringToLocalDatetimeString(context, blog.createdAt),
Utils.utcDatetimeStringToLocalDatetimeString(context, blog.createdAt!),
style: TextStyle(
fontSize: 14.0,
color: Colors.black38,

View File

@@ -103,14 +103,14 @@ class MobileViewTicketState extends State<MobileViewTicket> {
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Text(
S.of(context).ticket_number_token(ticket.id),
S.of(context).ticket_number_token(ticket.id!),
style: TextStyle(
fontSize: 24.0,
color: Colors.black
),
),
Text(
Utils.utcDatetimeStringToLocalDatetimeString(context, ticket.createdAt),
Utils.utcDatetimeStringToLocalDatetimeString(context, ticket.createdAt!),
style: TextStyle(
fontSize: 14.0,
color: Colors.black38,
@@ -211,7 +211,7 @@ class MobileViewTicketState extends State<MobileViewTicket> {
Text(
Utils.utcDatetimeStringToLocalDatetimeString(
context,
followUp.createdAt
followUp.createdAt!
),
style: TextStyle(
fontSize: 14.0,
@@ -242,7 +242,7 @@ class MobileViewTicketState extends State<MobileViewTicket> {
Container(
padding: EdgeInsets.only(top: 8.0, left: 8.0, right: 8.0, bottom: 20.0),
child: showGalleryImages(
mainContext, followUp.files,
mainContext, followUp.files!,
),
),
],

View File

@@ -99,7 +99,7 @@ class ProductItemState extends State<ProductItem> {
),
),
Text(
widget.product.description,
widget.product.description!,
// overflow: kIsWeb ? null : TextOverflow.ellipsis,
overflow: TextOverflow.ellipsis,
maxLines: 2,
@@ -134,7 +134,7 @@ class ProductItemState extends State<ProductItem> {
) : SizedBox.shrink(),
),
ShowPrice(
widget.product.price,
widget.product.price!,
regularPrice: widget.product.regularPrice,
currencySign: '\$',
fontWeight: FontWeight.bold,
@@ -193,7 +193,7 @@ class ProductItemState extends State<ProductItem> {
),
Container(
child: Text(
widget.product.description,
widget.product.description!,
// overflow: kIsWeb ? null : TextOverflow.ellipsis,
overflow: TextOverflow.ellipsis,
maxLines: 2,
@@ -219,7 +219,7 @@ class ProductItemState extends State<ProductItem> {
) : SizedBox.shrink(),
),
ShowPrice(
widget.product.price,
widget.product.price!,
regularPrice: widget.product.regularPrice,
currencySign: '\$',
fontWeight: FontWeight.bold,

View File

@@ -115,7 +115,7 @@ class ProductSearchState extends State<ProductSearch> {
if (result.response != null) {
throw RuntimeError(result.response!.data);
} else {
throw RuntimeError(result.message);
throw RuntimeError(result.message!);
}
} else if (result != null && result is List) {
lastBottomPosition = 0;

View File

@@ -140,7 +140,7 @@ class ShopState extends State<Shop>
'page': _commentPage.toString(),
'size': Constants.ORDERS_PER_PAGE.toString(),
},
businessId: _business.id,
businessId: _business.id!,
).then((data) {
if (isRefresh) {
_commentRefreshController.refreshCompleted();
@@ -403,7 +403,7 @@ class ShopState extends State<Shop>
child: new Icon(Icons.phone),
onTap: () {
Utils.launchURL(
'tel:${Utils.getFirstNumberFromString(_business.phone)}');
'tel:${Utils.getFirstNumberFromString(_business.phone!)}');
},
),
),
@@ -628,7 +628,7 @@ class ShopState extends State<Shop>
Container(
padding: EdgeInsets.only(bottom: 16.0),
child: ReadMoreText(
comment.replyFromStore,
comment.replyFromStore!,
style: TextStyle(
fontSize: 13.0,
color: Colors.black54,
@@ -657,7 +657,7 @@ class ShopState extends State<Shop>
margin: EdgeInsets.only(bottom: 5.0),
width: double.infinity,
child: ReadMoreText(
comment.content,
comment.content!,
trimLines: 3,
trimLength: 66,
colorClickableText: Colors.blue,
@@ -689,10 +689,10 @@ class ShopState extends State<Shop>
),
Container(
child: Text(
Utils.safeString(comment.contact) +
Utils.safeString(comment.contact!) +
' ' +
Utils.utcDatetimeStringToLocalDatetimeString(
context, comment.createdAt),
context, comment.createdAt!),
style: TextStyle(
fontSize: 12.0,
color: Colors.black26,
@@ -825,7 +825,7 @@ class ShopState extends State<Shop>
distanceRow.children.add(
new Text(
' / ' +
S.of(context).min_order_amount_token(_business.minPrice) +
S.of(context).min_order_amount_token(_business.minPrice!) +
' ',
style: new TextStyle(fontSize: 13.0, color: const Color(0xFFEEEEEE)),
),
@@ -895,7 +895,7 @@ class ShopState extends State<Shop>
color: Colors.white,
),
new Text(
_business.phone,
_business.phone!,
style: new TextStyle(
fontSize: 13.0, color: const Color(0xFFEEEEEE)),
)
@@ -996,7 +996,7 @@ class ShopState extends State<Shop>
padding:
EdgeInsets.only(left: 10.0, right: 10.0, top: 5.0, bottom: 5.0),
child: Text(
_business.description,
_business.description!,
style: TextStyle(
color: Colors.lightGreen,
fontSize: 12.0,
@@ -1040,7 +1040,7 @@ class ShopState extends State<Shop>
padding: EdgeInsets.only(left: 10.0, right: 10.0, bottom: 10.0),
child: SingleChildScrollView(
child: Text(
_business.policy,
_business.policy!,
softWrap: true,
style: TextStyle(
fontSize: 10.0,
@@ -1062,7 +1062,7 @@ class ShopState extends State<Shop>
right: 0,
bottom: 0,
child: Util.showImage(
_business.bannerImageUrl,
_business.bannerImageUrl!,
fit: BoxFit.cover,
),
),
@@ -1158,7 +1158,7 @@ class ShopState extends State<Shop>
child: Container(
margin: EdgeInsets.only(top: 5.0, bottom: 5.0),
child: Text(
cp.name,
cp.name!,
style: TextStyle(
fontSize: 13.0,
fontWeight: (cp.id == Constants.FEATURED_PRODUCT_ID ||
@@ -1371,7 +1371,7 @@ class ShopState extends State<Shop>
children: <Widget>[],
);
col.children.add(new Container(
height: _categoryDescHeight,
height: _categoryDescHeight!,
padding: new EdgeInsets.symmetric(horizontal: 10.0),
color: new Color(0xFFF5F5F5),
child: new Row(
@@ -1385,7 +1385,7 @@ class ShopState extends State<Shop>
new Padding(
padding: new EdgeInsets.only(right: 5.0),
child: new Text(
cp.name,
cp.name!,
style: new TextStyle(
fontSize: 16.0,
fontWeight:
@@ -1405,7 +1405,7 @@ class ShopState extends State<Shop>
new Visibility(
visible: cp.description!.isNotEmpty,
child: new Text(
cp.description,
cp.description!,
overflow: TextOverflow.ellipsis,
style: new TextStyle(
fontSize: 10.0,
@@ -1532,7 +1532,7 @@ class ShopState extends State<Shop>
}
_productCurrentPage = 1;
Utils.loadProducts(
widget.businessId, categoryId, _productCurrentPage, false,
widget.businessId!, categoryId, _productCurrentPage, false,
(value) {
if (_isLoading) {
_isLoading = false;
@@ -1605,7 +1605,7 @@ class ShopState extends State<Shop>
return;
}
_productCurrentPage += 1;
Utils.loadProducts(widget.businessId, categoryId, _productCurrentPage, true,
Utils.loadProducts(widget.businessId!, categoryId, _productCurrentPage, true,
(value) {
if (_isLoading) {
_isLoading = false;
@@ -1631,7 +1631,7 @@ class ShopState extends State<Shop>
CategoryProducts currentCp =
getCategoryProductByCategoryId(categoryId);
if (currentCp != null) {
currentCp.products!.addAll(moreCategoryProducts[0].products);
currentCp.products!.addAll(moreCategoryProducts[0].products!);
} else {
_productCurrentPage = 0;
displayProductByCategoryClickIndicator =
@@ -1844,7 +1844,7 @@ class ShopState extends State<Shop>
} else {
DateTime now = DateTime.now();
if (!(now.hour >= business.todayOpen &&
now.hour <= business.todayClose)) {
now.hour <= business.todayClose!)) {
showDialog(
context: context,
builder: (BuildContext context) {
@@ -1876,7 +1876,7 @@ class ShopState extends State<Shop>
Container(
child: Text(
S.of(context).book_now_delivery_later_token(
business.todayOpen),
business.todayOpen!),
style: TextStyle(
color: Colors.black38,
),

View File

@@ -270,7 +270,7 @@ class ShoppingCartBarState extends State<ShoppingCartBar> {
children: <Widget>[
Container(
child: Text(
item.name,
item.name!,
maxLines: 1,
style: TextStyle(
color: Colors.black87,
@@ -281,7 +281,7 @@ class ShoppingCartBarState extends State<ShoppingCartBar> {
),
Container(
child: Text(
item.description,
item.description!,
style: TextStyle(
color: Colors.black38,
fontSize: 10.0