From 79a8c3e3063df218cff0fb5ea661a7af820e4437 Mon Sep 17 00:00:00 2001 From: Roland Geider Date: Thu, 20 Aug 2026 22:19:40 +0200 Subject: [PATCH] Remove the weight screenshots, that can be seen with the measurements --- flatpak/de.wger.flutter.metainfo.xml | 6 - integration_test/make_screenshots_test.dart | 7 - test/screenshots/screenshots_06_weight.dart | 96 --- .../screenshots_06_weight.mocks.dart | 574 ------------------ test_data/screenshots/weight.dart | 32 +- 5 files changed, 3 insertions(+), 712 deletions(-) delete mode 100644 test/screenshots/screenshots_06_weight.dart delete mode 100644 test/screenshots/screenshots_06_weight.mocks.dart diff --git a/flatpak/de.wger.flutter.metainfo.xml b/flatpak/de.wger.flutter.metainfo.xml index 466702664..1c621fd34 100755 --- a/flatpak/de.wger.flutter.metainfo.xml +++ b/flatpak/de.wger.flutter.metainfo.xml @@ -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 - - Body weight - - https://media.githubusercontent.com/media/wger-project/flutter/refs/heads/master/fastlane/metadata/android/en-US/images/phoneScreenshots/06%20-%20weight.png - - diff --git a/integration_test/make_screenshots_test.dart b/integration_test/make_screenshots_test.dart index 9ff26cf5a..823950837 100644 --- a/integration_test/make_screenshots_test.dart +++ b/integration_test/make_screenshots_test.dart @@ -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'); - }); } }); } diff --git a/test/screenshots/screenshots_06_weight.dart b/test/screenshots/screenshots_06_weight.dart deleted file mode 100644 index cec8ee502..000000000 --- a/test/screenshots/screenshots_06_weight.dart +++ /dev/null @@ -1,96 +0,0 @@ -/* - * This file is part of wger Workout Manager . - * 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 . - */ - -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()}, - ), - ), - ); -} diff --git a/test/screenshots/screenshots_06_weight.mocks.dart b/test/screenshots/screenshots_06_weight.mocks.dart deleted file mode 100644 index 2306330c2..000000000 --- a/test/screenshots/screenshots_06_weight.mocks.dart +++ /dev/null @@ -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> watchAllWithoutEntries() => - (super.noSuchMethod( - Invocation.method(#watchAllWithoutEntries, []), - returnValue: _i3.Stream>.empty(), - ) - as _i3.Stream>); - - @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> watchEntries( - String? categoryId, { - required int? limit, - }) => - (super.noSuchMethod( - Invocation.method(#watchEntries, [categoryId], {#limit: limit}), - returnValue: _i3.Stream>.empty(), - ) - as _i3.Stream>); - - @override - _i3.Stream> watchGroupEntries( - String? parentId, { - required int? limit, - }) => - (super.noSuchMethod( - Invocation.method(#watchGroupEntries, [parentId], {#limit: limit}), - returnValue: _i3.Stream>.empty(), - ) - as _i3.Stream>); - - @override - _i3.Stream> watchLatestEntries() => - (super.noSuchMethod( - Invocation.method(#watchLatestEntries, []), - returnValue: _i3.Stream>.empty(), - ) - as _i3.Stream>); - - @override - _i3.Stream> 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>.empty(), - ) - as _i3.Stream>); - - @override - _i3.Stream>> 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>>.empty(), - ) - as _i3.Stream>>); - - @override - _i3.Stream>> watchDailyBuckets() => - (super.noSuchMethod( - Invocation.method(#watchDailyBuckets, []), - returnValue: _i3.Stream>>.empty(), - ) - as _i3.Stream>>); - - @override - _i3.Stream> watchValueCounts( - String? categoryId, { - DateTime? since, - bool? summedPerDay = false, - }) => - (super.noSuchMethod( - Invocation.method( - #watchValueCounts, - [categoryId], - {#since: since, #summedPerDay: summedPerDay}, - ), - returnValue: _i3.Stream>.empty(), - ) - as _i3.Stream>); - - @override - _i3.Future> getCategoriesOnce() => - (super.noSuchMethod( - Invocation.method(#getCategoriesOnce, []), - returnValue: _i3.Future>.value( - <_i4.MeasurementCategory>[], - ), - ) - as _i3.Future>); - - @override - _i3.Future> getExternalIds(String? categoryId) => - (super.noSuchMethod( - Invocation.method(#getExternalIds, [categoryId]), - returnValue: _i3.Future>.value({}), - ) - as _i3.Future>); - - @override - _i3.Future> getEntriesByExternalId( - String? categoryId, - ) => - (super.noSuchMethod( - Invocation.method(#getEntriesByExternalId, [categoryId]), - returnValue: _i3.Future>.value( - {}, - ), - ) - as _i3.Future>); - - @override - _i3.Future hasEntries(String? categoryId) => - (super.noSuchMethod( - Invocation.method(#hasEntries, [categoryId]), - returnValue: _i3.Future.value(false), - ) - as _i3.Future); - - @override - _i3.Future deleteLocalDrift(String? id) => - (super.noSuchMethod( - Invocation.method(#deleteLocalDrift, [id]), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); - - @override - _i3.Future updateLocalDrift(_i5.MeasurementEntry? entry) => - (super.noSuchMethod( - Invocation.method(#updateLocalDrift, [entry]), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); - - @override - _i3.Future addLocalDrift(_i5.MeasurementEntry? entry) => - (super.noSuchMethod( - Invocation.method(#addLocalDrift, [entry]), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); - - @override - _i3.Future addLocalDriftGroupEntries( - List<_i5.MeasurementEntry>? entries, - ) => - (super.noSuchMethod( - Invocation.method(#addLocalDriftGroupEntries, [entries]), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); - - @override - _i3.Future deleteLocalDriftCategory(String? id) => - (super.noSuchMethod( - Invocation.method(#deleteLocalDriftCategory, [id]), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); - - @override - _i3.Future updateLocalDriftCategory( - _i4.MeasurementCategory? category, - ) => - (super.noSuchMethod( - Invocation.method(#updateLocalDriftCategory, [category]), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); - - @override - _i3.Future addLocalDriftCategory(_i4.MeasurementCategory? category) => - (super.noSuchMethod( - Invocation.method(#addLocalDriftCategory, [category]), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); - - @override - _i3.Future addLocalDriftCategoryGroup( - List<_i4.MeasurementCategory>? categories, - ) => - (super.noSuchMethod( - Invocation.method(#addLocalDriftCategoryGroup, [categories]), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); - - @override - _i3.Future reorderCategories(List? orderedIds) => - (super.noSuchMethod( - Invocation.method(#reorderCategories, [orderedIds]), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); -} - -/// 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 editLocalDrift(_i8.UserProfile? profile) => - (super.noSuchMethod( - Invocation.method(#editLocalDrift, [profile]), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); -} - -/// 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> watchAllDrift() => - (super.noSuchMethod( - Invocation.method(#watchAllDrift, []), - returnValue: _i3.Stream>.empty(), - ) - as _i3.Stream>); - - @override - _i3.Future addPlanLocalDrift(_i10.NutritionalPlan? plan) => - (super.noSuchMethod( - Invocation.method(#addPlanLocalDrift, [plan]), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); - - @override - _i3.Future editLocalDrift(_i10.NutritionalPlan? plan) => - (super.noSuchMethod( - Invocation.method(#editLocalDrift, [plan]), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); - - @override - _i3.Future deleteLocalDrift(String? id) => - (super.noSuchMethod( - Invocation.method(#deleteLocalDrift, [id]), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); - - @override - _i3.Stream> watchAllMealsHydrated() => - (super.noSuchMethod( - Invocation.method(#watchAllMealsHydrated, []), - returnValue: _i3.Stream>.empty(), - ) - as _i3.Stream>); - - @override - _i3.Future addMealLocalDrift(_i11.Meal? meal) => - (super.noSuchMethod( - Invocation.method(#addMealLocalDrift, [meal]), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); - - @override - _i3.Future editMealLocalDrift(_i11.Meal? meal) => - (super.noSuchMethod( - Invocation.method(#editMealLocalDrift, [meal]), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); - - @override - _i3.Future deleteMealLocalDrift(String? id) => - (super.noSuchMethod( - Invocation.method(#deleteMealLocalDrift, [id]), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); - - @override - _i3.Future addMealItemLocalDrift(_i12.MealItem? item) => - (super.noSuchMethod( - Invocation.method(#addMealItemLocalDrift, [item]), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); - - @override - _i3.Future editMealItemLocalDrift(_i12.MealItem? item) => - (super.noSuchMethod( - Invocation.method(#editMealItemLocalDrift, [item]), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); - - @override - _i3.Future deleteMealItemLocalDrift(String? id) => - (super.noSuchMethod( - Invocation.method(#deleteMealItemLocalDrift, [id]), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); - - @override - _i3.Stream> watchAllLogsHydrated() => - (super.noSuchMethod( - Invocation.method(#watchAllLogsHydrated, []), - returnValue: _i3.Stream>.empty(), - ) - as _i3.Stream>); - - @override - _i3.Future addLogLocalDrift(_i13.LogItem? log) => - (super.noSuchMethod( - Invocation.method(#addLogLocalDrift, [log]), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); - - @override - _i3.Future deleteLogLocalDrift(String? id) => - (super.noSuchMethod( - Invocation.method(#deleteLogLocalDrift, [id]), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) - as _i3.Future); -} - -/// 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> watchAllDrift({ - _i16.IngredientFilters? filters = const _i16.IngredientFilters(), - }) => - (super.noSuchMethod( - Invocation.method(#watchAllDrift, [], {#filters: filters}), - returnValue: _i3.Stream>.empty(), - ) - as _i3.Stream>); - - @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> 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>.value( - <_i15.Ingredient>[], - ), - ) - as _i3.Future>); - - @override - _i3.Future> 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>.value( - <_i15.Ingredient>[], - ), - ) - as _i3.Future>); - - @override - _i3.Future> 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>.value( - <_i15.Ingredient>[], - ), - ) - as _i3.Future>); - - @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?>); -} diff --git a/test_data/screenshots/weight.dart b/test_data/screenshots/weight.dart index c2f100984..c77c7052a 100644 --- a/test_data/screenshots/weight.dart +++ b/test_data/screenshots/weight.dart @@ -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> getScreenshotBodyWeightEntries() { @@ -72,27 +70,3 @@ Map> 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 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, - ), - ]; -}