From 621d766335e1dcafddfa2a3efeee187774352b3c Mon Sep 17 00:00:00 2001 From: bossanyit Date: Sat, 29 Oct 2022 10:01:00 +0200 Subject: [PATCH] v1.26 ios v2 --- android/app/.project | 4 +- android/app/src/main/AndroidManifest.xml | 6 + ios/Podfile.lock | 430 +++++++++--------- ios/Runner.xcodeproj/project.pbxproj | 33 +- ios/Runner/Info.plist | 14 +- .../customer_change/customer_change_bloc.dart | 53 ++- lib/bloc/exercise_new/exercise_new_bloc.dart | 4 +- lib/bloc/login/login_bloc.dart | 85 ++-- lib/bloc/menu/menu_bloc.dart | 97 ---- lib/bloc/sales/sales_bloc.dart | 6 +- lib/bloc/session/session_bloc.dart | 6 + .../training_evaluation_bloc.dart | 2 +- lib/helper/database.dart | 5 +- lib/library/button_animations.dart | 8 +- lib/library/image_cache.dart | 9 - lib/library/network_image_to_byte.dart | 1 - lib/library/tree_view.dart | 2 +- lib/main.dart | 153 +++---- lib/model/cache.dart | 8 +- lib/repository/customer_repository.dart | 4 +- lib/service/api.dart | 56 ++- lib/service/firebase_api.dart | 12 +- lib/util/purchases.dart | 3 + lib/util/track.dart | 26 +- lib/view/account.dart | 16 +- lib/view/customer_fitness_page.dart | 2 - lib/view/customer_height_page.dart | 2 - lib/view/customer_sex_page.dart | 2 - lib/view/customer_weight_page.dart | 2 - lib/view/customer_welcome_page.dart | 4 +- lib/view/exercise_control_page.dart | 4 +- lib/view/mydevelopment_muscle_page.dart | 2 +- lib/view/mydevelopment_page.dart | 15 +- lib/view/settings.dart | 15 +- lib/view/test_set_control.dart | 4 +- lib/view/training_plan_activate_page.dart | 17 +- lib/view/training_plan_execute.dart | 20 +- .../bottom_bar_multiple_exercises.dart | 2 +- lib/widgets/exercise_save.dart | 13 +- lib/widgets/home.dart | 14 +- lib/widgets/input_dialog_widget.dart | 8 +- lib/widgets/menu_page_widget.dart | 16 +- lib/widgets/tutorial_widget.dart | 6 +- lib/widgets/victory_widget.dart | 2 +- pubspec.lock | 45 +- pubspec.yaml | 9 +- test/exercise_plan_repository_test.dart | 8 +- test/widget_test.db.dart | 6 +- test/widget_test.login.dart | 4 +- test_driver/service/customer_service.dart | 7 +- 50 files changed, 593 insertions(+), 679 deletions(-) diff --git a/android/app/.project b/android/app/.project index 868265d..17da268 100644 --- a/android/app/.project +++ b/android/app/.project @@ -22,12 +22,12 @@ - 1633186029325 + 1666112134141 30 org.eclipse.core.resources.regexFilterMatcher - node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__ + node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__ diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index a9a560b..5c6a088 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -56,6 +56,12 @@ + + + + + + diff --git a/ios/Podfile.lock b/ios/Podfile.lock index fdaf45a..3c031b4 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -1,218 +1,210 @@ PODS: - - AppAuth (1.5.0): - - AppAuth/Core (= 1.5.0) - - AppAuth/ExternalUserAgent (= 1.5.0) - - AppAuth/Core (1.5.0) - - AppAuth/ExternalUserAgent (1.5.0): + - AppAuth (1.6.0): + - AppAuth/Core (= 1.6.0) + - AppAuth/ExternalUserAgent (= 1.6.0) + - AppAuth/Core (1.6.0) + - AppAuth/ExternalUserAgent (1.6.0): - AppAuth/Core - device_info_plus (0.0.1): - Flutter - devicelocale (0.0.1): - Flutter - - FBAEMKit (13.0.0): - - FBSDKCoreKit_Basics (= 13.0.0) - - FBSDKCoreKit (13.0.0): - - FBAEMKit (= 13.0.0) - - FBSDKCoreKit_Basics (= 13.0.0) - - FBSDKCoreKit_Basics (13.0.0) - - FBSDKLoginKit (13.0.0): - - FBSDKCoreKit (= 13.0.0) - - Firebase/Analytics (8.11.0): + - FBAEMKit (14.1.0): + - FBSDKCoreKit_Basics (= 14.1.0) + - FBSDKCoreKit (14.1.0): + - FBAEMKit (= 14.1.0) + - FBSDKCoreKit_Basics (= 14.1.0) + - FBSDKCoreKit_Basics (14.1.0) + - FBSDKLoginKit (14.1.0): + - FBSDKCoreKit (= 14.1.0) + - Firebase/Analytics (10.0.0): - Firebase/Core - - Firebase/Auth (8.11.0): + - Firebase/Auth (10.0.0): - Firebase/CoreOnly - - FirebaseAuth (~> 8.11.0) - - Firebase/Core (8.11.0): + - FirebaseAuth (~> 10.0.0) + - Firebase/Core (10.0.0): - Firebase/CoreOnly - - FirebaseAnalytics (~> 8.11.0) - - Firebase/CoreOnly (8.11.0): - - FirebaseCore (= 8.11.0) - - Firebase/DynamicLinks (8.11.0): + - FirebaseAnalytics (~> 10.0.0) + - Firebase/CoreOnly (10.0.0): + - FirebaseCore (= 10.0.0) + - Firebase/DynamicLinks (10.0.0): - Firebase/CoreOnly - - FirebaseDynamicLinks (~> 8.11.0) - - Firebase/InAppMessaging (8.11.0): + - FirebaseDynamicLinks (~> 10.0.0) + - Firebase/InAppMessaging (10.0.0): - Firebase/CoreOnly - - FirebaseInAppMessaging (~> 8.11.0-beta) - - Firebase/Messaging (8.11.0): + - FirebaseInAppMessaging (~> 10.0.0-beta) + - Firebase/Messaging (10.0.0): - Firebase/CoreOnly - - FirebaseMessaging (~> 8.11.0) - - Firebase/RemoteConfig (8.11.0): + - FirebaseMessaging (~> 10.0.0) + - Firebase/RemoteConfig (10.0.0): - Firebase/CoreOnly - - FirebaseRemoteConfig (~> 8.11.0) - - firebase_analytics (9.1.2): - - Firebase/Analytics (= 8.11.0) + - FirebaseRemoteConfig (~> 10.0.0) + - firebase_analytics (10.0.1): + - Firebase/Analytics (= 10.0.0) - firebase_core - Flutter - - firebase_auth (3.3.11): - - Firebase/Auth (= 8.11.0) + - firebase_auth (4.0.1): + - Firebase/Auth (= 10.0.0) - firebase_core - Flutter - - firebase_core (1.13.1): - - Firebase/CoreOnly (= 8.11.0) + - firebase_core (2.0.0): + - Firebase/CoreOnly (= 10.0.0) - Flutter - - firebase_dynamic_links (4.1.1): - - Firebase/DynamicLinks (= 8.11.0) + - firebase_dynamic_links (5.0.1): + - Firebase/DynamicLinks (= 10.0.0) - firebase_core - Flutter - - firebase_in_app_messaging (0.6.0-9): - - Firebase/InAppMessaging (= 8.11.0) + - firebase_in_app_messaging (0.7.0-1): + - Firebase/InAppMessaging (= 10.0.0) - firebase_core - Flutter - - firebase_messaging (11.2.11): - - Firebase/Messaging (= 8.11.0) + - firebase_messaging (14.0.1): + - Firebase/Messaging (= 10.0.0) - firebase_core - Flutter - - firebase_remote_config (2.0.2): - - Firebase/RemoteConfig (= 8.11.0) + - firebase_remote_config (3.0.1): + - Firebase/RemoteConfig (= 10.0.0) - firebase_core - Flutter - - FirebaseABTesting (8.14.0): - - FirebaseCore (~> 8.0) - - FirebaseAnalytics (8.11.0): - - FirebaseAnalytics/AdIdSupport (= 8.11.0) - - FirebaseCore (~> 8.0) - - FirebaseInstallations (~> 8.0) - - GoogleUtilities/AppDelegateSwizzler (~> 7.7) - - GoogleUtilities/MethodSwizzler (~> 7.7) - - GoogleUtilities/Network (~> 7.7) - - "GoogleUtilities/NSData+zlib (~> 7.7)" - - nanopb (~> 2.30908.0) - - FirebaseAnalytics/AdIdSupport (8.11.0): - - FirebaseCore (~> 8.0) - - FirebaseInstallations (~> 8.0) - - GoogleAppMeasurement (= 8.11.0) - - GoogleUtilities/AppDelegateSwizzler (~> 7.7) - - GoogleUtilities/MethodSwizzler (~> 7.7) - - GoogleUtilities/Network (~> 7.7) - - "GoogleUtilities/NSData+zlib (~> 7.7)" - - nanopb (~> 2.30908.0) - - FirebaseAuth (8.11.0): - - FirebaseCore (~> 8.0) - - GoogleUtilities/AppDelegateSwizzler (~> 7.7) - - GoogleUtilities/Environment (~> 7.7) - - GTMSessionFetcher/Core (~> 1.5) - - FirebaseCore (8.11.0): - - FirebaseCoreDiagnostics (~> 8.0) - - GoogleUtilities/Environment (~> 7.7) - - GoogleUtilities/Logger (~> 7.7) - - FirebaseCoreDiagnostics (8.14.0): - - GoogleDataTransport (~> 9.1) - - GoogleUtilities/Environment (~> 7.7) - - GoogleUtilities/Logger (~> 7.7) - - nanopb (~> 2.30908.0) - - FirebaseDynamicLinks (8.11.0): - - FirebaseCore (~> 8.0) - - FirebaseInAppMessaging (8.11.0-beta): - - FirebaseABTesting (~> 8.0) - - FirebaseCore (~> 8.0) - - FirebaseInstallations (~> 8.0) - - GoogleUtilities/Environment (~> 7.7) - - nanopb (~> 2.30908.0) - - FirebaseInstallations (8.14.0): - - FirebaseCore (~> 8.0) - - GoogleUtilities/Environment (~> 7.7) - - GoogleUtilities/UserDefaults (~> 7.7) - - PromisesObjC (< 3.0, >= 1.2) - - FirebaseMessaging (8.11.0): - - FirebaseCore (~> 8.0) - - FirebaseInstallations (~> 8.0) - - GoogleDataTransport (~> 9.1) - - GoogleUtilities/AppDelegateSwizzler (~> 7.7) - - GoogleUtilities/Environment (~> 7.7) - - GoogleUtilities/Reachability (~> 7.7) - - GoogleUtilities/UserDefaults (~> 7.7) - - nanopb (~> 2.30908.0) - - FirebaseRemoteConfig (8.11.0): - - FirebaseABTesting (~> 8.0) - - FirebaseCore (~> 8.0) - - FirebaseInstallations (~> 8.0) - - GoogleUtilities/Environment (~> 7.7) - - "GoogleUtilities/NSData+zlib (~> 7.7)" + - FirebaseABTesting (10.0.0): + - FirebaseCore (~> 10.0) + - FirebaseAnalytics (10.0.0): + - FirebaseAnalytics/AdIdSupport (= 10.0.0) + - FirebaseCore (~> 10.0) + - FirebaseInstallations (~> 10.0) + - GoogleUtilities/AppDelegateSwizzler (~> 7.8) + - GoogleUtilities/MethodSwizzler (~> 7.8) + - GoogleUtilities/Network (~> 7.8) + - "GoogleUtilities/NSData+zlib (~> 7.8)" + - nanopb (< 2.30910.0, >= 2.30908.0) + - FirebaseAnalytics/AdIdSupport (10.0.0): + - FirebaseCore (~> 10.0) + - FirebaseInstallations (~> 10.0) + - GoogleAppMeasurement (= 10.0.0) + - GoogleUtilities/AppDelegateSwizzler (~> 7.8) + - GoogleUtilities/MethodSwizzler (~> 7.8) + - GoogleUtilities/Network (~> 7.8) + - "GoogleUtilities/NSData+zlib (~> 7.8)" + - nanopb (< 2.30910.0, >= 2.30908.0) + - FirebaseAuth (10.0.0): + - FirebaseCore (~> 10.0) + - GoogleUtilities/AppDelegateSwizzler (~> 7.8) + - GoogleUtilities/Environment (~> 7.8) + - GTMSessionFetcher/Core (~> 2.1) + - FirebaseCore (10.0.0): + - FirebaseCoreInternal (~> 10.0) + - GoogleUtilities/Environment (~> 7.8) + - GoogleUtilities/Logger (~> 7.8) + - FirebaseCoreInternal (10.0.0): + - "GoogleUtilities/NSData+zlib (~> 7.8)" + - FirebaseDynamicLinks (10.0.0): + - FirebaseCore (~> 10.0) + - FirebaseInAppMessaging (10.0.0-beta): + - FirebaseABTesting (~> 10.0) + - FirebaseCore (~> 10.0) + - FirebaseInstallations (~> 10.0) + - GoogleUtilities/Environment (~> 7.8) + - nanopb (< 2.30910.0, >= 2.30908.0) + - FirebaseInstallations (10.0.0): + - FirebaseCore (~> 10.0) + - GoogleUtilities/Environment (~> 7.8) + - GoogleUtilities/UserDefaults (~> 7.8) + - PromisesObjC (~> 2.1) + - FirebaseMessaging (10.0.0): + - FirebaseCore (~> 10.0) + - FirebaseInstallations (~> 10.0) + - GoogleDataTransport (~> 9.2) + - GoogleUtilities/AppDelegateSwizzler (~> 7.8) + - GoogleUtilities/Environment (~> 7.8) + - GoogleUtilities/Reachability (~> 7.8) + - GoogleUtilities/UserDefaults (~> 7.8) + - nanopb (< 2.30910.0, >= 2.30908.0) + - FirebaseRemoteConfig (10.0.0): + - FirebaseABTesting (~> 10.0) + - FirebaseCore (~> 10.0) + - FirebaseInstallations (~> 10.0) + - GoogleUtilities/Environment (~> 7.8) + - "GoogleUtilities/NSData+zlib (~> 7.8)" - Flutter (1.0.0) - flutter_app_badger (0.0.1): - Flutter - - flutter_facebook_auth (4.1.2): - - FBSDKCoreKit (~> 13.0.0) - - FBSDKLoginKit (~> 13.0.0) + - flutter_facebook_auth (4.4.1): + - FBSDKLoginKit (= 14.1.0) - Flutter - flutter_secure_storage (3.3.1): - Flutter - - flutter_smartlook (0.0.5): + - google_sign_in_ios (0.0.1): - Flutter - - flutter_uxcam (2.0.1): - - Flutter - - UXCam (~> 3.3.6) - - FMDB (2.7.5): - - FMDB/standard (= 2.7.5) - - FMDB/standard (2.7.5) - - google_sign_in (0.0.1): - - Flutter - - GoogleSignIn (~> 5.0) - - GoogleAppMeasurement (8.11.0): - - GoogleAppMeasurement/AdIdSupport (= 8.11.0) - - GoogleUtilities/AppDelegateSwizzler (~> 7.7) - - GoogleUtilities/MethodSwizzler (~> 7.7) - - GoogleUtilities/Network (~> 7.7) - - "GoogleUtilities/NSData+zlib (~> 7.7)" - - nanopb (~> 2.30908.0) - - GoogleAppMeasurement/AdIdSupport (8.11.0): - - GoogleAppMeasurement/WithoutAdIdSupport (= 8.11.0) - - GoogleUtilities/AppDelegateSwizzler (~> 7.7) - - GoogleUtilities/MethodSwizzler (~> 7.7) - - GoogleUtilities/Network (~> 7.7) - - "GoogleUtilities/NSData+zlib (~> 7.7)" - - nanopb (~> 2.30908.0) - - GoogleAppMeasurement/WithoutAdIdSupport (8.11.0): - - GoogleUtilities/AppDelegateSwizzler (~> 7.7) - - GoogleUtilities/MethodSwizzler (~> 7.7) - - GoogleUtilities/Network (~> 7.7) - - "GoogleUtilities/NSData+zlib (~> 7.7)" - - nanopb (~> 2.30908.0) - - GoogleDataTransport (9.1.2): - - GoogleUtilities/Environment (~> 7.2) - - nanopb (~> 2.30908.0) + - GoogleSignIn (~> 6.2) + - GoogleAppMeasurement (10.0.0): + - GoogleAppMeasurement/AdIdSupport (= 10.0.0) + - GoogleUtilities/AppDelegateSwizzler (~> 7.8) + - GoogleUtilities/MethodSwizzler (~> 7.8) + - GoogleUtilities/Network (~> 7.8) + - "GoogleUtilities/NSData+zlib (~> 7.8)" + - nanopb (< 2.30910.0, >= 2.30908.0) + - GoogleAppMeasurement/AdIdSupport (10.0.0): + - GoogleAppMeasurement/WithoutAdIdSupport (= 10.0.0) + - GoogleUtilities/AppDelegateSwizzler (~> 7.8) + - GoogleUtilities/MethodSwizzler (~> 7.8) + - GoogleUtilities/Network (~> 7.8) + - "GoogleUtilities/NSData+zlib (~> 7.8)" + - nanopb (< 2.30910.0, >= 2.30908.0) + - GoogleAppMeasurement/WithoutAdIdSupport (10.0.0): + - GoogleUtilities/AppDelegateSwizzler (~> 7.8) + - GoogleUtilities/MethodSwizzler (~> 7.8) + - GoogleUtilities/Network (~> 7.8) + - "GoogleUtilities/NSData+zlib (~> 7.8)" + - nanopb (< 2.30910.0, >= 2.30908.0) + - GoogleDataTransport (9.2.0): + - GoogleUtilities/Environment (~> 7.7) + - nanopb (< 2.30910.0, >= 2.30908.0) - PromisesObjC (< 3.0, >= 1.2) - - GoogleSignIn (5.0.2): - - AppAuth (~> 1.2) - - GTMAppAuth (~> 1.0) - - GTMSessionFetcher/Core (~> 1.1) - - GoogleUtilities/AppDelegateSwizzler (7.7.0): + - GoogleSignIn (6.2.4): + - AppAuth (~> 1.5) + - GTMAppAuth (~> 1.3) + - GTMSessionFetcher/Core (< 3.0, >= 1.1) + - GoogleUtilities/AppDelegateSwizzler (7.8.0): - GoogleUtilities/Environment - GoogleUtilities/Logger - GoogleUtilities/Network - - GoogleUtilities/Environment (7.7.0): + - GoogleUtilities/Environment (7.8.0): - PromisesObjC (< 3.0, >= 1.2) - - GoogleUtilities/Logger (7.7.0): + - GoogleUtilities/Logger (7.8.0): - GoogleUtilities/Environment - - GoogleUtilities/MethodSwizzler (7.7.0): + - GoogleUtilities/MethodSwizzler (7.8.0): - GoogleUtilities/Logger - - GoogleUtilities/Network (7.7.0): + - GoogleUtilities/Network (7.8.0): - GoogleUtilities/Logger - "GoogleUtilities/NSData+zlib" - GoogleUtilities/Reachability - - "GoogleUtilities/NSData+zlib (7.7.0)" - - GoogleUtilities/Reachability (7.7.0): + - "GoogleUtilities/NSData+zlib (7.8.0)" + - GoogleUtilities/Reachability (7.8.0): - GoogleUtilities/Logger - - GoogleUtilities/UserDefaults (7.7.0): + - GoogleUtilities/UserDefaults (7.8.0): - GoogleUtilities/Logger - - GTMAppAuth (1.2.3): - - AppAuth/Core (~> 1.4) - - GTMSessionFetcher/Core (~> 1.5) - - GTMSessionFetcher/Core (1.7.1) + - GTMAppAuth (1.3.1): + - AppAuth/Core (~> 1.6) + - GTMSessionFetcher/Core (< 3.0, >= 1.5) + - GTMSessionFetcher/Core (2.1.0) - modal_progress_hud_nsn (0.0.1): - Flutter - - nanopb (2.30908.0): - - nanopb/decode (= 2.30908.0) - - nanopb/encode (= 2.30908.0) - - nanopb/decode (2.30908.0) - - nanopb/encode (2.30908.0) + - nanopb (2.30909.0): + - nanopb/decode (= 2.30909.0) + - nanopb/encode (= 2.30909.0) + - nanopb/decode (2.30909.0) + - nanopb/encode (2.30909.0) - package_info (0.0.1): - Flutter - package_info_plus (0.4.5): - Flutter - path_provider_ios (0.0.1): - Flutter - - PromisesObjC (2.1.0) + - PostHog (1.4.4) + - posthog_flutter (0.0.1): + - Flutter + - PostHog (~> 1.0) + - PromisesObjC (2.1.1) - Purchases (3.13.2): - PurchasesCoreSwift (= 3.13.2) - purchases_flutter (3.9.5): @@ -221,25 +213,21 @@ PODS: - PurchasesCoreSwift (3.13.2) - PurchasesHybridCommon (1.11.2): - Purchases (= 3.13.2) - - Sentry (7.10.2): - - Sentry/Core (= 7.10.2) - - Sentry/Core (7.10.2) + - Sentry (7.28.0): + - Sentry/Core (= 7.28.0) + - Sentry/Core (7.28.0) - sentry_flutter (0.0.1): - Flutter - FlutterMacOS - - Sentry (~> 7.10.1) + - Sentry (~> 7.28.0) - share (0.0.1): - Flutter - shared_preferences_ios (0.0.1): - Flutter - sign_in_with_apple (0.0.1): - Flutter - - sqflite (0.0.2): - - Flutter - - FMDB (>= 2.7.5) - url_launcher_ios (0.0.1): - Flutter - - UXCam (3.3.9) - video_player_avfoundation (0.0.1): - Flutter - wakelock (0.0.1): @@ -261,19 +249,17 @@ DEPENDENCIES: - flutter_app_badger (from `.symlinks/plugins/flutter_app_badger/ios`) - flutter_facebook_auth (from `.symlinks/plugins/flutter_facebook_auth/ios`) - flutter_secure_storage (from `.symlinks/plugins/flutter_secure_storage/ios`) - - flutter_smartlook (from `.symlinks/plugins/flutter_smartlook/ios`) - - flutter_uxcam (from `.symlinks/plugins/flutter_uxcam/ios`) - - google_sign_in (from `.symlinks/plugins/google_sign_in/ios`) + - google_sign_in_ios (from `.symlinks/plugins/google_sign_in_ios/ios`) - modal_progress_hud_nsn (from `.symlinks/plugins/modal_progress_hud_nsn/ios`) - package_info (from `.symlinks/plugins/package_info/ios`) - package_info_plus (from `.symlinks/plugins/package_info_plus/ios`) - path_provider_ios (from `.symlinks/plugins/path_provider_ios/ios`) + - posthog_flutter (from `.symlinks/plugins/posthog_flutter/ios`) - purchases_flutter (from `.symlinks/plugins/purchases_flutter/ios`) - sentry_flutter (from `.symlinks/plugins/sentry_flutter/ios`) - share (from `.symlinks/plugins/share/ios`) - shared_preferences_ios (from `.symlinks/plugins/shared_preferences_ios/ios`) - sign_in_with_apple (from `.symlinks/plugins/sign_in_with_apple/ios`) - - sqflite (from `.symlinks/plugins/sqflite/ios`) - url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`) - video_player_avfoundation (from `.symlinks/plugins/video_player_avfoundation/ios`) - wakelock (from `.symlinks/plugins/wakelock/ios`) @@ -291,13 +277,12 @@ SPEC REPOS: - FirebaseAnalytics - FirebaseAuth - FirebaseCore - - FirebaseCoreDiagnostics + - FirebaseCoreInternal - FirebaseDynamicLinks - FirebaseInAppMessaging - FirebaseInstallations - FirebaseMessaging - FirebaseRemoteConfig - - FMDB - GoogleAppMeasurement - GoogleDataTransport - GoogleSignIn @@ -305,12 +290,12 @@ SPEC REPOS: - GTMAppAuth - GTMSessionFetcher - nanopb + - PostHog - PromisesObjC - Purchases - PurchasesCoreSwift - PurchasesHybridCommon - Sentry - - UXCam EXTERNAL SOURCES: device_info_plus: @@ -339,12 +324,8 @@ EXTERNAL SOURCES: :path: ".symlinks/plugins/flutter_facebook_auth/ios" flutter_secure_storage: :path: ".symlinks/plugins/flutter_secure_storage/ios" - flutter_smartlook: - :path: ".symlinks/plugins/flutter_smartlook/ios" - flutter_uxcam: - :path: ".symlinks/plugins/flutter_uxcam/ios" - google_sign_in: - :path: ".symlinks/plugins/google_sign_in/ios" + google_sign_in_ios: + :path: ".symlinks/plugins/google_sign_in_ios/ios" modal_progress_hud_nsn: :path: ".symlinks/plugins/modal_progress_hud_nsn/ios" package_info: @@ -353,6 +334,8 @@ EXTERNAL SOURCES: :path: ".symlinks/plugins/package_info_plus/ios" path_provider_ios: :path: ".symlinks/plugins/path_provider_ios/ios" + posthog_flutter: + :path: ".symlinks/plugins/posthog_flutter/ios" purchases_flutter: :path: ".symlinks/plugins/purchases_flutter/ios" sentry_flutter: @@ -363,8 +346,6 @@ EXTERNAL SOURCES: :path: ".symlinks/plugins/shared_preferences_ios/ios" sign_in_with_apple: :path: ".symlinks/plugins/sign_in_with_apple/ios" - sqflite: - :path: ".symlinks/plugins/sqflite/ios" url_launcher_ios: :path: ".symlinks/plugins/url_launcher_ios/ios" video_player_avfoundation: @@ -375,63 +356,60 @@ EXTERNAL SOURCES: :path: ".symlinks/plugins/webview_flutter_wkwebview/ios" SPEC CHECKSUMS: - AppAuth: 80317d99ac7ff2801a2f18ff86b48cd315ed465d + AppAuth: 8fca6b5563a5baef2c04bee27538025e4ceb2add device_info_plus: e5c5da33f982a436e103237c0c85f9031142abed devicelocale: b22617f40038496deffba44747101255cee005b0 - FBAEMKit: 11a0bcdc7a88e26ed764bcf56372afc6cbbbdcd9 - FBSDKCoreKit: 00e1e751257e1005304fa29cb683d2dfe008f41a - FBSDKCoreKit_Basics: 96ec2ddb67a032e54f0754ea3d59db6f84f42389 - FBSDKLoginKit: 66ff4ddf372d9c3fc360e65ae048a47a482c29b9 - Firebase: 44dd9724c84df18b486639e874f31436eaa9a20c - firebase_analytics: 20841ef6a705a412c737deb2fe98290e9242d323 - firebase_auth: bdfbd5b10da1db6d5eb6ae7dbda5d81365b9cc9d - firebase_core: 08f6a85f62060111de5e98d6a214810d11365de9 - firebase_dynamic_links: 1b6e3aeb743c0a0df1dab3543bd9dec6aab4de58 - firebase_in_app_messaging: 5937abf8acacbe3d35123a4c845ccf9d1669d7ed - firebase_messaging: 4a993bb4aa1a83349988d853c637fbb0494dab15 - firebase_remote_config: 588bafe2eff61076e53b018758ec1fa96893e3c3 - FirebaseABTesting: aaa0e096c9fc9972ce6806d596e8fcc077d4371f - FirebaseAnalytics: 4e4b13031034e6561ed3bd1d47b6fdabbd6487c6 - FirebaseAuth: d96d73aba85d192d7a7aa0b86dd6d7f8ec170b4b - FirebaseCore: 2f4f85b453cc8fea4bb2b37e370007d2bcafe3f0 - FirebaseCoreDiagnostics: fd0c8490f34287229c1d6c103d3a55f81ec85712 - FirebaseDynamicLinks: f506c83eb7eba0f9861f84cd6b65c38b3bd5ff6f - FirebaseInAppMessaging: 68586d72d5411b2dfaeb02461c2cd8d9f96a771a - FirebaseInstallations: 7d1d967a307c12f1aadd76844fc321cef699b1ce - FirebaseMessaging: 02e248e8997f71fa8cc9d78e9d49ec1a701ba14a - FirebaseRemoteConfig: a6a1ce9dabf404817ae2a44e8421d276660d9091 - Flutter: 50d75fe2f02b26cc09d224853bb45737f8b3214a + FBAEMKit: a899515e45476027f73aef377b5cffadcd56ca3a + FBSDKCoreKit: 24f8bc8d3b5b2a8c5c656a1329492a12e8efa792 + FBSDKCoreKit_Basics: 6e578c9bdc7aa1365dbbbde633c9ebb536bcaa98 + FBSDKLoginKit: 787de205d524c3a4b17d527916f1d066e4361660 + Firebase: 1b810f3d0c0532e27a48f1961f8c0400a668a2cf + firebase_analytics: 8f6874ecf36f61797835ed99d7a792d3a212b026 + firebase_auth: 62015b6cbfccf40521d7f777c804d19f9bc6f922 + firebase_core: f9febc855bab615ea02dc9a75b6932364edb1225 + firebase_dynamic_links: 37282d0148b844b34d09a9aba54bfa72eada9377 + firebase_in_app_messaging: 3ec946b7cf90c3fb0257e1e8155180d6dbf644f7 + firebase_messaging: a39df674ecaffd962658a9de3182d735b6cee0d7 + firebase_remote_config: 11eee0656374e6ef595f36e49d904ddc209b4523 + FirebaseABTesting: 5a08a4d3060b7fb5638f60698bc2cb57996bcc73 + FirebaseAnalytics: 9921a52739f4ab66099da31b6e0243db78a3ac0a + FirebaseAuth: 493382cf533cc45e2862b00e9aa4cfe4c98daf71 + FirebaseCore: 97f48a3a567a72b8d4daa0f03c3aadb78df4e995 + FirebaseCoreInternal: 5eb3960335da5ea30115d57d39db6988c4ad06f3 + FirebaseDynamicLinks: 37dcd9f082b9c5ea9eb5826e82aef58bbd6fd5c1 + FirebaseInAppMessaging: 07aafacbb74228af034fb1c8885d25045a25d510 + FirebaseInstallations: 7f1c9ae6bd9df6abe9c74124b38fa8740aba5df4 + FirebaseMessaging: 8916bf5edb1dbfac74665a181e4d1ab3a78a08a2 + FirebaseRemoteConfig: e4431ddba74ddf705e2aabd7d356a23d5b802853 + Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854 flutter_app_badger: 65de4d6f0c34a891df49e6cfb8a1c0496426fa68 - flutter_facebook_auth: c0a8473f857cf44b0a27bfe752facf1d5fedd863 + flutter_facebook_auth: 361ac7a57263ebf327f26089507ead0d66558ee8 flutter_secure_storage: 7953c38a04c3fdbb00571bcd87d8e3b5ceb9daec - flutter_smartlook: 2aa304f6a38fc22b741ca750e0078606582525ae - flutter_uxcam: 32e4e8b4355be6bf9d512ad36aed6d86c98a5cdf - FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a - google_sign_in: f669f45933dad48cd218dc3e189726bced3d19f4 - GoogleAppMeasurement: aa3cb422fab2b05d2efac543a5720d1a85b9dea5 - GoogleDataTransport: 629c20a4d363167143f30ea78320d5a7eb8bd940 - GoogleSignIn: 7137d297ddc022a7e0aa4619c86d72c909fa7213 - GoogleUtilities: e0913149f6b0625b553d70dae12b49fc62914fd1 - GTMAppAuth: 987526d41b07efb1bedda5e936fe0cb718a03113 - GTMSessionFetcher: 4577a4cc914a5a07c40a8a0ad0acc22080418c2d + google_sign_in_ios: 4f85eb9f937450765c8573bb85fd8cd6a5af675c + GoogleAppMeasurement: 7e48a3249792ac35d6f18f107f63f199a7e9d0ce + GoogleDataTransport: 1c8145da7117bd68bbbed00cf304edb6a24de00f + GoogleSignIn: 5651ce3a61e56ca864160e79b484cd9ed3f49b7a + GoogleUtilities: 1d20a6ad97ef46f67bbdec158ce00563a671ebb7 + GTMAppAuth: 0ff230db599948a9ad7470ca667337803b3fc4dd + GTMSessionFetcher: ffbb25ec00ebcb5201adab0a56d808f6f1902d9f modal_progress_hud_nsn: f6fb744cd060653d66ed8f325360ef3650eb2fde - nanopb: a0ba3315591a9ae0a16a309ee504766e90db0c96 + nanopb: b552cce312b6c8484180ef47159bc0f65a1f0431 package_info: 873975fc26034f0b863a300ad47e7f1ac6c7ec62 package_info_plus: 6c92f08e1f853dc01228d6f553146438dafcd14e path_provider_ios: 14f3d2fd28c4fdb42f44e0f751d12861c43cee02 - PromisesObjC: 99b6f43f9e1044bd87a95a60beff28c2c44ddb72 + PostHog: 4b6321b521569092d4ef3a02238d9435dbaeb99f + posthog_flutter: e5bed2753b8c124158530724e30232998aaf9137 + PromisesObjC: ab77feca74fa2823e7af4249b8326368e61014cb Purchases: 03200de9288724e77de435000d1828601e6b8e00 purchases_flutter: cf2b742f12b7ffef6f618c7f1ba1961e652825b1 PurchasesCoreSwift: 2ea4b33e5cece5c8a0751594ef7c6cbfcbd747a9 PurchasesHybridCommon: 56ef42d85c3e930d49aff4ac5fa027373d2e1bb8 - Sentry: 7bf9bfe713692cf87812e55f0999260494ba7982 - sentry_flutter: 77ccdac346608b8ce7e428e7284e7a3e4e7f4a02 + Sentry: 2c6053e4cfe6dea6608135dea1928ffbb4ecfba5 + sentry_flutter: fad3ef0917dc1afa7d242af0743696ed9a9a8864 share: 0b2c3e82132f5888bccca3351c504d0003b3b410 shared_preferences_ios: 548a61f8053b9b8a49ac19c1ffbc8b92c50d68ad sign_in_with_apple: f3bf75217ea4c2c8b91823f225d70230119b8440 - sqflite: 6d358c025f5b867b29ed92fc697fd34924e11904 url_launcher_ios: 839c58cdb4279282219f5e248c3321761ff3c4de - UXCam: fb294bf954e708fc308a645ae65bb967cac0760e video_player_avfoundation: e489aac24ef5cf7af82702979ed16f2a5ef84cff wakelock: d0fc7c864128eac40eba1617cb5264d9c940b46f webview_flutter_wkwebview: 005fbd90c888a42c5690919a1527ecc6649e1162 diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index aa1d37a..47ace6a 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -160,7 +160,6 @@ 9705A1C41CF9048500538489 /* Embed Frameworks */, 3B06AD1E1E4923F5004D2608 /* Thin Binary */, EB0A62903CC30EC853FC7908 /* [CP] Embed Pods Frameworks */, - C1BA2CB9D651F269CCBE06B3 /* [CP] Copy Pods Resources */, ); buildRules = ( ); @@ -270,23 +269,6 @@ shellPath = /bin/sh; shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; }; - C1BA2CB9D651F269CCBE06B3 /* [CP] Copy Pods Resources */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-input-files.xcfilelist", - ); - name = "[CP] Copy Pods Resources"; - outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-output-files.xcfilelist", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n"; - showEnvVarsInLog = 0; - }; EB0A62903CC30EC853FC7908 /* [CP] Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -388,7 +370,9 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; - CURRENT_PROJECT_VERSION = 1; + CODE_SIGN_IDENTITY = "Apple Development"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 2; DEVELOPMENT_TEAM = SFJJBDCU6Z; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( @@ -408,6 +392,7 @@ MARKETING_VERSION = 1.1.26; PRODUCT_BUNDLE_IDENTIFIER = com.aitrainer.app; PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = 1; @@ -531,7 +516,9 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; - CURRENT_PROJECT_VERSION = 1; + CODE_SIGN_IDENTITY = "Apple Development"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 2; DEVELOPMENT_TEAM = SFJJBDCU6Z; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( @@ -551,6 +538,7 @@ MARKETING_VERSION = 1.1.26; PRODUCT_BUNDLE_IDENTIFIER = com.aitrainer.app; PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 5.0; @@ -566,7 +554,9 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; - CURRENT_PROJECT_VERSION = 1; + CODE_SIGN_IDENTITY = "Apple Development"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 2; DEVELOPMENT_TEAM = SFJJBDCU6Z; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( @@ -586,6 +576,7 @@ MARKETING_VERSION = 1.1.26; PRODUCT_BUNDLE_IDENTIFIER = com.aitrainer.app; PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = 1; diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist index 0d57025..3602e11 100644 --- a/ios/Runner/Info.plist +++ b/ios/Runner/Info.plist @@ -2,6 +2,8 @@ + CADisableMinimumFrameDurationOnPhone + CFBundleDevelopmentRegion $(DEVELOPMENT_LANGUAGE) CFBundleExecutable @@ -38,10 +40,10 @@ TRUE FacebookAppID 584181112271127 - FacebookClientToken - 60d565f451ce32de3d7eeb26274bbddd FacebookAutoLogAppEventsEnabled TRUE + FacebookClientToken + 60d565f451ce32de3d7eeb26274bbddd FacebookDisplayName Workout Test FirebaseAppDelegateProxyEnabled @@ -98,5 +100,13 @@ UIViewControllerBasedStatusBarAppearance + + com.posthog.posthog.API_KEY + phc_ATsS8RRdgzDdKpDSPYEYpYxWjfZ4QPMHHnoLbSaTZ2Q + com.posthog.posthog.POSTHOG_HOST + https://posthog.workouttest.org + com.posthog.posthog.TRACK_APPLICATION_LIFECYCLE_EVENTS + + diff --git a/lib/bloc/customer_change/customer_change_bloc.dart b/lib/bloc/customer_change/customer_change_bloc.dart index 2867071..8da966a 100644 --- a/lib/bloc/customer_change/customer_change_bloc.dart +++ b/lib/bloc/customer_change/customer_change_bloc.dart @@ -133,25 +133,28 @@ class CustomerChangeBloc extends Bloc void _onSaveFitness(CustomerSaveFitness event, Emitter emit) { emit(CustomerChangeLoading()); if (customerRepository.customer!.fitnessLevel == null) { - throw Exception("Please select your fitness level"); + emit(CustomerSaveError(message: "Please selectyour fitness level")); + } else { + emit(CustomerSaveSuccess()); } - emit(CustomerSaveSuccess()); } void _onSaveGoal(CustomerSaveGoal event, Emitter emit) { emit(CustomerChangeLoading()); if (customerRepository.customer!.goal == null) { - throw Exception("Please select your goal"); + emit(CustomerSaveError(message: "Please select your goal")); + } else { + emit(CustomerSaveSuccess()); } - emit(CustomerSaveSuccess()); } void _onSaveSex(CustomerSaveSex event, Emitter emit) { emit(CustomerChangeLoading()); if (customerRepository.customer!.sex == null) { - throw Exception("Please select your biologial gender"); + emit(CustomerSaveError(message: "Please selectyour biological gender")); + } else { + emit(CustomerSaveSuccess()); } - emit(CustomerSaveSuccess()); } void _onSaveWeight(CustomerSaveWeight event, Emitter emit) { @@ -166,25 +169,29 @@ class CustomerChangeBloc extends Bloc void _onSave(CustomerSave event, Emitter emit) async { emit(CustomerSaving()); - if (validation()) { - if (selectedFitnessItem != null) { - customerRepository.setFitnessLevel(selectedFitnessItem!); - } - if (selectedSport != null) { - customerRepository.customer!.sportId = selectedSport!.sportId; - } + try { + if (validation()) { + if (selectedFitnessItem != null) { + customerRepository.setFitnessLevel(selectedFitnessItem!); + } + if (selectedSport != null) { + customerRepository.customer!.sportId = selectedSport!.sportId; + } - if (customerRepository.customer!.lang == null) { - customerRepository.customer!.lang = AppLanguage().appLocal.languageCode; - } + if (customerRepository.customer!.lang == null) { + customerRepository.customer!.lang = AppLanguage().appLocal.languageCode; + } - await customerRepository.saveCustomer(); - MauticRepository mauticRepository = MauticRepository(customerRepository: customerRepository); - await mauticRepository.sendMauticDataChange(); - Cache().initBadges(); - emit(CustomerSaveSuccess()); - } else { - emit(CustomerSaveError(message: "Please provide the necessary information")); + await customerRepository.saveCustomer(); + MauticRepository mauticRepository = MauticRepository(customerRepository: customerRepository); + await mauticRepository.sendMauticDataChange(); + Cache().initBadges(); + emit(CustomerSaveSuccess()); + } else { + emit(CustomerSaveError(message: "Please provide the necessary information")); + } + } on Exception catch (e) { + emit(CustomerSaveError(message: e.toString())); } } diff --git a/lib/bloc/exercise_new/exercise_new_bloc.dart b/lib/bloc/exercise_new/exercise_new_bloc.dart index f13af79..53e4e6e 100644 --- a/lib/bloc/exercise_new/exercise_new_bloc.dart +++ b/lib/bloc/exercise_new/exercise_new_bloc.dart @@ -182,7 +182,7 @@ class ExerciseNewBloc extends Bloc with Logg menuBloc.add(MenuTreeDown(parent: 0)); Cache().initBadges(); Track().track(TrackingEvent.exercise_new, eventValue: exerciseRepository.exerciseType!.name); - emit(ExerciseNewReady()); + emit(ExerciseNewSaved()); } void _onSubmitNoRegistration(ExerciseNewSubmitNoRegistration event, Emitter emit) async { @@ -190,7 +190,7 @@ class ExerciseNewBloc extends Bloc with Logg exerciseRepository.addExerciseNoRegistration(); menuBloc.add(MenuTreeDown(parent: 0)); Track().track(TrackingEvent.exercise_new_no_registration, eventValue: exerciseRepository.exerciseType!.name); - emit(ExerciseNewReady()); + emit(ExerciseNewSaved()); } void _onBMIAnimate(ExerciseNewBMIAnimate event, Emitter emit) async { diff --git a/lib/bloc/login/login_bloc.dart b/lib/bloc/login/login_bloc.dart index a0dfa7d..dd6e5d1 100644 --- a/lib/bloc/login/login_bloc.dart +++ b/lib/bloc/login/login_bloc.dart @@ -93,7 +93,7 @@ class LoginBloc extends Bloc with Trans { accountBloc.add(AccountLogInFinished(customer: Cache().userLoggedIn!)); Track().track(TrackingEvent.login, eventValue: "email"); Cache().setLoginType(LoginType.email); - } on Exception catch(e) { + } on Exception catch (e) { emit(LoginError(message: e.toString())); } finally { emit(LoginSuccess()); @@ -107,7 +107,7 @@ class LoginBloc extends Bloc with Trans { await userRepository.getUserByFB(); accountBloc.add(AccountLogInFinished(customer: Cache().userLoggedIn!)); Track().track(TrackingEvent.login, eventValue: "FB"); - } on Exception catch(e) { + } on Exception catch (e) { emit(LoginError(message: e.toString())); } finally { emit(LoginSuccess()); @@ -121,8 +121,7 @@ class LoginBloc extends Bloc with Trans { await userRepository.getUserByGoogle(); accountBloc.add(AccountLogInFinished(customer: Cache().userLoggedIn!)); Track().track(TrackingEvent.login, eventValue: "Google"); - - } on Exception catch(e) { + } on Exception catch (e) { emit(LoginError(message: e.toString())); } finally { emit(LoginSuccess()); @@ -136,7 +135,7 @@ class LoginBloc extends Bloc with Trans { await userRepository.getUserByApple(); accountBloc.add(AccountLogInFinished(customer: Cache().userLoggedIn!)); Track().track(TrackingEvent.login, eventValue: "Apple"); - } on Exception catch(e) { + } on Exception catch (e) { emit(LoginError(message: e.toString())); } finally { emit(LoginSuccess()); @@ -145,47 +144,67 @@ class LoginBloc extends Bloc with Trans { void _onRegistrationSubmit(RegistrationSubmit event, Emitter emit) async { emit(LoginLoading()); - final String? validationError = this.validate(); - if (validationError != null) { - emit(LoginError(message: validationError)); - } else { - await userRepository.addUser(); - accountBloc.add(AccountLogInFinished(customer: Cache().userLoggedIn!)); - customerRepository!.customer!.emailSubscription = emailSubscription == true ? 1 : 0; - await afterRegistration("email"); - Cache().setLoginType(LoginType.email); + try { + final String? validationError = this.validate(); + if (validationError != null) { + emit(LoginError(message: validationError)); + } else { + await userRepository.addUser(); + accountBloc.add(AccountLogInFinished(customer: Cache().userLoggedIn!)); + customerRepository!.customer!.emailSubscription = emailSubscription == true ? 1 : 0; + await afterRegistration("email"); + Cache().setLoginType(LoginType.email); + } + } on Exception catch (e) { + emit(LoginError(message: e.toString())); + } finally { + emit(LoginSuccess()); } - emit(LoginSuccess()); } void _onRegistrationFB(RegistrationFB event, Emitter emit) async { emit(LoginLoading()); - Cache().setLoginType(LoginType.fb); - await userRepository.addUserFB(); - accountBloc.add(AccountLogInFinished(customer: Cache().userLoggedIn!)); - customerRepository!.customer!.emailSubscription = emailSubscription == true ? 1 : 0; - await afterRegistration("FB"); - emit(LoginSuccess()); + try { + Cache().setLoginType(LoginType.fb); + await userRepository.addUserFB(); + accountBloc.add(AccountLogInFinished(customer: Cache().userLoggedIn!)); + customerRepository!.customer!.emailSubscription = emailSubscription == true ? 1 : 0; + await afterRegistration("FB"); + } on Exception catch (e) { + emit(LoginError(message: e.toString())); + } finally { + emit(LoginSuccess()); + } } void _onRegistrationGoogle(RegistrationGoogle event, Emitter emit) async { emit(LoginLoading()); - Cache().setLoginType(LoginType.google); - await userRepository.addUserGoogle(); - accountBloc.add(AccountLogInFinished(customer: Cache().userLoggedIn!)); - customerRepository!.customer!.emailSubscription = emailSubscription == true ? 1 : 0; - await afterRegistration("Google"); - emit(LoginSuccess()); + try { + Cache().setLoginType(LoginType.google); + await userRepository.addUserGoogle(); + accountBloc.add(AccountLogInFinished(customer: Cache().userLoggedIn!)); + customerRepository!.customer!.emailSubscription = emailSubscription == true ? 1 : 0; + await afterRegistration("Google"); + } on Exception catch (e) { + emit(LoginError(message: e.toString())); + } finally { + emit(LoginSuccess()); + } } void _onRegistrationApple(RegistrationApple event, Emitter emit) async { emit(LoginLoading()); - Cache().setLoginType(LoginType.apple); - await userRepository.addUserApple(); - accountBloc.add(AccountLogInFinished(customer: Cache().userLoggedIn!)); - customerRepository!.customer!.emailSubscription = emailSubscription == true ? 1 : 0; - await afterRegistration("Apple"); - emit(LoginSuccess()); + try { + Cache().setLoginType(LoginType.apple); + await userRepository.addUserApple(); + accountBloc.add(AccountLogInFinished(customer: Cache().userLoggedIn!)); + customerRepository!.customer!.emailSubscription = emailSubscription == true ? 1 : 0; + await afterRegistration("Apple"); + } on Exception catch (e) { + emit(LoginError(message: e.toString())); + } finally { + emit(LoginSuccess()); + } } void _onDataProtectionClicked(DataProtectionClicked event, Emitter emit) async { diff --git a/lib/bloc/menu/menu_bloc.dart b/lib/bloc/menu/menu_bloc.dart index ba4f2d9..4e69e05 100644 --- a/lib/bloc/menu/menu_bloc.dart +++ b/lib/bloc/menu/menu_bloc.dart @@ -113,103 +113,6 @@ class MenuBloc extends Bloc with Trans, Logging { this.context = context; } - /* @override - Stream mapEventToState( - MenuEvent event, - ) async* { - try { - if (event is MenuCreate) { - yield MenuLoading(); - //await menuTreeRepository.createTree(); - //menuTreeRepository.getBranch(this.parent); - //setMenuInfo(); - if (Cache().getDevices() != null) { - exerciseDeviceRepository.setDevices(Cache().getDevices()!); - } - yield MenuReady(); - } else if (event is MenuRecreateTree) { - yield MenuLoading(); - // ie. at language changes - menuTreeRepository.createTree(); - yield MenuReady(); - } else if (event is MenuTreeDown) { - yield MenuLoading(); - parent = event.parent; - workoutItem = event.item; - - if (workoutItem != null) { - setAbility(workoutItem!.internalName); - } - final LinkedHashMap branch = menuTreeRepository.getBranch(event.parent); - - await getImages(branch); - yield MenuReady(); - } else if (event is MenuTreeUp) { - yield MenuLoading(); - // get parent menus or exercises - parent = event.parent; - workoutItem = menuTreeRepository.getParentItem(parent); - - LinkedHashMap branch; - if (workoutItem != null) { - setAbility(workoutItem!.internalName); - branch = menuTreeRepository.getBranch(workoutItem!.parent); - await getImages(branch); - } - - yield MenuReady(); - } else if (event is MenuTreeJump) { - yield MenuLoading(); - parent = event.parent; - workoutItem = menuTreeRepository.getParentItem(parent); - - if (workoutItem != null) { - setAbility(workoutItem!.internalName); - } - final LinkedHashMap branch = menuTreeRepository.getBranch(workoutItem!.parent); - await getImages(branch); - - yield MenuReady(); - } else if (event is MenuClickExercise) { - yield MenuLoading(); - // get exercise page - yield MenuReady(); - } else if (event is MenuFilterExerciseType) { - yield MenuLoading(); - final int deviceId = event.deviceId; - if (selectedDevice(deviceId)) { - listFilterDevice.add(deviceId); - } else { - listFilterDevice.remove(deviceId); - } - yield MenuReady(); - } else if (event is MenuStartTrial) { - yield MenuLoading(); - final DateTime start = event.start; - CustomerRepository customerRepository = CustomerRepository(); - customerRepository.customer = Cache().userLoggedIn; - customerRepository.customer!.trialDate = start; - Cache().userLoggedIn!.trialDate = start; - - customerRepository.saveCustomer(); - - if (DateTime.now().difference(start).inHours < 1) { - Cache().hasPurchased = true; - log("Trial mode on!"); - Track().track(TrackingEvent.trial, eventValue: DateFormat('yyyy-MM-dd HH:mm:ss').format(start)); - - if (!isInDebugMode) { - MauticRepository mauticRepository = MauticRepository(customerRepository: customerRepository); - await mauticRepository.sendMauticTrial(); - } - } - yield MenuReady(); - } - } on Exception catch (ex) { - yield MenuError(message: ex.toString()); - } - } */ - void setAbility(String name) { switch (name) { case "one_rep_max": diff --git a/lib/bloc/sales/sales_bloc.dart b/lib/bloc/sales/sales_bloc.dart index 96a351b..3da9751 100644 --- a/lib/bloc/sales/sales_bloc.dart +++ b/lib/bloc/sales/sales_bloc.dart @@ -161,10 +161,10 @@ class SalesBloc extends Bloc with Logging { return; } - String productSetString = splitTestRepository.getSplitTestValue("product_set_5"); - log("ProductSetString: $productSetString"); + //String productSetString = splitTestRepository.getSplitTestValue("product_set_5"); + //log("ProductSetString: $productSetString"); try { - productSet = int.parse(productSetString); + productSet = 5; } on Exception catch (e) { log("Define the right productset! $e"); productSet = 2; diff --git a/lib/bloc/session/session_bloc.dart b/lib/bloc/session/session_bloc.dart index 12bc495..80ef64c 100644 --- a/lib/bloc/session/session_bloc.dart +++ b/lib/bloc/session/session_bloc.dart @@ -7,6 +7,7 @@ import 'package:aitrainer_app/service/logging.dart'; import 'package:aitrainer_app/util/session.dart'; import 'package:bloc/bloc.dart'; import 'package:equatable/equatable.dart'; +import 'package:upgrader/upgrader.dart'; part 'session_event.dart'; part 'session_state.dart'; @@ -30,6 +31,11 @@ class SessionBloc extends Bloc with Logging { String lang = AppLanguage().appLocal.languageCode; log("Change lang to $lang"); settingsBloc!.add(SettingsChangeLanguage(language: lang)); + final iTunes = ITunesSearchAPI(); + final resultsFuture = iTunes.lookupByBundleId('com.aitrainer.app'); + resultsFuture.then((results) { + print('iTunes results: $results'); + }); emit(SessionReady()); } diff --git a/lib/bloc/training_evaluation/training_evaluation_bloc.dart b/lib/bloc/training_evaluation/training_evaluation_bloc.dart index 083197a..8ecb1e3 100644 --- a/lib/bloc/training_evaluation/training_evaluation_bloc.dart +++ b/lib/bloc/training_evaluation/training_evaluation_bloc.dart @@ -17,7 +17,7 @@ class TrainingEvaluationBloc extends Bloc(_onLoad); + on(_onLoad); } String duration = "-"; diff --git a/lib/helper/database.dart b/lib/helper/database.dart index 63d8768..1c93ef9 100644 --- a/lib/helper/database.dart +++ b/lib/helper/database.dart @@ -1,5 +1,5 @@ -import 'dart:io'; - +//import 'dart:io'; +/* import 'package:sqflite/sqflite.dart'; class DB { @@ -35,3 +35,4 @@ class DB { Database getDB() => this._db; } +*/ \ No newline at end of file diff --git a/lib/library/button_animations.dart b/lib/library/button_animations.dart index 4b8d63c..7204e3b 100644 --- a/lib/library/button_animations.dart +++ b/lib/library/button_animations.dart @@ -121,7 +121,7 @@ class AnimatedButton extends StatefulWidget { this.borderWidth = 1, this.blurColor = Colors.black, this.shadowColor, - }) : super(key: key); + }) : super(key: key); @override _AnimatedButtonState createState() => _AnimatedButtonState( @@ -145,7 +145,7 @@ class _AnimatedButtonState extends State { _AnimatedButtonState({ this.type, this.color, - this.shadowColor, + //this.shadowColor, this.borderColor, this.blurColor, }); @@ -159,14 +159,14 @@ class _AnimatedButtonState extends State { int index = type!.index; setState(() { color = definedColors[index]["color"]; - shadowColor = definedColors[index]["shadowColor"]; + //shadowColor = definedColors[index]["shadowColor"]; blurColor = definedColors[index]["blurColor"]; borderColor = definedColors[index]["borderColor"]; }); } else { setState(() { color = widget.color; - shadowColor = widget.shadowColor; + //shadowColor = widget.shadowColor; blurColor = widget.blurColor; borderColor = widget.borderColor; }); diff --git a/lib/library/image_cache.dart b/lib/library/image_cache.dart index 16ff14e..2b21552 100644 --- a/lib/library/image_cache.dart +++ b/lib/library/image_cache.dart @@ -44,15 +44,6 @@ class ImageCache with Logging { _images[imageKey] = imageString; _imageMap[imageKey] = true; - -/* final String imageString = await getImageAs64BaseString(id, url); - if (imageString != null) { - _imageMap[imageKey] = imageString; - _imageDown[imageKey] = true; - } - } - _images[imageKey] = imageString; - _imageMap[imageKey] = true; */ } Future saveImageToPrefs(String key, String value) async { diff --git a/lib/library/network_image_to_byte.dart b/lib/library/network_image_to_byte.dart index 6a1fe74..2da9dd5 100644 --- a/lib/library/network_image_to_byte.dart +++ b/lib/library/network_image_to_byte.dart @@ -1,7 +1,6 @@ library network_image_to_byte; import 'dart:io'; -import 'dart:typed_data'; import 'package:flutter/foundation.dart'; diff --git a/lib/library/tree_view.dart b/lib/library/tree_view.dart index 057c9fc..3393936 100644 --- a/lib/library/tree_view.dart +++ b/lib/library/tree_view.dart @@ -76,7 +76,7 @@ class __TreeViewDataState extends State<_TreeViewData> { super.initState(); /// We require the initializers to run after the loading screen is rendered - SchedulerBinding.instance!.addPostFrameCallback((_) { + SchedulerBinding.instance.addPostFrameCallback((_) { final double cHeight = MediaQuery.of(context).size.height; subscription = stream.listen((value) { if (value) { diff --git a/lib/main.dart b/lib/main.dart index b74d63c..8f7963e 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,5 +1,3 @@ -// ignore_for_file: must_be_immutable - import 'dart:async'; import 'dart:io'; import 'package:aitrainer_app/bloc/test_set_execute/test_set_execute_bloc.dart'; @@ -48,17 +46,16 @@ import 'package:aitrainer_app/widgets/development_diagram.dart'; import 'package:aitrainer_app/widgets/home.dart'; import 'package:aitrainer_app/library/facebook_app_events/facebook_app_events.dart'; import 'package:firebase_analytics/firebase_analytics.dart'; -//import 'package:flurry_data/flurry_data.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_localizations/flutter_localizations.dart'; import 'package:aitrainer_app/util/app_localization.dart'; -//import 'package:flutter_uxcam/flutter_uxcam.dart'; import 'package:google_fonts/google_fonts.dart'; import 'package:matomo_tracker/matomo_tracker.dart'; import 'package:sentry_flutter/sentry_flutter.dart'; -//import 'package:flutter_smartlook/flutter_smartlook.dart'; + +import 'package:posthog_flutter/posthog_flutter.dart'; import 'package:upgrader/upgrader.dart'; import 'bloc/account/account_bloc.dart'; import 'bloc/body_development/body_development_bloc.dart'; @@ -72,7 +69,8 @@ import 'model/cache.dart'; import 'view/training_evaluation_page.dart'; import 'package:syncfusion_localizations/syncfusion_localizations.dart'; -const dsn = 'https://0f635b7225564abc9089f8106f25eb5c@sentry.aitrainer.app/1'; +const dsn = 'https://2309523cf2374c089fa1143d19209bc1@glitch.workouttest.org/2'; +//const dsn = 'https://be8b4f90398a45e68b6798c32c4e6baf@app.glitchtip.com/1992'; /// Whether the VM is running in debug mode. /// @@ -99,16 +97,10 @@ Future _reportError(dynamic error, dynamic stackTrace) async { } print('Reporting to Sentry.io...'); - final String customerId = Cache().userLoggedIn != null ? Cache().userLoggedIn!.customerId.toString() : "0"; - Sentry.configureScope( - (scope) => scope.user = SentryUser(id: customerId), - ); - final String platform = Platform.isAndroid ? "Android" : "iOS"; - final String version = Cache().packageInfo != null ? Cache().packageInfo!.version + "+" + Cache().packageInfo!.buildNumber : ""; - final sentryId = - await Sentry.captureException(error, stackTrace: stackTrace, hint: "Platform: $platform, Version: $version, User: $customerId"); - + final sentryId = await Sentry.captureException(error, stackTrace: stackTrace); print('Capture exception result : SentryId : $sentryId'); + MatomoTracker.instance.trackEvent(eventCategory: "error", action: error.toString()); + print('Track error to Matomo'); } Future main() async { @@ -117,13 +109,31 @@ Future main() async { if (isInDebugMode) { // In development mode simply print to console. FlutterError.dumpErrorToConsole(details); - } else { + //} else { // In production mode report to the application zone to report to // Sentry. Zone.current.handleUncaughtError(details.exception, details.stack!); } }; + Future initThirdParty() async { + if (!isInDebugMode) { + await MatomoTracker.instance.initialize( + siteId: 3, + url: 'https://matomo.workouttest.org/matomo.php', + ); + + Posthog().setContext({ + 'device': { + 'token': 'v1.26 test', + } + }); + } + + print(" -- FireBase init.."); + await FirebaseApi().initializeFlutterFire(); + } + // This creates a [Zone] that contains the Flutter application and stablishes // an error handler that captures errors and reports them. // @@ -136,80 +146,54 @@ Future main() async { // - https://api.dartlang.org/stable/1.24.2/dart-async/Zone-class.html // - https://www.dartlang.org/articles/libraries/zones runZonedGuarded>(() async { - if (!isInDebugMode) { - await SentryFlutter.init( - (options) { - options.dsn = dsn; - options.release = Cache().packageInfo != null ? Cache().packageInfo!.version + "+" + Cache().packageInfo!.buildNumber : ""; - options.enableAutoSessionTracking = true; - }, - ); - } - Future initThirdParty() async { - if (!isInDebugMode) { - //await FlurryData.initialize(androidKey: "JNYCTCWBT34FM3J8TV36", iosKey: "3QBG7BSMGPDH24S8TRQP", enableLog: true); - await MatomoTracker.instance.initialize( - siteId: 3, - url: 'https://matomo.workouttest.com/matomo.php', - //visitorId: 'customer_1', - ); - //FlutterUxcam.optIntoSchematicRecordings(); - } - await FirebaseApi().initializeFlutterFire(); - } - final WorkoutTreeRepository menuTreeRepository = WorkoutTreeRepository(); WidgetsFlutterBinding.ensureInitialized(); - if (!isInDebugMode) { - //FlutterUxcam.startWithKey("wvdstyoml4tiwfd"); - //SetupOptions options = (new SetupOptionsBuilder('682883e5cd71a46160c4f6ed070530ee593f49c6')).build(); - //Smartlook.setupAndStartRecording(options); - //Smartlook.setEventTrackingMode(EventTrackingMode.FULL_TRACKING); - } await initThirdParty(); final FirebaseAnalytics analytics = FirebaseAnalytics.instance; - print(" -- FireBase init.."); - - runApp(MultiBlocProvider( - providers: [ - BlocProvider( - create: (BuildContext context) => SessionBloc(session: Session()), - ), - BlocProvider( - create: (BuildContext context) => MenuBloc(menuTreeRepository: menuTreeRepository), - ), - BlocProvider( - create: (BuildContext context) => SettingsBloc(context: context), - ), - BlocProvider( - create: (BuildContext context) => AccountBloc(customerRepository: CustomerRepository()), - ), - BlocProvider( - create: (BuildContext context) => ExercisePlanBloc(menuTreeRepository: menuTreeRepository), - ), - BlocProvider( - create: (BuildContext context) => DevelopmentByMuscleBloc(workoutTreeRepository: menuTreeRepository), - ), - BlocProvider( - create: (BuildContext context) => BodyDevelopmentBloc(workoutTreeRepository: menuTreeRepository), - ), - BlocProvider( - create: (BuildContext context) => TimerBloc(), - ), - BlocProvider( - create: (BuildContext context) => TestSetExecuteBloc(), - ), - BlocProvider( - create: (BuildContext context) => TutorialBloc(tutorialName: ActivityDone.tutorialExecuteFirstTest.toStr())), - BlocProvider(create: (context) { - final MenuBloc menuBloc = BlocProvider.of(context); - return TrainingPlanBloc(menuBloc: menuBloc, trainingPlanRepository: TrainingPlanRepository()); - }), - ], - child: WorkoutTestApp(analytics: analytics), - )); + await SentryFlutter.init( + (options) => options + ..dsn = dsn + ..debug = true, + appRunner: () => runApp(MultiBlocProvider( + providers: [ + BlocProvider( + create: (BuildContext context) => SessionBloc(session: Session()), + ), + BlocProvider( + create: (BuildContext context) => MenuBloc(menuTreeRepository: menuTreeRepository), + ), + BlocProvider( + create: (BuildContext context) => SettingsBloc(context: context), + ), + BlocProvider( + create: (BuildContext context) => AccountBloc(customerRepository: CustomerRepository()), + ), + BlocProvider( + create: (BuildContext context) => ExercisePlanBloc(menuTreeRepository: menuTreeRepository), + ), + BlocProvider( + create: (BuildContext context) => DevelopmentByMuscleBloc(workoutTreeRepository: menuTreeRepository), + ), + BlocProvider( + create: (BuildContext context) => BodyDevelopmentBloc(workoutTreeRepository: menuTreeRepository), + ), + BlocProvider( + create: (BuildContext context) => TimerBloc(), + ), + BlocProvider( + create: (BuildContext context) => TestSetExecuteBloc(), + ), + BlocProvider( + create: (BuildContext context) => TutorialBloc(tutorialName: ActivityDone.tutorialExecuteFirstTest.toStr())), + BlocProvider(create: (context) { + final MenuBloc menuBloc = BlocProvider.of(context); + return TrainingPlanBloc(menuBloc: menuBloc, trainingPlanRepository: TrainingPlanRepository()); + }), + ], + child: WorkoutTestApp(analytics: analytics), + ))); }, (error, stackTrace) async { await _reportError(error, stackTrace); }); @@ -312,6 +296,7 @@ class WorkoutTestApp extends StatelessWidget { )), navigatorObservers: [ FirebaseAnalyticsObserver(analytics: analytics), + //PosthogObserver(), ], home: AitrainerHome(), ); diff --git a/lib/model/cache.dart b/lib/model/cache.dart index d96f467..f674a84 100644 --- a/lib/model/cache.dart +++ b/lib/model/cache.dart @@ -117,8 +117,8 @@ class Cache with Logging { static final String activeExercisePlanDetailsKey = "active_exercise_details_plan"; static final String myTrainingPlanKey = "myTrainingPlan"; - static String baseUrlLive = 'https://aitrainer.info:8943/api/'; - static String baseUrlTest = 'https://aitrainer.info:8843/api/'; + static String baseUrlLive = 'https://api.workouttest.org/api/'; + static String baseUrlTest = 'https://api-test.workouttest.org/api/'; late String baseUrl; static final String mediaUrl = 'https://admin.aitrainer.app/media/'; static final String username = 'bosi'; @@ -702,8 +702,8 @@ class Cache with Logging { //Smartlook.setUserIdentifier(customerId.toString()); //Smartlook.instance. Track().track(TrackingEvent.enter); - MatomoTracker.instance - .trackEvent(eventName: TrackingEvent.enter.enumToString(), eventCategory: "", action: TrackingEvent.enter.enumToString(), eventValue: customerId); + MatomoTracker.instance.setVisitorUserId(customerId.toString()); + MatomoTracker.instance.trackEvent(eventCategory: "wt", action: TrackingEvent.enter.enumToString()); } await Future.forEach(ActivityDone.values, (element) async { diff --git a/lib/repository/customer_repository.dart b/lib/repository/customer_repository.dart index 87809e8..e8574a2 100644 --- a/lib/repository/customer_repository.dart +++ b/lib/repository/customer_repository.dart @@ -23,7 +23,7 @@ class CustomerRepository with Logging { Customer? _trainee; List? _trainees; List? _properties; - List? _allCustomerProperties; + //List? _allCustomerProperties; final PropertyRepository propertyRepository = PropertyRepository(); final List womanSizes = []; final List manSizes = []; @@ -45,7 +45,7 @@ class CustomerRepository with Logging { isMan = (Cache().userLoggedIn!.sex == "m"); } - _allCustomerProperties = Cache().getCustomerPropertyAll(); + //_allCustomerProperties = Cache().getCustomerPropertyAll(); } String? getGenderByName(String name) { diff --git a/lib/service/api.dart b/lib/service/api.dart index b3109f1..fbbff28 100644 --- a/lib/service/api.dart +++ b/lib/service/api.dart @@ -5,6 +5,7 @@ import 'package:aitrainer_app/util/common.dart'; import 'package:aitrainer_app/util/not_found_exception.dart'; import 'package:flutter/services.dart'; import 'package:aitrainer_app/model/cache.dart'; +import 'package:sentry_flutter/sentry_flutter.dart'; class APIClient with Common, Logging { static final APIClient _singleton = APIClient._internal(); @@ -45,12 +46,13 @@ class APIClient with Common, Logging { HttpClientResponse result = await request.close(); client.close(); if (result.statusCode != 200) { - trace("authentication response: ${result.statusCode}"); - throw Exception("Network error, try again later!"); + trace("authentication response: ${result.statusCode} with URL: $url"); + throw Exception("Authentication error: ${result.statusCode}"); } return jsonDecode(await result.transform(utf8.decoder).join()); } catch (exception) { print(exception.toString()); + await Sentry.captureException(exception); throw Exception("Network error, try again later!"); } } @@ -87,37 +89,43 @@ class APIClient with Common, Logging { } } on Exception catch (e) { print("Post Exception: $e"); + await Sentry.captureException(e); throw Exception("Network Error, please try again later"); } } Future get(String endPoint, String param) async { final url = Cache().getBaseUrl() + endPoint + param; + try { + trace("-------- API get " + url); + String authToken = Cache().getAuthToken(); + if (authToken.length == 0) { + var responseJson = await this.authenticateUser(Cache.username, Cache.password); + authToken = responseJson['token']; + Cache().authToken = authToken; + } + var uri = Uri.parse(url); - trace("-------- API get " + url); - String authToken = Cache().getAuthToken(); - if (authToken.length == 0) { - var responseJson = await this.authenticateUser(Cache.username, Cache.password); - authToken = responseJson['token']; - Cache().authToken = authToken; - } - var uri = Uri.parse(url); + HttpClient client = new HttpClient(); - HttpClient client = new HttpClient(); + client.badCertificateCallback = ((X509Certificate cert, String host, int port) => true); - client.badCertificateCallback = ((X509Certificate cert, String host, int port) => true); - - final HttpClientRequest request = await client.getUrl(uri); - request.headers.set('Content-Type', 'application/json'); - request.headers.set('Authorization', 'Bearer $authToken'); - HttpClientResponse result = await request.close(); - client.close(); - trace(" ------------get response code: " + result.statusCode.toString()); - if (result.statusCode == 200) { - return await result.transform(utf8.decoder).join(); - } else if (result.statusCode == 404) { - throw NotFoundException(message: "Not Found"); - } else { + final HttpClientRequest request = await client.getUrl(uri); + request.headers.set('Content-Type', 'application/json'); + request.headers.set('Authorization', 'Bearer $authToken'); + HttpClientResponse result = await request.close(); + client.close(); + trace(" ------------get response code: " + result.statusCode.toString()); + if (result.statusCode == 200) { + return await result.transform(utf8.decoder).join(); + } else if (result.statusCode == 404) { + throw NotFoundException(message: "Not Found"); + } else { + throw Exception("Network Error, please try again later"); + } + } on Exception catch (e) { + print("Post Exception: $e"); + await Sentry.captureException(e); throw Exception("Network Error, please try again later"); } } diff --git a/lib/service/firebase_api.dart b/lib/service/firebase_api.dart index 9b88bab..e261514 100644 --- a/lib/service/firebase_api.dart +++ b/lib/service/firebase_api.dart @@ -62,10 +62,10 @@ class FirebaseApi with logging.Logging { badge: true, sound: true, ); - this.firebaseRegToken = await FirebaseMessaging.instance.getToken(); + this.firebaseRegToken = await FirebaseMessaging.instance.getToken(); Cache().firebaseMessageToken = firebaseRegToken; log("FirebaseMessaging token $firebaseRegToken"); - + FirebaseMessaging.onBackgroundMessage(_firebaseMessagingBackgroundHandler); FirebaseMessaging.onMessage.listen((RemoteMessage message) { print('Got a message whilst in the foreground!'); @@ -75,7 +75,6 @@ class FirebaseApi with logging.Logging { print('Message also contained a notification: ${message.notification}'); } }); - } catch (e) { // Set `_error` state to true if Firebase initialization fails log("Error initializing Firebase"); @@ -381,11 +380,10 @@ class FirebaseApi with logging.Logging { Future setupRemoteConfig() async { //initializeFlutterFire(); - RemoteConfig? remoteConfig; + FirebaseRemoteConfig? remoteConfig; try { - remoteConfig = RemoteConfig.instance; - await remoteConfig.setConfigSettings( - RemoteConfigSettings( + remoteConfig = FirebaseRemoteConfig.instance; + await remoteConfig.setConfigSettings(RemoteConfigSettings( fetchTimeout: const Duration(seconds: 10), minimumFetchInterval: const Duration(seconds: 1), )); diff --git a/lib/util/purchases.dart b/lib/util/purchases.dart index fd9fbfc..fbc3721 100644 --- a/lib/util/purchases.dart +++ b/lib/util/purchases.dart @@ -50,6 +50,7 @@ class RevenueCatPurchases with Logging { log("Trial mode: $inTrial date: ${Cache().userLoggedIn!.trialDate}"); if (Cache().userLoggedIn!.admin == 1 || inTrial || Cache().userLoggedIn!.lifeLong == 1) { Cache().hasPurchased = true; + log(" -- Purchased -- "); } } @@ -94,6 +95,7 @@ class RevenueCatPurchases with Logging { PurchaserInfo purchaserInfo = await Purchases.purchasePackage(selectedPackage); if (purchaserInfo.entitlements.all["wt_subscription"] != null && purchaserInfo.entitlements.all["wt_subscription"]!.isActive) { Cache().hasPurchased = true; + log(" -- Purchased -- "); } } else { log("!!!! No Selected package to purchase"); @@ -107,6 +109,7 @@ class RevenueCatPurchases with Logging { if (errorCode == PurchasesErrorCode.invalidReceiptError) { log("iOS Sandbox invalid receipt"); Cache().hasPurchased = true; + log(" -- Purchased -- "); return; } log(e.toString()); diff --git a/lib/util/track.dart b/lib/util/track.dart index 2e263ec..4ef91d8 100644 --- a/lib/util/track.dart +++ b/lib/util/track.dart @@ -6,9 +6,7 @@ import 'package:aitrainer_app/util/enums.dart'; import 'package:aitrainer_app/model/tracking.dart' as model; import 'package:firebase_analytics/firebase_analytics.dart'; import 'package:firebase_messaging/firebase_messaging.dart'; -//import 'package:flurry_data/flurry_data.dart'; -//import 'package:flutter_uxcam/flutter_uxcam.dart'; -//import 'package:flutter_smartlook/flutter_smartlook.dart'; +import 'package:posthog_flutter/posthog_flutter.dart'; import 'package:matomo_tracker/matomo_tracker.dart'; class Track with Logging { @@ -22,12 +20,9 @@ class Track with Logging { Track._internal(); void track(TrackingEvent event, {String eventValue = ""}) { + model.Tracking tracking = model.Tracking(); + tracking.customerId = Cache().userLoggedIn == null ? 0 : Cache().userLoggedIn!.customerId!; if (!isInDebugMode) { - //FlurryData.logEvent(event.enumToString()); - //Smartlook.setGlobalEventProperty(event.toString(), eventValue, false); - //FlutterUxcam.logEventWithProperties(event.enumToString(), {"value": eventValue}); - model.Tracking tracking = model.Tracking(); - tracking.customerId = Cache().userLoggedIn == null ? 0 : Cache().userLoggedIn!.customerId!; tracking.event = event.enumToString(); if (eventValue.isNotEmpty) { tracking.eventValue = eventValue; @@ -38,7 +33,20 @@ class Track with Logging { FirebaseMessaging.instance.subscribeToTopic(event.enumToString()); analytics.logEvent(name: event.enumToString(), parameters: {"value": eventValue}); - MatomoTracker.instance.trackEvent(eventName: event.enumToString(), eventCategory: "", action: eventValue, eventValue: tracking.customerId); + + if (eventValue.isNotEmpty) { + MatomoTracker.instance.trackEvent(eventCategory: "wt", action: event.enumToString(), eventName: eventValue); + } else { + MatomoTracker.instance.trackEvent(eventCategory: "wt", action: event.enumToString()); + } + + Posthog().capture( + eventName: event.enumToString(), + properties: { + 'action': eventValue, + 'customer': tracking.customerId, + }, + ); } } } diff --git a/lib/view/account.dart b/lib/view/account.dart index ff26a48..0bd17da 100644 --- a/lib/view/account.dart +++ b/lib/view/account.dart @@ -73,7 +73,7 @@ class AccountPage extends StatelessWidget with Trans { ]), style: TextButton.styleFrom( backgroundColor: Colors.white38, - onSurface: Colors.grey, + disabledForegroundColor: Colors.grey, ), onPressed: () => { if (Cache().userLoggedIn != null) @@ -94,7 +94,7 @@ class AccountPage extends StatelessWidget with Trans { ]), style: TextButton.styleFrom( backgroundColor: Colors.white38, - onSurface: Colors.grey, + disabledForegroundColor: Colors.grey, ), onPressed: () => { if (Cache().userLoggedIn != null) @@ -116,7 +116,7 @@ class AccountPage extends StatelessWidget with Trans { ]), style: TextButton.styleFrom( backgroundColor: Colors.white38, - onSurface: Colors.grey, + disabledForegroundColor: Colors.grey, ), onPressed: () => { if (Cache().userLoggedIn != null) @@ -134,7 +134,7 @@ class AccountPage extends StatelessWidget with Trans { title: TextButton( style: TextButton.styleFrom( backgroundColor: Colors.white38, - onSurface: Colors.grey, + disabledForegroundColor: Colors.grey, ), child: Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Text(t(bodyType), style: TextStyle(color: Colors.blue)), @@ -165,7 +165,7 @@ class AccountPage extends StatelessWidget with Trans { title: TextButton( style: TextButton.styleFrom( backgroundColor: Colors.white38, - onSurface: Colors.grey, + disabledForegroundColor: Colors.grey, ), child: Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Text(t("Available Devices"), style: TextStyle(color: Colors.blue)), @@ -189,7 +189,7 @@ class AccountPage extends StatelessWidget with Trans { title: TextButton( style: TextButton.styleFrom( backgroundColor: Colors.white38, - onSurface: Colors.grey, + disabledForegroundColor: Colors.grey, ), child: Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Text(t("Trigger message"), style: TextStyle(color: Colors.purple)), @@ -218,7 +218,7 @@ class AccountPage extends StatelessWidget with Trans { title: TextButton( style: TextButton.styleFrom( backgroundColor: Colors.white38, - onSurface: Colors.grey, + disabledForegroundColor: Colors.grey, ), child: Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Text(t(text), style: TextStyle(color: buttonColor)), @@ -253,7 +253,7 @@ class AccountPage extends StatelessWidget with Trans { leading: Icon(Icons.people), title: ElevatedButton( style: ElevatedButton.styleFrom( - primary: Colors.white70, + backgroundColor: Colors.white70, ), onPressed: () => accountBloc.add(AccountGetTrainees()), child: Text("See my trainees"), diff --git a/lib/view/customer_fitness_page.dart b/lib/view/customer_fitness_page.dart index 086428d..8371c63 100644 --- a/lib/view/customer_fitness_page.dart +++ b/lib/view/customer_fitness_page.dart @@ -13,8 +13,6 @@ import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:google_fonts/google_fonts.dart'; import 'package:modal_progress_hud_nsn/modal_progress_hud_nsn.dart'; -import '../bloc/customer_change/customer_change_bloc.dart'; - // ignore: must_be_immutable class CustomerFitnessPage extends StatefulWidget { late _CustomerFitnessPageState _state; diff --git a/lib/view/customer_height_page.dart b/lib/view/customer_height_page.dart index fd677c6..42f1718 100644 --- a/lib/view/customer_height_page.dart +++ b/lib/view/customer_height_page.dart @@ -11,8 +11,6 @@ import 'package:google_fonts/google_fonts.dart'; import 'package:syncfusion_flutter_gauges/gauges.dart'; -import '../bloc/customer_change/customer_change_bloc.dart'; - // ignore: must_be_immutable class CustomerHeightPage extends StatefulWidget { late _CustomerHeightPageState _state; diff --git a/lib/view/customer_sex_page.dart b/lib/view/customer_sex_page.dart index 0f4afec..58b8fa4 100644 --- a/lib/view/customer_sex_page.dart +++ b/lib/view/customer_sex_page.dart @@ -11,8 +11,6 @@ import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:google_fonts/google_fonts.dart'; import 'package:modal_progress_hud_nsn/modal_progress_hud_nsn.dart'; -import '../bloc/customer_change/customer_change_bloc.dart'; - // ignore: must_be_immutable class CustomerSexPage extends StatefulWidget { late _CustomerSexPageState _state; diff --git a/lib/view/customer_weight_page.dart b/lib/view/customer_weight_page.dart index ad1bcc0..05009a6 100644 --- a/lib/view/customer_weight_page.dart +++ b/lib/view/customer_weight_page.dart @@ -11,8 +11,6 @@ import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:google_fonts/google_fonts.dart'; import 'package:modal_progress_hud_nsn/modal_progress_hud_nsn.dart'; -import '../bloc/customer_change/customer_change_bloc.dart'; - // ignore: must_be_immutable class CustomerWeightPage extends StatefulWidget { late _CustomerWeightPageState _state; diff --git a/lib/view/customer_welcome_page.dart b/lib/view/customer_welcome_page.dart index 693a5c4..39dcd51 100644 --- a/lib/view/customer_welcome_page.dart +++ b/lib/view/customer_welcome_page.dart @@ -59,10 +59,10 @@ class _CustomerWelcomePageState extends State with Trans { duration: Duration(seconds: 6), ), SizedBox( - height: 110, + height: 40, ), CircularPercentIndicator( - radius: 250.0, + radius: 200.0, animation: true, animationDuration: 4800, lineWidth: 20.0, diff --git a/lib/view/exercise_control_page.dart b/lib/view/exercise_control_page.dart index 94ee6d9..9cf1fa2 100644 --- a/lib/view/exercise_control_page.dart +++ b/lib/view/exercise_control_page.dart @@ -327,8 +327,8 @@ class _ExerciseControlPage extends State with Trans { TextButton( style: TextButton.styleFrom( padding: EdgeInsets.all(0), - primary: Colors.white, - onSurface: Colors.blueAccent, + foregroundColor: Colors.white, + disabledForegroundColor: Colors.blueAccent, ), onPressed: () { exerciseBloc.add(ExerciseControlSubmit(step: step)); diff --git a/lib/view/mydevelopment_muscle_page.dart b/lib/view/mydevelopment_muscle_page.dart index 58245b8..32fd3a9 100644 --- a/lib/view/mydevelopment_muscle_page.dart +++ b/lib/view/mydevelopment_muscle_page.dart @@ -47,7 +47,7 @@ class _MyDevelopmentMuscleState extends State with Comm } /// We require the initializers to run after the loading screen is rendered - SchedulerBinding.instance!.addPostFrameCallback((_) { + SchedulerBinding.instance.addPostFrameCallback((_) { BlocProvider.of(context).add(DevelopmentByMuscleLoad()); }); } diff --git a/lib/view/mydevelopment_page.dart b/lib/view/mydevelopment_page.dart index 501da3a..f04e5be 100644 --- a/lib/view/mydevelopment_page.dart +++ b/lib/view/mydevelopment_page.dart @@ -66,7 +66,10 @@ class _MyDevelopmentPage extends State with Trans { text: t("My Training Logs"), style: GoogleFonts.robotoMono( textStyle: TextStyle( - fontSize: 14, color: Colors.white, fontWeight: FontWeight.bold, backgroundColor: Colors.black54.withOpacity(0.4))), + fontSize: 14, + color: Colors.white, + fontWeight: FontWeight.bold, + backgroundColor: Colors.black54.withOpacity(0.4))), image: "asset/image/edzesnaplom400400.jpg", left: 5, onTap: () => Navigator.of(context).pushNamed('mydevelopmentLog', arguments: args), @@ -186,7 +189,8 @@ class _MyDevelopmentPage extends State with Trans { onTap: () => {Navigator.of(context).pushNamed('mydevelopmentMusclePage', arguments: args)}, isLocked: true, ))), - developmentWidget(imageWidth, t("Development of My Sizes"), "asset/image/sizes_q.jpg", TrackingEvent.my_size_development, args), + developmentWidget( + imageWidth, t("Development of My Sizes"), "asset/image/sizes_q.jpg", TrackingEvent.my_size_development, args), hiddenWidget(customerRepository, exerciseRepository), ]), gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( @@ -207,7 +211,8 @@ class _MyDevelopmentPage extends State with Trans { textAlignment: Alignment.topLeft, text: t(title), style: GoogleFonts.robotoMono( - textStyle: TextStyle(fontSize: 14, color: Colors.white, fontWeight: FontWeight.bold, backgroundColor: Colors.black54.withOpacity(0.4))), + textStyle: + TextStyle(fontSize: 14, color: Colors.white, fontWeight: FontWeight.bold, backgroundColor: Colors.black54.withOpacity(0.4))), image: imageUrl, onTap: () => { if (Cache().userLoggedIn != null) @@ -240,8 +245,8 @@ class _MyDevelopmentPage extends State with Trans { return TextButton( style: TextButton.styleFrom( padding: EdgeInsets.all(20), - primary: Colors.white, - onSurface: Colors.blueAccent, + backgroundColor: Colors.white, + disabledForegroundColor: Colors.blueAccent, ), onPressed: () => { if (Cache().getTrainee() != null) diff --git a/lib/view/settings.dart b/lib/view/settings.dart index 4ba9475..18cf423 100644 --- a/lib/view/settings.dart +++ b/lib/view/settings.dart @@ -43,8 +43,8 @@ class SettingsPage extends StatelessWidget with Trans { child: Form( child: BlocConsumer(listener: (context, state) { if (state is SettingsError) { - ScaffoldMessenger.of(context) - .showSnackBar(SnackBar(backgroundColor: Colors.orange, content: Text(state.message, style: TextStyle(color: Colors.white)))); + ScaffoldMessenger.of(context).showSnackBar( + SnackBar(backgroundColor: Colors.orange, content: Text(state.message, style: TextStyle(color: Colors.white)))); } else if (state is SettingsReady) { menuBloc.add(MenuRecreateTree()); Navigator.of(context).pushNamed("home"); @@ -193,7 +193,7 @@ class SettingsPage extends StatelessWidget with Trans { ]), style: TextButton.styleFrom( backgroundColor: Colors.white70, - onSurface: Colors.grey, + disabledForegroundColor: Colors.grey, ), onPressed: () => { Track().track(TrackingEvent.terms_of_use), @@ -220,7 +220,7 @@ class SettingsPage extends StatelessWidget with Trans { ]), style: TextButton.styleFrom( backgroundColor: Colors.white70, - onSurface: Colors.grey, + disabledForegroundColor: Colors.grey, ), onPressed: () => { Track().track(TrackingEvent.data_privacy), @@ -247,7 +247,7 @@ class SettingsPage extends StatelessWidget with Trans { ]), style: TextButton.styleFrom( backgroundColor: Colors.white70, - onSurface: Colors.grey, + disabledForegroundColor: Colors.grey, ), onPressed: () => { Navigator.of(context).pushNamed("faqPage"), @@ -290,7 +290,7 @@ class SettingsPage extends StatelessWidget with Trans { ]), style: TextButton.styleFrom( backgroundColor: Colors.white70, - onSurface: Colors.grey, + disabledForegroundColor: Colors.grey, ), onPressed: () => { launchMailto(), @@ -311,6 +311,7 @@ class SettingsPage extends StatelessWidget with Trans { // Use either Dart's string interpolation // or the toString() method. print("Mailto: $mailtoLink"); - await launch('$mailtoLink'); + final Uri _url = Uri.parse("$mailtoLink"); + await launchUrl(_url); } } diff --git a/lib/view/test_set_control.dart b/lib/view/test_set_control.dart index 1a66dc4..0de3874 100644 --- a/lib/view/test_set_control.dart +++ b/lib/view/test_set_control.dart @@ -165,8 +165,8 @@ class TestSetControl extends StatelessWidget with Trans { TextButton( style: TextButton.styleFrom( padding: EdgeInsets.all(0), - primary: Colors.white, - onSurface: Colors.blueAccent, + foregroundColor: Colors.white, + disabledForegroundColor: Colors.blueAccent, ), onPressed: () => { bloc.add(TestSetControlSubmit()), diff --git a/lib/view/training_plan_activate_page.dart b/lib/view/training_plan_activate_page.dart index 25d2bac..0c46ee4 100644 --- a/lib/view/training_plan_activate_page.dart +++ b/lib/view/training_plan_activate_page.dart @@ -316,8 +316,8 @@ class TrainingPlanActivatePage extends StatelessWidget with Trans { getPlanDetails(plan, bloc, dayName), ElevatedButton( style: ElevatedButton.styleFrom( - onPrimary: Colors.white, - primary: restricted ? Colors.grey[600] : Colors.orange, + foregroundColor: Colors.white, + backgroundColor: restricted ? Colors.grey[600] : Colors.orange, ), child: Text(t("Start")), onPressed: () { @@ -476,7 +476,8 @@ class TrainingPlanActivatePage extends StatelessWidget with Trans { return DialogCommon( title: t("Dropset"), descriptions: t("A drop set is an advanced resistance training technique "), - description2: t(" in which you focus on completing a set until failure - or the inability to do another repetition."), + description2: + t(" in which you focus on completing a set until failure - or the inability to do another repetition."), text: "OK", onTap: () => { Navigator.of(context).pop(), @@ -490,7 +491,7 @@ class TrainingPlanActivatePage extends StatelessWidget with Trans { headerGridLinesVisibility: GridLinesVisibility.both, gridLinesVisibility: GridLinesVisibility.both, columns: [ - GridTextColumn( + GridColumn( columnWidthMode: ColumnWidthMode.lastColumnFill, maximumWidth: 130, columnName: 'exerciseImage', @@ -507,7 +508,7 @@ class TrainingPlanActivatePage extends StatelessWidget with Trans { textAlign: TextAlign.start, overflow: TextOverflow.ellipsis, ))), - GridTextColumn( + GridColumn( maximumWidth: 0, visible: false, columnName: 'exerciseName', @@ -520,7 +521,7 @@ class TrainingPlanActivatePage extends StatelessWidget with Trans { textAlign: TextAlign.start, overflow: TextOverflow.ellipsis, ))), - GridTextColumn( + GridColumn( maximumWidth: 60, columnName: 'Set', label: Container( @@ -532,7 +533,7 @@ class TrainingPlanActivatePage extends StatelessWidget with Trans { style: GoogleFonts.inter(color: Colors.white, fontWeight: FontWeight.bold), overflow: TextOverflow.ellipsis, ))), - GridTextColumn( + GridColumn( maximumWidth: 100, columnWidthMode: ColumnWidthMode.fill, columnName: 'Repeats', @@ -545,7 +546,7 @@ class TrainingPlanActivatePage extends StatelessWidget with Trans { style: GoogleFonts.inter(color: Colors.white, fontWeight: FontWeight.bold), overflow: TextOverflow.ellipsis, ))), - GridTextColumn( + GridColumn( maximumWidth: 60, columnName: 'Weight', label: Container( diff --git a/lib/view/training_plan_execute.dart b/lib/view/training_plan_execute.dart index 87b4f34..87d1c82 100644 --- a/lib/view/training_plan_execute.dart +++ b/lib/view/training_plan_execute.dart @@ -297,7 +297,7 @@ class _ExerciseListState extends State with Trans { @override void initState() { - WidgetsBinding.instance!.addPostFrameCallback((_) { + WidgetsBinding.instance.addPostFrameCallback((_) { animate(); }); super.initState(); @@ -306,7 +306,7 @@ class _ExerciseListState extends State with Trans { @override void didUpdateWidget(ExerciseList page) { super.didUpdateWidget(page); - WidgetsBinding.instance!.addPostFrameCallback((_) { + WidgetsBinding.instance.addPostFrameCallback((_) { animate(); }); } @@ -333,8 +333,8 @@ class _ExerciseListState extends State with Trans { String description2 = ""; if (next.exerciseTypeId != detail.exerciseTypeId) { title = AppLocalizations.of(context)!.translate("Stop!"); - description = - AppLocalizations.of(context)!.translate("Please continue with the next exercise in the queue:") + next.exerciseType!.nameTranslation; + description = AppLocalizations.of(context)!.translate("Please continue with the next exercise in the queue:") + + next.exerciseType!.nameTranslation; } else { final HashMap args = HashMap(); args['exerciseType'] = next.exerciseType; @@ -388,7 +388,8 @@ class _ExerciseListState extends State with Trans { bloc.getMyPlan()!.days[widget.dayName]!.forEach((element) { if (prev == null || (prev != null && prev!.exerciseTypeId != element.exerciseTypeId)) { tiles.add(GestureDetector( - onTap: () => bloc.getNext() != null ? executeExercise(bloc, bloc.getNext()!, context) : Navigator.of(context).pushNamed('home'), + onTap: () => + bloc.getNext() != null ? executeExercise(bloc, bloc.getNext()!, context) : Navigator.of(context).pushNamed('home'), child: ExerciseTile( bloc: bloc, detail: element, @@ -543,7 +544,8 @@ class ExerciseTile extends StatelessWidget with Trans { List getExerciseTiles(CustomerTrainingPlanDetails detail) { final List list = []; - if (bloc.alternatives[detail.customerTrainingPlanDetailsId] != null && bloc.alternatives[detail.customerTrainingPlanDetailsId].length > 0) { + if (bloc.alternatives[detail.customerTrainingPlanDetailsId] != null && + bloc.alternatives[detail.customerTrainingPlanDetailsId].length > 0) { int index = 0; for (CustomerTrainingPlanDetails alternative in bloc.alternatives[detail.customerTrainingPlanDetailsId]) { final Widget widget = getTile(alternative, index); @@ -563,7 +565,8 @@ class ExerciseTile extends StatelessWidget with Trans { final int step = bloc.getStep(detail); final int highlightStep = bloc.getHighlightStep(detail); final bool hasLeftAlternative = detail.alternatives.length > 0 && index > 0; - final bool hasRightAlternative = detail.alternatives.length > 0 && index + 1 < bloc.alternatives[detail.customerTrainingPlanDetailsId].length; + final bool hasRightAlternative = + detail.alternatives.length > 0 && index + 1 < bloc.alternatives[detail.customerTrainingPlanDetailsId].length; return Container( child: Stack(alignment: Alignment.centerRight, children: [ @@ -598,7 +601,8 @@ class ExerciseTile extends StatelessWidget with Trans { context: context, builder: (BuildContext context) { return DialogHTML( - title: detail.exerciseType!.nameTranslation, htmlData: '

' + detail.exerciseType!.descriptionTranslation + '

'); + title: detail.exerciseType!.nameTranslation, + htmlData: '

' + detail.exerciseType!.descriptionTranslation + '

'); }), icon: Icon( Icons.info_outline, diff --git a/lib/widgets/bottom_bar_multiple_exercises.dart b/lib/widgets/bottom_bar_multiple_exercises.dart index 184bbbf..f039cad 100644 --- a/lib/widgets/bottom_bar_multiple_exercises.dart +++ b/lib/widgets/bottom_bar_multiple_exercises.dart @@ -38,7 +38,7 @@ class _BottomBarMultipleExercisesState extends State @override void initState() { super.initState(); - SchedulerBinding.instance!.addPostFrameCallback((_) { + SchedulerBinding.instance.addPostFrameCallback((_) { _controller = ScrollController(); }); } diff --git a/lib/widgets/exercise_save.dart b/lib/widgets/exercise_save.dart index a9cb648..608ac25 100644 --- a/lib/widgets/exercise_save.dart +++ b/lib/widgets/exercise_save.dart @@ -209,12 +209,12 @@ class _ExerciseSaveState extends State with Trans { }); } - SchedulerBinding.instance!.addPostFrameCallback((_) { + SchedulerBinding.instance.addPostFrameCallback((_) { subscription = stream.listen((event) { //_controller1.text = ExerciseSaveStream().weight.toStringAsFixed(0); _controller2.text = ExerciseSaveStream().repeats.toStringAsFixed(0); }); - print("ExerciseSave weight ${widget.weight}"); + //print("ExerciseSave weight ${widget.weight}"); _controller1.text = widget.weight == null || widget.weight == -1 ? "TEST" : widget.weight! % widget.weight!.round() == 0 @@ -633,7 +633,8 @@ class _ExerciseSaveState extends State with Trans { padding: const EdgeInsets.all(2), color: Colors.white70, onPressed: () async { - stopWatchTimer.onExecute.add(StopWatchExecute.start); + //stopWatchTimer.onExecute.add(StopWatchExecute.start); + stopWatchTimer.onStartTimer(); Wakelock.enable(); // prevent sleep the phone }, icon: Icon(CustomIcon.play_1), @@ -647,7 +648,8 @@ class _ExerciseSaveState extends State with Trans { iconSize: 40, color: Colors.white70, onPressed: () async { - stopWatchTimer.onExecute.add(StopWatchExecute.stop); + //stopWatchTimer.onExecute.add(StopWatchExecute.stop); + stopWatchTimer.onStartTimer(); Wakelock.disable(); }, icon: Icon(CustomIcon.stop), @@ -660,7 +662,8 @@ class _ExerciseSaveState extends State with Trans { iconSize: 40, color: Colors.white70, onPressed: () async { - stopWatchTimer.onExecute.add(StopWatchExecute.reset); + //stopWatchTimer.onExecute.add(StopWatchExecute.reset); + stopWatchTimer.onResetTimer(); }, icon: Icon(CustomIcon.creative_commons_zero), ), diff --git a/lib/widgets/home.dart b/lib/widgets/home.dart index f24cb66..d20b421 100644 --- a/lib/widgets/home.dart +++ b/lib/widgets/home.dart @@ -2,7 +2,6 @@ import 'package:aitrainer_app/bloc/session/session_bloc.dart'; import 'package:aitrainer_app/bloc/settings/settings_bloc.dart'; import 'package:aitrainer_app/model/cache.dart'; import 'package:aitrainer_app/service/logging.dart'; -import 'package:aitrainer_app/util/app_language.dart'; import 'package:aitrainer_app/util/trans.dart'; import 'package:aitrainer_app/view/customer_goal_page.dart'; import 'package:aitrainer_app/view/login.dart'; @@ -12,6 +11,7 @@ import 'package:firebase_messaging/firebase_messaging.dart'; import 'package:flutter/material.dart'; import 'package:flutter/scheduler.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:matomo_tracker/matomo_tracker.dart'; import 'package:upgrader/upgrader.dart'; import 'loading.dart'; @@ -25,15 +25,21 @@ class AitrainerHome extends StatefulWidget { } } -class _HomePageState extends State with Logging, Trans { +class _HomePageState extends State with Logging, Trans, TraceableClientMixin { GlobalKey _scaffoldKey = new GlobalKey(); + @override + String get traceName => 'Home'; + + @override + String get traceTitle => this.widget.toString(); + @override void initState() { super.initState(); /// We require the initializers to run after the loading screen is rendered - SchedulerBinding.instance!.addPostFrameCallback((_) { + SchedulerBinding.instance.addPostFrameCallback((_) { runDelayedEvent(); }); @@ -70,7 +76,7 @@ class _HomePageState extends State with Logging, Trans { return Scaffold( key: _scaffoldKey, body: UpgradeAlert( - upgrader: Upgrader(appcastConfig: cfg, messages: MyLocalizedUpgraderMessages(context: context)), + upgrader: Upgrader(appcastConfig: cfg, messages: MyLocalizedUpgraderMessages(context: context)), child: BlocConsumer(listener: (context, state) { if (state is SessionFailure) { showDialog( diff --git a/lib/widgets/input_dialog_widget.dart b/lib/widgets/input_dialog_widget.dart index 2ed210a..95dfd25 100644 --- a/lib/widgets/input_dialog_widget.dart +++ b/lib/widgets/input_dialog_widget.dart @@ -174,8 +174,8 @@ class _InputDialogState extends State> with Trans { children: [ ElevatedButton( style: ElevatedButton.styleFrom( - primary: Colors.black26, - onSurface: Colors.white, + backgroundColor: Colors.black26, + disabledBackgroundColor: Colors.white, ), onPressed: () { Navigator.of(context).pop(); @@ -187,8 +187,8 @@ class _InputDialogState extends State> with Trans { ), ElevatedButton( style: ElevatedButton.styleFrom( - primary: Colors.orange[600], - onSurface: Colors.white, + backgroundColor: Colors.orange[600], + disabledForegroundColor: Colors.white, ), onPressed: () { widget.onChanged(this.inputValue); diff --git a/lib/widgets/menu_page_widget.dart b/lib/widgets/menu_page_widget.dart index 0dde78a..c96cb2f 100644 --- a/lib/widgets/menu_page_widget.dart +++ b/lib/widgets/menu_page_widget.dart @@ -5,7 +5,6 @@ import 'package:aitrainer_app/bloc/menu/menu_bloc.dart'; import 'package:aitrainer_app/repository/training_plan_repository.dart'; import 'package:aitrainer_app/util/enums.dart'; import 'package:aitrainer_app/util/track.dart'; -import 'package:aitrainer_app/widgets/dialog_trial.dart'; import 'package:aitrainer_app/widgets/menu_image.dart'; import 'package:aitrainer_app/widgets/menu_search_bar.dart'; import 'package:aitrainer_app/util/app_language.dart'; @@ -55,7 +54,7 @@ class _MenuPageWidgetState extends State with Trans, Logging { } /// We require the initializers to run after the loading screen is rendered - SchedulerBinding.instance!.addPostFrameCallback((_) { + SchedulerBinding.instance.addPostFrameCallback((_) { menuBloc.add(MenuCreate()); }); @@ -112,7 +111,9 @@ class _MenuPageWidgetState extends State with Trans, Logging { return Stack(children: [ CustomScrollView( - controller: scrollController, scrollDirection: Axis.vertical, slivers: buildMenuColumn(widget.parent!, context, menuBloc, cWidth, cHeight)), + controller: scrollController, + scrollDirection: Axis.vertical, + slivers: buildMenuColumn(widget.parent!, context, menuBloc, cWidth, cHeight)), ]); } @@ -134,7 +135,8 @@ class _MenuPageWidgetState extends State with Trans, Logging { padding: EdgeInsets.only(top: 15.0), child: Center( child: Stack(alignment: Alignment.bottomLeft, children: [ - Text(AppLocalizations.of(context)!.translate("All Exercises has been filtered out"), style: GoogleFonts.inter(color: Colors.white)), + Text(AppLocalizations.of(context)!.translate("All Exercises has been filtered out"), + style: GoogleFonts.inter(color: Colors.white)), ])))); } else { menuBloc.getFilteredBranch(menuBloc.parent).forEach((treeName, value) { @@ -395,8 +397,10 @@ class _MenuPageWidgetState extends State with Trans, Logging { dynamic getShape(WorkoutMenuTree workoutTree) { bool base = workoutTree.base; dynamic returnCode = (base == true) - ? RoundedRectangleBorder(side: BorderSide(width: 6, color: Colors.orangeAccent), borderRadius: BorderRadius.all(Radius.circular(24.0))) - : RoundedRectangleBorder(side: BorderSide(width: 1, color: Colors.transparent), borderRadius: BorderRadius.all(Radius.circular(8.0))); + ? RoundedRectangleBorder( + side: BorderSide(width: 6, color: Colors.orangeAccent), borderRadius: BorderRadius.all(Radius.circular(24.0))) + : RoundedRectangleBorder( + side: BorderSide(width: 1, color: Colors.transparent), borderRadius: BorderRadius.all(Radius.circular(8.0))); return returnCode; } diff --git a/lib/widgets/tutorial_widget.dart b/lib/widgets/tutorial_widget.dart index 7fa08ec..3e4557e 100644 --- a/lib/widgets/tutorial_widget.dart +++ b/lib/widgets/tutorial_widget.dart @@ -178,7 +178,7 @@ class TutorialWidget with Trans, Logging { children: [ ElevatedButton( style: ElevatedButton.styleFrom( - primary: Colors.transparent, + backgroundColor: Colors.transparent, ), onPressed: () => {bloc.add(TutorialNext(text: bloc.checks[0]))}, child: Text("« " + t(bloc.checks[0]), @@ -186,7 +186,7 @@ class TutorialWidget with Trans, Logging { ), ElevatedButton( style: ElevatedButton.styleFrom( - primary: Colors.transparent, + backgroundColor: Colors.transparent, ), onPressed: () => {bloc.add(TutorialNext(text: bloc.checks[1]))}, child: Text(t(bloc.checks[1]) + " »", @@ -196,7 +196,7 @@ class TutorialWidget with Trans, Logging { ) : ElevatedButton( style: ElevatedButton.styleFrom( - primary: Colors.transparent, + backgroundColor: Colors.transparent, ), onPressed: () => { //tooltip!.rebuild(context), diff --git a/lib/widgets/victory_widget.dart b/lib/widgets/victory_widget.dart index 8f002e1..bc6e7b9 100644 --- a/lib/widgets/victory_widget.dart +++ b/lib/widgets/victory_widget.dart @@ -16,7 +16,7 @@ class _VictoryConfettiState extends State { @override void initState() { _controllerBottomCenter = ConfettiController(duration: const Duration(seconds: 2)); - SchedulerBinding.instance!.addPostFrameCallback((_) { + SchedulerBinding.instance.addPostFrameCallback((_) { Future.delayed(Duration(milliseconds: 500)).then((value) => _controllerBottomCenter.play()); }); super.initState(); diff --git a/pubspec.lock b/pubspec.lock index 0d9ae12..31c934d 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -867,7 +867,7 @@ packages: name: matomo_tracker url: "https://pub.dartlang.org" source: hosted - version: "1.5.0" + version: "1.6.0" meta: dependency: transitive description: @@ -1092,6 +1092,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.5.0" + posthog_flutter: + dependency: "direct main" + description: + name: posthog_flutter + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.3" process: dependency: transitive description: @@ -1321,20 +1328,6 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.9.0" - sqflite: - dependency: "direct main" - description: - name: sqflite - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.0+1" - sqflite_common: - dependency: transitive - description: - name: sqflite_common - url: "https://pub.dartlang.org" - source: hosted - version: "2.3.0" stack_trace: dependency: transitive description: @@ -1426,13 +1419,6 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "20.3.50" - synchronized: - dependency: transitive - description: - name: synchronized - url: "https://pub.dartlang.org" - source: hosted - version: "3.0.0+2" term_glyph: dependency: transitive description: @@ -1517,27 +1503,20 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "2.0.4" - universal_platform: - dependency: transitive - description: - name: universal_platform - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.0+1" upgrader: dependency: "direct main" description: name: upgrader url: "https://pub.dartlang.org" source: hosted - version: "4.8.1" + version: "4.10.0" url_launcher: dependency: "direct main" description: name: url_launcher url: "https://pub.dartlang.org" source: hosted - version: "6.1.6" + version: "6.1.5" url_launcher_android: dependency: transitive description: @@ -1784,5 +1763,5 @@ packages: source: hosted version: "3.1.0" sdks: - dart: ">=2.18.0-0 <3.0.0" - flutter: ">=3.3.0-0" + dart: ">=2.17.0 <3.0.0" + flutter: ">=3.0.0" diff --git a/pubspec.yaml b/pubspec.yaml index c6220bb..272711a 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -67,19 +67,20 @@ dependencies: keyboard_actions: ^3.4.0 mailto: ^2.0.0 - matomo_tracker: ^1.5.0 + matomo_tracker: ^1.6.0 mockito: ^5.3.2 modal_progress_hud_nsn: ^0.3.0 package_info: ^2.0.2 percent_indicator: ^4.0.0 + posthog_flutter: ^2.0.3 purchases_flutter: ^3.9.5 rainbow_color: ^2.0.1 - sentry_flutter: ^6.13.0 + sentry_flutter: ^6.9.1 sign_in_with_apple: ^4.1.0 - sqflite: ^2.1.0+1 + #sqflite: ^2.1.0+1 stop_watch_timer: ^2.0.0 syncfusion_flutter_gauges: ^20.3.50 @@ -91,7 +92,7 @@ dependencies: timeline_tile: ^2.0.0 toggle_switch: ^2.0.1 - upgrader: ^4.8.1 + upgrader: ^4.10.0 url_launcher: ^6.0.9 wakelock: ^0.6.2 diff --git a/test/exercise_plan_repository_test.dart b/test/exercise_plan_repository_test.dart index bf5f0f2..57d1638 100644 --- a/test/exercise_plan_repository_test.dart +++ b/test/exercise_plan_repository_test.dart @@ -1,10 +1,10 @@ -import 'package:aitrainer_app/model/cache.dart'; +/*import 'package:aitrainer_app/model/cache.dart'; import 'package:aitrainer_app/model/exercise_plan.dart'; import 'package:aitrainer_app/model/exercise_plan_detail.dart'; import 'package:aitrainer_app/model/model_change.dart'; import 'package:test/test.dart'; -import 'mocks.dart'; - +import 'mocks.dart';*/ +/* main() { late SimExercisePlanRepository _exercisePlanRepository; late int _customerId; @@ -141,3 +141,5 @@ main() { }); }); } + +*/ \ No newline at end of file diff --git a/test/widget_test.db.dart b/test/widget_test.db.dart index d9c2e2c..b9c5ad8 100644 --- a/test/widget_test.db.dart +++ b/test/widget_test.db.dart @@ -17,10 +17,11 @@ import 'package:bloc_test/bloc_test.dart'; import 'package:flutter/material.dart'; import 'package:flutter_localizations/flutter_localizations.dart'; */ -import 'package:aitrainer_app/helper/database.dart'; -import 'package:flutter_test/flutter_test.dart'; +//import 'package:aitrainer_app/helper/database.dart'; +//import 'package:flutter_test/flutter_test.dart'; //import 'package:mockito/mockito.dart'; +/* void main() { group('SQFLite', () { setUp(() async { @@ -39,3 +40,4 @@ void main() { }); }); } +*/ \ No newline at end of file diff --git a/test/widget_test.login.dart b/test/widget_test.login.dart index 3689722..3a1ddd0 100644 --- a/test/widget_test.login.dart +++ b/test/widget_test.login.dart @@ -6,7 +6,7 @@ // tree, read text, and verify that the values of widget properties are correct. //import 'package:aitrainer_app/bloc/login_form_bloc.dart'; -import 'package:aitrainer_app/helper/database.dart'; +//import 'package:aitrainer_app/helper/database.dart'; import 'package:aitrainer_app/library_keys.dart'; import 'package:aitrainer_app/util/app_localization.dart'; import 'package:aitrainer_app/model/user.dart'; @@ -52,7 +52,7 @@ void main() { late MockCommon common; setUp(() async { - await DB().initDb(); + //await DB().initDb(); common = MockCommon(); loginWidget = MaterialApp(home: LoginPage(), localizationsDelegates: [ diff --git a/test_driver/service/customer_service.dart b/test_driver/service/customer_service.dart index b454397..c753ec7 100644 --- a/test_driver/service/customer_service.dart +++ b/test_driver/service/customer_service.dart @@ -1,9 +1,10 @@ -import 'package:aitrainer_app/model/customer.dart'; -import '../../lib/helper/database.dart'; - +//import 'package:aitrainer_app/model/customer.dart'; +//import '../../lib/helper/database.dart'; +/* class CustomerApi { Future addCustomer(Customer customer) async { //print(" ===== add new customer: " + customer.toSQL().toString(); await DB().getDB().insert("customer", customer.toJson()); } } +*/ \ No newline at end of file