New product view, Improved product sale appearance, Bug fixes
This commit is contained in:
parent
fc2041d450
commit
0681097f9b
@ -1,3 +1,9 @@
|
|||||||
|
## [2.0.6] - 2020-05-17
|
||||||
|
|
||||||
|
* New product view
|
||||||
|
* Improved product sale appearance
|
||||||
|
* Bug fixes
|
||||||
|
|
||||||
## [2.0.5] - 2020-05-16
|
## [2.0.5] - 2020-05-16
|
||||||
|
|
||||||
* RazorPay checkout added
|
* RazorPay checkout added
|
||||||
|
|||||||
@ -150,5 +150,7 @@
|
|||||||
"Ship to a different address?": "Ship to a different address?",
|
"Ship to a different address?": "Ship to a different address?",
|
||||||
"USE DETAILS": "USE DETAILS",
|
"USE DETAILS": "USE DETAILS",
|
||||||
"Not supported, try a card payment": "Not supported, try a card payment",
|
"Not supported, try a card payment": "Not supported, try a card payment",
|
||||||
"Invalid shipping address, please check your shipping details": "Invalid shipping address, please check your shipping details"
|
"Invalid shipping address, please check your shipping details": "Invalid shipping address, please check your shipping details",
|
||||||
|
"Was": "Was",
|
||||||
|
"off": "off"
|
||||||
}
|
}
|
||||||
@ -151,6 +151,12 @@ String formatStringCurrency({@required String total}) {
|
|||||||
return fmf.output.symbolOnLeft;
|
return fmf.output.symbolOnLeft;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
String workoutSaleDiscount({@required String salePrice, @required String priceBefore}) {
|
||||||
|
double dSalePrice = parseWcPrice(salePrice);
|
||||||
|
double dPriceBefore = parseWcPrice(priceBefore);
|
||||||
|
return ((dPriceBefore-dSalePrice) * (100 / dPriceBefore)).toStringAsFixed(0);
|
||||||
|
}
|
||||||
|
|
||||||
openBrowserTab({@required String url}) async {
|
openBrowserTab({@required String url}) async {
|
||||||
await FlutterWebBrowser.openWebPage(
|
await FlutterWebBrowser.openWebPage(
|
||||||
url: url, androidToolbarColor: Colors.white70);
|
url: url, androidToolbarColor: Colors.white70);
|
||||||
@ -499,17 +505,30 @@ Widget refreshableScroll(context,
|
|||||||
child: (products.length != null && products.length > 0
|
child: (products.length != null && products.length > 0
|
||||||
? GridView.count(
|
? GridView.count(
|
||||||
crossAxisCount: 2,
|
crossAxisCount: 2,
|
||||||
|
childAspectRatio: calAspectRatio(context),
|
||||||
|
shrinkWrap: true,
|
||||||
children: List.generate(
|
children: List.generate(
|
||||||
products.length,
|
products.length,
|
||||||
(index) {
|
(index) => wsCardProductItem(context,
|
||||||
return wsCardProductItem(context,
|
index: index, product: products[index], onTap: onTap),
|
||||||
index: index, product: products[index], onTap: onTap);
|
|
||||||
},
|
|
||||||
))
|
))
|
||||||
: wsNoResults(context)),
|
: wsNoResults(context)),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
double calAspectRatio(BuildContext context) {
|
||||||
|
if (MediaQuery.of(context).size.height > 800) {
|
||||||
|
return MediaQuery.of(context).size.width /
|
||||||
|
(MediaQuery.of(context).size.height / 1.85);
|
||||||
|
}
|
||||||
|
if (MediaQuery.of(context).size.height > 700) {
|
||||||
|
return MediaQuery.of(context).size.width /
|
||||||
|
(MediaQuery.of(context).size.height / 1.5);
|
||||||
|
}
|
||||||
|
return MediaQuery.of(context).size.width /
|
||||||
|
(MediaQuery.of(context).size.height / 1.3);
|
||||||
|
}
|
||||||
|
|
||||||
class UserAuth {
|
class UserAuth {
|
||||||
UserAuth._privateConstructor();
|
UserAuth._privateConstructor();
|
||||||
static final UserAuth instance = UserAuth._privateConstructor();
|
static final UserAuth instance = UserAuth._privateConstructor();
|
||||||
|
|||||||
@ -16,7 +16,7 @@ import 'dart:ui';
|
|||||||
Developer Notes
|
Developer Notes
|
||||||
|
|
||||||
SUPPORT EMAIL - support@woosignal.com
|
SUPPORT EMAIL - support@woosignal.com
|
||||||
VERSION - 2.0.5
|
VERSION - 2.0.6
|
||||||
https://woosignal.com
|
https://woosignal.com
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
@ -58,9 +58,7 @@ class _HomePageState extends State<HomePage> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_fetchCategories() async {
|
_fetchCategories() async {
|
||||||
_categories = await appWooSignal((api) {
|
_categories = await appWooSignal((api) => api.getProductCategories());
|
||||||
return api.getProductCategories();
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_fetchMoreProducts() async {
|
_fetchMoreProducts() async {
|
||||||
@ -90,9 +88,7 @@ class _HomePageState extends State<HomePage> {
|
|||||||
title: trans(context, "Categories"),
|
title: trans(context, "Categories"),
|
||||||
bodyWidget: ListView.separated(
|
bodyWidget: ListView.separated(
|
||||||
itemCount: _categories.length,
|
itemCount: _categories.length,
|
||||||
separatorBuilder: (cxt, i) {
|
separatorBuilder: (cxt, i) => Divider(),
|
||||||
return Divider();
|
|
||||||
},
|
|
||||||
itemBuilder: (BuildContext context, int index) {
|
itemBuilder: (BuildContext context, int index) {
|
||||||
return ListTile(
|
return ListTile(
|
||||||
title: Text(parseHtmlString(_categories[index].name)),
|
title: Text(parseHtmlString(_categories[index].name)),
|
||||||
@ -133,7 +129,7 @@ class _HomePageState extends State<HomePage> {
|
|||||||
onPressed: () => Navigator.pushNamed(context, "/home-search")
|
onPressed: () => Navigator.pushNamed(context, "/home-search")
|
||||||
.then((value) => _key.currentState.setState(() {})),
|
.then((value) => _key.currentState.setState(() {})),
|
||||||
),
|
),
|
||||||
wsCartIcon(context, key: _key)
|
wsCartIcon(context, key: _key),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
body: SafeArea(
|
body: SafeArea(
|
||||||
@ -150,7 +146,7 @@ class _HomePageState extends State<HomePage> {
|
|||||||
mainAxisAlignment: MainAxisAlignment.start,
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Text(trans(context, "Shop") + " / ",
|
Text(trans(context, "Shop") + " / ",
|
||||||
style: Theme.of(context).primaryTextTheme.subtitle1),
|
style: Theme.of(context).primaryTextTheme.subtitle1,),
|
||||||
Text(
|
Text(
|
||||||
trans(context, "Newest"),
|
trans(context, "Newest"),
|
||||||
style: Theme.of(context).primaryTextTheme.bodyText2,
|
style: Theme.of(context).primaryTextTheme.bodyText2,
|
||||||
@ -176,7 +172,7 @@ class _HomePageState extends State<HomePage> {
|
|||||||
onRefresh: _onRefresh,
|
onRefresh: _onRefresh,
|
||||||
onLoading: _onLoading,
|
onLoading: _onLoading,
|
||||||
products: _products,
|
products: _products,
|
||||||
onTap: _showProduct),
|
onTap: _showProduct,),
|
||||||
flex: 1,
|
flex: 1,
|
||||||
)),
|
)),
|
||||||
],
|
],
|
||||||
|
|||||||
@ -303,10 +303,12 @@ class _ProductDetailState extends State<ProductDetailPage> {
|
|||||||
return CachedNetworkImage(
|
return CachedNetworkImage(
|
||||||
imageUrl: _product.images[index].src,
|
imageUrl: _product.images[index].src,
|
||||||
placeholder: (context, url) =>
|
placeholder: (context, url) =>
|
||||||
new CircularProgressIndicator(
|
Center(
|
||||||
|
child: new CircularProgressIndicator(
|
||||||
strokeWidth: 2,
|
strokeWidth: 2,
|
||||||
backgroundColor: Colors.black12,
|
backgroundColor: Colors.black12,
|
||||||
),
|
),
|
||||||
|
),
|
||||||
errorWidget: (context, url, error) =>
|
errorWidget: (context, url, error) =>
|
||||||
new Icon(Icons.error),
|
new Icon(Icons.error),
|
||||||
fit: BoxFit.contain,
|
fit: BoxFit.contain,
|
||||||
@ -359,7 +361,7 @@ class _ProductDetailState extends State<ProductDetailPage> {
|
|||||||
),
|
),
|
||||||
textAlign: TextAlign.right,
|
textAlign: TextAlign.right,
|
||||||
),
|
),
|
||||||
(_product.onSale == true
|
(_product.onSale == true && _product.type != "variable"
|
||||||
? Text(
|
? Text(
|
||||||
formatStringCurrency(
|
formatStringCurrency(
|
||||||
total: _product.regularPrice),
|
total: _product.regularPrice),
|
||||||
|
|||||||
@ -205,68 +205,82 @@ List<BoxShadow> wsBoxShadow({double blurRadius}) {
|
|||||||
|
|
||||||
Widget wsCardProductItem(BuildContext context,
|
Widget wsCardProductItem(BuildContext context,
|
||||||
{int index, Product product, onTap}) {
|
{int index, Product product, onTap}) {
|
||||||
return InkWell(
|
return LayoutBuilder(
|
||||||
child: Container(
|
builder: (cxt,constraints) => InkWell(
|
||||||
padding: EdgeInsets.all(10),
|
child: Container(
|
||||||
margin: EdgeInsets.all(5),
|
margin: EdgeInsets.all(4),
|
||||||
decoration: BoxDecoration(
|
child: Column(
|
||||||
color: Colors.white,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
borderRadius: BorderRadius.circular(5),
|
children: <Widget>[
|
||||||
boxShadow: wsBoxShadow(blurRadius: 4),
|
ClipRRect(
|
||||||
),
|
borderRadius: BorderRadius.circular(3.0),
|
||||||
child: Column(
|
child: CachedNetworkImage(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
imageUrl:
|
||||||
children: <Widget>[
|
(product.images.length > 0 ? product.images.first.src : ""),
|
||||||
Flexible(
|
placeholder: (context, url) => Center(child: CircularProgressIndicator()),
|
||||||
child: CachedNetworkImage(
|
errorWidget: (context, url, error) => new Icon(Icons.error),
|
||||||
imageUrl:
|
fit: BoxFit.cover,
|
||||||
(product.images.length > 0 ? product.images.first.src : ""),
|
height: constraints.maxHeight / 1.8,
|
||||||
placeholder: (context, url) => new CircularProgressIndicator(),
|
width: double.infinity,
|
||||||
errorWidget: (context, url, error) => new Icon(Icons.error),
|
),
|
||||||
fit: BoxFit.contain,
|
|
||||||
),
|
),
|
||||||
flex: 4,
|
Padding(
|
||||||
),
|
padding: const EdgeInsets.only(top: 1),
|
||||||
Flexible(
|
child: Text(
|
||||||
child: Row(
|
product.name,
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
style: Theme.of(context).textTheme.bodyText2,
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
overflow: TextOverflow.ellipsis,
|
||||||
children: <Widget>[
|
maxLines: 2,
|
||||||
Text(
|
textAlign: TextAlign.left,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Flexible(
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.only(top: 1),
|
||||||
|
child: Text(
|
||||||
formatStringCurrency(total: product.price),
|
formatStringCurrency(total: product.price),
|
||||||
style: Theme.of(context).textTheme.bodyText1,
|
style: Theme.of(context).textTheme.bodyText1.copyWith(
|
||||||
textAlign: TextAlign.center,
|
fontWeight: FontWeight.w600,
|
||||||
|
fontSize: 16
|
||||||
|
),
|
||||||
|
textAlign: TextAlign.left,
|
||||||
),
|
),
|
||||||
(product.onSale
|
),
|
||||||
? Padding(
|
),
|
||||||
padding: const EdgeInsets.only(left: 8),
|
Flexible(
|
||||||
child: Text(
|
child: Container(
|
||||||
formatStringCurrency(total: product.regularPrice),
|
child: (product.onSale && product.type != "variable"
|
||||||
style: Theme.of(context).textTheme.bodyText1.copyWith(
|
? RichText(
|
||||||
decoration: TextDecoration.lineThrough,
|
textAlign: TextAlign.left,
|
||||||
color: Colors.grey,
|
text: TextSpan(
|
||||||
),
|
text: '',
|
||||||
textAlign: TextAlign.left,
|
style: Theme.of(context).textTheme.bodyText1,
|
||||||
),
|
children: <TextSpan>[
|
||||||
)
|
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),
|
: null),
|
||||||
].where((t) => t != null).toList(),
|
width: double.infinity,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
flex: 1,
|
].where((e) => e != null).toList(),
|
||||||
),
|
),
|
||||||
Expanded(
|
|
||||||
child: Text(
|
|
||||||
product.name,
|
|
||||||
style: Theme.of(context).textTheme.bodyText2,
|
|
||||||
overflow: TextOverflow.clip,
|
|
||||||
maxLines: 1,
|
|
||||||
),
|
|
||||||
flex: 1,
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
|
onTap: () => onTap(product),
|
||||||
),
|
),
|
||||||
onTap: () => onTap(product),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
# Label StoreMax
|
# Label StoreMax
|
||||||
# Version 2.0.5
|
# Version 2.0.6
|
||||||
#authors: - "Anthony Gordon"
|
#authors: - "Anthony Gordon"
|
||||||
#documentation: https://woosignal.com/docs/app/ios/label-storemax
|
#documentation: https://woosignal.com/docs/app/ios/label-storemax
|
||||||
#homepage: https://woosignal.com/
|
#homepage: https://woosignal.com/
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user