diff --git a/AUTHORS.md b/AUTHORS.md index a14238764..e9864010b 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -18,6 +18,7 @@ - Adam Bujdoš - - Aman Negi - - Sandi Milohanic - +- Mohammad Rafigh - - Miroslav Mazel - ## Translators @@ -53,7 +54,7 @@ - Norwegian Bokmål - Allan Nordhøy (98) - + - Japanese - Kosei TANAKA (97) @@ -63,5 +64,5 @@ - Nenza Nurfirmansyah (73) - Croatian - + - Sandi Milohaic diff --git a/lib/providers/exercises.dart b/lib/providers/exercises.dart index 13d6c1690..716549d7a 100644 --- a/lib/providers/exercises.dart +++ b/lib/providers/exercises.dart @@ -191,6 +191,14 @@ class ExercisesProvider with ChangeNotifier { ); } + /// Find exercise base by UUID + ExerciseBase findExerciseBaseByUuid(String uuid) { + return _exerciseBases.firstWhere( + (base) => base.uuid == uuid, + orElse: () => throw NoSuchEntryException(), + ); + } + /// Find exercise bases by variation IDs /// /// exerciseIdToExclude: the ID of the exercise to exclude from the list of diff --git a/lib/widgets/workouts/gym_mode.dart b/lib/widgets/workouts/gym_mode.dart index 96616393e..5e0c63fb9 100644 --- a/lib/widgets/workouts/gym_mode.dart +++ b/lib/widgets/workouts/gym_mode.dart @@ -41,6 +41,7 @@ import 'package:wger/providers/workout_plans.dart'; import 'package:wger/theme/theme.dart'; import 'package:wger/widgets/core/core.dart'; import 'package:wger/widgets/exercises/images.dart'; +import 'package:wger/widgets/exercises/videos.dart'; import 'package:wger/widgets/workouts/forms.dart'; class GymMode extends StatefulWidget { @@ -698,6 +699,17 @@ class ExerciseOverview extends StatelessWidget { textAlign: TextAlign.center, )) .toList(), + if (_exerciseBase.videos.isNotEmpty) + SizedBox( + width: double.infinity, + height: 200, + child: ListView( + scrollDirection: Axis.horizontal, + children: [ + ..._exerciseBase.videos.map((e) => ExerciseVideoWidget(video: e)).toList(), + ], + ), + ), if (_exerciseBase.images.isNotEmpty) SizedBox( width: double.infinity, @@ -1063,6 +1075,8 @@ class NavigationHeader extends StatelessWidget { }); Widget getDialog(BuildContext context) { + final exerciseProvider = Provider.of(context, listen: false); + return AlertDialog( title: Text( AppLocalizations.of(context).jumpTo, @@ -1074,7 +1088,11 @@ class NavigationHeader extends StatelessWidget { children: [ ...exercisePages.keys.map((e) { return ListTile( - title: Text(e), + title: Text( + exerciseProvider.findExerciseBaseByUuid(e).getExercise( + Localizations.localeOf(context).languageCode + ).name + ), trailing: const Icon(Icons.chevron_right), onTap: () { _controller.animateToPage(