mirror of
https://github.com/wger-project/flutter.git
synced 2026-12-06 07:54:02 +01:00
Render the individual workout days
This commit is contained in:
1 parent
fc74e34448
commit
eefec0d5e6
8 files changed
+136
-47
No files matched your search
@@ -12,11 +12,11 @@ class Exercise {
|
||||
final String name;
|
||||
final String description;
|
||||
final cat.Category category;
|
||||
final List<Muscle> muscles;
|
||||
final List<Muscle> musclesSecondary;
|
||||
final List<Equipment> equipment;
|
||||
final List<img.Image> images;
|
||||
final List<Comment> tips;
|
||||
List<Muscle> muscles = [];
|
||||
List<Muscle> musclesSecondary = [];
|
||||
List<Equipment> equipment = [];
|
||||
List<img.Image> images = [];
|
||||
List<Comment> tips = [];
|
||||
|
||||
Exercise({
|
||||
@required this.id,
|
||||
@@ -24,10 +24,10 @@ class Exercise {
|
||||
@required this.creationDate,
|
||||
@required this.name,
|
||||
@required this.description,
|
||||
@required this.category,
|
||||
@required this.muscles,
|
||||
this.category,
|
||||
this.muscles,
|
||||
this.musclesSecondary,
|
||||
@required this.equipment,
|
||||
this.equipment,
|
||||
this.images,
|
||||
this.tips,
|
||||
});
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:wger/models/workouts/set.dart';
|
||||
|
||||
@@ -7,6 +8,24 @@ class Day {
|
||||
List<int> daysOfWeek = [];
|
||||
List<Set> sets = [];
|
||||
|
||||
String getDayName(int weekDay) {
|
||||
Map<int, String> weekdays = {
|
||||
1: 'Monday',
|
||||
2: 'Tuesday',
|
||||
3: 'Wednesday',
|
||||
4: 'Thursday',
|
||||
5: 'Friday',
|
||||
6: 'Saturday',
|
||||
7: 'Sunday',
|
||||
};
|
||||
|
||||
return weekdays[weekDay];
|
||||
}
|
||||
|
||||
String get getAllDays {
|
||||
return daysOfWeek.map((e) => getDayName(e)).join(', ');
|
||||
}
|
||||
|
||||
Day({
|
||||
@required this.id,
|
||||
@required this.description,
|
||||
|
||||
@@ -1,16 +1,19 @@
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:wger/models/exercises/exercise.dart';
|
||||
import 'package:wger/models/workouts/setting.dart';
|
||||
|
||||
class Set {
|
||||
final int id;
|
||||
final int sets;
|
||||
final int order;
|
||||
List<Exercise> exercises = [];
|
||||
List<Setting> settings = [];
|
||||
|
||||
Set({
|
||||
@required this.id,
|
||||
@required this.sets,
|
||||
@required this.order,
|
||||
this.exercises,
|
||||
this.settings,
|
||||
});
|
||||
}
|
||||
@@ -1,24 +1,26 @@
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:wger/models/exercises/exercise.dart';
|
||||
import 'package:wger/models/workouts/repetition_unit.dart';
|
||||
import 'package:wger/models/workouts/weight_unit.dart';
|
||||
|
||||
class Setting {
|
||||
final int id;
|
||||
final Exercise exercise;
|
||||
final RepetitionUnit repetitionUnit;
|
||||
//final RepetitionUnit repetitionUnit;
|
||||
final int reps;
|
||||
final double weight;
|
||||
final WeightUnit weightUnit;
|
||||
//final WeightUnit weightUnit;
|
||||
final String comment;
|
||||
|
||||
// Generated by Server
|
||||
final String repsText;
|
||||
|
||||
Setting({
|
||||
@required this.id,
|
||||
@required this.exercise,
|
||||
@required this.repetitionUnit,
|
||||
this.exercise,
|
||||
//this.repetitionUnit,
|
||||
@required this.reps,
|
||||
@required this.weight,
|
||||
@required this.weightUnit,
|
||||
//this.weightUnit,
|
||||
@required this.comment,
|
||||
this.repsText,
|
||||
});
|
||||
}
|
||||
Reference in new issue
Block a user