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>.value({}), + returnValue: _i6.Future>.value({}), ) as _i6.Future>); @override @@ -266,8 +264,7 @@ class MockGalleryProvider extends _i1.Mock implements _i4.GalleryProvider { uri, ], ), - returnValue: - _i6.Future>.value({}), + returnValue: _i6.Future>.value({}), ) as _i6.Future>); @override @@ -283,8 +280,7 @@ class MockGalleryProvider extends _i1.Mock implements _i4.GalleryProvider { uri, ], ), - returnValue: - _i6.Future>.value({}), + returnValue: _i6.Future>.value({}), ) as _i6.Future>); @override diff --git a/test/gallery/gallery_provider_test.dart b/test/gallery/gallery_provider_test.dart index 9750866eb..1c6021a8a 100644 --- a/test/gallery/gallery_provider_test.dart +++ b/test/gallery/gallery_provider_test.dart @@ -69,7 +69,7 @@ void main() { final image = gallery.Image( id: 58, date: DateTime(2022, 01, 09), - url: "https://wger.de/media/gallery/170335/d2b9c9e0-d541-41ae-8786-a2ab459e3538.jpg", + url: 'https://wger.de/media/gallery/170335/d2b9c9e0-d541-41ae-8786-a2ab459e3538.jpg', description: "eggsaddjujuit\'ddayhadIforcanview"); galleryProvider.images.add(image); diff --git a/test/gallery/gallery_screen_test.mocks.dart b/test/gallery/gallery_screen_test.mocks.dart index 5bf657f70..0642ae7d4 100644 --- a/test/gallery/gallery_screen_test.mocks.dart +++ b/test/gallery/gallery_screen_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>.value({}), + returnValue: _i6.Future>.value({}), ) as _i6.Future>); @override @@ -266,8 +264,7 @@ class MockGalleryProvider extends _i1.Mock implements _i4.GalleryProvider { uri, ], ), - returnValue: - _i6.Future>.value({}), + returnValue: _i6.Future>.value({}), ) as _i6.Future>); @override @@ -283,8 +280,7 @@ class MockGalleryProvider extends _i1.Mock implements _i4.GalleryProvider { uri, ], ), - returnValue: - _i6.Future>.value({}), + returnValue: _i6.Future>.value({}), ) as _i6.Future>); @override diff --git a/test/measurements/measurement_categories_screen_test.mocks.dart b/test/measurements/measurement_categories_screen_test.mocks.dart index 4459e9d66..1ef3dc244 100644 --- a/test/measurements/measurement_categories_screen_test.mocks.dart +++ b/test/measurements/measurement_categories_screen_test.mocks.dart @@ -23,8 +23,7 @@ import 'package:wger/providers/measurement.dart' as _i4; // ignore_for_file: camel_case_types // ignore_for_file: subtype_of_sealed_class -class _FakeWgerBaseProvider_0 extends _i1.SmartFake - implements _i2.WgerBaseProvider { +class _FakeWgerBaseProvider_0 extends _i1.SmartFake implements _i2.WgerBaseProvider { _FakeWgerBaseProvider_0( Object parent, Invocation parentInvocation, @@ -34,8 +33,7 @@ class _FakeWgerBaseProvider_0 extends _i1.SmartFake ); } -class _FakeMeasurementCategory_1 extends _i1.SmartFake - implements _i3.MeasurementCategory { +class _FakeMeasurementCategory_1 extends _i1.SmartFake implements _i3.MeasurementCategory { _FakeMeasurementCategory_1( Object parent, Invocation parentInvocation, @@ -48,8 +46,7 @@ class _FakeMeasurementCategory_1 extends _i1.SmartFake /// A class which mocks [MeasurementProvider]. /// /// See the documentation for Mockito's code generation for more information. -class MockMeasurementProvider extends _i1.Mock - implements _i4.MeasurementProvider { +class MockMeasurementProvider extends _i1.Mock implements _i4.MeasurementProvider { MockMeasurementProvider() { _i1.throwOnMissingStub(this); } @@ -130,8 +127,7 @@ class MockMeasurementProvider extends _i1.Mock ) as _i5.Future); @override - _i5.Future addCategory(_i3.MeasurementCategory? category) => - (super.noSuchMethod( + _i5.Future addCategory(_i3.MeasurementCategory? category) => (super.noSuchMethod( Invocation.method( #addCategory, [category], diff --git a/test/measurements/measurement_provider_test.mocks.dart b/test/measurements/measurement_provider_test.mocks.dart index b18f41ef6..746c0bcc8 100644 --- a/test/measurements/measurement_provider_test.mocks.dart +++ b/test/measurements/measurement_provider_test.mocks.dart @@ -106,8 +106,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider { ); @override - Map getDefaultHeaders({dynamic includeAuth = false}) => - (super.noSuchMethod( + Map getDefaultHeaders({dynamic includeAuth = false}) => (super.noSuchMethod( Invocation.method( #getDefaultHeaders, [], @@ -153,8 +152,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider { #fetch, [uri], ), - returnValue: - _i5.Future>.value({}), + returnValue: _i5.Future>.value({}), ) as _i5.Future>); @override @@ -179,8 +177,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider { uri, ], ), - returnValue: - _i5.Future>.value({}), + returnValue: _i5.Future>.value({}), ) as _i5.Future>); @override @@ -196,8 +193,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider { uri, ], ), - returnValue: - _i5.Future>.value({}), + returnValue: _i5.Future>.value({}), ) as _i5.Future>); @override diff --git a/test/nutrition/nutrition_provider_test.dart b/test/nutrition/nutrition_provider_test.dart index fdedd435c..8f3f4f95e 100644 --- a/test/nutrition/nutrition_provider_test.dart +++ b/test/nutrition/nutrition_provider_test.dart @@ -21,29 +21,29 @@ void main() { const String diaryUrl = 'nutritiondiary'; const String ingredientUrl = 'ingredient'; - final Map NutritionalPlanInfoResponse = jsonDecode( + final Map nutritionalPlanInfoResponse = jsonDecode( fixture('nutrition/nutritional_plan_info_detail_response.json'), ); - final Map NutritionalPlanDetailResponse = jsonDecode( + final Map nutritionalPlanDetailResponse = jsonDecode( fixture('nutrition/nutritional_plan_detail_response.json'), ); - final List NutritionDiaryResponse = jsonDecode( + final List nutritionDiaryResponse = jsonDecode( fixture('nutrition/nutrition_diary_response.json'), )['results']; - final Map Ingredient59887Response = jsonDecode( + final Map ingredient59887Response = jsonDecode( fixture('nutrition/ingredient_59887_response.json'), ); - final Map Ingredient10065Response = jsonDecode( + final Map ingredient10065Response = jsonDecode( fixture('nutrition/ingredient_10065_response.json'), ); - final Map Ingredient58300Response = jsonDecode( + final Map ingredient58300Response = jsonDecode( fixture('nutrition/ingredient_58300_response.json'), ); final ingredientList = [ - Ingredient.fromJson(Ingredient59887Response), - Ingredient.fromJson(Ingredient10065Response), - Ingredient.fromJson(Ingredient58300Response), + Ingredient.fromJson(ingredient59887Response), + Ingredient.fromJson(ingredient10065Response), + Ingredient.fromJson(ingredient58300Response), ]; nutritionProvider.ingredients = ingredientList; @@ -67,13 +67,13 @@ void main() { when(mockWgerBaseProvider.makeUrl(planUrl, id: anyNamed('id'))).thenReturn(planUri); when(mockWgerBaseProvider.makeUrl(diaryUrl, query: anyNamed('query'))).thenReturn(diaryUri); when(mockWgerBaseProvider.fetch(planInfoUri)).thenAnswer( - (realInvocation) => Future.value(NutritionalPlanInfoResponse), + (realInvocation) => Future.value(nutritionalPlanInfoResponse), ); when(mockWgerBaseProvider.fetch(planUri)).thenAnswer( - (realInvocation) => Future.value(NutritionalPlanDetailResponse), + (realInvocation) => Future.value(nutritionalPlanDetailResponse), ); when(mockWgerBaseProvider.fetchPaginated(diaryUri)).thenAnswer( - (realInvocation) => Future.value(NutritionDiaryResponse), + (realInvocation) => Future.value(nutritionDiaryResponse), ); }); diff --git a/test/nutrition/nutritional_meal_form_test.mocks.dart b/test/nutrition/nutritional_meal_form_test.mocks.dart index 8ed74c571..a4d10af42 100644 --- a/test/nutrition/nutritional_meal_form_test.mocks.dart +++ b/test/nutrition/nutritional_meal_form_test.mocks.dart @@ -25,8 +25,7 @@ import 'package:wger/providers/nutrition.dart' as _i7; // ignore_for_file: camel_case_types // ignore_for_file: subtype_of_sealed_class -class _FakeWgerBaseProvider_0 extends _i1.SmartFake - implements _i2.WgerBaseProvider { +class _FakeWgerBaseProvider_0 extends _i1.SmartFake implements _i2.WgerBaseProvider { _FakeWgerBaseProvider_0( Object parent, Invocation parentInvocation, @@ -36,8 +35,7 @@ class _FakeWgerBaseProvider_0 extends _i1.SmartFake ); } -class _FakeNutritionalPlan_1 extends _i1.SmartFake - implements _i3.NutritionalPlan { +class _FakeNutritionalPlan_1 extends _i1.SmartFake implements _i3.NutritionalPlan { _FakeNutritionalPlan_1( Object parent, Invocation parentInvocation, @@ -80,8 +78,7 @@ class _FakeIngredient_4 extends _i1.SmartFake implements _i6.Ingredient { /// A class which mocks [NutritionPlansProvider]. /// /// See the documentation for Mockito's code generation for more information. -class MockNutritionPlansProvider extends _i1.Mock - implements _i7.NutritionPlansProvider { +class MockNutritionPlansProvider extends _i1.Mock implements _i7.NutritionPlansProvider { MockNutritionPlansProvider() { _i1.throwOnMissingStub(this); } @@ -167,14 +164,12 @@ class MockNutritionPlansProvider extends _i1.Mock ) as _i8.Future); @override - _i8.Future<_i3.NutritionalPlan> fetchAndSetPlanSparse(int? planId) => - (super.noSuchMethod( + _i8.Future<_i3.NutritionalPlan> fetchAndSetPlanSparse(int? planId) => (super.noSuchMethod( Invocation.method( #fetchAndSetPlanSparse, [planId], ), - returnValue: - _i8.Future<_i3.NutritionalPlan>.value(_FakeNutritionalPlan_1( + returnValue: _i8.Future<_i3.NutritionalPlan>.value(_FakeNutritionalPlan_1( this, Invocation.method( #fetchAndSetPlanSparse, @@ -184,14 +179,12 @@ class MockNutritionPlansProvider extends _i1.Mock ) as _i8.Future<_i3.NutritionalPlan>); @override - _i8.Future<_i3.NutritionalPlan> fetchAndSetPlanFull(int? planId) => - (super.noSuchMethod( + _i8.Future<_i3.NutritionalPlan> fetchAndSetPlanFull(int? planId) => (super.noSuchMethod( Invocation.method( #fetchAndSetPlanFull, [planId], ), - returnValue: - _i8.Future<_i3.NutritionalPlan>.value(_FakeNutritionalPlan_1( + returnValue: _i8.Future<_i3.NutritionalPlan>.value(_FakeNutritionalPlan_1( this, Invocation.method( #fetchAndSetPlanFull, @@ -201,14 +194,12 @@ class MockNutritionPlansProvider extends _i1.Mock ) as _i8.Future<_i3.NutritionalPlan>); @override - _i8.Future<_i3.NutritionalPlan> addPlan(_i3.NutritionalPlan? planData) => - (super.noSuchMethod( + _i8.Future<_i3.NutritionalPlan> addPlan(_i3.NutritionalPlan? planData) => (super.noSuchMethod( Invocation.method( #addPlan, [planData], ), - returnValue: - _i8.Future<_i3.NutritionalPlan>.value(_FakeNutritionalPlan_1( + returnValue: _i8.Future<_i3.NutritionalPlan>.value(_FakeNutritionalPlan_1( this, Invocation.method( #addPlan, @@ -313,8 +304,7 @@ class MockNutritionPlansProvider extends _i1.Mock ) as _i8.Future<_i5.MealItem>); @override - _i8.Future deleteMealItem(_i5.MealItem? mealItem) => - (super.noSuchMethod( + _i8.Future deleteMealItem(_i5.MealItem? mealItem) => (super.noSuchMethod( Invocation.method( #deleteMealItem, [mealItem], @@ -324,8 +314,7 @@ class MockNutritionPlansProvider extends _i1.Mock ) as _i8.Future); @override - _i8.Future<_i6.Ingredient> fetchIngredient(int? ingredientId) => - (super.noSuchMethod( + _i8.Future<_i6.Ingredient> fetchIngredient(int? ingredientId) => (super.noSuchMethod( Invocation.method( #fetchIngredient, [ingredientId], @@ -368,8 +357,7 @@ class MockNutritionPlansProvider extends _i1.Mock ) as _i8.Future>); @override - _i8.Future<_i6.Ingredient?> searchIngredientWithCode(String? code) => - (super.noSuchMethod( + _i8.Future<_i6.Ingredient?> searchIngredientWithCode(String? code) => (super.noSuchMethod( Invocation.method( #searchIngredientWithCode, [code], @@ -424,8 +412,7 @@ class MockNutritionPlansProvider extends _i1.Mock ) as _i8.Future); @override - _i8.Future fetchAndSetLogs(_i3.NutritionalPlan? plan) => - (super.noSuchMethod( + _i8.Future fetchAndSetLogs(_i3.NutritionalPlan? plan) => (super.noSuchMethod( Invocation.method( #fetchAndSetLogs, [plan], diff --git a/test/nutrition/nutritional_plan_form_test.mocks.dart b/test/nutrition/nutritional_plan_form_test.mocks.dart index a2b1b9702..ad0fb5e1e 100644 --- a/test/nutrition/nutritional_plan_form_test.mocks.dart +++ b/test/nutrition/nutritional_plan_form_test.mocks.dart @@ -25,8 +25,7 @@ import 'package:wger/providers/nutrition.dart' as _i7; // ignore_for_file: camel_case_types // ignore_for_file: subtype_of_sealed_class -class _FakeWgerBaseProvider_0 extends _i1.SmartFake - implements _i2.WgerBaseProvider { +class _FakeWgerBaseProvider_0 extends _i1.SmartFake implements _i2.WgerBaseProvider { _FakeWgerBaseProvider_0( Object parent, Invocation parentInvocation, @@ -36,8 +35,7 @@ class _FakeWgerBaseProvider_0 extends _i1.SmartFake ); } -class _FakeNutritionalPlan_1 extends _i1.SmartFake - implements _i3.NutritionalPlan { +class _FakeNutritionalPlan_1 extends _i1.SmartFake implements _i3.NutritionalPlan { _FakeNutritionalPlan_1( Object parent, Invocation parentInvocation, @@ -80,8 +78,7 @@ class _FakeIngredient_4 extends _i1.SmartFake implements _i6.Ingredient { /// A class which mocks [NutritionPlansProvider]. /// /// See the documentation for Mockito's code generation for more information. -class MockNutritionPlansProvider extends _i1.Mock - implements _i7.NutritionPlansProvider { +class MockNutritionPlansProvider extends _i1.Mock implements _i7.NutritionPlansProvider { MockNutritionPlansProvider() { _i1.throwOnMissingStub(this); } @@ -167,14 +164,12 @@ class MockNutritionPlansProvider extends _i1.Mock ) as _i8.Future); @override - _i8.Future<_i3.NutritionalPlan> fetchAndSetPlanSparse(int? planId) => - (super.noSuchMethod( + _i8.Future<_i3.NutritionalPlan> fetchAndSetPlanSparse(int? planId) => (super.noSuchMethod( Invocation.method( #fetchAndSetPlanSparse, [planId], ), - returnValue: - _i8.Future<_i3.NutritionalPlan>.value(_FakeNutritionalPlan_1( + returnValue: _i8.Future<_i3.NutritionalPlan>.value(_FakeNutritionalPlan_1( this, Invocation.method( #fetchAndSetPlanSparse, @@ -184,14 +179,12 @@ class MockNutritionPlansProvider extends _i1.Mock ) as _i8.Future<_i3.NutritionalPlan>); @override - _i8.Future<_i3.NutritionalPlan> fetchAndSetPlanFull(int? planId) => - (super.noSuchMethod( + _i8.Future<_i3.NutritionalPlan> fetchAndSetPlanFull(int? planId) => (super.noSuchMethod( Invocation.method( #fetchAndSetPlanFull, [planId], ), - returnValue: - _i8.Future<_i3.NutritionalPlan>.value(_FakeNutritionalPlan_1( + returnValue: _i8.Future<_i3.NutritionalPlan>.value(_FakeNutritionalPlan_1( this, Invocation.method( #fetchAndSetPlanFull, @@ -201,14 +194,12 @@ class MockNutritionPlansProvider extends _i1.Mock ) as _i8.Future<_i3.NutritionalPlan>); @override - _i8.Future<_i3.NutritionalPlan> addPlan(_i3.NutritionalPlan? planData) => - (super.noSuchMethod( + _i8.Future<_i3.NutritionalPlan> addPlan(_i3.NutritionalPlan? planData) => (super.noSuchMethod( Invocation.method( #addPlan, [planData], ), - returnValue: - _i8.Future<_i3.NutritionalPlan>.value(_FakeNutritionalPlan_1( + returnValue: _i8.Future<_i3.NutritionalPlan>.value(_FakeNutritionalPlan_1( this, Invocation.method( #addPlan, @@ -313,8 +304,7 @@ class MockNutritionPlansProvider extends _i1.Mock ) as _i8.Future<_i5.MealItem>); @override - _i8.Future deleteMealItem(_i5.MealItem? mealItem) => - (super.noSuchMethod( + _i8.Future deleteMealItem(_i5.MealItem? mealItem) => (super.noSuchMethod( Invocation.method( #deleteMealItem, [mealItem], @@ -324,8 +314,7 @@ class MockNutritionPlansProvider extends _i1.Mock ) as _i8.Future); @override - _i8.Future<_i6.Ingredient> fetchIngredient(int? ingredientId) => - (super.noSuchMethod( + _i8.Future<_i6.Ingredient> fetchIngredient(int? ingredientId) => (super.noSuchMethod( Invocation.method( #fetchIngredient, [ingredientId], @@ -368,8 +357,7 @@ class MockNutritionPlansProvider extends _i1.Mock ) as _i8.Future>); @override - _i8.Future<_i6.Ingredient?> searchIngredientWithCode(String? code) => - (super.noSuchMethod( + _i8.Future<_i6.Ingredient?> searchIngredientWithCode(String? code) => (super.noSuchMethod( Invocation.method( #searchIngredientWithCode, [code], @@ -424,8 +412,7 @@ class MockNutritionPlansProvider extends _i1.Mock ) as _i8.Future); @override - _i8.Future fetchAndSetLogs(_i3.NutritionalPlan? plan) => - (super.noSuchMethod( + _i8.Future fetchAndSetLogs(_i3.NutritionalPlan? plan) => (super.noSuchMethod( Invocation.method( #fetchAndSetLogs, [plan], diff --git a/test/nutrition/nutritional_plan_screen_test.mocks.dart b/test/nutrition/nutritional_plan_screen_test.mocks.dart index da991af90..eee84b13c 100644 --- a/test/nutrition/nutritional_plan_screen_test.mocks.dart +++ b/test/nutrition/nutritional_plan_screen_test.mocks.dart @@ -65,8 +65,7 @@ class _FakeResponse_3 extends _i1.SmartFake implements _i3.Response { ); } -class _FakeStreamedResponse_4 extends _i1.SmartFake - implements _i3.StreamedResponse { +class _FakeStreamedResponse_4 extends _i1.SmartFake implements _i3.StreamedResponse { _FakeStreamedResponse_4( Object parent, Invocation parentInvocation, @@ -121,8 +120,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider { ); @override - Map getDefaultHeaders({dynamic includeAuth = false}) => - (super.noSuchMethod( + Map getDefaultHeaders({dynamic includeAuth = false}) => (super.noSuchMethod( Invocation.method( #getDefaultHeaders, [], @@ -168,8 +166,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider { #fetch, [uri], ), - returnValue: - _i5.Future>.value({}), + returnValue: _i5.Future>.value({}), ) as _i5.Future>); @override @@ -194,8 +191,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider { uri, ], ), - returnValue: - _i5.Future>.value({}), + returnValue: _i5.Future>.value({}), ) as _i5.Future>); @override @@ -211,8 +207,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider { uri, ], ), - returnValue: - _i5.Future>.value({}), + returnValue: _i5.Future>.value({}), ) as _i5.Future>); @override @@ -277,8 +272,7 @@ class MockAuthProvider extends _i1.Mock implements _i2.AuthProvider { ); @override - set applicationVersion(_i6.PackageInfo? _applicationVersion) => - super.noSuchMethod( + set applicationVersion(_i6.PackageInfo? _applicationVersion) => super.noSuchMethod( Invocation.setter( #applicationVersion, _applicationVersion, @@ -410,8 +404,7 @@ class MockAuthProvider extends _i1.Mock implements _i2.AuthProvider { #serverUrl: serverUrl, }, ), - returnValue: _i5.Future>.value( - {}), + returnValue: _i5.Future>.value({}), ) as _i5.Future>); @override @@ -429,8 +422,7 @@ class MockAuthProvider extends _i1.Mock implements _i2.AuthProvider { serverUrl, ], ), - returnValue: _i5.Future>.value( - {}), + returnValue: _i5.Future>.value({}), ) as _i5.Future>); @override @@ -711,14 +703,12 @@ class MockClient extends _i1.Mock implements _i3.Client { ) as _i5.Future<_i9.Uint8List>); @override - _i5.Future<_i3.StreamedResponse> send(_i3.BaseRequest? request) => - (super.noSuchMethod( + _i5.Future<_i3.StreamedResponse> send(_i3.BaseRequest? request) => (super.noSuchMethod( Invocation.method( #send, [request], ), - returnValue: - _i5.Future<_i3.StreamedResponse>.value(_FakeStreamedResponse_4( + returnValue: _i5.Future<_i3.StreamedResponse>.value(_FakeStreamedResponse_4( this, Invocation.method( #send, diff --git a/test/nutrition/nutritional_plans_screen_test.mocks.dart b/test/nutrition/nutritional_plans_screen_test.mocks.dart index 2cee1227f..4cda1a3db 100644 --- a/test/nutrition/nutritional_plans_screen_test.mocks.dart +++ b/test/nutrition/nutritional_plans_screen_test.mocks.dart @@ -65,8 +65,7 @@ class _FakeResponse_3 extends _i1.SmartFake implements _i2.Response { ); } -class _FakeStreamedResponse_4 extends _i1.SmartFake - implements _i2.StreamedResponse { +class _FakeStreamedResponse_4 extends _i1.SmartFake implements _i2.StreamedResponse { _FakeStreamedResponse_4( Object parent, Invocation parentInvocation, @@ -112,8 +111,7 @@ class MockAuthProvider extends _i1.Mock implements _i3.AuthProvider { ); @override - set applicationVersion(_i4.PackageInfo? _applicationVersion) => - super.noSuchMethod( + set applicationVersion(_i4.PackageInfo? _applicationVersion) => super.noSuchMethod( Invocation.setter( #applicationVersion, _applicationVersion, @@ -245,8 +243,7 @@ class MockAuthProvider extends _i1.Mock implements _i3.AuthProvider { #serverUrl: serverUrl, }, ), - returnValue: _i5.Future>.value( - {}), + returnValue: _i5.Future>.value({}), ) as _i5.Future>); @override @@ -264,8 +261,7 @@ class MockAuthProvider extends _i1.Mock implements _i3.AuthProvider { serverUrl, ], ), - returnValue: _i5.Future>.value( - {}), + returnValue: _i5.Future>.value({}), ) as _i5.Future>); @override @@ -388,8 +384,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i7.WgerBaseProvider { ); @override - Map getDefaultHeaders({dynamic includeAuth = false}) => - (super.noSuchMethod( + Map getDefaultHeaders({dynamic includeAuth = false}) => (super.noSuchMethod( Invocation.method( #getDefaultHeaders, [], @@ -435,8 +430,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i7.WgerBaseProvider { #fetch, [uri], ), - returnValue: - _i5.Future>.value({}), + returnValue: _i5.Future>.value({}), ) as _i5.Future>); @override @@ -461,8 +455,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i7.WgerBaseProvider { uri, ], ), - returnValue: - _i5.Future>.value({}), + returnValue: _i5.Future>.value({}), ) as _i5.Future>); @override @@ -478,8 +471,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i7.WgerBaseProvider { uri, ], ), - returnValue: - _i5.Future>.value({}), + returnValue: _i5.Future>.value({}), ) as _i5.Future>); @override @@ -711,14 +703,12 @@ class MockClient extends _i1.Mock implements _i2.Client { ) as _i5.Future<_i9.Uint8List>); @override - _i5.Future<_i2.StreamedResponse> send(_i2.BaseRequest? request) => - (super.noSuchMethod( + _i5.Future<_i2.StreamedResponse> send(_i2.BaseRequest? request) => (super.noSuchMethod( Invocation.method( #send, [request], ), - returnValue: - _i5.Future<_i2.StreamedResponse>.value(_FakeStreamedResponse_4( + returnValue: _i5.Future<_i2.StreamedResponse>.value(_FakeStreamedResponse_4( this, Invocation.method( #send, diff --git a/test/other/base_provider_test.mocks.dart b/test/other/base_provider_test.mocks.dart index aeb648c76..b9f7770ed 100644 --- a/test/other/base_provider_test.mocks.dart +++ b/test/other/base_provider_test.mocks.dart @@ -31,8 +31,7 @@ class _FakeResponse_0 extends _i1.SmartFake implements _i2.Response { ); } -class _FakeStreamedResponse_1 extends _i1.SmartFake - implements _i2.StreamedResponse { +class _FakeStreamedResponse_1 extends _i1.SmartFake implements _i2.StreamedResponse { _FakeStreamedResponse_1( Object parent, Invocation parentInvocation, @@ -245,14 +244,12 @@ class MockClient extends _i1.Mock implements _i2.Client { ) as _i3.Future<_i5.Uint8List>); @override - _i3.Future<_i2.StreamedResponse> send(_i2.BaseRequest? request) => - (super.noSuchMethod( + _i3.Future<_i2.StreamedResponse> send(_i2.BaseRequest? request) => (super.noSuchMethod( Invocation.method( #send, [request], ), - returnValue: - _i3.Future<_i2.StreamedResponse>.value(_FakeStreamedResponse_1( + returnValue: _i3.Future<_i2.StreamedResponse>.value(_FakeStreamedResponse_1( this, Invocation.method( #send, diff --git a/test/user/provider_test.mocks.dart b/test/user/provider_test.mocks.dart index d6dc8d6eb..3f8bd77a2 100644 --- a/test/user/provider_test.mocks.dart +++ b/test/user/provider_test.mocks.dart @@ -106,8 +106,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider { ); @override - Map getDefaultHeaders({dynamic includeAuth = false}) => - (super.noSuchMethod( + Map getDefaultHeaders({dynamic includeAuth = false}) => (super.noSuchMethod( Invocation.method( #getDefaultHeaders, [], @@ -153,8 +152,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider { #fetch, [uri], ), - returnValue: - _i5.Future>.value({}), + returnValue: _i5.Future>.value({}), ) as _i5.Future>); @override @@ -179,8 +177,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider { uri, ], ), - returnValue: - _i5.Future>.value({}), + returnValue: _i5.Future>.value({}), ) as _i5.Future>); @override @@ -196,8 +193,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider { uri, ], ), - returnValue: - _i5.Future>.value({}), + returnValue: _i5.Future>.value({}), ) as _i5.Future>); @override diff --git a/test/weight/weight_provider_test.mocks.dart b/test/weight/weight_provider_test.mocks.dart index 352c53ad1..8d12e498e 100644 --- a/test/weight/weight_provider_test.mocks.dart +++ b/test/weight/weight_provider_test.mocks.dart @@ -106,8 +106,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider { ); @override - Map getDefaultHeaders({dynamic includeAuth = false}) => - (super.noSuchMethod( + Map getDefaultHeaders({dynamic includeAuth = false}) => (super.noSuchMethod( Invocation.method( #getDefaultHeaders, [], @@ -153,8 +152,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider { #fetch, [uri], ), - returnValue: - _i5.Future>.value({}), + returnValue: _i5.Future>.value({}), ) as _i5.Future>); @override @@ -179,8 +177,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider { uri, ], ), - returnValue: - _i5.Future>.value({}), + returnValue: _i5.Future>.value({}), ) as _i5.Future>); @override @@ -196,8 +193,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider { uri, ], ), - returnValue: - _i5.Future>.value({}), + returnValue: _i5.Future>.value({}), ) as _i5.Future>); @override diff --git a/test/weight/weight_screen_test.mocks.dart b/test/weight/weight_screen_test.mocks.dart index a63186b3d..f53b8c2fe 100644 --- a/test/weight/weight_screen_test.mocks.dart +++ b/test/weight/weight_screen_test.mocks.dart @@ -22,8 +22,7 @@ import 'package:wger/providers/body_weight.dart' as _i4; // ignore_for_file: camel_case_types // ignore_for_file: subtype_of_sealed_class -class _FakeWgerBaseProvider_0 extends _i1.SmartFake - implements _i2.WgerBaseProvider { +class _FakeWgerBaseProvider_0 extends _i1.SmartFake implements _i2.WgerBaseProvider { _FakeWgerBaseProvider_0( Object parent, Invocation parentInvocation, @@ -46,8 +45,7 @@ class _FakeWeightEntry_1 extends _i1.SmartFake implements _i3.WeightEntry { /// A class which mocks [BodyWeightProvider]. /// /// See the documentation for Mockito's code generation for more information. -class MockBodyWeightProvider extends _i1.Mock - implements _i4.BodyWeightProvider { +class MockBodyWeightProvider extends _i1.Mock implements _i4.BodyWeightProvider { MockBodyWeightProvider() { _i1.throwOnMissingStub(this); } @@ -107,8 +105,7 @@ class MockBodyWeightProvider extends _i1.Mock ) as _i3.WeightEntry); @override - _i3.WeightEntry? findByDate(DateTime? date) => - (super.noSuchMethod(Invocation.method( + _i3.WeightEntry? findByDate(DateTime? date) => (super.noSuchMethod(Invocation.method( #findByDate, [date], )) as _i3.WeightEntry?); @@ -119,13 +116,11 @@ class MockBodyWeightProvider extends _i1.Mock #fetchAndSetEntries, [], ), - returnValue: - _i5.Future>.value(<_i3.WeightEntry>[]), + returnValue: _i5.Future>.value(<_i3.WeightEntry>[]), ) as _i5.Future>); @override - _i5.Future<_i3.WeightEntry> addEntry(_i3.WeightEntry? entry) => - (super.noSuchMethod( + _i5.Future<_i3.WeightEntry> addEntry(_i3.WeightEntry? entry) => (super.noSuchMethod( Invocation.method( #addEntry, [entry], diff --git a/test/workout/gym_mode_screen_test.mocks.dart b/test/workout/gym_mode_screen_test.mocks.dart index b32f85875..033e344e8 100644 --- a/test/workout/gym_mode_screen_test.mocks.dart +++ b/test/workout/gym_mode_screen_test.mocks.dart @@ -68,8 +68,7 @@ class _FakeResponse_3 extends _i1.SmartFake implements _i3.Response { ); } -class _FakeWgerBaseProvider_4 extends _i1.SmartFake - implements _i4.WgerBaseProvider { +class _FakeWgerBaseProvider_4 extends _i1.SmartFake implements _i4.WgerBaseProvider { _FakeWgerBaseProvider_4( Object parent, Invocation parentInvocation, @@ -89,8 +88,7 @@ class _FakeExerciseBase_5 extends _i1.SmartFake implements _i5.ExerciseBase { ); } -class _FakeExerciseCategory_6 extends _i1.SmartFake - implements _i6.ExerciseCategory { +class _FakeExerciseCategory_6 extends _i1.SmartFake implements _i6.ExerciseCategory { _FakeExerciseCategory_6( Object parent, Invocation parentInvocation, @@ -175,8 +173,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider { ); @override - Map getDefaultHeaders({dynamic includeAuth = false}) => - (super.noSuchMethod( + Map getDefaultHeaders({dynamic includeAuth = false}) => (super.noSuchMethod( Invocation.method( #getDefaultHeaders, [], @@ -222,8 +219,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider { #fetch, [uri], ), - returnValue: - _i10.Future>.value({}), + returnValue: _i10.Future>.value({}), ) as _i10.Future>); @override @@ -248,8 +244,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider { uri, ], ), - returnValue: - _i10.Future>.value({}), + returnValue: _i10.Future>.value({}), ) as _i10.Future>); @override @@ -265,8 +260,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider { uri, ], ), - returnValue: - _i10.Future>.value({}), + returnValue: _i10.Future>.value({}), ) as _i10.Future>); @override @@ -313,8 +307,7 @@ class MockExercisesProvider extends _i1.Mock implements _i11.ExercisesProvider { ) as _i4.WgerBaseProvider); @override - set exerciseBases(List<_i5.ExerciseBase>? exercisesBases) => - super.noSuchMethod( + set exerciseBases(List<_i5.ExerciseBase>? exercisesBases) => super.noSuchMethod( Invocation.setter( #exerciseBases, exercisesBases, @@ -329,8 +322,7 @@ class MockExercisesProvider extends _i1.Mock implements _i11.ExercisesProvider { ) as List<_i5.ExerciseBase>); @override - set filteredExerciseBases(List<_i5.ExerciseBase>? newFilteredExercises) => - super.noSuchMethod( + set filteredExerciseBases(List<_i5.ExerciseBase>? newFilteredExercises) => super.noSuchMethod( Invocation.setter( #filteredExerciseBases, newFilteredExercises, @@ -339,8 +331,7 @@ class MockExercisesProvider extends _i1.Mock implements _i11.ExercisesProvider { ); @override - Map> get exerciseBasesByVariation => - (super.noSuchMethod( + Map> get exerciseBasesByVariation => (super.noSuchMethod( Invocation.getter(#exerciseBasesByVariation), returnValue: >{}, ) as Map>); @@ -559,8 +550,7 @@ class MockExercisesProvider extends _i1.Mock implements _i11.ExercisesProvider { ) as _i10.Future); @override - _i10.Future<_i5.ExerciseBase> fetchAndSetExerciseBase(int? exerciseBaseId) => - (super.noSuchMethod( + _i10.Future<_i5.ExerciseBase> fetchAndSetExerciseBase(int? exerciseBaseId) => (super.noSuchMethod( Invocation.method( #fetchAndSetExerciseBase, [exerciseBaseId], @@ -575,8 +565,7 @@ class MockExercisesProvider extends _i1.Mock implements _i11.ExercisesProvider { ) as _i10.Future<_i5.ExerciseBase>); @override - _i5.ExerciseBase readExerciseBaseFromBaseInfo(dynamic baseData) => - (super.noSuchMethod( + _i5.ExerciseBase readExerciseBaseFromBaseInfo(dynamic baseData) => (super.noSuchMethod( Invocation.method( #readExerciseBaseFromBaseInfo, [baseData], @@ -625,8 +614,7 @@ class MockExercisesProvider extends _i1.Mock implements _i11.ExercisesProvider { #searchEnglish: searchEnglish, }, ), - returnValue: - _i10.Future>.value(<_i5.ExerciseBase>[]), + returnValue: _i10.Future>.value(<_i5.ExerciseBase>[]), ) as _i10.Future>); @override diff --git a/test/workout/repetition_unit_form_widget_test.mocks.dart b/test/workout/repetition_unit_form_widget_test.mocks.dart index 07ecf14bc..956588067 100644 --- a/test/workout/repetition_unit_form_widget_test.mocks.dart +++ b/test/workout/repetition_unit_form_widget_test.mocks.dart @@ -31,8 +31,7 @@ import 'package:wger/providers/workout_plans.dart' as _i11; // ignore_for_file: camel_case_types // ignore_for_file: subtype_of_sealed_class -class _FakeWgerBaseProvider_0 extends _i1.SmartFake - implements _i2.WgerBaseProvider { +class _FakeWgerBaseProvider_0 extends _i1.SmartFake implements _i2.WgerBaseProvider { _FakeWgerBaseProvider_0( Object parent, Invocation parentInvocation, @@ -52,8 +51,7 @@ class _FakeWeightUnit_1 extends _i1.SmartFake implements _i3.WeightUnit { ); } -class _FakeRepetitionUnit_2 extends _i1.SmartFake - implements _i4.RepetitionUnit { +class _FakeRepetitionUnit_2 extends _i1.SmartFake implements _i4.RepetitionUnit { _FakeRepetitionUnit_2( Object parent, Invocation parentInvocation, @@ -103,8 +101,7 @@ class _FakeSetting_6 extends _i1.SmartFake implements _i8.Setting { ); } -class _FakeWorkoutSession_7 extends _i1.SmartFake - implements _i9.WorkoutSession { +class _FakeWorkoutSession_7 extends _i1.SmartFake implements _i9.WorkoutSession { _FakeWorkoutSession_7( Object parent, Invocation parentInvocation, @@ -127,8 +124,7 @@ class _FakeLog_8 extends _i1.SmartFake implements _i10.Log { /// A class which mocks [WorkoutPlansProvider]. /// /// See the documentation for Mockito's code generation for more information. -class MockWorkoutPlansProvider extends _i1.Mock - implements _i11.WorkoutPlansProvider { +class MockWorkoutPlansProvider extends _i1.Mock implements _i11.WorkoutPlansProvider { MockWorkoutPlansProvider() { _i1.throwOnMissingStub(this); } @@ -265,8 +261,7 @@ class MockWorkoutPlansProvider extends _i1.Mock ) as _i12.Future); @override - _i12.Future<_i5.WorkoutPlan> fetchAndSetPlanSparse(int? planId) => - (super.noSuchMethod( + _i12.Future<_i5.WorkoutPlan> fetchAndSetPlanSparse(int? planId) => (super.noSuchMethod( Invocation.method( #fetchAndSetPlanSparse, [planId], @@ -281,8 +276,7 @@ class MockWorkoutPlansProvider extends _i1.Mock ) as _i12.Future<_i5.WorkoutPlan>); @override - _i12.Future<_i5.WorkoutPlan> fetchAndSetWorkoutPlanFull(int? workoutId) => - (super.noSuchMethod( + _i12.Future<_i5.WorkoutPlan> fetchAndSetWorkoutPlanFull(int? workoutId) => (super.noSuchMethod( Invocation.method( #fetchAndSetWorkoutPlanFull, [workoutId], @@ -297,8 +291,7 @@ class MockWorkoutPlansProvider extends _i1.Mock ) as _i12.Future<_i5.WorkoutPlan>); @override - _i12.Future<_i5.WorkoutPlan> addWorkout(_i5.WorkoutPlan? workout) => - (super.noSuchMethod( + _i12.Future<_i5.WorkoutPlan> addWorkout(_i5.WorkoutPlan? workout) => (super.noSuchMethod( Invocation.method( #addWorkout, [workout], @@ -313,8 +306,7 @@ class MockWorkoutPlansProvider extends _i1.Mock ) as _i12.Future<_i5.WorkoutPlan>); @override - _i12.Future editWorkout(_i5.WorkoutPlan? workout) => - (super.noSuchMethod( + _i12.Future editWorkout(_i5.WorkoutPlan? workout) => (super.noSuchMethod( Invocation.method( #editWorkout, [workout], @@ -346,8 +338,7 @@ class MockWorkoutPlansProvider extends _i1.Mock base, ], ), - returnValue: - _i12.Future>.value({}), + returnValue: _i12.Future>.value({}), ) as _i12.Future>); @override @@ -467,8 +458,7 @@ class MockWorkoutPlansProvider extends _i1.Mock ) as _i12.Future>); @override - _i12.Future fetchComputedSettings(_i7.Set? workoutSet) => - (super.noSuchMethod( + _i12.Future fetchComputedSettings(_i7.Set? workoutSet) => (super.noSuchMethod( Invocation.method( #fetchComputedSettings, [workoutSet], @@ -504,8 +494,7 @@ class MockWorkoutPlansProvider extends _i1.Mock ) as _i12.Future); @override - _i12.Future<_i8.Setting> addSetting(_i8.Setting? workoutSetting) => - (super.noSuchMethod( + _i12.Future<_i8.Setting> addSetting(_i8.Setting? workoutSetting) => (super.noSuchMethod( Invocation.method( #addSetting, [workoutSetting], @@ -529,14 +518,12 @@ class MockWorkoutPlansProvider extends _i1.Mock ) as _i12.Future); @override - _i12.Future<_i9.WorkoutSession> addSession(_i9.WorkoutSession? session) => - (super.noSuchMethod( + _i12.Future<_i9.WorkoutSession> addSession(_i9.WorkoutSession? session) => (super.noSuchMethod( Invocation.method( #addSession, [session], ), - returnValue: - _i12.Future<_i9.WorkoutSession>.value(_FakeWorkoutSession_7( + returnValue: _i12.Future<_i9.WorkoutSession>.value(_FakeWorkoutSession_7( this, Invocation.method( #addSession, diff --git a/test/workout/weight_unit_form_widget_test.mocks.dart b/test/workout/weight_unit_form_widget_test.mocks.dart index 7dacae9e1..2bb2c28a6 100644 --- a/test/workout/weight_unit_form_widget_test.mocks.dart +++ b/test/workout/weight_unit_form_widget_test.mocks.dart @@ -22,8 +22,7 @@ import 'package:wger/providers/body_weight.dart' as _i4; // ignore_for_file: camel_case_types // ignore_for_file: subtype_of_sealed_class -class _FakeWgerBaseProvider_0 extends _i1.SmartFake - implements _i2.WgerBaseProvider { +class _FakeWgerBaseProvider_0 extends _i1.SmartFake implements _i2.WgerBaseProvider { _FakeWgerBaseProvider_0( Object parent, Invocation parentInvocation, @@ -46,8 +45,7 @@ class _FakeWeightEntry_1 extends _i1.SmartFake implements _i3.WeightEntry { /// A class which mocks [BodyWeightProvider]. /// /// See the documentation for Mockito's code generation for more information. -class MockBodyWeightProvider extends _i1.Mock - implements _i4.BodyWeightProvider { +class MockBodyWeightProvider extends _i1.Mock implements _i4.BodyWeightProvider { MockBodyWeightProvider() { _i1.throwOnMissingStub(this); } @@ -107,8 +105,7 @@ class MockBodyWeightProvider extends _i1.Mock ) as _i3.WeightEntry); @override - _i3.WeightEntry? findByDate(DateTime? date) => - (super.noSuchMethod(Invocation.method( + _i3.WeightEntry? findByDate(DateTime? date) => (super.noSuchMethod(Invocation.method( #findByDate, [date], )) as _i3.WeightEntry?); @@ -119,13 +116,11 @@ class MockBodyWeightProvider extends _i1.Mock #fetchAndSetEntries, [], ), - returnValue: - _i5.Future>.value(<_i3.WeightEntry>[]), + returnValue: _i5.Future>.value(<_i3.WeightEntry>[]), ) as _i5.Future>); @override - _i5.Future<_i3.WeightEntry> addEntry(_i3.WeightEntry? entry) => - (super.noSuchMethod( + _i5.Future<_i3.WeightEntry> addEntry(_i3.WeightEntry? entry) => (super.noSuchMethod( Invocation.method( #addEntry, [entry], diff --git a/test/workout/workout_day_form_test.mocks.dart b/test/workout/workout_day_form_test.mocks.dart index c147b84f0..9811b312b 100644 --- a/test/workout/workout_day_form_test.mocks.dart +++ b/test/workout/workout_day_form_test.mocks.dart @@ -31,8 +31,7 @@ import 'package:wger/providers/workout_plans.dart' as _i11; // ignore_for_file: camel_case_types // ignore_for_file: subtype_of_sealed_class -class _FakeWgerBaseProvider_0 extends _i1.SmartFake - implements _i2.WgerBaseProvider { +class _FakeWgerBaseProvider_0 extends _i1.SmartFake implements _i2.WgerBaseProvider { _FakeWgerBaseProvider_0( Object parent, Invocation parentInvocation, @@ -52,8 +51,7 @@ class _FakeWeightUnit_1 extends _i1.SmartFake implements _i3.WeightUnit { ); } -class _FakeRepetitionUnit_2 extends _i1.SmartFake - implements _i4.RepetitionUnit { +class _FakeRepetitionUnit_2 extends _i1.SmartFake implements _i4.RepetitionUnit { _FakeRepetitionUnit_2( Object parent, Invocation parentInvocation, @@ -103,8 +101,7 @@ class _FakeSetting_6 extends _i1.SmartFake implements _i8.Setting { ); } -class _FakeWorkoutSession_7 extends _i1.SmartFake - implements _i9.WorkoutSession { +class _FakeWorkoutSession_7 extends _i1.SmartFake implements _i9.WorkoutSession { _FakeWorkoutSession_7( Object parent, Invocation parentInvocation, @@ -127,8 +124,7 @@ class _FakeLog_8 extends _i1.SmartFake implements _i10.Log { /// A class which mocks [WorkoutPlansProvider]. /// /// See the documentation for Mockito's code generation for more information. -class MockWorkoutPlansProvider extends _i1.Mock - implements _i11.WorkoutPlansProvider { +class MockWorkoutPlansProvider extends _i1.Mock implements _i11.WorkoutPlansProvider { MockWorkoutPlansProvider() { _i1.throwOnMissingStub(this); } @@ -265,8 +261,7 @@ class MockWorkoutPlansProvider extends _i1.Mock ) as _i12.Future); @override - _i12.Future<_i5.WorkoutPlan> fetchAndSetPlanSparse(int? planId) => - (super.noSuchMethod( + _i12.Future<_i5.WorkoutPlan> fetchAndSetPlanSparse(int? planId) => (super.noSuchMethod( Invocation.method( #fetchAndSetPlanSparse, [planId], @@ -281,8 +276,7 @@ class MockWorkoutPlansProvider extends _i1.Mock ) as _i12.Future<_i5.WorkoutPlan>); @override - _i12.Future<_i5.WorkoutPlan> fetchAndSetWorkoutPlanFull(int? workoutId) => - (super.noSuchMethod( + _i12.Future<_i5.WorkoutPlan> fetchAndSetWorkoutPlanFull(int? workoutId) => (super.noSuchMethod( Invocation.method( #fetchAndSetWorkoutPlanFull, [workoutId], @@ -297,8 +291,7 @@ class MockWorkoutPlansProvider extends _i1.Mock ) as _i12.Future<_i5.WorkoutPlan>); @override - _i12.Future<_i5.WorkoutPlan> addWorkout(_i5.WorkoutPlan? workout) => - (super.noSuchMethod( + _i12.Future<_i5.WorkoutPlan> addWorkout(_i5.WorkoutPlan? workout) => (super.noSuchMethod( Invocation.method( #addWorkout, [workout], @@ -313,8 +306,7 @@ class MockWorkoutPlansProvider extends _i1.Mock ) as _i12.Future<_i5.WorkoutPlan>); @override - _i12.Future editWorkout(_i5.WorkoutPlan? workout) => - (super.noSuchMethod( + _i12.Future editWorkout(_i5.WorkoutPlan? workout) => (super.noSuchMethod( Invocation.method( #editWorkout, [workout], @@ -346,8 +338,7 @@ class MockWorkoutPlansProvider extends _i1.Mock base, ], ), - returnValue: - _i12.Future>.value({}), + returnValue: _i12.Future>.value({}), ) as _i12.Future>); @override @@ -467,8 +458,7 @@ class MockWorkoutPlansProvider extends _i1.Mock ) as _i12.Future>); @override - _i12.Future fetchComputedSettings(_i7.Set? workoutSet) => - (super.noSuchMethod( + _i12.Future fetchComputedSettings(_i7.Set? workoutSet) => (super.noSuchMethod( Invocation.method( #fetchComputedSettings, [workoutSet], @@ -504,8 +494,7 @@ class MockWorkoutPlansProvider extends _i1.Mock ) as _i12.Future); @override - _i12.Future<_i8.Setting> addSetting(_i8.Setting? workoutSetting) => - (super.noSuchMethod( + _i12.Future<_i8.Setting> addSetting(_i8.Setting? workoutSetting) => (super.noSuchMethod( Invocation.method( #addSetting, [workoutSetting], @@ -529,14 +518,12 @@ class MockWorkoutPlansProvider extends _i1.Mock ) as _i12.Future); @override - _i12.Future<_i9.WorkoutSession> addSession(_i9.WorkoutSession? session) => - (super.noSuchMethod( + _i12.Future<_i9.WorkoutSession> addSession(_i9.WorkoutSession? session) => (super.noSuchMethod( Invocation.method( #addSession, [session], ), - returnValue: - _i12.Future<_i9.WorkoutSession>.value(_FakeWorkoutSession_7( + returnValue: _i12.Future<_i9.WorkoutSession>.value(_FakeWorkoutSession_7( this, Invocation.method( #addSession, diff --git a/test/workout/workout_form_test.mocks.dart b/test/workout/workout_form_test.mocks.dart index a61e2a921..26964b783 100644 --- a/test/workout/workout_form_test.mocks.dart +++ b/test/workout/workout_form_test.mocks.dart @@ -31,8 +31,7 @@ import 'package:wger/providers/workout_plans.dart' as _i11; // ignore_for_file: camel_case_types // ignore_for_file: subtype_of_sealed_class -class _FakeWgerBaseProvider_0 extends _i1.SmartFake - implements _i2.WgerBaseProvider { +class _FakeWgerBaseProvider_0 extends _i1.SmartFake implements _i2.WgerBaseProvider { _FakeWgerBaseProvider_0( Object parent, Invocation parentInvocation, @@ -52,8 +51,7 @@ class _FakeWeightUnit_1 extends _i1.SmartFake implements _i3.WeightUnit { ); } -class _FakeRepetitionUnit_2 extends _i1.SmartFake - implements _i4.RepetitionUnit { +class _FakeRepetitionUnit_2 extends _i1.SmartFake implements _i4.RepetitionUnit { _FakeRepetitionUnit_2( Object parent, Invocation parentInvocation, @@ -103,8 +101,7 @@ class _FakeSetting_6 extends _i1.SmartFake implements _i8.Setting { ); } -class _FakeWorkoutSession_7 extends _i1.SmartFake - implements _i9.WorkoutSession { +class _FakeWorkoutSession_7 extends _i1.SmartFake implements _i9.WorkoutSession { _FakeWorkoutSession_7( Object parent, Invocation parentInvocation, @@ -127,8 +124,7 @@ class _FakeLog_8 extends _i1.SmartFake implements _i10.Log { /// A class which mocks [WorkoutPlansProvider]. /// /// See the documentation for Mockito's code generation for more information. -class MockWorkoutPlansProvider extends _i1.Mock - implements _i11.WorkoutPlansProvider { +class MockWorkoutPlansProvider extends _i1.Mock implements _i11.WorkoutPlansProvider { MockWorkoutPlansProvider() { _i1.throwOnMissingStub(this); } @@ -265,8 +261,7 @@ class MockWorkoutPlansProvider extends _i1.Mock ) as _i12.Future); @override - _i12.Future<_i5.WorkoutPlan> fetchAndSetPlanSparse(int? planId) => - (super.noSuchMethod( + _i12.Future<_i5.WorkoutPlan> fetchAndSetPlanSparse(int? planId) => (super.noSuchMethod( Invocation.method( #fetchAndSetPlanSparse, [planId], @@ -281,8 +276,7 @@ class MockWorkoutPlansProvider extends _i1.Mock ) as _i12.Future<_i5.WorkoutPlan>); @override - _i12.Future<_i5.WorkoutPlan> fetchAndSetWorkoutPlanFull(int? workoutId) => - (super.noSuchMethod( + _i12.Future<_i5.WorkoutPlan> fetchAndSetWorkoutPlanFull(int? workoutId) => (super.noSuchMethod( Invocation.method( #fetchAndSetWorkoutPlanFull, [workoutId], @@ -297,8 +291,7 @@ class MockWorkoutPlansProvider extends _i1.Mock ) as _i12.Future<_i5.WorkoutPlan>); @override - _i12.Future<_i5.WorkoutPlan> addWorkout(_i5.WorkoutPlan? workout) => - (super.noSuchMethod( + _i12.Future<_i5.WorkoutPlan> addWorkout(_i5.WorkoutPlan? workout) => (super.noSuchMethod( Invocation.method( #addWorkout, [workout], @@ -313,8 +306,7 @@ class MockWorkoutPlansProvider extends _i1.Mock ) as _i12.Future<_i5.WorkoutPlan>); @override - _i12.Future editWorkout(_i5.WorkoutPlan? workout) => - (super.noSuchMethod( + _i12.Future editWorkout(_i5.WorkoutPlan? workout) => (super.noSuchMethod( Invocation.method( #editWorkout, [workout], @@ -346,8 +338,7 @@ class MockWorkoutPlansProvider extends _i1.Mock base, ], ), - returnValue: - _i12.Future>.value({}), + returnValue: _i12.Future>.value({}), ) as _i12.Future>); @override @@ -467,8 +458,7 @@ class MockWorkoutPlansProvider extends _i1.Mock ) as _i12.Future>); @override - _i12.Future fetchComputedSettings(_i7.Set? workoutSet) => - (super.noSuchMethod( + _i12.Future fetchComputedSettings(_i7.Set? workoutSet) => (super.noSuchMethod( Invocation.method( #fetchComputedSettings, [workoutSet], @@ -504,8 +494,7 @@ class MockWorkoutPlansProvider extends _i1.Mock ) as _i12.Future); @override - _i12.Future<_i8.Setting> addSetting(_i8.Setting? workoutSetting) => - (super.noSuchMethod( + _i12.Future<_i8.Setting> addSetting(_i8.Setting? workoutSetting) => (super.noSuchMethod( Invocation.method( #addSetting, [workoutSetting], @@ -529,14 +518,12 @@ class MockWorkoutPlansProvider extends _i1.Mock ) as _i12.Future); @override - _i12.Future<_i9.WorkoutSession> addSession(_i9.WorkoutSession? session) => - (super.noSuchMethod( + _i12.Future<_i9.WorkoutSession> addSession(_i9.WorkoutSession? session) => (super.noSuchMethod( Invocation.method( #addSession, [session], ), - returnValue: - _i12.Future<_i9.WorkoutSession>.value(_FakeWorkoutSession_7( + returnValue: _i12.Future<_i9.WorkoutSession>.value(_FakeWorkoutSession_7( this, Invocation.method( #addSession, diff --git a/test/workout/workout_plan_screen_test.mocks.dart b/test/workout/workout_plan_screen_test.mocks.dart index 03f2be6fa..c47859e69 100644 --- a/test/workout/workout_plan_screen_test.mocks.dart +++ b/test/workout/workout_plan_screen_test.mocks.dart @@ -106,8 +106,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider { ); @override - Map getDefaultHeaders({dynamic includeAuth = false}) => - (super.noSuchMethod( + Map getDefaultHeaders({dynamic includeAuth = false}) => (super.noSuchMethod( Invocation.method( #getDefaultHeaders, [], @@ -153,8 +152,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider { #fetch, [uri], ), - returnValue: - _i5.Future>.value({}), + returnValue: _i5.Future>.value({}), ) as _i5.Future>); @override @@ -179,8 +177,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider { uri, ], ), - returnValue: - _i5.Future>.value({}), + returnValue: _i5.Future>.value({}), ) as _i5.Future>); @override @@ -196,8 +193,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider { uri, ], ), - returnValue: - _i5.Future>.value({}), + returnValue: _i5.Future>.value({}), ) as _i5.Future>); @override diff --git a/test/workout/workout_plans_screen_test.mocks.dart b/test/workout/workout_plans_screen_test.mocks.dart index cdf74da5f..6b542c207 100644 --- a/test/workout/workout_plans_screen_test.mocks.dart +++ b/test/workout/workout_plans_screen_test.mocks.dart @@ -106,8 +106,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider { ); @override - Map getDefaultHeaders({dynamic includeAuth = false}) => - (super.noSuchMethod( + Map getDefaultHeaders({dynamic includeAuth = false}) => (super.noSuchMethod( Invocation.method( #getDefaultHeaders, [], @@ -153,8 +152,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider { #fetch, [uri], ), - returnValue: - _i5.Future>.value({}), + returnValue: _i5.Future>.value({}), ) as _i5.Future>); @override @@ -179,8 +177,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider { uri, ], ), - returnValue: - _i5.Future>.value({}), + returnValue: _i5.Future>.value({}), ) as _i5.Future>); @override @@ -196,8 +193,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider { uri, ], ), - returnValue: - _i5.Future>.value({}), + returnValue: _i5.Future>.value({}), ) as _i5.Future>); @override diff --git a/test/workout/workout_provider_test.dart b/test/workout/workout_provider_test.dart index 598c08490..3c242e82d 100644 --- a/test/workout/workout_provider_test.dart +++ b/test/workout/workout_provider_test.dart @@ -152,10 +152,10 @@ void main() { await provider.fetchAndSetUnits(); final prefsJson = jsonDecode(prefs.getString('workoutUnits')!); - expect(prefsJson["repetitionUnits"].length, 7); - expect(prefsJson["weightUnit"].length, 6); - expect(true, DateTime.parse(prefsJson["date"]).isBefore(DateTime.now())); - expect(true, DateTime.parse(prefsJson["expiresIn"]).isAfter(DateTime.now())); + expect(prefsJson['repetitionUnits'].length, 7); + expect(prefsJson['weightUnit'].length, 6); + expect(true, DateTime.parse(prefsJson['date']).isBefore(DateTime.now())); + expect(true, DateTime.parse(prefsJson['expiresIn']).isAfter(DateTime.now())); }); }); } diff --git a/test/workout/workout_provider_test.mocks.dart b/test/workout/workout_provider_test.mocks.dart index a89a913f4..8ab1d85b8 100644 --- a/test/workout/workout_provider_test.mocks.dart +++ b/test/workout/workout_provider_test.mocks.dart @@ -106,8 +106,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider { ); @override - Map getDefaultHeaders({dynamic includeAuth = false}) => - (super.noSuchMethod( + Map getDefaultHeaders({dynamic includeAuth = false}) => (super.noSuchMethod( Invocation.method( #getDefaultHeaders, [], @@ -153,8 +152,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider { #fetch, [uri], ), - returnValue: - _i5.Future>.value({}), + returnValue: _i5.Future>.value({}), ) as _i5.Future>); @override @@ -179,8 +177,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider { uri, ], ), - returnValue: - _i5.Future>.value({}), + returnValue: _i5.Future>.value({}), ) as _i5.Future>); @override @@ -196,8 +193,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider { uri, ], ), - returnValue: - _i5.Future>.value({}), + returnValue: _i5.Future>.value({}), ) as _i5.Future>); @override diff --git a/test/workout/workout_set_form_test.mocks.dart b/test/workout/workout_set_form_test.mocks.dart index c319ed775..a31bcb5aa 100644 --- a/test/workout/workout_set_form_test.mocks.dart +++ b/test/workout/workout_set_form_test.mocks.dart @@ -38,8 +38,7 @@ import 'package:wger/providers/workout_plans.dart' as _i21; // ignore_for_file: camel_case_types // ignore_for_file: subtype_of_sealed_class -class _FakeWgerBaseProvider_0 extends _i1.SmartFake - implements _i2.WgerBaseProvider { +class _FakeWgerBaseProvider_0 extends _i1.SmartFake implements _i2.WgerBaseProvider { _FakeWgerBaseProvider_0( Object parent, Invocation parentInvocation, @@ -59,8 +58,7 @@ class _FakeExerciseBase_1 extends _i1.SmartFake implements _i3.ExerciseBase { ); } -class _FakeExerciseCategory_2 extends _i1.SmartFake - implements _i4.ExerciseCategory { +class _FakeExerciseCategory_2 extends _i1.SmartFake implements _i4.ExerciseCategory { _FakeExerciseCategory_2( Object parent, Invocation parentInvocation, @@ -150,8 +148,7 @@ class _FakeWeightUnit_10 extends _i1.SmartFake implements _i10.WeightUnit { ); } -class _FakeRepetitionUnit_11 extends _i1.SmartFake - implements _i11.RepetitionUnit { +class _FakeRepetitionUnit_11 extends _i1.SmartFake implements _i11.RepetitionUnit { _FakeRepetitionUnit_11( Object parent, Invocation parentInvocation, @@ -201,8 +198,7 @@ class _FakeSetting_15 extends _i1.SmartFake implements _i15.Setting { ); } -class _FakeWorkoutSession_16 extends _i1.SmartFake - implements _i16.WorkoutSession { +class _FakeWorkoutSession_16 extends _i1.SmartFake implements _i16.WorkoutSession { _FakeWorkoutSession_16( Object parent, Invocation parentInvocation, @@ -240,8 +236,7 @@ class MockExercisesProvider extends _i1.Mock implements _i18.ExercisesProvider { ) as _i2.WgerBaseProvider); @override - set exerciseBases(List<_i3.ExerciseBase>? exercisesBases) => - super.noSuchMethod( + set exerciseBases(List<_i3.ExerciseBase>? exercisesBases) => super.noSuchMethod( Invocation.setter( #exerciseBases, exercisesBases, @@ -256,8 +251,7 @@ class MockExercisesProvider extends _i1.Mock implements _i18.ExercisesProvider { ) as List<_i3.ExerciseBase>); @override - set filteredExerciseBases(List<_i3.ExerciseBase>? newFilteredExercises) => - super.noSuchMethod( + set filteredExerciseBases(List<_i3.ExerciseBase>? newFilteredExercises) => super.noSuchMethod( Invocation.setter( #filteredExerciseBases, newFilteredExercises, @@ -266,8 +260,7 @@ class MockExercisesProvider extends _i1.Mock implements _i18.ExercisesProvider { ); @override - Map> get exerciseBasesByVariation => - (super.noSuchMethod( + Map> get exerciseBasesByVariation => (super.noSuchMethod( Invocation.getter(#exerciseBasesByVariation), returnValue: >{}, ) as Map>); @@ -486,8 +479,7 @@ class MockExercisesProvider extends _i1.Mock implements _i18.ExercisesProvider { ) as _i19.Future); @override - _i19.Future<_i3.ExerciseBase> fetchAndSetExerciseBase(int? exerciseBaseId) => - (super.noSuchMethod( + _i19.Future<_i3.ExerciseBase> fetchAndSetExerciseBase(int? exerciseBaseId) => (super.noSuchMethod( Invocation.method( #fetchAndSetExerciseBase, [exerciseBaseId], @@ -502,8 +494,7 @@ class MockExercisesProvider extends _i1.Mock implements _i18.ExercisesProvider { ) as _i19.Future<_i3.ExerciseBase>); @override - _i3.ExerciseBase readExerciseBaseFromBaseInfo(dynamic baseData) => - (super.noSuchMethod( + _i3.ExerciseBase readExerciseBaseFromBaseInfo(dynamic baseData) => (super.noSuchMethod( Invocation.method( #readExerciseBaseFromBaseInfo, [baseData], @@ -552,8 +543,7 @@ class MockExercisesProvider extends _i1.Mock implements _i18.ExercisesProvider { #searchEnglish: searchEnglish, }, ), - returnValue: - _i19.Future>.value(<_i3.ExerciseBase>[]), + returnValue: _i19.Future>.value(<_i3.ExerciseBase>[]), ) as _i19.Future>); @override @@ -638,8 +628,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i2.WgerBaseProvider { ); @override - Map getDefaultHeaders({dynamic includeAuth = false}) => - (super.noSuchMethod( + Map getDefaultHeaders({dynamic includeAuth = false}) => (super.noSuchMethod( Invocation.method( #getDefaultHeaders, [], @@ -685,8 +674,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i2.WgerBaseProvider { #fetch, [uri], ), - returnValue: - _i19.Future>.value({}), + returnValue: _i19.Future>.value({}), ) as _i19.Future>); @override @@ -711,8 +699,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i2.WgerBaseProvider { uri, ], ), - returnValue: - _i19.Future>.value({}), + returnValue: _i19.Future>.value({}), ) as _i19.Future>); @override @@ -728,8 +715,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i2.WgerBaseProvider { uri, ], ), - returnValue: - _i19.Future>.value({}), + returnValue: _i19.Future>.value({}), ) as _i19.Future>); @override @@ -761,8 +747,7 @@ class MockWgerBaseProvider extends _i1.Mock implements _i2.WgerBaseProvider { /// A class which mocks [WorkoutPlansProvider]. /// /// See the documentation for Mockito's code generation for more information. -class MockWorkoutPlansProvider extends _i1.Mock - implements _i21.WorkoutPlansProvider { +class MockWorkoutPlansProvider extends _i1.Mock implements _i21.WorkoutPlansProvider { MockWorkoutPlansProvider() { _i1.throwOnMissingStub(this); } @@ -899,8 +884,7 @@ class MockWorkoutPlansProvider extends _i1.Mock ) as _i19.Future); @override - _i19.Future<_i12.WorkoutPlan> fetchAndSetPlanSparse(int? planId) => - (super.noSuchMethod( + _i19.Future<_i12.WorkoutPlan> fetchAndSetPlanSparse(int? planId) => (super.noSuchMethod( Invocation.method( #fetchAndSetPlanSparse, [planId], @@ -915,8 +899,7 @@ class MockWorkoutPlansProvider extends _i1.Mock ) as _i19.Future<_i12.WorkoutPlan>); @override - _i19.Future<_i12.WorkoutPlan> fetchAndSetWorkoutPlanFull(int? workoutId) => - (super.noSuchMethod( + _i19.Future<_i12.WorkoutPlan> fetchAndSetWorkoutPlanFull(int? workoutId) => (super.noSuchMethod( Invocation.method( #fetchAndSetWorkoutPlanFull, [workoutId], @@ -931,8 +914,7 @@ class MockWorkoutPlansProvider extends _i1.Mock ) as _i19.Future<_i12.WorkoutPlan>); @override - _i19.Future<_i12.WorkoutPlan> addWorkout(_i12.WorkoutPlan? workout) => - (super.noSuchMethod( + _i19.Future<_i12.WorkoutPlan> addWorkout(_i12.WorkoutPlan? workout) => (super.noSuchMethod( Invocation.method( #addWorkout, [workout], @@ -947,8 +929,7 @@ class MockWorkoutPlansProvider extends _i1.Mock ) as _i19.Future<_i12.WorkoutPlan>); @override - _i19.Future editWorkout(_i12.WorkoutPlan? workout) => - (super.noSuchMethod( + _i19.Future editWorkout(_i12.WorkoutPlan? workout) => (super.noSuchMethod( Invocation.method( #editWorkout, [workout], @@ -980,8 +961,7 @@ class MockWorkoutPlansProvider extends _i1.Mock base, ], ), - returnValue: - _i19.Future>.value({}), + returnValue: _i19.Future>.value({}), ) as _i19.Future>); @override @@ -1101,8 +1081,7 @@ class MockWorkoutPlansProvider extends _i1.Mock ) as _i19.Future>); @override - _i19.Future fetchComputedSettings(_i14.Set? workoutSet) => - (super.noSuchMethod( + _i19.Future fetchComputedSettings(_i14.Set? workoutSet) => (super.noSuchMethod( Invocation.method( #fetchComputedSettings, [workoutSet], @@ -1138,8 +1117,7 @@ class MockWorkoutPlansProvider extends _i1.Mock ) as _i19.Future); @override - _i19.Future<_i15.Setting> addSetting(_i15.Setting? workoutSetting) => - (super.noSuchMethod( + _i19.Future<_i15.Setting> addSetting(_i15.Setting? workoutSetting) => (super.noSuchMethod( Invocation.method( #addSetting, [workoutSetting], @@ -1163,14 +1141,12 @@ class MockWorkoutPlansProvider extends _i1.Mock ) as _i19.Future); @override - _i19.Future<_i16.WorkoutSession> addSession(_i16.WorkoutSession? session) => - (super.noSuchMethod( + _i19.Future<_i16.WorkoutSession> addSession(_i16.WorkoutSession? session) => (super.noSuchMethod( Invocation.method( #addSession, [session], ), - returnValue: - _i19.Future<_i16.WorkoutSession>.value(_FakeWorkoutSession_16( + returnValue: _i19.Future<_i16.WorkoutSession>.value(_FakeWorkoutSession_16( this, Invocation.method( #addSession,