Skip to content

Commit fc97552

Browse files
authored
Merge pull request #479 from Milksheyke/feature/contribue-exercise-suggestion
Feature - contribue exercise suggestion button when no exercises can be found.
2 parents 0299510 + 7fe9b64 commit fc97552

File tree

4 files changed

+27
-0
lines changed

4 files changed

+27
-0
lines changed

AUTHORS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
- artchiee - <https://github.com/artchiee>
2424
- Tejas Bir Singh - <https://github.com/tejasbirsingh>
2525
- Abhishek Saini - <https://github.com/Abhisheksainii>
26+
- Shey Alnasrawi - <https://github.com/Milksheyke>
2627

2728
## Translators
2829

lib/l10n/app_ar.arb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -420,6 +420,10 @@
420420
"@searchExercise": {
421421
"description": "Label on set form. Selected exercises are added to the set"
422422
},
423+
"noMatchingExerciseFound": "لم نجد تمرين بهذا الأسم",
424+
"@noMatchingExerciseFound": {
425+
"description": "Message returned if no exercise match the searched string"
426+
},
423427
"registerInstead": "ليس لديك حساب ؟ سجّل الان",
424428
"@registerInstead": {},
425429
"aboutMastodonTitle": "Mastodon",

lib/l10n/app_en.arb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,10 @@
122122
"@searchExercise": {
123123
"description": "Label on set form. Selected exercises are added to the set"
124124
},
125+
"noMatchingExerciseFound": "No matching exercises found",
126+
"@noMatchingExerciseFound": {
127+
"description": "Message returned if no exercises match the searched string"
128+
},
125129
"searchNamesInEnglish": "Also search for names in English",
126130
"supersetWith": "superset with",
127131
"@supersetWith": {

lib/widgets/workouts/forms.dart

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ import 'package:wger/models/workouts/weight_unit.dart';
3030
import 'package:wger/models/workouts/workout_plan.dart';
3131
import 'package:wger/providers/exercises.dart';
3232
import 'package:wger/providers/workout_plans.dart';
33+
import 'package:wger/screens/add_exercise_screen.dart';
3334
import 'package:wger/screens/workout_plan_screen.dart';
3435
import 'package:wger/widgets/exercises/images.dart';
3536

@@ -423,6 +424,23 @@ class _SetFormWidgetState extends State<SetFormWidget> {
423424
),
424425
);
425426
},
427+
noItemsFoundBuilder: (context) {
428+
return Padding(
429+
padding: const EdgeInsets.symmetric(vertical: 8.0),
430+
child: Column(
431+
mainAxisSize: MainAxisSize.min,
432+
children: [
433+
Text(AppLocalizations.of(context).noMatchingExerciseFound),
434+
TextButton(
435+
onPressed: () {
436+
Navigator.of(context).pushNamed(AddExerciseScreen.routeName);
437+
},
438+
child: Text(AppLocalizations.of(context).contributeExercise),
439+
),
440+
],
441+
),
442+
);
443+
},
426444
transitionBuilder: (context, suggestionsBox, controller) {
427445
return suggestionsBox;
428446
},

0 commit comments

Comments
 (0)