WT1.1.8+3 custom plan and training plan fixes
This commit is contained in:
@@ -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 = [];
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user