Skip to content

Commit 0665d0b

Browse files
authored
Merge pull request #22 from woosignal/master
v5.5.1 - updates
2 parents c9fdee7 + cd3ee2a commit 0665d0b

16 files changed

+90
-2694
lines changed

LabelStoreMax/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## [5.5.1] - 2021-12-18
2+
3+
* Fix bug if store connection fails
4+
* Minify default_shipping.json
5+
* Pubspec.yaml dependency updates
6+
17
## [5.5.0] - 2021-12-17
28

39
* Change font from WooSignal dashboard

LabelStoreMax/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.5.0
7+
### Label StoreMax - v5.5.1
88

99

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

LabelStoreMax/lib/bootstrap/app_helper.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import 'package:woosignal/models/response/woosignal_app.dart';
1313
class AppHelper {
1414
AppHelper._privateConstructor();
1515

16-
String themeType;
1716
static final AppHelper instance = AppHelper._privateConstructor();
1817

1918
WooSignalApp appConfig;

LabelStoreMax/lib/bootstrap/boot.dart

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,27 @@ Future<void> boot() async {
4343
/// AppHelper.instance.fcmToken = token;
4444
/// }
4545
46+
AppHelper?.instance?.appConfig = WooSignalApp();
47+
AppHelper.instance.appConfig.themeFont = "Poppins";
48+
AppHelper.instance.appConfig.themeColors = {
49+
'light': {
50+
'background': '0xFFFFFFFF',
51+
'primary_text': '0xFF000000',
52+
'button_background': '0xFF529cda',
53+
'button_text': '0xFFFFFFFF',
54+
'app_bar_background': '0xFFFFFFFF',
55+
'app_bar_text': '0xFF3a3d40',
56+
},
57+
'dark': {
58+
'background': '0xFF212121',
59+
'primary_text': '0xFFE1E1E1',
60+
'button_background': '0xFFFFFFFF',
61+
'button_text': '0xFF232c33',
62+
'app_bar_background': '0xFF2C2C2C',
63+
'app_bar_text': '0xFFFFFFFF',
64+
}
65+
};
66+
4667
// WooSignal Setup
4768
WooSignalApp wooSignalApp = await appWooSignal((api) => api.getApp());
4869
Locale locale = Locale('en');

LabelStoreMax/lib/main.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ void main() async {
99
WidgetsFlutterBinding.ensureInitialized();
1010
Nylo nylo = await Nylo.init(router: appRouter(), setup: boot);
1111

12-
String initialRoute = AppHelper.instance.appConfig != null ? '/home' : '/no-connection';
12+
String initialRoute = AppHelper.instance.appConfig.appStatus != null ? '/home' : '/no-connection';
1313

1414
runApp(
1515
AppBuild(

LabelStoreMax/lib/resources/pages/browse_category.dart

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ class _BrowseCategoryPageState extends NyState<BrowseCategoryPage> {
5252
}
5353

5454
_fetchMoreProducts() async {
55+
if (waitForNextRequest || _shouldStopRequests) {
56+
return;
57+
}
5558
waitForNextRequest = true;
5659
List<WS.Product> products = await appWooSignal(
5760
(api) => api.getProducts(
@@ -61,14 +64,18 @@ class _BrowseCategoryPageState extends NyState<BrowseCategoryPage> {
6164
status: "publish",
6265
stockStatus: "instock"),
6366
);
64-
_products.addAll(products);
65-
waitForNextRequest = false;
66-
_page = _page + 1;
6767

68-
waitForNextRequest = false;
6968
if (products.length == 0) {
7069
_shouldStopRequests = true;
70+
setState(() {});
71+
return;
72+
} else {
73+
_products.addAll(products);
7174
}
75+
76+
waitForNextRequest = false;
77+
_page = _page + 1;
78+
7279
setState(() {
7380
_isLoading = false;
7481
});

LabelStoreMax/lib/resources/pages/browse_search.dart

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,11 @@ class _BrowseSearchState extends NyState<BrowseSearchPage> {
4646
}
4747

4848
_fetchProductsForSearch() async {
49+
if (waitForNextRequest || _shouldStopRequests) {
50+
return;
51+
}
4952
waitForNextRequest = true;
53+
5054
List<WS.Product> products = await appWooSignal(
5155
(api) => api.getProducts(
5256
perPage: 100,
@@ -56,14 +60,19 @@ class _BrowseSearchState extends NyState<BrowseSearchPage> {
5660
stockStatus: "instock",
5761
),
5862
);
59-
_products.addAll(products);
60-
waitForNextRequest = false;
61-
_page = _page + 1;
6263

63-
waitForNextRequest = false;
6464
if (products.length == 0) {
6565
_shouldStopRequests = true;
66+
setState(() {
67+
_isLoading = false;
68+
});
69+
return;
70+
} else {
71+
_products.addAll(products);
6672
}
73+
waitForNextRequest = false;
74+
_page = _page + 1;
75+
6776
setState(() {
6877
_isLoading = false;
6978
});

LabelStoreMax/lib/resources/pages/home.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class _HomePageState extends State<HomePage> {
3131
Widget build(BuildContext context) {
3232
Widget theme =
3333
MelloThemeWidget(globalKey: _key, wooSignalApp: _wooSignalApp);
34-
if (AppHelper.instance.themeType == "notic") {
34+
if (AppHelper.instance.appConfig.theme == "notic") {
3535
theme = NoticThemeWidget(globalKey: _key, wooSignalApp: _wooSignalApp);
3636
}
3737
return theme;

LabelStoreMax/lib/resources/pages/home_search.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class _HomeSearchPageState extends State<HomeSearchPage> {
3737
Navigator.pushNamed(context, "/product-search",
3838
arguments: _txtSearchController.text)
3939
.then((search) {
40-
if (AppHelper.instance.themeType != "notic") {
40+
if (AppHelper.instance.appConfig.theme != "notic") {
4141
Navigator.pop(context);
4242
}
4343
});

LabelStoreMax/lib/resources/pages/no_connection_page.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ class _NoConnectionPageState extends State<NoConnectionPage> {
7373
}
7474

7575
AppHelper.instance.appConfig = wooSignalApp;
76-
AppHelper.instance.themeType = wooSignalApp.theme;
7776
Navigator.pushNamed(context, "/home");
7877
}
7978
}

0 commit comments

Comments
 (0)