From a81c115e8d886ad2afdf4c709cec788980fe9a25 Mon Sep 17 00:00:00 2001 From: WooSignal Date: Sun, 17 May 2020 15:18:59 +0100 Subject: [PATCH] v2.0.6 last tweaks --- LabelStoreMax/lib/helpers/tools.dart | 8 ++- LabelStoreMax/lib/pages/home.dart | 20 +++--- LabelStoreMax/lib/pages/product_detail.dart | 14 ++-- LabelStoreMax/lib/widgets/woosignal_ui.dart | 80 +++++++++++++-------- README.md | 2 +- 5 files changed, 75 insertions(+), 49 deletions(-) diff --git a/LabelStoreMax/lib/helpers/tools.dart b/LabelStoreMax/lib/helpers/tools.dart index bbb77aa..bc7579c 100644 --- a/LabelStoreMax/lib/helpers/tools.dart +++ b/LabelStoreMax/lib/helpers/tools.dart @@ -151,10 +151,12 @@ String formatStringCurrency({@required String total}) { return fmf.output.symbolOnLeft; } -String workoutSaleDiscount({@required String salePrice, @required String priceBefore}) { +String workoutSaleDiscount( + {@required String salePrice, @required String priceBefore}) { double dSalePrice = parseWcPrice(salePrice); double dPriceBefore = parseWcPrice(priceBefore); - return ((dPriceBefore-dSalePrice) * (100 / dPriceBefore)).toStringAsFixed(0); + return ((dPriceBefore - dSalePrice) * (100 / dPriceBefore)) + .toStringAsFixed(0); } openBrowserTab({@required String url}) async { @@ -505,7 +507,7 @@ Widget refreshableScroll(context, child: (products.length != null && products.length > 0 ? GridView.count( crossAxisCount: 2, - childAspectRatio: calAspectRatio(context), + childAspectRatio: calAspectRatio(context), shrinkWrap: true, children: List.generate( products.length, diff --git a/LabelStoreMax/lib/pages/home.dart b/LabelStoreMax/lib/pages/home.dart index 3702713..13b2f46 100644 --- a/LabelStoreMax/lib/pages/home.dart +++ b/LabelStoreMax/lib/pages/home.dart @@ -145,8 +145,10 @@ class _HomePageState extends State { crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start, children: [ - Text(trans(context, "Shop") + " / ", - style: Theme.of(context).primaryTextTheme.subtitle1,), + Text( + trans(context, "Shop") + " / ", + style: Theme.of(context).primaryTextTheme.subtitle1, + ), Text( trans(context, "Newest"), style: Theme.of(context).primaryTextTheme.bodyText2, @@ -167,12 +169,14 @@ class _HomePageState extends State { (_isLoading ? Expanded(child: showAppLoader()) : Expanded( - child: refreshableScroll(context, - refreshController: _refreshController, - onRefresh: _onRefresh, - onLoading: _onLoading, - products: _products, - onTap: _showProduct,), + child: refreshableScroll( + context, + refreshController: _refreshController, + onRefresh: _onRefresh, + onLoading: _onLoading, + products: _products, + onTap: _showProduct, + ), flex: 1, )), ], diff --git a/LabelStoreMax/lib/pages/product_detail.dart b/LabelStoreMax/lib/pages/product_detail.dart index def3b45..4ae59e5 100644 --- a/LabelStoreMax/lib/pages/product_detail.dart +++ b/LabelStoreMax/lib/pages/product_detail.dart @@ -302,13 +302,12 @@ class _ProductDetailState extends State { itemBuilder: (BuildContext context, int index) { return CachedNetworkImage( imageUrl: _product.images[index].src, - placeholder: (context, url) => - Center( - child: new CircularProgressIndicator( - strokeWidth: 2, - backgroundColor: Colors.black12, + placeholder: (context, url) => Center( + child: new CircularProgressIndicator( + strokeWidth: 2, + backgroundColor: Colors.black12, + ), ), - ), errorWidget: (context, url, error) => new Icon(Icons.error), fit: BoxFit.contain, @@ -361,7 +360,8 @@ class _ProductDetailState extends State { ), textAlign: TextAlign.right, ), - (_product.onSale == true && _product.type != "variable" + (_product.onSale == true && + _product.type != "variable" ? Text( formatStringCurrency( total: _product.regularPrice), diff --git a/LabelStoreMax/lib/widgets/woosignal_ui.dart b/LabelStoreMax/lib/widgets/woosignal_ui.dart index 43e51c7..a0942d9 100644 --- a/LabelStoreMax/lib/widgets/woosignal_ui.dart +++ b/LabelStoreMax/lib/widgets/woosignal_ui.dart @@ -206,7 +206,7 @@ List wsBoxShadow({double blurRadius}) { Widget wsCardProductItem(BuildContext context, {int index, Product product, onTap}) { return LayoutBuilder( - builder: (cxt,constraints) => InkWell( + builder: (cxt, constraints) => InkWell( child: Container( margin: EdgeInsets.all(4), child: Column( @@ -216,11 +216,16 @@ Widget wsCardProductItem(BuildContext context, borderRadius: BorderRadius.circular(3.0), child: CachedNetworkImage( imageUrl: - (product.images.length > 0 ? product.images.first.src : ""), - placeholder: (context, url) => Center(child: CircularProgressIndicator()), + (product.images.length > 0 ? product.images.first.src : ""), + placeholder: (context, url) => Container( + child: Center( + child: CircularProgressIndicator(), + ), + height: constraints.maxHeight / 1.75, + ), errorWidget: (context, url, error) => new Icon(Icons.error), - fit: BoxFit.cover, - height: constraints.maxHeight / 1.8, + fit: BoxFit.fitWidth, + height: constraints.maxHeight / 1.75, width: double.infinity, ), ), @@ -239,10 +244,10 @@ Widget wsCardProductItem(BuildContext context, padding: const EdgeInsets.only(top: 1), child: Text( formatStringCurrency(total: product.price), - style: Theme.of(context).textTheme.bodyText1.copyWith( - fontWeight: FontWeight.w600, - fontSize: 16 - ), + style: Theme.of(context) + .textTheme + .bodyText1 + .copyWith(fontWeight: FontWeight.w600, fontSize: 16), textAlign: TextAlign.left, ), ), @@ -251,27 +256,42 @@ Widget wsCardProductItem(BuildContext context, child: Container( child: (product.onSale && product.type != "variable" ? RichText( - textAlign: TextAlign.left, - text: TextSpan( - text: '', - style: Theme.of(context).textTheme.bodyText1, - children: [ - TextSpan(text: '${trans(context, "Was")}: ', style: Theme.of(context).textTheme.bodyText1.copyWith( - color: Colors.black54, - fontSize: 11 - ),), - TextSpan(text: formatStringCurrency(total: product.regularPrice), style: Theme.of(context).textTheme.bodyText1.copyWith( - decoration: TextDecoration.lineThrough, - color: Colors.grey, - fontSize: 11 - ),), - TextSpan(text: " | ${workoutSaleDiscount(salePrice: product.salePrice, priceBefore: product.regularPrice)}% ${trans(context, "off")}", style: Theme.of(context).textTheme.bodyText1.copyWith( - color: Colors.black87, - fontSize: 11 - ),), - ], - ), - ) + textAlign: TextAlign.left, + text: TextSpan( + text: '', + style: Theme.of(context).textTheme.bodyText1, + children: [ + TextSpan( + text: '${trans(context, "Was")}: ', + style: Theme.of(context) + .textTheme + .bodyText1 + .copyWith( + color: Colors.black54, fontSize: 11), + ), + TextSpan( + text: formatStringCurrency( + total: product.regularPrice), + style: Theme.of(context) + .textTheme + .bodyText1 + .copyWith( + decoration: TextDecoration.lineThrough, + color: Colors.grey, + fontSize: 11), + ), + TextSpan( + text: + " | ${workoutSaleDiscount(salePrice: product.salePrice, priceBefore: product.regularPrice)}% ${trans(context, "off")}", + style: Theme.of(context) + .textTheme + .bodyText1 + .copyWith( + color: Colors.black87, fontSize: 11), + ), + ], + ), + ) : null), width: double.infinity, ), diff --git a/README.md b/README.md index 75af72d..93dd070 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@

# WooCommerce App: Label StoreMax -### Label StoreMax - v2.0.5 +### Label StoreMax - v2.0.6 [Official WooSignal WooCommerce App](https://woosignal.com)