Skip to content

Commit

Permalink
v8.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
agordn52 committed Dec 1, 2024
1 parent 7185a3d commit 335144f
Show file tree
Hide file tree
Showing 145 changed files with 4,547 additions and 1,955 deletions.
4 changes: 2 additions & 2 deletions LabelStoreMax/.env
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ APP_DEBUG="true"
APP_URL="https://mywoocommercestore.com"
API_BASE_URL="https://mywoocommercestore.com"

ASSET_PATH_PUBLIC="public/assets/"
ASSET_PATH_IMAGES="public/assets/images"
ASSET_PATH_PUBLIC="public/"
ASSET_PATH_IMAGES="public/images"
TIMEZONE="UTC"

LIGHT_THEME_ID="default_light_theme"
Expand Down
5 changes: 5 additions & 0 deletions LabelStoreMax/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## [8.0.0] - 2024-12-01

* Update project for Nylo 6.x
* Pubspec.yaml dependency updates

## [7.5.7] - 2024-07-31

* Update order_wc.dart class
Expand Down
2 changes: 1 addition & 1 deletion LabelStoreMax/analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# (the recommended set includes the core lints).
# The core lints are also what is used by pub.dev for scoring packages.

include: package:lints/recommended.yaml
#include: package:flutter_lints/flutter.yaml

# Uncomment the following section to specify additional rules.

Expand Down
18 changes: 16 additions & 2 deletions LabelStoreMax/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,23 @@ if (flutterVersionName == null) {
}

android {
namespace "com.woosignal.android"
compileSdk 35
ndkVersion = "25.1.8937393"

packagingOptions {
exclude 'META-INF/DEPENDENCIES'
}

compileSdkVersion 34
compileOptions {
coreLibraryDesugaringEnabled true
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}

kotlinOptions {
jvmTarget = 17
}

sourceSets {
main.java.srcDirs += 'src/main/kotlin'
Expand Down Expand Up @@ -60,4 +72,6 @@ flutter {
source '../..'
}

dependencies {}
dependencies {
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.2.2'
}
3 changes: 1 addition & 2 deletions LabelStoreMax/android/app/src/debug/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.woosignal.android">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<!-- Flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
Expand Down
3 changes: 1 addition & 2 deletions LabelStoreMax/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.woosignal.android">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<!-- io.flutter.app.FlutterApplication is an android.app.Application that
calls FlutterMain.startInitialization(this); in its onCreate method.
In most cases you can leave this as-is, but you if you want to provide
Expand Down
3 changes: 1 addition & 2 deletions LabelStoreMax/android/app/src/profile/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.woosignal.android">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<!-- Flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
Expand Down
4 changes: 2 additions & 2 deletions LabelStoreMax/android/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
org.gradle.jvmargs=-Xmx4G
org.gradle.jvmargs=-Xmx4G -XX:MaxMetaspaceSize=2G -XX:+HeapDumpOnOutOfMemoryError
android.useAndroidX=true
android.enableJetifier=true
android.enableJetifier=true
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#Fri Jun 23 08:50:38 CEST 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-all.zip
4 changes: 2 additions & 2 deletions LabelStoreMax/android/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ pluginManagement {

plugins {
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
id "com.android.application" version "7.3.0" apply false
id "org.jetbrains.kotlin.android" version "1.9.10" apply false
id "com.android.application" version "8.3.2" apply false
id "org.jetbrains.kotlin.android" version "2.0.20" apply false
}

include ":app"
3 changes: 3 additions & 0 deletions LabelStoreMax/ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,7 @@
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = YES;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
Expand Down Expand Up @@ -672,6 +673,7 @@
baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = YES;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
Expand All @@ -698,6 +700,7 @@
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = YES;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
Expand Down
2 changes: 1 addition & 1 deletion LabelStoreMax/ios/Runner/AppDelegate.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import UIKit
import Flutter

@UIApplicationMain
@main
@objc class AppDelegate: FlutterAppDelegate {
override func application(
_ application: UIApplication,
Expand Down
6 changes: 6 additions & 0 deletions LabelStoreMax/ios/Runner/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@
<true/>
<key>UIApplicationSupportsIndirectInputEvents</key>
<true/>
<key>UIBackgroundModes</key>
<array>
<string>remote-notification</string>
<string>fetch</string>
<string>processing</string>
</array>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
Expand Down
5 changes: 4 additions & 1 deletion LabelStoreMax/ios/Runner/Runner.entitlements
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict/>
<dict>
<key>aps-environment</key>
<string>development</string>
</dict>
</plist>
2 changes: 1 addition & 1 deletion LabelStoreMax/lib/app/controllers/controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import 'package:nylo_framework/nylo_framework.dart';

/// Base Controller for the Nylo
/// See more on controllers here - https://nylo.dev/docs/5.20.0/controllers
/// See more on controllers here - https://nylo.dev/docs/6.x/controllers
class Controller extends NyController {
Controller();
}
39 changes: 5 additions & 34 deletions LabelStoreMax/lib/app/controllers/product_detail_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import 'package:flutter/material.dart';
import '/app/models/cart.dart';
import '/app/models/cart_line_item.dart';
import '/bootstrap/enums/wishlist_action_enums.dart';
import '/bootstrap/helpers.dart';
import '/resources/widgets/cart_quantity_widget.dart';
import '/resources/widgets/product_quantity_widget.dart';
Expand All @@ -26,14 +25,8 @@ class ProductDetailController extends Controller {
int quantity = 1;
Product? product;

@override
construct(BuildContext context) {
super.construct(context);
product = data() as Product?;
}

viewExternalProduct() {
if (product!.externalUrl != null && product!.externalUrl!.isNotEmpty) {
if (product?.externalUrl?.isNotEmpty ?? false) {
openBrowserTab(url: product!.externalUrl!);
}
}
Expand All @@ -55,13 +48,13 @@ class ProductDetailController extends Controller {
}

addQuantityTapped({Function? onSuccess}) {
if (product!.manageStock != null && product!.manageStock == true) {
if (quantity >= product!.stockQuantity!) {
if (product?.manageStock == true) {
if (quantity >= (product?.stockQuantity ?? 0)) {
showToastNotification(context!,
title: trans("Maximum quantity reached"),
description:
"${trans("Sorry, only")} ${product!.stockQuantity} ${trans("left")}",
style: ToastNotificationStyleType.INFO);
"${trans("Sorry, only")} ${product?.stockQuantity ?? "0"} ${trans("left")}",
style: ToastNotificationStyleType.info);
return;
}
}
Expand All @@ -86,28 +79,6 @@ class ProductDetailController extends Controller {
}
}

toggleWishList(
{required Function onSuccess,
required WishlistAction wishlistAction}) async {
String subtitleMsg;
if (wishlistAction == WishlistAction.remove) {
await removeWishlistProduct(product: product);
subtitleMsg = trans("This product has been removed from your wishlist");
} else {
await saveWishlistProduct(product: product);
subtitleMsg = trans("This product has been added to your wishlist");
}
showStatusAlert(
context,
title: trans("Success"),
subtitle: subtitleMsg,
icon: Icons.favorite,
duration: 1,
);

onSuccess();
}

ws_product_variation.ProductVariation? findProductVariation(
{required Map<int, dynamic> tmpAttributeObj,
required List<ws_product_variation.ProductVariation> productVariations}) {
Expand Down
24 changes: 24 additions & 0 deletions LabelStoreMax/lib/app/events/cart_remove_all_event.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import '/resources/pages/cart_page.dart';
import 'package:nylo_framework/nylo_framework.dart';

import '/resources/widgets/shopping_cart_total_widget.dart';
import '/app/models/cart.dart';

class CartRemoveAllEvent implements NyEvent {
@override
final listeners = {
DefaultListener: DefaultListener(),
};
}

class DefaultListener extends NyListener {
@override
handle(dynamic event) async {
await Cart.getInstance.clear();

// update states
updateState(ShoppingCartTotal.state);
NyListView.stateReset("shopping_cart_items_list_view");
updateState(CartPage.path, data: {"action": "showToastCartCleared"});
}
}
32 changes: 32 additions & 0 deletions LabelStoreMax/lib/app/events/cart_remove_item_event.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import '/resources/widgets/cart_quantity_widget.dart';
import '/resources/pages/cart_page.dart';
import 'package:nylo_framework/nylo_framework.dart';

import '/resources/widgets/shopping_cart_total_widget.dart';
import '/app/models/cart.dart';
import '/app/models/cart_line_item.dart';

class CartRemoveItemEvent implements NyEvent {
@override
final listeners = {
DefaultListener: DefaultListener(),
};
}

class DefaultListener extends NyListener {
@override
handle(dynamic event) async {
CartLineItem cartLineItem = event["cartLineItem"];
bool complete = (await Cart.getInstance.removeCartItem(cartLineItem));
if (complete != true) {
return;
}

// update states
updateState(CartPage.path, data: {"action": "showToastCartItemRemoved"});

updateState(ShoppingCartTotal.state);
NyListView.stateReset("shopping_cart_items_list_view");
updateState(CartQuantity.state);
}
}
39 changes: 39 additions & 0 deletions LabelStoreMax/lib/app/events/category_notification_event.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import 'package:firebase_messaging/firebase_messaging.dart';
import '/resources/pages/browse_category_page.dart';
import 'package:nylo_framework/nylo_framework.dart';
import 'package:wp_json_api/wp_json_api.dart';

class CategoryNotificationEvent implements NyEvent {
@override
final listeners = {
DefaultListener: DefaultListener(),
};
}

class DefaultListener extends NyListener {
@override
handle(dynamic event) async {
RemoteMessage message = event['RemoteMessage'];

if (!message.data.containsKey('order_id')) {
return;
}
if (!message.data.containsKey('user_id')) {
return;
}

String userId = message.data['user_id'];

if ((await WPJsonAPI.wpUserLoggedIn()) != true) {
return;
}

String? currentUserId = await WPJsonAPI.wpUserId();
if (currentUserId != userId) {
return;
}

routeTo(BrowseCategoryPage.path,
data: int.parse(message.data['category_id']));
}
}
27 changes: 27 additions & 0 deletions LabelStoreMax/lib/app/forms/login_form.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import 'package:nylo_framework/nylo_framework.dart';

/* Login Form
|--------------------------------------------------------------------------
| Usage: https://nylo.dev/docs/6.x/forms#how-it-works
| Casts: https://nylo.dev/docs/6.x/forms#form-casts
| Validation Rules: https://nylo.dev/docs/6.x/validation#validation-rules
|-------------------------------------------------------------------------- */

class LoginForm extends NyFormData {
LoginForm({String? name}) : super(name ?? "login");

@override
fields() => [
Field.email(
"Email",
style: "compact",
validate: FormValidator.email(),
),
Field.password(
"Password",
style: "compact",
viewable: true,
validate: FormValidator.password(),
),
];
}
Loading

0 comments on commit 335144f

Please sign in to comment.