From 3f52d95bbfd4b224d8bc5b7d5875f983941b7af4 Mon Sep 17 00:00:00 2001 From: bossanyit Date: Sun, 15 Jan 2023 11:45:30 +0100 Subject: [PATCH] v1.27.1 error fixes --- ios/Podfile.lock | 12 ++++----- ios/Runner.xcodeproj/project.pbxproj | 12 ++++----- lib/bloc/exercise_new/exercise_new_bloc.dart | 7 ++++- lib/library/image_cache.dart | 12 +++++---- lib/model/cache.dart | 2 +- lib/model/customer_training_plan_details.dart | 2 +- lib/service/mautic.dart | 2 +- lib/view/training_plan_execute.dart | 2 ++ lib/widgets/exercise_save.dart | 27 ++++++++++--------- pubspec.yaml | 2 +- 10 files changed, 46 insertions(+), 34 deletions(-) diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 3c031b4..f19bb84 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -201,9 +201,9 @@ PODS: - path_provider_ios (0.0.1): - Flutter - PostHog (1.4.4) - - posthog_flutter (0.0.1): + - posthog_session (0.0.1): - Flutter - - PostHog (~> 1.0) + - PostHog (~> 1.1) - PromisesObjC (2.1.1) - Purchases (3.13.2): - PurchasesCoreSwift (= 3.13.2) @@ -254,7 +254,7 @@ DEPENDENCIES: - 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`) + - posthog_session (from `.symlinks/plugins/posthog_session/ios`) - purchases_flutter (from `.symlinks/plugins/purchases_flutter/ios`) - sentry_flutter (from `.symlinks/plugins/sentry_flutter/ios`) - share (from `.symlinks/plugins/share/ios`) @@ -334,8 +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" + posthog_session: + :path: ".symlinks/plugins/posthog_session/ios" purchases_flutter: :path: ".symlinks/plugins/purchases_flutter/ios" sentry_flutter: @@ -398,7 +398,7 @@ SPEC CHECKSUMS: package_info_plus: 6c92f08e1f853dc01228d6f553146438dafcd14e path_provider_ios: 14f3d2fd28c4fdb42f44e0f751d12861c43cee02 PostHog: 4b6321b521569092d4ef3a02238d9435dbaeb99f - posthog_flutter: e5bed2753b8c124158530724e30232998aaf9137 + posthog_session: 24d7e00a2ebd7586c8e7a1789b987f3f8d6cd10a PromisesObjC: ab77feca74fa2823e7af4249b8326368e61014cb Purchases: 03200de9288724e77de435000d1828601e6b8e00 purchases_flutter: cf2b742f12b7ffef6f618c7f1ba1961e652825b1 diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 8ff73d6..0d00a43 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -372,7 +372,7 @@ CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 3; + CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = SFJJBDCU6Z; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( @@ -389,7 +389,7 @@ "$(inherited)", "$(PROJECT_DIR)/Flutter", ); - MARKETING_VERSION = 1.1.26; + MARKETING_VERSION = 1.1.27; PRODUCT_BUNDLE_IDENTIFIER = com.aitrainer.app; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -518,7 +518,7 @@ CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 3; + CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = SFJJBDCU6Z; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( @@ -535,7 +535,7 @@ "$(inherited)", "$(PROJECT_DIR)/Flutter", ); - MARKETING_VERSION = 1.1.26; + MARKETING_VERSION = 1.1.27; PRODUCT_BUNDLE_IDENTIFIER = com.aitrainer.app; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -556,7 +556,7 @@ CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 3; + CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = SFJJBDCU6Z; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( @@ -573,7 +573,7 @@ "$(inherited)", "$(PROJECT_DIR)/Flutter", ); - MARKETING_VERSION = 1.1.26; + MARKETING_VERSION = 1.1.27; PRODUCT_BUNDLE_IDENTIFIER = com.aitrainer.app; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; diff --git a/lib/bloc/exercise_new/exercise_new_bloc.dart b/lib/bloc/exercise_new/exercise_new_bloc.dart index e63e7aa..7f32ce9 100644 --- a/lib/bloc/exercise_new/exercise_new_bloc.dart +++ b/lib/bloc/exercise_new/exercise_new_bloc.dart @@ -220,7 +220,12 @@ class ExerciseNewBloc extends Bloc with Logg double getBMR() { var date = DateTime.now(); - if (weight == null || height == null || height == 0 || weight == 0) { + if (weight == null || + height == null || + height == 0 || + weight == 0 || + customerRepository.customer == null || + customerRepository.customer!.birthYear == null) { this.bmi = 0; return 0; } diff --git a/lib/library/image_cache.dart b/lib/library/image_cache.dart index 2b21552..967143c 100644 --- a/lib/library/image_cache.dart +++ b/lib/library/image_cache.dart @@ -40,10 +40,12 @@ class ImageCache with Logging { final String imageKey = generateMd5(url + "_" + id.toString()); // get from storage - final String imageString = (await getImageAs64BaseString(id, url))!; + final String? imageString = await getImageAs64BaseString(id, url); - _images[imageKey] = imageString; - _imageMap[imageKey] = true; + if (imageString != null) { + _images[imageKey] = imageString; + _imageMap[imageKey] = true; + } } Future saveImageToPrefs(String key, String value) async { @@ -93,14 +95,14 @@ class ImageCache with Logging { return image; } - Future getImageAs64BaseString(int id, String name) async { + Future? getImageAs64BaseString(int id, String name) async { final String imageKey = generateMd5(name + "_" + id.toString()); String? imageString; if (await storage.containsKey(key: imageKey)) { //log(" .. get from storage"); imageString = await storage.read(key: imageKey); } else { - imageString = (await downloadAndSaveImage(id, name))!; + imageString = await downloadAndSaveImage(id, name); //log(" .. downloaded"); } return imageString; diff --git a/lib/model/cache.dart b/lib/model/cache.dart index 355b617..97b83c2 100644 --- a/lib/model/cache.dart +++ b/lib/model/cache.dart @@ -118,7 +118,7 @@ class Cache with Logging { static String baseUrlLive = 'https://api.workouttest.org/api/'; static String baseUrlTest = 'https://apitest.workouttest.org/api/'; late String baseUrl; - static final String mediaUrl = 'https://admin.aitrainer.app/media/'; + static final String mediaUrl = 'https://admin.workouttest.org/media/'; static final String username = 'bosi'; static final String password = 'andio2009'; diff --git a/lib/model/customer_training_plan_details.dart b/lib/model/customer_training_plan_details.dart index 86b92ba..c97475c 100644 --- a/lib/model/customer_training_plan_details.dart +++ b/lib/model/customer_training_plan_details.dart @@ -94,7 +94,7 @@ class CustomerTrainingPlanDetails { this.exerciseType = Cache().getExerciseTypeById(exerciseTypeId!); - this.baseOneRepMax = json['baseOneRepMax']; + this.baseOneRepMax = json['baseOneRepMax'] == null ? 0 : json['baseOneRepMax']; } ExerciseType? getExerciseType() => exerciseType; diff --git a/lib/service/mautic.dart b/lib/service/mautic.dart index cd075d0..0ebb54e 100644 --- a/lib/service/mautic.dart +++ b/lib/service/mautic.dart @@ -4,7 +4,7 @@ import 'package:aitrainer_app/model/mautic.dart'; import 'package:aitrainer_app/service/logging.dart'; class MauticApi with Logging { - final String mauticUrl = "https://mautic.aitrainer.app/form/submit?formId="; + final String mauticUrl = "https://mautic.workouttest.org/form/submit?formId="; Future sendMauticForm(Mautic model) async { final String body = model.toForm(); diff --git a/lib/view/training_plan_execute.dart b/lib/view/training_plan_execute.dart index 87d1c82..8f37403 100644 --- a/lib/view/training_plan_execute.dart +++ b/lib/view/training_plan_execute.dart @@ -568,6 +568,8 @@ class ExerciseTile extends StatelessWidget with Trans { final bool hasRightAlternative = detail.alternatives.length > 0 && index + 1 < bloc.alternatives[detail.customerTrainingPlanDetailsId].length; + print("getTile Detail: $detail"); + return Container( child: Stack(alignment: Alignment.centerRight, children: [ Stack(alignment: Alignment.centerLeft, children: [ diff --git a/lib/widgets/exercise_save.dart b/lib/widgets/exercise_save.dart index 608ac25..f9a5bcb 100644 --- a/lib/widgets/exercise_save.dart +++ b/lib/widgets/exercise_save.dart @@ -229,19 +229,22 @@ class _ExerciseSaveState extends State with Trans { : widget.repeats!.toStringAsFixed(0); changable = (_controller2.text != "TEST" && _controller1.text != "TEST"); if (widget.unitQuantityUnit != null && widget.tip != null && Cache().isActivityDone(widget.tip!) == false) { - Timer( + /*Timer( Duration(milliseconds: 2000), () => { - TutorialWidget().explanation( - context, - ExplanationWidget( - unitQuantityUnit: widget.unitQuantityUnit, - unit: widget.unit, - tip: widget.tip, - weight: widget.weight, - repeats: widget.repeats, - )), - }); + if (context != null) + { + TutorialWidget().explanation( + context, + ExplanationWidget( + unitQuantityUnit: widget.unitQuantityUnit, + unit: widget.unit, + tip: widget.tip, + weight: widget.weight, + repeats: widget.repeats, + )), + } + });*/ } }); } @@ -387,7 +390,7 @@ class _ExerciseSaveState extends State with Trans { leading: IconButton( iconSize: 30, onPressed: () => { - if (widget.unitQuantityUnit != null) + if (widget.unitQuantityUnit != null && context != null) { TutorialWidget().explanation( context, diff --git a/pubspec.yaml b/pubspec.yaml index 8d27e4e..657f356 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -15,7 +15,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. # Read more about iOS versioning at # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html -version: 1.1.27+116 +version: 1.1.28+117 environment: sdk: ">=2.18.4 <3.0.0"