WT1.1.10+5 bugfix
This commit is contained in:
@@ -27,7 +27,13 @@ class ExerciseDeviceRepository {
|
||||
}
|
||||
|
||||
bool isGymElement(String name) {
|
||||
return name == "Cable" || name == "Baar" || name == "Gym Machine" || name == "Dumbbells" || name == "Barbell";
|
||||
return name == "Cable" ||
|
||||
name == "Baar" ||
|
||||
name == "Gym Machine" ||
|
||||
name == "Dumbbells" ||
|
||||
name == "Barbell" ||
|
||||
name == "HOME" ||
|
||||
name == "STREET";
|
||||
}
|
||||
|
||||
List<ExerciseDevice> getGymDevices() {
|
||||
|
||||
@@ -276,7 +276,13 @@ class ExerciseRepository {
|
||||
return;
|
||||
}
|
||||
|
||||
exerciseList.sort((a, b) => b.dateAdd.compareTo(a.dateAdd));
|
||||
exerciseList.sort((a, b) {
|
||||
final String datePartA = DateFormat('yyyyMMdd', AppLanguage().appLocal.toString()).format(a.dateAdd);
|
||||
String aId = a.exerciseTypeId.toString() + "_" + datePartA;
|
||||
final String datePartB = DateFormat('yyyyMMdd', AppLanguage().appLocal.toString()).format(b.dateAdd);
|
||||
String bId = b.exerciseTypeId.toString() + "_" + datePartB;
|
||||
return aId.compareTo(bId);
|
||||
});
|
||||
|
||||
this.exerciseLogList = List();
|
||||
String summary = "";
|
||||
@@ -289,8 +295,8 @@ class ExerciseRepository {
|
||||
Exercise exercise = exerciseList[i];
|
||||
int exerciseTypeId = exercise.exerciseTypeId;
|
||||
String exerciseDate = DateFormat("yyyy-MM-dd", AppLanguage().appLocal.toString()).format(exercise.dateAdd);
|
||||
//print(" -- $prevExerciseTypeId - $prevDate");
|
||||
if (!(exerciseTypeId == prevExerciseTypeId && prevDate == exerciseDate)) {
|
||||
print(" -- $prevExerciseTypeId - '$prevDate' against $exerciseTypeId - '$exerciseDate'");
|
||||
if (exerciseTypeId != prevExerciseTypeId || prevDate != exerciseDate) {
|
||||
ExerciseType exerciseType = Cache().getExerciseTypeById(prevExercise.exerciseTypeId);
|
||||
String unit = exerciseType.unitQuantityUnit != null ? exerciseType.unitQuantityUnit : prevExercise.unit;
|
||||
prevExercise.summary = summary + " " + unit;
|
||||
@@ -308,12 +314,14 @@ class ExerciseRepository {
|
||||
if (exerciseType.unitQuantity == "1") {
|
||||
summary += "x" + exercise.unitQuantity.toStringAsFixed(0);
|
||||
}
|
||||
//print(" --- sum " + exerciseType.name + " $summary");
|
||||
print(" --- sum " + exerciseType.name + " $summary");
|
||||
|
||||
prevExerciseTypeId = exerciseTypeId;
|
||||
prevDate = exerciseDate;
|
||||
prevExercise = exercise;
|
||||
prevCount++;
|
||||
}
|
||||
prevExercise.summary = summary;
|
||||
exerciseLogList.add(prevExercise);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ class WorkoutTreeRepository with Logging {
|
||||
WorkoutType workoutType;
|
||||
final List<WorkoutMenuTree> menuAsExercise = List();
|
||||
|
||||
Future<void> createTree() async {
|
||||
void createTree() {
|
||||
//if (Cache().getExerciseTree().length > 0 || Cache().getWorkoutMenuTree().length > 0) return;
|
||||
isEnglish = AppLanguage().appLocal == Locale('en');
|
||||
log("** Start creating tree on lang: " +
|
||||
@@ -35,14 +35,7 @@ class WorkoutTreeRepository with Logging {
|
||||
Cache().getExerciseTree().length.toString());
|
||||
|
||||
List<ExerciseTree> exerciseTree = Cache().getExerciseTree();
|
||||
if (exerciseTree == null || exerciseTree.length == 0) {
|
||||
exerciseTree = await ExerciseTreeApi().getExerciseTree();
|
||||
}
|
||||
|
||||
List<ExerciseType> exerciseTypes = Cache().getExerciseTypes();
|
||||
if (exerciseTypes == null || exerciseTypes.length == 0) {
|
||||
exerciseTypes = await ExerciseTypeApi().getExerciseTypes();
|
||||
}
|
||||
|
||||
exerciseTree.sort((a, b) => a.sort.compareTo(b.sort));
|
||||
|
||||
@@ -177,7 +170,7 @@ class WorkoutTreeRepository with Logging {
|
||||
WorkoutMenuTree treeItem = value as WorkoutMenuTree;
|
||||
if (treeItem.id == treeId) {
|
||||
isTreeItem1RM = isTreeItem1RM || treeItem.is1RM;
|
||||
//log (treeItem.name + " 1RM " + treeItem.is1RM.toString() );
|
||||
//log(treeItem.name + " 1RM " + treeItem.is1RM.toString());
|
||||
}
|
||||
});
|
||||
|
||||
@@ -305,7 +298,7 @@ class WorkoutTreeRepository with Logging {
|
||||
WorkoutMenuTree workoutTree = value as WorkoutMenuTree;
|
||||
if (!workoutTree.nameEnglish.contains('Muscle Build') && workoutTree.is1RM && workoutTree.exerciseTypeId == 0) {
|
||||
String treeName = getAntagonistSort(workoutTree.nameEnglish) + ". " + workoutTree.name;
|
||||
print("TreeName $treeName ${workoutTree.name}");
|
||||
//print("TreeName $treeName ${workoutTree.name}");
|
||||
sortedTree[treeName] = this.getBranchList(workoutTree.id);
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user