WT 1.1.24+5 training plan fixes

This commit is contained in:
bossanyit
2021-11-05 18:40:58 +01:00
parent e8fc6cd7ec
commit 4c5aff91db
23 changed files with 263 additions and 126 deletions
+2 -2
View File
@@ -31,7 +31,7 @@ import 'package:aitrainer_app/util/enums.dart';
import 'package:aitrainer_app/util/env.dart';
import 'package:aitrainer_app/util/track.dart';
import 'package:firebase_remote_config/firebase_remote_config.dart';
import 'package:flurry_data/flurry_data.dart';
//import 'package:flurry_data/flurry_data.dart';
import 'package:flutter_facebook_auth/flutter_facebook_auth.dart';
import 'package:flutter_uxcam/flutter_uxcam.dart';
import 'package:package_info/package_info.dart';
@@ -689,7 +689,7 @@ class Cache with Logging {
await PackageApi().getCustomerPackage(customerId);
if (!isInDebugMode) {
FlurryData.setUserId(customerId.toString());
//FlurryData.setUserId(customerId.toString());
FlutterUxcam.setUserProperty("username", customerId.toString());
FlutterUxcam.setUserIdentity(customerId.toString());
Smartlook.setUserIdentifier(customerId.toString());
+4
View File
@@ -1,5 +1,6 @@
import 'dart:collection';
import 'dart:convert';
import 'package:aitrainer_app/util/common.dart';
import 'package:intl/intl.dart';
import 'package:aitrainer_app/model/customer_training_plan_details.dart';
@@ -61,6 +62,9 @@ class CustomerTrainingPlan {
Iterable iterable = jsonDecode(jsonDetails);
this.details = iterable.map((detail) => CustomerTrainingPlanDetails.fromJsonWithExerciseList(detail)).toList();
this.details.forEach((detail) {
detail.alternatives = Common.getExerciseTypeAlternatives(detail.exerciseTypeId);
});
} on Exception catch (e) {
print("JsonDecode error " + e.toString());
}
@@ -38,7 +38,9 @@ class CustomerTrainingPlanDetails {
bool isTest = false;
double base1RM = -1;
double baseOneRepMax = -1;
List<ExerciseType> alternatives = [];
CustomerTrainingPlanDetails();
@@ -92,7 +94,7 @@ class CustomerTrainingPlanDetails {
this.exerciseType = Cache().getExerciseTypeById(exerciseTypeId!);
this.base1RM = json['base1RM'];
this.baseOneRepMax = json['baseOneRepMax'];
}
ExerciseType? getExerciseType() => exerciseType;
@@ -122,7 +124,7 @@ class CustomerTrainingPlanDetails {
'state': this.state.toStr(),
"isTest": this.isTest,
"dayId": this.dayId,
"base1RM": this.base1RM,
"baseOneRepMax": this.baseOneRepMax,
};
//print("Detail toJson $jsonMap");
@@ -147,5 +149,6 @@ class CustomerTrainingPlanDetails {
this.isTest = from.isTest;
this.day = from.day;
this.dayId = from.dayId;
this.baseOneRepMax = from.baseOneRepMax;
}
}
+2 -2
View File
@@ -19,8 +19,8 @@ class TrainingEvaluationExercise {
int? repeats;
int? maxRepeats;
int? totalLift;
int? maxTotalLift;
double? totalLift;
double? maxTotalLift;
double? oneRepMax;
double? max1RM;