From 568a165180a71ce1cabc0722bccaeb0b792f28d8 Mon Sep 17 00:00:00 2001 From: Roland Geider Date: Tue, 13 Jul 2021 17:13:19 +0200 Subject: [PATCH] Make more obvious that exercises are added together into a superset Closes #56 --- lib/l10n/app_en.arb | 4 ++++ lib/widgets/workouts/forms.dart | 32 +++++++++++++++++++++++++------- 2 files changed, 29 insertions(+), 7 deletions(-) diff --git a/lib/l10n/app_en.arb b/lib/l10n/app_en.arb index 191af707..1f56cfb8 100644 --- a/lib/l10n/app_en.arb +++ b/lib/l10n/app_en.arb @@ -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" diff --git a/lib/widgets/workouts/forms.dart b/lib/widgets/workouts/forms.dart index 03e8099e..3fcfa88f 100644 --- a/lib/widgets/workouts/forms.dart +++ b/lib/widgets/workouts/forms.dart @@ -440,16 +440,34 @@ class _SetFormWidgetState extends State { ), ), 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(