Make more obvious that exercises are added together into a superset

Closes #56
This commit is contained in:
Roland Geider
2021-07-13 17:13:19 +02:00
parent 5352eb51ee
commit 568a165180
2 changed files with 29 additions and 7 deletions

View File

@@ -108,6 +108,10 @@
"@searchExercise": {
"description": "Label on set form. Selected exercises are added to the set"
},
"supersetWith": "superset with",
"@supersetWith": {
"description": "Text used between exercise cards when adding a new set. Translate as something like 'in a superset with'"
},
"equipment": "Equipment",
"@equipment": {
"description": "Equipment needed to perform an exercise"

View File

@@ -440,16 +440,34 @@ class _SetFormWidgetState extends State<SetFormWidget> {
),
),
SizedBox(height: 10),
...widget._set.exercisesObj.map((exercise) {
...widget._set.exercisesObj.asMap().entries.map((entry) {
final index = entry.key;
final exercise = entry.value;
final showSupersetInfo = (index + 1) < widget._set.exercisesObj.length;
final settings =
widget._set.settings.where((e) => e.exerciseObj.id == exercise.id).toList();
return ExerciseSetting(
exercise,
settings,
_detailed,
_currentSetSliderValue,
removeExercise,
return Column(
children: [
ExerciseSetting(
exercise,
settings,
_detailed,
_currentSetSliderValue,
removeExercise,
),
if (showSupersetInfo)
Padding(
padding: const EdgeInsets.all(3.0),
child: Text('+'),
),
if (showSupersetInfo) Text(AppLocalizations.of(context).supersetWith),
if (showSupersetInfo)
Padding(
padding: const EdgeInsets.all(3.0),
child: Text('+'),
),
],
);
}).toList(),
ElevatedButton(