diff --git a/LabelStoreMax/CHANGELOG.md b/LabelStoreMax/CHANGELOG.md index 3ae465b..38941d1 100644 --- a/LabelStoreMax/CHANGELOG.md +++ b/LabelStoreMax/CHANGELOG.md @@ -1,3 +1,7 @@ +## [5.6.1] - 2022-01-05 + +* Fix bug with bottom navigation bar in Notic theme + ## [5.6.0] - 2022-01-03 * Fix bug with banner in Mello theme diff --git a/LabelStoreMax/README.md b/LabelStoreMax/README.md index ae33cb0..67b3f3b 100644 --- a/LabelStoreMax/README.md +++ b/LabelStoreMax/README.md @@ -4,7 +4,7 @@ # WooCommerce App: Label StoreMax -### Label StoreMax - v5.6.0 +### Label StoreMax - v5.6.1 [Official WooSignal WooCommerce App](https://woosignal.com) @@ -45,7 +45,7 @@ Full documentation this available [here](https://woosignal.com/docs/app/label-st - Change app name, logo, customize default language, currency + more - Light and dark mode - Stripe, Cash On Delivery, PayPal -- Localized for en, es, pt, it, hi, fr, zh +- Localized for en, es, pt, it, hi, fr, zh, tr, nl - Orders show as normal in WooCommerce ## Security Vulnerabilities diff --git a/LabelStoreMax/lib/bootstrap/boot.dart b/LabelStoreMax/lib/bootstrap/boot.dart index 838075b..e1fb047 100644 --- a/LabelStoreMax/lib/bootstrap/boot.dart +++ b/LabelStoreMax/lib/bootstrap/boot.dart @@ -39,7 +39,6 @@ Future boot() async { /// if (settings.authorizationStatus == AuthorizationStatus.authorized) { /// String token = await messaging.getToken(); /// WooSignal.instance.setFcmToken(token); - /// AppHelper.instance.fcmToken = token; /// } AppHelper?.instance?.appConfig = WooSignalApp(); diff --git a/LabelStoreMax/lib/resources/widgets/notic_theme_widget.dart b/LabelStoreMax/lib/resources/widgets/notic_theme_widget.dart index a04798b..951cef5 100644 --- a/LabelStoreMax/lib/resources/widgets/notic_theme_widget.dart +++ b/LabelStoreMax/lib/resources/widgets/notic_theme_widget.dart @@ -12,6 +12,7 @@ // import 'package:flutter/material.dart'; +import 'package:flutter_app/app/models/bottom_nav_item.dart'; import 'package:flutter_app/bootstrap/app_helper.dart'; import 'package:flutter_app/bootstrap/shared_pref/sp_auth.dart'; import 'package:flutter_app/resources/pages/account_detail.dart'; @@ -19,6 +20,7 @@ import 'package:flutter_app/resources/pages/account_landing.dart'; import 'package:flutter_app/resources/pages/cart.dart'; import 'package:flutter_app/resources/pages/wishlist_page_widget.dart'; import 'package:flutter_app/resources/pages/home_search.dart'; +import 'package:flutter_app/resources/widgets/app_loader_widget.dart'; import 'package:flutter_app/resources/widgets/notic_home_widget.dart'; import 'package:woosignal/models/response/woosignal_app.dart'; @@ -37,19 +39,29 @@ class _NoticThemeWidgetState extends State { Widget activeWidget; int _currentIndex = 0; + List allNavWidgets; @override void initState() { super.initState(); - _changeMainWidget(); + + activeWidget = NoticHomeWidget(wooSignalApp: widget.wooSignalApp); + _loadTabs(); + } + + _loadTabs() async { + allNavWidgets = await bottomNavWidgets(); + setState(() {}); } @override Widget build(BuildContext context) { return Scaffold( body: activeWidget, - bottomNavigationBar: BottomNavigationBar( - onTap: _onTabTapped, + bottomNavigationBar: allNavWidgets == null + ? AppLoaderWidget() : BottomNavigationBar( + onTap: (currentIndex) => + _changeMainWidget(currentIndex, allNavWidgets), currentIndex: _currentIndex, unselectedItemColor: Colors.black54, fixedColor: Colors.black87, @@ -59,66 +71,71 @@ class _NoticThemeWidgetState extends State { ), showSelectedLabels: false, showUnselectedLabels: false, - items: [ - BottomNavigationBarItem( - icon: Icon(Icons.home), - label: 'Home', - ), - BottomNavigationBarItem( - icon: Icon(Icons.search), - label: 'Search', - ), - BottomNavigationBarItem( - icon: Icon(Icons.favorite_border), - label: 'Favourites', - ), - BottomNavigationBarItem( - icon: Icon(Icons.shopping_cart), - label: 'Cart', - ), - if (AppHelper.instance.appConfig.wpLoginEnabled == 1) - BottomNavigationBarItem(icon: Icon(Icons.person), label: 'Account') - ], + items: + allNavWidgets.map((e) => e.bottomNavigationBarItem).toList(), ), ); } - _onTabTapped(int i) async { - _currentIndex = i; - await _changeMainWidget(); - setState(() {}); + Future> bottomNavWidgets() async { + List items = []; + items.add( + BottomNavItem( + id: 1, + bottomNavigationBarItem: BottomNavigationBarItem( + icon: Icon(Icons.home), + label: 'Home', + ), + tabWidget: NoticHomeWidget(wooSignalApp: widget.wooSignalApp)), + ); + + items.add( + BottomNavItem( + id: 2, + bottomNavigationBarItem: BottomNavigationBarItem( + icon: Icon(Icons.search), + label: 'Search', + ), + tabWidget: HomeSearchPage()), + ); + + if (AppHelper.instance.appConfig.wishlistEnabled == true) { + items.add(BottomNavItem( + id: 3, + bottomNavigationBarItem: BottomNavigationBarItem( + icon: Icon(Icons.favorite_border), + label: 'Wishlist', + ), + tabWidget: WishListPageWidget(), + )); + } + + items.add(BottomNavItem( + id: 4, + bottomNavigationBarItem: BottomNavigationBarItem( + icon: Icon(Icons.shopping_cart), label: 'Cart'), + tabWidget: CartPage(), + )); + + if (AppHelper.instance.appConfig.wpLoginEnabled == 1) { + items.add(BottomNavItem( + id: 5, + bottomNavigationBarItem: + BottomNavigationBarItem(icon: Icon(Icons.person), label: 'Account'), + tabWidget: (await authCheck()) + ? AccountDetailPage(showLeadingBackButton: false) + : AccountLandingPage( + showBackButton: false, + ), + )); + } + return items; } - _changeMainWidget() async { - if (_currentIndex == 2) { - activeWidget = WishListPageWidget(); - return; - } - switch (_currentIndex) { - case 0: - { - activeWidget = NoticHomeWidget(wooSignalApp: widget.wooSignalApp); - break; - } - case 1: - { - activeWidget = HomeSearchPage(); - break; - } - case 2: - { - activeWidget = CartPage(); - break; - } - case 3: - { - activeWidget = (await authCheck()) - ? AccountDetailPage(showLeadingBackButton: false) - : AccountLandingPage( - showBackButton: false, - ); - break; - } - } + _changeMainWidget( + int currentIndex, List bottomNavWidgets) async { + _currentIndex = currentIndex; + activeWidget = bottomNavWidgets[_currentIndex].tabWidget; + setState(() {}); } } diff --git a/LabelStoreMax/pubspec.yaml b/LabelStoreMax/pubspec.yaml index 1745117..7de8577 100644 --- a/LabelStoreMax/pubspec.yaml +++ b/LabelStoreMax/pubspec.yaml @@ -1,7 +1,7 @@ # Official WooSignal App Template for WooCommerce # Label StoreMax -# Version: 5.6.0 +# Version: 5.6.1 # Author: Anthony Gordon # Homepage: https://woosignal.com # Documentation: https://woosignal.com/docs/app/label-storemax diff --git a/README.md b/README.md index 7404f01..ecf1fe4 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ # WooCommerce App: Label StoreMax -### Label StoreMax - v5.6.0 +### Label StoreMax - v5.6.1 [Official WooSignal WooCommerce App](https://woosignal.com)