v5.6.1 - updates

This commit is contained in:
Anthony 2022-01-05 22:43:01 +00:00
parent a8fc75f31a
commit c98fd0246d
6 changed files with 83 additions and 63 deletions

View File

@ -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 ## [5.6.0] - 2022-01-03
* Fix bug with banner in Mello theme * Fix bug with banner in Mello theme

View File

@ -4,7 +4,7 @@
# WooCommerce App: Label StoreMax # WooCommerce App: Label StoreMax
### Label StoreMax - v5.6.0 ### Label StoreMax - v5.6.1
[Official WooSignal WooCommerce App](https://woosignal.com) [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 - Change app name, logo, customize default language, currency + more
- Light and dark mode - Light and dark mode
- Stripe, Cash On Delivery, PayPal - 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 - Orders show as normal in WooCommerce
## Security Vulnerabilities ## Security Vulnerabilities

View File

@ -39,7 +39,6 @@ Future<void> boot() async {
/// if (settings.authorizationStatus == AuthorizationStatus.authorized) { /// if (settings.authorizationStatus == AuthorizationStatus.authorized) {
/// String token = await messaging.getToken(); /// String token = await messaging.getToken();
/// WooSignal.instance.setFcmToken(token); /// WooSignal.instance.setFcmToken(token);
/// AppHelper.instance.fcmToken = token;
/// } /// }
AppHelper?.instance?.appConfig = WooSignalApp(); AppHelper?.instance?.appConfig = WooSignalApp();

View File

@ -12,6 +12,7 @@
// //
import 'package:flutter/material.dart'; 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/app_helper.dart';
import 'package:flutter_app/bootstrap/shared_pref/sp_auth.dart'; import 'package:flutter_app/bootstrap/shared_pref/sp_auth.dart';
import 'package:flutter_app/resources/pages/account_detail.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/cart.dart';
import 'package:flutter_app/resources/pages/wishlist_page_widget.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/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:flutter_app/resources/widgets/notic_home_widget.dart';
import 'package:woosignal/models/response/woosignal_app.dart'; import 'package:woosignal/models/response/woosignal_app.dart';
@ -37,19 +39,29 @@ class _NoticThemeWidgetState extends State<NoticThemeWidget> {
Widget activeWidget; Widget activeWidget;
int _currentIndex = 0; int _currentIndex = 0;
List<BottomNavItem> allNavWidgets;
@override @override
void initState() { void initState() {
super.initState(); super.initState();
_changeMainWidget();
activeWidget = NoticHomeWidget(wooSignalApp: widget.wooSignalApp);
_loadTabs();
}
_loadTabs() async {
allNavWidgets = await bottomNavWidgets();
setState(() {});
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
body: activeWidget, body: activeWidget,
bottomNavigationBar: BottomNavigationBar( bottomNavigationBar: allNavWidgets == null
onTap: _onTabTapped, ? AppLoaderWidget() : BottomNavigationBar(
onTap: (currentIndex) =>
_changeMainWidget(currentIndex, allNavWidgets),
currentIndex: _currentIndex, currentIndex: _currentIndex,
unselectedItemColor: Colors.black54, unselectedItemColor: Colors.black54,
fixedColor: Colors.black87, fixedColor: Colors.black87,
@ -59,66 +71,71 @@ class _NoticThemeWidgetState extends State<NoticThemeWidget> {
), ),
showSelectedLabels: false, showSelectedLabels: false,
showUnselectedLabels: false, showUnselectedLabels: false,
items: [ items:
BottomNavigationBarItem( allNavWidgets.map((e) => e.bottomNavigationBarItem).toList(),
),
);
}
Future<List<BottomNavItem>> bottomNavWidgets() async {
List<BottomNavItem> items = [];
items.add(
BottomNavItem(
id: 1,
bottomNavigationBarItem: BottomNavigationBarItem(
icon: Icon(Icons.home), icon: Icon(Icons.home),
label: 'Home', label: 'Home',
), ),
BottomNavigationBarItem( tabWidget: NoticHomeWidget(wooSignalApp: widget.wooSignalApp)),
);
items.add(
BottomNavItem(
id: 2,
bottomNavigationBarItem: BottomNavigationBarItem(
icon: Icon(Icons.search), icon: Icon(Icons.search),
label: 'Search', label: 'Search',
), ),
BottomNavigationBarItem( tabWidget: HomeSearchPage()),
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')
],
),
); );
if (AppHelper.instance.appConfig.wishlistEnabled == true) {
items.add(BottomNavItem(
id: 3,
bottomNavigationBarItem: BottomNavigationBarItem(
icon: Icon(Icons.favorite_border),
label: 'Wishlist',
),
tabWidget: WishListPageWidget(),
));
} }
_onTabTapped(int i) async { items.add(BottomNavItem(
_currentIndex = i; id: 4,
await _changeMainWidget(); bottomNavigationBarItem: BottomNavigationBarItem(
setState(() {}); icon: Icon(Icons.shopping_cart), label: 'Cart'),
} tabWidget: CartPage(),
));
_changeMainWidget() async { if (AppHelper.instance.appConfig.wpLoginEnabled == 1) {
if (_currentIndex == 2) { items.add(BottomNavItem(
activeWidget = WishListPageWidget(); id: 5,
return; bottomNavigationBarItem:
} BottomNavigationBarItem(icon: Icon(Icons.person), label: 'Account'),
switch (_currentIndex) { tabWidget: (await authCheck())
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) ? AccountDetailPage(showLeadingBackButton: false)
: AccountLandingPage( : AccountLandingPage(
showBackButton: false, showBackButton: false,
); ),
break; ));
} }
return items;
} }
_changeMainWidget(
int currentIndex, List<BottomNavItem> bottomNavWidgets) async {
_currentIndex = currentIndex;
activeWidget = bottomNavWidgets[_currentIndex].tabWidget;
setState(() {});
} }
} }

View File

@ -1,7 +1,7 @@
# Official WooSignal App Template for WooCommerce # Official WooSignal App Template for WooCommerce
# Label StoreMax # Label StoreMax
# Version: 5.6.0 # Version: 5.6.1
# Author: Anthony Gordon # Author: Anthony Gordon
# Homepage: https://woosignal.com # Homepage: https://woosignal.com
# Documentation: https://woosignal.com/docs/app/label-storemax # Documentation: https://woosignal.com/docs/app/label-storemax

View File

@ -4,7 +4,7 @@
# WooCommerce App: Label StoreMax # WooCommerce App: Label StoreMax
### Label StoreMax - v5.6.0 ### Label StoreMax - v5.6.1
[Official WooSignal WooCommerce App](https://woosignal.com) [Official WooSignal WooCommerce App](https://woosignal.com)