diff --git a/test/core/app_link_router_test.dart b/test/core/app_link_router_test.dart index 09046a74c..03e1fbb57 100644 --- a/test/core/app_link_router_test.dart +++ b/test/core/app_link_router_test.dart @@ -109,10 +109,10 @@ void main() { }); test('a mismatched state is rejected and still clears the pending one', () async { - await issueAppAuthState(server); + final state = await issueAppAuthState(server); expect(await consumeAppAuthState('not-the-real-one'), isNull); // The pending state was wiped — replaying the right value now also fails. - expect(await consumeAppAuthState('anything'), isNull); + expect(await consumeAppAuthState(state), isNull); }); test('null and empty received values are rejected', () async { diff --git a/test/core/http_overrides_test.dart b/test/core/http_overrides_test.dart index 203dff815..bf325dd83 100644 --- a/test/core/http_overrides_test.dart +++ b/test/core/http_overrides_test.dart @@ -25,6 +25,18 @@ import 'package:wger/core/http_overrides.dart'; class _FakeCertificate extends Fake implements X509Certificate {} +/// Records the certificate callback the code under test installs on it. +class _RecordingHttpClient extends Fake implements HttpClient { + bool Function(X509Certificate, String, int)? callback; + + @override + set badCertificateCallback(bool Function(X509Certificate, String, int)? value) => + callback = value; + + @override + void close({bool force = false}) {} +} + void main() { final cert = _FakeCertificate(); @@ -139,11 +151,18 @@ void main() { }); }); - test('syncHttpClientFactory builds a dart:io backed client', () { - final client = WgerHttpOverrides.syncHttpClientFactory('gym.example.com')(); + test('syncHttpClientFactory builds a dart:io backed client exempting the host', () { + final inner = _RecordingHttpClient(); + final client = HttpOverrides.runZoned( + () => WgerHttpOverrides.syncHttpClientFactory('gym.example.com')(), + createHttpClient: (_) => inner, + ); addTearDown(client.close); expect(client, isA()); + expect(inner.callback, isNotNull); + expect(inner.callback!(cert, 'gym.example.com', 443), isTrue); + expect(inner.callback!(cert, 'other.example.com', 443), isFalse); }); test('trustServer clears the host for a null, empty or hostless URL', () { diff --git a/test/core/media_url_prefix_notifier_test.dart b/test/core/media_url_prefix_notifier_test.dart index b2dff96f9..01c6944b7 100644 --- a/test/core/media_url_prefix_notifier_test.dart +++ b/test/core/media_url_prefix_notifier_test.dart @@ -16,6 +16,8 @@ * along with this program. If not, see . */ +import 'dart:async'; + import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/annotations.dart'; @@ -40,6 +42,8 @@ class _FixedAuthNotifier extends AuthNotifier { @override Future build() async => _initial; + + void switchTo(AuthStatus status) => state = AsyncData(AuthState(status: status)); } @GenerateMocks([SharedPreferencesAsync, WgerBaseProvider]) @@ -227,19 +231,25 @@ void main() { }); test('probe does not write back when the user logged out during the await', () async { - // fetch returns a valid prefix, but auth is loggedOut throughout. + // fetch returns a valid prefix, but only after the user has logged out. // The notifier must not persist the value. - stubFetch( - responseBody: { - 'results': [ - {'image': 'https://wger.de/media/exercise-images/1/foo.png'}, - ], - }, - ); + final response = Completer(); + final uri = Uri.parse('https://example/api/v2/exerciseimage/?limit=1'); + when(mockBase.makeUrl(any, query: anyNamed('query'))).thenReturn(uri); + when(mockBase.fetch(uri)).thenAnswer((_) => response.future); - final container = makeContainer(authStatus: AuthStatus.loggedOut); + final container = makeContainer(); await container.read(mediaUrlPrefixProvider.future); - await container.read(mediaUrlPrefixProvider.notifier).probe(); + final probe = container.read(mediaUrlPrefixProvider.notifier).probe(); + + (container.read(authProvider.notifier) as _FixedAuthNotifier).switchTo(AuthStatus.loggedOut); + response.complete({ + 'results': [ + {'image': 'https://wger.de/media/exercise-images/1/foo.png'}, + ], + }); + await probe; + await pumpEventQueue(); expect(container.read(mediaUrlPrefixProvider).asData?.value, isNull); verifyNever(mockPrefs.setString(any, any)); diff --git a/test/core/validators_test.dart b/test/core/validators_test.dart index 299a9f014..3a7f64ddb 100644 --- a/test/core/validators_test.dart +++ b/test/core/validators_test.dart @@ -1,79 +1,66 @@ import 'package:flutter_test/flutter_test.dart'; -import 'package:mockito/annotations.dart'; -import 'package:mockito/mockito.dart'; import 'package:wger/core/validators.dart'; -import 'package:wger/l10n/generated/app_localizations.dart'; +import 'package:wger/l10n/generated/app_localizations_en.dart'; -import 'validators_test.mocks.dart'; - -@GenerateMocks([AppLocalizations]) void main() { - MockAppLocalizations mockI18n = MockAppLocalizations(); - - setUp(() { - mockI18n = MockAppLocalizations(); - - when(mockI18n.enterValue).thenReturn('Please enter a value'); - when(mockI18n.invalidUrl).thenReturn('Invalid URL'); - }); + final i18n = AppLocalizationsEn(); test('Required field empty returns error', () { - final result = validateUrl('', mockI18n, required: true); - expect(result, isNotNull); + final result = validateUrl('', i18n, required: true); + expect(result, i18n.enterValue); }); test('Optional field empty returns no error', () { - final result = validateUrl('', mockI18n, required: false); + final result = validateUrl('', i18n, required: false); expect(result, isNull); }); test('Invalid URL without http/https returns error', () { - final result = validateUrl('www.example.com', mockI18n); - expect(result, isNotNull); + final result = validateUrl('www.example.com', i18n); + expect(result, i18n.invalidUrl); }); test('Invalid URL with wrong protocol returns error', () { - final result = validateUrl('gopher://', mockI18n); - expect(result, isNotNull); + final result = validateUrl('gopher://', i18n); + expect(result, i18n.invalidUrl); }); test('Valid http URL returns no error', () { - final result = validateUrl('http://example.com', mockI18n); + final result = validateUrl('http://example.com', i18n); expect(result, isNull); }); test('Valid https URL returns no error', () { - final result = validateUrl('https://example.com', mockI18n); + final result = validateUrl('https://example.com', i18n); expect(result, isNull); }); test('Scheme-only URL with empty host returns error', () { // Uri.parse('http://') succeeds with an empty host; the validator must // still reject it. - expect(validateUrl('http://', mockI18n), isNotNull); - expect(validateUrl('https://', mockI18n), isNotNull); + expect(validateUrl('http://', i18n), i18n.invalidUrl); + expect(validateUrl('https://', i18n), i18n.invalidUrl); }); group('validateDateRange', () { - setUp(() { - when(mockI18n.endBeforeStart).thenReturn('The end value cannot be before the start'); - }); - test('returns null when end is null', () { - expect(validateDateRange(DateTime(2024, 1, 1), null, mockI18n), isNull); + expect(validateDateRange(DateTime(2024, 1, 1), null, i18n), isNull); }); test('returns null when end is after start', () { - expect(validateDateRange(DateTime(2024, 1, 1), DateTime(2024, 2, 1), mockI18n), isNull); + expect(validateDateRange(DateTime(2024, 1, 1), DateTime(2024, 2, 1), i18n), isNull); }); test('returns null when end equals start', () { final date = DateTime(2024, 1, 1); - expect(validateDateRange(date, date, mockI18n), isNull); + expect(validateDateRange(date, date, i18n), isNull); }); test('returns an error when end is before start', () { - expect(validateDateRange(DateTime(2024, 2, 1), DateTime(2024, 1, 1), mockI18n), isNotNull); + expect( + validateDateRange(DateTime(2024, 2, 1), DateTime(2024, 1, 1), i18n), + i18n.endBeforeStart, + ); }); }); } diff --git a/test/core/validators_test.mocks.dart b/test/core/validators_test.mocks.dart deleted file mode 100644 index 953524979..000000000 --- a/test/core/validators_test.mocks.dart +++ /dev/null @@ -1,6360 +0,0 @@ -// Mocks generated by Mockito from annotations -// in wger/test/core/validators_test.dart. -// Do not manually edit this file. - -// ignore_for_file: no_leading_underscores_for_library_prefixes - -import 'package:mockito/mockito.dart' as _i1; -import 'package:mockito/src/dummies.dart' as _i3; -import 'package:wger/l10n/generated/app_localizations.dart' as _i2; - -// 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: experimental_member_use -// 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 [AppLocalizations]. -/// -/// See the documentation for Mockito's code generation for more information. -class MockAppLocalizations extends _i1.Mock implements _i2.AppLocalizations { - MockAppLocalizations() { - _i1.throwOnMissingStub(this); - } - - @override - String get localeName => - (super.noSuchMethod( - Invocation.getter(#localeName), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#localeName), - ), - ) - as String); - - @override - String get userProfile => - (super.noSuchMethod( - Invocation.getter(#userProfile), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#userProfile), - ), - ) - as String); - - @override - String get login => - (super.noSuchMethod( - Invocation.getter(#login), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#login), - ), - ) - as String); - - @override - String get logout => - (super.noSuchMethod( - Invocation.getter(#logout), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#logout), - ), - ) - as String); - - @override - String get register => - (super.noSuchMethod( - Invocation.getter(#register), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#register), - ), - ) - as String); - - @override - String get invalidUrl => - (super.noSuchMethod( - Invocation.getter(#invalidUrl), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#invalidUrl), - ), - ) - as String); - - @override - String get usernameValidChars => - (super.noSuchMethod( - Invocation.getter(#usernameValidChars), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#usernameValidChars), - ), - ) - as String); - - @override - String get passwordsDontMatch => - (super.noSuchMethod( - Invocation.getter(#passwordsDontMatch), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#passwordsDontMatch), - ), - ) - as String); - - @override - String get passwordTooShort => - (super.noSuchMethod( - Invocation.getter(#passwordTooShort), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#passwordTooShort), - ), - ) - as String); - - @override - String get selectAvailablePlates => - (super.noSuchMethod( - Invocation.getter(#selectAvailablePlates), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#selectAvailablePlates), - ), - ) - as String); - - @override - String get barWeight => - (super.noSuchMethod( - Invocation.getter(#barWeight), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#barWeight), - ), - ) - as String); - - @override - String get useColors => - (super.noSuchMethod( - Invocation.getter(#useColors), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#useColors), - ), - ) - as String); - - @override - String get password => - (super.noSuchMethod( - Invocation.getter(#password), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#password), - ), - ) - as String); - - @override - String get confirmPassword => - (super.noSuchMethod( - Invocation.getter(#confirmPassword), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#confirmPassword), - ), - ) - as String); - - @override - String get invalidEmail => - (super.noSuchMethod( - Invocation.getter(#invalidEmail), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#invalidEmail), - ), - ) - as String); - - @override - String get email => - (super.noSuchMethod( - Invocation.getter(#email), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#email), - ), - ) - as String); - - @override - String get username => - (super.noSuchMethod( - Invocation.getter(#username), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#username), - ), - ) - as String); - - @override - String get invalidUsername => - (super.noSuchMethod( - Invocation.getter(#invalidUsername), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#invalidUsername), - ), - ) - as String); - - @override - String get refreshToken => - (super.noSuchMethod( - Invocation.getter(#refreshToken), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#refreshToken), - ), - ) - as String); - - @override - String get invalidRefreshToken => - (super.noSuchMethod( - Invocation.getter(#invalidRefreshToken), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#invalidRefreshToken), - ), - ) - as String); - - @override - String get refreshTokenValidChars => - (super.noSuchMethod( - Invocation.getter(#refreshTokenValidChars), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#refreshTokenValidChars), - ), - ) - as String); - - @override - String get refreshTokenHelperText => - (super.noSuchMethod( - Invocation.getter(#refreshTokenHelperText), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#refreshTokenHelperText), - ), - ) - as String); - - @override - String get mfaChallengeTitle => - (super.noSuchMethod( - Invocation.getter(#mfaChallengeTitle), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#mfaChallengeTitle), - ), - ) - as String); - - @override - String get mfaChallengeTotpPrompt => - (super.noSuchMethod( - Invocation.getter(#mfaChallengeTotpPrompt), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#mfaChallengeTotpPrompt), - ), - ) - as String); - - @override - String get mfaChallengeRecoveryPrompt => - (super.noSuchMethod( - Invocation.getter(#mfaChallengeRecoveryPrompt), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#mfaChallengeRecoveryPrompt), - ), - ) - as String); - - @override - String get mfaCodeLabel => - (super.noSuchMethod( - Invocation.getter(#mfaCodeLabel), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#mfaCodeLabel), - ), - ) - as String); - - @override - String get mfaInvalidCode => - (super.noSuchMethod( - Invocation.getter(#mfaInvalidCode), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#mfaInvalidCode), - ), - ) - as String); - - @override - String get mfaUseRecoveryCode => - (super.noSuchMethod( - Invocation.getter(#mfaUseRecoveryCode), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#mfaUseRecoveryCode), - ), - ) - as String); - - @override - String get mfaUseTotpCode => - (super.noSuchMethod( - Invocation.getter(#mfaUseTotpCode), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#mfaUseTotpCode), - ), - ) - as String); - - @override - String get mfaSubmit => - (super.noSuchMethod( - Invocation.getter(#mfaSubmit), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#mfaSubmit), - ), - ) - as String); - - @override - String get mfaUnsupportedFactor => - (super.noSuchMethod( - Invocation.getter(#mfaUnsupportedFactor), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#mfaUnsupportedFactor), - ), - ) - as String); - - @override - String get manageAccountOnWeb => - (super.noSuchMethod( - Invocation.getter(#manageAccountOnWeb), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#manageAccountOnWeb), - ), - ) - as String); - - @override - String get manageAccountOnWebSubtitle => - (super.noSuchMethod( - Invocation.getter(#manageAccountOnWebSubtitle), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#manageAccountOnWebSubtitle), - ), - ) - as String); - - @override - String get customServerUrl => - (super.noSuchMethod( - Invocation.getter(#customServerUrl), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#customServerUrl), - ), - ) - as String); - - @override - String get customServerHint => - (super.noSuchMethod( - Invocation.getter(#customServerHint), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#customServerHint), - ), - ) - as String); - - @override - String get reset => - (super.noSuchMethod( - Invocation.getter(#reset), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#reset), - ), - ) - as String); - - @override - String get advanced => - (super.noSuchMethod( - Invocation.getter(#advanced), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#advanced), - ), - ) - as String); - - @override - String get advancedSubtitle => - (super.noSuchMethod( - Invocation.getter(#advancedSubtitle), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#advancedSubtitle), - ), - ) - as String); - - @override - String get serverSectionLabel => - (super.noSuchMethod( - Invocation.getter(#serverSectionLabel), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#serverSectionLabel), - ), - ) - as String); - - @override - String get signInMethodSectionLabel => - (super.noSuchMethod( - Invocation.getter(#signInMethodSectionLabel), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#signInMethodSectionLabel), - ), - ) - as String); - - @override - String get serverOptionDefaultDetail => - (super.noSuchMethod( - Invocation.getter(#serverOptionDefaultDetail), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#serverOptionDefaultDetail), - ), - ) - as String); - - @override - String get serverOptionSelfHostedTitle => - (super.noSuchMethod( - Invocation.getter(#serverOptionSelfHostedTitle), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#serverOptionSelfHostedTitle), - ), - ) - as String); - - @override - String get serverOptionSelfHostedDetail => - (super.noSuchMethod( - Invocation.getter(#serverOptionSelfHostedDetail), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#serverOptionSelfHostedDetail), - ), - ) - as String); - - @override - String get allowSelfSignedCertsTitle => - (super.noSuchMethod( - Invocation.getter(#allowSelfSignedCertsTitle), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#allowSelfSignedCertsTitle), - ), - ) - as String); - - @override - String get allowSelfSignedCertsDetail => - (super.noSuchMethod( - Invocation.getter(#allowSelfSignedCertsDetail), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#allowSelfSignedCertsDetail), - ), - ) - as String); - - @override - String get certsNotVerifiedTitle => - (super.noSuchMethod( - Invocation.getter(#certsNotVerifiedTitle), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#certsNotVerifiedTitle), - ), - ) - as String); - - @override - String get authOptionPasswordTitle => - (super.noSuchMethod( - Invocation.getter(#authOptionPasswordTitle), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#authOptionPasswordTitle), - ), - ) - as String); - - @override - String get signInWithToken => - (super.noSuchMethod( - Invocation.getter(#signInWithToken), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#signInWithToken), - ), - ) - as String); - - @override - String get tokenSubtitle => - (super.noSuchMethod( - Invocation.getter(#tokenSubtitle), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#tokenSubtitle), - ), - ) - as String); - - @override - String get newToWger => - (super.noSuchMethod( - Invocation.getter(#newToWger), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#newToWger), - ), - ) - as String); - - @override - String get alreadyHaveAccount => - (super.noSuchMethod( - Invocation.getter(#alreadyHaveAccount), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#alreadyHaveAccount), - ), - ) - as String); - - @override - String get tokenLabel => - (super.noSuchMethod( - Invocation.getter(#tokenLabel), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#tokenLabel), - ), - ) - as String); - - @override - String get webHandoffLinkLabel => - (super.noSuchMethod( - Invocation.getter(#webHandoffLinkLabel), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#webHandoffLinkLabel), - ), - ) - as String); - - @override - String get webHandoffLinkSubtitle => - (super.noSuchMethod( - Invocation.getter(#webHandoffLinkSubtitle), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#webHandoffLinkSubtitle), - ), - ) - as String); - - @override - String get labelBottomNavWorkout => - (super.noSuchMethod( - Invocation.getter(#labelBottomNavWorkout), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#labelBottomNavWorkout), - ), - ) - as String); - - @override - String get labelBottomNavNutrition => - (super.noSuchMethod( - Invocation.getter(#labelBottomNavNutrition), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#labelBottomNavNutrition), - ), - ) - as String); - - @override - String get labelBottomNavBody => - (super.noSuchMethod( - Invocation.getter(#labelBottomNavBody), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#labelBottomNavBody), - ), - ) - as String); - - @override - String get labelWorkoutLogs => - (super.noSuchMethod( - Invocation.getter(#labelWorkoutLogs), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#labelWorkoutLogs), - ), - ) - as String); - - @override - String get labelWorkoutPlan => - (super.noSuchMethod( - Invocation.getter(#labelWorkoutPlan), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#labelWorkoutPlan), - ), - ) - as String); - - @override - String get dashboardWidgets => - (super.noSuchMethod( - Invocation.getter(#dashboardWidgets), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#dashboardWidgets), - ), - ) - as String); - - @override - String get labelDashboard => - (super.noSuchMethod( - Invocation.getter(#labelDashboard), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#labelDashboard), - ), - ) - as String); - - @override - String get success => - (super.noSuchMethod( - Invocation.getter(#success), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#success), - ), - ) - as String); - - @override - String get successfullyDeleted => - (super.noSuchMethod( - Invocation.getter(#successfullyDeleted), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#successfullyDeleted), - ), - ) - as String); - - @override - String get successfullySaved => - (super.noSuchMethod( - Invocation.getter(#successfullySaved), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#successfullySaved), - ), - ) - as String); - - @override - String get exerciseList => - (super.noSuchMethod( - Invocation.getter(#exerciseList), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#exerciseList), - ), - ) - as String); - - @override - String get exercise => - (super.noSuchMethod( - Invocation.getter(#exercise), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#exercise), - ), - ) - as String); - - @override - String get exercises => - (super.noSuchMethod( - Invocation.getter(#exercises), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#exercises), - ), - ) - as String); - - @override - String get exerciseName => - (super.noSuchMethod( - Invocation.getter(#exerciseName), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#exerciseName), - ), - ) - as String); - - @override - String get searchExercise => - (super.noSuchMethod( - Invocation.getter(#searchExercise), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#searchExercise), - ), - ) - as String); - - @override - String get noIngredientsDefined => - (super.noSuchMethod( - Invocation.getter(#noIngredientsDefined), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#noIngredientsDefined), - ), - ) - as String); - - @override - String get noMatchingExerciseFound => - (super.noSuchMethod( - Invocation.getter(#noMatchingExerciseFound), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#noMatchingExerciseFound), - ), - ) - as String); - - @override - String get equipment => - (super.noSuchMethod( - Invocation.getter(#equipment), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#equipment), - ), - ) - as String); - - @override - String get muscles => - (super.noSuchMethod( - Invocation.getter(#muscles), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#muscles), - ), - ) - as String); - - @override - String get musclesSecondary => - (super.noSuchMethod( - Invocation.getter(#musclesSecondary), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#musclesSecondary), - ), - ) - as String); - - @override - String get category => - (super.noSuchMethod( - Invocation.getter(#category), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#category), - ), - ) - as String); - - @override - String get startDate => - (super.noSuchMethod( - Invocation.getter(#startDate), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#startDate), - ), - ) - as String); - - @override - String get dayTypeCustom => - (super.noSuchMethod( - Invocation.getter(#dayTypeCustom), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#dayTypeCustom), - ), - ) - as String); - - @override - String get dayTypeEnom => - (super.noSuchMethod( - Invocation.getter(#dayTypeEnom), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#dayTypeEnom), - ), - ) - as String); - - @override - String get dayTypeAmrap => - (super.noSuchMethod( - Invocation.getter(#dayTypeAmrap), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#dayTypeAmrap), - ), - ) - as String); - - @override - String get dayTypeHiit => - (super.noSuchMethod( - Invocation.getter(#dayTypeHiit), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#dayTypeHiit), - ), - ) - as String); - - @override - String get dayTypeTabata => - (super.noSuchMethod( - Invocation.getter(#dayTypeTabata), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#dayTypeTabata), - ), - ) - as String); - - @override - String get dayTypeEdt => - (super.noSuchMethod( - Invocation.getter(#dayTypeEdt), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#dayTypeEdt), - ), - ) - as String); - - @override - String get dayTypeRft => - (super.noSuchMethod( - Invocation.getter(#dayTypeRft), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#dayTypeRft), - ), - ) - as String); - - @override - String get dayTypeAfap => - (super.noSuchMethod( - Invocation.getter(#dayTypeAfap), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#dayTypeAfap), - ), - ) - as String); - - @override - String get slotEntryTypeNormal => - (super.noSuchMethod( - Invocation.getter(#slotEntryTypeNormal), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#slotEntryTypeNormal), - ), - ) - as String); - - @override - String get slotEntryTypeDropset => - (super.noSuchMethod( - Invocation.getter(#slotEntryTypeDropset), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#slotEntryTypeDropset), - ), - ) - as String); - - @override - String get slotEntryTypeMyo => - (super.noSuchMethod( - Invocation.getter(#slotEntryTypeMyo), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#slotEntryTypeMyo), - ), - ) - as String); - - @override - String get slotEntryTypeWarmup => - (super.noSuchMethod( - Invocation.getter(#slotEntryTypeWarmup), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#slotEntryTypeWarmup), - ), - ) - as String); - - @override - String get slotEntryTypePartial => - (super.noSuchMethod( - Invocation.getter(#slotEntryTypePartial), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#slotEntryTypePartial), - ), - ) - as String); - - @override - String get slotEntryTypeForced => - (super.noSuchMethod( - Invocation.getter(#slotEntryTypeForced), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#slotEntryTypeForced), - ), - ) - as String); - - @override - String get slotEntryTypeTut => - (super.noSuchMethod( - Invocation.getter(#slotEntryTypeTut), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#slotEntryTypeTut), - ), - ) - as String); - - @override - String get slotEntryTypeIso => - (super.noSuchMethod( - Invocation.getter(#slotEntryTypeIso), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#slotEntryTypeIso), - ), - ) - as String); - - @override - String get slotEntryTypeJump => - (super.noSuchMethod( - Invocation.getter(#slotEntryTypeJump), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#slotEntryTypeJump), - ), - ) - as String); - - @override - String get trophies => - (super.noSuchMethod( - Invocation.getter(#trophies), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#trophies), - ), - ) - as String); - - @override - String get routines => - (super.noSuchMethod( - Invocation.getter(#routines), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#routines), - ), - ) - as String); - - @override - String get newRoutine => - (super.noSuchMethod( - Invocation.getter(#newRoutine), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#newRoutine), - ), - ) - as String); - - @override - String get noRoutines => - (super.noSuchMethod( - Invocation.getter(#noRoutines), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#noRoutines), - ), - ) - as String); - - @override - String get reps => - (super.noSuchMethod( - Invocation.getter(#reps), - returnValue: _i3.dummyValue(this, Invocation.getter(#reps)), - ) - as String); - - @override - String get restTime => - (super.noSuchMethod( - Invocation.getter(#restTime), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#restTime), - ), - ) - as String); - - @override - String get sets => - (super.noSuchMethod( - Invocation.getter(#sets), - returnValue: _i3.dummyValue(this, Invocation.getter(#sets)), - ) - as String); - - @override - String get rir => - (super.noSuchMethod( - Invocation.getter(#rir), - returnValue: _i3.dummyValue(this, Invocation.getter(#rir)), - ) - as String); - - @override - String get rirNotUsed => - (super.noSuchMethod( - Invocation.getter(#rirNotUsed), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#rirNotUsed), - ), - ) - as String); - - @override - String get useMetric => - (super.noSuchMethod( - Invocation.getter(#useMetric), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#useMetric), - ), - ) - as String); - - @override - String get weightUnit => - (super.noSuchMethod( - Invocation.getter(#weightUnit), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#weightUnit), - ), - ) - as String); - - @override - String get repetitionUnit => - (super.noSuchMethod( - Invocation.getter(#repetitionUnit), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#repetitionUnit), - ), - ) - as String); - - @override - String get set => - (super.noSuchMethod( - Invocation.getter(#set), - returnValue: _i3.dummyValue(this, Invocation.getter(#set)), - ) - as String); - - @override - String get dayDescriptionHelp => - (super.noSuchMethod( - Invocation.getter(#dayDescriptionHelp), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#dayDescriptionHelp), - ), - ) - as String); - - @override - String get comment => - (super.noSuchMethod( - Invocation.getter(#comment), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#comment), - ), - ) - as String); - - @override - String get impressionGood => - (super.noSuchMethod( - Invocation.getter(#impressionGood), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#impressionGood), - ), - ) - as String); - - @override - String get impressionNeutral => - (super.noSuchMethod( - Invocation.getter(#impressionNeutral), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#impressionNeutral), - ), - ) - as String); - - @override - String get impressionBad => - (super.noSuchMethod( - Invocation.getter(#impressionBad), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#impressionBad), - ), - ) - as String); - - @override - String get impression => - (super.noSuchMethod( - Invocation.getter(#impression), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#impression), - ), - ) - as String); - - @override - String get notes => - (super.noSuchMethod( - Invocation.getter(#notes), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#notes), - ), - ) - as String); - - @override - String get workoutSession => - (super.noSuchMethod( - Invocation.getter(#workoutSession), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#workoutSession), - ), - ) - as String); - - @override - String get restDay => - (super.noSuchMethod( - Invocation.getter(#restDay), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#restDay), - ), - ) - as String); - - @override - String get isRestDay => - (super.noSuchMethod( - Invocation.getter(#isRestDay), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#isRestDay), - ), - ) - as String); - - @override - String get isRestDayHelp => - (super.noSuchMethod( - Invocation.getter(#isRestDayHelp), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#isRestDayHelp), - ), - ) - as String); - - @override - String get needsLogsToAdvance => - (super.noSuchMethod( - Invocation.getter(#needsLogsToAdvance), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#needsLogsToAdvance), - ), - ) - as String); - - @override - String get needsLogsToAdvanceHelp => - (super.noSuchMethod( - Invocation.getter(#needsLogsToAdvanceHelp), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#needsLogsToAdvanceHelp), - ), - ) - as String); - - @override - String get routineDays => - (super.noSuchMethod( - Invocation.getter(#routineDays), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#routineDays), - ), - ) - as String); - - @override - String get resultingRoutine => - (super.noSuchMethod( - Invocation.getter(#resultingRoutine), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#resultingRoutine), - ), - ) - as String); - - @override - String get newDay => - (super.noSuchMethod( - Invocation.getter(#newDay), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#newDay), - ), - ) - as String); - - @override - String get personalRecords => - (super.noSuchMethod( - Invocation.getter(#personalRecords), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#personalRecords), - ), - ) - as String); - - @override - String get gymMode => - (super.noSuchMethod( - Invocation.getter(#gymMode), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#gymMode), - ), - ) - as String); - - @override - String get gymModeShowExercises => - (super.noSuchMethod( - Invocation.getter(#gymModeShowExercises), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#gymModeShowExercises), - ), - ) - as String); - - @override - String get gymModeShowTimer => - (super.noSuchMethod( - Invocation.getter(#gymModeShowTimer), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#gymModeShowTimer), - ), - ) - as String); - - @override - String get gymModeShowWorkoutDuration => - (super.noSuchMethod( - Invocation.getter(#gymModeShowWorkoutDuration), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#gymModeShowWorkoutDuration), - ), - ) - as String); - - @override - String get gymModeTimerType => - (super.noSuchMethod( - Invocation.getter(#gymModeTimerType), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#gymModeTimerType), - ), - ) - as String); - - @override - String get gymModeTimerTypeHelText => - (super.noSuchMethod( - Invocation.getter(#gymModeTimerTypeHelText), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#gymModeTimerTypeHelText), - ), - ) - as String); - - @override - String get countdown => - (super.noSuchMethod( - Invocation.getter(#countdown), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#countdown), - ), - ) - as String); - - @override - String get stopwatch => - (super.noSuchMethod( - Invocation.getter(#stopwatch), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#stopwatch), - ), - ) - as String); - - @override - String get gymModeDefaultCountdownTime => - (super.noSuchMethod( - Invocation.getter(#gymModeDefaultCountdownTime), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#gymModeDefaultCountdownTime), - ), - ) - as String); - - @override - String get gymModeAlertOnRestEnd => - (super.noSuchMethod( - Invocation.getter(#gymModeAlertOnRestEnd), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#gymModeAlertOnRestEnd), - ), - ) - as String); - - @override - String get gymModeAlertOnRestEndHelp => - (super.noSuchMethod( - Invocation.getter(#gymModeAlertOnRestEndHelp), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#gymModeAlertOnRestEndHelp), - ), - ) - as String); - - @override - String get gymModeWorkoutNotification => - (super.noSuchMethod( - Invocation.getter(#gymModeWorkoutNotification), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#gymModeWorkoutNotification), - ), - ) - as String); - - @override - String get gymModeExactAlarmMissing => - (super.noSuchMethod( - Invocation.getter(#gymModeExactAlarmMissing), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#gymModeExactAlarmMissing), - ), - ) - as String); - - @override - String get gymModeExactAlarmAllow => - (super.noSuchMethod( - Invocation.getter(#gymModeExactAlarmAllow), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#gymModeExactAlarmAllow), - ), - ) - as String); - - @override - String get gymModeWorkoutNotificationHelp => - (super.noSuchMethod( - Invocation.getter(#gymModeWorkoutNotificationHelp), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#gymModeWorkoutNotificationHelp), - ), - ) - as String); - - @override - String get workoutNotificationRestOver => - (super.noSuchMethod( - Invocation.getter(#workoutNotificationRestOver), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#workoutNotificationRestOver), - ), - ) - as String); - - @override - String get workoutNotificationInProgress => - (super.noSuchMethod( - Invocation.getter(#workoutNotificationInProgress), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#workoutNotificationInProgress), - ), - ) - as String); - - @override - String get workoutNotificationLogSet => - (super.noSuchMethod( - Invocation.getter(#workoutNotificationLogSet), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#workoutNotificationLogSet), - ), - ) - as String); - - @override - String get workoutNotificationSkipRest => - (super.noSuchMethod( - Invocation.getter(#workoutNotificationSkipRest), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#workoutNotificationSkipRest), - ), - ) - as String); - - @override - String get workoutNotificationNotLoggedTitle => - (super.noSuchMethod( - Invocation.getter(#workoutNotificationNotLoggedTitle), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#workoutNotificationNotLoggedTitle), - ), - ) - as String); - - @override - String get workoutNotificationNotLoggedBody => - (super.noSuchMethod( - Invocation.getter(#workoutNotificationNotLoggedBody), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#workoutNotificationNotLoggedBody), - ), - ) - as String); - - @override - String get workoutNotificationAlarmChannel => - (super.noSuchMethod( - Invocation.getter(#workoutNotificationAlarmChannel), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#workoutNotificationAlarmChannel), - ), - ) - as String); - - @override - String get workoutNotificationChannel => - (super.noSuchMethod( - Invocation.getter(#workoutNotificationChannel), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#workoutNotificationChannel), - ), - ) - as String); - - @override - String get duration => - (super.noSuchMethod( - Invocation.getter(#duration), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#duration), - ), - ) - as String); - - @override - String get volume => - (super.noSuchMethod( - Invocation.getter(#volume), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#volume), - ), - ) - as String); - - @override - String get workoutCompleted => - (super.noSuchMethod( - Invocation.getter(#workoutCompleted), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#workoutCompleted), - ), - ) - as String); - - @override - String get plateCalculator => - (super.noSuchMethod( - Invocation.getter(#plateCalculator), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#plateCalculator), - ), - ) - as String); - - @override - String get plateCalculatorNotDivisible => - (super.noSuchMethod( - Invocation.getter(#plateCalculatorNotDivisible), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#plateCalculatorNotDivisible), - ), - ) - as String); - - @override - String get pause => - (super.noSuchMethod( - Invocation.getter(#pause), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#pause), - ), - ) - as String); - - @override - String get upNext => - (super.noSuchMethod( - Invocation.getter(#upNext), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#upNext), - ), - ) - as String); - - @override - String get gymModeStickySetValues => - (super.noSuchMethod( - Invocation.getter(#gymModeStickySetValues), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#gymModeStickySetValues), - ), - ) - as String); - - @override - String get gymModeStickySetValuesHelp => - (super.noSuchMethod( - Invocation.getter(#gymModeStickySetValuesHelp), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#gymModeStickySetValuesHelp), - ), - ) - as String); - - @override - String get jumpTo => - (super.noSuchMethod( - Invocation.getter(#jumpTo), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#jumpTo), - ), - ) - as String); - - @override - String get todaysWorkout => - (super.noSuchMethod( - Invocation.getter(#todaysWorkout), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#todaysWorkout), - ), - ) - as String); - - @override - String get logHelpEntries => - (super.noSuchMethod( - Invocation.getter(#logHelpEntries), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#logHelpEntries), - ), - ) - as String); - - @override - String get logHelpEntriesUnits => - (super.noSuchMethod( - Invocation.getter(#logHelpEntriesUnits), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#logHelpEntriesUnits), - ), - ) - as String); - - @override - String get description => - (super.noSuchMethod( - Invocation.getter(#description), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#description), - ), - ) - as String); - - @override - String get name => - (super.noSuchMethod( - Invocation.getter(#name), - returnValue: _i3.dummyValue(this, Invocation.getter(#name)), - ) - as String); - - @override - String get save => - (super.noSuchMethod( - Invocation.getter(#save), - returnValue: _i3.dummyValue(this, Invocation.getter(#save)), - ) - as String); - - @override - String get verify => - (super.noSuchMethod( - Invocation.getter(#verify), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#verify), - ), - ) - as String); - - @override - String get addSet => - (super.noSuchMethod( - Invocation.getter(#addSet), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#addSet), - ), - ) - as String); - - @override - String get gymModeLogScope => - (super.noSuchMethod( - Invocation.getter(#gymModeLogScope), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#gymModeLogScope), - ), - ) - as String); - - @override - String get gymModeLogScopeHelp => - (super.noSuchMethod( - Invocation.getter(#gymModeLogScopeHelp), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#gymModeLogScopeHelp), - ), - ) - as String); - - @override - String get gymModeLogScopeCurrentRoutine => - (super.noSuchMethod( - Invocation.getter(#gymModeLogScopeCurrentRoutine), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#gymModeLogScopeCurrentRoutine), - ), - ) - as String); - - @override - String get gymModeDistinctLogs => - (super.noSuchMethod( - Invocation.getter(#gymModeDistinctLogs), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#gymModeDistinctLogs), - ), - ) - as String); - - @override - String get addMeal => - (super.noSuchMethod( - Invocation.getter(#addMeal), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#addMeal), - ), - ) - as String); - - @override - String get meal => - (super.noSuchMethod( - Invocation.getter(#meal), - returnValue: _i3.dummyValue(this, Invocation.getter(#meal)), - ) - as String); - - @override - String get mealLogged => - (super.noSuchMethod( - Invocation.getter(#mealLogged), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#mealLogged), - ), - ) - as String); - - @override - String get ingredientLogged => - (super.noSuchMethod( - Invocation.getter(#ingredientLogged), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#ingredientLogged), - ), - ) - as String); - - @override - String get logMeal => - (super.noSuchMethod( - Invocation.getter(#logMeal), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#logMeal), - ), - ) - as String); - - @override - String get addIngredient => - (super.noSuchMethod( - Invocation.getter(#addIngredient), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#addIngredient), - ), - ) - as String); - - @override - String get logIngredient => - (super.noSuchMethod( - Invocation.getter(#logIngredient), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#logIngredient), - ), - ) - as String); - - @override - String get searchIngredient => - (super.noSuchMethod( - Invocation.getter(#searchIngredient), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#searchIngredient), - ), - ) - as String); - - @override - String get nutritionalPlan => - (super.noSuchMethod( - Invocation.getter(#nutritionalPlan), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#nutritionalPlan), - ), - ) - as String); - - @override - String get nutritionalDiary => - (super.noSuchMethod( - Invocation.getter(#nutritionalDiary), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#nutritionalDiary), - ), - ) - as String); - - @override - String get nutritionalPlans => - (super.noSuchMethod( - Invocation.getter(#nutritionalPlans), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#nutritionalPlans), - ), - ) - as String); - - @override - String get noNutritionalPlans => - (super.noSuchMethod( - Invocation.getter(#noNutritionalPlans), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#noNutritionalPlans), - ), - ) - as String); - - @override - String get clearSearchTerm => - (super.noSuchMethod( - Invocation.getter(#clearSearchTerm), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#clearSearchTerm), - ), - ) - as String); - - @override - String get ingredients => - (super.noSuchMethod( - Invocation.getter(#ingredients), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#ingredients), - ), - ) - as String); - - @override - String get onlyLogging => - (super.noSuchMethod( - Invocation.getter(#onlyLogging), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#onlyLogging), - ), - ) - as String); - - @override - String get onlyLoggingHelpText => - (super.noSuchMethod( - Invocation.getter(#onlyLoggingHelpText), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#onlyLoggingHelpText), - ), - ) - as String); - - @override - String get goalMacro => - (super.noSuchMethod( - Invocation.getter(#goalMacro), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#goalMacro), - ), - ) - as String); - - @override - String get selectMealToLog => - (super.noSuchMethod( - Invocation.getter(#selectMealToLog), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#selectMealToLog), - ), - ) - as String); - - @override - String get yourCurrentNutritionPlanHasNoMealsDefinedYet => - (super.noSuchMethod( - Invocation.getter(#yourCurrentNutritionPlanHasNoMealsDefinedYet), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#yourCurrentNutritionPlanHasNoMealsDefinedYet), - ), - ) - as String); - - @override - String get toAddMealsToThePlanGoToNutritionalPlanDetails => - (super.noSuchMethod( - Invocation.getter(#toAddMealsToThePlanGoToNutritionalPlanDetails), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#toAddMealsToThePlanGoToNutritionalPlanDetails), - ), - ) - as String); - - @override - String get otherLogs => - (super.noSuchMethod( - Invocation.getter(#otherLogs), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#otherLogs), - ), - ) - as String); - - @override - String get goalEnergy => - (super.noSuchMethod( - Invocation.getter(#goalEnergy), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#goalEnergy), - ), - ) - as String); - - @override - String get goalProtein => - (super.noSuchMethod( - Invocation.getter(#goalProtein), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#goalProtein), - ), - ) - as String); - - @override - String get goalCarbohydrates => - (super.noSuchMethod( - Invocation.getter(#goalCarbohydrates), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#goalCarbohydrates), - ), - ) - as String); - - @override - String get goalFat => - (super.noSuchMethod( - Invocation.getter(#goalFat), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#goalFat), - ), - ) - as String); - - @override - String get goalFiber => - (super.noSuchMethod( - Invocation.getter(#goalFiber), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#goalFiber), - ), - ) - as String); - - @override - String get anErrorOccurred => - (super.noSuchMethod( - Invocation.getter(#anErrorOccurred), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#anErrorOccurred), - ), - ) - as String); - - @override - String get errorRawSource => - (super.noSuchMethod( - Invocation.getter(#errorRawSource), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#errorRawSource), - ), - ) - as String); - - @override - String get errorInfoDescription => - (super.noSuchMethod( - Invocation.getter(#errorInfoDescription), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#errorInfoDescription), - ), - ) - as String); - - @override - String get errorInfoDescription2 => - (super.noSuchMethod( - Invocation.getter(#errorInfoDescription2), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#errorInfoDescription2), - ), - ) - as String); - - @override - String get errorViewDetails => - (super.noSuchMethod( - Invocation.getter(#errorViewDetails), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#errorViewDetails), - ), - ) - as String); - - @override - String get applicationLogs => - (super.noSuchMethod( - Invocation.getter(#applicationLogs), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#applicationLogs), - ), - ) - as String); - - @override - String get errorCouldNotConnectToServer => - (super.noSuchMethod( - Invocation.getter(#errorCouldNotConnectToServer), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#errorCouldNotConnectToServer), - ), - ) - as String); - - @override - String get copyToClipboard => - (super.noSuchMethod( - Invocation.getter(#copyToClipboard), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#copyToClipboard), - ), - ) - as String); - - @override - String get weight => - (super.noSuchMethod( - Invocation.getter(#weight), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#weight), - ), - ) - as String); - - @override - String get min => - (super.noSuchMethod( - Invocation.getter(#min), - returnValue: _i3.dummyValue(this, Invocation.getter(#min)), - ) - as String); - - @override - String get max => - (super.noSuchMethod( - Invocation.getter(#max), - returnValue: _i3.dummyValue(this, Invocation.getter(#max)), - ) - as String); - - @override - String get chartRangeAll => - (super.noSuchMethod( - Invocation.getter(#chartRangeAll), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#chartRangeAll), - ), - ) - as String); - - @override - String get chartType => - (super.noSuchMethod( - Invocation.getter(#chartType), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#chartType), - ), - ) - as String); - - @override - String get chartTypeAuto => - (super.noSuchMethod( - Invocation.getter(#chartTypeAuto), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#chartTypeAuto), - ), - ) - as String); - - @override - String get chartTypeLine => - (super.noSuchMethod( - Invocation.getter(#chartTypeLine), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#chartTypeLine), - ), - ) - as String); - - @override - String get chartTypeBar => - (super.noSuchMethod( - Invocation.getter(#chartTypeBar), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#chartTypeBar), - ), - ) - as String); - - @override - String get chartTypeHeatmap => - (super.noSuchMethod( - Invocation.getter(#chartTypeHeatmap), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#chartTypeHeatmap), - ), - ) - as String); - - @override - String get chartTypeDelta => - (super.noSuchMethod( - Invocation.getter(#chartTypeDelta), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#chartTypeDelta), - ), - ) - as String); - - @override - String get chartTrend => - (super.noSuchMethod( - Invocation.getter(#chartTrend), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#chartTrend), - ), - ) - as String); - - @override - String get trendReactive => - (super.noSuchMethod( - Invocation.getter(#trendReactive), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#trendReactive), - ), - ) - as String); - - @override - String get trendBalanced => - (super.noSuchMethod( - Invocation.getter(#trendBalanced), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#trendBalanced), - ), - ) - as String); - - @override - String get trendSluggish => - (super.noSuchMethod( - Invocation.getter(#trendSluggish), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#trendSluggish), - ), - ) - as String); - - @override - String get chartAverageWindow => - (super.noSuchMethod( - Invocation.getter(#chartAverageWindow), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#chartAverageWindow), - ), - ) - as String); - - @override - String get chartTypeDistribution => - (super.noSuchMethod( - Invocation.getter(#chartTypeDistribution), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#chartTypeDistribution), - ), - ) - as String); - - @override - String get distributionMedian => - (super.noSuchMethod( - Invocation.getter(#distributionMedian), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#distributionMedian), - ), - ) - as String); - - @override - String get distributionLatest => - (super.noSuchMethod( - Invocation.getter(#distributionLatest), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#distributionLatest), - ), - ) - as String); - - @override - String get sparkTrendStable => - (super.noSuchMethod( - Invocation.getter(#sparkTrendStable), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#sparkTrendStable), - ), - ) - as String); - - @override - String get trackNewMetric => - (super.noSuchMethod( - Invocation.getter(#trackNewMetric), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#trackNewMetric), - ), - ) - as String); - - @override - String get measurement => - (super.noSuchMethod( - Invocation.getter(#measurement), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#measurement), - ), - ) - as String); - - @override - String get measurements => - (super.noSuchMethod( - Invocation.getter(#measurements), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#measurements), - ), - ) - as String); - - @override - String get measurementCategoriesHelpText => - (super.noSuchMethod( - Invocation.getter(#measurementCategoriesHelpText), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#measurementCategoriesHelpText), - ), - ) - as String); - - @override - String get whatToTrack => - (super.noSuchMethod( - Invocation.getter(#whatToTrack), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#whatToTrack), - ), - ) - as String); - - @override - String get customMeasurement => - (super.noSuchMethod( - Invocation.getter(#customMeasurement), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#customMeasurement), - ), - ) - as String); - - @override - String get metricAlreadyTracked => - (super.noSuchMethod( - Invocation.getter(#metricAlreadyTracked), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#metricAlreadyTracked), - ), - ) - as String); - - @override - String get reorderCategories => - (super.noSuchMethod( - Invocation.getter(#reorderCategories), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#reorderCategories), - ), - ) - as String); - - @override - String get metricCustom => - (super.noSuchMethod( - Invocation.getter(#metricCustom), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#metricCustom), - ), - ) - as String); - - @override - String get metricLeanBodyMass => - (super.noSuchMethod( - Invocation.getter(#metricLeanBodyMass), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#metricLeanBodyMass), - ), - ) - as String); - - @override - String get metricBodyFat => - (super.noSuchMethod( - Invocation.getter(#metricBodyFat), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#metricBodyFat), - ), - ) - as String); - - @override - String get metricHeight => - (super.noSuchMethod( - Invocation.getter(#metricHeight), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#metricHeight), - ), - ) - as String); - - @override - String get metricBloodPressure => - (super.noSuchMethod( - Invocation.getter(#metricBloodPressure), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#metricBloodPressure), - ), - ) - as String); - - @override - String get metricBloodPressureSystolic => - (super.noSuchMethod( - Invocation.getter(#metricBloodPressureSystolic), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#metricBloodPressureSystolic), - ), - ) - as String); - - @override - String get metricBloodPressureDiastolic => - (super.noSuchMethod( - Invocation.getter(#metricBloodPressureDiastolic), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#metricBloodPressureDiastolic), - ), - ) - as String); - - @override - String get metricHeartRate => - (super.noSuchMethod( - Invocation.getter(#metricHeartRate), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#metricHeartRate), - ), - ) - as String); - - @override - String get metricRestingHeartRate => - (super.noSuchMethod( - Invocation.getter(#metricRestingHeartRate), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#metricRestingHeartRate), - ), - ) - as String); - - @override - String get metricBloodOxygen => - (super.noSuchMethod( - Invocation.getter(#metricBloodOxygen), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#metricBloodOxygen), - ), - ) - as String); - - @override - String get metricSteps => - (super.noSuchMethod( - Invocation.getter(#metricSteps), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#metricSteps), - ), - ) - as String); - - @override - String get metricDistance => - (super.noSuchMethod( - Invocation.getter(#metricDistance), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#metricDistance), - ), - ) - as String); - - @override - String get metricSleep => - (super.noSuchMethod( - Invocation.getter(#metricSleep), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#metricSleep), - ), - ) - as String); - - @override - String get noDataAvailable => - (super.noSuchMethod( - Invocation.getter(#noDataAvailable), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#noDataAvailable), - ), - ) - as String); - - @override - String get metricSleepTotal => - (super.noSuchMethod( - Invocation.getter(#metricSleepTotal), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#metricSleepTotal), - ), - ) - as String); - - @override - String get metricSleepLight => - (super.noSuchMethod( - Invocation.getter(#metricSleepLight), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#metricSleepLight), - ), - ) - as String); - - @override - String get metricSleepDeep => - (super.noSuchMethod( - Invocation.getter(#metricSleepDeep), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#metricSleepDeep), - ), - ) - as String); - - @override - String get metricSleepRem => - (super.noSuchMethod( - Invocation.getter(#metricSleepRem), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#metricSleepRem), - ), - ) - as String); - - @override - String get metricSleepAwake => - (super.noSuchMethod( - Invocation.getter(#metricSleepAwake), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#metricSleepAwake), - ), - ) - as String); - - @override - String get measurementEntriesHelpText => - (super.noSuchMethod( - Invocation.getter(#measurementEntriesHelpText), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#measurementEntriesHelpText), - ), - ) - as String); - - @override - String get partOfGroup => - (super.noSuchMethod( - Invocation.getter(#partOfGroup), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#partOfGroup), - ), - ) - as String); - - @override - String get noGroup => - (super.noSuchMethod( - Invocation.getter(#noGroup), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#noGroup), - ), - ) - as String); - - @override - String get date => - (super.noSuchMethod( - Invocation.getter(#date), - returnValue: _i3.dummyValue(this, Invocation.getter(#date)), - ) - as String); - - @override - String get endDate => - (super.noSuchMethod( - Invocation.getter(#endDate), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#endDate), - ), - ) - as String); - - @override - String get endBeforeStart => - (super.noSuchMethod( - Invocation.getter(#endBeforeStart), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#endBeforeStart), - ), - ) - as String); - - @override - String get openEnded => - (super.noSuchMethod( - Invocation.getter(#openEnded), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#openEnded), - ), - ) - as String); - - @override - String get value => - (super.noSuchMethod( - Invocation.getter(#value), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#value), - ), - ) - as String); - - @override - String get start => - (super.noSuchMethod( - Invocation.getter(#start), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#start), - ), - ) - as String); - - @override - String get time => - (super.noSuchMethod( - Invocation.getter(#time), - returnValue: _i3.dummyValue(this, Invocation.getter(#time)), - ) - as String); - - @override - String get timeStart => - (super.noSuchMethod( - Invocation.getter(#timeStart), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#timeStart), - ), - ) - as String); - - @override - String get timeEnd => - (super.noSuchMethod( - Invocation.getter(#timeEnd), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#timeEnd), - ), - ) - as String); - - @override - String get timeStartAhead => - (super.noSuchMethod( - Invocation.getter(#timeStartAhead), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#timeStartAhead), - ), - ) - as String); - - @override - String get ingredient => - (super.noSuchMethod( - Invocation.getter(#ingredient), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#ingredient), - ), - ) - as String); - - @override - String get energy => - (super.noSuchMethod( - Invocation.getter(#energy), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#energy), - ), - ) - as String); - - @override - String get energyShort => - (super.noSuchMethod( - Invocation.getter(#energyShort), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#energyShort), - ), - ) - as String); - - @override - String get dietaryInformation => - (super.noSuchMethod( - Invocation.getter(#dietaryInformation), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#dietaryInformation), - ), - ) - as String); - - @override - String get macronutrients => - (super.noSuchMethod( - Invocation.getter(#macronutrients), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#macronutrients), - ), - ) - as String); - - @override - String get planned => - (super.noSuchMethod( - Invocation.getter(#planned), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#planned), - ), - ) - as String); - - @override - String get logged => - (super.noSuchMethod( - Invocation.getter(#logged), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#logged), - ), - ) - as String); - - @override - String get today => - (super.noSuchMethod( - Invocation.getter(#today), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#today), - ), - ) - as String); - - @override - String get loggedToday => - (super.noSuchMethod( - Invocation.getter(#loggedToday), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#loggedToday), - ), - ) - as String); - - @override - String get weekAverage => - (super.noSuchMethod( - Invocation.getter(#weekAverage), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#weekAverage), - ), - ) - as String); - - @override - String get surplus => - (super.noSuchMethod( - Invocation.getter(#surplus), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#surplus), - ), - ) - as String); - - @override - String get deficit => - (super.noSuchMethod( - Invocation.getter(#deficit), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#deficit), - ), - ) - as String); - - @override - String get difference => - (super.noSuchMethod( - Invocation.getter(#difference), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#difference), - ), - ) - as String); - - @override - String get percentEnergy => - (super.noSuchMethod( - Invocation.getter(#percentEnergy), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#percentEnergy), - ), - ) - as String); - - @override - String get gPerBodyKg => - (super.noSuchMethod( - Invocation.getter(#gPerBodyKg), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#gPerBodyKg), - ), - ) - as String); - - @override - String get total => - (super.noSuchMethod( - Invocation.getter(#total), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#total), - ), - ) - as String); - - @override - String get kcal => - (super.noSuchMethod( - Invocation.getter(#kcal), - returnValue: _i3.dummyValue(this, Invocation.getter(#kcal)), - ) - as String); - - @override - String get kJ => - (super.noSuchMethod( - Invocation.getter(#kJ), - returnValue: _i3.dummyValue(this, Invocation.getter(#kJ)), - ) - as String); - - @override - String get g => - (super.noSuchMethod( - Invocation.getter(#g), - returnValue: _i3.dummyValue(this, Invocation.getter(#g)), - ) - as String); - - @override - String get protein => - (super.noSuchMethod( - Invocation.getter(#protein), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#protein), - ), - ) - as String); - - @override - String get proteinShort => - (super.noSuchMethod( - Invocation.getter(#proteinShort), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#proteinShort), - ), - ) - as String); - - @override - String get carbohydrates => - (super.noSuchMethod( - Invocation.getter(#carbohydrates), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#carbohydrates), - ), - ) - as String); - - @override - String get carbohydratesShort => - (super.noSuchMethod( - Invocation.getter(#carbohydratesShort), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#carbohydratesShort), - ), - ) - as String); - - @override - String get sugars => - (super.noSuchMethod( - Invocation.getter(#sugars), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#sugars), - ), - ) - as String); - - @override - String get fat => - (super.noSuchMethod( - Invocation.getter(#fat), - returnValue: _i3.dummyValue(this, Invocation.getter(#fat)), - ) - as String); - - @override - String get fatShort => - (super.noSuchMethod( - Invocation.getter(#fatShort), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#fatShort), - ), - ) - as String); - - @override - String get saturatedFat => - (super.noSuchMethod( - Invocation.getter(#saturatedFat), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#saturatedFat), - ), - ) - as String); - - @override - String get fiber => - (super.noSuchMethod( - Invocation.getter(#fiber), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#fiber), - ), - ) - as String); - - @override - String get sodium => - (super.noSuchMethod( - Invocation.getter(#sodium), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#sodium), - ), - ) - as String); - - @override - String get carbohydratesSugar => - (super.noSuchMethod( - Invocation.getter(#carbohydratesSugar), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#carbohydratesSugar), - ), - ) - as String); - - @override - String get amount => - (super.noSuchMethod( - Invocation.getter(#amount), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#amount), - ), - ) - as String); - - @override - String get unit => - (super.noSuchMethod( - Invocation.getter(#unit), - returnValue: _i3.dummyValue(this, Invocation.getter(#unit)), - ) - as String); - - @override - String get newEntry => - (super.noSuchMethod( - Invocation.getter(#newEntry), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#newEntry), - ), - ) - as String); - - @override - String get noTrophies => - (super.noSuchMethod( - Invocation.getter(#noTrophies), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#noTrophies), - ), - ) - as String); - - @override - String get noWeightEntries => - (super.noSuchMethod( - Invocation.getter(#noWeightEntries), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#noWeightEntries), - ), - ) - as String); - - @override - String get moreMeasurementEntries => - (super.noSuchMethod( - Invocation.getter(#moreMeasurementEntries), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#moreMeasurementEntries), - ), - ) - as String); - - @override - String get edit => - (super.noSuchMethod( - Invocation.getter(#edit), - returnValue: _i3.dummyValue(this, Invocation.getter(#edit)), - ) - as String); - - @override - String get preview => - (super.noSuchMethod( - Invocation.getter(#preview), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#preview), - ), - ) - as String); - - @override - String get delete => - (super.noSuchMethod( - Invocation.getter(#delete), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#delete), - ), - ) - as String); - - @override - String get newNutritionalPlan => - (super.noSuchMethod( - Invocation.getter(#newNutritionalPlan), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#newNutritionalPlan), - ), - ) - as String); - - @override - String get overview => - (super.noSuchMethod( - Invocation.getter(#overview), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#overview), - ), - ) - as String); - - @override - String get toggleDetails => - (super.noSuchMethod( - Invocation.getter(#toggleDetails), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#toggleDetails), - ), - ) - as String); - - @override - String get goToDetailPage => - (super.noSuchMethod( - Invocation.getter(#goToDetailPage), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#goToDetailPage), - ), - ) - as String); - - @override - String get aboutWhySupportTitle => - (super.noSuchMethod( - Invocation.getter(#aboutWhySupportTitle), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#aboutWhySupportTitle), - ), - ) - as String); - - @override - String get aboutDescription => - (super.noSuchMethod( - Invocation.getter(#aboutDescription), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#aboutDescription), - ), - ) - as String); - - @override - String get aboutDonateTitle => - (super.noSuchMethod( - Invocation.getter(#aboutDonateTitle), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#aboutDonateTitle), - ), - ) - as String); - - @override - String get aboutDonateText => - (super.noSuchMethod( - Invocation.getter(#aboutDonateText), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#aboutDonateText), - ), - ) - as String); - - @override - String get aboutContributeTitle => - (super.noSuchMethod( - Invocation.getter(#aboutContributeTitle), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#aboutContributeTitle), - ), - ) - as String); - - @override - String get aboutContributeText => - (super.noSuchMethod( - Invocation.getter(#aboutContributeText), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#aboutContributeText), - ), - ) - as String); - - @override - String get aboutBugsListTitle => - (super.noSuchMethod( - Invocation.getter(#aboutBugsListTitle), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#aboutBugsListTitle), - ), - ) - as String); - - @override - String get aboutTranslationListTitle => - (super.noSuchMethod( - Invocation.getter(#aboutTranslationListTitle), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#aboutTranslationListTitle), - ), - ) - as String); - - @override - String get aboutSourceListTitle => - (super.noSuchMethod( - Invocation.getter(#aboutSourceListTitle), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#aboutSourceListTitle), - ), - ) - as String); - - @override - String get aboutJoinCommunityTitle => - (super.noSuchMethod( - Invocation.getter(#aboutJoinCommunityTitle), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#aboutJoinCommunityTitle), - ), - ) - as String); - - @override - String get aboutMastodonTitle => - (super.noSuchMethod( - Invocation.getter(#aboutMastodonTitle), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#aboutMastodonTitle), - ), - ) - as String); - - @override - String get aboutDiscordTitle => - (super.noSuchMethod( - Invocation.getter(#aboutDiscordTitle), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#aboutDiscordTitle), - ), - ) - as String); - - @override - String get aboutViewDocsTitle => - (super.noSuchMethod( - Invocation.getter(#aboutViewDocsTitle), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#aboutViewDocsTitle), - ), - ) - as String); - - @override - String get aboutViewLicensesTitle => - (super.noSuchMethod( - Invocation.getter(#aboutViewLicensesTitle), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#aboutViewLicensesTitle), - ), - ) - as String); - - @override - String get aboutPrivacyPolicyTitle => - (super.noSuchMethod( - Invocation.getter(#aboutPrivacyPolicyTitle), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#aboutPrivacyPolicyTitle), - ), - ) - as String); - - @override - String get others => - (super.noSuchMethod( - Invocation.getter(#others), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#others), - ), - ) - as String); - - @override - String get calendar => - (super.noSuchMethod( - Invocation.getter(#calendar), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#calendar), - ), - ) - as String); - - @override - String get enterValue => - (super.noSuchMethod( - Invocation.getter(#enterValue), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#enterValue), - ), - ) - as String); - - @override - String get selectEntry => - (super.noSuchMethod( - Invocation.getter(#selectEntry), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#selectEntry), - ), - ) - as String); - - @override - String get selectExercise => - (super.noSuchMethod( - Invocation.getter(#selectExercise), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#selectExercise), - ), - ) - as String); - - @override - String get baseNameEnglish => - (super.noSuchMethod( - Invocation.getter(#baseNameEnglish), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#baseNameEnglish), - ), - ) - as String); - - @override - String get enterValidNumber => - (super.noSuchMethod( - Invocation.getter(#enterValidNumber), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#enterValidNumber), - ), - ) - as String); - - @override - String get selectIngredient => - (super.noSuchMethod( - Invocation.getter(#selectIngredient), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#selectIngredient), - ), - ) - as String); - - @override - String get recentlyUsedIngredients => - (super.noSuchMethod( - Invocation.getter(#recentlyUsedIngredients), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#recentlyUsedIngredients), - ), - ) - as String); - - @override - String get selectImage => - (super.noSuchMethod( - Invocation.getter(#selectImage), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#selectImage), - ), - ) - as String); - - @override - String get optionsLabel => - (super.noSuchMethod( - Invocation.getter(#optionsLabel), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#optionsLabel), - ), - ) - as String); - - @override - String get takePicture => - (super.noSuchMethod( - Invocation.getter(#takePicture), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#takePicture), - ), - ) - as String); - - @override - String get chooseFromLibrary => - (super.noSuchMethod( - Invocation.getter(#chooseFromLibrary), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#chooseFromLibrary), - ), - ) - as String); - - @override - String get gallery => - (super.noSuchMethod( - Invocation.getter(#gallery), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#gallery), - ), - ) - as String); - - @override - String get addImage => - (super.noSuchMethod( - Invocation.getter(#addImage), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#addImage), - ), - ) - as String); - - @override - String get dataCopied => - (super.noSuchMethod( - Invocation.getter(#dataCopied), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#dataCopied), - ), - ) - as String); - - @override - String get appUpdateTitle => - (super.noSuchMethod( - Invocation.getter(#appUpdateTitle), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#appUpdateTitle), - ), - ) - as String); - - @override - String get appUpdateContent => - (super.noSuchMethod( - Invocation.getter(#appUpdateContent), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#appUpdateContent), - ), - ) - as String); - - @override - String get serverUpdateTitle => - (super.noSuchMethod( - Invocation.getter(#serverUpdateTitle), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#serverUpdateTitle), - ), - ) - as String); - - @override - String get powerSyncUnreachableTitle => - (super.noSuchMethod( - Invocation.getter(#powerSyncUnreachableTitle), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#powerSyncUnreachableTitle), - ), - ) - as String); - - @override - String get powerSyncUnreachableContent => - (super.noSuchMethod( - Invocation.getter(#powerSyncUnreachableContent), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#powerSyncUnreachableContent), - ), - ) - as String); - - @override - String get serverUnreachableRetry => - (super.noSuchMethod( - Invocation.getter(#serverUnreachableRetry), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#serverUnreachableRetry), - ), - ) - as String); - - @override - String get productFound => - (super.noSuchMethod( - Invocation.getter(#productFound), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#productFound), - ), - ) - as String); - - @override - String get productNotFound => - (super.noSuchMethod( - Invocation.getter(#productNotFound), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#productNotFound), - ), - ) - as String); - - @override - String get scanBarcode => - (super.noSuchMethod( - Invocation.getter(#scanBarcode), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#scanBarcode), - ), - ) - as String); - - @override - String get close => - (super.noSuchMethod( - Invocation.getter(#close), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#close), - ), - ) - as String); - - @override - String get checkInformationBeforeSubmitting => - (super.noSuchMethod( - Invocation.getter(#checkInformationBeforeSubmitting), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#checkInformationBeforeSubmitting), - ), - ) - as String); - - @override - String get add_exercise_image_license => - (super.noSuchMethod( - Invocation.getter(#add_exercise_image_license), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#add_exercise_image_license), - ), - ) - as String); - - @override - String get imageDetailsTitle => - (super.noSuchMethod( - Invocation.getter(#imageDetailsTitle), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#imageDetailsTitle), - ), - ) - as String); - - @override - String get imageDetailsLicenseTitle => - (super.noSuchMethod( - Invocation.getter(#imageDetailsLicenseTitle), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#imageDetailsLicenseTitle), - ), - ) - as String); - - @override - String get imageDetailsLicenseTitleHint => - (super.noSuchMethod( - Invocation.getter(#imageDetailsLicenseTitleHint), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#imageDetailsLicenseTitleHint), - ), - ) - as String); - - @override - String get imageDetailsSourceLink => - (super.noSuchMethod( - Invocation.getter(#imageDetailsSourceLink), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#imageDetailsSourceLink), - ), - ) - as String); - - @override - String get author => - (super.noSuchMethod( - Invocation.getter(#author), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#author), - ), - ) - as String); - - @override - String get authorHint => - (super.noSuchMethod( - Invocation.getter(#authorHint), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#authorHint), - ), - ) - as String); - - @override - String get authorHelpText => - (super.noSuchMethod( - Invocation.getter(#authorHelpText), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#authorHelpText), - ), - ) - as String); - - @override - String get imageDetailsAuthorLink => - (super.noSuchMethod( - Invocation.getter(#imageDetailsAuthorLink), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#imageDetailsAuthorLink), - ), - ) - as String); - - @override - String get imageDetailsDerivativeSource => - (super.noSuchMethod( - Invocation.getter(#imageDetailsDerivativeSource), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#imageDetailsDerivativeSource), - ), - ) - as String); - - @override - String get imageDetailsDerivativeHelp => - (super.noSuchMethod( - Invocation.getter(#imageDetailsDerivativeHelp), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#imageDetailsDerivativeHelp), - ), - ) - as String); - - @override - String get imageDetailsImageType => - (super.noSuchMethod( - Invocation.getter(#imageDetailsImageType), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#imageDetailsImageType), - ), - ) - as String); - - @override - String get imageDetailsLicenseNotice => - (super.noSuchMethod( - Invocation.getter(#imageDetailsLicenseNotice), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#imageDetailsLicenseNotice), - ), - ) - as String); - - @override - String get imageDetailsLicenseNoticeLinkToLicense => - (super.noSuchMethod( - Invocation.getter(#imageDetailsLicenseNoticeLinkToLicense), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#imageDetailsLicenseNoticeLinkToLicense), - ), - ) - as String); - - @override - String get add => - (super.noSuchMethod( - Invocation.getter(#add), - returnValue: _i3.dummyValue(this, Invocation.getter(#add)), - ) - as String); - - @override - String get increase => - (super.noSuchMethod( - Invocation.getter(#increase), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#increase), - ), - ) - as String); - - @override - String get decrease => - (super.noSuchMethod( - Invocation.getter(#decrease), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#decrease), - ), - ) - as String); - - @override - String get variations => - (super.noSuchMethod( - Invocation.getter(#variations), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#variations), - ), - ) - as String); - - @override - String get verifiedEmail => - (super.noSuchMethod( - Invocation.getter(#verifiedEmail), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#verifiedEmail), - ), - ) - as String); - - @override - String get unVerifiedEmail => - (super.noSuchMethod( - Invocation.getter(#unVerifiedEmail), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#unVerifiedEmail), - ), - ) - as String); - - @override - String get alternativeNames => - (super.noSuchMethod( - Invocation.getter(#alternativeNames), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#alternativeNames), - ), - ) - as String); - - @override - String get oneNamePerLine => - (super.noSuchMethod( - Invocation.getter(#oneNamePerLine), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#oneNamePerLine), - ), - ) - as String); - - @override - String get whatVariationsExist => - (super.noSuchMethod( - Invocation.getter(#whatVariationsExist), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#whatVariationsExist), - ), - ) - as String); - - @override - String get previous => - (super.noSuchMethod( - Invocation.getter(#previous), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#previous), - ), - ) - as String); - - @override - String get next => - (super.noSuchMethod( - Invocation.getter(#next), - returnValue: _i3.dummyValue(this, Invocation.getter(#next)), - ) - as String); - - @override - String get images => - (super.noSuchMethod( - Invocation.getter(#images), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#images), - ), - ) - as String); - - @override - String get language => - (super.noSuchMethod( - Invocation.getter(#language), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#language), - ), - ) - as String); - - @override - String get addExercise => - (super.noSuchMethod( - Invocation.getter(#addExercise), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#addExercise), - ), - ) - as String); - - @override - String get fitInWeek => - (super.noSuchMethod( - Invocation.getter(#fitInWeek), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#fitInWeek), - ), - ) - as String); - - @override - String get fitInWeekHelp => - (super.noSuchMethod( - Invocation.getter(#fitInWeekHelp), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#fitInWeekHelp), - ), - ) - as String); - - @override - String get addSuperset => - (super.noSuchMethod( - Invocation.getter(#addSuperset), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#addSuperset), - ), - ) - as String); - - @override - String get setHasNoExercises => - (super.noSuchMethod( - Invocation.getter(#setHasNoExercises), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#setHasNoExercises), - ), - ) - as String); - - @override - String get contributeExercise => - (super.noSuchMethod( - Invocation.getter(#contributeExercise), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#contributeExercise), - ), - ) - as String); - - @override - String get personalExercisesWarningTitle => - (super.noSuchMethod( - Invocation.getter(#personalExercisesWarningTitle), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#personalExercisesWarningTitle), - ), - ) - as String); - - @override - String get personalExercisesWarningBody => - (super.noSuchMethod( - Invocation.getter(#personalExercisesWarningBody), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#personalExercisesWarningBody), - ), - ) - as String); - - @override - String get translation => - (super.noSuchMethod( - Invocation.getter(#translation), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#translation), - ), - ) - as String); - - @override - String get translateExercise => - (super.noSuchMethod( - Invocation.getter(#translateExercise), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#translateExercise), - ), - ) - as String); - - @override - String get baseData => - (super.noSuchMethod( - Invocation.getter(#baseData), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#baseData), - ), - ) - as String); - - @override - String get useBasicMarkdown => - (super.noSuchMethod( - Invocation.getter(#useBasicMarkdown), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#useBasicMarkdown), - ), - ) - as String); - - @override - String get editorBold => - (super.noSuchMethod( - Invocation.getter(#editorBold), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#editorBold), - ), - ) - as String); - - @override - String get editorItalic => - (super.noSuchMethod( - Invocation.getter(#editorItalic), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#editorItalic), - ), - ) - as String); - - @override - String get editorList => - (super.noSuchMethod( - Invocation.getter(#editorList), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#editorList), - ), - ) - as String); - - @override - String get enterTextInLanguage => - (super.noSuchMethod( - Invocation.getter(#enterTextInLanguage), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#enterTextInLanguage), - ), - ) - as String); - - @override - String get settingsTitle => - (super.noSuchMethod( - Invocation.getter(#settingsTitle), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#settingsTitle), - ), - ) - as String); - - @override - String get settingsCacheTitle => - (super.noSuchMethod( - Invocation.getter(#settingsCacheTitle), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#settingsCacheTitle), - ), - ) - as String); - - @override - String get settingsImageCacheDescription => - (super.noSuchMethod( - Invocation.getter(#settingsImageCacheDescription), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#settingsImageCacheDescription), - ), - ) - as String); - - @override - String get settingsCacheDeletedSnackbar => - (super.noSuchMethod( - Invocation.getter(#settingsCacheDeletedSnackbar), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#settingsCacheDeletedSnackbar), - ), - ) - as String); - - @override - String get settingsDataTitle => - (super.noSuchMethod( - Invocation.getter(#settingsDataTitle), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#settingsDataTitle), - ), - ) - as String); - - @override - String get settingsKeepDataOnLogout => - (super.noSuchMethod( - Invocation.getter(#settingsKeepDataOnLogout), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#settingsKeepDataOnLogout), - ), - ) - as String); - - @override - String get settingsKeepDataOnLogoutDescription => - (super.noSuchMethod( - Invocation.getter(#settingsKeepDataOnLogoutDescription), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#settingsKeepDataOnLogoutDescription), - ), - ) - as String); - - @override - String get settingsVerboseLogging => - (super.noSuchMethod( - Invocation.getter(#settingsVerboseLogging), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#settingsVerboseLogging), - ), - ) - as String); - - @override - String get settingsVerboseLoggingDescription => - (super.noSuchMethod( - Invocation.getter(#settingsVerboseLoggingDescription), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#settingsVerboseLoggingDescription), - ), - ) - as String); - - @override - String get aboutPageTitle => - (super.noSuchMethod( - Invocation.getter(#aboutPageTitle), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#aboutPageTitle), - ), - ) - as String); - - @override - String get simpleMode => - (super.noSuchMethod( - Invocation.getter(#simpleMode), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#simpleMode), - ), - ) - as String); - - @override - String get simpleModeHelp => - (super.noSuchMethod( - Invocation.getter(#simpleModeHelp), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#simpleModeHelp), - ), - ) - as String); - - @override - String get progressionRules => - (super.noSuchMethod( - Invocation.getter(#progressionRules), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#progressionRules), - ), - ) - as String); - - @override - String get cacheWarning => - (super.noSuchMethod( - Invocation.getter(#cacheWarning), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#cacheWarning), - ), - ) - as String); - - @override - String get textPromptTitle => - (super.noSuchMethod( - Invocation.getter(#textPromptTitle), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#textPromptTitle), - ), - ) - as String); - - @override - String get textPromptSubheading => - (super.noSuchMethod( - Invocation.getter(#textPromptSubheading), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#textPromptSubheading), - ), - ) - as String); - - @override - String get abs => - (super.noSuchMethod( - Invocation.getter(#abs), - returnValue: _i3.dummyValue(this, Invocation.getter(#abs)), - ) - as String); - - @override - String get arms => - (super.noSuchMethod( - Invocation.getter(#arms), - returnValue: _i3.dummyValue(this, Invocation.getter(#arms)), - ) - as String); - - @override - String get back => - (super.noSuchMethod( - Invocation.getter(#back), - returnValue: _i3.dummyValue(this, Invocation.getter(#back)), - ) - as String); - - @override - String get barbell => - (super.noSuchMethod( - Invocation.getter(#barbell), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#barbell), - ), - ) - as String); - - @override - String get bench => - (super.noSuchMethod( - Invocation.getter(#bench), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#bench), - ), - ) - as String); - - @override - String get biceps => - (super.noSuchMethod( - Invocation.getter(#biceps), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#biceps), - ), - ) - as String); - - @override - String get body_weight => - (super.noSuchMethod( - Invocation.getter(#body_weight), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#body_weight), - ), - ) - as String); - - @override - String get calves => - (super.noSuchMethod( - Invocation.getter(#calves), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#calves), - ), - ) - as String); - - @override - String get cardio => - (super.noSuchMethod( - Invocation.getter(#cardio), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#cardio), - ), - ) - as String); - - @override - String get chest => - (super.noSuchMethod( - Invocation.getter(#chest), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#chest), - ), - ) - as String); - - @override - String get dumbbell => - (super.noSuchMethod( - Invocation.getter(#dumbbell), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#dumbbell), - ), - ) - as String); - - @override - String get glutes => - (super.noSuchMethod( - Invocation.getter(#glutes), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#glutes), - ), - ) - as String); - - @override - String get gym_mat => - (super.noSuchMethod( - Invocation.getter(#gym_mat), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#gym_mat), - ), - ) - as String); - - @override - String get hamstrings => - (super.noSuchMethod( - Invocation.getter(#hamstrings), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#hamstrings), - ), - ) - as String); - - @override - String get incline_bench => - (super.noSuchMethod( - Invocation.getter(#incline_bench), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#incline_bench), - ), - ) - as String); - - @override - String get kettlebell => - (super.noSuchMethod( - Invocation.getter(#kettlebell), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#kettlebell), - ), - ) - as String); - - @override - String get kilometers => - (super.noSuchMethod( - Invocation.getter(#kilometers), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#kilometers), - ), - ) - as String); - - @override - String get kilometers_per_hour => - (super.noSuchMethod( - Invocation.getter(#kilometers_per_hour), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#kilometers_per_hour), - ), - ) - as String); - - @override - String get lats => - (super.noSuchMethod( - Invocation.getter(#lats), - returnValue: _i3.dummyValue(this, Invocation.getter(#lats)), - ) - as String); - - @override - String get legs => - (super.noSuchMethod( - Invocation.getter(#legs), - returnValue: _i3.dummyValue(this, Invocation.getter(#legs)), - ) - as String); - - @override - String get lower_back => - (super.noSuchMethod( - Invocation.getter(#lower_back), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#lower_back), - ), - ) - as String); - - @override - String get max_reps => - (super.noSuchMethod( - Invocation.getter(#max_reps), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#max_reps), - ), - ) - as String); - - @override - String get miles => - (super.noSuchMethod( - Invocation.getter(#miles), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#miles), - ), - ) - as String); - - @override - String get miles_per_hour => - (super.noSuchMethod( - Invocation.getter(#miles_per_hour), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#miles_per_hour), - ), - ) - as String); - - @override - String get minutes => - (super.noSuchMethod( - Invocation.getter(#minutes), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#minutes), - ), - ) - as String); - - @override - String get plates => - (super.noSuchMethod( - Invocation.getter(#plates), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#plates), - ), - ) - as String); - - @override - String get pull_up_bar => - (super.noSuchMethod( - Invocation.getter(#pull_up_bar), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#pull_up_bar), - ), - ) - as String); - - @override - String get quads => - (super.noSuchMethod( - Invocation.getter(#quads), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#quads), - ), - ) - as String); - - @override - String get repetitions => - (super.noSuchMethod( - Invocation.getter(#repetitions), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#repetitions), - ), - ) - as String); - - @override - String get resistance_band => - (super.noSuchMethod( - Invocation.getter(#resistance_band), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#resistance_band), - ), - ) - as String); - - @override - String get sz_bar => - (super.noSuchMethod( - Invocation.getter(#sz_bar), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#sz_bar), - ), - ) - as String); - - @override - String get seconds => - (super.noSuchMethod( - Invocation.getter(#seconds), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#seconds), - ), - ) - as String); - - @override - String get shoulders => - (super.noSuchMethod( - Invocation.getter(#shoulders), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#shoulders), - ), - ) - as String); - - @override - String get swiss_ball => - (super.noSuchMethod( - Invocation.getter(#swiss_ball), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#swiss_ball), - ), - ) - as String); - - @override - String get triceps => - (super.noSuchMethod( - Invocation.getter(#triceps), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#triceps), - ), - ) - as String); - - @override - String get until_failure => - (super.noSuchMethod( - Invocation.getter(#until_failure), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#until_failure), - ), - ) - as String); - - @override - String get kg => - (super.noSuchMethod( - Invocation.getter(#kg), - returnValue: _i3.dummyValue(this, Invocation.getter(#kg)), - ) - as String); - - @override - String get lb => - (super.noSuchMethod( - Invocation.getter(#lb), - returnValue: _i3.dummyValue(this, Invocation.getter(#lb)), - ) - as String); - - @override - String get none__bodyweight_exercise_ => - (super.noSuchMethod( - Invocation.getter(#none__bodyweight_exercise_), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#none__bodyweight_exercise_), - ), - ) - as String); - - @override - String get log => - (super.noSuchMethod( - Invocation.getter(#log), - returnValue: _i3.dummyValue(this, Invocation.getter(#log)), - ) - as String); - - @override - String get done => - (super.noSuchMethod( - Invocation.getter(#done), - returnValue: _i3.dummyValue(this, Invocation.getter(#done)), - ) - as String); - - @override - String get overallChangeWeight => - (super.noSuchMethod( - Invocation.getter(#overallChangeWeight), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#overallChangeWeight), - ), - ) - as String); - - @override - String get goalTypeMeals => - (super.noSuchMethod( - Invocation.getter(#goalTypeMeals), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#goalTypeMeals), - ), - ) - as String); - - @override - String get goalTypeBasic => - (super.noSuchMethod( - Invocation.getter(#goalTypeBasic), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#goalTypeBasic), - ), - ) - as String); - - @override - String get goalTypeAdvanced => - (super.noSuchMethod( - Invocation.getter(#goalTypeAdvanced), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#goalTypeAdvanced), - ), - ) - as String); - - @override - String get indicatorRaw => - (super.noSuchMethod( - Invocation.getter(#indicatorRaw), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#indicatorRaw), - ), - ) - as String); - - @override - String get indicatorAvg => - (super.noSuchMethod( - Invocation.getter(#indicatorAvg), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#indicatorAvg), - ), - ) - as String); - - @override - String get indicatorTrend => - (super.noSuchMethod( - Invocation.getter(#indicatorTrend), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#indicatorTrend), - ), - ) - as String); - - @override - String get endWorkout => - (super.noSuchMethod( - Invocation.getter(#endWorkout), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#endWorkout), - ), - ) - as String); - - @override - String get themeMode => - (super.noSuchMethod( - Invocation.getter(#themeMode), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#themeMode), - ), - ) - as String); - - @override - String get darkMode => - (super.noSuchMethod( - Invocation.getter(#darkMode), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#darkMode), - ), - ) - as String); - - @override - String get lightMode => - (super.noSuchMethod( - Invocation.getter(#lightMode), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#lightMode), - ), - ) - as String); - - @override - String get systemMode => - (super.noSuchMethod( - Invocation.getter(#systemMode), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#systemMode), - ), - ) - as String); - - @override - String get useDynamicColor => - (super.noSuchMethod( - Invocation.getter(#useDynamicColor), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#useDynamicColor), - ), - ) - as String); - - @override - String get youAreOffline => - (super.noSuchMethod( - Invocation.getter(#youAreOffline), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#youAreOffline), - ), - ) - as String); - - @override - String get appLanguage => - (super.noSuchMethod( - Invocation.getter(#appLanguage), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#appLanguage), - ), - ) - as String); - - @override - String get appLanguageSystem => - (super.noSuchMethod( - Invocation.getter(#appLanguageSystem), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#appLanguageSystem), - ), - ) - as String); - - @override - String get productNotFoundOpenFoodFacts => - (super.noSuchMethod( - Invocation.getter(#productNotFoundOpenFoodFacts), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#productNotFoundOpenFoodFacts), - ), - ) - as String); - - @override - String get addToOpenFoodFacts => - (super.noSuchMethod( - Invocation.getter(#addToOpenFoodFacts), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#addToOpenFoodFacts), - ), - ) - as String); - - @override - String get isVegan => - (super.noSuchMethod( - Invocation.getter(#isVegan), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#isVegan), - ), - ) - as String); - - @override - String get isVegetarian => - (super.noSuchMethod( - Invocation.getter(#isVegetarian), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#isVegetarian), - ), - ) - as String); - - @override - String get filter => - (super.noSuchMethod( - Invocation.getter(#filter), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#filter), - ), - ) - as String); - - @override - String get searchLanguageAll => - (super.noSuchMethod( - Invocation.getter(#searchLanguageAll), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#searchLanguageAll), - ), - ) - as String); - - @override - String get exerciseSearchMode => - (super.noSuchMethod( - Invocation.getter(#exerciseSearchMode), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#exerciseSearchMode), - ), - ) - as String); - - @override - String get searchModeFuzzy => - (super.noSuchMethod( - Invocation.getter(#searchModeFuzzy), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#searchModeFuzzy), - ), - ) - as String); - - @override - String get searchModeExact => - (super.noSuchMethod( - Invocation.getter(#searchModeExact), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#searchModeExact), - ), - ) - as String); - - @override - String get syncStatusConnected => - (super.noSuchMethod( - Invocation.getter(#syncStatusConnected), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#syncStatusConnected), - ), - ) - as String); - - @override - String get syncStatusConnecting => - (super.noSuchMethod( - Invocation.getter(#syncStatusConnecting), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#syncStatusConnecting), - ), - ) - as String); - - @override - String get syncStatusDisconnected => - (super.noSuchMethod( - Invocation.getter(#syncStatusDisconnected), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#syncStatusDisconnected), - ), - ) - as String); - - @override - String get syncStatusUploading => - (super.noSuchMethod( - Invocation.getter(#syncStatusUploading), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#syncStatusUploading), - ), - ) - as String); - - @override - String get syncStatusDownloading => - (super.noSuchMethod( - Invocation.getter(#syncStatusDownloading), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#syncStatusDownloading), - ), - ) - as String); - - @override - String get syncStatusSyncing => - (super.noSuchMethod( - Invocation.getter(#syncStatusSyncing), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#syncStatusSyncing), - ), - ) - as String); - - @override - String get syncStatusError => - (super.noSuchMethod( - Invocation.getter(#syncStatusError), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#syncStatusError), - ), - ) - as String); - - @override - String get syncStatusDialogTitle => - (super.noSuchMethod( - Invocation.getter(#syncStatusDialogTitle), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#syncStatusDialogTitle), - ), - ) - as String); - - @override - String get syncStatusLastSynced => - (super.noSuchMethod( - Invocation.getter(#syncStatusLastSynced), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#syncStatusLastSynced), - ), - ) - as String); - - @override - String get syncStatusErrorDetails => - (super.noSuchMethod( - Invocation.getter(#syncStatusErrorDetails), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#syncStatusErrorDetails), - ), - ) - as String); - - @override - String get syncStatusStalledHint => - (super.noSuchMethod( - Invocation.getter(#syncStatusStalledHint), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#syncStatusStalledHint), - ), - ) - as String); - - @override - String get syncStatusStalledNotStartedHint => - (super.noSuchMethod( - Invocation.getter(#syncStatusStalledNotStartedHint), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#syncStatusStalledNotStartedHint), - ), - ) - as String); - - @override - String get syncStatusStalledNotAppliedHint => - (super.noSuchMethod( - Invocation.getter(#syncStatusStalledNotAppliedHint), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#syncStatusStalledNotAppliedHint), - ), - ) - as String); - - @override - String get syncStatusReconnect => - (super.noSuchMethod( - Invocation.getter(#syncStatusReconnect), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#syncStatusReconnect), - ), - ) - as String); - - @override - String get syncStatusNeverSynced => - (super.noSuchMethod( - Invocation.getter(#syncStatusNeverSynced), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#syncStatusNeverSynced), - ), - ) - as String); - - @override - String get filterNutriscore => - (super.noSuchMethod( - Invocation.getter(#filterNutriscore), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#filterNutriscore), - ), - ) - as String); - - @override - String get off => - (super.noSuchMethod( - Invocation.getter(#off), - returnValue: _i3.dummyValue(this, Invocation.getter(#off)), - ) - as String); - - @override - String get filterNutriscoreNoFilter => - (super.noSuchMethod( - Invocation.getter(#filterNutriscoreNoFilter), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#filterNutriscoreNoFilter), - ), - ) - as String); - - @override - String get serverConfigIssueTitle => - (super.noSuchMethod( - Invocation.getter(#serverConfigIssueTitle), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#serverConfigIssueTitle), - ), - ) - as String); - - @override - String get serverConfigIssueMessage => - (super.noSuchMethod( - Invocation.getter(#serverConfigIssueMessage), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#serverConfigIssueMessage), - ), - ) - as String); - - @override - String get understand => - (super.noSuchMethod( - Invocation.getter(#understand), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#understand), - ), - ) - as String); - - @override - String get viewDocumentation => - (super.noSuchMethod( - Invocation.getter(#viewDocumentation), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#viewDocumentation), - ), - ) - as String); - - @override - String get sessionExpired => - (super.noSuchMethod( - Invocation.getter(#sessionExpired), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#sessionExpired), - ), - ) - as String); - - @override - String get weightOrRepsRequired => - (super.noSuchMethod( - Invocation.getter(#weightOrRepsRequired), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#weightOrRepsRequired), - ), - ) - as String); - - @override - String get healthSync => - (super.noSuchMethod( - Invocation.getter(#healthSync), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#healthSync), - ), - ) - as String); - - @override - String get healthSyncDescription => - (super.noSuchMethod( - Invocation.getter(#healthSyncDescription), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#healthSyncDescription), - ), - ) - as String); - - @override - String get healthSyncPermissionDenied => - (super.noSuchMethod( - Invocation.getter(#healthSyncPermissionDenied), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#healthSyncPermissionDenied), - ), - ) - as String); - - @override - String get healthSyncSyncing => - (super.noSuchMethod( - Invocation.getter(#healthSyncSyncing), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#healthSyncSyncing), - ), - ) - as String); - - @override - String get healthSyncNow => - (super.noSuchMethod( - Invocation.getter(#healthSyncNow), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#healthSyncNow), - ), - ) - as String); - - @override - String get healthSyncGrantAccess => - (super.noSuchMethod( - Invocation.getter(#healthSyncGrantAccess), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#healthSyncGrantAccess), - ), - ) - as String); - - @override - String get healthSyncFailed => - (super.noSuchMethod( - Invocation.getter(#healthSyncFailed), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#healthSyncFailed), - ), - ) - as String); - - @override - String get healthConnectInstall => - (super.noSuchMethod( - Invocation.getter(#healthConnectInstall), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#healthConnectInstall), - ), - ) - as String); - - @override - String get healthConnectUpdate => - (super.noSuchMethod( - Invocation.getter(#healthConnectUpdate), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#healthConnectUpdate), - ), - ) - as String); - - @override - String get healthConnectRequired => - (super.noSuchMethod( - Invocation.getter(#healthConnectRequired), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#healthConnectRequired), - ), - ) - as String); - - @override - String get health => - (super.noSuchMethod( - Invocation.getter(#health), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#health), - ), - ) - as String); - - @override - String get importedEntryOverwriteWarning => - (super.noSuchMethod( - Invocation.getter(#importedEntryOverwriteWarning), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#importedEntryOverwriteWarning), - ), - ) - as String); - - @override - String get calculationValuesManual => - (super.noSuchMethod( - Invocation.getter(#calculationValuesManual), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#calculationValuesManual), - ), - ) - as String); - - @override - String get calculationType => - (super.noSuchMethod( - Invocation.getter(#calculationType), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#calculationType), - ), - ) - as String); - - @override - String get calculationUnknown => - (super.noSuchMethod( - Invocation.getter(#calculationUnknown), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#calculationUnknown), - ), - ) - as String); - - @override - String get calculationParamsIncomplete => - (super.noSuchMethod( - Invocation.getter(#calculationParamsIncomplete), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#calculationParamsIncomplete), - ), - ) - as String); - - @override - String get calculationLocked => - (super.noSuchMethod( - Invocation.getter(#calculationLocked), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#calculationLocked), - ), - ) - as String); - - @override - String get calculationMissingHeight => - (super.noSuchMethod( - Invocation.getter(#calculationMissingHeight), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#calculationMissingHeight), - ), - ) - as String); - - @override - String get calculationNoSourceCategory => - (super.noSuchMethod( - Invocation.getter(#calculationNoSourceCategory), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#calculationNoSourceCategory), - ), - ) - as String); - - @override - String get calculationBadge => - (super.noSuchMethod( - Invocation.getter(#calculationBadge), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#calculationBadge), - ), - ) - as String); - - @override - String get calculationEntryInfo => - (super.noSuchMethod( - Invocation.getter(#calculationEntryInfo), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#calculationEntryInfo), - ), - ) - as String); - - @override - String get calculationNameBmi => - (super.noSuchMethod( - Invocation.getter(#calculationNameBmi), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#calculationNameBmi), - ), - ) - as String); - - @override - String get calculationNameWhtr => - (super.noSuchMethod( - Invocation.getter(#calculationNameWhtr), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#calculationNameWhtr), - ), - ) - as String); - - @override - String get calculationNameOneRepMax => - (super.noSuchMethod( - Invocation.getter(#calculationNameOneRepMax), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#calculationNameOneRepMax), - ), - ) - as String); - - @override - String get calculationNameOneRmTotal => - (super.noSuchMethod( - Invocation.getter(#calculationNameOneRmTotal), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#calculationNameOneRmTotal), - ), - ) - as String); - - @override - String get calculationDescriptionBmi => - (super.noSuchMethod( - Invocation.getter(#calculationDescriptionBmi), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#calculationDescriptionBmi), - ), - ) - as String); - - @override - String get calculationParamCategory => - (super.noSuchMethod( - Invocation.getter(#calculationParamCategory), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#calculationParamCategory), - ), - ) - as String); - - @override - String get calculationParamMaxReps => - (super.noSuchMethod( - Invocation.getter(#calculationParamMaxReps), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#calculationParamMaxReps), - ), - ) - as String); - - @override - String get calculationParamWindowDays => - (super.noSuchMethod( - Invocation.getter(#calculationParamWindowDays), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#calculationParamWindowDays), - ), - ) - as String); - - @override - String certsNotVerifiedDetail(String? host) => - (super.noSuchMethod( - Invocation.method(#certsNotVerifiedDetail, [host]), - returnValue: _i3.dummyValue( - this, - Invocation.method(#certsNotVerifiedDetail, [host]), - ), - ) - as String); - - @override - String exerciseNr(String? nr) => - (super.noSuchMethod( - Invocation.method(#exerciseNr, [nr]), - returnValue: _i3.dummyValue( - this, - Invocation.method(#exerciseNr, [nr]), - ), - ) - as String); - - @override - String supersetNr(String? nr) => - (super.noSuchMethod( - Invocation.method(#supersetNr, [nr]), - returnValue: _i3.dummyValue( - this, - Invocation.method(#supersetNr, [nr]), - ), - ) - as String); - - @override - String setNr(String? nr) => - (super.noSuchMethod( - Invocation.method(#setNr, [nr]), - returnValue: _i3.dummyValue( - this, - Invocation.method(#setNr, [nr]), - ), - ) - as String); - - @override - String topSet(String? value) => - (super.noSuchMethod( - Invocation.method(#topSet, [value]), - returnValue: _i3.dummyValue( - this, - Invocation.method(#topSet, [value]), - ), - ) - as String); - - @override - String workoutNotificationNext(String? set) => - (super.noSuchMethod( - Invocation.method(#workoutNotificationNext, [set]), - returnValue: _i3.dummyValue( - this, - Invocation.method(#workoutNotificationNext, [set]), - ), - ) - as String); - - @override - String workoutNotificationSetOf(int? current, int? total) => - (super.noSuchMethod( - Invocation.method(#workoutNotificationSetOf, [current, total]), - returnValue: _i3.dummyValue( - this, - Invocation.method(#workoutNotificationSetOf, [current, total]), - ), - ) - as String); - - @override - String workoutNotificationExtendRest(int? seconds) => - (super.noSuchMethod( - Invocation.method(#workoutNotificationExtendRest, [seconds]), - returnValue: _i3.dummyValue( - this, - Invocation.method(#workoutNotificationExtendRest, [seconds]), - ), - ) - as String); - - @override - String durationHoursMinutes(int? hours, int? minutes) => - (super.noSuchMethod( - Invocation.method(#durationHoursMinutes, [hours, minutes]), - returnValue: _i3.dummyValue( - this, - Invocation.method(#durationHoursMinutes, [hours, minutes]), - ), - ) - as String); - - @override - String gymModeLogScopeWeeks(int? weeks) => - (super.noSuchMethod( - Invocation.method(#gymModeLogScopeWeeks, [weeks]), - returnValue: _i3.dummyValue( - this, - Invocation.method(#gymModeLogScopeWeeks, [weeks]), - ), - ) - as String); - - @override - String planDateRange(String? startDate, String? endDate) => - (super.noSuchMethod( - Invocation.method(#planDateRange, [startDate, endDate]), - returnValue: _i3.dummyValue( - this, - Invocation.method(#planDateRange, [startDate, endDate]), - ), - ) - as String); - - @override - String planStartDate(String? startDate) => - (super.noSuchMethod( - Invocation.method(#planStartDate, [startDate]), - returnValue: _i3.dummyValue( - this, - Invocation.method(#planStartDate, [startDate]), - ), - ) - as String); - - @override - String chartRangeWeeks(int? count) => - (super.noSuchMethod( - Invocation.method(#chartRangeWeeks, [count]), - returnValue: _i3.dummyValue( - this, - Invocation.method(#chartRangeWeeks, [count]), - ), - ) - as String); - - @override - String chartRangeMonths(int? count) => - (super.noSuchMethod( - Invocation.method(#chartRangeMonths, [count]), - returnValue: _i3.dummyValue( - this, - Invocation.method(#chartRangeMonths, [count]), - ), - ) - as String); - - @override - String chartRangeYears(int? count) => - (super.noSuchMethod( - Invocation.method(#chartRangeYears, [count]), - returnValue: _i3.dummyValue( - this, - Invocation.method(#chartRangeYears, [count]), - ), - ) - as String); - - @override - String chartWeeklyChangeTitle(String? name) => - (super.noSuchMethod( - Invocation.method(#chartWeeklyChangeTitle, [name]), - returnValue: _i3.dummyValue( - this, - Invocation.method(#chartWeeklyChangeTitle, [name]), - ), - ) - as String); - - @override - String chartAverageWindowDays(int? days) => - (super.noSuchMethod( - Invocation.method(#chartAverageWindowDays, [days]), - returnValue: _i3.dummyValue( - this, - Invocation.method(#chartAverageWindowDays, [days]), - ), - ) - as String); - - @override - String chartDistributionTitle(String? name) => - (super.noSuchMethod( - Invocation.method(#chartDistributionTitle, [name]), - returnValue: _i3.dummyValue( - this, - Invocation.method(#chartDistributionTitle, [name]), - ), - ) - as String); - - @override - String distributionEntryCount(int? count) => - (super.noSuchMethod( - Invocation.method(#distributionEntryCount, [count]), - returnValue: _i3.dummyValue( - this, - Invocation.method(#distributionEntryCount, [count]), - ), - ) - as String); - - @override - String distributionDayCount(int? count) => - (super.noSuchMethod( - Invocation.method(#distributionDayCount, [count]), - returnValue: _i3.dummyValue( - this, - Invocation.method(#distributionDayCount, [count]), - ), - ) - as String); - - @override - String relativeDaysAgo(int? count) => - (super.noSuchMethod( - Invocation.method(#relativeDaysAgo, [count]), - returnValue: _i3.dummyValue( - this, - Invocation.method(#relativeDaysAgo, [count]), - ), - ) - as String); - - @override - String relativeWeeksAgo(int? count) => - (super.noSuchMethod( - Invocation.method(#relativeWeeksAgo, [count]), - returnValue: _i3.dummyValue( - this, - Invocation.method(#relativeWeeksAgo, [count]), - ), - ) - as String); - - @override - String relativeMonthsAgo(int? count) => - (super.noSuchMethod( - Invocation.method(#relativeMonthsAgo, [count]), - returnValue: _i3.dummyValue( - this, - Invocation.method(#relativeMonthsAgo, [count]), - ), - ) - as String); - - @override - String relativeYearsAgo(int? count) => - (super.noSuchMethod( - Invocation.method(#relativeYearsAgo, [count]), - returnValue: _i3.dummyValue( - this, - Invocation.method(#relativeYearsAgo, [count]), - ), - ) - as String); - - @override - String sparkAverage(String? value) => - (super.noSuchMethod( - Invocation.method(#sparkAverage, [value]), - returnValue: _i3.dummyValue( - this, - Invocation.method(#sparkAverage, [value]), - ), - ) - as String); - - @override - String sparkTrendPerWeek(String? value) => - (super.noSuchMethod( - Invocation.method(#sparkTrendPerWeek, [value]), - returnValue: _i3.dummyValue( - this, - Invocation.method(#sparkTrendPerWeek, [value]), - ), - ) - as String); - - @override - String minLengthRoutine(int? number) => - (super.noSuchMethod( - Invocation.method(#minLengthRoutine, [number]), - returnValue: _i3.dummyValue( - this, - Invocation.method(#minLengthRoutine, [number]), - ), - ) - as String); - - @override - String maxLengthRoutine(int? number) => - (super.noSuchMethod( - Invocation.method(#maxLengthRoutine, [number]), - returnValue: _i3.dummyValue( - this, - Invocation.method(#maxLengthRoutine, [number]), - ), - ) - as String); - - @override - String kcalValue(String? value) => - (super.noSuchMethod( - Invocation.method(#kcalValue, [value]), - returnValue: _i3.dummyValue( - this, - Invocation.method(#kcalValue, [value]), - ), - ) - as String); - - @override - String gValue(String? value) => - (super.noSuchMethod( - Invocation.method(#gValue, [value]), - returnValue: _i3.dummyValue( - this, - Invocation.method(#gValue, [value]), - ), - ) - as String); - - @override - String percentValue(String? value) => - (super.noSuchMethod( - Invocation.method(#percentValue, [value]), - returnValue: _i3.dummyValue( - this, - Invocation.method(#percentValue, [value]), - ), - ) - as String); - - @override - String confirmDelete(String? toDelete) => - (super.noSuchMethod( - Invocation.method(#confirmDelete, [toDelete]), - returnValue: _i3.dummyValue( - this, - Invocation.method(#confirmDelete, [toDelete]), - ), - ) - as String); - - @override - String enterCharacters(String? min, String? max) => - (super.noSuchMethod( - Invocation.method(#enterCharacters, [min, max]), - returnValue: _i3.dummyValue( - this, - Invocation.method(#enterCharacters, [min, max]), - ), - ) - as String); - - @override - String formMinMaxValues(int? min, int? max) => - (super.noSuchMethod( - Invocation.method(#formMinMaxValues, [min, max]), - returnValue: _i3.dummyValue( - this, - Invocation.method(#formMinMaxValues, [min, max]), - ), - ) - as String); - - @override - String enterMinCharacters(int? min) => - (super.noSuchMethod( - Invocation.method(#enterMinCharacters, [min]), - returnValue: _i3.dummyValue( - this, - Invocation.method(#enterMinCharacters, [min]), - ), - ) - as String); - - @override - String enterMinWords(int? min) => - (super.noSuchMethod( - Invocation.method(#enterMinWords, [min]), - returnValue: _i3.dummyValue( - this, - Invocation.method(#enterMinWords, [min]), - ), - ) - as String); - - @override - String enterMaxCharacters(int? max) => - (super.noSuchMethod( - Invocation.method(#enterMaxCharacters, [max]), - returnValue: _i3.dummyValue( - this, - Invocation.method(#enterMaxCharacters, [max]), - ), - ) - as String); - - @override - String nrOfSets(String? nrOfSets) => - (super.noSuchMethod( - Invocation.method(#nrOfSets, [nrOfSets]), - returnValue: _i3.dummyValue( - this, - Invocation.method(#nrOfSets, [nrOfSets]), - ), - ) - as String); - - @override - String serverUpdateContent(String? minVersion) => - (super.noSuchMethod( - Invocation.method(#serverUpdateContent, [minVersion]), - returnValue: _i3.dummyValue( - this, - Invocation.method(#serverUpdateContent, [minVersion]), - ), - ) - as String); - - @override - String productFoundDescription(String? productName) => - (super.noSuchMethod( - Invocation.method(#productFoundDescription, [productName]), - returnValue: _i3.dummyValue( - this, - Invocation.method(#productFoundDescription, [productName]), - ), - ) - as String); - - @override - String productNotFoundDescription(String? barcode) => - (super.noSuchMethod( - Invocation.method(#productNotFoundDescription, [barcode]), - returnValue: _i3.dummyValue( - this, - Invocation.method(#productNotFoundDescription, [barcode]), - ), - ) - as String); - - @override - String imageFormatNotSupported(String? imageFormat) => - (super.noSuchMethod( - Invocation.method(#imageFormatNotSupported, [imageFormat]), - returnValue: _i3.dummyValue( - this, - Invocation.method(#imageFormatNotSupported, [imageFormat]), - ), - ) - as String); - - @override - String alsoKnownAs(String? aliases) => - (super.noSuchMethod( - Invocation.method(#alsoKnownAs, [aliases]), - returnValue: _i3.dummyValue( - this, - Invocation.method(#alsoKnownAs, [aliases]), - ), - ) - as String); - - @override - String verifiedEmailInfo(String? email) => - (super.noSuchMethod( - Invocation.method(#verifiedEmailInfo, [email]), - returnValue: _i3.dummyValue( - this, - Invocation.method(#verifiedEmailInfo, [email]), - ), - ) - as String); - - @override - String contributeExerciseWarning(int? days) => - (super.noSuchMethod( - Invocation.method(#contributeExerciseWarning, [days]), - returnValue: _i3.dummyValue( - this, - Invocation.method(#contributeExerciseWarning, [days]), - ), - ) - as String); - - @override - String searchLanguageCurrent(String? lang) => - (super.noSuchMethod( - Invocation.method(#searchLanguageCurrent, [lang]), - returnValue: _i3.dummyValue( - this, - Invocation.method(#searchLanguageCurrent, [lang]), - ), - ) - as String); - - @override - String searchLanguageEnglish(String? lang) => - (super.noSuchMethod( - Invocation.method(#searchLanguageEnglish, [lang]), - returnValue: _i3.dummyValue( - this, - Invocation.method(#searchLanguageEnglish, [lang]), - ), - ) - as String); - - @override - String syncStatusPendingUploads(int? count) => - (super.noSuchMethod( - Invocation.method(#syncStatusPendingUploads, [count]), - returnValue: _i3.dummyValue( - this, - Invocation.method(#syncStatusPendingUploads, [count]), - ), - ) - as String); - - @override - String filterNutriscoreOrBetter(String? grade) => - (super.noSuchMethod( - Invocation.method(#filterNutriscoreOrBetter, [grade]), - returnValue: _i3.dummyValue( - this, - Invocation.method(#filterNutriscoreOrBetter, [grade]), - ), - ) - as String); - - @override - String sessionTooLong(int? hours) => - (super.noSuchMethod( - Invocation.method(#sessionTooLong, [hours]), - returnValue: _i3.dummyValue( - this, - Invocation.method(#sessionTooLong, [hours]), - ), - ) - as String); - - @override - String healthSyncSuccess(int? count) => - (super.noSuchMethod( - Invocation.method(#healthSyncSuccess, [count]), - returnValue: _i3.dummyValue( - this, - Invocation.method(#healthSyncSuccess, [count]), - ), - ) - as String); - - @override - String healthSyncNoData(String? platform) => - (super.noSuchMethod( - Invocation.method(#healthSyncNoData, [platform]), - returnValue: _i3.dummyValue( - this, - Invocation.method(#healthSyncNoData, [platform]), - ), - ) - as String); - - @override - String healthSyncStatus(int? count, String? time) => - (super.noSuchMethod( - Invocation.method(#healthSyncStatus, [count, time]), - returnValue: _i3.dummyValue( - this, - Invocation.method(#healthSyncStatus, [count, time]), - ), - ) - as String); - - @override - String healthSyncPermissionMissing(String? platform) => - (super.noSuchMethod( - Invocation.method(#healthSyncPermissionMissing, [platform]), - returnValue: _i3.dummyValue( - this, - Invocation.method(#healthSyncPermissionMissing, [platform]), - ), - ) - as String); - - @override - String calculationDuplicate(String? name) => - (super.noSuchMethod( - Invocation.method(#calculationDuplicate, [name]), - returnValue: _i3.dummyValue( - this, - Invocation.method(#calculationDuplicate, [name]), - ), - ) - as String); - - @override - String calculationDescriptionWhtr(String? category) => - (super.noSuchMethod( - Invocation.method(#calculationDescriptionWhtr, [category]), - returnValue: _i3.dummyValue( - this, - Invocation.method(#calculationDescriptionWhtr, [category]), - ), - ) - as String); - - @override - String calculationHelpExercises(int? min, int? max, int? count) => - (super.noSuchMethod( - Invocation.method(#calculationHelpExercises, [min, max, count]), - returnValue: _i3.dummyValue( - this, - Invocation.method(#calculationHelpExercises, [min, max, count]), - ), - ) - as String); - - @override - String calculationHelpMaxReps(int? min, int? max) => - (super.noSuchMethod( - Invocation.method(#calculationHelpMaxReps, [min, max]), - returnValue: _i3.dummyValue( - this, - Invocation.method(#calculationHelpMaxReps, [min, max]), - ), - ) - as String); - - @override - String calculationHelpWindowDays(int? min, int? max) => - (super.noSuchMethod( - Invocation.method(#calculationHelpWindowDays, [min, max]), - returnValue: _i3.dummyValue( - this, - Invocation.method(#calculationHelpWindowDays, [min, max]), - ), - ) - as String); -} diff --git a/test/core/widgets/datetime_input_test.dart b/test/core/widgets/datetime_input_test.dart index 57b79d625..0c4a08ce6 100644 --- a/test/core/widgets/datetime_input_test.dart +++ b/test/core/widgets/datetime_input_test.dart @@ -60,12 +60,18 @@ void main() { }); testWidgets('shows nothing when the value is null', (WidgetTester tester) async { + // With onCleared, so the clear button is left out for the missing value + // and not merely for want of a callback await tester.pumpWidget( - wrap(TimeInputWidget(value: null, labelText: 'Time', onChanged: (_) {})), + wrap( + TimeInputWidget(value: null, labelText: 'Time', onChanged: (_) {}, onCleared: () {}), + ), ); await tester.pumpAndSettle(); + expect(tester.widget(find.byType(EditableText)).controller.text, isEmpty); expect(find.byIcon(Icons.clear), findsNothing); + expect(find.byIcon(Icons.access_time_outlined), findsOneWidget); }); testWidgets('clear button invokes onCleared and clears the display', ( @@ -191,7 +197,7 @@ void main() { ); await tester.pumpAndSettle(); - // Straight through the two halves, whose own pickers are covered above + // Straight through the two halves' callbacks, no picker is opened here tester.widget(find.byType(DateInputWidget)).onChanged(DateTime(2021, 1, 5)); await tester.pumpAndSettle(); expect(reported, DateTime(2021, 1, 5, 15, 30)); diff --git a/test/features/account/providers/user_profile_repository_test.dart b/test/features/account/providers/user_profile_repository_test.dart index 686316bab..e777deb78 100644 --- a/test/features/account/providers/user_profile_repository_test.dart +++ b/test/features/account/providers/user_profile_repository_test.dart @@ -16,8 +16,6 @@ * along with this program. If not, see . */ -import 'dart:async'; - import 'package:drift/drift.dart' show Value; import 'package:flutter_test/flutter_test.dart'; import 'package:wger/database/powersync/database.dart'; @@ -78,21 +76,6 @@ void main() { expect((await repo.watchDrift().first)!.height, isNull); }); - - test('re-emits after the row changes', () async { - await seed(); - final iter = StreamIterator(repo.watchDrift()); - - await iter.moveNext(); - expect(iter.current!.weightUnitStr, 'kg'); - - await repo.editLocalDrift(UserProfile(id: 1, weightUnitStr: 'lb')); - - await iter.moveNext(); - expect(iter.current!.weightUnitStr, 'lb'); - - await iter.cancel(); - }); }); group('editLocalDrift', () { diff --git a/test/features/exercises/providers/add_exercise_notifier_test.dart b/test/features/exercises/providers/add_exercise_notifier_test.dart index 8dd70a602..457d14b65 100644 --- a/test/features/exercises/providers/add_exercise_notifier_test.dart +++ b/test/features/exercises/providers/add_exercise_notifier_test.dart @@ -52,48 +52,6 @@ void main() { }); }); - group('field setters', () { - test('setAuthor / name / description / language setters update state', () { - final n = container.read(addExerciseProvider.notifier); - - n.setAuthor('Alice'); - n.setExerciseNameEn('Bench Press'); - n.setExerciseNameTrans('Bankdrücken'); - n.setDescriptionEn('English desc'); - n.setDescriptionTrans('Deutsche Beschreibung'); - n.setLanguageEn(testEnglish); - n.setLanguageTranslation(testGerman); - n.setAlternateNamesEn(['Chest Press']); - n.setAlternateNamesTrans(['Flachbankdrücken']); - - final state = container.read(addExerciseProvider); - expect(state.author, 'Alice'); - expect(state.exerciseNameEn, 'Bench Press'); - expect(state.exerciseNameTrans, 'Bankdrücken'); - expect(state.descriptionEn, 'English desc'); - expect(state.descriptionTrans, 'Deutsche Beschreibung'); - expect(state.languageEn, testEnglish); - expect(state.languageTranslation, testGerman); - expect(state.alternateNamesEn, ['Chest Press']); - expect(state.alternateNamesTrans, ['Flachbankdrücken']); - }); - - test('category, equipment, muscles setters update state', () { - final n = container.read(addExerciseProvider.notifier); - - n.setCategory(testCategoryArms); - n.setEquipment([testEquipmentBench, testEquipmentDumbbell]); - n.setPrimaryMuscles([tMuscle1]); - n.setSecondaryMuscles([tMuscle2, tMuscle3]); - - final state = container.read(addExerciseProvider); - expect(state.category, testCategoryArms); - expect(state.equipment, [testEquipmentBench, testEquipmentDumbbell]); - expect(state.primaryMuscles, [tMuscle1]); - expect(state.secondaryMuscles, [tMuscle2, tMuscle3]); - }); - }); - group('variation setters, mutual exclusion', () { test('setVariationGroup clears variationConnectToExercise', () { final n = container.read(addExerciseProvider.notifier); @@ -151,77 +109,14 @@ void main() { expect(container.read(addExerciseProvider).exerciseImages, [image1]); }); - test('stores an image with all license fields set', () { - final file = File('/tmp/licensed.jpg'); + test('clear drops the attached images', () { + final n = container.read(addExerciseProvider.notifier); + n.addExerciseImages([image1, image2]); - container.read(addExerciseProvider.notifier).addExerciseImages([ - ExerciseSubmissionImage( - imageFile: file, - title: 'Test Title', - author: 'Test Author', - authorUrl: 'https://test.com/author', - sourceUrl: 'https://source.com', - derivativeSourceUrl: 'https://derivative.com', - type: ImageType.lowPoly, - ), - ]); - - final images = container.read(addExerciseProvider).exerciseImages; - expect(images.length, 1); - expect(images.first.imageFile.path, file.path); - }); - - test('accepts an image with only some metadata fields set', () { - container.read(addExerciseProvider.notifier).addExerciseImages([ - ExerciseSubmissionImage( - imageFile: File('/tmp/partial.jpg'), - title: 'Only Title', - type: ImageType.threeD, - ), - ]); - - expect(container.read(addExerciseProvider).exerciseImages.length, 1); - }); - - test('addExerciseImages with an empty list leaves the state empty', () { - container.read(addExerciseProvider.notifier).addExerciseImages([]); + n.clear(); expect(container.read(addExerciseProvider).exerciseImages, isEmpty); }); - - test('clear on an empty image list is a no-op', () { - container.read(addExerciseProvider.notifier).clear(); - - expect(container.read(addExerciseProvider).exerciseImages, isEmpty); - }); - - test('accepts very long metadata strings', () { - final longString = 'a' * 1000; - - container.read(addExerciseProvider.notifier).addExerciseImages([ - ExerciseSubmissionImage( - imageFile: File('/tmp/long.jpg'), - title: longString, - author: longString, - authorUrl: 'https://example.com/$longString', - ), - ]); - - expect(container.read(addExerciseProvider).exerciseImages.length, 1); - }); - - test('accepts special characters in metadata', () { - container.read(addExerciseProvider.notifier).addExerciseImages([ - ExerciseSubmissionImage( - imageFile: File('/tmp/special.jpg'), - title: 'Title with émojis 🎉 and spëcial çhars', - author: 'Autör with ümlauts', - authorUrl: 'https://example.com/path?query=value&another=value', - ), - ]); - - expect(container.read(addExerciseProvider).exerciseImages.length, 1); - }); }); group('clear', () { @@ -348,7 +243,7 @@ void main() { expect(container.read(addExerciseProvider).exerciseImages, hasLength(1)); }); - test('passes the same payload that exerciseApiObject builds', () async { + test('submits the payload built from the wizard state', () async { final n = container.read(addExerciseProvider.notifier); n.setAuthor('Alice'); n.setExerciseNameEn('Bench Press'); @@ -356,18 +251,18 @@ void main() { n.setLanguageEn(testEnglish); n.setCategory(testCategoryArms); n.setPrimaryMuscles([tMuscle1]); - - // Snapshot the API object before submitting (the notifier clears state - // afterwards). - final expected = container.read(addExerciseProvider).exerciseApiObject; when(mockRepo.submit(any)).thenAnswer((_) async => 1); await n.postExerciseToServer(); final captured = verify(mockRepo.submit(captureAny)).captured.single as ExerciseSubmissionApi; - expect(captured.author, expected.author); - expect(captured.category, expected.category); - expect(captured.translations, hasLength(expected.translations.length)); + expect(captured.author, 'Alice'); + expect(captured.category, testCategoryArms.id); + expect(captured.muscles, [tMuscle1.id]); + expect(captured.translations, hasLength(1)); + expect(captured.translations.single.name, 'Bench Press'); + expect(captured.translations.single.descriptionSource, 'English desc'); + expect(captured.translations.single.language, testEnglish.id); }); }); } diff --git a/test/features/exercises/providers/add_exercise_repository_test.dart b/test/features/exercises/providers/add_exercise_repository_test.dart index 9b517bfa8..8c4a503f5 100644 --- a/test/features/exercises/providers/add_exercise_repository_test.dart +++ b/test/features/exercises/providers/add_exercise_repository_test.dart @@ -16,6 +16,8 @@ * along with this program. If not, see . */ +import 'dart:convert'; + import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/annotations.dart'; import 'package:mockito/mockito.dart'; @@ -46,15 +48,49 @@ void main() { author: 'Alice', category: 1, muscles: [1], - musclesSecondary: [], - equipment: [], - translations: [], + musclesSecondary: [2, 3], + equipment: [4], + variationGroup: 'chest', + variationConnectTo: 99, + translations: [ + ExerciseTranslationSubmissionApi( + name: 'Bench Press', + descriptionSource: 'Lie down and press.', + language: 2, + author: 'Alice', + aliases: [ExerciseAliasSubmissionApi(alias: 'Chest Press')], + ), + ], ); final id = await repo.submit(payload); expect(id, 42); - verify(mockBase.post(payload.toJson(), uri)).called(1); + final captured = verify(mockBase.post(captureAny, uri)).captured.single; + // Round-trip through JSON like WgerBaseProvider.post does, so the nested + // translations show their wire names too + final body = jsonDecode(jsonEncode(captured)) as Map; + expect(body, { + 'category': 1, + 'muscles': [1], + 'muscles_secondary': [2, 3], + 'equipment': [4], + 'license_author': 'Alice', + 'variation_group': 'chest', + 'variations_connect_to': 99, + 'translations': [ + { + 'name': 'Bench Press', + 'description_source': 'Lie down and press.', + 'language': 2, + 'license_author': 'Alice', + 'aliases': [ + {'alias': 'Chest Press'}, + ], + 'comments': [], + }, + ], + }); }); }); diff --git a/test/features/exercises/providers/add_exercise_state_test.dart b/test/features/exercises/providers/add_exercise_state_test.dart index fa8d747d5..7dd0617c5 100644 --- a/test/features/exercises/providers/add_exercise_state_test.dart +++ b/test/features/exercises/providers/add_exercise_state_test.dart @@ -23,21 +23,6 @@ import '../../../../test_data/exercises.dart'; void main() { group('AddExerciseState defaults', () { - test('starts with empty author, no language, no category', () { - const state = AddExerciseState(); - - expect(state.author, ''); - expect(state.languageEn, isNull); - expect(state.languageTranslation, isNull); - expect(state.category, isNull); - expect(state.equipment, isEmpty); - expect(state.primaryMuscles, isEmpty); - expect(state.secondaryMuscles, isEmpty); - expect(state.alternateNamesEn, isEmpty); - expect(state.alternateNamesTrans, isEmpty); - expect(state.exerciseImages, isEmpty); - }); - test('newVariation reflects whether variationConnectToExercise is set', () { const noVariation = AddExerciseState(); const withVariation = AddExerciseState(variationConnectToExercise: 42); @@ -113,15 +98,4 @@ void main() { ); }); }); - - group('copyWith', () { - test('replaces only the named fields', () { - const original = AddExerciseState(author: 'Alice', exerciseNameEn: 'Press'); - - final copy = original.copyWith(author: 'Bob'); - - expect(copy.author, 'Bob'); - expect(copy.exerciseNameEn, 'Press'); - }); - }); } diff --git a/test/features/exercises/providers/exercise_filters_riverpod_test.dart b/test/features/exercises/providers/exercise_filters_riverpod_test.dart index 413d0bde8..599ccc348 100644 --- a/test/features/exercises/providers/exercise_filters_riverpod_test.dart +++ b/test/features/exercises/providers/exercise_filters_riverpod_test.dart @@ -1,117 +1,129 @@ -import 'package:flutter_riverpod/flutter_riverpod.dart'; -import 'package:flutter_test/flutter_test.dart'; -import 'package:shared_preferences_platform_interface/in_memory_shared_preferences_async.dart'; -import 'package:shared_preferences_platform_interface/shared_preferences_async_platform_interface.dart'; -import 'package:wger/core/search_options.dart'; -import 'package:wger/core/shared_preferences.dart'; -import 'package:wger/features/exercises/models/category.dart'; -import 'package:wger/features/exercises/models/exercise_filters.dart'; -import 'package:wger/features/exercises/providers/exercise_filters_riverpod.dart'; - -void main() { - TestWidgetsFlutterBinding.ensureInitialized(); - - setUp(() { - SharedPreferencesAsyncPlatform.instance = InMemorySharedPreferencesAsync.empty(); - }); - - test('default values are correct on first load', () async { - final container = ProviderContainer.test(); - final filters = await container.read(exerciseFiltersProvider.future); - - expect(filters.searchLanguage, SearchLanguage.currentAndEnglish); - expect(filters.searchMode, ExerciseSearchMode.fulltext); - expect(filters.selectedCategories, isEmpty); - }); - - test('chooseLanguage updates provider and saves to SharedPreferences', () async { - final container = ProviderContainer.test(); - await container.read(exerciseFiltersProvider.future); - final notifier = container.read(exerciseFiltersProvider.notifier); - - await notifier.chooseLanguage(SearchLanguage.all); - - final filters = await container.read(exerciseFiltersProvider.future); - expect(filters.searchLanguage, SearchLanguage.all); - expect( - await PreferenceHelper.instance.getExerciseSearchLanguage(), - SearchLanguage.all, - ); - }); - - test('chooseSearchMode updates provider and saves to SharedPreferences', () async { - final container = ProviderContainer.test(); - await container.read(exerciseFiltersProvider.future); - final notifier = container.read(exerciseFiltersProvider.notifier); - - await notifier.chooseSearchMode(ExerciseSearchMode.exact); - - final filters = await container.read(exerciseFiltersProvider.future); - expect(filters.searchMode, ExerciseSearchMode.exact); - expect( - await PreferenceHelper.instance.getExerciseSearchMode(), - ExerciseSearchMode.exact, - ); - }); - - test('toggleCategory adds and removes categories without persisting them', () async { - final container = ProviderContainer.test(); - await container.read(exerciseFiltersProvider.future); - final notifier = container.read(exerciseFiltersProvider.notifier); - - const abs = ExerciseCategory(id: 1, name: 'Abs'); - const arms = ExerciseCategory(id: 2, name: 'Arms'); - - // Add two categories - notifier.toggleCategory(abs); - notifier.toggleCategory(arms); - - var filters = await container.read(exerciseFiltersProvider.future); - expect(filters.selectedCategories, {abs, arms}); - - // Tapping an already-selected category removes it - notifier.toggleCategory(abs); - filters = await container.read(exerciseFiltersProvider.future); - expect(filters.selectedCategories, {arms}); - - // clearCategories empties the set - notifier.clearCategories(); - filters = await container.read(exerciseFiltersProvider.future); - expect(filters.selectedCategories, isEmpty); - }); - - test('resetAll clears the category selection', () async { - final container = ProviderContainer.test(); - await container.read(exerciseFiltersProvider.future); - final notifier = container.read(exerciseFiltersProvider.notifier); - - notifier.toggleCategory(const ExerciseCategory(id: 1, name: 'Abs')); - await notifier.resetAll(); - - final filters = await container.read(exerciseFiltersProvider.future); - expect(filters.selectedCategories, isEmpty); - }); - - test('settings persist across provider container restart', () async { - // create container, set values, destroy, create new container - final container1 = ProviderContainer.test(); - await container1.read(exerciseFiltersProvider.future); - await container1 - .read(exerciseFiltersProvider.notifier) - .chooseLanguage( - SearchLanguage.current, - ); - await container1 - .read(exerciseFiltersProvider.notifier) - .chooseSearchMode( - ExerciseSearchMode.exact, - ); - container1.dispose(); - - // New container - final container2 = ProviderContainer.test(); - final filters = await container2.read(exerciseFiltersProvider.future); - expect(filters.searchLanguage, SearchLanguage.current); - expect(filters.searchMode, ExerciseSearchMode.exact); - }); -} +import 'package:flutter_riverpod/flutter_riverpod.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:shared_preferences_platform_interface/in_memory_shared_preferences_async.dart'; +import 'package:shared_preferences_platform_interface/shared_preferences_async_platform_interface.dart'; +import 'package:wger/core/search_options.dart'; +import 'package:wger/core/shared_preferences.dart'; +import 'package:wger/features/exercises/models/category.dart'; +import 'package:wger/features/exercises/models/exercise_filters.dart'; +import 'package:wger/features/exercises/providers/exercise_filters_riverpod.dart'; + +void main() { + TestWidgetsFlutterBinding.ensureInitialized(); + + setUp(() { + SharedPreferencesAsyncPlatform.instance = InMemorySharedPreferencesAsync.empty(); + }); + + test('default values are correct on first load', () async { + final container = ProviderContainer.test(); + final filters = await container.read(exerciseFiltersProvider.future); + + expect(filters.searchLanguage, SearchLanguage.currentAndEnglish); + expect(filters.searchMode, ExerciseSearchMode.fulltext); + expect(filters.selectedCategories, isEmpty); + }); + + test('chooseLanguage updates provider and saves to SharedPreferences', () async { + final container = ProviderContainer.test(); + await container.read(exerciseFiltersProvider.future); + final notifier = container.read(exerciseFiltersProvider.notifier); + + await notifier.chooseLanguage(SearchLanguage.all); + + final filters = await container.read(exerciseFiltersProvider.future); + expect(filters.searchLanguage, SearchLanguage.all); + expect( + await PreferenceHelper.instance.getExerciseSearchLanguage(), + SearchLanguage.all, + ); + }); + + test('chooseSearchMode updates provider and saves to SharedPreferences', () async { + final container = ProviderContainer.test(); + await container.read(exerciseFiltersProvider.future); + final notifier = container.read(exerciseFiltersProvider.notifier); + + await notifier.chooseSearchMode(ExerciseSearchMode.exact); + + final filters = await container.read(exerciseFiltersProvider.future); + expect(filters.searchMode, ExerciseSearchMode.exact); + expect( + await PreferenceHelper.instance.getExerciseSearchMode(), + ExerciseSearchMode.exact, + ); + }); + + test('toggleCategory adds and removes categories without persisting them', () async { + final container = ProviderContainer.test(); + await container.read(exerciseFiltersProvider.future); + final notifier = container.read(exerciseFiltersProvider.notifier); + + const abs = ExerciseCategory(id: 1, name: 'Abs'); + const arms = ExerciseCategory(id: 2, name: 'Arms'); + + // Add two categories + notifier.toggleCategory(abs); + notifier.toggleCategory(arms); + + var filters = await container.read(exerciseFiltersProvider.future); + expect(filters.selectedCategories, {abs, arms}); + + // Tapping an already-selected category removes it + notifier.toggleCategory(abs); + filters = await container.read(exerciseFiltersProvider.future); + expect(filters.selectedCategories, {arms}); + + // clearCategories empties the set + notifier.clearCategories(); + filters = await container.read(exerciseFiltersProvider.future); + expect(filters.selectedCategories, isEmpty); + }); + + test('resetAll clears the category selection and persists the defaults', () async { + final container = ProviderContainer.test(); + await container.read(exerciseFiltersProvider.future); + final notifier = container.read(exerciseFiltersProvider.notifier); + + await notifier.chooseLanguage(SearchLanguage.all); + await notifier.chooseSearchMode(ExerciseSearchMode.exact); + notifier.toggleCategory(const ExerciseCategory(id: 1, name: 'Abs')); + await notifier.resetAll(); + + final filters = await container.read(exerciseFiltersProvider.future); + expect(filters.selectedCategories, isEmpty); + expect(filters.searchLanguage, SearchLanguage.currentAndEnglish); + expect(filters.searchMode, ExerciseSearchMode.fulltext); + expect( + await PreferenceHelper.instance.getExerciseSearchLanguage(), + SearchLanguage.currentAndEnglish, + ); + expect( + await PreferenceHelper.instance.getExerciseSearchMode(), + ExerciseSearchMode.fulltext, + ); + }); + + test('settings persist across provider container restart', () async { + // create container, set values, destroy, create new container + final container1 = ProviderContainer.test(); + await container1.read(exerciseFiltersProvider.future); + await container1 + .read(exerciseFiltersProvider.notifier) + .chooseLanguage( + SearchLanguage.current, + ); + await container1 + .read(exerciseFiltersProvider.notifier) + .chooseSearchMode( + ExerciseSearchMode.exact, + ); + container1.dispose(); + + // New container + final container2 = ProviderContainer.test(); + final filters = await container2.read(exerciseFiltersProvider.future); + expect(filters.searchLanguage, SearchLanguage.current); + expect(filters.searchMode, ExerciseSearchMode.exact); + }); +} diff --git a/test/features/exercises/providers/exercise_repository_test.dart b/test/features/exercises/providers/exercise_repository_test.dart index 34aaec61d..89d2274c6 100644 --- a/test/features/exercises/providers/exercise_repository_test.dart +++ b/test/features/exercises/providers/exercise_repository_test.dart @@ -502,39 +502,4 @@ void main() { expect(await repo.searchExerciseServerWithSearchMode('bench'), [7, 9]); }); }); - - group('reference-data watchers', () { - test('watchCategoriesDrift emits the seeded categories', () async { - await seedCategory(testCategoryArms.id, 'Arms'); - await seedCategory(testCategoryLegs.id, 'Legs'); - - final categories = await repo.watchCategoriesDrift().first; - - expect(categories.map((c) => c.id).toSet(), {testCategoryArms.id, testCategoryLegs.id}); - }); - - test('watchEquipmentDrift emits the seeded equipment', () async { - await seedEquipment(testEquipmentBench.id, 'Bench'); - - final equipment = await repo.watchEquipmentDrift().first; - - expect(equipment.single.id, testEquipmentBench.id); - }); - - test('watchMusclesDrift emits the seeded muscles', () async { - await seedMuscle(tMuscle1.id, 'Pec'); - - final muscles = await repo.watchMusclesDrift().first; - - expect(muscles.single.id, tMuscle1.id); - }); - - test('watchLanguagesDrift emits the seeded languages', () async { - await seedLanguage(testEnglish.id, 'en', 'English'); - - final languages = await repo.watchLanguagesDrift().first; - - expect(languages.single.id, testEnglish.id); - }); - }); } diff --git a/test/features/exercises/screens/add_exercise_screen_test.dart b/test/features/exercises/screens/add_exercise_screen_test.dart index 880186d6e..468e7980d 100644 --- a/test/features/exercises/screens/add_exercise_screen_test.dart +++ b/test/features/exercises/screens/add_exercise_screen_test.dart @@ -16,6 +16,7 @@ * along with this program. If not, see . */ +import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:material_ui/material_ui.dart'; import 'package:mockito/annotations.dart'; @@ -28,7 +29,9 @@ import 'package:wger/features/exercises/models/category.dart'; import 'package:wger/features/exercises/models/equipment.dart'; import 'package:wger/features/exercises/models/exercise.dart'; import 'package:wger/features/exercises/models/muscle.dart'; +import 'package:wger/features/exercises/providers/add_exercise_notifier.dart'; import 'package:wger/features/exercises/providers/add_exercise_repository.dart'; +import 'package:wger/features/exercises/providers/add_exercise_state.dart'; import 'package:wger/features/exercises/providers/exercise_repository.dart'; import 'package:wger/features/exercises/providers/exercises_notifier.dart'; import 'package:wger/features/exercises/screens/add_exercise_screen.dart'; @@ -97,6 +100,9 @@ void main() { ); } + AddExerciseState wizardState(WidgetTester tester) => + ProviderScope.containerOf(tester.element(find.byType(Stepper))).read(addExerciseProvider); + int currentStep(WidgetTester tester) => tester.widget(find.byType(Stepper)).currentStep; AppLocalizations l10nOf(WidgetTester tester) => @@ -171,49 +177,41 @@ void main() { await tester.pumpWidget(createExerciseScreen()); await tester.pumpAndSettle(); - final context = tester.element(find.byType(Stepper)); - final l10n = AppLocalizations.of(context); + // Author is prefilled, so the category is the only other required field + await pickFromDropdown(tester, const Key('category-dropdown'), testCategoryArms.name); + await tapNext(tester); - final nextButton = find.widgetWithText(ElevatedButton, l10n.next).first; - expect(nextButton, findsOneWidget); - - await tester.ensureVisible(nextButton); - await tester.pumpAndSettle(); - - await tester.tap(nextButton); - await tester.pumpAndSettle(); - - final stepper = tester.widget(find.byType(Stepper)); - expect(stepper.currentStep, equals(0)); + expect(currentStep(tester), 0); + expect( + find.descendant( + of: fieldOf(Step1Basics, 0), + matching: find.text(l10nOf(tester).enterValue), + ), + findsOneWidget, + ); + expect(find.text(l10nOf(tester).selectEntry), findsNothing); }); - testWidgets('User can enter exercise name in text field', (tester) async { + testWidgets('Typing the exercise name stores it in the wizard state', (tester) async { setTrustworthy(true); await tester.pumpWidget(createExerciseScreen()); await tester.pumpAndSettle(); - final nameField = find.byType(TextFormField).first; - expect(nameField, findsOneWidget); - - await tester.enterText(nameField, 'Bench Press'); + await tester.enterText(fieldOf(Step1Basics, 0), 'Bench Press'); await tester.pump(); - expect(find.text('Bench Press'), findsOneWidget); + expect(wizardState(tester).exerciseNameEn, 'Bench Press'); }); - testWidgets('Alternative names field accepts multiple lines of text', (tester) async { + testWidgets('Alternative names field stores one name per line', (tester) async { setTrustworthy(true); await tester.pumpWidget(createExerciseScreen()); await tester.pumpAndSettle(); - final textFields = find.byType(TextFormField); - expect(textFields, findsWidgets); - - final alternativeNamesField = textFields.at(1); - await tester.enterText(alternativeNamesField, 'Chest Press\nFlat Bench Press'); + await tester.enterText(fieldOf(Step1Basics, 1), 'Chest Press\nFlat Bench Press'); await tester.pump(); - expect(find.text('Chest Press\nFlat Bench Press'), findsOneWidget); + expect(wizardState(tester).alternateNamesEn, ['Chest Press', 'Flat Bench Press']); }); testWidgets('Category dropdown is required for form submission', (tester) async { @@ -221,22 +219,14 @@ void main() { await tester.pumpWidget(createExerciseScreen()); await tester.pumpAndSettle(); - final nameField = find.byType(TextFormField).first; - await tester.enterText(nameField, 'Test Exercise'); + // Name typed and author prefilled, so only the category is missing + await tester.enterText(fieldOf(Step1Basics, 0), 'Test Exercise'); await tester.pump(); + await tapNext(tester); - final context = tester.element(find.byType(Stepper)); - final l10n = AppLocalizations.of(context); - final nextButton = find.widgetWithText(ElevatedButton, l10n.next).first; - - await tester.ensureVisible(nextButton); - await tester.pumpAndSettle(); - - await tester.tap(nextButton); - await tester.pumpAndSettle(); - - final stepper = tester.widget(find.byType(Stepper)); - expect(stepper.currentStep, equals(0)); + expect(currentStep(tester), 0); + expect(find.text(l10nOf(tester).selectEntry), findsOneWidget); + expect(find.text(l10nOf(tester).enterValue), findsNothing); }); }); @@ -280,17 +270,14 @@ void main() { // -------------------------------------------------------------------------- group('Dropdown Selection Tests', () { - testWidgets('Category selection widgets exist in form', (tester) async { + testWidgets('Picking a category stores it in the wizard state', (tester) async { setTrustworthy(true); await tester.pumpWidget(createExerciseScreen()); await tester.pumpAndSettle(); - expect(find.byType(AddExerciseStepper), findsOneWidget); - expect(find.byType(Stepper), findsOneWidget); + await pickFromDropdown(tester, const Key('category-dropdown'), testCategoryArms.name); - final stepper = tester.widget(find.byType(Stepper)); - expect(stepper.steps.length, equals(6)); - expect(stepper.steps[0].content.runtimeType.toString(), contains('Step1Basics')); + expect(wizardState(tester).category, testCategoryArms); }); testWidgets('Form contains multiple selection fields', (tester) async { @@ -336,18 +323,14 @@ void main() { expect(find.byType(Stepper), findsNothing); }); - testWidgets('Verified users can access all form fields', (tester) async { + testWidgets('Verified users get the form instead of the warning', (tester) async { setTrustworthy(true); await tester.pumpWidget(createExerciseScreen()); await tester.pumpAndSettle(); + expect(find.byType(EmailNotVerified), findsNothing); expect(find.byType(AddExerciseStepper), findsOneWidget); - expect(find.byType(Stepper), findsOneWidget); - expect(find.byType(TextFormField), findsWidgets); - - final stepper = tester.widget(find.byType(Stepper)); - expect(stepper.steps.length, equals(6)); }); testWidgets('Email verification warning displays correct message', (tester) async { diff --git a/test/features/gallery/providers/gallery_repository_test.dart b/test/features/gallery/providers/gallery_repository_test.dart index 31723fccf..eaa66de7c 100644 --- a/test/features/gallery/providers/gallery_repository_test.dart +++ b/test/features/gallery/providers/gallery_repository_test.dart @@ -16,8 +16,6 @@ * along with this program. If not, see . */ -import 'dart:async'; - import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/annotations.dart'; import 'package:wger/core/network/base_provider.dart'; @@ -75,21 +73,6 @@ void main() { expect(emitted.first.date.month, 5); expect(emitted.last.date, DateTime.utc(2021, 2, 22)); }); - - test('re-emits after a row is added', () async { - final stream = repo.watchAllDrift(); - final iter = StreamIterator(stream); - - await iter.moveNext(); - expect(iter.current, isEmpty); - - await seed([getTestImages().first]); - - await iter.moveNext(); - expect(iter.current, hasLength(1)); - - await iter.cancel(); - }); }); group('editLocalDrift', () { @@ -125,14 +108,6 @@ void main() { final rows = await readAll(); expect(rows.map((r) => r.id).toSet(), {1, 3, 4}); }); - - test('on a non-existent id is a no-op', () async { - await seed([getTestImages().first]); - - await repo.deleteLocalDrift(999); - - expect(await readAll(), hasLength(1)); - }); }); // Note: addImageServer and editImageServer are not unit-tested here. Both diff --git a/test/features/gallery/screens/gallery_screen_test.dart b/test/features/gallery/screens/gallery_screen_test.dart index dbccd5c34..91d730452 100644 --- a/test/features/gallery/screens/gallery_screen_test.dart +++ b/test/features/gallery/screens/gallery_screen_test.dart @@ -21,9 +21,11 @@ import 'package:material_ui/material_ui.dart'; import 'package:mockito/annotations.dart'; import 'package:mockito/mockito.dart'; import 'package:network_image_mock/network_image_mock.dart'; +import 'package:wger/core/form_screen.dart'; import 'package:wger/core/network/network_provider.dart'; import 'package:wger/features/gallery/providers/gallery_repository.dart'; import 'package:wger/features/gallery/screens/gallery_screen.dart'; +import 'package:wger/features/gallery/widgets/forms.dart'; import '../../../../test_data/gallery.dart'; import '../../../helpers/pump_app.dart'; @@ -48,9 +50,22 @@ void main() { galleryRepositoryProvider.overrideWithValue(mockGalleryRepository), ], locale: Locale(locale), + routes: {FormScreen.routeName: (_) => const FormScreen()}, ); } + testWidgets('Add button opens the image form when online', (WidgetTester tester) async { + await mockNetworkImagesFor(() => tester.pumpWidget(renderGalleryScreen())); + await tester.pumpAndSettle(); + + final fab = tester.widget(find.byType(FloatingActionButton)); + expect(fab.onPressed, isNotNull); + + await tester.tap(find.byType(FloatingActionButton)); + await tester.pumpAndSettle(); + expect(find.byType(ImageForm), findsOneWidget); + }); + testWidgets('Add button is disabled when offline', (WidgetTester tester) async { // Adding an image is a binary REST upload, so it needs connectivity. await mockNetworkImagesFor( diff --git a/test/features/gallery/widgets/forms_test.dart b/test/features/gallery/widgets/forms_test.dart index bc6b3f06f..54b187f24 100644 --- a/test/features/gallery/widgets/forms_test.dart +++ b/test/features/gallery/widgets/forms_test.dart @@ -63,17 +63,22 @@ void main() { expect(find.text('A very cool image from the gym'), findsOneWidget); expect(find.byKey(const Key(SUBMIT_BUTTON_KEY_NAME)), findsOneWidget); - // Date can only be edited via the datepicker + // Date can only be edited via the datepicker, which opens on the image's month (May 2021) await tester.tap(find.byKey(const Key('field-date'))); - await tester.pump(); + await tester.pumpAndSettle(); + await tester.tap(find.text('15')); await tester.tap(find.text('OK')); - await tester.tap(find.text('15'), warnIfMissed: false); + await tester.pumpAndSettle(); - await tester.pump(); await tester.tap(find.byKey(const Key(SUBMIT_BUTTON_KEY_NAME))); + await tester.pump(); verifyNever(mockGalleryRepository.addImageServer(any, any)); - verify(mockGalleryRepository.editLocalDrift(any)); + final saved = + verify(mockGalleryRepository.editLocalDrift(captureAny)).captured.single as GalleryImage; + expect(saved.id, 1); + expect(saved.date, DateTime(2021, 5, 15)); + expect(saved.description, 'A very cool image from the gym'); }); testWidgets('Test opening the form for a new image', (WidgetTester tester) async { diff --git a/test/features/health/providers/health_sync_test.dart b/test/features/health/providers/health_sync_test.dart index 860f0d7ac..f47407f13 100644 --- a/test/features/health/providers/health_sync_test.dart +++ b/test/features/health/providers/health_sync_test.dart @@ -138,23 +138,6 @@ void main() { }); } - group('HealthSyncState', () { - test('default state has sync disabled', () { - const state = HealthSyncState(); - expect(state.isEnabled, false); - expect(state.isSyncing, false); - expect(state.lastSyncCount, 0); - }); - - test('copyWith updates individual fields', () { - const state = HealthSyncState(); - final updated = state.copyWith(isEnabled: true, lastSyncCount: 5); - expect(updated.isEnabled, true); - expect(updated.isSyncing, false); - expect(updated.lastSyncCount, 5); - }); - }); - group('enableSync', () { test('returns null and stays disabled when permissions are denied', () async { await PreferenceHelper.instance.setHealthSyncEnabled(false); diff --git a/test/features/measurements/charts/data_test.dart b/test/features/measurements/charts/data_test.dart index 50570d9ff..dab1214e4 100644 --- a/test/features/measurements/charts/data_test.dart +++ b/test/features/measurements/charts/data_test.dart @@ -16,6 +16,7 @@ * along with this program. If not, see . */ +import 'package:clock/clock.dart'; import 'package:collection/collection.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:material_ui/material_ui.dart'; @@ -444,26 +445,26 @@ void main() { }); group('chartSeriesFor', () { test('cuts both series at the range, after averaging over all points', () { - // The points reach back beyond the range so the first ones in it average + // Six weeks of daily points, one at noon each day up to today. The + // points reach back beyond the range so the first ones in it average // the days before them instead of starting over at the cutoff final points = [ - for (var day = 0; day < 20; day++) - MeasurementChartEntry( - day.isEven ? 70 : 80, - DateTime.now().subtract(Duration(days: 19 - day)), - ), + for (var day = 0; day < 40; day++) + MeasurementChartEntry(day.isEven ? 70 : 80, DateTime(2026, 3, 15 - 39 + day, 12)), ]; - final (:entries, :average) = chartSeriesFor( - points, - ChartRange.lastMonth, - const ChartSettings(), + final (:entries, :average) = withClock( + Clock.fixed(DateTime(2026, 3, 15, 18)), + () => chartSeriesFor(points, ChartRange.lastWeek, const ChartSettings()), ); - expect(entries, hasLength(20)); - expect(average, hasLength(20)); - // The last point averages a full window, not just itself - expect(average.last.value, closeTo(75, 1)); + // Today and the six days before it; the day before the cutoff is out + expect(entries.map((e) => e.date), [ + for (var day = 9; day <= 15; day++) DateTime(2026, 3, day, 12), + ]); + expect(average.map((e) => e.date), entries.map((e) => e.date)); + // The first point in range averages a full window, not just itself (80) + expect(average.first.value, closeTo(75, 1)); }); }); group('niceBinWidth', () { diff --git a/test/features/measurements/providers/body_weight_provider_test.dart b/test/features/measurements/providers/body_weight_provider_test.dart index 9b3d205cc..41375ebde 100644 --- a/test/features/measurements/providers/body_weight_provider_test.dart +++ b/test/features/measurements/providers/body_weight_provider_test.dart @@ -45,24 +45,6 @@ void main() { mockRepo = MockMeasurementRepository(); }); - test('exposes the official body weight category', () async { - container = buildContainer(getBodyWeightCategory()); - container.listen(bodyWeightCategoryOnlyProvider, (_, _) {}); - await pumpEventQueue(); - - expect(container.read(bodyWeightCategoryOnlyProvider).value?.id, testBodyWeightCategoryId); - }); - - test('is null while no official category has been synced', () async { - container = buildContainer(null); - container.listen(bodyWeightCategoryOnlyProvider, (_, _) {}); - await pumpEventQueue(); - - final async = container.read(bodyWeightCategoryOnlyProvider); - expect(async.hasValue, isTrue); - expect(async.value, isNull); - }); - test('asks the repository for one category instead of for all of them', () async { // Reading every category and keeping one made any other category's entry // rebuild the weight screen, and the sync writes five sleep rows a night diff --git a/test/features/measurements/providers/measurement_repository_test.dart b/test/features/measurements/providers/measurement_repository_test.dart index 8bf930f3b..f6feea10b 100644 --- a/test/features/measurements/providers/measurement_repository_test.dart +++ b/test/features/measurements/providers/measurement_repository_test.dart @@ -401,7 +401,10 @@ void main() { final page = await repo.watchEntries('2', limit: 10).first; - expect(page.every((e) => e.categoryId == '2'), isTrue); + expect( + page.map((e) => e.id).toSet(), + getMeasurementEntries()['2']!.map((e) => e.id).toSet(), + ); }); }); diff --git a/test/features/measurements/screens/measurement_entries_screen_test.dart b/test/features/measurements/screens/measurement_entries_screen_test.dart index 4d8f4ab09..e71654755 100644 --- a/test/features/measurements/screens/measurement_entries_screen_test.dart +++ b/test/features/measurements/screens/measurement_entries_screen_test.dart @@ -178,8 +178,12 @@ void main() { await tester.pumpAndSettle(); // From the entries list, which shows the newest first - expect(find.text('11/15/2022'), findsWidgets); - expect(find.text('11/10/2022'), findsWidgets); + expect(find.text('11/15/2022'), findsOneWidget); + expect(find.text('11/10/2022'), findsOneWidget); + expect( + tester.getTopLeft(find.text('11/15/2022')).dy, + lessThan(tester.getTopLeft(find.text('11/10/2022')).dy), + ); }); testWidgets('Tests the localization of dates - DE', (WidgetTester tester) async { @@ -188,7 +192,11 @@ void main() { await tester.pumpAndSettle(); // From the entries list, which shows the newest first - expect(find.text('15.11.2022'), findsWidgets); - expect(find.text('10.11.2022'), findsWidgets); + expect(find.text('15.11.2022'), findsOneWidget); + expect(find.text('10.11.2022'), findsOneWidget); + expect( + tester.getTopLeft(find.text('15.11.2022')).dy, + lessThan(tester.getTopLeft(find.text('10.11.2022')).dy), + ); }); } diff --git a/test/features/measurements/widgets/categories_card_test.dart b/test/features/measurements/widgets/categories_card_test.dart index b1e2468e2..94c7d3e19 100644 --- a/test/features/measurements/widgets/categories_card_test.dart +++ b/test/features/measurements/widgets/categories_card_test.dart @@ -179,10 +179,9 @@ void main() { await tester.pumpAndSettle(); // The ends of the bar say which is which - expect( - tester.widgetList(find.byType(ListTile)).every((t) => t.leading == null), - isTrue, - ); + final tiles = tester.widgetList(find.byType(ListTile)); + expect(tiles, hasLength(2)); + expect(tiles.every((t) => t.leading == null), isTrue); }); testWidgets('falls back to lines when the readings are not paired', (tester) async { @@ -270,6 +269,7 @@ void main() { // Total sleep is no segment of the stack, so no colour identifies it final tiles = tester.widgetList(find.byType(ListTile)).toList(); + expect(tiles, hasLength(3)); expect(tiles.first.leading, isNull); expect(tiles.skip(1).every((t) => t.leading != null), isTrue); }); diff --git a/test/features/measurements/widgets/forms/category_test.dart b/test/features/measurements/widgets/forms/category_test.dart index 0221a4ec5..77ceb859c 100644 --- a/test/features/measurements/widgets/forms/category_test.dart +++ b/test/features/measurements/widgets/forms/category_test.dart @@ -75,18 +75,20 @@ void main() { await tester.pumpWidget(wrap(const MeasurementCategoryForm())); await tester.pumpAndSettle(); - // Tap save without entering any text + // Fill the unit but leave the name empty, so only the name can complain + await tester.enterText(find.byType(TextFormField).at(1), 'cm'); await tester.tap(find.byType(ElevatedButton)); await tester.pumpAndSettle(); - // Check for validation errors. - final error = find.byWidgetPredicate((widget) { - if (widget is TextField) { - return widget.decoration?.errorText != null; - } - return false; - }); - expect(error, findsAtLeastNWidgets(1)); + expect( + find.descendant( + of: find.byType(TextFormField).first, + matching: find.text('Please enter a value'), + ), + findsOneWidget, + ); + expect(find.text('Please enter a value'), findsOneWidget); + verifyNever(mockRepo.addLocalDriftCategory(any)); }); testWidgets('empty unit field fails validation', (tester) async { @@ -98,8 +100,15 @@ void main() { await tester.tap(find.byType(ElevatedButton)); await tester.pumpAndSettle(); - // still on same screen - expect(find.byType(MeasurementCategoryForm), findsOneWidget); + expect( + find.descendant( + of: find.byType(TextFormField).at(1), + matching: find.text('Please enter a value'), + ), + findsOneWidget, + ); + expect(find.text('Please enter a value'), findsOneWidget); + verifyNever(mockRepo.addLocalDriftCategory(any)); }); testWidgets('the metric type is not offered', (tester) async { diff --git a/test/features/measurements/widgets/metric_picker_test.dart b/test/features/measurements/widgets/metric_picker_test.dart index 0ce17a854..70c7e16a2 100644 --- a/test/features/measurements/widgets/metric_picker_test.dart +++ b/test/features/measurements/widgets/metric_picker_test.dart @@ -80,8 +80,12 @@ void main() { testWidgets('offers neither body weight nor the components', (tester) async { // Body weight is the server's category and a component comes with its // group, so neither is something to start here + // Tall enough for the whole list: the ListView only builds what is in + // view, and findsNothing on an unbuilt tile would prove nothing + setTestViewSize(tester, const Size(800, 5000)); await tester.pumpWidget(wrap()); await tester.pumpAndSettle(); + expect(tester.state(find.byType(Scrollable)).position.maxScrollExtent, 0); final context = tester.element(find.byType(MetricPickerSheet)); for (final hidden in [ diff --git a/test/features/measurements/widgets/weight_form_test.dart b/test/features/measurements/widgets/weight_form_test.dart index d3cab75b4..c465342ce 100644 --- a/test/features/measurements/widgets/weight_form_test.dart +++ b/test/features/measurements/widgets/weight_form_test.dart @@ -69,6 +69,16 @@ void main() { ); } + String weightText(WidgetTester tester) => tester + .widget( + find.descendant( + of: find.byKey(const Key('weightInput')), + matching: find.byType(EditableText), + ), + ) + .controller + .text; + testWidgets('Correctly prefills and localizes the data - en', (WidgetTester tester) async { await tester.pumpWidget(createWeightForm(entry: testWeightEntry1)); await tester.pumpAndSettle(); @@ -113,10 +123,10 @@ void main() { await tester.pumpAndSettle(); expect(find.text('shiba inu'), findsNothing); - // Quick-change still works on the now-empty field + // Quick-change on the now-empty field has nothing to step from await tester.tap(find.byKey(const Key('stepper-minus-0'))); await tester.pumpAndSettle(); - expect(find.text('shiba inu'), findsNothing); + expect(weightText(tester), isEmpty); }); testWidgets('Accepts a dot as decimal separator in the de locale', (WidgetTester tester) async { @@ -129,9 +139,25 @@ void main() { expect(find.text('81,5'), findsOneWidget); }); - testWidgets('Widget works if there is no last entry', (WidgetTester tester) async { + testWidgets('Without an entry it starts empty in kg and saves a new entry', ( + WidgetTester tester, + ) async { await tester.pumpWidget(createWeightForm()); await tester.pumpAndSettle(); + + expect(weightText(tester), isEmpty); + expect(find.text('kg'), findsOneWidget); + + await tester.enterText(find.byKey(const Key('weightInput')), '75'); + await tester.tap(find.byKey(const Key(SUBMIT_BUTTON_KEY_NAME))); + await tester.pumpAndSettle(); + + final saved = verify(mockRepo.addLocalDrift(captureAny)).captured.single as MeasurementEntry; + expect(saved.id, isNull); + expect(saved.categoryId, testBodyWeightCategoryId); + expect(saved.value, 75); + expect(saved.extraData, {'unit': 'kg'}); + verifyNever(mockRepo.updateLocalDrift(any)); }); testWidgets('Saving keeps an afternoon (PM) time intact and takes the edited notes', ( diff --git a/test/features/nutrition/models/nutritional_plan_model_test.dart b/test/features/nutrition/models/nutritional_plan_model_test.dart index 7152e1329..ccac1893e 100644 --- a/test/features/nutrition/models/nutritional_plan_model_test.dart +++ b/test/features/nutrition/models/nutritional_plan_model_test.dart @@ -17,6 +17,8 @@ */ import 'package:flutter_test/flutter_test.dart'; +import 'package:wger/features/nutrition/models/meal.dart'; +import 'package:wger/features/nutrition/models/meal_item.dart'; import 'package:wger/features/nutrition/models/nutritional_goals.dart'; import 'package:wger/features/nutrition/models/nutritional_plan.dart'; import 'package:wger/features/nutrition/models/nutritional_values.dart'; @@ -108,8 +110,29 @@ void main() { expect(meal.plannedNutritionalValues, values); }); - test('Test that the getter returns all meal items for a plan', () { - expect(plan.dedupMealItems, plan.meals[0].mealItems + plan.meals[1].mealItems); + test('dedupMealItems drops items with the same amount and ingredient', () { + final item1 = MealItem(ingredientId: 1, amount: 100); + final item2 = MealItem(ingredientId: 2, amount: 75); + final duplicate = MealItem(ingredientId: 1, amount: 100); + final otherAmount = MealItem(ingredientId: 1, amount: 50); + final otherIngredient = MealItem(ingredientId: 3, amount: 100); + final planWithDuplicates = NutritionalPlan( + description: 'duplicates', + creationDate: DateTime(2024, 5, 4), + startDate: DateTime(2024, 5, 4), + meals: [ + Meal(mealItems: [item1, item2]), + Meal(mealItems: [duplicate, otherAmount, otherIngredient]), + ], + ); + + final result = planWithDuplicates.dedupMealItems; + + expect(result, hasLength(4)); + expect(result[0], same(item1)); + expect(result[1], same(item2)); + expect(result[2], same(otherAmount)); + expect(result[3], same(otherIngredient)); }); }); } diff --git a/test/features/nutrition/providers/ingredient_notifier_test.dart b/test/features/nutrition/providers/ingredient_notifier_test.dart index 5108484da..b67918388 100644 --- a/test/features/nutrition/providers/ingredient_notifier_test.dart +++ b/test/features/nutrition/providers/ingredient_notifier_test.dart @@ -16,10 +16,13 @@ * along with this program. If not, see . */ +import 'package:fake_async/fake_async.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/annotations.dart'; import 'package:mockito/mockito.dart'; +import 'package:wger/core/network/network_provider.dart'; +import 'package:wger/core/search_options.dart'; import 'package:wger/features/nutrition/models/ingredient.dart'; import 'package:wger/features/nutrition/models/ingredient_filters.dart'; import 'package:wger/features/nutrition/providers/ingredient_filters_notifier.dart'; @@ -107,71 +110,143 @@ void main() { }); }); - group('ingredientByIdProvider', () { - test('reads from the repository by id', () async { - final apple = makeIngredient(1, 'Apple'); - when(mockRepo.getById(1)).thenAnswer((_) async => apple); + group('searchedIngredientsProvider', () { + const debounce = Duration(milliseconds: 350); - final container = makeContainer(); - final result = await container.read(ingredientByIdProvider(1).future); - - expect(result?.id, 1); - verify(mockRepo.getById(1)).called(1); - }); - - test('returns null when the repo returns null', () async { - when(mockRepo.getById(99)).thenAnswer((_) async => null); - - final container = makeContainer(); - final result = await container.read(ingredientByIdProvider(99).future); - - expect(result, isNull); - }); - - test('concurrent reads of the same id share a single repo call', () async { - final apple = makeIngredient(1, 'Apple'); - when(mockRepo.getById(1)).thenAnswer((_) async => apple); - - final container = makeContainer(); - final results = await Future.wait([ - container.read(ingredientByIdProvider(1).future), - container.read(ingredientByIdProvider(1).future), - ]); - - expect(results.map((i) => i?.id), [1, 1]); - // Riverpod's per-family caching dedupes the repo call. - verify(mockRepo.getById(1)).called(1); - }); - }); - - group('ingredientByIdStreamProvider', () { - test('emits each value the repository stream emits', () async { - final apple = makeIngredient(1, 'Apple'); - final appleRenamed = makeIngredient(1, 'Apple Renamed'); + void stubSearch() { when( - mockRepo.watchById(1), - ).thenAnswer((_) => Stream.fromIterable([apple, appleRenamed])); + mockRepo.search( + any, + isOnline: anyNamed('isOnline'), + searchLanguage: anyNamed('searchLanguage'), + isVegan: anyNamed('isVegan'), + isVegetarian: anyNamed('isVegetarian'), + nutriscoreMax: anyNamed('nutriscoreMax'), + ), + ).thenAnswer((inv) async => [makeIngredient(1, inv.positionalArguments.first as String)]); + } - final container = makeContainer(); - // Explicit listen() keeps the autoDispose stream alive long enough - // to drain. - container.listen(ingredientByIdStreamProvider(1), (_, _) {}); - await pumpEventQueue(); - final result = container.read(ingredientByIdStreamProvider(1)).requireValue; + ProviderContainer makeSearchContainer({ + required bool isOnline, + IngredientFilters filters = const IngredientFilters(searchTerm: 'apple'), + }) { + return ProviderContainer.test( + overrides: [ + ingredientRepositoryProvider.overrideWithValue(mockRepo), + networkStatusProvider.overrideWithValue(isOnline), + _testFiltersProvider.overrideWith(() => _TestFilters(filters)), + ingredientFiltersSyncProvider.overrideWith((ref) => ref.watch(_testFiltersProvider)), + ], + ); + } - expect(result?.name, 'Apple Renamed'); - verify(mockRepo.watchById(1)).called(1); + test('searches with the filter state once the debounce window elapsed', () { + fakeAsync((async) { + stubSearch(); + final container = makeSearchContainer( + isOnline: true, + filters: const IngredientFilters( + searchTerm: 'banana', + searchLanguage: SearchLanguage.all, + isVegan: true, + nutriscoreMax: NutriScore.b, + ), + ); + container.listen(searchedIngredientsProvider, (_, _) {}); + + async.elapse(debounce - const Duration(milliseconds: 1)); + verifyNever( + mockRepo.search( + any, + isOnline: anyNamed('isOnline'), + searchLanguage: anyNamed('searchLanguage'), + isVegan: anyNamed('isVegan'), + isVegetarian: anyNamed('isVegetarian'), + nutriscoreMax: anyNamed('nutriscoreMax'), + ), + ); + + async.elapse(const Duration(milliseconds: 1)); + verify( + mockRepo.search( + 'banana', + isOnline: true, + searchLanguage: SearchLanguage.all, + isVegan: true, + isVegetarian: false, + nutriscoreMax: NutriScore.b, + ), + ).called(1); + expect(container.read(searchedIngredientsProvider).requireValue.single.name, 'banana'); + }); }); - test('emits null when no row with that id exists yet', () async { - when(mockRepo.watchById(99)).thenAnswer((_) => Stream.value(null)); + test('searches offline when the network is down', () { + fakeAsync((async) { + stubSearch(); + final container = makeSearchContainer(isOnline: false); + container.listen(searchedIngredientsProvider, (_, _) {}); - final container = makeContainer(); - container.listen(ingredientByIdStreamProvider(99), (_, _) {}); - await pumpEventQueue(); - final result = container.read(ingredientByIdStreamProvider(99)).requireValue; + async.elapse(debounce); - expect(result, isNull); + final isOnline = verify( + mockRepo.search( + 'apple', + isOnline: captureAnyNamed('isOnline'), + searchLanguage: anyNamed('searchLanguage'), + isVegan: anyNamed('isVegan'), + isVegetarian: anyNamed('isVegetarian'), + nutriscoreMax: anyNamed('nutriscoreMax'), + ), + ).captured.single; + expect(isOnline, isFalse); + }); + }); + + test('a filter change within the debounce window cancels the pending search', () { + fakeAsync((async) { + stubSearch(); + final container = makeSearchContainer( + isOnline: true, + filters: const IngredientFilters(searchTerm: 'ap'), + ); + container.listen(searchedIngredientsProvider, (_, _) {}); + + async.elapse(const Duration(milliseconds: 200)); + container + .read(_testFiltersProvider.notifier) + .set(const IngredientFilters(searchTerm: 'apple')); + async.elapse(debounce); + + final terms = verify( + mockRepo.search( + captureAny, + isOnline: anyNamed('isOnline'), + searchLanguage: anyNamed('searchLanguage'), + isVegan: anyNamed('isVegan'), + isVegetarian: anyNamed('isVegetarian'), + nutriscoreMax: anyNamed('nutriscoreMax'), + ), + ).captured; + expect(terms, ['apple']); + expect(container.read(searchedIngredientsProvider).requireValue.single.name, 'apple'); + }); }); }); } + +/// Holds the filter state so a test can change it while a search is pending. +final _testFiltersProvider = NotifierProvider<_TestFilters, IngredientFilters>( + () => _TestFilters(const IngredientFilters()), +); + +class _TestFilters extends Notifier { + _TestFilters(this._initial); + + final IngredientFilters _initial; + + @override + IngredientFilters build() => _initial; + + void set(IngredientFilters filters) => state = filters; +} diff --git a/test/features/nutrition/providers/ingredient_repository_test.dart b/test/features/nutrition/providers/ingredient_repository_test.dart index 5e9774a1f..efcbfa6b2 100644 --- a/test/features/nutrition/providers/ingredient_repository_test.dart +++ b/test/features/nutrition/providers/ingredient_repository_test.dart @@ -277,9 +277,15 @@ void main() { final uri = Uri.https('localhost', 'api/v2/ingredientinfo/'); test('returns empty for terms <= 1 char', () async { + // Stubbed so a missing guard reaches the server instead of throwing a MissingStubError. + when(mockBase.makeUrl('ingredientinfo', query: anyNamed('query'))).thenReturn(uri); + when( + mockBase.fetch(uri, timeout: anyNamed('timeout')), + ).thenAnswer((_) async => {'results': []}); + expect(await repo.searchIngredientServer(''), isEmpty); expect(await repo.searchIngredientServer('a'), isEmpty); - verifyNever(mockBase.fetch(any)); + verifyNever(mockBase.fetch(any, timeout: anyNamed('timeout'))); }); test('current language: passes the languageCode in the query', () async { diff --git a/test/features/nutrition/screens/nutritional_plans_screen_test.dart b/test/features/nutrition/screens/nutritional_plans_screen_test.dart index 6beb7e150..8d6708e33 100644 --- a/test/features/nutrition/screens/nutritional_plans_screen_test.dart +++ b/test/features/nutrition/screens/nutritional_plans_screen_test.dart @@ -124,16 +124,20 @@ void main() { await tester.pumpWidget(createHomeScreen()); await tester.pumpAndSettle(); - await tester.tap(find.byIcon(Icons.delete).first); + // Delete the second plan, so a handler that always deletes the first one fails. + final tile = find.ancestor(of: find.text('test plan 2'), matching: find.byType(ListTile)); + await tester.tap(find.descendant(of: tile, matching: find.byIcon(Icons.delete))); await tester.pumpAndSettle(); // Confirmation dialog expect(find.byType(AlertDialog), findsOneWidget); - // Confirm tap, actual delete now goes through Drift + PowerSync (not - // REST), so we don't assert on the REST mock here. + // Confirm tap, the delete goes through Drift + PowerSync (not REST). await tester.tap(find.text('Delete')); await tester.pumpAndSettle(); + + expect(find.byType(AlertDialog), findsNothing); + expect(verify(mockNutritionRepo.deleteLocalDrift(captureAny)).captured, [planUuid2]); }); testWidgets('Test the form on the nutritional plan screen', (WidgetTester tester) async { @@ -170,12 +174,13 @@ void main() { ); expect(deleteButton.onPressed, isNotNull); - await tester.tap(find.byIcon(Icons.delete).first); + final tile = find.ancestor(of: find.text('test plan 1'), matching: find.byType(ListTile)); + await tester.tap(find.descendant(of: tile, matching: find.byIcon(Icons.delete))); await tester.pumpAndSettle(); expect(find.byType(AlertDialog), findsOneWidget); await tester.tap(find.text('Delete')); await tester.pumpAndSettle(); - verify(mockNutritionRepo.deleteLocalDrift(any)).called(1); + expect(verify(mockNutritionRepo.deleteLocalDrift(captureAny)).captured, [planUuid1]); }); testWidgets('Tests the localization of dates - EN', (WidgetTester tester) async { diff --git a/test/features/nutrition/widgets/ingredient_dialogs_test.dart b/test/features/nutrition/widgets/ingredient_dialogs_test.dart index f462a877a..51aa8eba3 100644 --- a/test/features/nutrition/widgets/ingredient_dialogs_test.dart +++ b/test/features/nutrition/widgets/ingredient_dialogs_test.dart @@ -18,6 +18,8 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:material_ui/material_ui.dart'; +import 'package:plugin_platform_interface/plugin_platform_interface.dart'; +import 'package:url_launcher_platform_interface/url_launcher_platform_interface.dart'; import 'package:wger/features/nutrition/models/ingredient.dart'; import 'package:wger/features/nutrition/models/ingredient_image.dart'; import 'package:wger/features/nutrition/widgets/ingredient_dialogs.dart'; @@ -25,6 +27,17 @@ import 'package:wger/features/nutrition/widgets/ingredient_dialogs.dart'; import '../../../../test_data/nutritional_plans.dart'; import '../../../helpers/pump_app.dart'; +/// Captures `launchUrl(...)` calls so no real browser opens. +class _FakeUrlLauncher extends Fake with MockPlatformInterfaceMixin implements UrlLauncherPlatform { + final launchedUrls = []; + + @override + Future launchUrl(String url, LaunchOptions options) async { + launchedUrls.add(url); + return true; + } +} + Future pumpIngredientDetailsDialog( WidgetTester tester, { required Ingredient ingredient, @@ -180,9 +193,14 @@ void main() { ); testWidgets( - 'tapping Open Food Facts button closes the dialog', + 'tapping Open Food Facts button opens the product form and closes the dialog', (WidgetTester tester) async { // Arrange + final original = UrlLauncherPlatform.instance; + final fakeLauncher = _FakeUrlLauncher(); + UrlLauncherPlatform.instance = fakeLauncher; + addTearDown(() => UrlLauncherPlatform.instance = original); + const snapshot = AsyncSnapshot.withData( ConnectionState.done, null, @@ -207,7 +225,8 @@ void main() { ); await tester.pumpAndSettle(); - // Assert: Dialog should be closed + // Assert: the product form was opened and the dialog closed + expect(fakeLauncher.launchedUrls, ['https://world.openfoodfacts.org/cgi/product.pl']); expect(find.byType(AlertDialog), findsNothing); }, ); diff --git a/test/features/nutrition/widgets/nutritional_meal_form_test.dart b/test/features/nutrition/widgets/nutritional_meal_form_test.dart index 6e51548b1..3e4978d03 100644 --- a/test/features/nutrition/widgets/nutritional_meal_form_test.dart +++ b/test/features/nutrition/widgets/nutritional_meal_form_test.dart @@ -123,9 +123,12 @@ void main() { await tester.enterText(find.byKey(const Key('field-name')), 'test meal'); await tester.tap(find.byKey(const Key(SUBMIT_BUTTON_KEY_NAME))); - // Correct method was called - verify(mockRepo.editMealLocalDrift(any)); + // Correct method was called, with the typed name verifyNever(mockRepo.addMealLocalDrift(any)); + final meal = verify(mockRepo.editMealLocalDrift(captureAny)).captured.single as Meal; + expect(meal.id, testMealUuid1); + expect(meal.name, 'test meal'); + expect(meal.time, const TimeOfDay(hour: 17, minute: 0)); }); testWidgets('a new meal defaults to the current time', (WidgetTester tester) async { diff --git a/test/features/nutrition/widgets/nutritional_plan_form_test.dart b/test/features/nutrition/widgets/nutritional_plan_form_test.dart index 5f81d6802..6a8f53fd4 100644 --- a/test/features/nutrition/widgets/nutritional_plan_form_test.dart +++ b/test/features/nutrition/widgets/nutritional_plan_form_test.dart @@ -94,9 +94,11 @@ void main() { await tester.enterText(find.byKey(const Key('field-description')), 'New description'); await tester.tap(find.byKey(const Key(SUBMIT_BUTTON_KEY_NAME))); - // Correct method was called - verify(mockRepo.editLocalDrift(any)); + // Correct method was called, with the typed description verifyNever(mockRepo.addPlanLocalDrift(any)); + final saved = verify(mockRepo.editLocalDrift(captureAny)).captured.single as NutritionalPlan; + expect(saved.id, planUuid1); + expect(saved.description, 'New description'); }); testWidgets('Goal macros survive a no-op save in a comma-decimal locale', ( @@ -145,8 +147,10 @@ void main() { await tester.enterText(find.byKey(const Key('field-description')), 'New cool plan'); await tester.tap(find.byKey(const Key(SUBMIT_BUTTON_KEY_NAME))); - // Correct method was called + // Correct method was called, with the typed description verifyNever(mockRepo.editLocalDrift(any)); - verify(mockRepo.addPlanLocalDrift(any)); + final saved = verify(mockRepo.addPlanLocalDrift(captureAny)).captured.single as NutritionalPlan; + expect(saved.id, isNull); + expect(saved.description, 'New cool plan'); }); } diff --git a/test/features/routines/providers/routines_notifier_test.dart b/test/features/routines/providers/routines_notifier_test.dart index 6dac4e9a0..abbc08acd 100644 --- a/test/features/routines/providers/routines_notifier_test.dart +++ b/test/features/routines/providers/routines_notifier_test.dart @@ -596,48 +596,5 @@ void main() { expect(repoRead, true); verify(mockRepo.fetchAndSetRoutineFullServer(101)).called(1); }); - - test('watching the provider triggers a single structure fetch', () async { - // Arrange - when( - mockRepo.fetchAndSetRoutineFullServer(101), - ).thenAnswer((_) async => Routine(id: 101, name: 'Test routine')); - final container = ProviderContainer.test( - overrides: [ - routinesRepositoryProvider.overrideWithValue(mockRepo), - ...ambientOverrides(), - ], - ); - - // Act - container.listen(routineHydrationProvider(101), (_, _) {}); - await container.read(routineHydrationProvider(101).future); - - // Assert - verify(mockRepo.fetchAndSetRoutineFullServer(101)).called(1); - }); - - test('concurrent watchers of the same routine share one fetch', () async { - // Arrange - when( - mockRepo.fetchAndSetRoutineFullServer(101), - ).thenAnswer((_) async => Routine(id: 101, name: 'Test routine')); - final container = ProviderContainer.test( - overrides: [ - routinesRepositoryProvider.overrideWithValue(mockRepo), - ...ambientOverrides(), - ], - ); - - // Act: two readers of the same family instance. - container.listen(routineHydrationProvider(101), (_, _) {}); - await Future.wait([ - container.read(routineHydrationProvider(101).future), - container.read(routineHydrationProvider(101).future), - ]); - - // Assert: a single shared roundtrip, not one per reader. - verify(mockRepo.fetchAndSetRoutineFullServer(101)).called(1); - }); }); } diff --git a/test/features/routines/providers/routines_repository_test.dart b/test/features/routines/providers/routines_repository_test.dart index 0c36be209..f655ca191 100644 --- a/test/features/routines/providers/routines_repository_test.dart +++ b/test/features/routines/providers/routines_repository_test.dart @@ -79,10 +79,6 @@ void main() { // --------------------------------------------------------------------------- group('Routines, Drift', () { - test('watchAllDrift emits an empty list when no routines exist', () async { - expect(await repo.watchAllDrift().first, isEmpty); - }); - test('watchAllDrift sorts by start desc, then created desc', () async { // Two routines share a start date; the newer `created` should win. await seedRoutine( @@ -132,26 +128,6 @@ void main() { final emitted = await repo.watchAllDrift().first; expect(emitted.map((r) => r.id), [2]); }); - - test('watchWeightUnitsDrift emits seeded units', () async { - await db - .into(db.routineWeightUnitTable) - .insert(RoutineWeightUnitTableCompanion.insert(id: 1, name: 'kg')); - - final units = await repo.watchWeightUnitsDrift().first; - - expect(units.single.name, 'kg'); - }); - - test('watchRepetitionUnitsDrift emits seeded units', () async { - await db - .into(db.routineRepetitionUnitTable) - .insert(RoutineRepetitionUnitTableCompanion.insert(id: 1, name: 'Repetitions')); - - final units = await repo.watchRepetitionUnitsDrift().first; - - expect(units.single.name, 'Repetitions'); - }); }); group('Days, REST', () { @@ -237,9 +213,10 @@ void main() { when(mockBase.makeUrl('slot', id: 5)).thenReturn(uri); when(mockBase.patch(any, uri)).thenAnswer((_) async => {}); - await repo.editSlotServer(Slot.withData(id: 5, day: 1, order: 1)); + await repo.editSlotServer(Slot.withData(id: 5, day: 1, order: 2, comment: 'warm up')); - verify(mockBase.patch(any, uri)).called(1); + final sent = verify(mockBase.patch(captureAny, uri)).captured.single; + expect(sent, {'day': 1, 'order': 2, 'comment': 'warm up', 'config': null}); }); test('deleteSlotServer sends DELETE for /slot//', () async { @@ -309,7 +286,19 @@ void main() { await repo.editSlotEntryServer(makeEntry(id: 5)); - verify(mockBase.patch(any, uri)).called(1); + final sent = verify(mockBase.patch(captureAny, uri)).captured.single; + expect(sent, { + 'slot': 1, + 'order': 1, + 'comment': '', + 'type': 'normal', + 'exercise': 1, + 'repetition_unit': 1, + 'repetition_rounding': 1, + 'weight_unit': 1, + 'weight_rounding': 1.25, + 'config': null, + }); }); test('deleteSlotEntryServer sends DELETE for /slot-entry//', () async { @@ -358,6 +347,16 @@ void main() { await repo.addConfigServer(BaseConfig.firstIteration(5, 1), entry.key); verify(mockBase.makeUrl(entry.value)).called(1); + final sent = verify(mockBase.post(captureAny, uri)).captured.single; + expect(sent, { + 'slot_entry': 1, + 'iteration': 1, + 'value': 5, + 'operation': 'r', + 'step': 'abs', + 'repeat': false, + 'requirements': null, + }); }); } @@ -371,7 +370,9 @@ void main() { final result = await repo.editConfigServer(config, ConfigType.sets); expect(result.id, 3); - verify(mockBase.patch(any, uri)).called(1); + final sent = verify(mockBase.patch(captureAny, uri)).captured.single as Map; + expect(sent['slot_entry'], 1); + expect(sent['value'], 4); }); test('deleteConfigServer sends DELETE for ///', () async { @@ -424,7 +425,10 @@ void main() { await repo.handleConfigServer(entry, 5, ConfigType.sets); - verify(mockBase.patch(any, uri)).called(1); + // The new value replaces the old 3 on the existing config + final sent = verify(mockBase.patch(captureAny, uri)).captured.single as Map; + expect(sent['value'], 5); + expect(sent['slot_entry'], 1); }); test('value + no existing config → POST (add new)', () async { @@ -435,7 +439,17 @@ void main() { await repo.handleConfigServer(entry, 5, ConfigType.sets); - verify(mockBase.post(any, uri)).called(1); + // A first-iteration config for this entry, carrying the value + final sent = verify(mockBase.post(captureAny, uri)).captured.single; + expect(sent, { + 'slot_entry': 1, + 'iteration': 1, + 'value': 5, + 'operation': 'r', + 'step': 'abs', + 'repeat': false, + 'requirements': null, + }); }); test('value=null + no existing config → no-op', () async { @@ -479,6 +493,10 @@ void main() { id: 325397, name: 'Test workout', description: 'Test workout abcd', + created: DateTime.utc(2022, 10, 10, 8, 30), + start: DateTime(2021, 12, 20), + end: DateTime(2022, 6, 6), + fitInWeek: true, ), ); @@ -486,6 +504,20 @@ void main() { expect(plan, isA()); expect(plan.id, 325397); expect(plan.description, 'Test workout abcd'); + + // The id is server-assigned and stays out of the payload; the dates go + // out as plain days, `created` as a UTC timestamp + final sent = verify(mockBaseProvider.post(captureAny, uri)).captured.single; + expect(sent, { + 'created': '2022-10-10T08:30:00.000Z', + 'name': 'Test workout', + 'description': 'Test workout abcd', + 'fit_in_week': true, + 'is_template': false, + 'is_public': false, + 'start': '2021-12-20', + 'end': '2022-06-06', + }); }); test('Smoke test fetchAndSetRoutineFullServer', () async { diff --git a/test/features/routines/providers/workout_logs_repository_test.dart b/test/features/routines/providers/workout_logs_repository_test.dart index 49795c4b6..5942161fb 100644 --- a/test/features/routines/providers/workout_logs_repository_test.dart +++ b/test/features/routines/providers/workout_logs_repository_test.dart @@ -322,15 +322,6 @@ void main() { expect(await readLogs(), isEmpty); }); - - test('on a non-existent id is a no-op', () async { - final log = makeLog(sessionId: 'session-1'); - await repo.addLocalDrift(log); - - await repo.deleteLocalDrift('does-not-exist'); - - expect(await readLogs(), hasLength(1)); - }); }); group('watchLogsByExerciseDrift', () { diff --git a/test/features/routines/providers/workout_session_repository_test.dart b/test/features/routines/providers/workout_session_repository_test.dart index 5799e1548..b3a6d6d90 100644 --- a/test/features/routines/providers/workout_session_repository_test.dart +++ b/test/features/routines/providers/workout_session_repository_test.dart @@ -118,14 +118,6 @@ void main() { expect(await db.select(db.workoutSessionTable).get(), isEmpty); }); - - test('deleteLocalDrift on a non-existent id is a no-op', () async { - await repo.addLocalDrift(makeSession()); - - await repo.deleteLocalDrift('does-not-exist'); - - expect(await db.select(db.workoutSessionTable).get(), hasLength(1)); - }); }); group('watchAllDrift', () { diff --git a/test/features/routines/screens/routine_screen_test.dart b/test/features/routines/screens/routine_screen_test.dart index a6acf15a4..d18254de0 100644 --- a/test/features/routines/screens/routine_screen_test.dart +++ b/test/features/routines/screens/routine_screen_test.dart @@ -103,8 +103,8 @@ void main() { expect(find.text('second day'), findsOneWidget); expect(find.text('legs'), findsOneWidget); - expect(find.byType(Card), findsWidgets); - // expect(find.byType(Card), findsNWidgets(4)); + // One card per day of the routine + expect(find.byType(Card), findsNWidgets(2)); }, tags: ['golden'], ); diff --git a/test/features/routines/widgets/forms/repetition_unit_form_widget_test.dart b/test/features/routines/widgets/forms/repetition_unit_form_widget_test.dart index 201fd4bf7..0d569758c 100644 --- a/test/features/routines/widgets/forms/repetition_unit_form_widget_test.dart +++ b/test/features/routines/widgets/forms/repetition_unit_form_widget_test.dart @@ -20,7 +20,6 @@ import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:material_ui/material_ui.dart'; import 'package:wger/features/routines/models/repetition_unit.dart'; -import 'package:wger/features/routines/models/slot_entry.dart'; import 'package:wger/features/routines/providers/routines_notifier.dart'; import 'package:wger/features/routines/screens/routine_screen.dart'; import 'package:wger/features/routines/widgets/forms/repetitions.dart'; @@ -34,17 +33,6 @@ void main() { RepetitionUnit? result; - final slotEntry = SlotEntry( - slotId: 1, - exerciseId: 1, - repetitionUnitId: 1, - repetitionRounding: 0.25, - weightUnitId: 1, - weightRounding: 0.25, - comment: 'comment', - ); - slotEntry.repetitionUnitObj = unit1; - setUp(() { result = null; }); @@ -86,6 +74,11 @@ void main() { await tester.pumpWidget(renderWidget()); await tester.pump(); + // The passed unit is preselected, nothing is reported yet + expect(find.text('some rep unit'), findsOneWidget); + expect(find.text('another name'), findsNothing); + expect(result, isNull); + // act await tester.tap(find.byKey(const Key('1'))); await tester.pump(); diff --git a/test/features/routines/widgets/forms/session_form_test.dart b/test/features/routines/widgets/forms/session_form_test.dart index 0cca71f32..f564746ac 100644 --- a/test/features/routines/widgets/forms/session_form_test.dart +++ b/test/features/routines/widgets/forms/session_form_test.dart @@ -22,6 +22,7 @@ void main() { WidgetTester tester, { WorkoutSession? session, int routineId = 1, + int? dayId, Function()? onSaved, }) async { await pumpApp( @@ -30,6 +31,7 @@ void main() { body: SessionForm( routineId, session: session, + dayId: dayId, onSaved: onSaved, ), ), @@ -68,7 +70,12 @@ void main() { when(mockRepository.addLocalDrift(any)).thenAnswer( (inv) async => inv.positionalArguments.first as WorkoutSession, ); - await pumpSessionForm(tester, onSaved: () => onSavedCalled = true); + await pumpSessionForm( + tester, + routineId: 3, + dayId: 7, + onSaved: () => onSavedCalled = true, + ); // Act await tester.enterText(find.widgetWithText(TextFormField, 'Notes'), 'New session notes'); @@ -76,7 +83,12 @@ void main() { await tester.pumpAndSettle(); // Assert - verify(mockRepository.addLocalDrift(any)).called(1); + final captured = + verify(mockRepository.addLocalDrift(captureAny)).captured.single as WorkoutSession; + expect(captured.id, isNull); + expect(captured.routineId, 3); + expect(captured.dayId, 7); + expect(captured.notes, 'New session notes'); expect(onSavedCalled, isTrue); }); diff --git a/test/features/routines/widgets/forms/slot_entry_form_test.dart b/test/features/routines/widgets/forms/slot_entry_form_test.dart index 9e5e84d4f..b3475d9f9 100644 --- a/test/features/routines/widgets/forms/slot_entry_form_test.dart +++ b/test/features/routines/widgets/forms/slot_entry_form_test.dart @@ -103,9 +103,9 @@ void main() { await tester.pumpWidget(renderWidget(simpleMode: false)); await tester.pumpAndSettle(); - // Set weight + // Set weight (not 100, the fixture already prefills that) final weightField = find.byKey(const ValueKey('field-weight')); - await tester.enterText(weightField, '100'); + await tester.enterText(weightField, '105'); final maxWeightField = find.byKey(const ValueKey('field-max-weight')); await tester.enterText(maxWeightField, '110'); @@ -165,7 +165,7 @@ void main() { expect(capturedArgs[(0 * 3) + 1], 4); expect(capturedArgs[(0 * 3) + 2], ConfigType.sets); - expect(capturedArgs[(1 * 3) + 1], 100); + expect(capturedArgs[(1 * 3) + 1], 105); expect(capturedArgs[(1 * 3) + 2], ConfigType.weight); expect(capturedArgs[(2 * 3) + 1], 110); expect(capturedArgs[(2 * 3) + 2], ConfigType.maxWeight); diff --git a/test/features/routines/widgets/forms/weight_unit_form_widget_test.dart b/test/features/routines/widgets/forms/weight_unit_form_widget_test.dart index b94a9d7dc..b97f1cf09 100644 --- a/test/features/routines/widgets/forms/weight_unit_form_widget_test.dart +++ b/test/features/routines/widgets/forms/weight_unit_form_widget_test.dart @@ -19,7 +19,6 @@ import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:material_ui/material_ui.dart'; -import 'package:wger/features/routines/models/slot_entry.dart'; import 'package:wger/features/routines/models/weight_unit.dart'; import 'package:wger/features/routines/providers/routines_notifier.dart'; import 'package:wger/features/routines/screens/routine_screen.dart'; @@ -34,17 +33,6 @@ void main() { const unit2 = WeightUnit(id: 2, name: 'donkeys'); const unit3 = WeightUnit(id: 3, name: 'plates'); - final slotEntry = SlotEntry( - slotId: 1, - exerciseId: 1, - repetitionUnitId: 1, - repetitionRounding: 0.25, - weightUnitId: 1, - weightRounding: 0.25, - comment: 'comment', - ); - slotEntry.weightUnitObj = unit1; - setUp(() { result = null; }); @@ -79,8 +67,12 @@ void main() { await tester.pumpWidget(renderWidget()); await tester.pump(); + // The passed unit is preselected, nothing is reported yet + expect(find.text('kg'), findsOneWidget); + expect(find.text('donkeys'), findsNothing); + expect(result, isNull); + // act - expect(slotEntry.weightUnitObj, equals(unit1)); await tester.tap(find.byKey(const Key('1'))); await tester.pump(); await tester.tap(find.text('donkeys').last); diff --git a/test/features/routines/widgets/gym_mode/workout_menu_test.dart b/test/features/routines/widgets/gym_mode/workout_menu_test.dart index 646fcb950..6da7f65ec 100644 --- a/test/features/routines/widgets/gym_mode/workout_menu_test.dart +++ b/test/features/routines/widgets/gym_mode/workout_menu_test.dart @@ -67,6 +67,16 @@ void main() { await tester.pumpWidget(renderWidget()); + // One block per set page: the exercise name, one row per logged set, and + // a chevron to jump there. Nothing is done yet and the current page is + // the start page, so every row has the empty circle. + expect(find.text('Bench press'), findsOneWidget); + expect(find.text('3x100kg'), findsNWidgets(3)); + expect(find.text('Side raises'), findsOneWidget); + expect(find.text('12x10kg'), findsNWidgets(3)); + expect(find.byIcon(Icons.circle_outlined), findsNWidgets(6)); + expect(find.byIcon(Icons.chevron_right), findsNWidgets(2)); + if (Platform.isLinux) { await expectLater( find.byType(MaterialApp), diff --git a/test/features/trophies/models/trophy_test.dart b/test/features/trophies/models/trophy_test.dart deleted file mode 100644 index 429530765..000000000 --- a/test/features/trophies/models/trophy_test.dart +++ /dev/null @@ -1,72 +0,0 @@ -/* - * This file is part of wger Workout Manager . - * Copyright (c) 2025 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_test/flutter_test.dart'; -import 'package:wger/features/trophies/models/trophy.dart'; - -void main() { - group('Trophy model', () { - final sampleJson = { - 'id': 1, - 'uuid': '550e8400-e29b-41d4-a716-446655440000', - 'name': 'First Steps', - 'description': 'Awarded for the first workout', - 'image': 'https://example.org/trophy.png', - 'trophy_type': 'count', - 'is_hidden': false, - 'is_progressive': true, - }; - - test('fromJson creates valid Trophy instance', () { - final trophy = Trophy.fromJson(sampleJson); - - expect(trophy.id, 1); - expect(trophy.uuid, '550e8400-e29b-41d4-a716-446655440000'); - expect(trophy.name, 'First Steps'); - expect(trophy.description, 'Awarded for the first workout'); - expect(trophy.image, 'https://example.org/trophy.png'); - expect(trophy.type, TrophyType.count); - expect(trophy.isHidden, isFalse); - expect(trophy.isProgressive, isTrue); - }); - - test('toJson returns expected map', () { - final trophy = Trophy( - id: 2, - uuid: '00000000-0000-0000-0000-000000000000', - name: 'Progressor', - description: 'Progressive trophy', - image: 'https://example.org/prog.png', - type: TrophyType.time, - isHidden: true, - isProgressive: false, - ); - - final json = trophy.toJson(); - - expect(json['id'], 2); - expect(json['uuid'], '00000000-0000-0000-0000-000000000000'); - expect(json['name'], 'Progressor'); - expect(json['description'], 'Progressive trophy'); - expect(json['image'], 'https://example.org/prog.png'); - expect(json['trophy_type'], 'time'); - expect(json['is_hidden'], true); - expect(json['is_progressive'], false); - }); - }); -} diff --git a/test/features/trophies/models/user_trophy_progression_test.dart b/test/features/trophies/models/user_trophy_progression_test.dart index ded55368f..44baca900 100644 --- a/test/features/trophies/models/user_trophy_progression_test.dart +++ b/test/features/trophies/models/user_trophy_progression_test.dart @@ -17,7 +17,6 @@ */ import 'package:flutter_test/flutter_test.dart'; -import 'package:wger/features/trophies/models/trophy.dart'; import 'package:wger/features/trophies/models/user_trophy_progression.dart'; void main() { @@ -58,40 +57,5 @@ void main() { expect(utp.targetValue, 100); expect(utp.progressDisplay, '12.5/100'); }); - - test('toJson returns expected map', () { - final trophy = Trophy( - id: 2, - uuid: '00000000-0000-0000-0000-000000000000', - name: 'Progressor', - description: 'Progressive trophy', - image: 'https://example.org/prog.png', - type: TrophyType.time, - isHidden: true, - isProgressive: false, - ); - - final earnedAt = DateTime.parse('2020-01-02T15:04:05Z').toLocal(); - - final utp = UserTrophyProgression( - trophy: trophy, - isEarned: true, - earnedAt: earnedAt, - progress: 75, - currentValue: 75, - targetValue: 100, - progressDisplay: '75/100', - ); - - final json = utp.toJson(); - - expect(json['trophy'], same(trophy)); - expect(json['is_earned'], true); - expect(json['earned_at'], earnedAt.toIso8601String()); - expect(json['progress'], 75); - expect(json['current_value'], 75); - expect(json['target_value'], 100); - expect(json['progress_display'], '75/100'); - }); }); } diff --git a/test/features/trophies/providers/trophy_repository_test.dart b/test/features/trophies/providers/trophy_repository_test.dart index f81181de8..9d955170e 100644 --- a/test/features/trophies/providers/trophy_repository_test.dart +++ b/test/features/trophies/providers/trophy_repository_test.dart @@ -56,12 +56,25 @@ void main() { final result = await repository.fetchTrophies(); // Assert - expect(result, isA()); expect(result, hasLength(1)); final trophy = result.first; expect(trophy.id, 1); expect(trophy.name, 'First Steps'); expect(trophy.type.toString(), contains('count')); + + final urlArgs = verify( + mockBase.makeUrl( + captureAny, + id: anyNamed('id'), + objectMethod: anyNamed('objectMethod'), + query: captureAnyNamed('query'), + ), + ).captured; + expect(urlArgs, [ + 'trophy', + {'limit': '999'}, + ]); + verify(mockBase.fetchPaginated(Uri.parse('https://example.org/trophies'))).called(1); }); test('fetches list of user trophy progression', () async { @@ -78,14 +91,15 @@ void main() { final mockBase = MockWgerBaseProvider(); when(mockBase.fetch(any)).thenAnswer((_) async => [progressionJson]); - when(mockBase.makeUrl(any)).thenReturn(Uri.parse('https://example.org/user_progressions')); + when( + mockBase.makeUrl(any, query: anyNamed('query')), + ).thenReturn(Uri.parse('https://example.org/user_progressions')); final repository = TrophyRepository(mockBase); // Act - final result = await repository.fetchProgression(); + final result = await repository.fetchProgression(filterQuery: {'is_earned': 'true'}); // Assert - expect(result, isA()); expect(result, hasLength(1)); final p = result.first; expect(p.isEarned, isTrue); @@ -93,7 +107,14 @@ void main() { expect(p.currentValue, 12.5); expect(p.progressDisplay, '12.5/100'); - verify(mockBase.fetch(any)).called(1); + final urlArgs = verify( + mockBase.makeUrl(captureAny, query: captureAnyNamed('query')), + ).captured; + expect(urlArgs, [ + 'trophy/progress', + {'is_earned': 'true'}, + ]); + verify(mockBase.fetch(Uri.parse('https://example.org/user_progressions'))).called(1); }); }); }