Skip to content

Commit 3271170

Browse files
committed
v6.15.0
1 parent b1cb227 commit 3271170

File tree

12 files changed

+185
-54
lines changed

12 files changed

+185
-54
lines changed

LabelStoreMax/CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
## [6.15.0] - 2024-03-08
2+
3+
* Increase minimum ios version to 14.0
4+
* Ability to deep link notifications on new products or orders using wp notify
5+
* Ability to order product categories from WooSignal dashboard
6+
* Update android config that fixes https://github.com/nylo-core/nylo/issues/112
7+
* Pubspec.yaml dependency updates
8+
19
## [6.14.0] - 2024-03-04
210

311
* Refactor project

LabelStoreMax/android/app/src/main/AndroidManifest.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
<application
1414
android:name="${applicationName}"
1515
android:label="Label StoreMax"
16+
android:allowBackup="false"
17+
android:fullBackupContent="false"
1618
android:icon="@mipmap/ic_launcher">
1719
<activity
1820
android:name=".MainActivity"

LabelStoreMax/ios/Runner.xcodeproj/project.pbxproj

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,7 @@
452452
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
453453
GCC_WARN_UNUSED_FUNCTION = YES;
454454
GCC_WARN_UNUSED_VARIABLE = YES;
455-
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
455+
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
456456
MTL_ENABLE_DEBUG_INFO = NO;
457457
SDKROOT = iphoneos;
458458
SUPPORTED_PLATFORMS = iphoneos;
@@ -470,6 +470,7 @@
470470
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
471471
ENABLE_BITCODE = NO;
472472
INFOPLIST_FILE = Runner/Info.plist;
473+
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
473474
LD_RUNPATH_SEARCH_PATHS = (
474475
"$(inherited)",
475476
"@executable_path/Frameworks",
@@ -580,7 +581,7 @@
580581
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
581582
GCC_WARN_UNUSED_FUNCTION = YES;
582583
GCC_WARN_UNUSED_VARIABLE = YES;
583-
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
584+
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
584585
MTL_ENABLE_DEBUG_INFO = YES;
585586
ONLY_ACTIVE_ARCH = YES;
586587
SDKROOT = iphoneos;
@@ -629,7 +630,7 @@
629630
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
630631
GCC_WARN_UNUSED_FUNCTION = YES;
631632
GCC_WARN_UNUSED_VARIABLE = YES;
632-
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
633+
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
633634
MTL_ENABLE_DEBUG_INFO = NO;
634635
SDKROOT = iphoneos;
635636
SUPPORTED_PLATFORMS = iphoneos;
@@ -649,6 +650,7 @@
649650
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
650651
ENABLE_BITCODE = NO;
651652
INFOPLIST_FILE = Runner/Info.plist;
653+
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
652654
LD_RUNPATH_SEARCH_PATHS = (
653655
"$(inherited)",
654656
"@executable_path/Frameworks",
@@ -672,6 +674,7 @@
672674
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
673675
ENABLE_BITCODE = NO;
674676
INFOPLIST_FILE = Runner/Info.plist;
677+
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
675678
LD_RUNPATH_SEARCH_PATHS = (
676679
"$(inherited)",
677680
"@executable_path/Frameworks",

LabelStoreMax/lib/resources/pages/cart_page.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,7 @@ class _CartPageState extends NyState<CartPage> {
138138
});
139139
return;
140140
}
141-
142-
Navigator.pushNamed(context, "/checkout");
141+
routeTo(CheckoutConfirmationPage.path);
143142
}
144143

145144
actionIncrementQuantity({required CartLineItem cartLineItem}) async {

LabelStoreMax/lib/resources/pages/home_page.dart

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@
88
// distributed under the License is distributed on an "AS IS" BASIS,
99
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1010

11+
import 'package:firebase_messaging/firebase_messaging.dart';
1112
import 'package:flutter/material.dart';
13+
import 'package:flutter_app/resources/pages/account_order_detail_page.dart';
14+
import 'package:flutter_app/resources/pages/product_detail_page.dart';
15+
import 'package:nylo_framework/nylo_framework.dart';
1216
import '/bootstrap/app_helper.dart';
1317
import '/resources/widgets/compo_theme_widget.dart';
1418
import '/resources/widgets/mello_theme_widget.dart';
@@ -24,12 +28,35 @@ class HomePage extends StatefulWidget {
2428
createState() => _HomePageState();
2529
}
2630

27-
class _HomePageState extends State<HomePage> {
31+
class _HomePageState extends NyState<HomePage> {
2832
_HomePageState();
2933

3034
final GlobalKey _key = GlobalKey();
3135
final WooSignalApp? _wooSignalApp = AppHelper.instance.appConfig;
3236

37+
@override
38+
init() async {
39+
await _enableFcmNotifications();
40+
}
41+
42+
_enableFcmNotifications() async {
43+
bool? firebaseFcmIsEnabled = AppHelper.instance.appConfig?.firebaseFcmIsEnabled;
44+
firebaseFcmIsEnabled ??= getEnv('FCM_ENABLED', defaultValue: false);
45+
46+
if (firebaseFcmIsEnabled != true) return;
47+
48+
FirebaseMessaging.onMessageOpenedApp.listen((RemoteMessage message) {
49+
/// WP Notify - Product notification
50+
if (message.data.containsKey('product_id')) {
51+
routeTo(ProductDetailPage.path, data: int.parse(message.data['product_id']));
52+
}
53+
/// WP Notify - Order notification
54+
if (message.data.containsKey('order_id')) {
55+
routeTo(AccountOrderDetailPage.path, data: int.parse(message.data['order_id']));
56+
}
57+
});
58+
}
59+
3360
@override
3461
Widget build(BuildContext context) {
3562
Widget theme =

LabelStoreMax/lib/resources/pages/home_search_page.dart

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,27 +54,26 @@ class _HomeSearchPageState extends State<HomeSearchPage> {
5454
),
5555
body: SafeAreaWidget(
5656
child: Column(
57-
mainAxisAlignment: MainAxisAlignment.center,
57+
mainAxisAlignment: MainAxisAlignment.start,
5858
crossAxisAlignment: CrossAxisAlignment.start,
59-
children: <Widget>[
60-
TextField(
59+
children: [
60+
NyTextField.compact(
6161
decoration: InputDecoration(prefixIcon: Icon(Icons.search)),
6262
controller: _txtSearchController,
6363
style: Theme.of(context).textTheme.displaySmall,
6464
keyboardType: TextInputType.text,
6565
autocorrect: false,
66-
autofocus: true,
66+
autoFocus: true,
6767
textCapitalization: TextCapitalization.sentences,
6868
),
6969
Container(
70-
margin: EdgeInsets.only(top: 10),
7170
child: PrimaryButton(
7271
title: trans("Search"),
7372
action: _actionSearch,
7473
),
7574
)
7675
],
77-
),
76+
).withGap(20),
7877
),
7978
);
8079
}

LabelStoreMax/lib/resources/widgets/compo_home_widget.dart

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@
99
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1010

1111
import 'package:auto_size_text/auto_size_text.dart';
12+
import 'package:collection/collection.dart';
1213
import 'package:flutter/material.dart';
14+
import 'package:woosignal/models/response/product_category_collection.dart';
1315
import '/bootstrap/helpers.dart';
1416
import '/resources/widgets/app_loader_widget.dart';
1517
import '/resources/widgets/buttons.dart';
@@ -39,10 +41,28 @@ class _CompoHomeWidgetState extends State<CompoHomeWidget> {
3941
}
4042

4143
_loadHome() async {
42-
categories = await (appWooSignal((api) =>
43-
api.getProductCategories(parent: 0, perPage: 50, hideEmpty: true)));
44-
categories.sort((category1, category2) =>
45-
category1.menuOrder!.compareTo(category2.menuOrder!));
44+
if ((widget.wooSignalApp?.productCategoryCollections ?? []).isNotEmpty) {
45+
List<int> productCategoryId = widget.wooSignalApp?.productCategoryCollections.map((e) => int.parse(e.collectionId!)).toList() ?? [];
46+
categories = await (appWooSignal((api) =>
47+
api.getProductCategories(parent: 0, perPage: 50, hideEmpty: true, include: productCategoryId)));
48+
categories.sort((category1, category2) {
49+
ProductCategoryCollection? productCategoryCollection1 = widget.wooSignalApp?.productCategoryCollections.firstWhereOrNull((element) => element.collectionId == category1.id.toString());
50+
ProductCategoryCollection? productCategoryCollection2 = widget.wooSignalApp?.productCategoryCollections.firstWhereOrNull((element) => element.collectionId == category2.id.toString());
51+
52+
if (productCategoryCollection1 == null) return 0;
53+
if (productCategoryCollection2 == null) return 0;
54+
55+
if (productCategoryCollection1.position == null) return 0;
56+
if (productCategoryCollection2.position == null) return 0;
57+
58+
return productCategoryCollection1.position!.compareTo(productCategoryCollection2.position!);
59+
});
60+
} else {
61+
categories = await (appWooSignal((api) =>
62+
api.getProductCategories(parent: 0, perPage: 50, hideEmpty: true)));
63+
categories.sort((category1, category2) =>
64+
category1.menuOrder!.compareTo(category2.menuOrder!));
65+
}
4666

4767
for (var category in categories) {
4868
List<Product> products = await (appWooSignal(
@@ -73,7 +93,7 @@ class _CompoHomeWidgetState extends State<CompoHomeWidget> {
7393
Size size = MediaQuery.of(context).size;
7494
List<String>? bannerImages = widget.wooSignalApp!.bannerImages;
7595
return Scaffold(
76-
drawer: HomeDrawerWidget(wooSignalApp: widget.wooSignalApp),
96+
drawer: HomeDrawerWidget(wooSignalApp: widget.wooSignalApp, productCategories: categories),
7797
appBar: AppBar(
7898
centerTitle: true,
7999
title: StoreLogo(),

LabelStoreMax/lib/resources/widgets/home_drawer_widget.dart

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1010

1111
import 'package:flutter/material.dart';
12+
import '/resources/pages/browse_category_page.dart';
13+
import 'package:woosignal/models/response/product_category.dart';
1214
import '/bootstrap/app_helper.dart';
1315
import '/bootstrap/helpers.dart';
1416
import '/bootstrap/shared_pref/sp_auth.dart';
@@ -22,9 +24,10 @@ import 'package:woosignal/models/response/woosignal_app.dart';
2224
import 'package:url_launcher/url_launcher.dart';
2325

2426
class HomeDrawerWidget extends StatefulWidget {
25-
const HomeDrawerWidget({super.key, required this.wooSignalApp});
27+
const HomeDrawerWidget({super.key, required this.wooSignalApp, this.productCategories = const []});
2628

2729
final WooSignalApp? wooSignalApp;
30+
final List<ProductCategory> productCategories;
2831

2932
@override
3033
createState() => _HomeDrawerWidgetState();
@@ -56,6 +59,37 @@ class _HomeDrawerWidgetState extends State<HomeDrawerWidget> {
5659
color: ThemeColor.get(context).background,
5760
),
5861
),
62+
if (widget.wooSignalApp?.productCategoryCollections.isNotEmpty ?? false)
63+
Column(
64+
crossAxisAlignment: CrossAxisAlignment.start,
65+
mainAxisAlignment: MainAxisAlignment.start,
66+
children: [
67+
Padding(
68+
child: Text(
69+
trans("Categories".tr()),
70+
style: Theme.of(context).textTheme.titleSmall!.copyWith(
71+
fontWeight: FontWeight.w600,
72+
),
73+
textAlign: TextAlign.left,
74+
),
75+
padding: EdgeInsets.only(left: 16, top: 8, bottom: 8),
76+
),
77+
...widget.productCategories.map((collection) {
78+
return ListTile(
79+
title: Text(
80+
collection.name ?? "",
81+
style: Theme.of(context)
82+
.textTheme
83+
.bodyMedium!
84+
.copyWith(fontSize: 16),
85+
),
86+
trailing: Icon(Icons.keyboard_arrow_right_rounded),
87+
onTap: () {
88+
routeTo(BrowseCategoryPage.path, data: collection);
89+
},
90+
);
91+
})
92+
]),
5993
if (["compo"].contains(_themeType) == false)
6094
Column(
6195
crossAxisAlignment: CrossAxisAlignment.start,

LabelStoreMax/lib/resources/widgets/mello_theme_widget.dart

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88
// distributed under the License is distributed on an "AS IS" BASIS,
99
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1010

11+
import 'package:collection/collection.dart';
1112
import 'package:flutter/material.dart';
13+
import 'package:woosignal/models/response/product_category_collection.dart';
1214
import '/app/controllers/product_loader_controller.dart';
1315
import '/bootstrap/helpers.dart';
1416
import '/resources/widgets/cart_icon_widget.dart';
@@ -57,8 +59,28 @@ class _MelloThemeWidgetState extends NyState<MelloThemeWidget> {
5759
}
5860

5961
_fetchCategories() async {
60-
_categories =
61-
await (appWooSignal((api) => api.getProductCategories(perPage: 100)));
62+
if ((widget.wooSignalApp?.productCategoryCollections ?? []).isNotEmpty) {
63+
List<int> productCategoryId = widget.wooSignalApp?.productCategoryCollections.map((e) => int.parse(e.collectionId!)).toList() ?? [];
64+
_categories = await (appWooSignal((api) =>
65+
api.getProductCategories(parent: 0, perPage: 50, hideEmpty: true, include: productCategoryId)));
66+
_categories.sort((category1, category2) {
67+
ProductCategoryCollection? productCategoryCollection1 = widget.wooSignalApp?.productCategoryCollections.firstWhereOrNull((element) => element.collectionId == category1.id.toString());
68+
ProductCategoryCollection? productCategoryCollection2 = widget.wooSignalApp?.productCategoryCollections.firstWhereOrNull((element) => element.collectionId == category2.id.toString());
69+
70+
if (productCategoryCollection1 == null) return 0;
71+
if (productCategoryCollection2 == null) return 0;
72+
73+
if (productCategoryCollection1.position == null) return 0;
74+
if (productCategoryCollection2.position == null) return 0;
75+
76+
return productCategoryCollection1.position!.compareTo(productCategoryCollection2.position!);
77+
});
78+
} else {
79+
_categories = await (appWooSignal((api) =>
80+
api.getProductCategories(parent: 0, perPage: 50, hideEmpty: true)));
81+
_categories.sort((category1, category2) =>
82+
category1.menuOrder!.compareTo(category2.menuOrder!));
83+
}
6284
}
6385

6486
_modalBottomSheetMenu() {
@@ -86,7 +108,7 @@ class _MelloThemeWidgetState extends NyState<MelloThemeWidget> {
86108
Widget build(BuildContext context) {
87109
List<String>? bannerImages = widget.wooSignalApp!.bannerImages;
88110
return Scaffold(
89-
drawer: HomeDrawerWidget(wooSignalApp: widget.wooSignalApp),
111+
drawer: HomeDrawerWidget(wooSignalApp: widget.wooSignalApp, productCategories: _categories,),
90112
appBar: AppBar(
91113
title: StoreLogo(height: 55),
92114
centerTitle: true,

LabelStoreMax/lib/resources/widgets/notic_home_widget.dart

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,10 @@
88
// distributed under the License is distributed on an "AS IS" BASIS,
99
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1010

11+
import 'package:collection/collection.dart';
1112
import 'package:flutter/cupertino.dart';
1213
import 'package:flutter/material.dart';
14+
import 'package:woosignal/models/response/product_category_collection.dart';
1315
import '/app/controllers/product_loader_controller.dart';
1416
import '/bootstrap/helpers.dart';
1517
import '/resources/widgets/cached_image_widget.dart';
@@ -55,8 +57,28 @@ class _NoticHomeWidgetState extends NyState<NoticHomeWidget> {
5557
}
5658

5759
_fetchCategories() async {
58-
_categories =
59-
await (appWooSignal((api) => api.getProductCategories(perPage: 100)));
60+
if ((widget.wooSignalApp?.productCategoryCollections ?? []).isNotEmpty) {
61+
List<int> productCategoryId = widget.wooSignalApp?.productCategoryCollections.map((e) => int.parse(e.collectionId!)).toList() ?? [];
62+
_categories = await (appWooSignal((api) =>
63+
api.getProductCategories(parent: 0, perPage: 50, hideEmpty: true, include: productCategoryId)));
64+
_categories.sort((category1, category2) {
65+
ProductCategoryCollection? productCategoryCollection1 = widget.wooSignalApp?.productCategoryCollections.firstWhereOrNull((element) => element.collectionId == category1.id.toString());
66+
ProductCategoryCollection? productCategoryCollection2 = widget.wooSignalApp?.productCategoryCollections.firstWhereOrNull((element) => element.collectionId == category2.id.toString());
67+
68+
if (productCategoryCollection1 == null) return 0;
69+
if (productCategoryCollection2 == null) return 0;
70+
71+
if (productCategoryCollection1.position == null) return 0;
72+
if (productCategoryCollection2.position == null) return 0;
73+
74+
return productCategoryCollection1.position!.compareTo(productCategoryCollection2.position!);
75+
});
76+
} else {
77+
_categories = await (appWooSignal((api) =>
78+
api.getProductCategories(parent: 0, perPage: 50, hideEmpty: true)));
79+
_categories.sort((category1, category2) =>
80+
category1.menuOrder!.compareTo(category2.menuOrder!));
81+
}
6082
}
6183

6284
_modalBottomSheetMenu() {

0 commit comments

Comments
 (0)