Skip to content

Commit

Permalink
v6.7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
agordn52 committed Jun 20, 2023
1 parent f67f486 commit 456f313
Show file tree
Hide file tree
Showing 13 changed files with 137 additions and 50 deletions.
3 changes: 2 additions & 1 deletion LabelStoreMax/.env
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,5 @@ RAZORPAY_API_KEY=""
PRODUCT_PLACEHOLDER_IMAGE="https://woosignal.com/images/woocommerce-placeholder.png"
# Sets the default placeholder image for products with no image

AUTH_USER_KEY="AUTH_USER"
AUTH_USER_KEY="AUTH_USER"
FCM_ENABLED=false
8 changes: 7 additions & 1 deletion LabelStoreMax/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## [6.7.0] - 2023-06-20

* Refactor project for Nylo 5.x.
* New Firebase provider for FCM.
* Pubspec.yaml dependency updates.

## [6.6.2] - 2023-06-14

* Page bug fixes
Expand Down Expand Up @@ -33,7 +39,7 @@
* Fix the ThemeColor.get helper method to support ColorStyles.
* Pubspec.yaml dependency updates

* ## [6.4.0] - 2023-01-06
## [6.4.0] - 2023-01-06

* Upgrade to Nylo v4.0.0
* Update copyright
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class BearerAuthInterceptor extends Interceptor {
}

@override
void onError(DioError err, ErrorInterceptorHandler handler) {
void onError(DioException err, ErrorInterceptorHandler handler) {
handler.next(err);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class LoggingInterceptor extends Interceptor {
}

@override
void onError(DioError err, ErrorInterceptorHandler handler) {
void onError(DioException err, ErrorInterceptorHandler handler) {
print(
'ERROR[${err.response?.statusCode}] => PATH: ${err.requestOptions.path}');
handler.next(err);
Expand Down
26 changes: 1 addition & 25 deletions LabelStoreMax/lib/app/providers/app_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,30 +24,6 @@ class AppProvider implements NyProvider {
await WooSignal.instance
.init(appKey: getEnv('APP_KEY'), debugMode: getEnv('APP_DEBUG'));

// Notifications
/// await Firebase.initializeApp(
/// options: DefaultFirebaseOptions.currentPlatform,
/// );
///
/// FirebaseMessaging messaging = FirebaseMessaging.instance;
///
/// NotificationSettings settings = await messaging.requestPermission(
/// alert: true,
/// announcement: false,
/// badge: true,
/// carPlay: false,
/// criticalAlert: false,
/// provisional: false,
/// sound: true,
/// );
///
/// if (settings.authorizationStatus == AuthorizationStatus.authorized) {
/// String? token = await messaging.getToken();
/// if (token != null) {
/// WooSignal.instance.setFcmToken(token);
/// }
/// }
AppHelper.instance.appConfig = WooSignalApp();
AppHelper.instance.appConfig!.themeFont = "Poppins";
AppHelper.instance.appConfig!.themeColors = {
Expand Down Expand Up @@ -124,4 +100,4 @@ class AppProvider implements NyProvider {
afterBoot(Nylo nylo) async {

}
}
}
41 changes: 41 additions & 0 deletions LabelStoreMax/lib/app/providers/firebase_provider.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import 'package:firebase_core/firebase_core.dart';
import 'package:firebase_messaging/firebase_messaging.dart';
import 'package:flutter_app/firebase_options.dart';
import 'package:nylo_framework/nylo_framework.dart';
import 'package:woosignal/woosignal.dart';

class FirebaseProvider implements NyProvider {

boot(Nylo nylo) async {

return null;
}

afterBoot(Nylo nylo) async {
if (getEnv('FCM_ENABLED') != true) return;

await Firebase.initializeApp(
options: DefaultFirebaseOptions.currentPlatform,
);

FirebaseMessaging messaging = FirebaseMessaging.instance;
NotificationSettings settings = await messaging.requestPermission(
alert: true,
announcement: false,
badge: true,
carPlay: false,
criticalAlert: false,
provisional: false,
sound: true,
);

if (settings.authorizationStatus != AuthorizationStatus.authorized) {
return;
}

String? token = await messaging.getToken();
if (token != null) {
WooSignal.instance.setFcmToken(token);
}
}
}
4 changes: 4 additions & 0 deletions LabelStoreMax/lib/config/providers.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import '/app/providers/firebase_provider.dart';
import 'package:flutter_app/app/providers/app_provider.dart';
import 'package:flutter_app/app/providers/event_provider.dart';
import 'package:flutter_app/app/providers/route_provider.dart';
Expand All @@ -17,4 +18,7 @@ final Map<Type, NyProvider> providers = {
AppProvider: AppProvider(),
RouteProvider: RouteProvider(),
EventProvider: EventProvider(),
FirebaseProvider: FirebaseProvider(),

};

4 changes: 2 additions & 2 deletions LabelStoreMax/lib/config/validation_rules.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
|--------------------------------------------------------------------------
*/

final Map<Type, dynamic> validationRules = {
final Map<String, dynamic> validationRules = {
/// Example
// SimplePassword: (attribute) => SimplePassword(attribute)
// "simple_password": (attribute) => SimplePassword(attribute)
};

/// Example validation class
Expand Down
59 changes: 59 additions & 0 deletions LabelStoreMax/lib/firebase_options.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
// ignore_for_file: lines_longer_than_80_chars, avoid_classes_with_only_static_members
import 'package:firebase_core/firebase_core.dart' show FirebaseOptions;
import 'package:flutter/foundation.dart'
show defaultTargetPlatform, kIsWeb, TargetPlatform;

/// Default [FirebaseOptions] for use with your Firebase apps.
class DefaultFirebaseOptions {
static FirebaseOptions get currentPlatform {
if (kIsWeb) {
throw UnsupportedError(
'DefaultFirebaseOptions have not been configured for web - '
'you can reconfigure this by running the FlutterFire CLI again.',
);
}
switch (defaultTargetPlatform) {
case TargetPlatform.android:
return android;
case TargetPlatform.iOS:
return ios;
case TargetPlatform.macOS:
throw UnsupportedError(
'DefaultFirebaseOptions have not been configured for macos - '
'you can reconfigure this by running the FlutterFire CLI again.',
);
case TargetPlatform.windows:
throw UnsupportedError(
'DefaultFirebaseOptions have not been configured for windows - '
'you can reconfigure this by running the FlutterFire CLI again.',
);
case TargetPlatform.linux:
throw UnsupportedError(
'DefaultFirebaseOptions have not been configured for linux - '
'you can reconfigure this by running the FlutterFire CLI again.',
);
default:
throw UnsupportedError(
'DefaultFirebaseOptions are not supported for this platform.',
);
}
}

static const FirebaseOptions android = FirebaseOptions(
apiKey: '',
appId: '',
messagingSenderId: '',
projectId: '',
storageBucket: '',
);

static const FirebaseOptions ios = FirebaseOptions(
apiKey: '',
appId: '',
messagingSenderId: '',
projectId: '',
storageBucket: '',
iosClientId: '',
iosBundleId: '',
);
}
3 changes: 2 additions & 1 deletion LabelStoreMax/lib/resources/pages/account_delete_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ class _AccountDeletePageState extends NyState<AccountDeletePage> {
PrimaryButton(
title: trans("Yes, delete my account"),
isLoading: isLocked('delete_account'),
action: _deleteAccount),
action: _deleteAccount,
),
LinkButton(title: trans("Back"), action: pop)
],
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,10 @@ class _AccountOrderDetailPageState extends NyState<AccountOrderDetailPage> {
Padding(
padding: EdgeInsets.only(top: 8),
child: Text(
"${trans("Date Ordered").capitalize()}: " +
dateFormatted(
date: _order!.dateCreated!,
formatType: formatForDateTime(FormatType.date),
),
"${trans("Date Ordered").capitalize()}: ${dateFormatted(
date: _order?.dateCreated ?? "",
formatType: formatForDateTime(FormatType.date),
)}",
),
),
Container(
Expand Down
16 changes: 8 additions & 8 deletions LabelStoreMax/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -415,10 +415,10 @@ packages:
dependency: "direct main"
description:
name: flutter_stripe
sha256: "317be4a0c5bbc02170449d62615c0667d018a16fdd43e7e8dbf7cb121ea6f5fd"
sha256: fb1a0647867a26b1fced98706ef96c664a5ae2579e29b67af5ddd054e01d83df
url: "https://pub.dev"
source: hosted
version: "9.2.1"
version: "9.2.2"
flutter_styled_toast:
dependency: transitive
description:
Expand Down Expand Up @@ -617,18 +617,18 @@ packages:
dependency: "direct main"
description:
name: nylo_framework
sha256: c60cd540f890b6f92cc9fe1345faceec31523b2616ecc22df2d536acd3396061
sha256: "905f0f013413ab07433b37aeab2ac05865dea0dc7c2cf93336b881cd5eeb32e4"
url: "https://pub.dev"
source: hosted
version: "5.0.6"
version: "5.1.0"
nylo_support:
dependency: transitive
description:
name: nylo_support
sha256: "4304c0bffabfa26592da637583e6f50215ac8d3dd6848a1c1e3b1e3d9b766702"
sha256: "7324d3fccb315619a28ce292d15f8ac1150aa6111faddbf1de991305fdf80479"
url: "https://pub.dev"
source: hosted
version: "5.2.2"
version: "5.3.0"
octo_image:
dependency: transitive
description:
Expand Down Expand Up @@ -950,10 +950,10 @@ packages:
dependency: transitive
description:
name: stripe_platform_interface
sha256: "8148f5fb15ed7fd9236559edfd72260657c03904cfe67d3ebba7eeaa20bb4261"
sha256: "321de409f41088e842140a8e8b334b1111cc6072dfb2fa9e6452155187e8ff2d"
url: "https://pub.dev"
source: hosted
version: "9.2.1"
version: "9.2.2"
synchronized:
dependency: transitive
description:
Expand Down
10 changes: 5 additions & 5 deletions LabelStoreMax/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# Official WooSignal App Template for WooCommerce

# Label StoreMax
# Version: 6.6.2
# Version: 6.7.0
# Author: Anthony Gordon
# Homepage: https://woosignal.com
# Documentation: https://woosignal.com/docs/app/label-storemax

### Change App Icon
# 1 Replace: public/assets/icon/appicon.png (1024px1024px icon size)
# 2 Run this command from the terminal: "flutter pub run flutter_launcher_icons:main"
# 2 Run this command from the terminal: "dart pub run flutter_launcher_icons:main"

### Uploading the IOS/Android app
# IOS https://flutter.dev/docs/deployment/ios
Expand All @@ -29,7 +29,7 @@ dependencies:
google_fonts: ^4.0.5
analyzer: ^5.12.0
intl: ^0.18.0
nylo_framework: ^5.0.6
nylo_framework: ^5.1.0
woosignal: ^3.5.0
wp_json_api: ^3.3.2
cached_network_image: ^3.2.3
Expand Down Expand Up @@ -60,8 +60,8 @@ dependencies:
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^1.0.5
collection: ^1.15.0
flutter_stripe: ^9.2.1
collection: ^1.17.1
flutter_stripe: ^9.2.2
razorpay_flutter: ^1.3.5

dependency_overrides:
Expand Down

0 comments on commit 456f313

Please sign in to comment.