Skip to content

Commit d306f55

Browse files
committed
v2.3.0
1 parent e2e127a commit d306f55

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+749
-781
lines changed

ShopMax/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## [2.3.0] - 2025-05-28
2+
3+
* Upgrade project
4+
* pubspec.yaml updates
5+
16
## [2.2.0] - 2025-02-07
27

38
* pubspec.yaml updates

ShopMax/android/app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,5 +75,5 @@ flutter {
7575
}
7676

7777
dependencies {
78-
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.2.2'
78+
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.1.5'
7979
}

ShopMax/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
ignoresPersistentStateOnLaunch = "NO"
6060
debugDocumentVersioning = "YES"
6161
debugServiceExtension = "internal"
62+
enableGPUValidationMode = "1"
6263
allowLocationSimulation = "YES">
6364
<BuildableProductRunnable
6465
runnableDebuggingMode = "0">

ShopMax/lib/app/forms/login_form.dart

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,19 @@ import 'package:nylo_framework/nylo_framework.dart';
88
|-------------------------------------------------------------------------- */
99

1010
class LoginForm extends NyFormData {
11-
1211
LoginForm({String? name}) : super(name ?? "login");
1312

1413
@override
1514
fields() => [
16-
Field.email("Email",
17-
style: "compact",
18-
validate: FormValidator.email(),
19-
),
20-
Field.password("Password",
21-
style: "compact",
22-
validate: FormValidator.password(strength: 1),
23-
),
24-
];
15+
Field.email(
16+
"Email",
17+
style: "compact",
18+
validate: FormValidator.email(),
19+
),
20+
Field.password(
21+
"Password",
22+
style: "compact",
23+
validate: FormValidator.password(strength: 1),
24+
),
25+
];
2526
}

ShopMax/lib/app/forms/register_form.dart

Lines changed: 14 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -8,29 +8,21 @@ import 'package:nylo_framework/nylo_framework.dart';
88
|-------------------------------------------------------------------------- */
99

1010
class RegisterForm extends NyFormData {
11-
1211
RegisterForm({String? name}) : super(name ?? "register");
1312

1413
@override
1514
fields() => [
16-
[
17-
Field.text("First Name",
18-
style: "compact",
19-
validate: FormValidator.maxLength(100)
20-
),
21-
Field.text("Last Name",
22-
style: "compact",
23-
validate: FormValidator.maxLength(100)
24-
),
25-
],
26-
Field.email("Email Address",
27-
style: "compact",
28-
validate: FormValidator.email()
29-
),
30-
Field.password("Password",
31-
style: "compact",
32-
viewable: true,
33-
validate: FormValidator.password()
34-
),
35-
];
36-
}
15+
[
16+
Field.text("First Name",
17+
style: "compact", validate: FormValidator.maxLength(100)),
18+
Field.text("Last Name",
19+
style: "compact", validate: FormValidator.maxLength(100)),
20+
],
21+
Field.email("Email Address",
22+
style: "compact", validate: FormValidator.email()),
23+
Field.password("Password",
24+
style: "compact",
25+
viewable: true,
26+
validate: FormValidator.password()),
27+
];
28+
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ stripePay(context) async {
7575
? ThemeMode.light
7676
: ThemeMode.dark,
7777
merchantDisplayName:
78-
getEnv('APP_NAME', defaultValue: wooSignalApp?.appName),
78+
getEnv('APP_NAME', defaultValue: wooSignalApp?.appName),
7979
customerId: rsp!['customer'],
8080
paymentIntentClientSecret: rsp!['client_secret'],
8181
customerEphemeralKeySecret: rsp!['ephemeral_key'],

ShopMax/lib/app/providers/route_provider.dart

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,4 @@ class RouteProvider implements NyProvider {
1515
afterBoot(Nylo nylo) async {
1616
nylo.initRoutes();
1717
}
18-
19-
// _onDeepLink(route, data) {
20-
// print("Deep link route: $route");
21-
// print("Deep link data: $data");
22-
23-
// Example of updating the route stack
24-
// if (route == ProfilePage.path) {
25-
// Nylo.updateRouteStack([
26-
// SettingsPage.path, // first route
27-
// PostsPage.path, // second route
28-
// PostDetailPage.path, // and so on..
29-
// ProfilePage.path // deep link route
30-
// ], replace: true, deepLink: true, dataForRoute: {
31-
// PostsPage.path: {"name": "John Doe"}
32-
// });
33-
// }
34-
// }
3518
}

ShopMax/lib/app/providers/woosignal_provider.dart

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,11 @@ import '/bootstrap/helpers.dart';
44
import '/bootstrap/app_helper.dart';
55
import 'package:woosignal_shopify_api/woosignal_shopify_api.dart' as shopify;
66
import 'package:woosignal_shopify_api/models/response/woosignal_app.dart'
7-
as shopify;
7+
as shopify;
88

99
class WoosignalProvider implements NyProvider {
10-
1110
@override
1211
boot(Nylo nylo) async {
13-
1412
await shopify.WooSignalShopify.instance.init(
1513
appKey: getEnv('APP_KEY'),
1614
debugMode: getEnv('APP_DEBUG'),
@@ -41,7 +39,7 @@ class WoosignalProvider implements NyProvider {
4139

4240
// WooSignal Setup
4341
shopify.WooSignalApp? wooSignalApp = await (appWooSignalShopify(
44-
(api) => api.getApp(encrypted: shouldEncrypt())));
42+
(api) => api.getApp(encrypted: shouldEncrypt())));
4543

4644
Locale? locale;
4745

@@ -58,17 +56,16 @@ class WoosignalProvider implements NyProvider {
5856

5957
await NyLocalization.instance.init(
6058
localeType: localeType,
61-
languageCode: locale?.languageCode ?? languageCode,
59+
languageCode: (locale?.languageCode ?? languageCode) ?? "en",
6260
assetsDirectory: assetsDirectory,
6361
);
64-
65-
return nylo;
62+
63+
return nylo;
6664
}
67-
65+
6866
@override
6967
afterBoot(Nylo nylo) async {
70-
71-
// Called after Nylo has finished booting
72-
// ...
68+
// Called after Nylo has finished booting
69+
// ...
7370
}
7471
}

ShopMax/lib/bootstrap/extensions.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,9 @@ extension DateTimeExtension on DateTime? {
5656
}
5757

5858
bool? isBetween(
59-
DateTime fromDateTime,
60-
DateTime toDateTime,
61-
) {
59+
DateTime fromDateTime,
60+
DateTime toDateTime,
61+
) {
6262
final date = this;
6363
if (date != null) {
6464
final isAfter = date.isAfterOrEqualTo(fromDateTime) ?? false;
@@ -80,4 +80,4 @@ extension ColorApp on Color {
8080
assert(opacity >= 0.0 && opacity <= 1.0);
8181
return withAlpha((255.0 * opacity).round());
8282
}
83-
}
83+
}

ShopMax/lib/bootstrap/helpers.dart

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import 'dart:convert';
33
import 'package:collection/collection.dart' show IterableExtension;
44
import 'package:firebase_messaging/firebase_messaging.dart';
55
import 'package:flutter_inappwebview/flutter_inappwebview.dart';
6+
import 'package:woosignal_shopify_api/money_formatter/money_formatter.dart';
67
import '/bootstrap/status_alert/models/status_alert_media_configuration.dart';
78
import '/bootstrap/status_alert/status_alert.dart';
89
import '/app/models/cart.dart';
@@ -18,7 +19,6 @@ import '/config/currency.dart';
1819
import '/config/payment_gateways.dart';
1920
import '/config/keys.dart';
2021
import 'package:html/parser.dart';
21-
import 'package:money_formatter/money_formatter.dart';
2222
import 'package:nylo_framework/nylo_framework.dart';
2323
import 'package:woosignal_shopify_api/models/response/auth/auth_customer_info.dart';
2424
import 'package:woosignal_shopify_api/woosignal_shopify_api.dart';
@@ -38,7 +38,6 @@ class ThemeColor {
3838
static Color fromHex(String hexColor) => nyHexColor(hexColor);
3939
}
4040

41-
4241
Future appWooSignalShopify(Function(WooSignalShopify api) api) async {
4342
return await api(WooSignalShopify.instance);
4443
}
@@ -53,7 +52,7 @@ bool isProductNew(DateTime? createdAt) {
5352
if (createdAt == null) false;
5453
try {
5554
return createdAt.isBetween(
56-
DateTime.now().subtract(Duration(days: 2)), DateTime.now()) ??
55+
DateTime.now().subtract(Duration(days: 2)), DateTime.now()) ??
5756
false;
5857
} on Exception catch (e) {
5958
NyLogger.error(e.toString());
@@ -82,18 +81,18 @@ Future<List<PaymentType?>> getShopifyPaymentTypes() async {
8281

8382
for (var appPaymentGateway in appPaymentGateways) {
8483
paymentTypes.add(paymentTypeList.firstWhereOrNull(
85-
(paymentTypeList) => paymentTypeList.name == appPaymentGateway));
84+
(paymentTypeList) => paymentTypeList.name == appPaymentGateway));
8685
}
8786

8887
return paymentTypes.where((v) => v != null).toList();
8988
}
9089

9190
PaymentType addPayment(
92-
{required int id,
93-
required String name,
94-
required String description,
95-
required String assetImage,
96-
required Function pay}) =>
91+
{required int id,
92+
required String name,
93+
required String description,
94+
required String assetImage,
95+
required Function pay}) =>
9796
PaymentType(
9897
id: id,
9998
name: name,
@@ -104,9 +103,9 @@ PaymentType addPayment(
104103

105104
showStatusAlert(context,
106105
{required String title,
107-
required String subtitle,
108-
IconData? icon,
109-
int? duration}) {
106+
required String subtitle,
107+
IconData? icon,
108+
int? duration}) {
110109
StatusAlert.show(
111110
context,
112111
duration: Duration(seconds: duration ?? 2),
@@ -127,7 +126,7 @@ String moneyFormatter(double amount) {
127126
amount: amount,
128127
settings: MoneyFormatterSettings(
129128
symbol:
130-
AppHelper.instance.shopifyAppConfig?.currencyMeta?.symbolNative,
129+
AppHelper.instance.shopifyAppConfig?.currencyMeta?.symbolNative,
131130
symbolAndNumberSeparator: ""),
132131
);
133132
if (appCurrencySymbolPosition == SymbolPositionType.left) {
@@ -177,9 +176,9 @@ bool isNumeric(String? str) {
177176

178177
checkoutShopify(
179178
Function(String total, BillingDetails? billingDetails, Cart cart)
180-
completeCheckout) async {
179+
completeCheckout) async {
181180
String cartTotal =
182-
await shopify.CheckoutSession.getInstance.total(withFormat: false);
181+
await shopify.CheckoutSession.getInstance.total(withFormat: false);
183182
BillingDetails? billingDetails =
184183
shopify.CheckoutSession.getInstance.billingDetails;
185184
Cart cart = Cart.getInstance;
@@ -188,9 +187,9 @@ checkoutShopify(
188187

189188
navigatorPush(BuildContext context,
190189
{required String routeName,
191-
Object? arguments,
192-
bool forgetAll = false,
193-
int? forgetLast}) {
190+
Object? arguments,
191+
bool forgetAll = false,
192+
int? forgetLast}) {
194193
if (forgetAll) {
195194
Navigator.of(context).pushNamedAndRemoveUntil(
196195
routeName, (Route<dynamic> route) => false,
@@ -216,13 +215,13 @@ class UserAuth {
216215

217216
Future<List<DefaultShipping>> getDefaultShipping() async {
218217
String data =
219-
await rootBundle.loadString('public/json/default_shipping.json');
218+
await rootBundle.loadString('public/json/default_shipping.json');
220219
dynamic dataJson = json.decode(data);
221220
List<DefaultShipping> shipping = [];
222221

223222
dataJson.forEach((key, value) {
224223
DefaultShipping defaultShipping =
225-
DefaultShipping(code: key, country: value['country'], states: []);
224+
DefaultShipping(code: key, country: value['country'], states: []);
226225
if (value['states'] != null) {
227226
value['states'].forEach((key1, value2) {
228227
defaultShipping.states
@@ -237,7 +236,7 @@ Future<List<DefaultShipping>> getDefaultShipping() async {
237236
Future<DefaultShipping?> findCountryMetaForShipping(String countryCode) async {
238237
List<DefaultShipping> defaultShipping = await getDefaultShipping();
239238
List<DefaultShipping> shippingByCountryCode =
240-
defaultShipping.where((element) => element.code == countryCode).toList();
239+
defaultShipping.where((element) => element.code == countryCode).toList();
241240
if (shippingByCountryCode.isNotEmpty) {
242241
return shippingByCountryCode.first;
243242
}
@@ -247,7 +246,7 @@ Future<DefaultShipping?> findCountryMetaForShipping(String countryCode) async {
247246
DefaultShippingState? findDefaultShippingStateByCode(
248247
DefaultShipping defaultShipping, String code) {
249248
List<DefaultShippingState> defaultShippingStates =
250-
defaultShipping.states.where((state) => state.code == code).toList();
249+
defaultShipping.states.where((state) => state.code == code).toList();
251250
if (defaultShippingStates.isEmpty) {
252251
return null;
253252
}
@@ -262,7 +261,7 @@ String truncateString(String data, int length) {
262261

263262
Future<List<String>> getWishlistProducts() async {
264263
List<String> currentProductsJSON =
265-
await (NyStorage.readCollection(Keys.wishlistProducts));
264+
await (NyStorage.readCollection(Keys.wishlistProducts));
266265

267266
return currentProductsJSON;
268267
}
@@ -350,7 +349,7 @@ class NyNotification {
350349
/// Get all notifications
351350
static Future<List<NotificationItem>> allNotifications() async {
352351
List<NotificationItem> notifications =
353-
await NyStorage.readCollection("app_notifications");
352+
await NyStorage.readCollection("app_notifications");
354353
String? userId = await WooSignalShopify.authUserId();
355354
notifications.removeWhere((notification) {
356355
if (notification.meta != null &&

0 commit comments

Comments
 (0)