phase3: nullfix arg-bang handler (argument_type/invalid_assignment). 872 -> 621
This commit is contained in:
@@ -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'],
|
||||
),
|
||||
|
||||
@@ -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,
|
||||
),
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
),
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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!,),
|
||||
));
|
||||
},
|
||||
),
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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!);
|
||||
},
|
||||
),
|
||||
),
|
||||
|
||||
@@ -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,),
|
||||
));
|
||||
},
|
||||
),
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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,
|
||||
),
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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!,
|
||||
),
|
||||
),
|
||||
],
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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,
|
||||
),
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user