Skip to content

Commit

Permalink
Merge pull request wger-project#445 from 12people/master
Browse files Browse the repository at this point in the history
Maintenance PR
  • Loading branch information
rolandgeider authored Nov 9, 2023
2 parents 09f60fe + ca27faf commit 345a99e
Show file tree
Hide file tree
Showing 107 changed files with 454 additions and 619 deletions.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
10 changes: 10 additions & 0 deletions android/app/src/main/res/drawable/ic_launcher_foreground.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="108dp"
android:height="108dp"
android:viewportWidth="108"
android:viewportHeight="108">
<path
android:pathData="M43.5,51V40.5H37.5V42H33V43.5H28.5V51H27V57H28.5V64.5H33V66H37.5V67.5H43.5V57H64.5V67.5H70.5V66H75V64.5H79.5V57H81V51H79.5V43.5H75V42H70.5V40.5H64.5V51H43.5ZM42,42H39V66H42V42ZM43.5,52.5V55.5H64.5V52.5H43.5ZM66,66H69V42H66V66ZM33,63V45H30V63H33ZM34.5,43.5V64.5H37.5V43.5H34.5ZM75,45V63H78V45H75ZM73.5,64.5V43.5H70.5V64.5H73.5Z"
android:fillColor="#ffffff"
android:fillType="evenOdd"/>
</vector>
1 change: 1 addition & 0 deletions android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/ic_launcher_background"/>
<foreground android:drawable="@drawable/ic_launcher_foreground"/>
<monochrome android:drawable="@drawable/ic_launcher_foreground"/>
</adaptive-icon>
Binary file removed assets_dev/logo_adaptive.png
Binary file not shown.
2 changes: 1 addition & 1 deletion integration_test/5_nutritional_plan.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import 'package:wger/theme/theme.dart';
import '../test/user/provider_test.mocks.dart';

Widget createNutritionalPlanScreen({locale = 'en'}) {
var mockBaseProvider = MockWgerBaseProvider();
final mockBaseProvider = MockWgerBaseProvider();

final key = GlobalKey<NavigatorState>();

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion lib/helpers/colors.dart
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ Iterable<Color> generateChartColors(int nrOfItems) sync* {
for (final color in colors) {
yield color;
}
}
}
1 change: 1 addition & 0 deletions lib/helpers/consts.dart
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ const LANGUAGE_SHORT_ENGLISH = 'en';
///
/// Values taken from exercises/models/image.py
enum EXERCISE_IMAGE_ART_STYLE {
// ignore: unused_field
_, // 0 is not used
LINE_ART,
THREE_D,
Expand Down
4 changes: 2 additions & 2 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import 'package:flutter_zxing/flutter_zxing.dart';
import 'package:provider/provider.dart';
import 'package:wger/providers/add_exercise.dart';
import 'package:wger/providers/base_provider.dart';
Expand Down Expand Up @@ -50,8 +52,6 @@ import 'package:wger/theme/theme.dart';
import 'package:wger/widgets/core/about.dart';

import 'providers/auth.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter_zxing/flutter_zxing.dart';

void main() {
zx.setLogEnabled(kDebugMode);
Expand Down
3 changes: 1 addition & 2 deletions lib/models/body_weight/weight_entry.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 7 additions & 15 deletions lib/models/exercises/base.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions lib/models/exercises/category.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions lib/models/exercises/image.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 2 additions & 5 deletions lib/models/exercises/translation.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions lib/models/measurements/measurement_category.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions lib/models/measurements/measurement_entry.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions lib/models/nutrition/image.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions lib/models/nutrition/ingredient.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 2 additions & 4 deletions lib/models/nutrition/ingredient_weight_unit.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 1 addition & 8 deletions lib/models/nutrition/log.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions lib/models/nutrition/nutritional_plan.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions lib/models/nutrition/nutritional_values.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

import 'dart:ui';

class NutritionalValues {
double energy = 0;
double protein = 0;
Expand Down
3 changes: 1 addition & 2 deletions lib/models/nutrition/weight_unit.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 1 addition & 6 deletions lib/models/user/profile.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions lib/models/workouts/repetition_unit.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 2 additions & 10 deletions lib/models/workouts/session.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions lib/models/workouts/weight_unit.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions lib/models/workouts/workout_plan.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/providers/gallery.dart
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ class GalleryProvider extends WgerBaseProvider with ChangeNotifier {
}

Future<void> deleteImage(gallery.Image image) async {
var response = await deleteRequest(_galleryUrlPath, image.id!);
final response = await deleteRequest(_galleryUrlPath, image.id!);
images.removeWhere((element) => element.id == image.id);

notifyListeners();
Expand Down
12 changes: 7 additions & 5 deletions lib/screens/auth_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -187,17 +187,19 @@ class _AuthCardState extends State<AuthCard> {
_isLoading = false;
});
} on WgerHttpException catch (error) {
showHttpExceptionErrorDialog(error, context);
if (mounted) {
showHttpExceptionErrorDialog(error, context);
}
setState(() {
_isLoading = false;
});
} catch (error) {
if (mounted) {
showErrorDialog(error, context);
setState(() {
_isLoading = false;
});
}
setState(() {
_isLoading = false;
});
}
}

Expand Down Expand Up @@ -249,7 +251,7 @@ class _AuthCardState extends State<AuthCard> {
if (value == null || value.isEmpty) {
return AppLocalizations.of(context).invalidUsername;
}
if (!RegExp(r'^[\w.@+-]+$').hasMatch(value!)) {
if (!RegExp(r'^[\w.@+-]+$').hasMatch(value)) {
return AppLocalizations.of(context).usernameValidChars;
}

Expand Down
1 change: 0 additions & 1 deletion lib/screens/dashboard.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import 'package:wger/widgets/core/app_bar.dart';
Expand Down
2 changes: 1 addition & 1 deletion lib/widgets/add_exercise/add_exercise_dropdown_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ class _AddExerciseDropdownButtonState extends State<AddExerciseDropdownButton> {
items: widget.items
.map(
(item) => DropdownMenuItem<String>(
child: Text(item),
value: item,
child: Text(item),
),
)
.toList(),
Expand Down
4 changes: 3 additions & 1 deletion lib/widgets/add_exercise/mixins/image_picker_mixin.dart
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ mixin ExerciseImagePickerMixin {
}

if (!isFileValid) {
showDialog(context: context, builder: (context) => Text(errorMessage));
if (context.mounted) {
showDialog(context: context, builder: (context) => Text(errorMessage));
}
return;
}
}
Expand Down
Loading

0 comments on commit 345a99e

Please sign in to comment.