WT1.1.8+3 custom plan and training plan fixes

This commit is contained in:
bossanyit
2021-06-02 17:25:35 +02:00
parent 2b206fff49
commit d5deaf48a9
24 changed files with 1561 additions and 614 deletions
+10
View File
@@ -4,6 +4,14 @@ import 'package:intl/intl.dart';
import 'package:aitrainer_app/model/customer_training_plan_details.dart';
enum CustomerTrainingPlanType { custom, template, none }
extension CustomerTrainingPlanTypeExt on CustomerTrainingPlanType {
String toStr() => this.toString().split(".").last;
bool equalsTo(CustomerTrainingPlanType type) => this.toString() == type.toString();
bool equalsStringTo(String type) => this.toStr() == type;
}
class CustomerTrainingPlan {
int? customerTrainingPlanId;
int? customerId;
@@ -14,6 +22,8 @@ class CustomerTrainingPlan {
String? name;
CustomerTrainingPlanType type = CustomerTrainingPlanType.none;
CustomerTrainingPlan();
List<CustomerTrainingPlanDetails> details = [];
+5
View File
@@ -1,5 +1,6 @@
import 'package:aitrainer_app/model/exercise_ability.dart';
import 'package:aitrainer_app/util/app_language.dart';
import 'package:aitrainer_app/util/enums.dart';
import 'package:flutter/material.dart';
class ExerciseType {
@@ -48,6 +49,10 @@ class ExerciseType {
/// ability
ExerciseAbility? ability;
/// TrainingPlanState - whether the exercise_type exists in the
/// custom training plan
ExerciseTypeTrainingPlanState trainingPlanState = ExerciseTypeTrainingPlanState.none;
ExerciseType({required this.name, required this.description});
ExerciseType.fromJson(Map json) {