fix(runtime): 37 late fields with == null checks were wrongly migrated -> nullable. Fixes LateInitializationError crashes on page navigation (shop/checkout/comment/data pages)
This commit is contained in:
@@ -30,7 +30,7 @@ class BuyService extends StatefulWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class BuyServiceState extends State<BuyService> {
|
class BuyServiceState extends State<BuyService> {
|
||||||
late Map<String, dynamic> data;
|
Map<String, dynamic>? data;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
@@ -51,9 +51,9 @@ class BuyServiceState extends State<BuyService> {
|
|||||||
return ResponsiveBuilder(
|
return ResponsiveBuilder(
|
||||||
builder: (context, sizingInformation) =>
|
builder: (context, sizingInformation) =>
|
||||||
ScreenTypeLayout(
|
ScreenTypeLayout(
|
||||||
mobile: MobileBuyService(data),
|
mobile: MobileBuyService(data!),
|
||||||
tablet: DesktopBuyService(data),
|
tablet: DesktopBuyService(data!),
|
||||||
desktop: DesktopBuyService(data),
|
desktop: DesktopBuyService(data!),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -73,7 +73,7 @@ class BuyServiceState extends State<BuyService> {
|
|||||||
}
|
}
|
||||||
).then((value) {
|
).then((value) {
|
||||||
data = value;
|
data = value;
|
||||||
data['domain'] = widget.domain;
|
data!['domain'] = widget.domain;
|
||||||
print('data: $data');
|
print('data: $data');
|
||||||
setState(() {});
|
setState(() {});
|
||||||
}).onError((error, stackTrace) {
|
}).onError((error, stackTrace) {
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ class ContactUs extends StatefulWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class ContactUsState extends State<ContactUs> {
|
class ContactUsState extends State<ContactUs> {
|
||||||
late Business business;
|
Business? business;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
@@ -43,9 +43,9 @@ class ContactUsState extends State<ContactUs> {
|
|||||||
return ResponsiveBuilder(
|
return ResponsiveBuilder(
|
||||||
builder: (context, sizingInformation) =>
|
builder: (context, sizingInformation) =>
|
||||||
ScreenTypeLayout(
|
ScreenTypeLayout(
|
||||||
mobile: MobileContactUs(business),
|
mobile: MobileContactUs(business!),
|
||||||
tablet: DesktopContactUs(business),
|
tablet: DesktopContactUs(business!),
|
||||||
desktop: DesktopContactUs(business),
|
desktop: DesktopContactUs(business!),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ class Download extends StatefulWidget {
|
|||||||
|
|
||||||
class DownloadState extends State<Download> {
|
class DownloadState extends State<Download> {
|
||||||
final _scaffoldKey = GlobalKey<ScaffoldState>();
|
final _scaffoldKey = GlobalKey<ScaffoldState>();
|
||||||
late Map<String, dynamic> data;
|
Map<String, dynamic>? data;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
@@ -58,11 +58,11 @@ class DownloadState extends State<Download> {
|
|||||||
),
|
),
|
||||||
drawer: sizingInformation.deviceScreenType == DeviceScreenType.mobile ? MobileNavigationDrawer() : null,
|
drawer: sizingInformation.deviceScreenType == DeviceScreenType.mobile ? MobileNavigationDrawer() : null,
|
||||||
body: ScreenTypeLayout(
|
body: ScreenTypeLayout(
|
||||||
mobile: MobileDownloadApps(data),
|
mobile: MobileDownloadApps(data!),
|
||||||
tablet: DesktopDownloadApps(data),
|
tablet: DesktopDownloadApps(data!),
|
||||||
desktop: Scrollbar(
|
desktop: Scrollbar(
|
||||||
thumbVisibility: true,
|
thumbVisibility: true,
|
||||||
child: DesktopDownloadApps(data),
|
child: DesktopDownloadApps(data!),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
bottomNavigationBar: ScreenTypeLayout(
|
bottomNavigationBar: ScreenTypeLayout(
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ class IGoShowLearnMore extends StatefulWidget {
|
|||||||
|
|
||||||
class IGoShowLearnMoreState extends State<IGoShowLearnMore> {
|
class IGoShowLearnMoreState extends State<IGoShowLearnMore> {
|
||||||
final _scaffoldKey = GlobalKey<ScaffoldState>();
|
final _scaffoldKey = GlobalKey<ScaffoldState>();
|
||||||
late Map<String, dynamic> data;
|
Map<String, dynamic>? data;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
@@ -56,9 +56,9 @@ class IGoShowLearnMoreState extends State<IGoShowLearnMore> {
|
|||||||
),
|
),
|
||||||
drawer: null,
|
drawer: null,
|
||||||
body: ScreenTypeLayout(
|
body: ScreenTypeLayout(
|
||||||
mobile: MobileiGoShowLearnMore(data),
|
mobile: MobileiGoShowLearnMore(data!),
|
||||||
tablet: DesktopiGoShowLearnMore(data),
|
tablet: DesktopiGoShowLearnMore(data!),
|
||||||
desktop: DesktopiGoShowLearnMore(data),
|
desktop: DesktopiGoShowLearnMore(data!),
|
||||||
),
|
),
|
||||||
bottomNavigationBar: ScreenTypeLayout(
|
bottomNavigationBar: ScreenTypeLayout(
|
||||||
mobile: MobileBottomNav(currentIndex: 0,),
|
mobile: MobileBottomNav(currentIndex: 0,),
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ class MiniPosLearnMore extends StatefulWidget {
|
|||||||
|
|
||||||
class MiniPosLearnMoreState extends State<MiniPosLearnMore> {
|
class MiniPosLearnMoreState extends State<MiniPosLearnMore> {
|
||||||
final _scaffoldKey = GlobalKey<ScaffoldState>();
|
final _scaffoldKey = GlobalKey<ScaffoldState>();
|
||||||
late Map<String, dynamic> data;
|
Map<String, dynamic>? data;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
@@ -57,9 +57,9 @@ class MiniPosLearnMoreState extends State<MiniPosLearnMore> {
|
|||||||
),
|
),
|
||||||
drawer: null,
|
drawer: null,
|
||||||
body: ScreenTypeLayout(
|
body: ScreenTypeLayout(
|
||||||
mobile: MobileMiniPosLearnMore(data),
|
mobile: MobileMiniPosLearnMore(data!),
|
||||||
tablet: DesktopMiniPosLearnMore(data),
|
tablet: DesktopMiniPosLearnMore(data!),
|
||||||
desktop: DesktopMiniPosLearnMore(data),
|
desktop: DesktopMiniPosLearnMore(data!),
|
||||||
),
|
),
|
||||||
bottomNavigationBar: ScreenTypeLayout(
|
bottomNavigationBar: ScreenTypeLayout(
|
||||||
mobile: MobileBottomNav(currentIndex: 0,),
|
mobile: MobileBottomNav(currentIndex: 0,),
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ class PlainPage extends StatefulWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class PlainPageState extends State<PlainPage> {
|
class PlainPageState extends State<PlainPage> {
|
||||||
late Blog blog;
|
Blog? blog;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
@@ -44,9 +44,9 @@ class PlainPageState extends State<PlainPage> {
|
|||||||
return ResponsiveBuilder(
|
return ResponsiveBuilder(
|
||||||
builder: (context, sizingInformation) =>
|
builder: (context, sizingInformation) =>
|
||||||
ScreenTypeLayout(
|
ScreenTypeLayout(
|
||||||
mobile: MobilePlainPage(blog),
|
mobile: MobilePlainPage(blog!),
|
||||||
tablet: DesktopPlainPage(blog),
|
tablet: DesktopPlainPage(blog!),
|
||||||
desktop: DesktopPlainPage(blog),
|
desktop: DesktopPlainPage(blog!),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ class RenewMiniOffice extends StatefulWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class RenewMiniOfficeState extends State<RenewMiniOffice> {
|
class RenewMiniOfficeState extends State<RenewMiniOffice> {
|
||||||
late Map<String, dynamic> data;
|
Map<String, dynamic>? data;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
@@ -46,9 +46,9 @@ class RenewMiniOfficeState extends State<RenewMiniOffice> {
|
|||||||
return ResponsiveBuilder(
|
return ResponsiveBuilder(
|
||||||
builder: (context, sizingInformation) =>
|
builder: (context, sizingInformation) =>
|
||||||
ScreenTypeLayout(
|
ScreenTypeLayout(
|
||||||
mobile: MobileRenewMiniOffice(data),
|
mobile: MobileRenewMiniOffice(data!),
|
||||||
tablet: DesktopRenewMiniOffice(data),
|
tablet: DesktopRenewMiniOffice(data!),
|
||||||
desktop: DesktopRenewMiniOffice(data),
|
desktop: DesktopRenewMiniOffice(data!),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ class DoubleBackToCloseApp extends StatefulWidget {
|
|||||||
|
|
||||||
class _DoubleBackToCloseAppState extends State<DoubleBackToCloseApp> {
|
class _DoubleBackToCloseAppState extends State<DoubleBackToCloseApp> {
|
||||||
/// The last time the user tapped Android's back-button.
|
/// The last time the user tapped Android's back-button.
|
||||||
late DateTime _lastTimeBackButtonWasTapped;
|
DateTime? _lastTimeBackButtonWasTapped;
|
||||||
|
|
||||||
/// Returns whether the current platform is Android.
|
/// Returns whether the current platform is Android.
|
||||||
bool get _isAndroid => Theme.of(context).platform == TargetPlatform.android;
|
bool get _isAndroid => Theme.of(context).platform == TargetPlatform.android;
|
||||||
@@ -50,7 +50,7 @@ class _DoubleBackToCloseAppState extends State<DoubleBackToCloseApp> {
|
|||||||
bool get _isSnackBarVisible =>
|
bool get _isSnackBarVisible =>
|
||||||
(_lastTimeBackButtonWasTapped != null) &&
|
(_lastTimeBackButtonWasTapped != null) &&
|
||||||
(widget.snackBar.duration >
|
(widget.snackBar.duration >
|
||||||
DateTime.now().difference(_lastTimeBackButtonWasTapped));
|
DateTime.now().difference(_lastTimeBackButtonWasTapped!));
|
||||||
|
|
||||||
/// Returns whether the next back navigation of this route will be handled
|
/// Returns whether the next back navigation of this route will be handled
|
||||||
/// internally.
|
/// internally.
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ class CreateOnlineStore1State extends State<CreateOnlineStore1> {
|
|||||||
bool canSubmit = false;
|
bool canSubmit = false;
|
||||||
|
|
||||||
List<dynamic> stores = [];
|
List<dynamic> stores = [];
|
||||||
late Map<String, dynamic> service;
|
Map<String, dynamic>? service;
|
||||||
dynamic selectedStore;
|
dynamic selectedStore;
|
||||||
|
|
||||||
late Group group;
|
late Group group;
|
||||||
@@ -322,7 +322,7 @@ class CreateOnlineStore1State extends State<CreateOnlineStore1> {
|
|||||||
Container(
|
Container(
|
||||||
padding: EdgeInsets.only(top: 8.0),
|
padding: EdgeInsets.only(top: 8.0),
|
||||||
child: Text(
|
child: Text(
|
||||||
service['description'],
|
service!['description'],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
@@ -330,7 +330,7 @@ class CreateOnlineStore1State extends State<CreateOnlineStore1> {
|
|||||||
Container(
|
Container(
|
||||||
padding: EdgeInsets.only(top: 8.0),
|
padding: EdgeInsets.only(top: 8.0),
|
||||||
child: Text(
|
child: Text(
|
||||||
service['options'][0]['name'],
|
service!['options'][0]['name'],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
@@ -338,7 +338,7 @@ class CreateOnlineStore1State extends State<CreateOnlineStore1> {
|
|||||||
Container(
|
Container(
|
||||||
padding: EdgeInsets.only(top: 8.0),
|
padding: EdgeInsets.only(top: 8.0),
|
||||||
child: Text(
|
child: Text(
|
||||||
'\$${service['options'][0]['price']}',
|
'\$${service!['options'][0]['price']}',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 20,
|
fontSize: 20,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ class DesktopNewComment extends StatefulWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class DesktopNewCommentState extends State<DesktopNewComment> {
|
class DesktopNewCommentState extends State<DesktopNewComment> {
|
||||||
late Comment comment;
|
Comment? comment;
|
||||||
|
|
||||||
late bool _showProgress;
|
late bool _showProgress;
|
||||||
|
|
||||||
@@ -203,8 +203,8 @@ class DesktopNewCommentState extends State<DesktopNewComment> {
|
|||||||
children: <Widget>[],
|
children: <Widget>[],
|
||||||
);
|
);
|
||||||
|
|
||||||
if (comment != null && comment.images!.length > 0) {
|
if (comment != null && comment!.images!.length > 0) {
|
||||||
for (ProductImage image in comment.images!) {
|
for (ProductImage image in comment!.images!) {
|
||||||
row.children.add(
|
row.children.add(
|
||||||
Container(
|
Container(
|
||||||
padding: EdgeInsets.only(left: 10.0),
|
padding: EdgeInsets.only(left: 10.0),
|
||||||
@@ -275,7 +275,7 @@ class DesktopNewCommentState extends State<DesktopNewComment> {
|
|||||||
child: Icon(
|
child: Icon(
|
||||||
Icons.add,
|
Icons.add,
|
||||||
size: 60.0,
|
size: 60.0,
|
||||||
color: comment == null || comment.images!.length < 3 ? Colors.lightBlue : Colors.black12,
|
color: comment == null || comment!.images!.length < 3 ? Colors.lightBlue : Colors.black12,
|
||||||
),
|
),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: Colors.white70,
|
color: Colors.white70,
|
||||||
@@ -300,13 +300,13 @@ class DesktopNewCommentState extends State<DesktopNewComment> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
onTap: () {
|
onTap: () {
|
||||||
if (comment == null || comment.images!.length < 3) {
|
if (comment == null || comment!.images!.length < 3) {
|
||||||
showDialog(
|
showDialog(
|
||||||
context: mainContext,
|
context: mainContext,
|
||||||
barrierDismissible: true,
|
barrierDismissible: true,
|
||||||
builder: (BuildContext context) {
|
builder: (BuildContext context) {
|
||||||
return Util().getPicture(mainContext, store.state.user!,
|
return Util().getPicture(mainContext, store.state.user!,
|
||||||
commentId: comment != null ? comment.id! : 0,
|
commentId: comment != null ? comment!.id! : 0,
|
||||||
orderId: widget.orderId);
|
orderId: widget.orderId);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
@@ -365,7 +365,7 @@ class DesktopNewCommentState extends State<DesktopNewComment> {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
queryParameters: {
|
queryParameters: {
|
||||||
'comment_id': comment != null ? comment.id! : 0,
|
'comment_id': comment != null ? comment!.id! : 0,
|
||||||
},
|
},
|
||||||
).catchError((error) {
|
).catchError((error) {
|
||||||
Utils.showMessageDialog(context, error);
|
Utils.showMessageDialog(context, error);
|
||||||
@@ -392,7 +392,7 @@ class DesktopNewCommentState extends State<DesktopNewComment> {
|
|||||||
isFormData: true,
|
isFormData: true,
|
||||||
body: {
|
body: {
|
||||||
'order_id': widget.orderId,
|
'order_id': widget.orderId,
|
||||||
'comment_id': comment != null ? comment.id! : 0,
|
'comment_id': comment != null ? comment!.id! : 0,
|
||||||
'content': commentController.text,
|
'content': commentController.text,
|
||||||
'rating': rating.round(),
|
'rating': rating.round(),
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ class DesktopPayNow extends StatefulWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class DesktopPayNowState extends State<DesktopPayNow> {
|
class DesktopPayNowState extends State<DesktopPayNow> {
|
||||||
late Order order;
|
Order? order;
|
||||||
late List<PaymentPlatform> paymentPlatforms;
|
late List<PaymentPlatform> paymentPlatforms;
|
||||||
late User _user;
|
late User _user;
|
||||||
|
|
||||||
@@ -86,7 +86,7 @@ class DesktopPayNowState extends State<DesktopPayNow> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
'\$${order.totalPrice!.toStringAsFixed(2)}',
|
'\$${order!.totalPrice!.toStringAsFixed(2)}',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 24.0,
|
fontSize: 24.0,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
@@ -206,7 +206,7 @@ class DesktopPayNowState extends State<DesktopPayNow> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
onTap: () {
|
onTap: () {
|
||||||
Util.goPayment(context, order, paymentPlatform);
|
Util.goPayment(context, order!, paymentPlatform);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ class DesktopProductDetailPageState extends State<DesktopProductDetailPage>
|
|||||||
|
|
||||||
final double _tabBarHeight = 50;
|
final double _tabBarHeight = 50;
|
||||||
|
|
||||||
late ProductDetail productDetail;
|
ProductDetail? productDetail;
|
||||||
|
|
||||||
late bool refresh;
|
late bool refresh;
|
||||||
|
|
||||||
@@ -83,7 +83,7 @@ class DesktopProductDetailPageState extends State<DesktopProductDetailPage>
|
|||||||
title: S.of(context).shop,
|
title: S.of(context).shop,
|
||||||
back: true,
|
back: true,
|
||||||
breadCrumbs: [
|
breadCrumbs: [
|
||||||
BreadCrumb(productDetail.name!, null),
|
BreadCrumb(productDetail!.name!, null),
|
||||||
],
|
],
|
||||||
breadCrumbHeight: Constants.BREADCRUMB_HEIGHT,
|
breadCrumbHeight: Constants.BREADCRUMB_HEIGHT,
|
||||||
// shoppingCart: DesktopShoppingCartWidget(business: widget.business,),
|
// shoppingCart: DesktopShoppingCartWidget(business: widget.business,),
|
||||||
@@ -114,7 +114,7 @@ class DesktopProductDetailPageState extends State<DesktopProductDetailPage>
|
|||||||
Container(
|
Container(
|
||||||
margin: EdgeInsets.only(top: 10),
|
margin: EdgeInsets.only(top: 10),
|
||||||
child: Text(
|
child: Text(
|
||||||
'SKU: ${productDetail.sku}',
|
'SKU: ${productDetail!.sku}',
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
maxLines: 2,
|
maxLines: 2,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
@@ -125,7 +125,7 @@ class DesktopProductDetailPageState extends State<DesktopProductDetailPage>
|
|||||||
),
|
),
|
||||||
Container(
|
Container(
|
||||||
child: Text(
|
child: Text(
|
||||||
productDetail.name!,
|
productDetail!.name!,
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
maxLines: 2,
|
maxLines: 2,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
@@ -137,7 +137,7 @@ class DesktopProductDetailPageState extends State<DesktopProductDetailPage>
|
|||||||
Container(
|
Container(
|
||||||
padding: EdgeInsets.only(top: 10, bottom: 20),
|
padding: EdgeInsets.only(top: 10, bottom: 20),
|
||||||
child: Text(
|
child: Text(
|
||||||
'${productDetail.description}',
|
'${productDetail!.description}',
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
maxLines: 3,
|
maxLines: 3,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
@@ -163,12 +163,12 @@ class DesktopProductDetailPageState extends State<DesktopProductDetailPage>
|
|||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
ShowPrice(
|
ShowPrice(
|
||||||
productDetail.price!,
|
productDetail!.price!,
|
||||||
currencySign: '\$',
|
currencySign: '\$',
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
smallFontSize: 24,
|
smallFontSize: 24,
|
||||||
largeFontSize: 40,
|
largeFontSize: 40,
|
||||||
regularPrice: productDetail.regularPrice,
|
regularPrice: productDetail!.regularPrice,
|
||||||
),
|
),
|
||||||
AddRemoveButton(
|
AddRemoveButton(
|
||||||
product: widget.product,
|
product: widget.product,
|
||||||
@@ -207,35 +207,35 @@ class DesktopProductDetailPageState extends State<DesktopProductDetailPage>
|
|||||||
mainAxisAlignment: MainAxisAlignment.start,
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
(productDetail.subproducts!.length > 0) ?
|
(productDetail!.subproducts!.length > 0) ?
|
||||||
subProducts(productDetail.subproducts!) :
|
subProducts(productDetail!.subproducts!) :
|
||||||
SizedBox.shrink(),
|
SizedBox.shrink(),
|
||||||
Container(
|
Container(
|
||||||
padding: EdgeInsets.only(
|
padding: EdgeInsets.only(
|
||||||
top: 10.0, left: 10.0, right: 10.0, bottom: 16.0),
|
top: 10.0, left: 10.0, right: 10.0, bottom: 16.0),
|
||||||
child: Text(
|
child: Text(
|
||||||
productDetail.description!,
|
productDetail!.description!,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 14.0, color: Colors.black54),
|
fontSize: 14.0, color: Colors.black54),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Container(
|
Container(
|
||||||
padding: EdgeInsets.only(left: 10.0, right: 10.0),
|
padding: EdgeInsets.only(left: 10.0, right: 10.0),
|
||||||
child: (productDetail.description2 != null &&
|
child: (productDetail!.description2 != null &&
|
||||||
!productDetail.description2!.isEmpty)
|
!productDetail!.description2!.isEmpty)
|
||||||
? Text(
|
? Text(
|
||||||
'${productDetail.description2}',
|
'${productDetail!.description2}',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 14.0, color: Colors.black54),
|
fontSize: 14.0, color: Colors.black54),
|
||||||
)
|
)
|
||||||
: SizedBox.shrink(),
|
: SizedBox.shrink(),
|
||||||
),
|
),
|
||||||
productDetail.detailDescription != null
|
productDetail!.detailDescription != null
|
||||||
? Container(
|
? Container(
|
||||||
padding:
|
padding:
|
||||||
EdgeInsets.only(left: 10.0, right: 10.0),
|
EdgeInsets.only(left: 10.0, right: 10.0),
|
||||||
child: MarkdownBody(
|
child: MarkdownBody(
|
||||||
data: '${productDetail.detailDescription}',
|
data: '${productDetail!.detailDescription}',
|
||||||
shrinkWrap: true,
|
shrinkWrap: true,
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
@@ -253,7 +253,7 @@ class DesktopProductDetailPageState extends State<DesktopProductDetailPage>
|
|||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Container(
|
Container(
|
||||||
child: Text(
|
child: Text(
|
||||||
S.of(context).weight_token(productDetail.weight!),
|
S.of(context).weight_token(productDetail!.weight!),
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 12.0,
|
fontSize: 12.0,
|
||||||
color: Colors.black54,
|
color: Colors.black54,
|
||||||
@@ -263,9 +263,9 @@ class DesktopProductDetailPageState extends State<DesktopProductDetailPage>
|
|||||||
Container(
|
Container(
|
||||||
child: Text(
|
child: Text(
|
||||||
S.of(context).dimentions_token(
|
S.of(context).dimentions_token(
|
||||||
productDetail.dimentionsLength!,
|
productDetail!.dimentionsLength!,
|
||||||
productDetail.dimentionsWidth!,
|
productDetail!.dimentionsWidth!,
|
||||||
productDetail.dimentionsHeight!),
|
productDetail!.dimentionsHeight!),
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 12.0,
|
fontSize: 12.0,
|
||||||
color: Colors.black54,
|
color: Colors.black54,
|
||||||
@@ -299,9 +299,9 @@ class DesktopProductDetailPageState extends State<DesktopProductDetailPage>
|
|||||||
}
|
}
|
||||||
|
|
||||||
Widget getImage(double width) {
|
Widget getImage(double width) {
|
||||||
if (productDetail.images!.length <= 0) {
|
if (productDetail!.images!.length <= 0) {
|
||||||
return Util.showImage(
|
return Util.showImage(
|
||||||
productDetail.image!,
|
productDetail!.image!,
|
||||||
width: width,
|
width: width,
|
||||||
height: width,
|
height: width,
|
||||||
);
|
);
|
||||||
@@ -452,10 +452,10 @@ class DesktopProductDetailPageState extends State<DesktopProductDetailPage>
|
|||||||
List<Widget> _getProductPictures(BuildContext context) {
|
List<Widget> _getProductPictures(BuildContext context) {
|
||||||
var pages = <Widget>[];
|
var pages = <Widget>[];
|
||||||
List<String> images = [];
|
List<String> images = [];
|
||||||
images.add(productDetail.image!);
|
images.add(productDetail!.image!);
|
||||||
for (var i = 0; i < productDetail.images!.length; i++) {
|
for (var i = 0; i < productDetail!.images!.length; i++) {
|
||||||
// print('>>https:' + productDetail.images[i].image);
|
// print('>>https:' + productDetail.images[i].image);
|
||||||
images.add(productDetail.images![i].image!);
|
images.add(productDetail!.images![i].image!);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (var i = 0; i < images.length; i++) {
|
for (var i = 0; i < images.length; i++) {
|
||||||
|
|||||||
@@ -18,15 +18,15 @@ class DesktopShoppingCartWidget extends StatefulWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class DesktopShoppingCartWidgetState extends State<DesktopShoppingCartWidget> {
|
class DesktopShoppingCartWidgetState extends State<DesktopShoppingCartWidget> {
|
||||||
late CartInfo cartInfo;
|
CartInfo? cartInfo;
|
||||||
double totalPrice = 0.0;
|
double totalPrice = 0.0;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
totalPrice = 0.0;
|
totalPrice = 0.0;
|
||||||
cartInfo = Utils.getCartInfoByBusiness(store.state.cartInfos, widget.business)!;
|
cartInfo = Utils.getCartInfoByBusiness(store.state.cartInfos, widget.business)!;
|
||||||
if (cartInfo != null && cartInfo.businessInfo!.id == widget.business.id) {
|
if (cartInfo != null && cartInfo!.businessInfo!.id == widget.business.id) {
|
||||||
totalPrice = cartInfo.getTotalPrice();
|
totalPrice = cartInfo!.getTotalPrice();
|
||||||
}
|
}
|
||||||
Row row = Row(
|
Row row = Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.end,
|
mainAxisAlignment: MainAxisAlignment.end,
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ class DesktopViewBlog extends StatefulWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class DesktopViewBlogState extends State<DesktopViewBlog> {
|
class DesktopViewBlogState extends State<DesktopViewBlog> {
|
||||||
late Blog blog;
|
Blog? blog;
|
||||||
|
|
||||||
double sideSpace = 0;
|
double sideSpace = 0;
|
||||||
double mainSpace = 1200;
|
double mainSpace = 1200;
|
||||||
@@ -97,7 +97,7 @@ class DesktopViewBlogState extends State<DesktopViewBlog> {
|
|||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Text(
|
child: Text(
|
||||||
'${blog.title}',
|
'${blog!.title}',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 24.0,
|
fontSize: 24.0,
|
||||||
color: Colors.black
|
color: Colors.black
|
||||||
@@ -105,7 +105,7 @@ class DesktopViewBlogState extends State<DesktopViewBlog> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
Utils.utcDatetimeStringToLocalDatetimeString(context, blog.createdAt!),
|
Utils.utcDatetimeStringToLocalDatetimeString(context, blog!.createdAt!),
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 14.0,
|
fontSize: 14.0,
|
||||||
color: Colors.black38,
|
color: Colors.black38,
|
||||||
@@ -119,7 +119,7 @@ class DesktopViewBlogState extends State<DesktopViewBlog> {
|
|||||||
padding: EdgeInsets.only(top: 8.0, left: 16.0, right: 16.0, bottom: 24.0),
|
padding: EdgeInsets.only(top: 8.0, left: 16.0, right: 16.0, bottom: 24.0),
|
||||||
child: Container(
|
child: Container(
|
||||||
child: Text(
|
child: Text(
|
||||||
'${blog.body}',
|
'${blog!.body}',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: Colors.black87,
|
color: Colors.black87,
|
||||||
fontSize: 17.0,
|
fontSize: 17.0,
|
||||||
@@ -169,12 +169,12 @@ class DesktopViewBlogState extends State<DesktopViewBlog> {
|
|||||||
width: mainSpace / 2,
|
width: mainSpace / 2,
|
||||||
margin: EdgeInsets.only(top: 16.0, bottom: 16.0),
|
margin: EdgeInsets.only(top: 16.0, bottom: 16.0),
|
||||||
padding: EdgeInsets.all(10.0),
|
padding: EdgeInsets.all(10.0),
|
||||||
child: (blog.imageUrl == null) ?
|
child: (blog!.imageUrl == null) ?
|
||||||
SizedBox.shrink()
|
SizedBox.shrink()
|
||||||
: Container(
|
: Container(
|
||||||
width: mainSpace / 2 - 100.0,
|
width: mainSpace / 2 - 100.0,
|
||||||
height: mainSpace / 2 - 100.0,
|
height: mainSpace / 2 - 100.0,
|
||||||
child: Util.showImage('https:${blog.imageUrl}'),
|
child: Util.showImage('https:${blog!.imageUrl}'),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ class DesktopViewTicket extends StatefulWidget {
|
|||||||
class DesktopViewTicketState extends State<DesktopViewTicket> {
|
class DesktopViewTicketState extends State<DesktopViewTicket> {
|
||||||
final GlobalKey<FormState> _formKey = GlobalKey<FormState>();
|
final GlobalKey<FormState> _formKey = GlobalKey<FormState>();
|
||||||
|
|
||||||
late Ticket ticket;
|
Ticket? ticket;
|
||||||
|
|
||||||
final issueMsgController = TextEditingController();
|
final issueMsgController = TextEditingController();
|
||||||
|
|
||||||
@@ -220,14 +220,14 @@ class DesktopViewTicketState extends State<DesktopViewTicket> {
|
|||||||
crossAxisAlignment: CrossAxisAlignment.end,
|
crossAxisAlignment: CrossAxisAlignment.end,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
S.of(context).ticket_number_token(ticket.id!),
|
S.of(context).ticket_number_token(ticket!.id!),
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 24.0,
|
fontSize: 24.0,
|
||||||
color: Colors.black
|
color: Colors.black
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
Utils.utcDatetimeStringToLocalDatetimeString(context, ticket.createdAt!),
|
Utils.utcDatetimeStringToLocalDatetimeString(context, ticket!.createdAt!),
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 14.0,
|
fontSize: 14.0,
|
||||||
color: Colors.black38,
|
color: Colors.black38,
|
||||||
@@ -240,7 +240,7 @@ class DesktopViewTicketState extends State<DesktopViewTicket> {
|
|||||||
width: double.maxFinite,
|
width: double.maxFinite,
|
||||||
padding: EdgeInsets.only(top: 8.0, left: 16.0, right: 16.0, bottom: 24.0),
|
padding: EdgeInsets.only(top: 8.0, left: 16.0, right: 16.0, bottom: 24.0),
|
||||||
child: Text(
|
child: Text(
|
||||||
'${ticket.issue!.msg}',
|
'${ticket!.issue!.msg}',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: Colors.black54,
|
color: Colors.black54,
|
||||||
fontSize: 14.0,
|
fontSize: 14.0,
|
||||||
@@ -260,7 +260,7 @@ class DesktopViewTicketState extends State<DesktopViewTicket> {
|
|||||||
padding: EdgeInsets.only(top: 16.0, bottom: 16.0, left: 16.0, right: 16.0),
|
padding: EdgeInsets.only(top: 16.0, bottom: 16.0, left: 16.0, right: 16.0),
|
||||||
child: SingleChildScrollView(
|
child: SingleChildScrollView(
|
||||||
scrollDirection: Axis.horizontal,
|
scrollDirection: Axis.horizontal,
|
||||||
child: showGalleryImages(mainContext, ticket.issue!.files!),
|
child: showGalleryImages(mainContext, ticket!.issue!.files!),
|
||||||
),
|
),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
border: Border(
|
border: Border(
|
||||||
@@ -291,7 +291,7 @@ class DesktopViewTicketState extends State<DesktopViewTicket> {
|
|||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
|
||||||
if (ticket.followUps!.length > 0) {
|
if (ticket!.followUps!.length > 0) {
|
||||||
ticketCol.children.add(
|
ticketCol.children.add(
|
||||||
Container(
|
Container(
|
||||||
width: double.maxFinite,
|
width: double.maxFinite,
|
||||||
@@ -305,8 +305,8 @@ class DesktopViewTicketState extends State<DesktopViewTicket> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
for (int i = 0; i < ticket.followUps!.length; i++) {
|
for (int i = 0; i < ticket!.followUps!.length; i++) {
|
||||||
FollowUp followUp = ticket.followUps![i];
|
FollowUp followUp = ticket!.followUps![i];
|
||||||
ticketCol.children.add(
|
ticketCol.children.add(
|
||||||
Container(
|
Container(
|
||||||
width: double.maxFinite,
|
width: double.maxFinite,
|
||||||
@@ -406,7 +406,7 @@ class DesktopViewTicketState extends State<DesktopViewTicket> {
|
|||||||
width: mainSpace / 2,
|
width: mainSpace / 2,
|
||||||
margin: EdgeInsets.only(top: 16.0, bottom: 16.0),
|
margin: EdgeInsets.only(top: 16.0, bottom: 16.0),
|
||||||
padding: EdgeInsets.all(10.0),
|
padding: EdgeInsets.all(10.0),
|
||||||
child: (ticket.isClosed == true) ?
|
child: (ticket!.isClosed == true) ?
|
||||||
Column(
|
Column(
|
||||||
children: [
|
children: [
|
||||||
Container(
|
Container(
|
||||||
@@ -423,7 +423,7 @@ class DesktopViewTicketState extends State<DesktopViewTicket> {
|
|||||||
padding: EdgeInsets.only(left: 20.0, right: 20.0, top: 0.0, bottom: 30.0),
|
padding: EdgeInsets.only(left: 20.0, right: 20.0, top: 0.0, bottom: 30.0),
|
||||||
child: TextLink(
|
child: TextLink(
|
||||||
S.of(context).new_ticket,
|
S.of(context).new_ticket,
|
||||||
'/new-ticket/${ticket.store!.id}',
|
'/new-ticket/${ticket!.store!.id}',
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
@@ -692,7 +692,7 @@ class DesktopViewTicketState extends State<DesktopViewTicket> {
|
|||||||
child: Text(S.of(context).ok),
|
child: Text(S.of(context).ok),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
Routes.router.navigateTo(context,
|
Routes.router.navigateTo(context,
|
||||||
'/my-support/${ticket.store!.id}',
|
'/my-support/${ticket!.store!.id}',
|
||||||
replace: true,
|
replace: true,
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ class Shop extends StatefulWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class ShopState extends State<Shop> {
|
class ShopState extends State<Shop> {
|
||||||
late Business _business;
|
Business? _business;
|
||||||
|
|
||||||
PanelController panelController = PanelController();
|
PanelController panelController = PanelController();
|
||||||
late SlidingUpPanel _slidUpShoppingCart;
|
late SlidingUpPanel _slidUpShoppingCart;
|
||||||
@@ -71,7 +71,7 @@ class ShopState extends State<Shop> {
|
|||||||
backdropEnabled: true,
|
backdropEnabled: true,
|
||||||
slideDirection: SlideDirection.DOWN,
|
slideDirection: SlideDirection.DOWN,
|
||||||
panel: ShoppingCartBar(
|
panel: ShoppingCartBar(
|
||||||
business: _business,
|
business: _business!,
|
||||||
endKey: endKey,
|
endKey: endKey,
|
||||||
barAtBottom: true,
|
barAtBottom: true,
|
||||||
hasPicture: true,
|
hasPicture: true,
|
||||||
@@ -119,14 +119,14 @@ class ShopState extends State<Shop> {
|
|||||||
onTap: () {
|
onTap: () {
|
||||||
Navigator.push(context,
|
Navigator.push(context,
|
||||||
MaterialPageRoute(builder: (BuildContext context) {
|
MaterialPageRoute(builder: (BuildContext context) {
|
||||||
return ProductSearch(_business);
|
return ProductSearch(_business!);
|
||||||
}));
|
}));
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
breadCrumbHeight: Constants.BREADCRUMB_HEIGHT,
|
breadCrumbHeight: Constants.BREADCRUMB_HEIGHT,
|
||||||
shoppingCart: ShoppingCartWidget(
|
shoppingCart: ShoppingCartWidget(
|
||||||
business: _business,
|
business: _business!,
|
||||||
onTap: () {
|
onTap: () {
|
||||||
if (panelController.isPanelClosed) {
|
if (panelController.isPanelClosed) {
|
||||||
panelController.open();
|
panelController.open();
|
||||||
@@ -150,7 +150,7 @@ class ShopState extends State<Shop> {
|
|||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: [
|
children: [
|
||||||
ShopPromote(data),
|
ShopPromote(data),
|
||||||
ShopBulletin(_business),
|
ShopBulletin(_business!),
|
||||||
ShopProducts(data),
|
ShopProducts(data),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -19,15 +19,15 @@ class ShoppingCartWidget extends StatefulWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class ShoppingCartWidgetState extends State<ShoppingCartWidget> {
|
class ShoppingCartWidgetState extends State<ShoppingCartWidget> {
|
||||||
late CartInfo cartInfo;
|
CartInfo? cartInfo;
|
||||||
double totalPrice = 0.0;
|
double totalPrice = 0.0;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
totalPrice = 0.0;
|
totalPrice = 0.0;
|
||||||
cartInfo = Utils.getCartInfoByBusiness(store.state.cartInfos, widget.business)!;
|
cartInfo = Utils.getCartInfoByBusiness(store.state.cartInfos, widget.business)!;
|
||||||
if (cartInfo != null && cartInfo.businessInfo!.id == widget.business.id) {
|
if (cartInfo != null && cartInfo!.businessInfo!.id == widget.business.id) {
|
||||||
totalPrice = cartInfo.getTotalPrice();
|
totalPrice = cartInfo!.getTotalPrice();
|
||||||
}
|
}
|
||||||
Row row = Row(
|
Row row = Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.end,
|
mainAxisAlignment: MainAxisAlignment.end,
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ class AddRemoveButtonState extends State<AddRemoveButton> {
|
|||||||
|
|
||||||
var d = 1;
|
var d = 1;
|
||||||
|
|
||||||
late CartInfo cartInfo;
|
CartInfo? cartInfo;
|
||||||
|
|
||||||
GlobalKey startKey = GlobalKey();
|
GlobalKey startKey = GlobalKey();
|
||||||
|
|
||||||
@@ -63,10 +63,10 @@ class AddRemoveButtonState extends State<AddRemoveButton> {
|
|||||||
_qty = 0;
|
_qty = 0;
|
||||||
cartInfo = Utils.getCartInfoByBusiness(store.state.cartInfos, widget.business!)!;
|
cartInfo = Utils.getCartInfoByBusiness(store.state.cartInfos, widget.business!)!;
|
||||||
if (cartInfo != null) {
|
if (cartInfo != null) {
|
||||||
for (var i = 0; i < cartInfo.productList!.length; i++) {
|
for (var i = 0; i < cartInfo!.productList!.length; i++) {
|
||||||
if (cartInfo.productList![i].product!.id == widget.product!.id
|
if (cartInfo!.productList![i].product!.id == widget.product!.id
|
||||||
&& cartInfo.productList![i].unitPrice == 0.0) {
|
&& cartInfo!.productList![i].unitPrice == 0.0) {
|
||||||
_qty = cartInfo.productList![i].quantity!.round();
|
_qty = cartInfo!.productList![i].quantity!.round();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -104,9 +104,9 @@ class AddRemoveButtonState extends State<AddRemoveButton> {
|
|||||||
_qty = 0;
|
_qty = 0;
|
||||||
cartInfo = Utils.getCartInfoByBusiness(store.state.cartInfos, widget.business!)!;
|
cartInfo = Utils.getCartInfoByBusiness(store.state.cartInfos, widget.business!)!;
|
||||||
if (cartInfo != null) {
|
if (cartInfo != null) {
|
||||||
for (var i = 0; i < cartInfo.productList!.length; i++) {
|
for (var i = 0; i < cartInfo!.productList!.length; i++) {
|
||||||
if (cartInfo.productList![i].product!.id == widget.product!.id) {
|
if (cartInfo!.productList![i].product!.id == widget.product!.id) {
|
||||||
_qty = cartInfo.productList![i].quantity!.round();
|
_qty = cartInfo!.productList![i].quantity!.round();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -196,9 +196,9 @@ class AddRemoveButtonState extends State<AddRemoveButton> {
|
|||||||
_qty = 0;
|
_qty = 0;
|
||||||
cartInfo = Utils.getCartInfoByBusiness(store.state.cartInfos, widget.business!)!;
|
cartInfo = Utils.getCartInfoByBusiness(store.state.cartInfos, widget.business!)!;
|
||||||
if (cartInfo != null) {
|
if (cartInfo != null) {
|
||||||
for (var i = 0; i < cartInfo.productList!.length; i++) {
|
for (var i = 0; i < cartInfo!.productList!.length; i++) {
|
||||||
if (cartInfo.productList![i].product!.id == widget.product!.id) {
|
if (cartInfo!.productList![i].product!.id == widget.product!.id) {
|
||||||
_qty = cartInfo.productList![i].quantity!.round();
|
_qty = cartInfo!.productList![i].quantity!.round();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -311,7 +311,7 @@ class AddRemoveButtonState extends State<AddRemoveButton> {
|
|||||||
|
|
||||||
void _addToCart(BuildContext context) {
|
void _addToCart(BuildContext context) {
|
||||||
if (widget.cartLineItemIndex != -1) {
|
if (widget.cartLineItemIndex != -1) {
|
||||||
if (cartInfo.productList![widget.cartLineItemIndex].quantity! + 1.0 > widget.product!.leftNum!) {
|
if (cartInfo!.productList![widget.cartLineItemIndex].quantity! + 1.0 > widget.product!.leftNum!) {
|
||||||
Fluttertoast.showToast(
|
Fluttertoast.showToast(
|
||||||
msg: S.of(context).product_insufficient,
|
msg: S.of(context).product_insufficient,
|
||||||
toastLength: Toast.LENGTH_SHORT,
|
toastLength: Toast.LENGTH_SHORT,
|
||||||
@@ -320,10 +320,10 @@ class AddRemoveButtonState extends State<AddRemoveButton> {
|
|||||||
textColor: Colors.white
|
textColor: Colors.white
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
cartInfo.productList![widget.cartLineItemIndex].quantity = (cartInfo.productList![widget.cartLineItemIndex].quantity ?? 0) + 1.0;
|
cartInfo!.productList![widget.cartLineItemIndex].quantity = (cartInfo!.productList![widget.cartLineItemIndex].quantity ?? 0) + 1.0;
|
||||||
Utils.addSubproductQty(cartInfo, cartInfo.productList![widget.cartLineItemIndex]);
|
Utils.addSubproductQty(cartInfo!, cartInfo!.productList![widget.cartLineItemIndex]);
|
||||||
store.dispatch(UpdateCartInfo(
|
store.dispatch(UpdateCartInfo(
|
||||||
Utils.addCartInfoToCartInfoList(store.state.cartInfos, cartInfo)));
|
Utils.addCartInfoToCartInfoList(store.state.cartInfos, cartInfo!)));
|
||||||
eventBus.fire(new OnCartInfoUpdated());
|
eventBus.fire(new OnCartInfoUpdated());
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -344,7 +344,7 @@ class AddRemoveButtonState extends State<AddRemoveButton> {
|
|||||||
|
|
||||||
void _removeFromCart(BuildContext context) {
|
void _removeFromCart(BuildContext context) {
|
||||||
if (widget.cartLineItemIndex != -1) {
|
if (widget.cartLineItemIndex != -1) {
|
||||||
if (cartInfo.productList![widget.cartLineItemIndex].quantity! <= 1) {
|
if (cartInfo!.productList![widget.cartLineItemIndex].quantity! <= 1) {
|
||||||
showDialog(
|
showDialog(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (BuildContext context) {
|
builder: (BuildContext context) {
|
||||||
@@ -379,18 +379,18 @@ class AddRemoveButtonState extends State<AddRemoveButton> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void _removeCartLineItem() {
|
void _removeCartLineItem() {
|
||||||
if (cartInfo.productList![widget.cartLineItemIndex].quantity! <= 1) {
|
if (cartInfo!.productList![widget.cartLineItemIndex].quantity! <= 1) {
|
||||||
String uuid = cartInfo.productList![widget.cartLineItemIndex].uuid!;
|
String uuid = cartInfo!.productList![widget.cartLineItemIndex].uuid!;
|
||||||
cartInfo.productList!.removeAt(widget.cartLineItemIndex);
|
cartInfo!.productList!.removeAt(widget.cartLineItemIndex);
|
||||||
Utils.removeSubproduct(cartInfo, uuid);
|
Utils.removeSubproduct(cartInfo!, uuid);
|
||||||
} else {
|
} else {
|
||||||
cartInfo.productList![widget.cartLineItemIndex].quantity = (cartInfo.productList![widget.cartLineItemIndex].quantity ?? 0) - 1;
|
cartInfo!.productList![widget.cartLineItemIndex].quantity = (cartInfo!.productList![widget.cartLineItemIndex].quantity ?? 0) - 1;
|
||||||
Utils.addSubproductQty(cartInfo, cartInfo.productList![widget.cartLineItemIndex], remove: true);
|
Utils.addSubproductQty(cartInfo!, cartInfo!.productList![widget.cartLineItemIndex], remove: true);
|
||||||
}
|
}
|
||||||
if (cartInfo.productList!.length <= 0) {
|
if (cartInfo!.productList!.length <= 0) {
|
||||||
store.dispatch(new UpdateCartInfo(Utils.removeCartInfoFromCartInfoList(store.state.cartInfos, cartInfo)));
|
store.dispatch(new UpdateCartInfo(Utils.removeCartInfoFromCartInfoList(store.state.cartInfos, cartInfo)));
|
||||||
} else {
|
} else {
|
||||||
store.dispatch(new UpdateCartInfo(Utils.addCartInfoToCartInfoList(store.state.cartInfos, cartInfo)));
|
store.dispatch(new UpdateCartInfo(Utils.addCartInfoToCartInfoList(store.state.cartInfos, cartInfo!)));
|
||||||
}
|
}
|
||||||
eventBus.fire(new OnCartInfoUpdated());
|
eventBus.fire(new OnCartInfoUpdated());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ class Carousel extends StatefulWidget {
|
|||||||
class CarouselState extends State<Carousel> {
|
class CarouselState extends State<Carousel> {
|
||||||
final _pageController = new PageController();
|
final _pageController = new PageController();
|
||||||
|
|
||||||
late Timer _timer;
|
Timer? _timer;
|
||||||
int _currentPage = 0;
|
int _currentPage = 0;
|
||||||
bool reverse = false;
|
bool reverse = false;
|
||||||
GlobalKey<IndicatorState> _indicatorStateKey = new GlobalKey();
|
GlobalKey<IndicatorState> _indicatorStateKey = new GlobalKey();
|
||||||
@@ -63,7 +63,7 @@ class CarouselState extends State<Carousel> {
|
|||||||
void dispose() {
|
void dispose() {
|
||||||
_pageController?.dispose();
|
_pageController?.dispose();
|
||||||
if (_timer != null) {
|
if (_timer != null) {
|
||||||
_timer.cancel();
|
_timer!.cancel();
|
||||||
}
|
}
|
||||||
super.dispose();
|
super.dispose();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ class ParabolicAnimationWidget extends AnimatedWidget {
|
|||||||
this.endAdjustOffset = Offset.zero,
|
this.endAdjustOffset = Offset.zero,
|
||||||
}) : super(listenable: animation);
|
}) : super(listenable: animation);
|
||||||
|
|
||||||
late Offset _startOffset;
|
Offset? _startOffset;
|
||||||
late Offset _endOffset;
|
late Offset _endOffset;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@@ -36,13 +36,13 @@ class ParabolicAnimationWidget extends AnimatedWidget {
|
|||||||
// double x(double time) => _x + _v * time + 0.5 * _a * time * time;
|
// double x(double time) => _x + _v * time + 0.5 * _a * time * time;
|
||||||
final double initV = -400; //纵坐标初速度, 负值为向上抛
|
final double initV = -400; //纵坐标初速度, 负值为向上抛
|
||||||
final double acceleration =
|
final double acceleration =
|
||||||
(_endOffset.dy - _startOffset.dy - initV) / 0.5; //求纵坐标加速度
|
(_endOffset.dy - _startOffset!.dy - initV) / 0.5; //求纵坐标加速度
|
||||||
|
|
||||||
final GravitySimulation spy = GravitySimulation(
|
final GravitySimulation spy = GravitySimulation(
|
||||||
acceleration, _startOffset.dy, _endOffset.dy, initV); //y轴加速度运动 模拟
|
acceleration, _startOffset!.dy, _endOffset.dy, initV); //y轴加速度运动 模拟
|
||||||
|
|
||||||
final GravitySimulation spx = GravitySimulation(0, _startOffset.dx,
|
final GravitySimulation spx = GravitySimulation(0, _startOffset!.dx,
|
||||||
_endOffset.dx, _endOffset.dx - _startOffset.dx); //x轴匀速模拟 加速度为0
|
_endOffset.dx, _endOffset.dx - _startOffset!.dx); //x轴匀速模拟 加速度为0
|
||||||
|
|
||||||
final Animation<double> opacity = Tween<double>(begin: 1, end: 0).animate(
|
final Animation<double> opacity = Tween<double>(begin: 1, end: 0).animate(
|
||||||
CurvedAnimation(
|
CurvedAnimation(
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ class PaymentVerificationCodeDialogState extends State<PaymentVerificationCodeDi
|
|||||||
String getCodeText = '';
|
String getCodeText = '';
|
||||||
String paymentCodeEncrypt = '';
|
String paymentCodeEncrypt = '';
|
||||||
|
|
||||||
late String verifyMethod;
|
String? verifyMethod;
|
||||||
late String verifyName;
|
late String verifyName;
|
||||||
|
|
||||||
final TextEditingController _pinPutController = TextEditingController();
|
final TextEditingController _pinPutController = TextEditingController();
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ class PopupAnimationWidget extends AnimatedWidget {
|
|||||||
this.popupOffset = Offset.zero,
|
this.popupOffset = Offset.zero,
|
||||||
}) : super(listenable: animation);
|
}) : super(listenable: animation);
|
||||||
|
|
||||||
late Offset _startOffset;
|
Offset? _startOffset;
|
||||||
Offset _offset = Offset.zero;
|
Offset _offset = Offset.zero;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@@ -29,7 +29,7 @@ class PopupAnimationWidget extends AnimatedWidget {
|
|||||||
.animate(CurvedAnimation(
|
.animate(CurvedAnimation(
|
||||||
parent: animation, curve: Interval(0, 0.4, curve: Curves.ease)));
|
parent: animation, curve: Interval(0, 0.4, curve: Curves.ease)));
|
||||||
_offset =
|
_offset =
|
||||||
Offset(_startOffset.dx, _startOffset.dy - opacityAnimation.value * 80);
|
Offset(_startOffset!.dx, _startOffset!.dy - opacityAnimation.value * 80);
|
||||||
|
|
||||||
return Positioned(
|
return Positioned(
|
||||||
left: _offset.dx,
|
left: _offset.dx,
|
||||||
|
|||||||
@@ -602,7 +602,7 @@ class _SlidingUpPanelState extends State<SlidingUpPanel> with SingleTickerProvid
|
|||||||
|
|
||||||
|
|
||||||
class PanelController{
|
class PanelController{
|
||||||
late _SlidingUpPanelState _panelState;
|
_SlidingUpPanelState? _panelState;
|
||||||
|
|
||||||
void _addState(_SlidingUpPanelState panelState){
|
void _addState(_SlidingUpPanelState panelState){
|
||||||
this._panelState = panelState;
|
this._panelState = panelState;
|
||||||
@@ -616,27 +616,27 @@ class PanelController{
|
|||||||
/// Closes the sliding panel to its collapsed state (i.e. to the minHeight)
|
/// Closes the sliding panel to its collapsed state (i.e. to the minHeight)
|
||||||
Future<void> close(){
|
Future<void> close(){
|
||||||
assert(isAttached, "PanelController must be attached to a SlidingUpPanel");
|
assert(isAttached, "PanelController must be attached to a SlidingUpPanel");
|
||||||
return _panelState._close();
|
return _panelState!._close();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Opens the sliding panel fully
|
/// Opens the sliding panel fully
|
||||||
/// (i.e. to the maxHeight)
|
/// (i.e. to the maxHeight)
|
||||||
Future<void> open(){
|
Future<void> open(){
|
||||||
assert(isAttached, "PanelController must be attached to a SlidingUpPanel");
|
assert(isAttached, "PanelController must be attached to a SlidingUpPanel");
|
||||||
return _panelState._open();
|
return _panelState!._open();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Hides the sliding panel (i.e. is invisible)
|
/// Hides the sliding panel (i.e. is invisible)
|
||||||
Future<void> hide(){
|
Future<void> hide(){
|
||||||
assert(isAttached, "PanelController must be attached to a SlidingUpPanel");
|
assert(isAttached, "PanelController must be attached to a SlidingUpPanel");
|
||||||
return _panelState._hide();
|
return _panelState!._hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Shows the sliding panel in its collapsed state
|
/// Shows the sliding panel in its collapsed state
|
||||||
/// (i.e. "un-hide" the sliding panel)
|
/// (i.e. "un-hide" the sliding panel)
|
||||||
Future<void> show(){
|
Future<void> show(){
|
||||||
assert(isAttached, "PanelController must be attached to a SlidingUpPanel");
|
assert(isAttached, "PanelController must be attached to a SlidingUpPanel");
|
||||||
return _panelState._show();
|
return _panelState!._show();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Animates the panel position to the value.
|
/// Animates the panel position to the value.
|
||||||
@@ -647,7 +647,7 @@ class PanelController{
|
|||||||
Future<void> animatePanelToPosition(double value, {Duration? duration, Curve curve = Curves.linear}){
|
Future<void> animatePanelToPosition(double value, {Duration? duration, Curve curve = Curves.linear}){
|
||||||
assert(isAttached, "PanelController must be attached to a SlidingUpPanel");
|
assert(isAttached, "PanelController must be attached to a SlidingUpPanel");
|
||||||
assert(0.0 <= value && value <= 1.0);
|
assert(0.0 <= value && value <= 1.0);
|
||||||
return _panelState._animatePanelToPosition(value, duration: duration, curve: curve);
|
return _panelState!._animatePanelToPosition(value, duration: duration, curve: curve);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Animates the panel position to the snap point
|
/// Animates the panel position to the snap point
|
||||||
@@ -656,8 +656,8 @@ class PanelController{
|
|||||||
/// (optional) curve specifies the easing behavior of the animation.
|
/// (optional) curve specifies the easing behavior of the animation.
|
||||||
Future<void> animatePanelToSnapPoint({Duration? duration, Curve curve = Curves.linear}){
|
Future<void> animatePanelToSnapPoint({Duration? duration, Curve curve = Curves.linear}){
|
||||||
assert(isAttached, "PanelController must be attached to a SlidingUpPanel");
|
assert(isAttached, "PanelController must be attached to a SlidingUpPanel");
|
||||||
assert(_panelState.widget.snapPoint != null, "SlidingUpPanel snapPoint property must not be null");
|
assert(_panelState!.widget.snapPoint != null, "SlidingUpPanel snapPoint property must not be null");
|
||||||
return _panelState._animatePanelToSnapPoint(duration: duration, curve: curve);
|
return _panelState!._animatePanelToSnapPoint(duration: duration, curve: curve);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Sets the panel position (without animation).
|
/// Sets the panel position (without animation).
|
||||||
@@ -666,7 +666,7 @@ class PanelController{
|
|||||||
set panelPosition(double value){
|
set panelPosition(double value){
|
||||||
assert(isAttached, "PanelController must be attached to a SlidingUpPanel");
|
assert(isAttached, "PanelController must be attached to a SlidingUpPanel");
|
||||||
assert(0.0 <= value && value <= 1.0);
|
assert(0.0 <= value && value <= 1.0);
|
||||||
_panelState._panelPosition = value;
|
_panelState!._panelPosition = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Gets the current panel position.
|
/// Gets the current panel position.
|
||||||
@@ -677,35 +677,35 @@ class PanelController{
|
|||||||
/// 1.0 is full open.
|
/// 1.0 is full open.
|
||||||
double get panelPosition{
|
double get panelPosition{
|
||||||
assert(isAttached, "PanelController must be attached to a SlidingUpPanel");
|
assert(isAttached, "PanelController must be attached to a SlidingUpPanel");
|
||||||
return _panelState._panelPosition;
|
return _panelState!._panelPosition;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns whether or not the panel is
|
/// Returns whether or not the panel is
|
||||||
/// currently animating.
|
/// currently animating.
|
||||||
bool get isPanelAnimating{
|
bool get isPanelAnimating{
|
||||||
assert(isAttached, "PanelController must be attached to a SlidingUpPanel");
|
assert(isAttached, "PanelController must be attached to a SlidingUpPanel");
|
||||||
return _panelState._isPanelAnimating;
|
return _panelState!._isPanelAnimating;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns whether or not the
|
/// Returns whether or not the
|
||||||
/// panel is open.
|
/// panel is open.
|
||||||
bool get isPanelOpen{
|
bool get isPanelOpen{
|
||||||
assert(isAttached, "PanelController must be attached to a SlidingUpPanel");
|
assert(isAttached, "PanelController must be attached to a SlidingUpPanel");
|
||||||
return _panelState._isPanelOpen;
|
return _panelState!._isPanelOpen;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns whether or not the
|
/// Returns whether or not the
|
||||||
/// panel is closed.
|
/// panel is closed.
|
||||||
bool get isPanelClosed{
|
bool get isPanelClosed{
|
||||||
assert(isAttached, "PanelController must be attached to a SlidingUpPanel");
|
assert(isAttached, "PanelController must be attached to a SlidingUpPanel");
|
||||||
return _panelState._isPanelClosed;
|
return _panelState!._isPanelClosed;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns whether or not the
|
/// Returns whether or not the
|
||||||
/// panel is shown/hidden.
|
/// panel is shown/hidden.
|
||||||
bool get isPanelShown{
|
bool get isPanelShown{
|
||||||
assert(isAttached, "PanelController must be attached to a SlidingUpPanel");
|
assert(isAttached, "PanelController must be attached to a SlidingUpPanel");
|
||||||
return _panelState._isPanelShown;
|
return _panelState!._isPanelShown;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -30,7 +30,7 @@ class CreateOnlineStore1State extends State<CreateOnlineStore1> {
|
|||||||
bool canSubmit = false;
|
bool canSubmit = false;
|
||||||
|
|
||||||
List<dynamic> stores = [];
|
List<dynamic> stores = [];
|
||||||
late Map<String, dynamic> service;
|
Map<String, dynamic>? service;
|
||||||
dynamic selectedStore;
|
dynamic selectedStore;
|
||||||
|
|
||||||
late Group group;
|
late Group group;
|
||||||
@@ -269,7 +269,7 @@ class CreateOnlineStore1State extends State<CreateOnlineStore1> {
|
|||||||
Container(
|
Container(
|
||||||
padding: EdgeInsets.only(top: 8.0),
|
padding: EdgeInsets.only(top: 8.0),
|
||||||
child: Text(
|
child: Text(
|
||||||
service['description'],
|
service!['description'],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
@@ -277,7 +277,7 @@ class CreateOnlineStore1State extends State<CreateOnlineStore1> {
|
|||||||
Container(
|
Container(
|
||||||
padding: EdgeInsets.only(top: 8.0),
|
padding: EdgeInsets.only(top: 8.0),
|
||||||
child: Text(
|
child: Text(
|
||||||
service['options'][0]['name'],
|
service!['options'][0]['name'],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
@@ -285,7 +285,7 @@ class CreateOnlineStore1State extends State<CreateOnlineStore1> {
|
|||||||
Container(
|
Container(
|
||||||
padding: EdgeInsets.only(top: 8.0),
|
padding: EdgeInsets.only(top: 8.0),
|
||||||
child: Text(
|
child: Text(
|
||||||
'\$${service['options'][0]['price']}',
|
'\$${service!['options'][0]['price']}',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 20,
|
fontSize: 20,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ class MobileCheckout extends StatefulWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class MobileCheckoutState extends State<MobileCheckout> with SingleTickerProviderStateMixin, AutomaticKeepAliveClientMixin {
|
class MobileCheckoutState extends State<MobileCheckout> with SingleTickerProviderStateMixin, AutomaticKeepAliveClientMixin {
|
||||||
late CartInfo cartInfo;
|
CartInfo? cartInfo;
|
||||||
Address? shipAddress;
|
Address? shipAddress;
|
||||||
late bool canSubmit;
|
late bool canSubmit;
|
||||||
late List<ErrorMessage> errorMessages;
|
late List<ErrorMessage> errorMessages;
|
||||||
@@ -53,7 +53,7 @@ class MobileCheckoutState extends State<MobileCheckout> with SingleTickerProvide
|
|||||||
late List<BookingDateTime> bookingDateTimeList;
|
late List<BookingDateTime> bookingDateTimeList;
|
||||||
late List<PaymentPlatform> paymentPlatforms;
|
late List<PaymentPlatform> paymentPlatforms;
|
||||||
TextValue? durationInTraffic;
|
TextValue? durationInTraffic;
|
||||||
late int selectedCoupon;
|
int? selectedCoupon;
|
||||||
double couponDiscountAmount = 0;
|
double couponDiscountAmount = 0;
|
||||||
late List<Coupon> coupons;
|
late List<Coupon> coupons;
|
||||||
|
|
||||||
@@ -79,7 +79,7 @@ class MobileCheckoutState extends State<MobileCheckout> with SingleTickerProvide
|
|||||||
GlobalKey slidingUpPanelKey = GlobalKey();
|
GlobalKey slidingUpPanelKey = GlobalKey();
|
||||||
late SlidingUpPanel slidingUpPanel;
|
late SlidingUpPanel slidingUpPanel;
|
||||||
PanelController panelController = PanelController();
|
PanelController panelController = PanelController();
|
||||||
late Widget panel;
|
Widget? panel;
|
||||||
|
|
||||||
late double subtotal;
|
late double subtotal;
|
||||||
|
|
||||||
@@ -102,7 +102,7 @@ class MobileCheckoutState extends State<MobileCheckout> with SingleTickerProvide
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cartInfo.businessInfo!.deliveryPickup == false && cartInfo.businessInfo!.deliveryCanadaPost == false && cartInfo.businessInfo!.deliveryStoreDelivery == false) {
|
if (cartInfo!.businessInfo!.deliveryPickup == false && cartInfo!.businessInfo!.deliveryCanadaPost == false && cartInfo!.businessInfo!.deliveryStoreDelivery == false) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
body: Container(
|
body: Container(
|
||||||
child: Center(
|
child: Center(
|
||||||
@@ -197,13 +197,13 @@ class MobileCheckoutState extends State<MobileCheckout> with SingleTickerProvide
|
|||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
'\$${(cartInfo.totalPrice! - couponDiscountAmount).toStringAsFixed(2)}',
|
'\$${(cartInfo!.totalPrice! - couponDiscountAmount).toStringAsFixed(2)}',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 20.0,
|
fontSize: 20.0,
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
cartInfo.businessInfo!.isPublic == true ? SizedBox.shrink() : Container(
|
cartInfo!.businessInfo!.isPublic == true ? SizedBox.shrink() : Container(
|
||||||
padding: EdgeInsets.only(top: 2.0, bottom: 2.0, left: 5.0, right: 5.0),
|
padding: EdgeInsets.only(top: 2.0, bottom: 2.0, left: 5.0, right: 5.0),
|
||||||
width: 100.0,
|
width: 100.0,
|
||||||
color: Colors.red,
|
color: Colors.red,
|
||||||
@@ -267,7 +267,7 @@ class MobileCheckoutState extends State<MobileCheckout> with SingleTickerProvide
|
|||||||
itemCount: 6,
|
itemCount: 6,
|
||||||
addAutomaticKeepAlives: true,
|
addAutomaticKeepAlives: true,
|
||||||
itemBuilder: (BuildContext context, int position) {
|
itemBuilder: (BuildContext context, int position) {
|
||||||
var deliveryTimeInSeconds = cartInfo.businessInfo!.shippingTime! * 60 + (durationInTraffic != null ? durationInTraffic!.value ?? 0 : 0);
|
var deliveryTimeInSeconds = cartInfo!.businessInfo!.shippingTime! * 60 + (durationInTraffic != null ? durationInTraffic!.value ?? 0 : 0);
|
||||||
print('aaa: $deliveryTimeInSeconds');
|
print('aaa: $deliveryTimeInSeconds');
|
||||||
DateTime now = DateTime.now();
|
DateTime now = DateTime.now();
|
||||||
var formatter = DateFormat('H:mm');
|
var formatter = DateFormat('H:mm');
|
||||||
@@ -341,7 +341,7 @@ class MobileCheckoutState extends State<MobileCheckout> with SingleTickerProvide
|
|||||||
);
|
);
|
||||||
switch (position) {
|
switch (position) {
|
||||||
case 0:
|
case 0:
|
||||||
if (cartInfo.businessInfo!.deliveryPickup == true) {
|
if (cartInfo!.businessInfo!.deliveryPickup == true) {
|
||||||
return Container(
|
return Container(
|
||||||
padding: EdgeInsets.only(
|
padding: EdgeInsets.only(
|
||||||
top: 16.0, bottom: 16.0, left: 16.0, right: 16.0),
|
top: 16.0, bottom: 16.0, left: 16.0, right: 16.0),
|
||||||
@@ -389,7 +389,7 @@ class MobileCheckoutState extends State<MobileCheckout> with SingleTickerProvide
|
|||||||
Container(
|
Container(
|
||||||
margin: EdgeInsets.only(top: 10.0),
|
margin: EdgeInsets.only(top: 10.0),
|
||||||
child: Text(
|
child: Text(
|
||||||
cartInfo.businessInfo!.name!,
|
cartInfo!.businessInfo!.name!,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 17.0,
|
fontSize: 17.0,
|
||||||
),
|
),
|
||||||
@@ -398,7 +398,7 @@ class MobileCheckoutState extends State<MobileCheckout> with SingleTickerProvide
|
|||||||
Container(
|
Container(
|
||||||
margin: EdgeInsets.only(top: 5.0),
|
margin: EdgeInsets.only(top: 5.0),
|
||||||
child: Text(
|
child: Text(
|
||||||
cartInfo.businessInfo!.address!.addressLine1!,
|
cartInfo!.businessInfo!.address!.addressLine1!,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 14.0,
|
fontSize: 14.0,
|
||||||
color: Colors.black45,
|
color: Colors.black45,
|
||||||
@@ -406,9 +406,9 @@ class MobileCheckoutState extends State<MobileCheckout> with SingleTickerProvide
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
Container(
|
Container(
|
||||||
child: cartInfo.businessInfo!.address!.addressLine2 != null
|
child: cartInfo!.businessInfo!.address!.addressLine2 != null
|
||||||
&& cartInfo.businessInfo!.address!.addressLine2!.length > 0 ?
|
&& cartInfo!.businessInfo!.address!.addressLine2!.length > 0 ?
|
||||||
Text(cartInfo.businessInfo!.address!.addressLine2!,
|
Text(cartInfo!.businessInfo!.address!.addressLine2!,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 14.0,
|
fontSize: 14.0,
|
||||||
color: Colors.black45,
|
color: Colors.black45,
|
||||||
@@ -417,7 +417,7 @@ class MobileCheckoutState extends State<MobileCheckout> with SingleTickerProvide
|
|||||||
),
|
),
|
||||||
Container(
|
Container(
|
||||||
child: Text(
|
child: Text(
|
||||||
'${cartInfo.businessInfo!.address!.city}, ${cartInfo.businessInfo!.address!.state}, ${cartInfo.businessInfo!.address!.zip}',
|
'${cartInfo!.businessInfo!.address!.city}, ${cartInfo!.businessInfo!.address!.state}, ${cartInfo!.businessInfo!.address!.zip}',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 14.0,
|
fontSize: 14.0,
|
||||||
color: Colors.black45,
|
color: Colors.black45,
|
||||||
@@ -427,7 +427,7 @@ class MobileCheckoutState extends State<MobileCheckout> with SingleTickerProvide
|
|||||||
Container(
|
Container(
|
||||||
margin: EdgeInsets.only(top: 5.0),
|
margin: EdgeInsets.only(top: 5.0),
|
||||||
child: Text(
|
child: Text(
|
||||||
'Tel: ${cartInfo.businessInfo!.phone}',
|
'Tel: ${cartInfo!.businessInfo!.phone}',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 15.0,
|
fontSize: 15.0,
|
||||||
color: Colors.black54,
|
color: Colors.black54,
|
||||||
@@ -504,7 +504,7 @@ class MobileCheckoutState extends State<MobileCheckout> with SingleTickerProvide
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
onTap: () {
|
onTap: () {
|
||||||
Routes.router.navigateTo(context, '/my-addresses/${cartInfo.businessInfo!.id}', replace: true);
|
Routes.router.navigateTo(context, '/my-addresses/${cartInfo!.businessInfo!.id}', replace: true);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
@@ -583,7 +583,7 @@ class MobileCheckoutState extends State<MobileCheckout> with SingleTickerProvide
|
|||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (cartInfo.businessInfo!.instanceDelivery != true) {
|
if (cartInfo!.businessInfo!.instanceDelivery != true) {
|
||||||
return Container(
|
return Container(
|
||||||
padding: EdgeInsets.only(left: 16.0, right: 16.0, top: 0.0, bottom: 16.0),
|
padding: EdgeInsets.only(left: 16.0, right: 16.0, top: 0.0, bottom: 16.0),
|
||||||
child: Text(S.of(context).no_instance_delivery_desc),
|
child: Text(S.of(context).no_instance_delivery_desc),
|
||||||
@@ -712,7 +712,7 @@ class MobileCheckoutState extends State<MobileCheckout> with SingleTickerProvide
|
|||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
padding: EdgeInsets.only(bottom: 10.0),
|
padding: EdgeInsets.only(bottom: 10.0),
|
||||||
child: Text(
|
child: Text(
|
||||||
cartInfo.businessInfo!.name!,
|
cartInfo!.businessInfo!.name!,
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 16.0,
|
fontSize: 16.0,
|
||||||
@@ -731,9 +731,9 @@ class MobileCheckoutState extends State<MobileCheckout> with SingleTickerProvide
|
|||||||
|
|
||||||
subtotal = 0.0;
|
subtotal = 0.0;
|
||||||
|
|
||||||
for (var i = 0; i < cartInfo.productList!.length; i++) {
|
for (var i = 0; i < cartInfo!.productList!.length; i++) {
|
||||||
subtotal += cartInfo.productList![i].totalPrice!;
|
subtotal += cartInfo!.productList![i].totalPrice!;
|
||||||
column.children.add(lineItem(cartInfo.productList![i]));
|
column.children.add(lineItem(cartInfo!.productList![i]));
|
||||||
}
|
}
|
||||||
column.children.add(GestureDetector(
|
column.children.add(GestureDetector(
|
||||||
child: Container(
|
child: Container(
|
||||||
@@ -826,8 +826,8 @@ class MobileCheckoutState extends State<MobileCheckout> with SingleTickerProvide
|
|||||||
),
|
),
|
||||||
));
|
));
|
||||||
|
|
||||||
if (cartInfo.extraFeeList!.length > 0) {
|
if (cartInfo!.extraFeeList!.length > 0) {
|
||||||
for (var i = 0; i < cartInfo.extraFeeList!.length; i++) {
|
for (var i = 0; i < cartInfo!.extraFeeList!.length; i++) {
|
||||||
column.children.add(Container(
|
column.children.add(Container(
|
||||||
padding: EdgeInsets.only(bottom: 16.0),
|
padding: EdgeInsets.only(bottom: 16.0),
|
||||||
alignment: Alignment.centerRight,
|
alignment: Alignment.centerRight,
|
||||||
@@ -838,7 +838,7 @@ class MobileCheckoutState extends State<MobileCheckout> with SingleTickerProvide
|
|||||||
Container(
|
Container(
|
||||||
alignment: Alignment.centerRight,
|
alignment: Alignment.centerRight,
|
||||||
child: Text(
|
child: Text(
|
||||||
S.of(context).extra_fee_token(cartInfo.extraFeeList![i].name!, cartInfo.extraFeeList![i].rate!),
|
S.of(context).extra_fee_token(cartInfo!.extraFeeList![i].name!, cartInfo!.extraFeeList![i].rate!),
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: Colors.grey,
|
color: Colors.grey,
|
||||||
),
|
),
|
||||||
@@ -848,7 +848,7 @@ class MobileCheckoutState extends State<MobileCheckout> with SingleTickerProvide
|
|||||||
width: 100.0,
|
width: 100.0,
|
||||||
alignment: Alignment.centerRight,
|
alignment: Alignment.centerRight,
|
||||||
child: Text(
|
child: Text(
|
||||||
'${cartInfo.extraFeeList![i].price!.toStringAsFixed(2)}'
|
'${cartInfo!.extraFeeList![i].price!.toStringAsFixed(2)}'
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@@ -876,7 +876,7 @@ class MobileCheckoutState extends State<MobileCheckout> with SingleTickerProvide
|
|||||||
width: 100.0,
|
width: 100.0,
|
||||||
alignment: Alignment.centerRight,
|
alignment: Alignment.centerRight,
|
||||||
child: Text(
|
child: Text(
|
||||||
'${(cartInfo.totalPrice! - couponDiscountAmount).toStringAsFixed(2)}',
|
'${(cartInfo!.totalPrice! - couponDiscountAmount).toStringAsFixed(2)}',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 19.0,
|
fontSize: 19.0,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
@@ -1074,7 +1074,7 @@ class MobileCheckoutState extends State<MobileCheckout> with SingleTickerProvide
|
|||||||
shippingRates = (response.data['shipping_rates'] as List).map((e) => ShippingRate.fromJson(e)).toList();
|
shippingRates = (response.data['shipping_rates'] as List).map((e) => ShippingRate.fromJson(e)).toList();
|
||||||
selectedShippingRate = (response.data['selected_shipping_rate'] as String).length > 0 ? ShippingRate.fromJson(json.decode(response.data['selected_shipping_rate'])) : null;
|
selectedShippingRate = (response.data['selected_shipping_rate'] as String).length > 0 ? ShippingRate.fromJson(json.decode(response.data['selected_shipping_rate'])) : null;
|
||||||
int i = 0;
|
int i = 0;
|
||||||
if (cartInfo.businessInfo!.deliveryStoreDelivery == true) {
|
if (cartInfo!.businessInfo!.deliveryStoreDelivery == true) {
|
||||||
shippingMethodLabels.add(S.of(context).delivery);
|
shippingMethodLabels.add(S.of(context).delivery);
|
||||||
shippingMethodIcons.add(Icons.directions_car);
|
shippingMethodIcons.add(Icons.directions_car);
|
||||||
if (deliveryMethod == 'store-delivery') {
|
if (deliveryMethod == 'store-delivery') {
|
||||||
@@ -1082,7 +1082,7 @@ class MobileCheckoutState extends State<MobileCheckout> with SingleTickerProvide
|
|||||||
}
|
}
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
if (cartInfo.businessInfo!.deliveryCanadaPost == true) {
|
if (cartInfo!.businessInfo!.deliveryCanadaPost == true) {
|
||||||
shippingMethodLabels.add(S.of(context).canada_post);
|
shippingMethodLabels.add(S.of(context).canada_post);
|
||||||
shippingMethodIcons.add(Icons.local_shipping);
|
shippingMethodIcons.add(Icons.local_shipping);
|
||||||
if (deliveryMethod == 'canada-post') {
|
if (deliveryMethod == 'canada-post') {
|
||||||
@@ -1090,7 +1090,7 @@ class MobileCheckoutState extends State<MobileCheckout> with SingleTickerProvide
|
|||||||
}
|
}
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
if (cartInfo.businessInfo!.deliveryPickup == true) {
|
if (cartInfo!.businessInfo!.deliveryPickup == true) {
|
||||||
shippingMethodLabels.add(S.of(context).pickup);
|
shippingMethodLabels.add(S.of(context).pickup);
|
||||||
shippingMethodIcons.add(Icons.store);
|
shippingMethodIcons.add(Icons.store);
|
||||||
if (deliveryMethod == 'pickup') {
|
if (deliveryMethod == 'pickup') {
|
||||||
@@ -1681,7 +1681,7 @@ class MobileCheckoutState extends State<MobileCheckout> with SingleTickerProvide
|
|||||||
return GestureDetector(
|
return GestureDetector(
|
||||||
child: Container(
|
child: Container(
|
||||||
decoration: selectedCoupon == 0 ? BoxDecoration(
|
decoration: selectedCoupon == 0 ? BoxDecoration(
|
||||||
color: subtotal > cartInfo.businessInfo!.minPrice! ? Colors
|
color: subtotal > cartInfo!.businessInfo!.minPrice! ? Colors
|
||||||
.transparent : Colors.black38,
|
.transparent : Colors.black38,
|
||||||
border: Border(
|
border: Border(
|
||||||
top: BorderSide(
|
top: BorderSide(
|
||||||
@@ -1702,7 +1702,7 @@ class MobileCheckoutState extends State<MobileCheckout> with SingleTickerProvide
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
) : BoxDecoration(
|
) : BoxDecoration(
|
||||||
color: subtotal > cartInfo.businessInfo!.minPrice! ? Colors
|
color: subtotal > cartInfo!.businessInfo!.minPrice! ? Colors
|
||||||
.transparent : Colors.black38,
|
.transparent : Colors.black38,
|
||||||
),
|
),
|
||||||
child: Row(
|
child: Row(
|
||||||
@@ -1743,7 +1743,7 @@ class MobileCheckoutState extends State<MobileCheckout> with SingleTickerProvide
|
|||||||
return GestureDetector(
|
return GestureDetector(
|
||||||
child: Container(
|
child: Container(
|
||||||
decoration: selectedCoupon == coupon.id ? BoxDecoration(
|
decoration: selectedCoupon == coupon.id ? BoxDecoration(
|
||||||
color: subtotal > cartInfo.businessInfo!.minPrice! ? Colors
|
color: subtotal > cartInfo!.businessInfo!.minPrice! ? Colors
|
||||||
.transparent : Colors.black38,
|
.transparent : Colors.black38,
|
||||||
border: Border(
|
border: Border(
|
||||||
top: BorderSide(
|
top: BorderSide(
|
||||||
@@ -1917,7 +1917,7 @@ class MobileCheckoutState extends State<MobileCheckout> with SingleTickerProvide
|
|||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [],
|
children: [],
|
||||||
);
|
);
|
||||||
if (cartInfo.businessInfo!.quickInputs!.length > 0) {
|
if (cartInfo!.businessInfo!.quickInputs!.length > 0) {
|
||||||
Wrap w = Wrap(
|
Wrap w = Wrap(
|
||||||
children: [],
|
children: [],
|
||||||
);
|
);
|
||||||
@@ -1931,8 +1931,8 @@ class MobileCheckoutState extends State<MobileCheckout> with SingleTickerProvide
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
));
|
));
|
||||||
for (int i = 0; i < cartInfo.businessInfo!.quickInputs!.length; i++) {
|
for (int i = 0; i < cartInfo!.businessInfo!.quickInputs!.length; i++) {
|
||||||
String qi = cartInfo.businessInfo!.quickInputs![i].value!;
|
String qi = cartInfo!.businessInfo!.quickInputs![i].value!;
|
||||||
w.children.add(TextButton(
|
w.children.add(TextButton(
|
||||||
child: Text(
|
child: Text(
|
||||||
qi,
|
qi,
|
||||||
@@ -2196,7 +2196,7 @@ class MobileCheckoutState extends State<MobileCheckout> with SingleTickerProvide
|
|||||||
},
|
},
|
||||||
businessId: widget.businessId,
|
businessId: widget.businessId,
|
||||||
body: {
|
body: {
|
||||||
'cart_id': cartInfo.id,
|
'cart_id': cartInfo!.id,
|
||||||
'remark': orderRemark,
|
'remark': orderRemark,
|
||||||
'booked_at': bookingTimeList.length > 0
|
'booked_at': bookingTimeList.length > 0
|
||||||
? bookingTimeList[bookingTimeIndex].unixTime
|
? bookingTimeList[bookingTimeIndex].unixTime
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ class MobileNewComment extends StatefulWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class MobileNewCommentState extends State<MobileNewComment> {
|
class MobileNewCommentState extends State<MobileNewComment> {
|
||||||
late Comment comment;
|
Comment? comment;
|
||||||
|
|
||||||
late bool _showProgress;
|
late bool _showProgress;
|
||||||
|
|
||||||
@@ -167,8 +167,8 @@ class MobileNewCommentState extends State<MobileNewComment> {
|
|||||||
children: <Widget>[],
|
children: <Widget>[],
|
||||||
);
|
);
|
||||||
|
|
||||||
if (comment != null && comment.images!.length > 0) {
|
if (comment != null && comment!.images!.length > 0) {
|
||||||
for (ProductImage image in comment.images!) {
|
for (ProductImage image in comment!.images!) {
|
||||||
row.children.add(
|
row.children.add(
|
||||||
Container(
|
Container(
|
||||||
padding: EdgeInsets.only(left: 10.0),
|
padding: EdgeInsets.only(left: 10.0),
|
||||||
@@ -239,7 +239,7 @@ class MobileNewCommentState extends State<MobileNewComment> {
|
|||||||
child: Icon(
|
child: Icon(
|
||||||
Icons.add,
|
Icons.add,
|
||||||
size: 60.0,
|
size: 60.0,
|
||||||
color: comment == null || comment.images!.length < 3 ? Colors.lightBlue : Colors.black12,
|
color: comment == null || comment!.images!.length < 3 ? Colors.lightBlue : Colors.black12,
|
||||||
),
|
),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: Colors.white70,
|
color: Colors.white70,
|
||||||
@@ -264,13 +264,13 @@ class MobileNewCommentState extends State<MobileNewComment> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
onTap: () {
|
onTap: () {
|
||||||
if (comment == null || comment.images!.length < 3) {
|
if (comment == null || comment!.images!.length < 3) {
|
||||||
showDialog(
|
showDialog(
|
||||||
context: mainContext,
|
context: mainContext,
|
||||||
barrierDismissible: true,
|
barrierDismissible: true,
|
||||||
builder: (BuildContext context) {
|
builder: (BuildContext context) {
|
||||||
return Util().getPicture(mainContext, store.state.user!,
|
return Util().getPicture(mainContext, store.state.user!,
|
||||||
commentId: comment != null ? comment.id! : 0,
|
commentId: comment != null ? comment!.id! : 0,
|
||||||
orderId: widget.orderId);
|
orderId: widget.orderId);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
@@ -329,7 +329,7 @@ class MobileNewCommentState extends State<MobileNewComment> {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
queryParameters: {
|
queryParameters: {
|
||||||
'comment_id': comment != null ? comment.id! : 0,
|
'comment_id': comment != null ? comment!.id! : 0,
|
||||||
},
|
},
|
||||||
).catchError((error) {
|
).catchError((error) {
|
||||||
Utils.showMessageDialog(context, error);
|
Utils.showMessageDialog(context, error);
|
||||||
@@ -356,7 +356,7 @@ class MobileNewCommentState extends State<MobileNewComment> {
|
|||||||
isFormData: true,
|
isFormData: true,
|
||||||
body: {
|
body: {
|
||||||
'order_id': widget.orderId,
|
'order_id': widget.orderId,
|
||||||
'comment_id': comment != null ? comment.id! : 0,
|
'comment_id': comment != null ? comment!.id! : 0,
|
||||||
'content': commentController.text,
|
'content': commentController.text,
|
||||||
'rating': rating.round(),
|
'rating': rating.round(),
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ class MobilePayNow extends StatefulWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class MobilePayNowState extends State<MobilePayNow> {
|
class MobilePayNowState extends State<MobilePayNow> {
|
||||||
late Order order;
|
Order? order;
|
||||||
late List<PaymentPlatform> paymentPlatforms;
|
late List<PaymentPlatform> paymentPlatforms;
|
||||||
late User _user;
|
late User _user;
|
||||||
|
|
||||||
@@ -74,7 +74,7 @@ class MobilePayNowState extends State<MobilePayNow> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
'\$${order.totalPrice!.toStringAsFixed(2)}',
|
'\$${order!.totalPrice!.toStringAsFixed(2)}',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 24.0,
|
fontSize: 24.0,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
@@ -194,7 +194,7 @@ class MobilePayNowState extends State<MobilePayNow> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
onTap: () {
|
onTap: () {
|
||||||
Util.goPayment(context, order, paymentPlatform);
|
Util.goPayment(context, order!, paymentPlatform);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ class MobileProductDetailPageState extends State<MobileProductDetailPage>
|
|||||||
late double _sliverAppBarMaxHeight;
|
late double _sliverAppBarMaxHeight;
|
||||||
final double _tabBarHeight = 50;
|
final double _tabBarHeight = 50;
|
||||||
|
|
||||||
late ProductDetail productDetail;
|
ProductDetail? productDetail;
|
||||||
|
|
||||||
late bool refresh;
|
late bool refresh;
|
||||||
|
|
||||||
@@ -133,7 +133,7 @@ class MobileProductDetailPageState extends State<MobileProductDetailPage>
|
|||||||
padding:
|
padding:
|
||||||
EdgeInsets.only(left: 10.0, top: 5.0, right: 10.0),
|
EdgeInsets.only(left: 10.0, top: 5.0, right: 10.0),
|
||||||
child: Text(
|
child: Text(
|
||||||
productDetail.name!,
|
productDetail!.name!,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 15.0, fontWeight: FontWeight.bold),
|
fontSize: 15.0, fontWeight: FontWeight.bold),
|
||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
@@ -144,12 +144,12 @@ class MobileProductDetailPageState extends State<MobileProductDetailPage>
|
|||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
ShowPrice(
|
ShowPrice(
|
||||||
productDetail.price!,
|
productDetail!.price!,
|
||||||
currencySign: '\$',
|
currencySign: '\$',
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
smallFontSize: 14,
|
smallFontSize: 14,
|
||||||
largeFontSize: 18,
|
largeFontSize: 18,
|
||||||
regularPrice: productDetail.regularPrice,
|
regularPrice: productDetail!.regularPrice,
|
||||||
),
|
),
|
||||||
Container(
|
Container(
|
||||||
child: AddRemoveButton(
|
child: AddRemoveButton(
|
||||||
@@ -204,35 +204,35 @@ class MobileProductDetailPageState extends State<MobileProductDetailPage>
|
|||||||
mainAxisAlignment: MainAxisAlignment.start,
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
(productDetail.subproducts!.length > 0) ?
|
(productDetail!.subproducts!.length > 0) ?
|
||||||
subProducts(productDetail.subproducts!) :
|
subProducts(productDetail!.subproducts!) :
|
||||||
SizedBox.shrink(),
|
SizedBox.shrink(),
|
||||||
Container(
|
Container(
|
||||||
padding: EdgeInsets.only(
|
padding: EdgeInsets.only(
|
||||||
top: 10.0, left: 10.0, right: 10.0),
|
top: 10.0, left: 10.0, right: 10.0),
|
||||||
child: Text(
|
child: Text(
|
||||||
productDetail.description!,
|
productDetail!.description!,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 14.0, color: Colors.black54),
|
fontSize: 14.0, color: Colors.black54),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Container(
|
Container(
|
||||||
padding: EdgeInsets.only(left: 10.0, right: 10.0),
|
padding: EdgeInsets.only(left: 10.0, right: 10.0),
|
||||||
child: (productDetail.description2 != null &&
|
child: (productDetail!.description2 != null &&
|
||||||
!productDetail.description2!.isEmpty)
|
!productDetail!.description2!.isEmpty)
|
||||||
? Text(
|
? Text(
|
||||||
'${productDetail.description2}',
|
'${productDetail!.description2}',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 14.0, color: Colors.black54),
|
fontSize: 14.0, color: Colors.black54),
|
||||||
)
|
)
|
||||||
: SizedBox.shrink(),
|
: SizedBox.shrink(),
|
||||||
),
|
),
|
||||||
productDetail.detailDescription != null
|
productDetail!.detailDescription != null
|
||||||
? Container(
|
? Container(
|
||||||
padding:
|
padding:
|
||||||
EdgeInsets.only(left: 10.0, right: 10.0),
|
EdgeInsets.only(left: 10.0, right: 10.0),
|
||||||
child: MarkdownBody(
|
child: MarkdownBody(
|
||||||
data: '${productDetail.detailDescription}',
|
data: '${productDetail!.detailDescription}',
|
||||||
shrinkWrap: true,
|
shrinkWrap: true,
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
@@ -250,7 +250,7 @@ class MobileProductDetailPageState extends State<MobileProductDetailPage>
|
|||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Container(
|
Container(
|
||||||
child: Text(
|
child: Text(
|
||||||
S.of(context).weight_token(productDetail.weight!),
|
S.of(context).weight_token(productDetail!.weight!),
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 12.0,
|
fontSize: 12.0,
|
||||||
color: Colors.black54,
|
color: Colors.black54,
|
||||||
@@ -260,9 +260,9 @@ class MobileProductDetailPageState extends State<MobileProductDetailPage>
|
|||||||
Container(
|
Container(
|
||||||
child: Text(
|
child: Text(
|
||||||
S.of(context).dimentions_token(
|
S.of(context).dimentions_token(
|
||||||
productDetail.dimentionsLength!,
|
productDetail!.dimentionsLength!,
|
||||||
productDetail.dimentionsWidth!,
|
productDetail!.dimentionsWidth!,
|
||||||
productDetail.dimentionsHeight!),
|
productDetail!.dimentionsHeight!),
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 12.0,
|
fontSize: 12.0,
|
||||||
color: Colors.black54,
|
color: Colors.black54,
|
||||||
@@ -418,10 +418,10 @@ class MobileProductDetailPageState extends State<MobileProductDetailPage>
|
|||||||
List<Widget> _getProductPictures(BuildContext context) {
|
List<Widget> _getProductPictures(BuildContext context) {
|
||||||
var pages = <Widget>[];
|
var pages = <Widget>[];
|
||||||
List<String> images = [];
|
List<String> images = [];
|
||||||
images.add(productDetail.image!);
|
images.add(productDetail!.image!);
|
||||||
for (var i = 0; i < productDetail.images!.length; i++) {
|
for (var i = 0; i < productDetail!.images!.length; i++) {
|
||||||
// print('>>https:' + productDetail.images[i].image);
|
// print('>>https:' + productDetail.images[i].image);
|
||||||
images.add(productDetail.images![i].image!);
|
images.add(productDetail!.images![i].image!);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (var i = 0; i < images.length; i++) {
|
for (var i = 0; i < images.length; i++) {
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ class MobileViewBlog extends StatefulWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class MobileViewBlogState extends State<MobileViewBlog> {
|
class MobileViewBlogState extends State<MobileViewBlog> {
|
||||||
late Blog blog;
|
Blog? blog;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
@@ -85,7 +85,7 @@ class MobileViewBlogState extends State<MobileViewBlog> {
|
|||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Text(
|
child: Text(
|
||||||
'${blog.title}',
|
'${blog!.title}',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 24.0,
|
fontSize: 24.0,
|
||||||
color: Colors.black
|
color: Colors.black
|
||||||
@@ -93,7 +93,7 @@ class MobileViewBlogState extends State<MobileViewBlog> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
Utils.utcDatetimeStringToLocalDatetimeString(context, blog.createdAt!),
|
Utils.utcDatetimeStringToLocalDatetimeString(context, blog!.createdAt!),
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 14.0,
|
fontSize: 14.0,
|
||||||
color: Colors.black38,
|
color: Colors.black38,
|
||||||
@@ -106,7 +106,7 @@ class MobileViewBlogState extends State<MobileViewBlog> {
|
|||||||
width: double.maxFinite,
|
width: double.maxFinite,
|
||||||
padding: EdgeInsets.only(top: 8.0, left: 16.0, right: 16.0, bottom: 24.0),
|
padding: EdgeInsets.only(top: 8.0, left: 16.0, right: 16.0, bottom: 24.0),
|
||||||
child: Text(
|
child: Text(
|
||||||
'${blog.body}',
|
'${blog!.body}',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: Colors.black87,
|
color: Colors.black87,
|
||||||
fontSize: 17.0,
|
fontSize: 17.0,
|
||||||
@@ -124,11 +124,11 @@ class MobileViewBlogState extends State<MobileViewBlog> {
|
|||||||
Container(
|
Container(
|
||||||
width: double.maxFinite,
|
width: double.maxFinite,
|
||||||
padding: EdgeInsets.only(top: 16.0, bottom: 16.0, left: 16.0, right: 16.0),
|
padding: EdgeInsets.only(top: 16.0, bottom: 16.0, left: 16.0, right: 16.0),
|
||||||
child: (blog.imageUrl != null) ?
|
child: (blog!.imageUrl != null) ?
|
||||||
Container(
|
Container(
|
||||||
width: min(MediaQuery.of(context).size.width, MediaQuery.of(context).size.height) - 100.0,
|
width: min(MediaQuery.of(context).size.width, MediaQuery.of(context).size.height) - 100.0,
|
||||||
height: min(MediaQuery.of(context).size.width, MediaQuery.of(context).size.height) - 100.0,
|
height: min(MediaQuery.of(context).size.width, MediaQuery.of(context).size.height) - 100.0,
|
||||||
child: Util.showImage('https:${blog.imageUrl}'),
|
child: Util.showImage('https:${blog!.imageUrl}'),
|
||||||
) : SizedBox.shrink(),
|
) : SizedBox.shrink(),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
border: Border(
|
border: Border(
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ class MobileViewTicket extends StatefulWidget {
|
|||||||
class MobileViewTicketState extends State<MobileViewTicket> {
|
class MobileViewTicketState extends State<MobileViewTicket> {
|
||||||
final GlobalKey<FormState> _formKey = GlobalKey<FormState>();
|
final GlobalKey<FormState> _formKey = GlobalKey<FormState>();
|
||||||
|
|
||||||
late Ticket ticket;
|
Ticket? ticket;
|
||||||
|
|
||||||
final issueMsgController = TextEditingController();
|
final issueMsgController = TextEditingController();
|
||||||
|
|
||||||
@@ -103,14 +103,14 @@ class MobileViewTicketState extends State<MobileViewTicket> {
|
|||||||
crossAxisAlignment: CrossAxisAlignment.end,
|
crossAxisAlignment: CrossAxisAlignment.end,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
S.of(context).ticket_number_token(ticket.id!),
|
S.of(context).ticket_number_token(ticket!.id!),
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 24.0,
|
fontSize: 24.0,
|
||||||
color: Colors.black
|
color: Colors.black
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
Utils.utcDatetimeStringToLocalDatetimeString(context, ticket.createdAt!),
|
Utils.utcDatetimeStringToLocalDatetimeString(context, ticket!.createdAt!),
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 14.0,
|
fontSize: 14.0,
|
||||||
color: Colors.black38,
|
color: Colors.black38,
|
||||||
@@ -123,7 +123,7 @@ class MobileViewTicketState extends State<MobileViewTicket> {
|
|||||||
width: double.maxFinite,
|
width: double.maxFinite,
|
||||||
padding: EdgeInsets.only(top: 8.0, left: 16.0, right: 16.0, bottom: 24.0),
|
padding: EdgeInsets.only(top: 8.0, left: 16.0, right: 16.0, bottom: 24.0),
|
||||||
child: Text(
|
child: Text(
|
||||||
'${ticket.issue!.msg}',
|
'${ticket!.issue!.msg}',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: Colors.black54,
|
color: Colors.black54,
|
||||||
fontSize: 14.0,
|
fontSize: 14.0,
|
||||||
@@ -141,7 +141,7 @@ class MobileViewTicketState extends State<MobileViewTicket> {
|
|||||||
Container(
|
Container(
|
||||||
width: double.maxFinite,
|
width: double.maxFinite,
|
||||||
padding: EdgeInsets.only(top: 16.0, bottom: 16.0, left: 16.0, right: 16.0),
|
padding: EdgeInsets.only(top: 16.0, bottom: 16.0, left: 16.0, right: 16.0),
|
||||||
child: showGalleryImages(mainContext, ticket.issue!.files!),
|
child: showGalleryImages(mainContext, ticket!.issue!.files!),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
border: Border(
|
border: Border(
|
||||||
bottom: BorderSide(
|
bottom: BorderSide(
|
||||||
@@ -171,7 +171,7 @@ class MobileViewTicketState extends State<MobileViewTicket> {
|
|||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
|
||||||
if (ticket.followUps!.length > 0) {
|
if (ticket!.followUps!.length > 0) {
|
||||||
view.children.add(
|
view.children.add(
|
||||||
Container(
|
Container(
|
||||||
width: double.maxFinite,
|
width: double.maxFinite,
|
||||||
@@ -185,8 +185,8 @@ class MobileViewTicketState extends State<MobileViewTicket> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
for (int i = 0; i < ticket.followUps!.length; i++) {
|
for (int i = 0; i < ticket!.followUps!.length; i++) {
|
||||||
FollowUp followUp = ticket.followUps![i];
|
FollowUp followUp = ticket!.followUps![i];
|
||||||
view.children.add(
|
view.children.add(
|
||||||
Container(
|
Container(
|
||||||
width: double.maxFinite,
|
width: double.maxFinite,
|
||||||
@@ -353,7 +353,7 @@ class MobileViewTicketState extends State<MobileViewTicket> {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
if (ticket.followUps!.length > 0) {
|
if (ticket!.followUps!.length > 0) {
|
||||||
view.children.add(
|
view.children.add(
|
||||||
Container(
|
Container(
|
||||||
width: double.maxFinite,
|
width: double.maxFinite,
|
||||||
@@ -375,7 +375,7 @@ class MobileViewTicketState extends State<MobileViewTicket> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ticket.isClosed == true) {
|
if (ticket!.isClosed == true) {
|
||||||
view.children.add(
|
view.children.add(
|
||||||
Container(
|
Container(
|
||||||
padding: EdgeInsets.symmetric(horizontal: 20.0, vertical: 20.0),
|
padding: EdgeInsets.symmetric(horizontal: 20.0, vertical: 20.0),
|
||||||
@@ -393,7 +393,7 @@ class MobileViewTicketState extends State<MobileViewTicket> {
|
|||||||
padding: EdgeInsets.only(left: 20.0, right: 20.0, top: 0.0, bottom: 30.0),
|
padding: EdgeInsets.only(left: 20.0, right: 20.0, top: 0.0, bottom: 30.0),
|
||||||
child: TextLink(
|
child: TextLink(
|
||||||
S.of(context).new_ticket,
|
S.of(context).new_ticket,
|
||||||
'/new-ticket/${ticket.store!.id}',
|
'/new-ticket/${ticket!.store!.id}',
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
@@ -689,7 +689,7 @@ class MobileViewTicketState extends State<MobileViewTicket> {
|
|||||||
child: Text(S.of(context).ok),
|
child: Text(S.of(context).ok),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
Routes.router.navigateTo(context,
|
Routes.router.navigateTo(context,
|
||||||
'/my-support/${ticket.store!.id}',
|
'/my-support/${ticket!.store!.id}',
|
||||||
replace: true,
|
replace: true,
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -56,8 +56,8 @@ class ShopState extends State<Shop>
|
|||||||
|
|
||||||
GlobalKey<ScaffoldState> _scaffoldKey = new GlobalKey<ScaffoldState>();
|
GlobalKey<ScaffoldState> _scaffoldKey = new GlobalKey<ScaffoldState>();
|
||||||
|
|
||||||
late Business _business;
|
Business? _business;
|
||||||
late List<CategoryProducts> _categoryProducts;
|
List<CategoryProducts>? _categoryProducts;
|
||||||
late List<Product> _featuredProducts;
|
late List<Product> _featuredProducts;
|
||||||
late List<Product> _hotSaleProducts;
|
late List<Product> _hotSaleProducts;
|
||||||
|
|
||||||
@@ -86,7 +86,7 @@ class ShopState extends State<Shop>
|
|||||||
final double _tabBarHeight = 50.0;
|
final double _tabBarHeight = 50.0;
|
||||||
late double _sliverAppBarMaxHeight;
|
late double _sliverAppBarMaxHeight;
|
||||||
|
|
||||||
late ShopScrollController _listScrollController1;
|
ShopScrollController? _listScrollController1;
|
||||||
late ShopScrollController _listScrollController2;
|
late ShopScrollController _listScrollController2;
|
||||||
late ShopScrollController _listScrollController3;
|
late ShopScrollController _listScrollController3;
|
||||||
|
|
||||||
@@ -94,7 +94,7 @@ class ShopState extends State<Shop>
|
|||||||
GlobalKey stackKey = GlobalKey();
|
GlobalKey stackKey = GlobalKey();
|
||||||
GlobalKey endKey = GlobalKey();
|
GlobalKey endKey = GlobalKey();
|
||||||
|
|
||||||
late List<Comment> comments;
|
List<Comment>? comments;
|
||||||
int _commentPage = 1;
|
int _commentPage = 1;
|
||||||
int _commentPageCount = 1;
|
int _commentPageCount = 1;
|
||||||
bool _commentLoadingFinish = false;
|
bool _commentLoadingFinish = false;
|
||||||
@@ -140,7 +140,7 @@ class ShopState extends State<Shop>
|
|||||||
'page': _commentPage.toString(),
|
'page': _commentPage.toString(),
|
||||||
'size': Constants.ORDERS_PER_PAGE.toString(),
|
'size': Constants.ORDERS_PER_PAGE.toString(),
|
||||||
},
|
},
|
||||||
businessId: _business.id!,
|
businessId: _business!.id!,
|
||||||
).then((data) {
|
).then((data) {
|
||||||
if (isRefresh) {
|
if (isRefresh) {
|
||||||
_commentRefreshController.refreshCompleted();
|
_commentRefreshController.refreshCompleted();
|
||||||
@@ -226,7 +226,7 @@ class ShopState extends State<Shop>
|
|||||||
isDraggable: true,
|
isDraggable: true,
|
||||||
backdropEnabled: true,
|
backdropEnabled: true,
|
||||||
panel: ShoppingCartBar(
|
panel: ShoppingCartBar(
|
||||||
business: _business,
|
business: _business!,
|
||||||
endKey: endKey,
|
endKey: endKey,
|
||||||
onEmptyCartListener: () {
|
onEmptyCartListener: () {
|
||||||
Future.delayed(Duration(seconds: 1), () {
|
Future.delayed(Duration(seconds: 1), () {
|
||||||
@@ -247,7 +247,7 @@ class ShopState extends State<Shop>
|
|||||||
mainAxisAlignment: MainAxisAlignment.start,
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
children: <Widget>[],
|
children: <Widget>[],
|
||||||
);
|
);
|
||||||
for (var i = 0; i < _business.promoProducts!.length; i++) {
|
for (var i = 0; i < _business!.promoProducts!.length; i++) {
|
||||||
promotRow.children.add(Container(
|
promotRow.children.add(Container(
|
||||||
padding: EdgeInsets.only(
|
padding: EdgeInsets.only(
|
||||||
left: 10.0,
|
left: 10.0,
|
||||||
@@ -286,17 +286,17 @@ class ShopState extends State<Shop>
|
|||||||
GestureDetector(
|
GestureDetector(
|
||||||
child: Container(
|
child: Container(
|
||||||
child: Util.showImage(
|
child: Util.showImage(
|
||||||
_business.promoProducts![i].imagePath!,
|
_business!.promoProducts![i].imagePath!,
|
||||||
width: 110.0,
|
width: 110.0,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
onTap: () {
|
onTap: () {
|
||||||
_showProductDetail(_business.promoProducts![i]);
|
_showProductDetail(_business!.promoProducts![i]);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
Container(
|
Container(
|
||||||
child: Text(
|
child: Text(
|
||||||
_business.promoProducts![i].name!,
|
_business!.promoProducts![i].name!,
|
||||||
maxLines: 2,
|
maxLines: 2,
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
style: TextStyle(fontSize: 14.0),
|
style: TextStyle(fontSize: 14.0),
|
||||||
@@ -306,13 +306,13 @@ class ShopState extends State<Shop>
|
|||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
ShowPrice(
|
ShowPrice(
|
||||||
_business.promoProducts![i].price!,
|
_business!.promoProducts![i].price!,
|
||||||
currencySign: '\$',
|
currencySign: '\$',
|
||||||
regularPrice: _business.promoProducts![i].regularPrice,
|
regularPrice: _business!.promoProducts![i].regularPrice,
|
||||||
),
|
),
|
||||||
Container(
|
Container(
|
||||||
child: AddRemoveButton(
|
child: AddRemoveButton(
|
||||||
product: _business.promoProducts![i],
|
product: _business!.promoProducts![i],
|
||||||
business: _business,
|
business: _business,
|
||||||
addOnly: true,
|
addOnly: true,
|
||||||
),
|
),
|
||||||
@@ -392,7 +392,7 @@ class ShopState extends State<Shop>
|
|||||||
onTap: () {
|
onTap: () {
|
||||||
Navigator.push(context,
|
Navigator.push(context,
|
||||||
MaterialPageRoute(builder: (BuildContext context) {
|
MaterialPageRoute(builder: (BuildContext context) {
|
||||||
return ProductSearch(_business);
|
return ProductSearch(_business!);
|
||||||
}));
|
}));
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
@@ -403,13 +403,13 @@ class ShopState extends State<Shop>
|
|||||||
child: new Icon(Icons.phone),
|
child: new Icon(Icons.phone),
|
||||||
onTap: () {
|
onTap: () {
|
||||||
Utils.launchURL(
|
Utils.launchURL(
|
||||||
'tel:${Utils.getFirstNumberFromString(_business.phone!)}');
|
'tel:${Utils.getFirstNumberFromString(_business!.phone!)}');
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
title: Text(
|
title: Text(
|
||||||
_business != null ? _business.name! : '',
|
_business != null ? _business!.name! : '',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
),
|
),
|
||||||
@@ -446,7 +446,7 @@ class ShopState extends State<Shop>
|
|||||||
Tab(
|
Tab(
|
||||||
child: Badge(
|
child: Badge(
|
||||||
badgeContent: Text(
|
badgeContent: Text(
|
||||||
'${_business.commentsCount}',
|
'${_business!.commentsCount}',
|
||||||
style: TextStyle(color: Colors.white, fontSize: 11.0),
|
style: TextStyle(color: Colors.white, fontSize: 11.0),
|
||||||
),
|
),
|
||||||
badgeStyle: BadgeStyle(badgeColor: Colors.lightBlueAccent),
|
badgeStyle: BadgeStyle(badgeColor: Colors.lightBlueAccent),
|
||||||
@@ -508,7 +508,7 @@ class ShopState extends State<Shop>
|
|||||||
|
|
||||||
stack.children.addAll(children);
|
stack.children.addAll(children);
|
||||||
|
|
||||||
if (_business.isPublic != true) {
|
if (_business!.isPublic != true) {
|
||||||
stack.children.add(
|
stack.children.add(
|
||||||
Positioned(
|
Positioned(
|
||||||
top: 0,
|
top: 0,
|
||||||
@@ -571,12 +571,12 @@ class ShopState extends State<Shop>
|
|||||||
Widget commentWidget = Center(
|
Widget commentWidget = Center(
|
||||||
child: Text(S.of(context).no_comments_yet),
|
child: Text(S.of(context).no_comments_yet),
|
||||||
);
|
);
|
||||||
if (comments != null && comments.length > 0) {
|
if (comments != null && comments!.length > 0) {
|
||||||
commentWidget = ListView.builder(
|
commentWidget = ListView.builder(
|
||||||
controller: _listScrollController3,
|
controller: _listScrollController3,
|
||||||
itemCount: comments.length,
|
itemCount: comments!.length,
|
||||||
itemBuilder: (BuildContext context, int position) {
|
itemBuilder: (BuildContext context, int position) {
|
||||||
Comment comment = comments[position];
|
Comment comment = comments![position];
|
||||||
Row imageRow = Row(
|
Row imageRow = Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
children: <Widget>[],
|
children: <Widget>[],
|
||||||
@@ -772,18 +772,18 @@ class ShopState extends State<Shop>
|
|||||||
children: <Widget>[],
|
children: <Widget>[],
|
||||||
);
|
);
|
||||||
addressColumn.children.add(new Text(
|
addressColumn.children.add(new Text(
|
||||||
_business.address!.addressLine1! +
|
_business!.address!.addressLine1! +
|
||||||
(_business.address!.addressLine2!.isNotEmpty
|
(_business!.address!.addressLine2!.isNotEmpty
|
||||||
? ' ' + _business.address!.addressLine2!
|
? ' ' + _business!.address!.addressLine2!
|
||||||
: ''),
|
: ''),
|
||||||
style: new TextStyle(fontSize: 13.0, color: const Color(0xFFEEEEEE)),
|
style: new TextStyle(fontSize: 13.0, color: const Color(0xFFEEEEEE)),
|
||||||
));
|
));
|
||||||
addressColumn.children.add(new Text(
|
addressColumn.children.add(new Text(
|
||||||
_business.address!.city! +
|
_business!.address!.city! +
|
||||||
', ' +
|
', ' +
|
||||||
_business.address!.state! +
|
_business!.address!.state! +
|
||||||
', ' +
|
', ' +
|
||||||
_business.address!.zip!,
|
_business!.address!.zip!,
|
||||||
style: new TextStyle(fontSize: 13.0, color: const Color(0xFFEEEEEE)),
|
style: new TextStyle(fontSize: 13.0, color: const Color(0xFFEEEEEE)),
|
||||||
));
|
));
|
||||||
|
|
||||||
@@ -793,23 +793,23 @@ class ShopState extends State<Shop>
|
|||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
children: <Widget>[],
|
children: <Widget>[],
|
||||||
);
|
);
|
||||||
if (_business.distanceInfo != null) {
|
if (_business!.distanceInfo != null) {
|
||||||
distanceRow.children.add(new Icon(
|
distanceRow.children.add(new Icon(
|
||||||
Icons.directions_car,
|
Icons.directions_car,
|
||||||
size: 14.0,
|
size: 14.0,
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
));
|
));
|
||||||
distanceRow.children.add(new Text(
|
distanceRow.children.add(new Text(
|
||||||
_business.distanceInfo!.distance != null
|
_business!.distanceInfo!.distance != null
|
||||||
? _business.distanceInfo!.distance!.text!
|
? _business!.distanceInfo!.distance!.text!
|
||||||
: '***' + ' / ',
|
: '***' + ' / ',
|
||||||
style: new TextStyle(color: const Color(0xFFEEEEEE), fontSize: 13.0),
|
style: new TextStyle(color: const Color(0xFFEEEEEE), fontSize: 13.0),
|
||||||
));
|
));
|
||||||
var duration = Duration(
|
var duration = Duration(
|
||||||
seconds: (_business.distanceInfo!.duration != null
|
seconds: (_business!.distanceInfo!.duration != null
|
||||||
? _business.distanceInfo!.duration!.value
|
? _business!.distanceInfo!.duration!.value
|
||||||
: 30)! +
|
: 30)! +
|
||||||
_business.shippingTime! * 60);
|
_business!.shippingTime! * 60);
|
||||||
var hours = duration.inHours.remainder(60);
|
var hours = duration.inHours.remainder(60);
|
||||||
var minutes = duration.inMinutes.remainder(60);
|
var minutes = duration.inMinutes.remainder(60);
|
||||||
distanceRow.children.add(new Text(
|
distanceRow.children.add(new Text(
|
||||||
@@ -825,7 +825,7 @@ class ShopState extends State<Shop>
|
|||||||
distanceRow.children.add(
|
distanceRow.children.add(
|
||||||
new Text(
|
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)),
|
style: new TextStyle(fontSize: 13.0, color: const Color(0xFFEEEEEE)),
|
||||||
),
|
),
|
||||||
@@ -853,7 +853,7 @@ class ShopState extends State<Shop>
|
|||||||
bottom: 0.0,
|
bottom: 0.0,
|
||||||
child: GestureDetector(
|
child: GestureDetector(
|
||||||
child: Util.showImage(
|
child: Util.showImage(
|
||||||
'${_business.picUrl}',
|
'${_business!.picUrl}',
|
||||||
width: 72.0,
|
width: 72.0,
|
||||||
height: 72.0,
|
height: 72.0,
|
||||||
fit: BoxFit.fill,
|
fit: BoxFit.fill,
|
||||||
@@ -895,7 +895,7 @@ class ShopState extends State<Shop>
|
|||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
),
|
),
|
||||||
new Text(
|
new Text(
|
||||||
_business.phone!,
|
_business!.phone!,
|
||||||
style: new TextStyle(
|
style: new TextStyle(
|
||||||
fontSize: 13.0, color: const Color(0xFFEEEEEE)),
|
fontSize: 13.0, color: const Color(0xFFEEEEEE)),
|
||||||
)
|
)
|
||||||
@@ -910,9 +910,9 @@ class ShopState extends State<Shop>
|
|||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
),
|
),
|
||||||
new Text(
|
new Text(
|
||||||
_business.openingTime![0].openTime! +
|
_business!.openingTime![0].openTime! +
|
||||||
':00 - ' +
|
':00 - ' +
|
||||||
_business.openingTime![0].closeTime! +
|
_business!.openingTime![0].closeTime! +
|
||||||
':00',
|
':00',
|
||||||
style: new TextStyle(
|
style: new TextStyle(
|
||||||
fontSize: 13.0, color: const Color(0xFFEEEEEE)),
|
fontSize: 13.0, color: const Color(0xFFEEEEEE)),
|
||||||
@@ -941,7 +941,7 @@ class ShopState extends State<Shop>
|
|||||||
mainAxisAlignment: MainAxisAlignment.start,
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
_business.bulletin!.isNotEmpty ? Row(
|
_business!.bulletin!.isNotEmpty ? Row(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Container(
|
Container(
|
||||||
@@ -956,7 +956,7 @@ class ShopState extends State<Shop>
|
|||||||
width: mediaQuery.size.width - 30.0,
|
width: mediaQuery.size.width - 30.0,
|
||||||
padding: EdgeInsets.only(right: 10.0, bottom: 10.0),
|
padding: EdgeInsets.only(right: 10.0, bottom: 10.0),
|
||||||
child: new Text(
|
child: new Text(
|
||||||
_business.bulletin!.isEmpty ? '' : _business.bulletin!,
|
_business!.bulletin!.isEmpty ? '' : _business!.bulletin!,
|
||||||
softWrap: true,
|
softWrap: true,
|
||||||
style: new TextStyle(
|
style: new TextStyle(
|
||||||
fontSize: 12.0, color: const Color(0xFFDDDDDD)),
|
fontSize: 12.0, color: const Color(0xFFDDDDDD)),
|
||||||
@@ -965,7 +965,7 @@ class ShopState extends State<Shop>
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
) : SizedBox.shrink(),
|
) : SizedBox.shrink(),
|
||||||
_business.description!.isNotEmpty ? Column(
|
_business!.description!.isNotEmpty ? Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
@@ -996,7 +996,7 @@ class ShopState extends State<Shop>
|
|||||||
padding:
|
padding:
|
||||||
EdgeInsets.only(left: 10.0, right: 10.0, top: 5.0, bottom: 5.0),
|
EdgeInsets.only(left: 10.0, right: 10.0, top: 5.0, bottom: 5.0),
|
||||||
child: Text(
|
child: Text(
|
||||||
_business.description!,
|
_business!.description!,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: Colors.lightGreen,
|
color: Colors.lightGreen,
|
||||||
fontSize: 12.0,
|
fontSize: 12.0,
|
||||||
@@ -1009,7 +1009,7 @@ class ShopState extends State<Shop>
|
|||||||
padding: EdgeInsets.only(left: 10.0, right: 10.0, bottom: 10.0),
|
padding: EdgeInsets.only(left: 10.0, right: 10.0, bottom: 10.0),
|
||||||
child: slidingGellery,
|
child: slidingGellery,
|
||||||
) : SizedBox.shrink(),
|
) : SizedBox.shrink(),
|
||||||
_business.policy!.isNotEmpty ? Column(
|
_business!.policy!.isNotEmpty ? Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
@@ -1040,7 +1040,7 @@ class ShopState extends State<Shop>
|
|||||||
padding: EdgeInsets.only(left: 10.0, right: 10.0, bottom: 10.0),
|
padding: EdgeInsets.only(left: 10.0, right: 10.0, bottom: 10.0),
|
||||||
child: SingleChildScrollView(
|
child: SingleChildScrollView(
|
||||||
child: Text(
|
child: Text(
|
||||||
_business.policy!,
|
_business!.policy!,
|
||||||
softWrap: true,
|
softWrap: true,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 10.0,
|
fontSize: 10.0,
|
||||||
@@ -1062,7 +1062,7 @@ class ShopState extends State<Shop>
|
|||||||
right: 0,
|
right: 0,
|
||||||
bottom: 0,
|
bottom: 0,
|
||||||
child: Util.showImage(
|
child: Util.showImage(
|
||||||
_business.bannerImageUrl!,
|
_business!.bannerImageUrl!,
|
||||||
fit: BoxFit.cover,
|
fit: BoxFit.cover,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -1098,11 +1098,11 @@ class ShopState extends State<Shop>
|
|||||||
|
|
||||||
List<Widget> _buildBanners(BuildContext context) {
|
List<Widget> _buildBanners(BuildContext context) {
|
||||||
var pages = <Widget>[];
|
var pages = <Widget>[];
|
||||||
for (var i = 0; i < _business.slideImages!.length; i++) {
|
for (var i = 0; i < _business!.slideImages!.length; i++) {
|
||||||
pages.add(new GestureDetector(
|
pages.add(new GestureDetector(
|
||||||
child: new Container(
|
child: new Container(
|
||||||
child: Util.showImage(
|
child: Util.showImage(
|
||||||
_business.slideImages![i].imageUrl!,
|
_business!.slideImages![i].imageUrl!,
|
||||||
fit: BoxFit.cover,
|
fit: BoxFit.cover,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -1132,14 +1132,14 @@ class ShopState extends State<Shop>
|
|||||||
child: new ListView.builder(
|
child: new ListView.builder(
|
||||||
physics: ClampingScrollPhysics(),
|
physics: ClampingScrollPhysics(),
|
||||||
controller: _listScrollController2,
|
controller: _listScrollController2,
|
||||||
itemCount: _categoryProducts == null ? 0 : _categoryProducts.length,
|
itemCount: _categoryProducts == null ? 0 : _categoryProducts!.length,
|
||||||
itemBuilder: (BuildContext context, int i) {
|
itemBuilder: (BuildContext context, int i) {
|
||||||
CategoryProducts cp = _categoryProducts[i];
|
CategoryProducts cp = _categoryProducts![i];
|
||||||
int qtyInCategory = 0;
|
int qtyInCategory = 0;
|
||||||
CartInfo cartInfo =
|
CartInfo cartInfo =
|
||||||
Utils.getCartInfoByBusiness(store.state.cartInfos, _business)!;
|
Utils.getCartInfoByBusiness(store.state.cartInfos, _business!)!;
|
||||||
if (cartInfo != null &&
|
if (cartInfo != null &&
|
||||||
cartInfo.businessInfo!.id == _business.id &&
|
cartInfo.businessInfo!.id == _business!.id &&
|
||||||
cartInfo.productList != null) {
|
cartInfo.productList != null) {
|
||||||
for (var i = 0; i < cartInfo.productList!.length; i++) {
|
for (var i = 0; i < cartInfo.productList!.length; i++) {
|
||||||
if (cartInfo.productList![i].product!.categoryId == cp.id) {
|
if (cartInfo.productList![i].product!.categoryId == cp.id) {
|
||||||
@@ -1213,21 +1213,21 @@ class ShopState extends State<Shop>
|
|||||||
}
|
}
|
||||||
|
|
||||||
void _selectCategory(int index) {
|
void _selectCategory(int index) {
|
||||||
if (displayProductByCategoryClick && _categoryProducts[index].id! > 0) {
|
if (displayProductByCategoryClick && _categoryProducts![index].id! > 0) {
|
||||||
categoryId = _categoryProducts[index].id!;
|
categoryId = _categoryProducts![index].id!;
|
||||||
loadProducts();
|
loadProducts();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
double height = 0.0;
|
double height = 0.0;
|
||||||
for (int i = 0; i < index; ++i) {
|
for (int i = 0; i < index; ++i) {
|
||||||
height += _categoryDescHeight +
|
height += _categoryDescHeight +
|
||||||
_categoryProducts[i].products!.length * _productHeight;
|
_categoryProducts![i].products!.length * _productHeight;
|
||||||
}
|
}
|
||||||
if (height > _listScrollController1.position.maxScrollExtent) {
|
if (height > _listScrollController1!.position.maxScrollExtent) {
|
||||||
height = _listScrollController1.position.maxScrollExtent;
|
height = _listScrollController1!.position.maxScrollExtent;
|
||||||
}
|
}
|
||||||
_categoryIndexChange = true;
|
_categoryIndexChange = true;
|
||||||
_listScrollController1
|
_listScrollController1!
|
||||||
.animateTo(height,
|
.animateTo(height,
|
||||||
duration: new Duration(
|
duration: new Duration(
|
||||||
microseconds: 200,
|
microseconds: 200,
|
||||||
@@ -1237,7 +1237,7 @@ class ShopState extends State<Shop>
|
|||||||
_categoryIndexChange = false;
|
_categoryIndexChange = false;
|
||||||
});
|
});
|
||||||
print(
|
print(
|
||||||
'height: $height, index: $index, ${_categoryProducts[0].products!.length}');
|
'height: $height, index: $index, ${_categoryProducts![0].products!.length}');
|
||||||
if (mounted) {
|
if (mounted) {
|
||||||
setState(() {
|
setState(() {
|
||||||
_categoryIndex = index;
|
_categoryIndex = index;
|
||||||
@@ -1246,7 +1246,7 @@ class ShopState extends State<Shop>
|
|||||||
}
|
}
|
||||||
|
|
||||||
CategoryProducts? getCategoryProductByCategoryId(int cid) {
|
CategoryProducts? getCategoryProductByCategoryId(int cid) {
|
||||||
for (CategoryProducts cp in _categoryProducts) {
|
for (CategoryProducts cp in _categoryProducts!) {
|
||||||
if (cp.id == cid) {
|
if (cp.id == cid) {
|
||||||
return cp;
|
return cp;
|
||||||
}
|
}
|
||||||
@@ -1256,8 +1256,8 @@ class ShopState extends State<Shop>
|
|||||||
|
|
||||||
void _resetProductListScroll() {
|
void _resetProductListScroll() {
|
||||||
if (_listScrollController1 != null &&
|
if (_listScrollController1 != null &&
|
||||||
_listScrollController1.positions.isNotEmpty) {
|
_listScrollController1!.positions.isNotEmpty) {
|
||||||
_listScrollController1.animateTo(
|
_listScrollController1!.animateTo(
|
||||||
0,
|
0,
|
||||||
duration: new Duration(
|
duration: new Duration(
|
||||||
microseconds: 200,
|
microseconds: 200,
|
||||||
@@ -1270,9 +1270,9 @@ class ShopState extends State<Shop>
|
|||||||
int _getCategoryIndexByRightScrollHeight(double height) {
|
int _getCategoryIndexByRightScrollHeight(double height) {
|
||||||
double cHeight = 0.0;
|
double cHeight = 0.0;
|
||||||
if (height > 0) {
|
if (height > 0) {
|
||||||
for (int i = 0; i < _categoryProducts.length; ++i) {
|
for (int i = 0; i < _categoryProducts!.length; ++i) {
|
||||||
double categoryHeight = _categoryDescHeight +
|
double categoryHeight = _categoryDescHeight +
|
||||||
_categoryProducts[i].products!.length * _productHeight;
|
_categoryProducts![i].products!.length * _productHeight;
|
||||||
if (height >= cHeight && height < cHeight + categoryHeight) {
|
if (height >= cHeight && height < cHeight + categoryHeight) {
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
@@ -1280,7 +1280,7 @@ class ShopState extends State<Shop>
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (height > cHeight) {
|
if (height > cHeight) {
|
||||||
return _categoryProducts.length - 1;
|
return _categoryProducts!.length - 1;
|
||||||
}
|
}
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@@ -1310,7 +1310,7 @@ class ShopState extends State<Shop>
|
|||||||
|
|
||||||
int numCategoriesHasProducts() {
|
int numCategoriesHasProducts() {
|
||||||
int num = 0;
|
int num = 0;
|
||||||
for (CategoryProducts cp in _categoryProducts) {
|
for (CategoryProducts cp in _categoryProducts!) {
|
||||||
if (cp.products!.length > 0) {
|
if (cp.products!.length > 0) {
|
||||||
num += 1;
|
num += 1;
|
||||||
}
|
}
|
||||||
@@ -1340,21 +1340,21 @@ class ShopState extends State<Shop>
|
|||||||
_categoryProducts == null ? 0 : numCategoriesHasProducts(),
|
_categoryProducts == null ? 0 : numCategoriesHasProducts(),
|
||||||
itemBuilder: (BuildContext context, int i) {
|
itemBuilder: (BuildContext context, int i) {
|
||||||
CategoryProducts cp;
|
CategoryProducts cp;
|
||||||
cp = _categoryProducts[i];
|
cp = _categoryProducts![i];
|
||||||
|
|
||||||
int index = -1;
|
int index = -1;
|
||||||
if (displayProductByCategoryClick) {
|
if (displayProductByCategoryClick) {
|
||||||
if (categoryId > 0) {
|
if (categoryId > 0) {
|
||||||
for (var j = 0; j < _categoryProducts.length; j++) {
|
for (var j = 0; j < _categoryProducts!.length; j++) {
|
||||||
if (_categoryProducts[j].id == categoryId) {
|
if (_categoryProducts![j].id == categoryId) {
|
||||||
cp = _categoryProducts[j];
|
cp = _categoryProducts![j];
|
||||||
index = j;
|
index = j;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (cp == null) {
|
if (cp == null) {
|
||||||
index = 0;
|
index = 0;
|
||||||
cp = _categoryProducts[0];
|
cp = _categoryProducts![0];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
|
WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
|
||||||
@@ -1424,7 +1424,7 @@ class ShopState extends State<Shop>
|
|||||||
pStack.children.add(Container(
|
pStack.children.add(Container(
|
||||||
// width: MediaQuery.of(context).size.width - 100.0,
|
// width: MediaQuery.of(context).size.width - 100.0,
|
||||||
child: ProductItem(
|
child: ProductItem(
|
||||||
p, _business,
|
p, _business!,
|
||||||
horizontal: true,
|
horizontal: true,
|
||||||
imageWidth: 80.0,
|
imageWidth: 80.0,
|
||||||
),
|
),
|
||||||
@@ -1498,9 +1498,9 @@ class ShopState extends State<Shop>
|
|||||||
_listScrollController2 = _shopCoordinator.newChildScrollController();
|
_listScrollController2 = _shopCoordinator.newChildScrollController();
|
||||||
_listScrollController3 = _shopCoordinator.newChildScrollController();
|
_listScrollController3 = _shopCoordinator.newChildScrollController();
|
||||||
|
|
||||||
_listScrollController1.addListener(() {
|
_listScrollController1!.addListener(() {
|
||||||
if (_listScrollController1.position.atEdge) {
|
if (_listScrollController1!.position.atEdge) {
|
||||||
if (_listScrollController1.position.pixels == 0) {
|
if (_listScrollController1!.position.pixels == 0) {
|
||||||
print('product list at top');
|
print('product list at top');
|
||||||
} else {
|
} else {
|
||||||
print('product list at bottom');
|
print('product list at bottom');
|
||||||
@@ -1567,7 +1567,7 @@ class ShopState extends State<Shop>
|
|||||||
'',
|
'',
|
||||||
'',
|
'',
|
||||||
_hotSaleProducts);
|
_hotSaleProducts);
|
||||||
_categoryProducts.insert(0, hs);
|
_categoryProducts!.insert(0, hs);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_featuredProducts.length > 0) {
|
if (_featuredProducts.length > 0) {
|
||||||
@@ -1578,7 +1578,7 @@ class ShopState extends State<Shop>
|
|||||||
'',
|
'',
|
||||||
'',
|
'',
|
||||||
_featuredProducts);
|
_featuredProducts);
|
||||||
_categoryProducts.insert(0, fe);
|
_categoryProducts!.insert(0, fe);
|
||||||
}
|
}
|
||||||
|
|
||||||
checkActionAndClose(context);
|
checkActionAndClose(context);
|
||||||
|
|||||||
@@ -35,21 +35,21 @@ class ShoppingCartBar extends StatefulWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class ShoppingCartBarState extends State<ShoppingCartBar> {
|
class ShoppingCartBarState extends State<ShoppingCartBar> {
|
||||||
late CartInfo cartInfo;
|
CartInfo? cartInfo;
|
||||||
double totalPrice = 0.0;
|
double totalPrice = 0.0;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
totalPrice = 0.0;
|
totalPrice = 0.0;
|
||||||
cartInfo = Utils.getCartInfoByBusiness(store.state.cartInfos, widget.business)!;
|
cartInfo = Utils.getCartInfoByBusiness(store.state.cartInfos, widget.business)!;
|
||||||
if (cartInfo != null && cartInfo.businessInfo!.id == widget.business.id) {
|
if (cartInfo != null && cartInfo!.businessInfo!.id == widget.business.id) {
|
||||||
totalPrice = cartInfo.getTotalPrice();
|
totalPrice = cartInfo!.getTotalPrice();
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget cartContent;
|
Widget cartContent;
|
||||||
|
|
||||||
if (cartInfo == null || (cartInfo.businessInfo!.id != widget.business.id)
|
if (cartInfo == null || (cartInfo!.businessInfo!.id != widget.business.id)
|
||||||
|| (totalPrice == 0.0 && cartInfo.productList!.length == 0)) {
|
|| (totalPrice == 0.0 && cartInfo!.productList!.length == 0)) {
|
||||||
cartContent = Center(
|
cartContent = Center(
|
||||||
child: Container(
|
child: Container(
|
||||||
padding: EdgeInsets.all(20.0),
|
padding: EdgeInsets.all(20.0),
|
||||||
@@ -92,8 +92,8 @@ class ShoppingCartBarState extends State<ShoppingCartBar> {
|
|||||||
},
|
},
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
for (var i = 0; i < cartInfo.productList!.length; i++) {
|
for (var i = 0; i < cartInfo!.productList!.length; i++) {
|
||||||
(cartContent as Column).children.add(cartLineItem(cartInfo.productList![i], i));
|
(cartContent as Column).children.add(cartLineItem(cartInfo!.productList![i], i));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user