Skip to content

Commit 3b350db

Browse files
committed
v6.9.0
1 parent 6deab50 commit 3b350db

File tree

11 files changed

+94
-40
lines changed

11 files changed

+94
-40
lines changed

LabelStoreMax/.env

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,4 +52,7 @@ PRODUCT_PLACEHOLDER_IMAGE="https://woosignal.com/images/woocommerce-placeholder.
5252
# Sets the default placeholder image for products with no image
5353

5454
AUTH_USER_KEY="AUTH_USER"
55-
FCM_ENABLED=false
55+
FCM_ENABLED=null
56+
57+
ENCRYPT_KEY=null
58+
ENCRYPT_SECRET=null

LabelStoreMax/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
## [6.9.0] - 2023-07-13
2+
3+
* Pull firebase config via woosignal api
4+
* New encrypt key and secret added to .env
5+
* fix fetchRelated to return "publish" products
6+
* Pubspec.yaml dependency updates
7+
18
## [6.8.2] - 2023-07-04
29

310
* Update gradle + kotlin versions.

LabelStoreMax/lib/app/providers/app_provider.dart

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,10 @@ class AppProvider implements NyProvider {
2222
]);
2323

2424
await WooSignal.instance
25-
.init(appKey: getEnv('APP_KEY'), debugMode: getEnv('APP_DEBUG'));
25+
.init(appKey: getEnv('APP_KEY'), debugMode: getEnv('APP_DEBUG'),
26+
encryptKey: getEnv('ENCRYPT_KEY', defaultValue: null),
27+
encryptSecret: getEnv('ENCRYPT_SECRET', defaultValue: null)
28+
);
2629

2730
AppHelper.instance.appConfig = WooSignalApp();
2831
AppHelper.instance.appConfig!.themeFont = "Poppins";
@@ -46,7 +49,7 @@ class AppProvider implements NyProvider {
4649
};
4750

4851
// WooSignal Setup
49-
WooSignalApp? wooSignalApp = await (appWooSignal((api) => api.getApp()));
52+
WooSignalApp? wooSignalApp = await (appWooSignal((api) => api.getApp(encrypted: shouldEncrypt())));
5053
Locale locale = Locale('en');
5154

5255
if (wooSignalApp != null) {

LabelStoreMax/lib/app/providers/firebase_provider.dart

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import 'package:firebase_core/firebase_core.dart';
22
import 'package:firebase_messaging/firebase_messaging.dart';
3+
import 'package:flutter_app/bootstrap/app_helper.dart';
34
import 'package:flutter_app/firebase_options.dart';
45
import 'package:nylo_framework/nylo_framework.dart';
56
import 'package:woosignal/woosignal.dart';
@@ -14,7 +15,12 @@ class FirebaseProvider implements NyProvider {
1415

1516
@override
1617
afterBoot(Nylo nylo) async {
17-
if (getEnv('FCM_ENABLED', defaultValue: false) != true) return;
18+
bool? firebaseFcmIsEnabled = AppHelper.instance.appConfig?.firebaseFcmIsEnabled;
19+
if (firebaseFcmIsEnabled == null) {
20+
firebaseFcmIsEnabled = getEnv('FCM_ENABLED', defaultValue: false);
21+
}
22+
23+
if (firebaseFcmIsEnabled != true) return;
1824

1925
await Firebase.initializeApp(
2026
options: DefaultFirebaseOptions.currentPlatform,

LabelStoreMax/lib/app/providers/payments/stripe_pay.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ stripePay(context,
118118
return;
119119
}
120120

121-
Navigator.pushNamed(context, "/checkout-status", arguments: order);
121+
routeTo('/checkout-status', navigationType: NavigationType.pushAndForgetAll, data: order);
122122
} on StripeException catch (e) {
123123
if (getEnv('APP_DEBUG', defaultValue: true)) {
124124
NyLogger.error(e.error.message!);

LabelStoreMax/lib/bootstrap/helpers.dart

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -667,4 +667,16 @@ bool isProductNew(Product? product) {
667667
NyLogger.error(e.toString());
668668
}
669669
return false;
670+
}
671+
672+
bool shouldEncrypt() {
673+
String? encryptKey = getEnv('ENCRYPT_KEY', defaultValue: "");
674+
if (encryptKey == null || encryptKey == "") {
675+
return false;
676+
}
677+
String? encryptSecret = getEnv('ENCRYPT_KEY', defaultValue: "");
678+
if (encryptSecret == null || encryptSecret == "") {
679+
return false;
680+
}
681+
return true;
670682
}

LabelStoreMax/lib/firebase_options.dart

Lines changed: 27 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import 'package:firebase_core/firebase_core.dart' show FirebaseOptions;
33
import 'package:flutter/foundation.dart'
44
show defaultTargetPlatform, kIsWeb, TargetPlatform;
5+
import 'package:flutter_app/bootstrap/app_helper.dart';
56

67
/// Default [FirebaseOptions] for use with your Firebase apps.
78
class DefaultFirebaseOptions {
@@ -14,9 +15,33 @@ class DefaultFirebaseOptions {
1415
}
1516
switch (defaultTargetPlatform) {
1617
case TargetPlatform.android:
17-
return android;
18+
if (AppHelper.instance.appConfig?.firebaseOptionsAndroid == null) {
19+
throw UnsupportedError(
20+
'Add a valid Firebase json config on https://woosignal.com for your WooCommerce store',
21+
);
22+
}
23+
return FirebaseOptions(
24+
apiKey: AppHelper.instance.appConfig!.firebaseOptionsAndroid!['apiKey'],
25+
appId: AppHelper.instance.appConfig!.firebaseOptionsAndroid!['appId'],
26+
messagingSenderId: AppHelper.instance.appConfig!.firebaseOptionsAndroid!['messagingSenderId'],
27+
projectId: AppHelper.instance.appConfig!.firebaseOptionsAndroid!['projectId'],
28+
storageBucket: AppHelper.instance.appConfig!.firebaseOptionsAndroid!['storageBucket'],
29+
);
1830
case TargetPlatform.iOS:
19-
return ios;
31+
if (AppHelper.instance.appConfig?.firebaseOptionsIos == null) {
32+
throw UnsupportedError(
33+
'Add a valid Firebase plist config on https://woosignal.com for your WooCommerce store',
34+
);
35+
}
36+
return FirebaseOptions(
37+
apiKey: AppHelper.instance.appConfig!.firebaseOptionsIos!['apiKey'],
38+
appId: AppHelper.instance.appConfig!.firebaseOptionsIos!['appId'],
39+
messagingSenderId: AppHelper.instance.appConfig!.firebaseOptionsIos!['messagingSenderId'],
40+
projectId: AppHelper.instance.appConfig!.firebaseOptionsIos!['projectId'],
41+
storageBucket: AppHelper.instance.appConfig!.firebaseOptionsIos!['storageBucket'],
42+
iosClientId: AppHelper.instance.appConfig!.firebaseOptionsIos!['iosClientId'],
43+
iosBundleId: AppHelper.instance.appConfig!.firebaseOptionsIos!['iosBundleId'],
44+
);
2045
case TargetPlatform.macOS:
2146
throw UnsupportedError(
2247
'DefaultFirebaseOptions have not been configured for macos - '
@@ -38,22 +63,4 @@ class DefaultFirebaseOptions {
3863
);
3964
}
4065
}
41-
42-
static const FirebaseOptions android = FirebaseOptions(
43-
apiKey: '',
44-
appId: '',
45-
messagingSenderId: '',
46-
projectId: '',
47-
storageBucket: '',
48-
);
49-
50-
static const FirebaseOptions ios = FirebaseOptions(
51-
apiKey: '',
52-
appId: '',
53-
messagingSenderId: '',
54-
projectId: '',
55-
storageBucket: '',
56-
iosClientId: '',
57-
iosBundleId: '',
58-
);
5966
}

LabelStoreMax/lib/main.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ void main() async {
1515
debugShowCheckedModeBanner: false,
1616
),
1717
);
18-
}
18+
}

LabelStoreMax/lib/resources/widgets/product_detail_related_products_widget.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,6 @@ class ProductDetailRelatedProductsWidget extends StatelessWidget {
7575
}
7676

7777
Future<List<Product>> fetchRelated() async => await (appWooSignal(
78-
(api) => api.getProducts(perPage: 100, include: product!.relatedIds),
78+
(api) => api.getProducts(perPage: 100, include: product!.relatedIds, status: "publish"),
7979
));
8080
}

LabelStoreMax/pubspec.lock

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,14 @@ packages:
4949
url: "https://pub.dev"
5050
source: hosted
5151
version: "2.4.2"
52+
asn1lib:
53+
dependency: transitive
54+
description:
55+
name: asn1lib
56+
sha256: b74e3842a52c61f8819a1ec8444b4de5419b41a7465e69d4aa681445377398b0
57+
url: "https://pub.dev"
58+
source: hosted
59+
version: "1.4.1"
5260
async:
5361
dependency: transitive
5462
description:
@@ -209,6 +217,14 @@ packages:
209217
url: "https://pub.dev"
210218
source: hosted
211219
version: "5.2.1+1"
220+
encrypt:
221+
dependency: transitive
222+
description:
223+
name: encrypt
224+
sha256: "4fd4e4fdc21b9d7d4141823e1e6515cd94e7b8d84749504c232999fba25d9bbb"
225+
url: "https://pub.dev"
226+
source: hosted
227+
version: "5.0.1"
212228
eventify:
213229
dependency: transitive
214230
description:
@@ -617,18 +633,18 @@ packages:
617633
dependency: "direct main"
618634
description:
619635
name: nylo_framework
620-
sha256: a10e1ea240e04aa64a90a6170bc2eebd585b9c0f85b1557e323c5a49312add2b
636+
sha256: cfd9f98313672d06ccee6db7dfe75e584e1f72d7465c649b9bb765b1112f9f2a
621637
url: "https://pub.dev"
622638
source: hosted
623-
version: "5.1.1"
639+
version: "5.1.2"
624640
nylo_support:
625641
dependency: transitive
626642
description:
627643
name: nylo_support
628-
sha256: "09c5eace0c4fa4cef5148b3b7820fd0a8b24154c964c34c1396372315ef815d6"
644+
sha256: "35e4938f7c18f518a9cc09dc02cadd85183530c95217fa05fe6de08d8f25fbfe"
629645
url: "https://pub.dev"
630646
source: hosted
631-
version: "5.3.1"
647+
version: "5.4.0"
632648
octo_image:
633649
dependency: transitive
634650
description:
@@ -998,10 +1014,10 @@ packages:
9981014
dependency: "direct main"
9991015
description:
10001016
name: url_launcher
1001-
sha256: eb1e00ab44303d50dd487aab67ebc575456c146c6af44422f9c13889984c00f3
1017+
sha256: "781bd58a1eb16069412365c98597726cd8810ae27435f04b3b4d3a470bacd61e"
10021018
url: "https://pub.dev"
10031019
source: hosted
1004-
version: "6.1.11"
1020+
version: "6.1.12"
10051021
url_launcher_android:
10061022
dependency: transitive
10071023
description:
@@ -1142,10 +1158,10 @@ packages:
11421158
dependency: "direct main"
11431159
description:
11441160
name: woosignal
1145-
sha256: "5059a0f531149e3bd9ee70a24e76315644663462509c84771d3bb8ca403726ab"
1161+
sha256: "089a373122ae0e202e64e214ce4a549af29e589128bdc8c8a54f3da68a2355aa"
11461162
url: "https://pub.dev"
11471163
source: hosted
1148-
version: "3.7.1"
1164+
version: "3.8.0"
11491165
wp_json_api:
11501166
dependency: "direct main"
11511167
description:
@@ -1180,4 +1196,4 @@ packages:
11801196
version: "3.1.2"
11811197
sdks:
11821198
dart: ">=3.0.0 <4.0.0"
1183-
flutter: ">=3.7.0-0"
1199+
flutter: ">=3.10.0"

0 commit comments

Comments
 (0)