From b2df6c522487c6cac5bbbc90c56fe64b7f0d2a61 Mon Sep 17 00:00:00 2001 From: Anthony Date: Wed, 18 Nov 2020 20:04:21 +0000 Subject: [PATCH] v2.3.0 updates, dependancy version bump and bug fixes --- LabelStoreMax/CHANGELOG.md | 6 +++ LabelStoreMax/flutter_application_id.yaml | 12 ----- LabelStoreMax/lib/labelconfig.dart | 6 ++- LabelStoreMax/lib/models/cart.dart | 6 ++- LabelStoreMax/lib/pages/account_detail.dart | 8 +++- LabelStoreMax/lib/pages/cart.dart | 50 ++++++++++++--------- LabelStoreMax/pubspec.lock | 2 +- LabelStoreMax/pubspec.yaml | 8 +--- README.md | 2 +- 9 files changed, 54 insertions(+), 46 deletions(-) delete mode 100644 LabelStoreMax/flutter_application_id.yaml diff --git a/LabelStoreMax/CHANGELOG.md b/LabelStoreMax/CHANGELOG.md index 7d101af..5ca70f7 100644 --- a/LabelStoreMax/CHANGELOG.md +++ b/LabelStoreMax/CHANGELOG.md @@ -1,3 +1,9 @@ +## [2.3.0] - 2020-11-18 + +* Option to set if prices include tax +* Pubspec.yaml dependency updates +* Bug fixes + ## [2.2.2] - 2020-10-30 * Bug fix for Android build diff --git a/LabelStoreMax/flutter_application_id.yaml b/LabelStoreMax/flutter_application_id.yaml deleted file mode 100644 index 51e9442..0000000 --- a/LabelStoreMax/flutter_application_id.yaml +++ /dev/null @@ -1,12 +0,0 @@ -# APP CONFIGURATION -# Updates the package name and display name for your app - -# Run in the terminal: "flutter pub run flutter_application_id:main" - -flutter_application_id: - android: - id: "com.woosignal.label-android" - name: "Label StoreMax" - ios: - id: "com.woosignal.label-ios" - name: "Label StoreMax" \ No newline at end of file diff --git a/LabelStoreMax/lib/labelconfig.dart b/LabelStoreMax/lib/labelconfig.dart index 88deb30..5e47ac2 100644 --- a/LabelStoreMax/lib/labelconfig.dart +++ b/LabelStoreMax/lib/labelconfig.dart @@ -16,7 +16,7 @@ import 'dart:ui'; Developer Notes SUPPORT EMAIL - support@woosignal.com - VERSION - 2.2.2 + VERSION - 2.3.0 https://woosignal.com */ @@ -38,7 +38,11 @@ const app_privacy_url = "https://yourdomain.com/privacy"; const app_currency_symbol = "\£"; const app_currency_iso = "gbp"; + +const app_products_prices_include_tax = true; + const Locale app_locale = Locale('en'); + const List app_locales_supported = [ Locale('en'), Locale('es'), diff --git a/LabelStoreMax/lib/models/cart.dart b/LabelStoreMax/lib/models/cart.dart index 6998f09..77bf409 100644 --- a/LabelStoreMax/lib/models/cart.dart +++ b/LabelStoreMax/lib/models/cart.dart @@ -11,6 +11,7 @@ import 'dart:convert'; import 'package:label_storemax/helpers/shared_pref.dart'; +import 'package:label_storemax/labelconfig.dart'; import 'package:label_storemax/models/cart_line_item.dart'; import 'package:label_storemax/models/checkout_session.dart'; import 'package:label_storemax/models/shipping_type.dart'; @@ -148,9 +149,10 @@ class Cart { cartItems.where((c) => c.taxStatus == 'taxable').toList(); double cartSubtotal = 0; - if (taxableCartLines.length > 0) { + if (app_products_prices_include_tax == false && + taxableCartLines.length > 0) { cartSubtotal = taxableCartLines - .map((m) => parseWcPrice(m.subtotal)) + .map((m) => parseWcPrice(m.subtotal) * m.quantity) .reduce((a, b) => a + b); } diff --git a/LabelStoreMax/lib/pages/account_detail.dart b/LabelStoreMax/lib/pages/account_detail.dart index df1e618..19ddfb4 100644 --- a/LabelStoreMax/lib/pages/account_detail.dart +++ b/LabelStoreMax/lib/pages/account_detail.dart @@ -62,8 +62,12 @@ class _AccountDetailPageState extends State ]; _tabController = TabController(vsync: this, length: _tabs.length); _activeBody = showAppLoader(); - _fetchWpUserData(); - _fetchOrders(); + this.init(); + } + + init() async { + await _fetchWpUserData(); + await _fetchOrders(); } _fetchWpUserData() async { diff --git a/LabelStoreMax/lib/pages/cart.dart b/LabelStoreMax/lib/pages/cart.dart index 9925026..01fd0ce 100644 --- a/LabelStoreMax/lib/pages/cart.dart +++ b/LabelStoreMax/lib/pages/cart.dart @@ -80,21 +80,24 @@ class _CartPageState extends State { return; } if (cartLineItems.length <= 0) { - showEdgeAlertWith(context, - title: trans(context, "Cart"), - desc: trans(context, - trans(context, "You need items in your cart to checkout")), - style: EdgeAlertStyle.WARNING, - icon: Icons.shopping_cart); + showEdgeAlertWith( + context, + title: trans(context, "Cart"), + desc: trans(context, "You need items in your cart to checkout"), + style: EdgeAlertStyle.WARNING, + icon: Icons.shopping_cart, + ); return; } if (!cartLineItems.every( (c) => c.stockStatus == 'instock' || c.stockStatus == 'onbackorder')) { - showEdgeAlertWith(context, - title: trans(context, "Cart"), - desc: trans(context, trans(context, "There is an item out of stock")), - style: EdgeAlertStyle.WARNING, - icon: Icons.shopping_cart); + showEdgeAlertWith( + context, + title: trans(context, "Cart"), + desc: trans(context, "There is an item out of stock"), + style: EdgeAlertStyle.WARNING, + icon: Icons.shopping_cart, + ); return; } CheckoutSession.getInstance.initSession(); @@ -120,7 +123,7 @@ class _CartPageState extends State { showEdgeAlertWith( context, title: trans(context, "Cart"), - desc: trans(context, trans(context, "Maximum stock reached")), + desc: trans(context, "Maximum stock reached"), style: EdgeAlertStyle.WARNING, icon: Icons.shopping_cart, ); @@ -187,8 +190,10 @@ class _CartPageState extends State { splashColor: Colors.transparent, child: Align( child: Padding( - child: Text(trans(context, "Clear Cart"), - style: Theme.of(context).primaryTextTheme.bodyText1), + child: Text( + trans(context, "Clear Cart"), + style: Theme.of(context).primaryTextTheme.bodyText1, + ), padding: EdgeInsets.only(right: 8), ), alignment: Alignment.centerLeft, @@ -217,10 +222,11 @@ class _CartPageState extends State { color: Colors.black45, ), Padding( - child: Text(trans(context, "Empty Basket"), - style: Theme.of(context) - .primaryTextTheme - .bodyText2), + child: Text( + trans(context, "Empty Basket"), + style: + Theme.of(context).primaryTextTheme.bodyText2, + ), padding: EdgeInsets.only(top: 10), ) ], @@ -266,9 +272,11 @@ class _CartPageState extends State { return Text(""); else return new Padding( - child: wsRow2Text(context, - text1: trans(context, "Total"), - text2: (_isLoading ? "" : snapshot.data)), + child: wsRow2Text( + context, + text1: trans(context, "Total"), + text2: (_isLoading ? "" : snapshot.data), + ), padding: EdgeInsets.only(bottom: 15, top: 15), ); } diff --git a/LabelStoreMax/pubspec.lock b/LabelStoreMax/pubspec.lock index 6348bae..c9d7874 100644 --- a/LabelStoreMax/pubspec.lock +++ b/LabelStoreMax/pubspec.lock @@ -676,7 +676,7 @@ packages: name: wp_json_api url: "https://pub.dartlang.org" source: hosted - version: "0.1.4" + version: "2.0.0" xdg_directories: dependency: transitive description: diff --git a/LabelStoreMax/pubspec.yaml b/LabelStoreMax/pubspec.yaml index 26a1312..2307c9e 100644 --- a/LabelStoreMax/pubspec.yaml +++ b/LabelStoreMax/pubspec.yaml @@ -1,15 +1,11 @@ # Official WooSignal App Template for WooCommerce # Label StoreMax -# Version 2.2.2 +# Version 2.3.0 # Homepage: https://woosignal.com # Author: Anthony Gordon # Documentation: https://woosignal.com/docs/app/ios/label-storemax -### App Configuration -# 1 Open: "lib/labelconfig.dart" and edit the variables -# 2 Open: "flutter_application_id.yaml" and update package name and display name - ### Change App Icon # 1 Replace: assets/icon/appicon.png (1024px1024px icon size) # 2 Run this command from terminal: "flutter pub run flutter_launcher_icons:main" @@ -30,7 +26,7 @@ dependencies: woosignal: ^1.2.1 woosignal_stripe: ^0.0.6 razorpay_flutter: ^1.2.2 - wp_json_api: ^0.1.4 + wp_json_api: ^2.0.0 shared_preferences: ^0.5.12 cached_network_image: ^2.3.3 page_transition: ^1.1.7+2 diff --git a/README.md b/README.md index 141f13d..3205632 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ # WooCommerce App: Label StoreMax -### Label StoreMax - v2.2.2 +### Label StoreMax - v2.3.0 [Official WooSignal WooCommerce App](https://woosignal.com)