mirror of
https://github.com/wger-project/flutter.git
synced 2026-12-05 13:07:36 +01:00
Remove the weight screenshots, that can be seen with the measurements
This commit is contained in:
@@ -79,12 +79,6 @@
|
||||
https://media.githubusercontent.com/media/wger-project/flutter/refs/heads/master/fastlane/metadata/android/en-US/images/phoneScreenshots/05%20-%20nutritional%20plan.png
|
||||
</image>
|
||||
</screenshot>
|
||||
<screenshot>
|
||||
<caption>Body weight</caption>
|
||||
<image type="source">
|
||||
https://media.githubusercontent.com/media/wger-project/flutter/refs/heads/master/fastlane/metadata/android/en-US/images/phoneScreenshots/06%20-%20weight.png
|
||||
</image>
|
||||
</screenshot>
|
||||
</screenshots>
|
||||
<releases>
|
||||
<release version="2.0.4" date="2026-08-11">
|
||||
|
||||
@@ -30,7 +30,6 @@ import '../test/screenshots/screenshots_02_workout.dart';
|
||||
import '../test/screenshots/screenshots_03_gym_mode.dart';
|
||||
import '../test/screenshots/screenshots_04_measurements.dart';
|
||||
import '../test/screenshots/screenshots_05_nutritional_plan.dart';
|
||||
import '../test/screenshots/screenshots_06_weight.dart';
|
||||
|
||||
/// Type of device
|
||||
///
|
||||
@@ -181,12 +180,6 @@ void main() {
|
||||
await tester.pumpAndSettle();
|
||||
await takeScreenshot(tester, binding, language, '05 - nutritional plan');
|
||||
});
|
||||
|
||||
testWidgets('body weight screen - $language', (WidgetTester tester) async {
|
||||
await tester.pumpWidget(createWeightScreen(locale: locale));
|
||||
await tester.pumpAndSettle();
|
||||
await takeScreenshot(tester, binding, language, '06 - weight');
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,96 +0,0 @@
|
||||
/*
|
||||
* This file is part of wger Workout Manager <https://github.com/wger-project>.
|
||||
* Copyright (c) 2026 wger Team
|
||||
*
|
||||
* wger Workout Manager is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:mockito/annotations.dart';
|
||||
import 'package:mockito/mockito.dart';
|
||||
import 'package:wger/core/form_screen.dart';
|
||||
import 'package:wger/features/account/providers/user_profile_repository.dart';
|
||||
import 'package:wger/features/measurements/providers/measurement_repository.dart';
|
||||
import 'package:wger/features/measurements/screens/weight_screen.dart';
|
||||
import 'package:wger/features/nutrition/providers/ingredient_repository.dart';
|
||||
import 'package:wger/features/nutrition/providers/nutrition_notifier.dart';
|
||||
import 'package:wger/features/nutrition/providers/nutrition_repository.dart';
|
||||
import 'package:wger/l10n/generated/app_localizations.dart';
|
||||
import 'package:wger/theme/theme.dart';
|
||||
|
||||
import '../../test_data/body_weight.dart';
|
||||
import '../../test_data/profile.dart';
|
||||
import '../../test_data/screenshots/weight.dart';
|
||||
import '../helpers/measurement_repository_stubs.dart';
|
||||
import 'screenshots_06_weight.mocks.dart';
|
||||
|
||||
@GenerateMocks([
|
||||
MeasurementRepository,
|
||||
UserProfileRepository,
|
||||
NutritionRepository,
|
||||
IngredientRepository,
|
||||
])
|
||||
Widget createWeightScreen({Locale? locale}) {
|
||||
locale ??= const Locale('en');
|
||||
final mockMeasurementRepository = MockMeasurementRepository();
|
||||
stubMeasurementReads(
|
||||
mockMeasurementRepository,
|
||||
[getBodyWeightCategory()],
|
||||
getScreenshotBodyWeightEntries(),
|
||||
);
|
||||
|
||||
final mockUserProfileRepository = MockUserProfileRepository();
|
||||
when(
|
||||
mockUserProfileRepository.watchDrift(),
|
||||
).thenAnswer((_) => Stream.value(tUserProfile1));
|
||||
|
||||
final mockNutritionRepo = MockNutritionRepository();
|
||||
final mockIngredientRepo = MockIngredientRepository();
|
||||
when(mockIngredientRepo.getById(any)).thenAnswer((_) async => null);
|
||||
|
||||
final container = ProviderContainer(
|
||||
overrides: [
|
||||
measurementRepositoryProvider.overrideWithValue(mockMeasurementRepository),
|
||||
userProfileRepositoryProvider.overrideWithValue(mockUserProfileRepository),
|
||||
nutritionRepositoryProvider.overrideWithValue(mockNutritionRepo),
|
||||
ingredientRepositoryProvider.overrideWithValue(mockIngredientRepo),
|
||||
],
|
||||
);
|
||||
// Seed the nutrition notifier with the plans behind the weight phases, so
|
||||
// the chart shows their periods as bands.
|
||||
container.read(nutritionProvider.notifier).state = AsyncData(
|
||||
NutritionState(plans: getScreenshotWeightPlans()),
|
||||
);
|
||||
|
||||
return MediaQuery(
|
||||
data: MediaQueryData.fromView(WidgetsBinding.instance.platformDispatcher.views.first).copyWith(
|
||||
padding: EdgeInsets.zero,
|
||||
viewPadding: EdgeInsets.zero,
|
||||
viewInsets: EdgeInsets.zero,
|
||||
),
|
||||
child: UncontrolledProviderScope(
|
||||
container: container,
|
||||
child: MaterialApp(
|
||||
locale: locale,
|
||||
debugShowCheckedModeBanner: false,
|
||||
localizationsDelegates: AppLocalizations.localizationsDelegates,
|
||||
supportedLocales: AppLocalizations.supportedLocales,
|
||||
theme: wgerLightTheme,
|
||||
home: const WeightScreen(),
|
||||
routes: {FormScreen.routeName: (ctx) => const FormScreen()},
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
@@ -1,574 +0,0 @@
|
||||
// Mocks generated by Mockito 5.4.6 from annotations
|
||||
// in wger/test/screenshots/screenshots_06_weight.dart.
|
||||
// Do not manually edit this file.
|
||||
|
||||
// ignore_for_file: no_leading_underscores_for_library_prefixes
|
||||
import 'dart:async' as _i3;
|
||||
|
||||
import 'package:mockito/mockito.dart' as _i1;
|
||||
import 'package:wger/core/search_options.dart' as _i17;
|
||||
import 'package:wger/features/account/models/user_profile.dart' as _i8;
|
||||
import 'package:wger/features/account/providers/user_profile_repository.dart' as _i7;
|
||||
import 'package:wger/features/measurements/models/measurement_bucket.dart' as _i6;
|
||||
import 'package:wger/features/measurements/models/measurement_category.dart' as _i4;
|
||||
import 'package:wger/features/measurements/models/measurement_entry.dart' as _i5;
|
||||
import 'package:wger/features/measurements/providers/measurement_repository.dart' as _i2;
|
||||
import 'package:wger/features/nutrition/models/ingredient.dart' as _i15;
|
||||
import 'package:wger/features/nutrition/models/ingredient_filters.dart' as _i16;
|
||||
import 'package:wger/features/nutrition/models/log.dart' as _i13;
|
||||
import 'package:wger/features/nutrition/models/meal.dart' as _i11;
|
||||
import 'package:wger/features/nutrition/models/meal_item.dart' as _i12;
|
||||
import 'package:wger/features/nutrition/models/nutritional_plan.dart' as _i10;
|
||||
import 'package:wger/features/nutrition/providers/ingredient_repository.dart' as _i14;
|
||||
import 'package:wger/features/nutrition/providers/nutrition_repository.dart' as _i9;
|
||||
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: avoid_redundant_argument_values
|
||||
// ignore_for_file: avoid_setters_without_getters
|
||||
// ignore_for_file: comment_references
|
||||
// ignore_for_file: deprecated_member_use
|
||||
// ignore_for_file: deprecated_member_use_from_same_package
|
||||
// ignore_for_file: implementation_imports
|
||||
// ignore_for_file: invalid_use_of_visible_for_testing_member
|
||||
// ignore_for_file: must_be_immutable
|
||||
// ignore_for_file: prefer_const_constructors
|
||||
// ignore_for_file: unnecessary_parenthesis
|
||||
// ignore_for_file: camel_case_types
|
||||
// ignore_for_file: subtype_of_sealed_class
|
||||
// ignore_for_file: invalid_use_of_internal_member
|
||||
|
||||
/// A class which mocks [MeasurementRepository].
|
||||
///
|
||||
/// See the documentation for Mockito's code generation for more information.
|
||||
class MockMeasurementRepository extends _i1.Mock implements _i2.MeasurementRepository {
|
||||
MockMeasurementRepository() {
|
||||
_i1.throwOnMissingStub(this);
|
||||
}
|
||||
|
||||
@override
|
||||
_i3.Stream<List<_i4.MeasurementCategory>> watchAllWithoutEntries() =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(#watchAllWithoutEntries, []),
|
||||
returnValue: _i3.Stream<List<_i4.MeasurementCategory>>.empty(),
|
||||
)
|
||||
as _i3.Stream<List<_i4.MeasurementCategory>>);
|
||||
|
||||
@override
|
||||
_i3.Stream<_i4.MeasurementCategory?> watchCategoryWithoutEntries(
|
||||
String? id,
|
||||
) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(#watchCategoryWithoutEntries, [id]),
|
||||
returnValue: _i3.Stream<_i4.MeasurementCategory?>.empty(),
|
||||
)
|
||||
as _i3.Stream<_i4.MeasurementCategory?>);
|
||||
|
||||
@override
|
||||
_i3.Stream<_i4.MeasurementCategory?> watchOfficialBodyWeightCategory() =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(#watchOfficialBodyWeightCategory, []),
|
||||
returnValue: _i3.Stream<_i4.MeasurementCategory?>.empty(),
|
||||
)
|
||||
as _i3.Stream<_i4.MeasurementCategory?>);
|
||||
|
||||
@override
|
||||
_i3.Stream<List<_i5.MeasurementEntry>> watchEntries(
|
||||
String? categoryId, {
|
||||
required int? limit,
|
||||
}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(#watchEntries, [categoryId], {#limit: limit}),
|
||||
returnValue: _i3.Stream<List<_i5.MeasurementEntry>>.empty(),
|
||||
)
|
||||
as _i3.Stream<List<_i5.MeasurementEntry>>);
|
||||
|
||||
@override
|
||||
_i3.Stream<List<_i5.MeasurementEntry>> watchGroupEntries(
|
||||
String? parentId, {
|
||||
required int? limit,
|
||||
}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(#watchGroupEntries, [parentId], {#limit: limit}),
|
||||
returnValue: _i3.Stream<List<_i5.MeasurementEntry>>.empty(),
|
||||
)
|
||||
as _i3.Stream<List<_i5.MeasurementEntry>>);
|
||||
|
||||
@override
|
||||
_i3.Stream<Map<String, _i5.MeasurementEntry>> watchLatestEntries() =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(#watchLatestEntries, []),
|
||||
returnValue: _i3.Stream<Map<String, _i5.MeasurementEntry>>.empty(),
|
||||
)
|
||||
as _i3.Stream<Map<String, _i5.MeasurementEntry>>);
|
||||
|
||||
@override
|
||||
_i3.Stream<List<_i6.MeasurementBucket>> watchEntryBuckets(
|
||||
String? categoryId, {
|
||||
DateTime? since,
|
||||
DateTime? until,
|
||||
_i6.MeasurementBucketLevel? level = _i6.MeasurementBucketLevel.auto,
|
||||
int? maxPoints = 200,
|
||||
}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#watchEntryBuckets,
|
||||
[categoryId],
|
||||
{
|
||||
#since: since,
|
||||
#until: until,
|
||||
#level: level,
|
||||
#maxPoints: maxPoints,
|
||||
},
|
||||
),
|
||||
returnValue: _i3.Stream<List<_i6.MeasurementBucket>>.empty(),
|
||||
)
|
||||
as _i3.Stream<List<_i6.MeasurementBucket>>);
|
||||
|
||||
@override
|
||||
_i3.Stream<Map<String, List<_i6.MeasurementBucket>>> watchGroupBuckets(
|
||||
String? parentId, {
|
||||
DateTime? since,
|
||||
_i6.MeasurementBucketLevel? level = _i6.MeasurementBucketLevel.auto,
|
||||
int? maxPoints = 200,
|
||||
}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#watchGroupBuckets,
|
||||
[parentId],
|
||||
{#since: since, #level: level, #maxPoints: maxPoints},
|
||||
),
|
||||
returnValue: _i3.Stream<Map<String, List<_i6.MeasurementBucket>>>.empty(),
|
||||
)
|
||||
as _i3.Stream<Map<String, List<_i6.MeasurementBucket>>>);
|
||||
|
||||
@override
|
||||
_i3.Stream<Map<String, List<_i6.MeasurementBucket>>> watchDailyBuckets() =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(#watchDailyBuckets, []),
|
||||
returnValue: _i3.Stream<Map<String, List<_i6.MeasurementBucket>>>.empty(),
|
||||
)
|
||||
as _i3.Stream<Map<String, List<_i6.MeasurementBucket>>>);
|
||||
|
||||
@override
|
||||
_i3.Stream<List<_i6.MeasurementValueCount>> watchValueCounts(
|
||||
String? categoryId, {
|
||||
DateTime? since,
|
||||
bool? summedPerDay = false,
|
||||
}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#watchValueCounts,
|
||||
[categoryId],
|
||||
{#since: since, #summedPerDay: summedPerDay},
|
||||
),
|
||||
returnValue: _i3.Stream<List<_i6.MeasurementValueCount>>.empty(),
|
||||
)
|
||||
as _i3.Stream<List<_i6.MeasurementValueCount>>);
|
||||
|
||||
@override
|
||||
_i3.Future<List<_i4.MeasurementCategory>> getCategoriesOnce() =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(#getCategoriesOnce, []),
|
||||
returnValue: _i3.Future<List<_i4.MeasurementCategory>>.value(
|
||||
<_i4.MeasurementCategory>[],
|
||||
),
|
||||
)
|
||||
as _i3.Future<List<_i4.MeasurementCategory>>);
|
||||
|
||||
@override
|
||||
_i3.Future<Set<String>> getExternalIds(String? categoryId) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(#getExternalIds, [categoryId]),
|
||||
returnValue: _i3.Future<Set<String>>.value(<String>{}),
|
||||
)
|
||||
as _i3.Future<Set<String>>);
|
||||
|
||||
@override
|
||||
_i3.Future<Map<String, _i5.MeasurementEntry>> getEntriesByExternalId(
|
||||
String? categoryId,
|
||||
) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(#getEntriesByExternalId, [categoryId]),
|
||||
returnValue: _i3.Future<Map<String, _i5.MeasurementEntry>>.value(
|
||||
<String, _i5.MeasurementEntry>{},
|
||||
),
|
||||
)
|
||||
as _i3.Future<Map<String, _i5.MeasurementEntry>>);
|
||||
|
||||
@override
|
||||
_i3.Future<bool> hasEntries(String? categoryId) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(#hasEntries, [categoryId]),
|
||||
returnValue: _i3.Future<bool>.value(false),
|
||||
)
|
||||
as _i3.Future<bool>);
|
||||
|
||||
@override
|
||||
_i3.Future<void> deleteLocalDrift(String? id) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(#deleteLocalDrift, [id]),
|
||||
returnValue: _i3.Future<void>.value(),
|
||||
returnValueForMissingStub: _i3.Future<void>.value(),
|
||||
)
|
||||
as _i3.Future<void>);
|
||||
|
||||
@override
|
||||
_i3.Future<void> updateLocalDrift(_i5.MeasurementEntry? entry) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(#updateLocalDrift, [entry]),
|
||||
returnValue: _i3.Future<void>.value(),
|
||||
returnValueForMissingStub: _i3.Future<void>.value(),
|
||||
)
|
||||
as _i3.Future<void>);
|
||||
|
||||
@override
|
||||
_i3.Future<void> addLocalDrift(_i5.MeasurementEntry? entry) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(#addLocalDrift, [entry]),
|
||||
returnValue: _i3.Future<void>.value(),
|
||||
returnValueForMissingStub: _i3.Future<void>.value(),
|
||||
)
|
||||
as _i3.Future<void>);
|
||||
|
||||
@override
|
||||
_i3.Future<void> addLocalDriftGroupEntries(
|
||||
List<_i5.MeasurementEntry>? entries,
|
||||
) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(#addLocalDriftGroupEntries, [entries]),
|
||||
returnValue: _i3.Future<void>.value(),
|
||||
returnValueForMissingStub: _i3.Future<void>.value(),
|
||||
)
|
||||
as _i3.Future<void>);
|
||||
|
||||
@override
|
||||
_i3.Future<void> deleteLocalDriftCategory(String? id) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(#deleteLocalDriftCategory, [id]),
|
||||
returnValue: _i3.Future<void>.value(),
|
||||
returnValueForMissingStub: _i3.Future<void>.value(),
|
||||
)
|
||||
as _i3.Future<void>);
|
||||
|
||||
@override
|
||||
_i3.Future<void> updateLocalDriftCategory(
|
||||
_i4.MeasurementCategory? category,
|
||||
) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(#updateLocalDriftCategory, [category]),
|
||||
returnValue: _i3.Future<void>.value(),
|
||||
returnValueForMissingStub: _i3.Future<void>.value(),
|
||||
)
|
||||
as _i3.Future<void>);
|
||||
|
||||
@override
|
||||
_i3.Future<void> addLocalDriftCategory(_i4.MeasurementCategory? category) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(#addLocalDriftCategory, [category]),
|
||||
returnValue: _i3.Future<void>.value(),
|
||||
returnValueForMissingStub: _i3.Future<void>.value(),
|
||||
)
|
||||
as _i3.Future<void>);
|
||||
|
||||
@override
|
||||
_i3.Future<void> addLocalDriftCategoryGroup(
|
||||
List<_i4.MeasurementCategory>? categories,
|
||||
) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(#addLocalDriftCategoryGroup, [categories]),
|
||||
returnValue: _i3.Future<void>.value(),
|
||||
returnValueForMissingStub: _i3.Future<void>.value(),
|
||||
)
|
||||
as _i3.Future<void>);
|
||||
|
||||
@override
|
||||
_i3.Future<void> reorderCategories(List<String>? orderedIds) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(#reorderCategories, [orderedIds]),
|
||||
returnValue: _i3.Future<void>.value(),
|
||||
returnValueForMissingStub: _i3.Future<void>.value(),
|
||||
)
|
||||
as _i3.Future<void>);
|
||||
}
|
||||
|
||||
/// A class which mocks [UserProfileRepository].
|
||||
///
|
||||
/// See the documentation for Mockito's code generation for more information.
|
||||
class MockUserProfileRepository extends _i1.Mock implements _i7.UserProfileRepository {
|
||||
MockUserProfileRepository() {
|
||||
_i1.throwOnMissingStub(this);
|
||||
}
|
||||
|
||||
@override
|
||||
_i3.Stream<_i8.UserProfile?> watchDrift() =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(#watchDrift, []),
|
||||
returnValue: _i3.Stream<_i8.UserProfile?>.empty(),
|
||||
)
|
||||
as _i3.Stream<_i8.UserProfile?>);
|
||||
|
||||
@override
|
||||
_i3.Future<void> editLocalDrift(_i8.UserProfile? profile) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(#editLocalDrift, [profile]),
|
||||
returnValue: _i3.Future<void>.value(),
|
||||
returnValueForMissingStub: _i3.Future<void>.value(),
|
||||
)
|
||||
as _i3.Future<void>);
|
||||
}
|
||||
|
||||
/// A class which mocks [NutritionRepository].
|
||||
///
|
||||
/// See the documentation for Mockito's code generation for more information.
|
||||
class MockNutritionRepository extends _i1.Mock implements _i9.NutritionRepository {
|
||||
MockNutritionRepository() {
|
||||
_i1.throwOnMissingStub(this);
|
||||
}
|
||||
|
||||
@override
|
||||
_i3.Stream<List<_i10.NutritionalPlan>> watchAllDrift() =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(#watchAllDrift, []),
|
||||
returnValue: _i3.Stream<List<_i10.NutritionalPlan>>.empty(),
|
||||
)
|
||||
as _i3.Stream<List<_i10.NutritionalPlan>>);
|
||||
|
||||
@override
|
||||
_i3.Future<void> addPlanLocalDrift(_i10.NutritionalPlan? plan) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(#addPlanLocalDrift, [plan]),
|
||||
returnValue: _i3.Future<void>.value(),
|
||||
returnValueForMissingStub: _i3.Future<void>.value(),
|
||||
)
|
||||
as _i3.Future<void>);
|
||||
|
||||
@override
|
||||
_i3.Future<void> editLocalDrift(_i10.NutritionalPlan? plan) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(#editLocalDrift, [plan]),
|
||||
returnValue: _i3.Future<void>.value(),
|
||||
returnValueForMissingStub: _i3.Future<void>.value(),
|
||||
)
|
||||
as _i3.Future<void>);
|
||||
|
||||
@override
|
||||
_i3.Future<void> deleteLocalDrift(String? id) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(#deleteLocalDrift, [id]),
|
||||
returnValue: _i3.Future<void>.value(),
|
||||
returnValueForMissingStub: _i3.Future<void>.value(),
|
||||
)
|
||||
as _i3.Future<void>);
|
||||
|
||||
@override
|
||||
_i3.Stream<List<_i11.Meal>> watchAllMealsHydrated() =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(#watchAllMealsHydrated, []),
|
||||
returnValue: _i3.Stream<List<_i11.Meal>>.empty(),
|
||||
)
|
||||
as _i3.Stream<List<_i11.Meal>>);
|
||||
|
||||
@override
|
||||
_i3.Future<void> addMealLocalDrift(_i11.Meal? meal) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(#addMealLocalDrift, [meal]),
|
||||
returnValue: _i3.Future<void>.value(),
|
||||
returnValueForMissingStub: _i3.Future<void>.value(),
|
||||
)
|
||||
as _i3.Future<void>);
|
||||
|
||||
@override
|
||||
_i3.Future<void> editMealLocalDrift(_i11.Meal? meal) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(#editMealLocalDrift, [meal]),
|
||||
returnValue: _i3.Future<void>.value(),
|
||||
returnValueForMissingStub: _i3.Future<void>.value(),
|
||||
)
|
||||
as _i3.Future<void>);
|
||||
|
||||
@override
|
||||
_i3.Future<void> deleteMealLocalDrift(String? id) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(#deleteMealLocalDrift, [id]),
|
||||
returnValue: _i3.Future<void>.value(),
|
||||
returnValueForMissingStub: _i3.Future<void>.value(),
|
||||
)
|
||||
as _i3.Future<void>);
|
||||
|
||||
@override
|
||||
_i3.Future<void> addMealItemLocalDrift(_i12.MealItem? item) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(#addMealItemLocalDrift, [item]),
|
||||
returnValue: _i3.Future<void>.value(),
|
||||
returnValueForMissingStub: _i3.Future<void>.value(),
|
||||
)
|
||||
as _i3.Future<void>);
|
||||
|
||||
@override
|
||||
_i3.Future<void> editMealItemLocalDrift(_i12.MealItem? item) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(#editMealItemLocalDrift, [item]),
|
||||
returnValue: _i3.Future<void>.value(),
|
||||
returnValueForMissingStub: _i3.Future<void>.value(),
|
||||
)
|
||||
as _i3.Future<void>);
|
||||
|
||||
@override
|
||||
_i3.Future<void> deleteMealItemLocalDrift(String? id) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(#deleteMealItemLocalDrift, [id]),
|
||||
returnValue: _i3.Future<void>.value(),
|
||||
returnValueForMissingStub: _i3.Future<void>.value(),
|
||||
)
|
||||
as _i3.Future<void>);
|
||||
|
||||
@override
|
||||
_i3.Stream<List<_i13.LogItem>> watchAllLogsHydrated() =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(#watchAllLogsHydrated, []),
|
||||
returnValue: _i3.Stream<List<_i13.LogItem>>.empty(),
|
||||
)
|
||||
as _i3.Stream<List<_i13.LogItem>>);
|
||||
|
||||
@override
|
||||
_i3.Future<void> addLogLocalDrift(_i13.LogItem? log) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(#addLogLocalDrift, [log]),
|
||||
returnValue: _i3.Future<void>.value(),
|
||||
returnValueForMissingStub: _i3.Future<void>.value(),
|
||||
)
|
||||
as _i3.Future<void>);
|
||||
|
||||
@override
|
||||
_i3.Future<void> deleteLogLocalDrift(String? id) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(#deleteLogLocalDrift, [id]),
|
||||
returnValue: _i3.Future<void>.value(),
|
||||
returnValueForMissingStub: _i3.Future<void>.value(),
|
||||
)
|
||||
as _i3.Future<void>);
|
||||
}
|
||||
|
||||
/// A class which mocks [IngredientRepository].
|
||||
///
|
||||
/// See the documentation for Mockito's code generation for more information.
|
||||
class MockIngredientRepository extends _i1.Mock implements _i14.IngredientRepository {
|
||||
MockIngredientRepository() {
|
||||
_i1.throwOnMissingStub(this);
|
||||
}
|
||||
|
||||
@override
|
||||
_i3.Stream<_i15.Ingredient?> watchById(int? id) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(#watchById, [id]),
|
||||
returnValue: _i3.Stream<_i15.Ingredient?>.empty(),
|
||||
)
|
||||
as _i3.Stream<_i15.Ingredient?>);
|
||||
|
||||
@override
|
||||
_i3.Stream<List<_i15.Ingredient>> watchAllDrift({
|
||||
_i16.IngredientFilters? filters = const _i16.IngredientFilters(),
|
||||
}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(#watchAllDrift, [], {#filters: filters}),
|
||||
returnValue: _i3.Stream<List<_i15.Ingredient>>.empty(),
|
||||
)
|
||||
as _i3.Stream<List<_i15.Ingredient>>);
|
||||
|
||||
@override
|
||||
_i3.Future<_i15.Ingredient?> getById(int? id) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(#getById, [id]),
|
||||
returnValue: _i3.Future<_i15.Ingredient?>.value(),
|
||||
)
|
||||
as _i3.Future<_i15.Ingredient?>);
|
||||
|
||||
@override
|
||||
_i3.Future<List<_i15.Ingredient>> searchIngredientLocal(
|
||||
String? term, {
|
||||
bool? isVegan = false,
|
||||
bool? isVegetarian = false,
|
||||
_i15.NutriScore? nutriscoreMax,
|
||||
int? limit = 100,
|
||||
}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#searchIngredientLocal,
|
||||
[term],
|
||||
{
|
||||
#isVegan: isVegan,
|
||||
#isVegetarian: isVegetarian,
|
||||
#nutriscoreMax: nutriscoreMax,
|
||||
#limit: limit,
|
||||
},
|
||||
),
|
||||
returnValue: _i3.Future<List<_i15.Ingredient>>.value(
|
||||
<_i15.Ingredient>[],
|
||||
),
|
||||
)
|
||||
as _i3.Future<List<_i15.Ingredient>>);
|
||||
|
||||
@override
|
||||
_i3.Future<List<_i15.Ingredient>> searchIngredientServer(
|
||||
String? name, {
|
||||
String? languageCode = 'en',
|
||||
_i17.SearchLanguage? searchLanguage = _i17.SearchLanguage.current,
|
||||
bool? isVegan = false,
|
||||
bool? isVegetarian = false,
|
||||
_i15.NutriScore? nutriscoreMax,
|
||||
}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#searchIngredientServer,
|
||||
[name],
|
||||
{
|
||||
#languageCode: languageCode,
|
||||
#searchLanguage: searchLanguage,
|
||||
#isVegan: isVegan,
|
||||
#isVegetarian: isVegetarian,
|
||||
#nutriscoreMax: nutriscoreMax,
|
||||
},
|
||||
),
|
||||
returnValue: _i3.Future<List<_i15.Ingredient>>.value(
|
||||
<_i15.Ingredient>[],
|
||||
),
|
||||
)
|
||||
as _i3.Future<List<_i15.Ingredient>>);
|
||||
|
||||
@override
|
||||
_i3.Future<List<_i15.Ingredient>> search(
|
||||
String? name, {
|
||||
required bool? isOnline,
|
||||
String? languageCode = 'en',
|
||||
_i17.SearchLanguage? searchLanguage = _i17.SearchLanguage.current,
|
||||
bool? isVegan = false,
|
||||
bool? isVegetarian = false,
|
||||
_i15.NutriScore? nutriscoreMax,
|
||||
}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#search,
|
||||
[name],
|
||||
{
|
||||
#isOnline: isOnline,
|
||||
#languageCode: languageCode,
|
||||
#searchLanguage: searchLanguage,
|
||||
#isVegan: isVegan,
|
||||
#isVegetarian: isVegetarian,
|
||||
#nutriscoreMax: nutriscoreMax,
|
||||
},
|
||||
),
|
||||
returnValue: _i3.Future<List<_i15.Ingredient>>.value(
|
||||
<_i15.Ingredient>[],
|
||||
),
|
||||
)
|
||||
as _i3.Future<List<_i15.Ingredient>>);
|
||||
|
||||
@override
|
||||
_i3.Future<_i15.Ingredient?> searchIngredientByBarcode(String? barcode) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(#searchIngredientByBarcode, [barcode]),
|
||||
returnValue: _i3.Future<_i15.Ingredient?>.value(),
|
||||
)
|
||||
as _i3.Future<_i15.Ingredient?>);
|
||||
}
|
||||
@@ -19,15 +19,13 @@
|
||||
import 'dart:math';
|
||||
|
||||
import 'package:wger/features/measurements/models/measurement_entry.dart';
|
||||
import 'package:wger/features/nutrition/models/nutritional_plan.dart';
|
||||
|
||||
import '../body_weight.dart';
|
||||
|
||||
/// A year of body weight ending today, shaped like a real log: a slow drift
|
||||
/// up, a successful cut over the period of [getScreenshotWeightPlans]' first
|
||||
/// plan, a short maintenance phase, and a fresh cut under the active plan.
|
||||
/// The cut and the active plan fall inside the last three months, so the
|
||||
/// story is visible in every chart range.
|
||||
/// up, a successful cut, a short maintenance phase, and a fresh cut. The cuts
|
||||
/// fall inside the last three months, so the story is visible in every chart
|
||||
/// range.
|
||||
///
|
||||
/// Deterministic (fixed random seed); only the dates move with today.
|
||||
Map<String, List<MeasurementEntry>> getScreenshotBodyWeightEntries() {
|
||||
@@ -72,27 +70,3 @@ Map<String, List<MeasurementEntry>> getScreenshotBodyWeightEntries() {
|
||||
// newest first, matching the order the paged list reads them in
|
||||
return bodyWeightEntries(entries.reversed.toList());
|
||||
}
|
||||
|
||||
/// The nutrition plans behind the weight phases of
|
||||
/// [getScreenshotBodyWeightEntries]: a finished cut covering the big drop
|
||||
/// and a currently active plan. Shown as period bands in the weight chart.
|
||||
List<NutritionalPlan> getScreenshotWeightPlans() {
|
||||
final today = DateTime.now();
|
||||
DateTime daysAgo(int days) => DateTime(today.year, today.month, today.day - days);
|
||||
|
||||
return [
|
||||
NutritionalPlan(
|
||||
id: 'bb000000-0000-4000-8000-000000000001',
|
||||
description: 'Summer cut',
|
||||
startDate: daysAgo(75),
|
||||
endDate: daysAgo(25),
|
||||
onlyLogging: true,
|
||||
),
|
||||
NutritionalPlan(
|
||||
id: 'bb000000-0000-4000-8000-000000000002',
|
||||
description: 'Mini cut',
|
||||
startDate: daysAgo(10),
|
||||
onlyLogging: true,
|
||||
),
|
||||
];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user