Skip to content

Commit

Permalink
v6.12.0
Browse files Browse the repository at this point in the history
  • Loading branch information
agordn52 committed Oct 31, 2023
1 parent 698d1c8 commit 34a2608
Show file tree
Hide file tree
Showing 10 changed files with 251 additions and 211 deletions.
7 changes: 7 additions & 0 deletions LabelStoreMax/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## [6.12.0] - 2023-10-31

* Update design for Toast Notifications
* Refactor project config for Nylo 5.7.1.
* Update minimum sdk requirements to 3.1.3
* Pubspec.yaml dependency updates

## [6.11.1] - 2023-10-08

* Pubspec.yaml dependency updates
Expand Down
2 changes: 1 addition & 1 deletion LabelStoreMax/lib/app/controllers/controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ import 'package:nylo_framework/nylo_framework.dart';

/// Base Controller for the Nylo
/// See more on controllers here - https://nylo.dev/docs/2.x/controllers
class Controller extends BaseController {
class Controller extends NyController {
Controller();
}
7 changes: 3 additions & 4 deletions LabelStoreMax/lib/app/providers/app_provider.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import 'dart:developer';

import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_app/bootstrap/app_helper.dart';
Expand Down Expand Up @@ -58,12 +56,12 @@ class AppProvider implements NyProvider {
if (wooSignalApp.wpLoginEnabled == 1) {
if (wooSignalApp.wpLoginBaseUrl == null) {
AppHelper.instance.appConfig?.wpLoginEnabled = 0;
log('Set your stores domain on WooSignal. Go to Features > WP Login and add your domain to "Store Base Url"');
NyLogger.debug('Set your stores domain on WooSignal. Go to Features > WP Login and add your domain to "Store Base Url"');
}

if (wooSignalApp.wpLoginWpApiPath == null) {
AppHelper.instance.appConfig?.wpLoginEnabled = 0;
log('Set your stores Wp JSON path on WooSignal. Go to Features > WP Login and add your Wp JSON path to "WP API Path"');
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"');
}

WPJsonAPI.instance.initWith(
Expand Down Expand Up @@ -92,6 +90,7 @@ class AppProvider implements NyProvider {
nylo.appThemes = appThemes;
nylo.appLoader = loader;
nylo.appLogo = logo;
nylo.addControllers(controllers);

nylo.addModelDecoders(modelDecoders);
nylo.addValidationRules(validationRules);
Expand Down
24 changes: 22 additions & 2 deletions LabelStoreMax/lib/bootstrap/helpers.dart
Original file line number Diff line number Diff line change
Expand Up @@ -650,9 +650,29 @@ Future<BillingDetails> billingDetailsFromWpUserInfoResponse(
}

/// API helper
api<T>(dynamic Function(T) request, {BuildContext? context}) async =>
api<T>(dynamic Function(T request) request,
{BuildContext? context,
Map<String, dynamic> headers = const {},
String? bearerToken,
String? baseUrl,
int? page,
String? queryNamePage,
String? queryNamePerPage,
int? perPage,
List<Type> events = const []}) async =>
await nyApi<T>(
request: request, apiDecoders: apiDecoders, context: context);
request: request,
apiDecoders: apiDecoders,
context: context,
headers: headers,
bearerToken: bearerToken,
baseUrl: baseUrl,
events: events,
page: page,
perPage: perPage,
queryParamPage: queryNamePage ?? "page",
queryParamPerPage: queryNamePerPage
);

/// Event helper
event<T>({Map? data}) async => nyEvent<T>(params: data, events: events);
Expand Down
31 changes: 31 additions & 0 deletions LabelStoreMax/lib/config/decoders.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
import 'package:flutter_app/app/controllers/account_order_detail_controller.dart';
import 'package:flutter_app/app/controllers/browse_category_controller.dart';
import 'package:flutter_app/app/controllers/checkout_status_controller.dart';
import 'package:flutter_app/app/controllers/leave_review_controller.dart';
import 'package:flutter_app/app/controllers/product_detail_controller.dart';
import 'package:flutter_app/app/controllers/product_image_viewer_controller.dart';
import 'package:flutter_app/app/controllers/product_reviews_controller.dart';
import 'package:flutter_app/app/models/user.dart';
import 'package:flutter_app/app/networking/api_service.dart';
import 'package:flutter_app/app/networking/dio/base_api_service.dart';
import 'package:nylo_framework/nylo_framework.dart';

/*
|--------------------------------------------------------------------------
Expand Down Expand Up @@ -31,3 +39,26 @@ final Map<Type, BaseApiService> apiDecoders = {

// ...
};

/*
|--------------------------------------------------------------------------
| Controller Decoders
| -------------------------------------------------------------------------
| Controller are used in pages.
| E.g. NyPage<MyController>
|
| Learn more https://nylo.dev/docs/5.x/controllers#using-controllers-with-ny-page
|--------------------------------------------------------------------------
*/
final Map<Type, BaseController> controllers = {
ProductDetailController: ProductDetailController(),
AccountOrderDetailController: AccountOrderDetailController(),
BrowseCategoryController: BrowseCategoryController(),
CheckoutStatusController: CheckoutStatusController(),
LeaveReviewController: LeaveReviewController(),
ProductImageViewerController: ProductImageViewerController(),
ProductReviewsController: ProductReviewsController()

// ...

};
96 changes: 24 additions & 72 deletions LabelStoreMax/lib/config/theme.dart
Original file line number Diff line number Diff line change
@@ -1,81 +1,33 @@
import 'package:flutter_app/resources/themes/dark_theme.dart';
import 'package:flutter_app/resources/themes/light_theme.dart';
import 'package:flutter_app/resources/themes/styles/color_styles.dart';
import 'package:flutter_app/resources/themes/styles/dark_theme_colors.dart';
import 'package:flutter_app/resources/themes/styles/light_theme_colors.dart';
import 'package:nylo_framework/nylo_framework.dart';

import '/resources/themes/dark_theme.dart';
import '/resources/themes/light_theme.dart';
import '/resources/themes/styles/color_styles.dart';
import '/resources/themes/styles/dark_theme_colors.dart';
import '/resources/themes/styles/light_theme_colors.dart';

/*
|--------------------------------------------------------------------------
| Theme Config
| Flutter Themes
| Run the below in the terminal to add a new theme.
| "dart run nylo_framework:main make:theme bright_theme"
|
| Learn more: https://nylo.dev/docs/5.x/themes-and-styling
|--------------------------------------------------------------------------
*/

// App Themes
final List<BaseThemeConfig<ColorStyles>> appThemes = [
ThemeConfig.light(),
ThemeConfig.dark(),
];

/*
|--------------------------------------------------------------------------
| Theme Colors
|--------------------------------------------------------------------------
*/

// Light Colors
ColorStyles lightColors = LightThemeColors();

// Dark Colors
ColorStyles darkColors = DarkThemeColors();

/*
|--------------------------------------------------------------------------
| Themes
|--------------------------------------------------------------------------
*/

// Preset Themes
class ThemeConfig {
// LIGHT
static BaseThemeConfig<ColorStyles> light() => BaseThemeConfig<ColorStyles>(
id: "default_light_theme",
description: "Light theme",
theme: lightTheme(lightColors),
colors: lightColors,
);

// DARK
static BaseThemeConfig<ColorStyles> dark() => BaseThemeConfig<ColorStyles>(
id: "default_dark_theme",
description: "Dark theme",
theme: darkTheme(darkColors),
colors: darkColors,
);

// E.G. CUSTOM THEME
/// Run: "flutter pub run nylo_framework:main make:theme bright_theme" // example bright_theme
// Creates a basic theme in /resources/themes/bright_theme.dart
// Creates the themes colors in /resources/themes/styles/bright_theme_colors.dart

// First add the colors which was created into the above section like the following:
// Bright Colors
/// ColorStyles brightColors = BrightThemeColors();
// Next, uncomment the below:
/// static BaseThemeConfig<ColorStyles> bright() => BaseThemeConfig<ColorStyles>(
/// id: "default_bright_theme",
/// description: "Bright theme",
/// theme: brightTheme(brightColors),
/// colors: brightColors,
/// );
// To then use this theme, add it to the [appThemes] above like the following:
// final appThemes = [
/// ThemeConfig.bright(), // new theme
//
// ThemeConfig.light(),
//
// ThemeConfig.dark(),
// ];
}
BaseThemeConfig<ColorStyles>(
id: getEnv('LIGHT_THEME_ID'),
description: "Light theme",
theme: lightTheme,
colors: LightThemeColors(),
),
BaseThemeConfig<ColorStyles>(
id: getEnv('DARK_THEME_ID'),
description: "Dark theme",
theme: darkTheme,
colors: DarkThemeColors(),
),
];
18 changes: 9 additions & 9 deletions LabelStoreMax/lib/config/toast_notification.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ class NyToastNotificationStyleMetaHelper extends ToastNotificationStyleMetaHelpe
return ToastMeta.danger();
}

// Example customizing a notification
// onSuccess() {
// return ToastMeta.success(
// title: "Hello",
// description: "World",
// action: () {},
// backgroundColor: Colors.Yellow
// );
// }
// Example customizing a notification
// onSuccess() {
// return ToastMeta.success(
// title: "Hello",
// description: "World",
// action: () {},
// backgroundColor: Colors.Yellow
// );
// }
}
Loading

0 comments on commit 34a2608

Please sign in to comment.