Skip to content

Commit 7293fb8

Browse files
authored
Merge pull request #25 from woosignal/master
v5.6.1 - updates
2 parents f092daf + c98fd02 commit 7293fb8

File tree

6 files changed

+79
-59
lines changed

6 files changed

+79
-59
lines changed

LabelStoreMax/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## [5.6.1] - 2022-01-05
2+
3+
* Fix bug with bottom navigation bar in Notic theme
4+
15
## [5.6.0] - 2022-01-03
26

37
* Fix bug with banner in Mello theme

LabelStoreMax/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
# WooCommerce App: Label StoreMax
66

7-
### Label StoreMax - v5.6.0
7+
### Label StoreMax - v5.6.1
88

99

1010
[Official WooSignal WooCommerce App](https://woosignal.com)
@@ -45,7 +45,7 @@ Full documentation this available [here](https://woosignal.com/docs/app/label-st
4545
- Change app name, logo, customize default language, currency + more
4646
- Light and dark mode
4747
- Stripe, Cash On Delivery, PayPal
48-
- Localized for en, es, pt, it, hi, fr, zh
48+
- Localized for en, es, pt, it, hi, fr, zh, tr, nl
4949
- Orders show as normal in WooCommerce
5050

5151
## Security Vulnerabilities

LabelStoreMax/lib/bootstrap/boot.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ Future<void> boot() async {
3939
/// if (settings.authorizationStatus == AuthorizationStatus.authorized) {
4040
/// String token = await messaging.getToken();
4141
/// WooSignal.instance.setFcmToken(token);
42-
/// AppHelper.instance.fcmToken = token;
4342
/// }
4443
4544
AppHelper?.instance?.appConfig = WooSignalApp();

LabelStoreMax/lib/resources/widgets/notic_theme_widget.dart

Lines changed: 71 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,15 @@
1212
//
1313

1414
import 'package:flutter/material.dart';
15+
import 'package:flutter_app/app/models/bottom_nav_item.dart';
1516
import 'package:flutter_app/bootstrap/app_helper.dart';
1617
import 'package:flutter_app/bootstrap/shared_pref/sp_auth.dart';
1718
import 'package:flutter_app/resources/pages/account_detail.dart';
1819
import 'package:flutter_app/resources/pages/account_landing.dart';
1920
import 'package:flutter_app/resources/pages/cart.dart';
2021
import 'package:flutter_app/resources/pages/wishlist_page_widget.dart';
2122
import 'package:flutter_app/resources/pages/home_search.dart';
23+
import 'package:flutter_app/resources/widgets/app_loader_widget.dart';
2224
import 'package:flutter_app/resources/widgets/notic_home_widget.dart';
2325
import 'package:woosignal/models/response/woosignal_app.dart';
2426

@@ -37,19 +39,29 @@ class _NoticThemeWidgetState extends State<NoticThemeWidget> {
3739
Widget activeWidget;
3840

3941
int _currentIndex = 0;
42+
List<BottomNavItem> allNavWidgets;
4043

4144
@override
4245
void initState() {
4346
super.initState();
44-
_changeMainWidget();
47+
48+
activeWidget = NoticHomeWidget(wooSignalApp: widget.wooSignalApp);
49+
_loadTabs();
50+
}
51+
52+
_loadTabs() async {
53+
allNavWidgets = await bottomNavWidgets();
54+
setState(() {});
4555
}
4656

4757
@override
4858
Widget build(BuildContext context) {
4959
return Scaffold(
5060
body: activeWidget,
51-
bottomNavigationBar: BottomNavigationBar(
52-
onTap: _onTabTapped,
61+
bottomNavigationBar: allNavWidgets == null
62+
? AppLoaderWidget() : BottomNavigationBar(
63+
onTap: (currentIndex) =>
64+
_changeMainWidget(currentIndex, allNavWidgets),
5365
currentIndex: _currentIndex,
5466
unselectedItemColor: Colors.black54,
5567
fixedColor: Colors.black87,
@@ -59,66 +71,71 @@ class _NoticThemeWidgetState extends State<NoticThemeWidget> {
5971
),
6072
showSelectedLabels: false,
6173
showUnselectedLabels: false,
62-
items: [
63-
BottomNavigationBarItem(
74+
items:
75+
allNavWidgets.map((e) => e.bottomNavigationBarItem).toList(),
76+
),
77+
);
78+
}
79+
80+
Future<List<BottomNavItem>> bottomNavWidgets() async {
81+
List<BottomNavItem> items = [];
82+
items.add(
83+
BottomNavItem(
84+
id: 1,
85+
bottomNavigationBarItem: BottomNavigationBarItem(
6486
icon: Icon(Icons.home),
6587
label: 'Home',
6688
),
67-
BottomNavigationBarItem(
89+
tabWidget: NoticHomeWidget(wooSignalApp: widget.wooSignalApp)),
90+
);
91+
92+
items.add(
93+
BottomNavItem(
94+
id: 2,
95+
bottomNavigationBarItem: BottomNavigationBarItem(
6896
icon: Icon(Icons.search),
6997
label: 'Search',
7098
),
71-
BottomNavigationBarItem(
72-
icon: Icon(Icons.favorite_border),
73-
label: 'Favourites',
74-
),
75-
BottomNavigationBarItem(
76-
icon: Icon(Icons.shopping_cart),
77-
label: 'Cart',
78-
),
79-
if (AppHelper.instance.appConfig.wpLoginEnabled == 1)
80-
BottomNavigationBarItem(icon: Icon(Icons.person), label: 'Account')
81-
],
82-
),
99+
tabWidget: HomeSearchPage()),
83100
);
84-
}
85-
86-
_onTabTapped(int i) async {
87-
_currentIndex = i;
88-
await _changeMainWidget();
89-
setState(() {});
90-
}
91101

92-
_changeMainWidget() async {
93-
if (_currentIndex == 2) {
94-
activeWidget = WishListPageWidget();
95-
return;
102+
if (AppHelper.instance.appConfig.wishlistEnabled == true) {
103+
items.add(BottomNavItem(
104+
id: 3,
105+
bottomNavigationBarItem: BottomNavigationBarItem(
106+
icon: Icon(Icons.favorite_border),
107+
label: 'Wishlist',
108+
),
109+
tabWidget: WishListPageWidget(),
110+
));
96111
}
97-
switch (_currentIndex) {
98-
case 0:
99-
{
100-
activeWidget = NoticHomeWidget(wooSignalApp: widget.wooSignalApp);
101-
break;
102-
}
103-
case 1:
104-
{
105-
activeWidget = HomeSearchPage();
106-
break;
107-
}
108-
case 2:
109-
{
110-
activeWidget = CartPage();
111-
break;
112-
}
113-
case 3:
114-
{
115-
activeWidget = (await authCheck())
116-
? AccountDetailPage(showLeadingBackButton: false)
117-
: AccountLandingPage(
118-
showBackButton: false,
119-
);
120-
break;
121-
}
112+
113+
items.add(BottomNavItem(
114+
id: 4,
115+
bottomNavigationBarItem: BottomNavigationBarItem(
116+
icon: Icon(Icons.shopping_cart), label: 'Cart'),
117+
tabWidget: CartPage(),
118+
));
119+
120+
if (AppHelper.instance.appConfig.wpLoginEnabled == 1) {
121+
items.add(BottomNavItem(
122+
id: 5,
123+
bottomNavigationBarItem:
124+
BottomNavigationBarItem(icon: Icon(Icons.person), label: 'Account'),
125+
tabWidget: (await authCheck())
126+
? AccountDetailPage(showLeadingBackButton: false)
127+
: AccountLandingPage(
128+
showBackButton: false,
129+
),
130+
));
122131
}
132+
return items;
133+
}
134+
135+
_changeMainWidget(
136+
int currentIndex, List<BottomNavItem> bottomNavWidgets) async {
137+
_currentIndex = currentIndex;
138+
activeWidget = bottomNavWidgets[_currentIndex].tabWidget;
139+
setState(() {});
123140
}
124141
}

LabelStoreMax/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Official WooSignal App Template for WooCommerce
22

33
# Label StoreMax
4-
# Version: 5.6.0
4+
# Version: 5.6.1
55
# Author: Anthony Gordon
66
# Homepage: https://woosignal.com
77
# Documentation: https://woosignal.com/docs/app/label-storemax

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
# WooCommerce App: Label StoreMax
66

7-
### Label StoreMax - v5.6.0
7+
### Label StoreMax - v5.6.1
88

99

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

0 commit comments

Comments
 (0)