diff --git a/android/app/src/main/res/drawable-hdpi/ic_launcher_foreground.png b/android/app/src/main/res/drawable-hdpi/ic_launcher_foreground.png
deleted file mode 100644
index c0c4d66b5..000000000
Binary files a/android/app/src/main/res/drawable-hdpi/ic_launcher_foreground.png and /dev/null differ
diff --git a/android/app/src/main/res/drawable-mdpi/ic_launcher_foreground.png b/android/app/src/main/res/drawable-mdpi/ic_launcher_foreground.png
deleted file mode 100644
index 914dac918..000000000
Binary files a/android/app/src/main/res/drawable-mdpi/ic_launcher_foreground.png and /dev/null differ
diff --git a/android/app/src/main/res/drawable-xhdpi/ic_launcher_foreground.png b/android/app/src/main/res/drawable-xhdpi/ic_launcher_foreground.png
deleted file mode 100644
index 0e6e44772..000000000
Binary files a/android/app/src/main/res/drawable-xhdpi/ic_launcher_foreground.png and /dev/null differ
diff --git a/android/app/src/main/res/drawable-xxhdpi/ic_launcher_foreground.png b/android/app/src/main/res/drawable-xxhdpi/ic_launcher_foreground.png
deleted file mode 100644
index 06bff1417..000000000
Binary files a/android/app/src/main/res/drawable-xxhdpi/ic_launcher_foreground.png and /dev/null differ
diff --git a/android/app/src/main/res/drawable-xxxhdpi/ic_launcher_foreground.png b/android/app/src/main/res/drawable-xxxhdpi/ic_launcher_foreground.png
deleted file mode 100644
index 14728c77c..000000000
Binary files a/android/app/src/main/res/drawable-xxxhdpi/ic_launcher_foreground.png and /dev/null differ
diff --git a/android/app/src/main/res/drawable/ic_launcher_foreground.xml b/android/app/src/main/res/drawable/ic_launcher_foreground.xml
new file mode 100644
index 000000000..9172a677c
--- /dev/null
+++ b/android/app/src/main/res/drawable/ic_launcher_foreground.xml
@@ -0,0 +1,10 @@
+
+
+
diff --git a/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
index 5f349f7f4..b26e945b8 100644
--- a/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
+++ b/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
@@ -2,4 +2,5 @@
+
diff --git a/assets_dev/logo_adaptive.png b/assets_dev/logo_adaptive.png
deleted file mode 100644
index 17d72394e..000000000
Binary files a/assets_dev/logo_adaptive.png and /dev/null differ
diff --git a/integration_test/5_nutritional_plan.dart b/integration_test/5_nutritional_plan.dart
index 78a2993ff..d45a6def9 100644
--- a/integration_test/5_nutritional_plan.dart
+++ b/integration_test/5_nutritional_plan.dart
@@ -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();
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png
index 88c5fc5cf..da9a60943 100644
Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png
index 6bda90f73..2b3b1a948 100644
Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png
index 5307f04ce..0c5443fef 100644
Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png
index 15a4317be..4f2bc8656 100644
Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png
index cdcf167e2..b7539761a 100644
Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png
index 0c50547f5..956eb4bd3 100644
Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png
index b47cbbc22..1c4c2daee 100644
Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png
index 4042785a0..0c5443fef 100644
Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png
index d0ca7ab09..81ed89bc1 100644
Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png
index 7b53d9d3e..af6c44299 100644
Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png
index 6901b7bd5..af6c44299 100644
Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png
index 1b6c4a5fe..91145264b 100644
Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png
index 20c884a5b..a538920e7 100644
Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png
index 5fa92ae09..9579c5e3e 100644
Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png
index fec740623..211d8e572 100644
Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png differ
diff --git a/lib/helpers/colors.dart b/lib/helpers/colors.dart
index 62cb1cf49..8e362db04 100644
--- a/lib/helpers/colors.dart
+++ b/lib/helpers/colors.dart
@@ -40,4 +40,4 @@ Iterable generateChartColors(int nrOfItems) sync* {
for (final color in colors) {
yield color;
}
-}
\ No newline at end of file
+}
diff --git a/lib/helpers/consts.dart b/lib/helpers/consts.dart
index 84f148b3b..d8077cd02 100644
--- a/lib/helpers/consts.dart
+++ b/lib/helpers/consts.dart
@@ -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,
diff --git a/lib/main.dart b/lib/main.dart
index 016c63102..f7b2657d7 100644
--- a/lib/main.dart
+++ b/lib/main.dart
@@ -16,8 +16,10 @@
* along with this program. If not, see .
*/
+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';
@@ -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);
diff --git a/lib/models/body_weight/weight_entry.g.dart b/lib/models/body_weight/weight_entry.g.dart
index 60ee02c9b..d1152d20e 100644
--- a/lib/models/body_weight/weight_entry.g.dart
+++ b/lib/models/body_weight/weight_entry.g.dart
@@ -18,8 +18,7 @@ WeightEntry _$WeightEntryFromJson(Map json) {
);
}
-Map _$WeightEntryToJson(WeightEntry instance) =>
- {
+Map _$WeightEntryToJson(WeightEntry instance) => {
'id': instance.id,
'weight': numToString(instance.weight),
'date': toDate(instance.date),
diff --git a/lib/models/exercises/base.g.dart b/lib/models/exercises/base.g.dart
index b57b9ebfa..d9f7c36ee 100644
--- a/lib/models/exercises/base.g.dart
+++ b/lib/models/exercises/base.g.dart
@@ -24,26 +24,18 @@ ExerciseBase _$ExerciseBaseFromJson(Map json) {
return ExerciseBase(
id: json['id'] as int?,
uuid: json['uuid'] as String?,
- created: json['created'] == null
- ? null
- : DateTime.parse(json['created'] as String),
- lastUpdate: json['last_update'] == null
- ? null
- : DateTime.parse(json['last_update'] as String),
+ created: json['created'] == null ? null : DateTime.parse(json['created'] as String),
+ lastUpdate: json['last_update'] == null ? null : DateTime.parse(json['last_update'] as String),
variationId: json['variations'] as int?,
)
..categoryId = json['category'] as int
- ..musclesIds =
- (json['muscles'] as List).map((e) => e as int).toList()
- ..musclesSecondaryIds = (json['muscles_secondary'] as List)
- .map((e) => e as int)
- .toList()
- ..equipmentIds =
- (json['equipment'] as List).map((e) => e as int).toList();
+ ..musclesIds = (json['muscles'] as List).map((e) => e as int).toList()
+ ..musclesSecondaryIds =
+ (json['muscles_secondary'] as List).map((e) => e as int).toList()
+ ..equipmentIds = (json['equipment'] as List).map((e) => e as int).toList();
}
-Map _$ExerciseBaseToJson(ExerciseBase instance) =>
- {
+Map _$ExerciseBaseToJson(ExerciseBase instance) => {
'id': instance.id,
'uuid': instance.uuid,
'variations': instance.variationId,
diff --git a/lib/models/exercises/category.g.dart b/lib/models/exercises/category.g.dart
index 19383107b..915120d13 100644
--- a/lib/models/exercises/category.g.dart
+++ b/lib/models/exercises/category.g.dart
@@ -17,8 +17,7 @@ ExerciseCategory _$ExerciseCategoryFromJson(Map json) {
);
}
-Map _$ExerciseCategoryToJson(ExerciseCategory instance) =>
- {
+Map _$ExerciseCategoryToJson(ExerciseCategory instance) => {
'id': instance.id,
'name': instance.name,
};
diff --git a/lib/models/exercises/image.g.dart b/lib/models/exercises/image.g.dart
index 1240dc38d..6ef7c62e4 100644
--- a/lib/models/exercises/image.g.dart
+++ b/lib/models/exercises/image.g.dart
@@ -20,8 +20,7 @@ ExerciseImage _$ExerciseImageFromJson(Map json) {
);
}
-Map _$ExerciseImageToJson(ExerciseImage instance) =>
- {
+Map _$ExerciseImageToJson(ExerciseImage instance) => {
'id': instance.id,
'uuid': instance.uuid,
'exercise_base': instance.exerciseBaseId,
diff --git a/lib/models/exercises/translation.g.dart b/lib/models/exercises/translation.g.dart
index d40525477..642c2e7f2 100644
--- a/lib/models/exercises/translation.g.dart
+++ b/lib/models/exercises/translation.g.dart
@@ -22,17 +22,14 @@ Translation _$TranslationFromJson(Map json) {
return Translation(
id: json['id'] as int?,
uuid: json['uuid'] as String?,
- created: json['created'] == null
- ? null
- : DateTime.parse(json['created'] as String),
+ created: json['created'] == null ? null : DateTime.parse(json['created'] as String),
name: json['name'] as String,
description: json['description'] as String,
baseId: json['exercise_base'] as int?,
)..languageId = json['language'] as int;
}
-Map _$TranslationToJson(Translation instance) =>
- {
+Map _$TranslationToJson(Translation instance) => {
'id': instance.id,
'uuid': instance.uuid,
'language': instance.languageId,
diff --git a/lib/models/measurements/measurement_category.g.dart b/lib/models/measurements/measurement_category.g.dart
index ef4ebcd30..eb887b2e7 100644
--- a/lib/models/measurements/measurement_category.g.dart
+++ b/lib/models/measurements/measurement_category.g.dart
@@ -22,9 +22,7 @@ MeasurementCategory _$MeasurementCategoryFromJson(Map json) {
);
}
-Map _$MeasurementCategoryToJson(
- MeasurementCategory instance) =>
- {
+Map _$MeasurementCategoryToJson(MeasurementCategory instance) => {
'id': instance.id,
'name': instance.name,
'unit': instance.unit,
diff --git a/lib/models/measurements/measurement_entry.g.dart b/lib/models/measurements/measurement_entry.g.dart
index 4b0969600..7f6e346ad 100644
--- a/lib/models/measurements/measurement_entry.g.dart
+++ b/lib/models/measurements/measurement_entry.g.dart
@@ -20,8 +20,7 @@ MeasurementEntry _$MeasurementEntryFromJson(Map json) {
);
}
-Map _$MeasurementEntryToJson(MeasurementEntry instance) =>
- {
+Map _$MeasurementEntryToJson(MeasurementEntry instance) => {
'id': instance.id,
'category': instance.category,
'date': toDate(instance.date),
diff --git a/lib/models/nutrition/image.g.dart b/lib/models/nutrition/image.g.dart
index 39272d16a..0bd0771d9 100644
--- a/lib/models/nutrition/image.g.dart
+++ b/lib/models/nutrition/image.g.dart
@@ -38,8 +38,7 @@ IngredientImage _$IngredientImageFromJson(Map json) {
);
}
-Map _$IngredientImageToJson(IngredientImage instance) =>
- {
+Map _$IngredientImageToJson(IngredientImage instance) => {
'id': instance.id,
'uuid': instance.uuid,
'ingredient_id': instance.ingredientId,
diff --git a/lib/models/nutrition/ingredient.g.dart b/lib/models/nutrition/ingredient.g.dart
index fcff133a6..d0ea8cfac 100644
--- a/lib/models/nutrition/ingredient.g.dart
+++ b/lib/models/nutrition/ingredient.g.dart
@@ -43,8 +43,7 @@ Ingredient _$IngredientFromJson(Map json) {
);
}
-Map _$IngredientToJson(Ingredient instance) =>
- {
+Map _$IngredientToJson(Ingredient instance) => {
'id': instance.id,
'code': instance.code,
'name': instance.name,
diff --git a/lib/models/nutrition/ingredient_weight_unit.g.dart b/lib/models/nutrition/ingredient_weight_unit.g.dart
index 74b1f1015..f147a2ee1 100644
--- a/lib/models/nutrition/ingredient_weight_unit.g.dart
+++ b/lib/models/nutrition/ingredient_weight_unit.g.dart
@@ -13,16 +13,14 @@ IngredientWeightUnit _$IngredientWeightUnitFromJson(Map json) {
);
return IngredientWeightUnit(
id: json['id'] as int,
- weightUnit:
- WeightUnit.fromJson(json['weight_unit'] as Map),
+ weightUnit: WeightUnit.fromJson(json['weight_unit'] as Map),
ingredient: Ingredient.fromJson(json['ingredient'] as Map),
grams: json['grams'] as int,
amount: (json['amount'] as num).toDouble(),
);
}
-Map _$IngredientWeightUnitToJson(
- IngredientWeightUnit instance) =>
+Map _$IngredientWeightUnitToJson(IngredientWeightUnit instance) =>
{
'id': instance.id,
'weight_unit': instance.weightUnit,
diff --git a/lib/models/nutrition/log.g.dart b/lib/models/nutrition/log.g.dart
index 390687681..616901551 100644
--- a/lib/models/nutrition/log.g.dart
+++ b/lib/models/nutrition/log.g.dart
@@ -9,14 +9,7 @@ part of 'log.dart';
Log _$LogFromJson(Map json) {
$checkKeys(
json,
- requiredKeys: const [
- 'id',
- 'plan',
- 'datetime',
- 'ingredient',
- 'weight_unit',
- 'amount'
- ],
+ requiredKeys: const ['id', 'plan', 'datetime', 'ingredient', 'weight_unit', 'amount'],
);
return Log(
id: json['id'] as int?,
diff --git a/lib/models/nutrition/nutritional_plan.g.dart b/lib/models/nutrition/nutritional_plan.g.dart
index 9b10d8a5a..661a9f47a 100644
--- a/lib/models/nutrition/nutritional_plan.g.dart
+++ b/lib/models/nutrition/nutritional_plan.g.dart
@@ -18,8 +18,7 @@ NutritionalPlan _$NutritionalPlanFromJson(Map json) {
);
}
-Map _$NutritionalPlanToJson(NutritionalPlan instance) =>
- {
+Map _$NutritionalPlanToJson(NutritionalPlan instance) => {
'id': instance.id,
'description': instance.description,
'creation_date': toDate(instance.creationDate),
diff --git a/lib/models/nutrition/nutritional_values.dart b/lib/models/nutrition/nutritional_values.dart
index 834dcbb26..902fbd32a 100644
--- a/lib/models/nutrition/nutritional_values.dart
+++ b/lib/models/nutrition/nutritional_values.dart
@@ -16,8 +16,6 @@
* along with this program. If not, see .
*/
-import 'dart:ui';
-
class NutritionalValues {
double energy = 0;
double protein = 0;
diff --git a/lib/models/nutrition/weight_unit.g.dart b/lib/models/nutrition/weight_unit.g.dart
index 74e1f0cfb..6f2b9607e 100644
--- a/lib/models/nutrition/weight_unit.g.dart
+++ b/lib/models/nutrition/weight_unit.g.dart
@@ -17,8 +17,7 @@ WeightUnit _$WeightUnitFromJson(Map json) {
);
}
-Map _$WeightUnitToJson(WeightUnit instance) =>
- {
+Map _$WeightUnitToJson(WeightUnit instance) => {
'id': instance.id,
'name': instance.name,
};
diff --git a/lib/models/user/profile.g.dart b/lib/models/user/profile.g.dart
index d9147ebe9..fc05b9cf2 100644
--- a/lib/models/user/profile.g.dart
+++ b/lib/models/user/profile.g.dart
@@ -9,12 +9,7 @@ part of 'profile.dart';
Profile _$ProfileFromJson(Map json) {
$checkKeys(
json,
- requiredKeys: const [
- 'username',
- 'email_verified',
- 'is_trustworthy',
- 'email'
- ],
+ requiredKeys: const ['username', 'email_verified', 'is_trustworthy', 'email'],
);
return Profile(
username: json['username'] as String,
diff --git a/lib/models/workouts/repetition_unit.g.dart b/lib/models/workouts/repetition_unit.g.dart
index 115dc338c..33e6a815e 100644
--- a/lib/models/workouts/repetition_unit.g.dart
+++ b/lib/models/workouts/repetition_unit.g.dart
@@ -17,8 +17,7 @@ RepetitionUnit _$RepetitionUnitFromJson(Map json) {
);
}
-Map _$RepetitionUnitToJson(RepetitionUnit instance) =>
- {
+Map _$RepetitionUnitToJson(RepetitionUnit instance) => {
'id': instance.id,
'name': instance.name,
};
diff --git a/lib/models/workouts/session.g.dart b/lib/models/workouts/session.g.dart
index e16affadb..79f4fee41 100644
--- a/lib/models/workouts/session.g.dart
+++ b/lib/models/workouts/session.g.dart
@@ -9,14 +9,7 @@ part of 'session.dart';
WorkoutSession _$WorkoutSessionFromJson(Map json) {
$checkKeys(
json,
- requiredKeys: const [
- 'id',
- 'workout',
- 'date',
- 'impression',
- 'time_start',
- 'time_end'
- ],
+ requiredKeys: const ['id', 'workout', 'date', 'impression', 'time_start', 'time_end'],
);
return WorkoutSession()
..id = json['id'] as int?
@@ -28,8 +21,7 @@ WorkoutSession _$WorkoutSessionFromJson(Map json) {
..timeEnd = stringToTime(json['time_end'] as String?);
}
-Map _$WorkoutSessionToJson(WorkoutSession instance) =>
- {
+Map _$WorkoutSessionToJson(WorkoutSession instance) => {
'id': instance.id,
'workout': instance.workoutId,
'date': toDate(instance.date),
diff --git a/lib/models/workouts/weight_unit.g.dart b/lib/models/workouts/weight_unit.g.dart
index 74e1f0cfb..6f2b9607e 100644
--- a/lib/models/workouts/weight_unit.g.dart
+++ b/lib/models/workouts/weight_unit.g.dart
@@ -17,8 +17,7 @@ WeightUnit _$WeightUnitFromJson(Map json) {
);
}
-Map _$WeightUnitToJson(WeightUnit instance) =>
- {
+Map _$WeightUnitToJson(WeightUnit instance) => {
'id': instance.id,
'name': instance.name,
};
diff --git a/lib/models/workouts/workout_plan.g.dart b/lib/models/workouts/workout_plan.g.dart
index ef156e3e0..ac1d6fa9f 100644
--- a/lib/models/workouts/workout_plan.g.dart
+++ b/lib/models/workouts/workout_plan.g.dart
@@ -19,8 +19,7 @@ WorkoutPlan _$WorkoutPlanFromJson(Map json) {
);
}
-Map _$WorkoutPlanToJson(WorkoutPlan instance) =>
- {
+Map _$WorkoutPlanToJson(WorkoutPlan instance) => {
'id': instance.id,
'creation_date': instance.creationDate.toIso8601String(),
'name': instance.name,
diff --git a/lib/providers/gallery.dart b/lib/providers/gallery.dart
index f4ad1f4ba..ce1980b4e 100644
--- a/lib/providers/gallery.dart
+++ b/lib/providers/gallery.dart
@@ -103,7 +103,7 @@ class GalleryProvider extends WgerBaseProvider with ChangeNotifier {
}
Future 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();
diff --git a/lib/screens/auth_screen.dart b/lib/screens/auth_screen.dart
index 98f08072d..7424ae8f7 100644
--- a/lib/screens/auth_screen.dart
+++ b/lib/screens/auth_screen.dart
@@ -187,17 +187,19 @@ class _AuthCardState extends State {
_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;
+ });
}
}
@@ -249,7 +251,7 @@ class _AuthCardState extends State {
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;
}
diff --git a/lib/screens/dashboard.dart b/lib/screens/dashboard.dart
index 2723ec956..2b324c389 100644
--- a/lib/screens/dashboard.dart
+++ b/lib/screens/dashboard.dart
@@ -16,7 +16,6 @@
* along with this program. If not, see .
*/
-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';
diff --git a/lib/widgets/add_exercise/add_exercise_dropdown_button.dart b/lib/widgets/add_exercise/add_exercise_dropdown_button.dart
index dda65e15e..0f2894da4 100644
--- a/lib/widgets/add_exercise/add_exercise_dropdown_button.dart
+++ b/lib/widgets/add_exercise/add_exercise_dropdown_button.dart
@@ -49,8 +49,8 @@ class _AddExerciseDropdownButtonState extends State {
items: widget.items
.map(
(item) => DropdownMenuItem(
- child: Text(item),
value: item,
+ child: Text(item),
),
)
.toList(),
diff --git a/lib/widgets/add_exercise/mixins/image_picker_mixin.dart b/lib/widgets/add_exercise/mixins/image_picker_mixin.dart
index 425b0308e..d98a235ee 100644
--- a/lib/widgets/add_exercise/mixins/image_picker_mixin.dart
+++ b/lib/widgets/add_exercise/mixins/image_picker_mixin.dart
@@ -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;
}
}
diff --git a/lib/widgets/core/app_bar.dart b/lib/widgets/core/app_bar.dart
index 8f618cd33..06f1c7466 100644
--- a/lib/widgets/core/app_bar.dart
+++ b/lib/widgets/core/app_bar.dart
@@ -32,7 +32,7 @@ import 'package:wger/widgets/user/forms.dart';
class MainAppBar extends StatelessWidget implements PreferredSizeWidget {
final String _title;
- MainAppBar(this._title);
+ const MainAppBar(this._title);
@override
Widget build(BuildContext context) {
@@ -116,7 +116,7 @@ class MainAppBar extends StatelessWidget implements PreferredSizeWidget {
class EmptyAppBar extends StatelessWidget implements PreferredSizeWidget {
final String _title;
- EmptyAppBar(this._title);
+ const EmptyAppBar(this._title);
@override
Widget build(BuildContext context) {
diff --git a/lib/widgets/core/text_prompt.dart b/lib/widgets/core/text_prompt.dart
index c2b14e775..83dbc0f3a 100644
--- a/lib/widgets/core/text_prompt.dart
+++ b/lib/widgets/core/text_prompt.dart
@@ -13,7 +13,7 @@ class TextPrompt extends StatelessWidget {
style: Theme.of(context).textTheme.headlineMedium,
),
Padding(
- padding: EdgeInsets.only(top: 12),
+ padding: const EdgeInsets.only(top: 12),
child: Text(AppLocalizations.of(context).textPromptSubheading),
),
],
diff --git a/lib/widgets/dashboard/calendar.dart b/lib/widgets/dashboard/calendar.dart
index dea7d7203..f2ade2f5e 100644
--- a/lib/widgets/dashboard/calendar.dart
+++ b/lib/widgets/dashboard/calendar.dart
@@ -17,7 +17,6 @@
*/
import 'package:flutter/material.dart';
-import 'package:flutter/widgets.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import 'package:provider/provider.dart';
import 'package:table_calendar/table_calendar.dart';
diff --git a/lib/widgets/exercises/filter_row.dart b/lib/widgets/exercises/filter_row.dart
index 8fb4c5eae..d7510dd1b 100644
--- a/lib/widgets/exercises/filter_row.dart
+++ b/lib/widgets/exercises/filter_row.dart
@@ -25,7 +25,7 @@ import 'package:wger/screens/add_exercise_screen.dart';
import 'filter_modal.dart';
class FilterRow extends StatefulWidget {
- FilterRow({Key? key}) : super(key: key);
+ const FilterRow({Key? key}) : super(key: key);
@override
_FilterRowState createState() => _FilterRowState();
@@ -89,8 +89,8 @@ class _FilterRowState extends State {
itemBuilder: (context) {
return [
PopupMenuItem(
- child: Text(AppLocalizations.of(context).contributeExercise),
value: ExerciseMoreOption.ADD_EXERCISE,
+ child: Text(AppLocalizations.of(context).contributeExercise),
)
];
},
diff --git a/lib/widgets/exercises/videos.dart b/lib/widgets/exercises/videos.dart
index 655af11cb..4675fc2da 100644
--- a/lib/widgets/exercises/videos.dart
+++ b/lib/widgets/exercises/videos.dart
@@ -17,7 +17,6 @@
*/
import 'package:flutter/material.dart';
-import 'package:flutter/widgets.dart';
import 'package:video_player/video_player.dart';
import 'package:wger/models/exercises/video.dart';
diff --git a/lib/widgets/gallery/overview.dart b/lib/widgets/gallery/overview.dart
index e222ae0b8..a0011c2e5 100644
--- a/lib/widgets/gallery/overview.dart
+++ b/lib/widgets/gallery/overview.dart
@@ -39,7 +39,7 @@ class Gallery extends StatelessWidget {
padding: const EdgeInsets.all(5),
child: RefreshIndicator(
onRefresh: () => provider.fetchAndSetGallery(),
- child: provider.images.length == 0
+ child: provider.images.isEmpty
? TextPrompt()
: MasonryGridView.count(
crossAxisCount: 2,
diff --git a/lib/widgets/measurements/categories_card.dart b/lib/widgets/measurements/categories_card.dart
index 80e746381..bbe89cfc3 100644
--- a/lib/widgets/measurements/categories_card.dart
+++ b/lib/widgets/measurements/categories_card.dart
@@ -8,10 +8,10 @@ import 'charts.dart';
import 'forms.dart';
class CategoriesCard extends StatelessWidget {
- MeasurementCategory currentCategory;
- double? elevation;
+ final MeasurementCategory currentCategory;
+ final double? elevation;
- CategoriesCard(this.currentCategory, {this.elevation});
+ const CategoriesCard(this.currentCategory, {this.elevation});
@override
Widget build(BuildContext context) {
diff --git a/lib/widgets/measurements/forms.dart b/lib/widgets/measurements/forms.dart
index 6270757d1..4e6e09e9a 100644
--- a/lib/widgets/measurements/forms.dart
+++ b/lib/widgets/measurements/forms.dart
@@ -17,7 +17,6 @@
*/
import 'package:flutter/material.dart';
-import 'package:flutter/widgets.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import 'package:provider/provider.dart';
import 'package:wger/exceptions/http_exception.dart';
@@ -110,11 +109,17 @@ class MeasurementCategoryForm extends StatelessWidget {
: await Provider.of(context, listen: false).editCategory(
categoryData['id'], categoryData['name'], categoryData['unit']);
} on WgerHttpException catch (error) {
- showHttpExceptionErrorDialog(error, context);
+ if (context.mounted) {
+ showHttpExceptionErrorDialog(error, context);
+ }
} catch (error) {
- showErrorDialog(error, context);
+ if (context.mounted) {
+ showErrorDialog(error, context);
+ }
+ }
+ if (context.mounted) {
+ Navigator.of(context).pop();
}
- Navigator.of(context).pop();
},
),
],
@@ -272,11 +277,17 @@ class MeasurementEntryForm extends StatelessWidget {
_entryData['date'],
);
} on WgerHttpException catch (error) {
- showHttpExceptionErrorDialog(error, context);
+ if (context.mounted) {
+ showHttpExceptionErrorDialog(error, context);
+ }
} catch (error) {
- showErrorDialog(error, context);
+ if (context.mounted) {
+ showErrorDialog(error, context);
+ }
+ }
+ if (context.mounted) {
+ Navigator.of(context).pop();
}
- Navigator.of(context).pop();
},
),
],
diff --git a/lib/widgets/nutrition/forms.dart b/lib/widgets/nutrition/forms.dart
index 3345a1a56..b0b002253 100644
--- a/lib/widgets/nutrition/forms.dart
+++ b/lib/widgets/nutrition/forms.dart
@@ -192,8 +192,8 @@ class MealItemForm extends StatelessWidget {
),
if (_listMealItems.isNotEmpty) const SizedBox(height: 10.0),
Container(
- child: Text(AppLocalizations.of(context).recentlyUsedIngredients),
padding: const EdgeInsets.all(10.0),
+ child: Text(AppLocalizations.of(context).recentlyUsedIngredients),
),
Expanded(
child: ListView.builder(
@@ -320,8 +320,8 @@ class IngredientLogForm extends StatelessWidget {
),
if (diaryEntries.isNotEmpty) const SizedBox(height: 10.0),
Container(
- child: Text(AppLocalizations.of(context).recentlyUsedIngredients),
padding: const EdgeInsets.all(10.0),
+ child: Text(AppLocalizations.of(context).recentlyUsedIngredients),
),
Expanded(
child: ListView.builder(
@@ -394,22 +394,30 @@ class PlanForm extends StatelessWidget {
try {
if (_plan.id != null) {
await Provider.of(context, listen: false).editPlan(_plan);
- Navigator.of(context).pop();
+ if (context.mounted) {
+ Navigator.of(context).pop();
+ }
} else {
_plan = await Provider.of(context, listen: false)
.addPlan(_plan);
- Navigator.of(context).pushReplacementNamed(
- NutritionalPlanScreen.routeName,
- arguments: _plan,
- );
+ if (context.mounted) {
+ Navigator.of(context).pushReplacementNamed(
+ NutritionalPlanScreen.routeName,
+ arguments: _plan,
+ );
+ }
}
// Saving was successful, reset the data
_descriptionController.clear();
} on WgerHttpException catch (error) {
- showHttpExceptionErrorDialog(error, context);
+ if (context.mounted) {
+ showHttpExceptionErrorDialog(error, context);
+ }
} catch (error) {
- showErrorDialog(error, context);
+ if (context.mounted) {
+ showErrorDialog(error, context);
+ }
}
},
),
diff --git a/lib/widgets/nutrition/meal.dart b/lib/widgets/nutrition/meal.dart
index 528a0bcd5..9e7b49058 100644
--- a/lib/widgets/nutrition/meal.dart
+++ b/lib/widgets/nutrition/meal.dart
@@ -223,37 +223,6 @@ class DismissibleMealHeader extends StatelessWidget {
return Dismissible(
key: Key(_meal.id.toString()),
direction: DismissDirection.startToEnd,
- child: Container(
- padding: const EdgeInsets.all(10),
- decoration: const BoxDecoration(color: Colors.white),
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- if (_meal.name != '')
- Text(
- _meal.name,
- style: Theme.of(context).textTheme.headline5,
- ),
- Row(
- children: [
- Expanded(
- child: Text(
- _meal.time!.format(context),
- style: Theme.of(context).textTheme.headline5,
- ),
- ),
- IconButton(
- visualDensity: VisualDensity.compact,
- icon: _expanded ? const Icon(Icons.unfold_less) : const Icon(Icons.unfold_more),
- onPressed: () {
- _toggle();
- },
- ),
- ],
- ),
- ],
- ),
- ),
background: Container(
color: wgerPrimaryButtonColor, //Theme.of(context).primaryColor,
alignment: Alignment.centerLeft,
@@ -287,6 +256,37 @@ class DismissibleMealHeader extends StatelessWidget {
}
return false;
},
+ child: Container(
+ padding: const EdgeInsets.all(10),
+ decoration: const BoxDecoration(color: Colors.white),
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ if (_meal.name != '')
+ Text(
+ _meal.name,
+ style: Theme.of(context).textTheme.headline5,
+ ),
+ Row(
+ children: [
+ Expanded(
+ child: Text(
+ _meal.time!.format(context),
+ style: Theme.of(context).textTheme.headline5,
+ ),
+ ),
+ IconButton(
+ visualDensity: VisualDensity.compact,
+ icon: _expanded ? const Icon(Icons.unfold_less) : const Icon(Icons.unfold_more),
+ onPressed: () {
+ _toggle();
+ },
+ ),
+ ],
+ ),
+ ],
+ ),
+ ),
);
}
}
diff --git a/lib/widgets/nutrition/nutritional_plans_list.dart b/lib/widgets/nutrition/nutritional_plans_list.dart
index c2678c206..6d1eae27d 100644
--- a/lib/widgets/nutrition/nutritional_plans_list.dart
+++ b/lib/widgets/nutrition/nutritional_plans_list.dart
@@ -32,7 +32,7 @@ class NutritionalPlansList extends StatelessWidget {
Widget build(BuildContext context) {
return RefreshIndicator(
onRefresh: () => _nutritionProvider.fetchAndSetAllPlansSparse(),
- child: _nutritionProvider.items.length == 0
+ child: _nutritionProvider.items.isEmpty
? TextPrompt()
: ListView.builder(
padding: const EdgeInsets.all(10.0),
diff --git a/lib/widgets/nutrition/widgets.dart b/lib/widgets/nutrition/widgets.dart
index 2137c28a1..977eae0aa 100644
--- a/lib/widgets/nutrition/widgets.dart
+++ b/lib/widgets/nutrition/widgets.dart
@@ -16,15 +16,12 @@
* along with this program. If not, see .
*/
-import 'dart:developer';
-import 'dart:io';
-
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
//import 'package:flutter_barcode_scanner/flutter_barcode_scanner.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import 'package:flutter_typeahead/flutter_typeahead.dart';
-import 'package:font_awesome_flutter/font_awesome_flutter.dart';
+import 'package:flutter_zxing/flutter_zxing.dart';
import 'package:provider/provider.dart';
import 'package:wger/helpers/consts.dart';
import 'package:wger/helpers/platform.dart';
@@ -32,8 +29,6 @@ import 'package:wger/helpers/ui.dart';
import 'package:wger/providers/nutrition.dart';
import 'package:wger/widgets/core/core.dart';
-import 'package:flutter_zxing/flutter_zxing.dart';
-
class ScanReader extends StatelessWidget {
String? scannedr;
@@ -212,10 +207,12 @@ class _IngredientTypeaheadState extends State {
}
}
} catch (e) {
- showErrorDialog(e, context);
- // Need to pop back since reader scan is a widget
- // otherwise returns null when back button is pressed
- return Navigator.pop(context);
+ if (context.mounted) {
+ showErrorDialog(e, context);
+ // Need to pop back since reader scan is a widget
+ // otherwise returns null when back button is pressed
+ return Navigator.pop(context);
+ }
}
},
icon: Image.asset('assets/images/barcode_scanner_icon.png'),
diff --git a/lib/widgets/user/forms.dart b/lib/widgets/user/forms.dart
index 14e1f28bc..87907f8ed 100644
--- a/lib/widgets/user/forms.dart
+++ b/lib/widgets/user/forms.dart
@@ -17,7 +17,6 @@
*/
import 'package:flutter/material.dart';
-import 'package:flutter/widgets.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import 'package:provider/provider.dart';
import 'package:wger/models/user/profile.dart';
diff --git a/lib/widgets/weight/forms.dart b/lib/widgets/weight/forms.dart
index 7523f1655..c4b6f6760 100644
--- a/lib/widgets/weight/forms.dart
+++ b/lib/widgets/weight/forms.dart
@@ -17,7 +17,6 @@
*/
import 'package:flutter/material.dart';
-import 'package:flutter/widgets.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import 'package:provider/provider.dart';
import 'package:wger/exceptions/http_exception.dart';
@@ -120,11 +119,17 @@ class WeightForm extends StatelessWidget {
: await Provider.of(context, listen: false)
.editEntry(_weightEntry);
} on WgerHttpException catch (error) {
- showHttpExceptionErrorDialog(error, context);
+ if (context.mounted) {
+ showHttpExceptionErrorDialog(error, context);
+ }
} catch (error) {
- showErrorDialog(error, context);
+ if (context.mounted) {
+ showErrorDialog(error, context);
+ }
+ }
+ if (context.mounted) {
+ Navigator.of(context).pop();
}
- Navigator.of(context).pop();
},
),
],
diff --git a/lib/widgets/workouts/day.dart b/lib/widgets/workouts/day.dart
index 3de5af759..1ea0c3a5c 100644
--- a/lib/widgets/workouts/day.dart
+++ b/lib/widgets/workouts/day.dart
@@ -50,8 +50,8 @@ class SettingWidget extends StatelessWidget {
return ListTile(
leading: InkWell(
child: SizedBox(
- child: ExerciseImageWidget(image: setting.exerciseBaseObj.getMainImage),
width: 45,
+ child: ExerciseImageWidget(image: setting.exerciseBaseObj.getMainImage),
),
onTap: () {
showDialog(
@@ -224,19 +224,19 @@ class _WorkoutDayWidgetState extends State {
physics: const NeverScrollableScrollPhysics(),
shrinkWrap: true,
buildDefaultDragHandles: false,
- onReorder: (_oldIndex, _newIndex) async {
- int _startIndex = 0;
- if (_oldIndex < _newIndex) {
- _newIndex -= 1;
- _startIndex = _oldIndex;
+ onReorder: (oldIndex, newIndex) async {
+ int startIndex = 0;
+ if (oldIndex < newIndex) {
+ newIndex -= 1;
+ startIndex = oldIndex;
} else {
- _startIndex = _newIndex;
+ startIndex = newIndex;
}
setState(() {
- _sets.insert(_newIndex, _sets.removeAt(_oldIndex));
+ _sets.insert(newIndex, _sets.removeAt(oldIndex));
});
_sets = await Provider.of(context, listen: false)
- .reorderSets(_sets, _startIndex);
+ .reorderSets(_sets, startIndex);
},
children: [
for (var i = 0; i < widget._day.sets.length; i++) getSetRow(widget._day.sets[i], i),
@@ -283,6 +283,31 @@ class DayHeaderDismissible extends StatelessWidget {
return Dismissible(
key: Key(_day.id.toString()),
direction: DismissDirection.startToEnd,
+ background: Container(
+ color: wgerPrimaryButtonColor, //Theme.of(context).primaryColor,
+ alignment: Alignment.centerLeft,
+ padding: const EdgeInsets.only(left: 10),
+ child: Column(
+ mainAxisAlignment: MainAxisAlignment.center,
+ children: [
+ Text(
+ AppLocalizations.of(context).gymMode,
+ style: const TextStyle(color: Colors.white),
+ ),
+ const Icon(
+ Icons.play_arrow,
+ color: Colors.white,
+ ),
+ ],
+ ),
+ ),
+ confirmDismiss: (direction) async {
+ // Delete day
+ if (direction == DismissDirection.startToEnd) {
+ Navigator.of(context).pushNamed(GymModeScreen.routeName, arguments: _day);
+ }
+ return false;
+ },
child: Container(
padding: const EdgeInsets.all(10),
decoration: const BoxDecoration(color: Colors.white),
@@ -311,31 +336,6 @@ class DayHeaderDismissible extends StatelessWidget {
],
),
),
- background: Container(
- color: wgerPrimaryButtonColor, //Theme.of(context).primaryColor,
- alignment: Alignment.centerLeft,
- padding: const EdgeInsets.only(left: 10),
- child: Column(
- mainAxisAlignment: MainAxisAlignment.center,
- children: [
- Text(
- AppLocalizations.of(context).gymMode,
- style: const TextStyle(color: Colors.white),
- ),
- const Icon(
- Icons.play_arrow,
- color: Colors.white,
- ),
- ],
- ),
- ),
- confirmDismiss: (direction) async {
- // Delete day
- if (direction == DismissDirection.startToEnd) {
- Navigator.of(context).pushNamed(GymModeScreen.routeName, arguments: _day);
- }
- return false;
- },
);
}
}
diff --git a/lib/widgets/workouts/forms.dart b/lib/widgets/workouts/forms.dart
index 0a13b1cef..3de5b3a66 100644
--- a/lib/widgets/workouts/forms.dart
+++ b/lib/widgets/workouts/forms.dart
@@ -104,15 +104,19 @@ class WorkoutForm extends StatelessWidget {
// Save to DB
if (_plan.id != null) {
await Provider.of(context, listen: false).editWorkout(_plan);
- Navigator.of(context).pop();
+ if (context.mounted) {
+ Navigator.of(context).pop();
+ }
} else {
final WorkoutPlan newPlan =
await Provider.of(context, listen: false)
.addWorkout(_plan);
- Navigator.of(context).pushReplacementNamed(
- WorkoutPlanScreen.routeName,
- arguments: newPlan,
- );
+ if (context.mounted) {
+ Navigator.of(context).pushReplacementNamed(
+ WorkoutPlanScreen.routeName,
+ arguments: newPlan,
+ );
+ }
}
},
),
@@ -541,7 +545,9 @@ class _SetFormWidgetState extends State {
widget._day.sets.add(widget._set);
// Close the bottom sheet
- Navigator.of(context).pop();
+ if (context.mounted) {
+ Navigator.of(context).pop();
+ }
},
),
],
diff --git a/lib/widgets/workouts/gym_mode.dart b/lib/widgets/workouts/gym_mode.dart
index 96616393e..c6731a461 100644
--- a/lib/widgets/workouts/gym_mode.dart
+++ b/lib/widgets/workouts/gym_mode.dart
@@ -466,15 +466,6 @@ class _LogPageState extends State {
},
),
ElevatedButton(
- child: (!_isSaving)
- ? Text(AppLocalizations.of(context).save)
- : const SizedBox(
- height: 20,
- width: 20,
- child: CircularProgressIndicator(
- valueColor: AlwaysStoppedAnimation(Colors.white),
- ),
- ),
onPressed: _isSaving
? null
: () async {
@@ -505,13 +496,26 @@ class _LogPageState extends State {
);
_isSaving = false;
} on WgerHttpException catch (error) {
- showHttpExceptionErrorDialog(error, context);
+ if (mounted) {
+ showHttpExceptionErrorDialog(error, context);
+ }
_isSaving = false;
} catch (error) {
- showErrorDialog(error, context);
+ if (mounted) {
+ showErrorDialog(error, context);
+ }
_isSaving = false;
}
},
+ child: (!_isSaving)
+ ? Text(AppLocalizations.of(context).save)
+ : const SizedBox(
+ height: 20,
+ width: 20,
+ child: CircularProgressIndicator(
+ valueColor: AlwaysStoppedAnimation(Colors.white),
+ ),
+ ),
),
],
),
@@ -781,17 +785,6 @@ class _SessionPageState extends State {
mainAxisAlignment: MainAxisAlignment.center,
children: [
ToggleButtons(
- children: const [
- Icon(
- Icons.sentiment_very_dissatisfied,
- ),
- Icon(
- Icons.sentiment_neutral,
- ),
- Icon(
- Icons.sentiment_very_satisfied,
- ),
- ],
renderBorder: false,
onPressed: (int index) {
setState(() {
@@ -809,6 +802,17 @@ class _SessionPageState extends State {
});
},
isSelected: selectedImpression,
+ children: const [
+ Icon(
+ Icons.sentiment_very_dissatisfied,
+ ),
+ Icon(
+ Icons.sentiment_neutral,
+ ),
+ Icon(
+ Icons.sentiment_very_satisfied,
+ ),
+ ],
),
TextFormField(
decoration: InputDecoration(
@@ -902,11 +906,17 @@ class _SessionPageState extends State {
try {
await Provider.of(context, listen: false)
.addSession(_session);
- Navigator.of(context).pop();
+ if (mounted) {
+ Navigator.of(context).pop();
+ }
} on WgerHttpException catch (error) {
- showHttpExceptionErrorDialog(error, context);
+ if (mounted) {
+ showHttpExceptionErrorDialog(error, context);
+ }
} catch (error) {
- showErrorDialog(error, context);
+ if (mounted) {
+ showErrorDialog(error, context);
+ }
}
},
),
diff --git a/lib/widgets/workouts/workout_logs.dart b/lib/widgets/workouts/workout_logs.dart
index 1147c3c5e..64c8c6f64 100644
--- a/lib/widgets/workouts/workout_logs.dart
+++ b/lib/widgets/workouts/workout_logs.dart
@@ -45,6 +45,13 @@ class _WorkoutLogsState extends State {
return Column(
children: [
ToggleButtons(
+ renderBorder: false,
+ onPressed: (int index) {
+ if (index == 0) {
+ widget._changeMode(WorkoutScreenMode.workout);
+ }
+ },
+ isSelected: const [false, true],
children: const [
Icon(
Icons.table_chart_outlined,
@@ -53,13 +60,6 @@ class _WorkoutLogsState extends State {
Icons.show_chart,
),
],
- renderBorder: false,
- onPressed: (int index) {
- if (index == 0) {
- widget._changeMode(WorkoutScreenMode.workout);
- }
- },
- isSelected: const [false, true],
),
Padding(
padding: const EdgeInsets.symmetric(vertical: 10),
diff --git a/lib/widgets/workouts/workout_plans_list.dart b/lib/widgets/workouts/workout_plans_list.dart
index 875bf5d7f..92723dd40 100644
--- a/lib/widgets/workouts/workout_plans_list.dart
+++ b/lib/widgets/workouts/workout_plans_list.dart
@@ -33,7 +33,7 @@ class WorkoutPlansList extends StatelessWidget {
Widget build(BuildContext context) {
return RefreshIndicator(
onRefresh: () => _workoutProvider.fetchAndSetAllPlansSparse(),
- child: _workoutProvider.items.length == 0
+ child: _workoutProvider.items.isEmpty
? TextPrompt()
: ListView.builder(
padding: const EdgeInsets.all(10.0),
diff --git a/macos/Podfile b/macos/Podfile
index 049abe295..9ec46f8cd 100644
--- a/macos/Podfile
+++ b/macos/Podfile
@@ -1,4 +1,4 @@
-platform :osx, '10.14'
+platform :osx, '10.15'
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
diff --git a/macos/Podfile.lock b/macos/Podfile.lock
index 8ac0f7074..72fa8204f 100644
--- a/macos/Podfile.lock
+++ b/macos/Podfile.lock
@@ -1,4 +1,8 @@
PODS:
+ - file_selector_macos (0.0.1):
+ - FlutterMacOS
+ - flutter_zxing (0.0.1):
+ - FlutterMacOS
- FlutterMacOS (1.0.0)
- package_info_plus (0.0.1):
- FlutterMacOS
@@ -9,18 +13,21 @@ PODS:
- FlutterMacOS
- url_launcher_macos (0.0.1):
- FlutterMacOS
- - wakelock_macos (0.0.1):
- - FlutterMacOS
DEPENDENCIES:
+ - file_selector_macos (from `Flutter/ephemeral/.symlinks/plugins/file_selector_macos/macos`)
+ - flutter_zxing (from `Flutter/ephemeral/.symlinks/plugins/flutter_zxing/macos`)
- FlutterMacOS (from `Flutter/ephemeral`)
- package_info_plus (from `Flutter/ephemeral/.symlinks/plugins/package_info_plus/macos`)
- rive_common (from `Flutter/ephemeral/.symlinks/plugins/rive_common/macos`)
- - shared_preferences_foundation (from `Flutter/ephemeral/.symlinks/plugins/shared_preferences_foundation/macos`)
+ - shared_preferences_foundation (from `Flutter/ephemeral/.symlinks/plugins/shared_preferences_foundation/darwin`)
- url_launcher_macos (from `Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos`)
- - wakelock_macos (from `Flutter/ephemeral/.symlinks/plugins/wakelock_macos/macos`)
EXTERNAL SOURCES:
+ file_selector_macos:
+ :path: Flutter/ephemeral/.symlinks/plugins/file_selector_macos/macos
+ flutter_zxing:
+ :path: Flutter/ephemeral/.symlinks/plugins/flutter_zxing/macos
FlutterMacOS:
:path: Flutter/ephemeral
package_info_plus:
@@ -28,20 +35,19 @@ EXTERNAL SOURCES:
rive_common:
:path: Flutter/ephemeral/.symlinks/plugins/rive_common/macos
shared_preferences_foundation:
- :path: Flutter/ephemeral/.symlinks/plugins/shared_preferences_foundation/macos
+ :path: Flutter/ephemeral/.symlinks/plugins/shared_preferences_foundation/darwin
url_launcher_macos:
:path: Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos
- wakelock_macos:
- :path: Flutter/ephemeral/.symlinks/plugins/wakelock_macos/macos
SPEC CHECKSUMS:
+ file_selector_macos: 0f85c1108e2fd597b58246bc0b0c1cb483d7593b
+ flutter_zxing: ea030278aa2a051cd81a5b0053be9d0569d11c9a
FlutterMacOS: 8f6f14fa908a6fb3fba0cd85dbd81ec4b251fb24
package_info_plus: 02d7a575e80f194102bef286361c6c326e4c29ce
- rive_common: e966d74ca90edb3761cfc559d0f4c884ee947576
+ rive_common: acedcab7802c0ece4b0d838b71d7deb637e1309a
shared_preferences_foundation: 986fc17f3d3251412d18b0265f9c64113a8c2472
url_launcher_macos: 5335912b679c073563f29d89d33d10d459f95451
- wakelock_macos: bc3f2a9bd8d2e6c89fee1e1822e7ddac3bd004a9
-PODFILE CHECKSUM: 353c8bcc5d5b0994e508d035b5431cfe18c1dea7
+PODFILE CHECKSUM: 0d3963a09fc94f580682bd88480486da345dc3f0
-COCOAPODS: 1.12.0
+COCOAPODS: 1.13.0
diff --git a/macos/Runner.xcodeproj/project.pbxproj b/macos/Runner.xcodeproj/project.pbxproj
index d211aabab..9fda4bfbd 100644
--- a/macos/Runner.xcodeproj/project.pbxproj
+++ b/macos/Runner.xcodeproj/project.pbxproj
@@ -203,7 +203,7 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0920;
- LastUpgradeCheck = 1300;
+ LastUpgradeCheck = 1430;
ORGANIZATIONNAME = "";
TargetAttributes = {
33CC10EC2044A3C60003C045 = {
@@ -405,7 +405,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
- MACOSX_DEPLOYMENT_TARGET = 10.14;
+ MACOSX_DEPLOYMENT_TARGET = 10.15;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = macosx;
SWIFT_COMPILATION_MODE = wholemodule;
@@ -484,7 +484,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
- MACOSX_DEPLOYMENT_TARGET = 10.14;
+ MACOSX_DEPLOYMENT_TARGET = 10.15;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = macosx;
@@ -531,7 +531,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
- MACOSX_DEPLOYMENT_TARGET = 10.14;
+ MACOSX_DEPLOYMENT_TARGET = 10.15;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = macosx;
SWIFT_COMPILATION_MODE = wholemodule;
diff --git a/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
index 5d323891c..5dc152fa7 100644
--- a/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
+++ b/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
@@ -1,6 +1,6 @@
);
@override
- _i13.Future<_i4.Translation> addExerciseTranslation(
- _i4.Translation? exercise) =>
+ _i13.Future<_i4.Translation> addExerciseTranslation(_i4.Translation? exercise) =>
(super.noSuchMethod(
Invocation.method(
#addExerciseTranslation,
diff --git a/test/gallery/gallery_form_test.mocks.dart b/test/gallery/gallery_form_test.mocks.dart
index 68ca4e783..c207984de 100644
--- a/test/gallery/gallery_form_test.mocks.dart
+++ b/test/gallery/gallery_form_test.mocks.dart
@@ -193,8 +193,7 @@ class MockGalleryProvider extends _i1.Mock implements _i4.GalleryProvider {
) as _i6.Future);
@override
- Map getDefaultHeaders({dynamic includeAuth = false}) =>
- (super.noSuchMethod(
+ Map getDefaultHeaders({dynamic includeAuth = false}) => (super.noSuchMethod(
Invocation.method(
#getDefaultHeaders,
[],
@@ -240,8 +239,7 @@ class MockGalleryProvider extends _i1.Mock implements _i4.GalleryProvider {
#fetch,
[uri],
),
- returnValue:
- _i6.Future