Merge pull request #22 from woosignal/master

v5.5.1 - updates
This commit is contained in:
Anthony Gordon 2021-12-18 13:03:38 +00:00 committed by GitHub
commit 0665d0b6af
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
16 changed files with 92 additions and 2696 deletions

View File

@ -1,3 +1,9 @@
## [5.5.1] - 2021-12-18
* Fix bug if store connection fails
* Minify default_shipping.json
* Pubspec.yaml dependency updates
## [5.5.0] - 2021-12-17 ## [5.5.0] - 2021-12-17
* Change font from WooSignal dashboard * Change font from WooSignal dashboard

View File

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

View File

@ -13,7 +13,6 @@ import 'package:woosignal/models/response/woosignal_app.dart';
class AppHelper { class AppHelper {
AppHelper._privateConstructor(); AppHelper._privateConstructor();
String themeType;
static final AppHelper instance = AppHelper._privateConstructor(); static final AppHelper instance = AppHelper._privateConstructor();
WooSignalApp appConfig; WooSignalApp appConfig;

View File

@ -43,6 +43,27 @@ Future<void> boot() async {
/// AppHelper.instance.fcmToken = token; /// AppHelper.instance.fcmToken = token;
/// } /// }
AppHelper?.instance?.appConfig = WooSignalApp();
AppHelper.instance.appConfig.themeFont = "Poppins";
AppHelper.instance.appConfig.themeColors = {
'light': {
'background': '0xFFFFFFFF',
'primary_text': '0xFF000000',
'button_background': '0xFF529cda',
'button_text': '0xFFFFFFFF',
'app_bar_background': '0xFFFFFFFF',
'app_bar_text': '0xFF3a3d40',
},
'dark': {
'background': '0xFF212121',
'primary_text': '0xFFE1E1E1',
'button_background': '0xFFFFFFFF',
'button_text': '0xFF232c33',
'app_bar_background': '0xFF2C2C2C',
'app_bar_text': '0xFFFFFFFF',
}
};
// WooSignal Setup // WooSignal Setup
WooSignalApp wooSignalApp = await appWooSignal((api) => api.getApp()); WooSignalApp wooSignalApp = await appWooSignal((api) => api.getApp());
Locale locale = Locale('en'); Locale locale = Locale('en');

View File

@ -9,7 +9,7 @@ void main() async {
WidgetsFlutterBinding.ensureInitialized(); WidgetsFlutterBinding.ensureInitialized();
Nylo nylo = await Nylo.init(router: appRouter(), setup: boot); Nylo nylo = await Nylo.init(router: appRouter(), setup: boot);
String initialRoute = AppHelper.instance.appConfig != null ? '/home' : '/no-connection'; String initialRoute = AppHelper.instance.appConfig.appStatus != null ? '/home' : '/no-connection';
runApp( runApp(
AppBuild( AppBuild(

View File

@ -52,6 +52,9 @@ class _BrowseCategoryPageState extends NyState<BrowseCategoryPage> {
} }
_fetchMoreProducts() async { _fetchMoreProducts() async {
if (waitForNextRequest || _shouldStopRequests) {
return;
}
waitForNextRequest = true; waitForNextRequest = true;
List<WS.Product> products = await appWooSignal( List<WS.Product> products = await appWooSignal(
(api) => api.getProducts( (api) => api.getProducts(
@ -61,14 +64,18 @@ class _BrowseCategoryPageState extends NyState<BrowseCategoryPage> {
status: "publish", status: "publish",
stockStatus: "instock"), stockStatus: "instock"),
); );
_products.addAll(products);
if (products.length == 0) {
_shouldStopRequests = true;
setState(() {});
return;
} else {
_products.addAll(products);
}
waitForNextRequest = false; waitForNextRequest = false;
_page = _page + 1; _page = _page + 1;
waitForNextRequest = false;
if (products.length == 0) {
_shouldStopRequests = true;
}
setState(() { setState(() {
_isLoading = false; _isLoading = false;
}); });

View File

@ -46,7 +46,11 @@ class _BrowseSearchState extends NyState<BrowseSearchPage> {
} }
_fetchProductsForSearch() async { _fetchProductsForSearch() async {
if (waitForNextRequest || _shouldStopRequests) {
return;
}
waitForNextRequest = true; waitForNextRequest = true;
List<WS.Product> products = await appWooSignal( List<WS.Product> products = await appWooSignal(
(api) => api.getProducts( (api) => api.getProducts(
perPage: 100, perPage: 100,
@ -56,14 +60,19 @@ class _BrowseSearchState extends NyState<BrowseSearchPage> {
stockStatus: "instock", stockStatus: "instock",
), ),
); );
_products.addAll(products);
if (products.length == 0) {
_shouldStopRequests = true;
setState(() {
_isLoading = false;
});
return;
} else {
_products.addAll(products);
}
waitForNextRequest = false; waitForNextRequest = false;
_page = _page + 1; _page = _page + 1;
waitForNextRequest = false;
if (products.length == 0) {
_shouldStopRequests = true;
}
setState(() { setState(() {
_isLoading = false; _isLoading = false;
}); });

View File

@ -31,7 +31,7 @@ class _HomePageState extends State<HomePage> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
Widget theme = Widget theme =
MelloThemeWidget(globalKey: _key, wooSignalApp: _wooSignalApp); MelloThemeWidget(globalKey: _key, wooSignalApp: _wooSignalApp);
if (AppHelper.instance.themeType == "notic") { if (AppHelper.instance.appConfig.theme == "notic") {
theme = NoticThemeWidget(globalKey: _key, wooSignalApp: _wooSignalApp); theme = NoticThemeWidget(globalKey: _key, wooSignalApp: _wooSignalApp);
} }
return theme; return theme;

View File

@ -37,7 +37,7 @@ class _HomeSearchPageState extends State<HomeSearchPage> {
Navigator.pushNamed(context, "/product-search", Navigator.pushNamed(context, "/product-search",
arguments: _txtSearchController.text) arguments: _txtSearchController.text)
.then((search) { .then((search) {
if (AppHelper.instance.themeType != "notic") { if (AppHelper.instance.appConfig.theme != "notic") {
Navigator.pop(context); Navigator.pop(context);
} }
}); });

View File

@ -73,7 +73,6 @@ class _NoConnectionPageState extends State<NoConnectionPage> {
} }
AppHelper.instance.appConfig = wooSignalApp; AppHelper.instance.appConfig = wooSignalApp;
AppHelper.instance.themeType = wooSignalApp.theme;
Navigator.pushNamed(context, "/home"); Navigator.pushNamed(context, "/home");
} }
} }

View File

@ -54,10 +54,7 @@ class _MelloThemeWidgetState extends State<MelloThemeWidget> {
} }
_fetchMoreProducts() async { _fetchMoreProducts() async {
if (_shouldStopRequests) { if (waitForNextRequest || _shouldStopRequests) {
return;
}
if (waitForNextRequest) {
return; return;
} }
waitForNextRequest = true; waitForNextRequest = true;
@ -67,14 +64,17 @@ class _MelloThemeWidgetState extends State<MelloThemeWidget> {
perPage: 50, perPage: 50,
page: _page, page: _page,
status: "publish", status: "publish",
stockStatus: "instock")); stockStatus: "instock"),
_page = _page + 1; );
if (products.length == 0) { if (products.length == 0) {
_shouldStopRequests = true; _shouldStopRequests = true;
setState(() {});
return;
} }
_page = _page + 1;
waitForNextRequest = false; waitForNextRequest = false;
setState(() { setState(() {
_products.addAll(products.toList()); _products.addAll(products);
}); });
} }
@ -125,21 +125,19 @@ class _MelloThemeWidgetState extends State<MelloThemeWidget> {
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
(_isLoading Expanded(
? Expanded(child: AppLoaderWidget()) child: _isLoading ? AppLoaderWidget() : RefreshableScrollContainer(
: Expanded( controller: _refreshController,
child: RefreshableScrollContainer( onRefresh: _onRefresh,
controller: _refreshController, onLoading: _onLoading,
onRefresh: _onRefresh, products: _products,
onLoading: _onLoading, onTap: _showProduct,
products: _products, bannerHeight: MediaQuery.of(context).size.height / 3.5,
onTap: _showProduct, bannerImages: bannerImages,
bannerHeight: MediaQuery.of(context).size.height / 3.5, modalBottomSheetMenu: _modalBottomSheetMenu,
bannerImages: bannerImages, ),
modalBottomSheetMenu: _modalBottomSheetMenu, flex: 1,
), ),
flex: 1,
)),
], ],
), ),
), ),

View File

@ -57,10 +57,7 @@ class _NoticHomeWidgetState extends State<NoticHomeWidget> {
} }
_fetchMoreProducts() async { _fetchMoreProducts() async {
if (_shouldStopRequests) { if (waitForNextRequest || _shouldStopRequests) {
return;
}
if (waitForNextRequest) {
return; return;
} }
waitForNextRequest = true; waitForNextRequest = true;
@ -70,15 +67,19 @@ class _NoticHomeWidgetState extends State<NoticHomeWidget> {
perPage: 50, perPage: 50,
page: _page, page: _page,
status: "publish", status: "publish",
stockStatus: "instock")); stockStatus: "instock"),
_page = _page + 1; );
if (products.length == 0) { if (products.length == 0) {
_shouldStopRequests = true; _shouldStopRequests = true;
setState(() {});
return;
} else {
_products.addAll(products);
} }
_page = _page + 1;
waitForNextRequest = false; waitForNextRequest = false;
setState(() { setState(() {});
_products.addAll(products.toList());
});
} }
_modalBottomSheetMenu() { _modalBottomSheetMenu() {

File diff suppressed because one or more lines are too long

View File

@ -907,7 +907,7 @@ packages:
name: woosignal name: woosignal
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "3.0.0" version: "3.0.1"
wp_json_api: wp_json_api:
dependency: "direct main" dependency: "direct main"
description: description:

View File

@ -1,7 +1,7 @@
# Official WooSignal App Template for WooCommerce # Official WooSignal App Template for WooCommerce
# Label StoreMax # Label StoreMax
# Version: 5.5.0 # Version: 5.5.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
@ -30,7 +30,7 @@ dependencies:
intl: ^0.17.0 intl: ^0.17.0
page_transition: ^2.0.4 page_transition: ^2.0.4
nylo_framework: ^2.1.3 nylo_framework: ^2.1.3
woosignal: ^3.0.0 woosignal: ^3.0.1
flutter_stripe: ^2.0.2 flutter_stripe: ^2.0.2
wp_json_api: ^3.1.3 wp_json_api: ^3.1.3
cached_network_image: ^3.2.0 cached_network_image: ^3.2.0

View File

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