Skip to content

Commit a81c115

Browse files
author
WooSignal
committed
v2.0.6 last tweaks
1 parent 0681097 commit a81c115

File tree

5 files changed

+75
-49
lines changed

5 files changed

+75
-49
lines changed

LabelStoreMax/lib/helpers/tools.dart

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,10 +151,12 @@ String formatStringCurrency({@required String total}) {
151151
return fmf.output.symbolOnLeft;
152152
}
153153

154-
String workoutSaleDiscount({@required String salePrice, @required String priceBefore}) {
154+
String workoutSaleDiscount(
155+
{@required String salePrice, @required String priceBefore}) {
155156
double dSalePrice = parseWcPrice(salePrice);
156157
double dPriceBefore = parseWcPrice(priceBefore);
157-
return ((dPriceBefore-dSalePrice) * (100 / dPriceBefore)).toStringAsFixed(0);
158+
return ((dPriceBefore - dSalePrice) * (100 / dPriceBefore))
159+
.toStringAsFixed(0);
158160
}
159161

160162
openBrowserTab({@required String url}) async {
@@ -505,7 +507,7 @@ Widget refreshableScroll(context,
505507
child: (products.length != null && products.length > 0
506508
? GridView.count(
507509
crossAxisCount: 2,
508-
childAspectRatio: calAspectRatio(context),
510+
childAspectRatio: calAspectRatio(context),
509511
shrinkWrap: true,
510512
children: List.generate(
511513
products.length,

LabelStoreMax/lib/pages/home.dart

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,10 @@ class _HomePageState extends State<HomePage> {
145145
crossAxisAlignment: CrossAxisAlignment.start,
146146
mainAxisAlignment: MainAxisAlignment.start,
147147
children: <Widget>[
148-
Text(trans(context, "Shop") + " / ",
149-
style: Theme.of(context).primaryTextTheme.subtitle1,),
148+
Text(
149+
trans(context, "Shop") + " / ",
150+
style: Theme.of(context).primaryTextTheme.subtitle1,
151+
),
150152
Text(
151153
trans(context, "Newest"),
152154
style: Theme.of(context).primaryTextTheme.bodyText2,
@@ -167,12 +169,14 @@ class _HomePageState extends State<HomePage> {
167169
(_isLoading
168170
? Expanded(child: showAppLoader())
169171
: Expanded(
170-
child: refreshableScroll(context,
171-
refreshController: _refreshController,
172-
onRefresh: _onRefresh,
173-
onLoading: _onLoading,
174-
products: _products,
175-
onTap: _showProduct,),
172+
child: refreshableScroll(
173+
context,
174+
refreshController: _refreshController,
175+
onRefresh: _onRefresh,
176+
onLoading: _onLoading,
177+
products: _products,
178+
onTap: _showProduct,
179+
),
176180
flex: 1,
177181
)),
178182
],

LabelStoreMax/lib/pages/product_detail.dart

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -302,13 +302,12 @@ class _ProductDetailState extends State<ProductDetailPage> {
302302
itemBuilder: (BuildContext context, int index) {
303303
return CachedNetworkImage(
304304
imageUrl: _product.images[index].src,
305-
placeholder: (context, url) =>
306-
Center(
307-
child: new CircularProgressIndicator(
308-
strokeWidth: 2,
309-
backgroundColor: Colors.black12,
305+
placeholder: (context, url) => Center(
306+
child: new CircularProgressIndicator(
307+
strokeWidth: 2,
308+
backgroundColor: Colors.black12,
309+
),
310310
),
311-
),
312311
errorWidget: (context, url, error) =>
313312
new Icon(Icons.error),
314313
fit: BoxFit.contain,
@@ -361,7 +360,8 @@ class _ProductDetailState extends State<ProductDetailPage> {
361360
),
362361
textAlign: TextAlign.right,
363362
),
364-
(_product.onSale == true && _product.type != "variable"
363+
(_product.onSale == true &&
364+
_product.type != "variable"
365365
? Text(
366366
formatStringCurrency(
367367
total: _product.regularPrice),

LabelStoreMax/lib/widgets/woosignal_ui.dart

Lines changed: 50 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ List<BoxShadow> wsBoxShadow({double blurRadius}) {
206206
Widget wsCardProductItem(BuildContext context,
207207
{int index, Product product, onTap}) {
208208
return LayoutBuilder(
209-
builder: (cxt,constraints) => InkWell(
209+
builder: (cxt, constraints) => InkWell(
210210
child: Container(
211211
margin: EdgeInsets.all(4),
212212
child: Column(
@@ -216,11 +216,16 @@ Widget wsCardProductItem(BuildContext context,
216216
borderRadius: BorderRadius.circular(3.0),
217217
child: CachedNetworkImage(
218218
imageUrl:
219-
(product.images.length > 0 ? product.images.first.src : ""),
220-
placeholder: (context, url) => Center(child: CircularProgressIndicator()),
219+
(product.images.length > 0 ? product.images.first.src : ""),
220+
placeholder: (context, url) => Container(
221+
child: Center(
222+
child: CircularProgressIndicator(),
223+
),
224+
height: constraints.maxHeight / 1.75,
225+
),
221226
errorWidget: (context, url, error) => new Icon(Icons.error),
222-
fit: BoxFit.cover,
223-
height: constraints.maxHeight / 1.8,
227+
fit: BoxFit.fitWidth,
228+
height: constraints.maxHeight / 1.75,
224229
width: double.infinity,
225230
),
226231
),
@@ -239,10 +244,10 @@ Widget wsCardProductItem(BuildContext context,
239244
padding: const EdgeInsets.only(top: 1),
240245
child: Text(
241246
formatStringCurrency(total: product.price),
242-
style: Theme.of(context).textTheme.bodyText1.copyWith(
243-
fontWeight: FontWeight.w600,
244-
fontSize: 16
245-
),
247+
style: Theme.of(context)
248+
.textTheme
249+
.bodyText1
250+
.copyWith(fontWeight: FontWeight.w600, fontSize: 16),
246251
textAlign: TextAlign.left,
247252
),
248253
),
@@ -251,27 +256,42 @@ Widget wsCardProductItem(BuildContext context,
251256
child: Container(
252257
child: (product.onSale && product.type != "variable"
253258
? RichText(
254-
textAlign: TextAlign.left,
255-
text: TextSpan(
256-
text: '',
257-
style: Theme.of(context).textTheme.bodyText1,
258-
children: <TextSpan>[
259-
TextSpan(text: '${trans(context, "Was")}: ', style: Theme.of(context).textTheme.bodyText1.copyWith(
260-
color: Colors.black54,
261-
fontSize: 11
262-
),),
263-
TextSpan(text: formatStringCurrency(total: product.regularPrice), style: Theme.of(context).textTheme.bodyText1.copyWith(
264-
decoration: TextDecoration.lineThrough,
265-
color: Colors.grey,
266-
fontSize: 11
267-
),),
268-
TextSpan(text: " | ${workoutSaleDiscount(salePrice: product.salePrice, priceBefore: product.regularPrice)}% ${trans(context, "off")}", style: Theme.of(context).textTheme.bodyText1.copyWith(
269-
color: Colors.black87,
270-
fontSize: 11
271-
),),
272-
],
273-
),
274-
)
259+
textAlign: TextAlign.left,
260+
text: TextSpan(
261+
text: '',
262+
style: Theme.of(context).textTheme.bodyText1,
263+
children: <TextSpan>[
264+
TextSpan(
265+
text: '${trans(context, "Was")}: ',
266+
style: Theme.of(context)
267+
.textTheme
268+
.bodyText1
269+
.copyWith(
270+
color: Colors.black54, fontSize: 11),
271+
),
272+
TextSpan(
273+
text: formatStringCurrency(
274+
total: product.regularPrice),
275+
style: Theme.of(context)
276+
.textTheme
277+
.bodyText1
278+
.copyWith(
279+
decoration: TextDecoration.lineThrough,
280+
color: Colors.grey,
281+
fontSize: 11),
282+
),
283+
TextSpan(
284+
text:
285+
" | ${workoutSaleDiscount(salePrice: product.salePrice, priceBefore: product.regularPrice)}% ${trans(context, "off")}",
286+
style: Theme.of(context)
287+
.textTheme
288+
.bodyText1
289+
.copyWith(
290+
color: Colors.black87, fontSize: 11),
291+
),
292+
],
293+
),
294+
)
275295
: null),
276296
width: double.infinity,
277297
),

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
</p>
44

55
# WooCommerce App: Label StoreMax
6-
### Label StoreMax - v2.0.5
6+
### Label StoreMax - v2.0.6
77

88
[Official WooSignal WooCommerce App](https://woosignal.com)
99

0 commit comments

Comments
 (0)