Skip to content

Commit 34a2608

Browse files
committed
v6.12.0
1 parent 698d1c8 commit 34a2608

File tree

10 files changed

+251
-211
lines changed

10 files changed

+251
-211
lines changed

LabelStoreMax/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
## [6.12.0] - 2023-10-31
2+
3+
* Update design for Toast Notifications
4+
* Refactor project config for Nylo 5.7.1.
5+
* Update minimum sdk requirements to 3.1.3
6+
* Pubspec.yaml dependency updates
7+
18
## [6.11.1] - 2023-10-08
29

310
* Pubspec.yaml dependency updates

LabelStoreMax/lib/app/controllers/controller.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ import 'package:nylo_framework/nylo_framework.dart';
1212

1313
/// Base Controller for the Nylo
1414
/// See more on controllers here - https://nylo.dev/docs/2.x/controllers
15-
class Controller extends BaseController {
15+
class Controller extends NyController {
1616
Controller();
1717
}

LabelStoreMax/lib/app/providers/app_provider.dart

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import 'dart:developer';
2-
31
import 'package:flutter/material.dart';
42
import 'package:flutter/services.dart';
53
import 'package:flutter_app/bootstrap/app_helper.dart';
@@ -58,12 +56,12 @@ class AppProvider implements NyProvider {
5856
if (wooSignalApp.wpLoginEnabled == 1) {
5957
if (wooSignalApp.wpLoginBaseUrl == null) {
6058
AppHelper.instance.appConfig?.wpLoginEnabled = 0;
61-
log('Set your stores domain on WooSignal. Go to Features > WP Login and add your domain to "Store Base Url"');
59+
NyLogger.debug('Set your stores domain on WooSignal. Go to Features > WP Login and add your domain to "Store Base Url"');
6260
}
6361

6462
if (wooSignalApp.wpLoginWpApiPath == null) {
6563
AppHelper.instance.appConfig?.wpLoginEnabled = 0;
66-
log('Set your stores Wp JSON path on WooSignal. Go to Features > WP Login and add your Wp JSON path to "WP API Path"');
64+
NyLogger.debug('Set your stores Wp JSON path on WooSignal. Go to Features > WP Login and add your Wp JSON path to "WP API Path"');
6765
}
6866

6967
WPJsonAPI.instance.initWith(
@@ -92,6 +90,7 @@ class AppProvider implements NyProvider {
9290
nylo.appThemes = appThemes;
9391
nylo.appLoader = loader;
9492
nylo.appLogo = logo;
93+
nylo.addControllers(controllers);
9594

9695
nylo.addModelDecoders(modelDecoders);
9796
nylo.addValidationRules(validationRules);

LabelStoreMax/lib/bootstrap/helpers.dart

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -650,9 +650,29 @@ Future<BillingDetails> billingDetailsFromWpUserInfoResponse(
650650
}
651651

652652
/// API helper
653-
api<T>(dynamic Function(T) request, {BuildContext? context}) async =>
653+
api<T>(dynamic Function(T request) request,
654+
{BuildContext? context,
655+
Map<String, dynamic> headers = const {},
656+
String? bearerToken,
657+
String? baseUrl,
658+
int? page,
659+
String? queryNamePage,
660+
String? queryNamePerPage,
661+
int? perPage,
662+
List<Type> events = const []}) async =>
654663
await nyApi<T>(
655-
request: request, apiDecoders: apiDecoders, context: context);
664+
request: request,
665+
apiDecoders: apiDecoders,
666+
context: context,
667+
headers: headers,
668+
bearerToken: bearerToken,
669+
baseUrl: baseUrl,
670+
events: events,
671+
page: page,
672+
perPage: perPage,
673+
queryParamPage: queryNamePage ?? "page",
674+
queryParamPerPage: queryNamePerPage
675+
);
656676

657677
/// Event helper
658678
event<T>({Map? data}) async => nyEvent<T>(params: data, events: events);

LabelStoreMax/lib/config/decoders.dart

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
1+
import 'package:flutter_app/app/controllers/account_order_detail_controller.dart';
2+
import 'package:flutter_app/app/controllers/browse_category_controller.dart';
3+
import 'package:flutter_app/app/controllers/checkout_status_controller.dart';
4+
import 'package:flutter_app/app/controllers/leave_review_controller.dart';
5+
import 'package:flutter_app/app/controllers/product_detail_controller.dart';
6+
import 'package:flutter_app/app/controllers/product_image_viewer_controller.dart';
7+
import 'package:flutter_app/app/controllers/product_reviews_controller.dart';
18
import 'package:flutter_app/app/models/user.dart';
29
import 'package:flutter_app/app/networking/api_service.dart';
310
import 'package:flutter_app/app/networking/dio/base_api_service.dart';
11+
import 'package:nylo_framework/nylo_framework.dart';
412

513
/*
614
|--------------------------------------------------------------------------
@@ -31,3 +39,26 @@ final Map<Type, BaseApiService> apiDecoders = {
3139

3240
// ...
3341
};
42+
43+
/*
44+
|--------------------------------------------------------------------------
45+
| Controller Decoders
46+
| -------------------------------------------------------------------------
47+
| Controller are used in pages.
48+
| E.g. NyPage<MyController>
49+
|
50+
| Learn more https://nylo.dev/docs/5.x/controllers#using-controllers-with-ny-page
51+
|--------------------------------------------------------------------------
52+
*/
53+
final Map<Type, BaseController> controllers = {
54+
ProductDetailController: ProductDetailController(),
55+
AccountOrderDetailController: AccountOrderDetailController(),
56+
BrowseCategoryController: BrowseCategoryController(),
57+
CheckoutStatusController: CheckoutStatusController(),
58+
LeaveReviewController: LeaveReviewController(),
59+
ProductImageViewerController: ProductImageViewerController(),
60+
ProductReviewsController: ProductReviewsController()
61+
62+
// ...
63+
64+
};
Lines changed: 24 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -1,81 +1,33 @@
1-
import 'package:flutter_app/resources/themes/dark_theme.dart';
2-
import 'package:flutter_app/resources/themes/light_theme.dart';
3-
import 'package:flutter_app/resources/themes/styles/color_styles.dart';
4-
import 'package:flutter_app/resources/themes/styles/dark_theme_colors.dart';
5-
import 'package:flutter_app/resources/themes/styles/light_theme_colors.dart';
61
import 'package:nylo_framework/nylo_framework.dart';
72

3+
import '/resources/themes/dark_theme.dart';
4+
import '/resources/themes/light_theme.dart';
5+
import '/resources/themes/styles/color_styles.dart';
6+
import '/resources/themes/styles/dark_theme_colors.dart';
7+
import '/resources/themes/styles/light_theme_colors.dart';
8+
89
/*
910
|--------------------------------------------------------------------------
10-
| Theme Config
11+
| Flutter Themes
12+
| Run the below in the terminal to add a new theme.
13+
| "dart run nylo_framework:main make:theme bright_theme"
14+
|
15+
| Learn more: https://nylo.dev/docs/5.x/themes-and-styling
1116
|--------------------------------------------------------------------------
1217
*/
1318

1419
// App Themes
1520
final List<BaseThemeConfig<ColorStyles>> appThemes = [
16-
ThemeConfig.light(),
17-
ThemeConfig.dark(),
18-
];
19-
20-
/*
21-
|--------------------------------------------------------------------------
22-
| Theme Colors
23-
|--------------------------------------------------------------------------
24-
*/
25-
26-
// Light Colors
27-
ColorStyles lightColors = LightThemeColors();
28-
29-
// Dark Colors
30-
ColorStyles darkColors = DarkThemeColors();
31-
32-
/*
33-
|--------------------------------------------------------------------------
34-
| Themes
35-
|--------------------------------------------------------------------------
36-
*/
37-
38-
// Preset Themes
39-
class ThemeConfig {
40-
// LIGHT
41-
static BaseThemeConfig<ColorStyles> light() => BaseThemeConfig<ColorStyles>(
42-
id: "default_light_theme",
43-
description: "Light theme",
44-
theme: lightTheme(lightColors),
45-
colors: lightColors,
46-
);
47-
48-
// DARK
49-
static BaseThemeConfig<ColorStyles> dark() => BaseThemeConfig<ColorStyles>(
50-
id: "default_dark_theme",
51-
description: "Dark theme",
52-
theme: darkTheme(darkColors),
53-
colors: darkColors,
54-
);
55-
56-
// E.G. CUSTOM THEME
57-
/// Run: "flutter pub run nylo_framework:main make:theme bright_theme" // example bright_theme
58-
// Creates a basic theme in /resources/themes/bright_theme.dart
59-
// Creates the themes colors in /resources/themes/styles/bright_theme_colors.dart
60-
61-
// First add the colors which was created into the above section like the following:
62-
// Bright Colors
63-
/// ColorStyles brightColors = BrightThemeColors();
64-
65-
// Next, uncomment the below:
66-
/// static BaseThemeConfig<ColorStyles> bright() => BaseThemeConfig<ColorStyles>(
67-
/// id: "default_bright_theme",
68-
/// description: "Bright theme",
69-
/// theme: brightTheme(brightColors),
70-
/// colors: brightColors,
71-
/// );
72-
73-
// To then use this theme, add it to the [appThemes] above like the following:
74-
// final appThemes = [
75-
/// ThemeConfig.bright(), // new theme
76-
//
77-
// ThemeConfig.light(),
78-
//
79-
// ThemeConfig.dark(),
80-
// ];
81-
}
21+
BaseThemeConfig<ColorStyles>(
22+
id: getEnv('LIGHT_THEME_ID'),
23+
description: "Light theme",
24+
theme: lightTheme,
25+
colors: LightThemeColors(),
26+
),
27+
BaseThemeConfig<ColorStyles>(
28+
id: getEnv('DARK_THEME_ID'),
29+
description: "Dark theme",
30+
theme: darkTheme,
31+
colors: DarkThemeColors(),
32+
),
33+
];

LabelStoreMax/lib/config/toast_notification.dart

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@ class NyToastNotificationStyleMetaHelper extends ToastNotificationStyleMetaHelpe
2222
return ToastMeta.danger();
2323
}
2424

25-
// Example customizing a notification
26-
// onSuccess() {
27-
// return ToastMeta.success(
28-
// title: "Hello",
29-
// description: "World",
30-
// action: () {},
31-
// backgroundColor: Colors.Yellow
32-
// );
33-
// }
25+
// Example customizing a notification
26+
// onSuccess() {
27+
// return ToastMeta.success(
28+
// title: "Hello",
29+
// description: "World",
30+
// action: () {},
31+
// backgroundColor: Colors.Yellow
32+
// );
33+
// }
3434
}

0 commit comments

Comments
 (0)