diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml index 162625580..a0df6de83 100644 --- a/.github/workflows/build-release.yml +++ b/.github/workflows/build-release.yml @@ -26,7 +26,7 @@ jobs: uses: subosito/flutter-action@v2 with: channel: stable - flutter-version: 3.27.x + flutter-version: 3.29.x - name: Flutter info run: | diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 76f1074eb..8eb14605f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,7 +20,7 @@ jobs: with: cache: true channel: 'stable' - flutter-version: '3.27.x' + flutter-version: '3.29.x' - run: dart --version - run: flutter --version diff --git a/.gitignore b/.gitignore index 0df000b82..19df0622f 100644 --- a/.gitignore +++ b/.gitignore @@ -53,3 +53,4 @@ app.*.map.json # Others /vendor/bundle/ruby/ /coverage/ +/lib/l10n/generated/ diff --git a/Gemfile.lock b/Gemfile.lock index f8cc1530a..525e409e4 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -10,17 +10,18 @@ GEM public_suffix (>= 2.0.2, < 7.0) artifactory (3.0.17) atomos (0.1.3) - aws-eventstream (1.3.0) - aws-partitions (1.1042.0) - aws-sdk-core (3.216.1) + aws-eventstream (1.3.2) + aws-partitions (1.1065.0) + aws-sdk-core (3.220.1) aws-eventstream (~> 1, >= 1.3.0) aws-partitions (~> 1, >= 1.992.0) aws-sigv4 (~> 1.9) + base64 jmespath (~> 1, >= 1.6.1) - aws-sdk-kms (1.97.0) + aws-sdk-kms (1.99.0) aws-sdk-core (~> 3, >= 3.216.0) aws-sigv4 (~> 1.5) - aws-sdk-s3 (1.178.0) + aws-sdk-s3 (1.182.0) aws-sdk-core (~> 3, >= 3.216.0) aws-sdk-kms (~> 1) aws-sigv4 (~> 1.5) @@ -34,7 +35,7 @@ GEM commander (4.6.0) highline (~> 2.0.0) declarative (0.0.20) - digest-crc (0.6.5) + digest-crc (0.7.0) rake (>= 12.0.0, < 14.0.0) domain_name (0.6.20240107) dotenv (2.8.1) @@ -131,12 +132,12 @@ GEM google-apis-core (>= 0.11.0, < 2.a) google-apis-storage_v1 (0.31.0) google-apis-core (>= 0.11.0, < 2.a) - google-cloud-core (1.7.1) + google-cloud-core (1.8.0) google-cloud-env (>= 1.0, < 3.a) google-cloud-errors (~> 1.0) google-cloud-env (1.6.0) faraday (>= 0.17.3, < 3.0) - google-cloud-errors (1.4.0) + google-cloud-errors (1.5.0) google-cloud-storage (1.47.0) addressable (~> 2.8) digest-crc (~> 0.4) @@ -154,9 +155,10 @@ GEM highline (2.0.3) http-cookie (1.0.8) domain_name (~> 0.5) - httpclient (2.8.3) + httpclient (2.9.0) + mutex_m jmespath (1.6.2) - json (2.9.1) + json (2.10.2) jwt (2.10.1) base64 logger (1.6.5) @@ -178,7 +180,7 @@ GEM trailblazer-option (>= 0.1.1, < 0.2.0) uber (< 0.2.0) retriable (3.1.2) - rexml (3.4.0) + rexml (3.4.1) rouge (3.28.0) ruby2_keywords (0.0.5) rubyzip (2.4.1) diff --git a/README.md b/README.md index b739d3660..2e0d16b99 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Mobile app for wger Workout Manager +# Mobile app for wger wger is a free, open-source flutter application that manages and tracks/logs your exercises and personal workouts, weight, and diet plans. This is the mobile @@ -7,7 +7,7 @@ app written with Flutter, it talks via REST with the main server. If you want to contribute, hop on the Discord server and say hi! -

+

@@ -26,32 +26,17 @@ height="80">](https://f-droid.org/packages/de.wger.flutter/) ## Development -### 1 - -Install the [wger server](https://github.com/wger-project/wger), the easiest way -is to start the development docker-compose: - -Alternatively, you can use the test server (the db is reset every day): +This is a regular flutter application, so you basically just run `flutter run` in +the root directory of the project, and optionally use the test server to login +(the db is reset daily): * URL: `https://wger-master.rge.uber.space` * username: `user` * password: `flutteruser` -* API key: `31e2ea0322c07b9df583a9b6d1e794f7139e78d4` -### 2 +For more information consult the development documentation: -Install Flutter and all its dependencies, and create a new virtual device: -. - -The app currently uses flutter 3.27 - -### 3 - -Start the application with ``flutter run`` or use your IDE -(please note that depending on how you run your emulator you will need to change the IP address of -the server) - -You can run the tests with the ``flutter test`` + ## Translation diff --git a/android/app/build.gradle b/android/app/build.gradle index d12e201a4..b7dea1b8c 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -23,8 +23,8 @@ if (keystorePropertiesFile.exists()) { android { namespace = "de.wger.flutter" - compileSdkVersion 34 - ndkVersion "25.1.8937393" + compileSdkVersion 35 + ndkVersion "26.3.11579264" compileOptions { sourceCompatibility JavaVersion.VERSION_11 diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 9899c63c1..1e198ad9b 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -26,6 +26,7 @@ android:name="${applicationName}" android:label="wger" android:icon="@mipmap/ic_launcher" + android:enableOnBackInvokedCallback="true" android:networkSecurityConfig="@xml/network_security_config"> - -## 3. Push tags to trigger release - -Make sure that the commit that will be tagged was already pushed or didn't change -any dart code, otherwise the automatic linter might push a "correction" commit -and the build step will fail. - -Set the vX.Y.Z tag locally, push it and delete it. It will get recreated to X.Y.Z. -by github actions. - -`TAG=vX.Y.Z && git tag $TAG && git push origin $TAG && git tag -d $TAG` - -## 4. Edit release - -If necessary, edit the created release on github - -## 5. Merge pull requests - -* in the flathub - repo: https://github.com/flathub/de.wger.flutter/compare/master...wger-project:de.wger.flutter:master -* in the fork sync master https://github.com/wger-project/de.wger.flutter -* in the flutter repo: https://github.com/wger-project/flutter/branches \ No newline at end of file +Moved to \ No newline at end of file diff --git a/fastlane/metadata/android/ca/images/phoneScreenshots/01 - dashboard.png b/fastlane/metadata/android/ca/images/phoneScreenshots/01 - dashboard.png index c4859012e..311e1626b 100644 Binary files a/fastlane/metadata/android/ca/images/phoneScreenshots/01 - dashboard.png and b/fastlane/metadata/android/ca/images/phoneScreenshots/01 - dashboard.png differ diff --git a/fastlane/metadata/android/ca/images/phoneScreenshots/02 - workout detail.png b/fastlane/metadata/android/ca/images/phoneScreenshots/02 - workout detail.png index bbefe65c8..345db1459 100644 Binary files a/fastlane/metadata/android/ca/images/phoneScreenshots/02 - workout detail.png and b/fastlane/metadata/android/ca/images/phoneScreenshots/02 - workout detail.png differ diff --git a/fastlane/metadata/android/ca/images/phoneScreenshots/03 - gym mode.png b/fastlane/metadata/android/ca/images/phoneScreenshots/03 - gym mode.png index 8c7bd000a..eb41c2e14 100644 Binary files a/fastlane/metadata/android/ca/images/phoneScreenshots/03 - gym mode.png and b/fastlane/metadata/android/ca/images/phoneScreenshots/03 - gym mode.png differ diff --git a/fastlane/metadata/android/ca/images/phoneScreenshots/04 - measurements.png b/fastlane/metadata/android/ca/images/phoneScreenshots/04 - measurements.png index bd61f8d1f..1c8204a7b 100644 Binary files a/fastlane/metadata/android/ca/images/phoneScreenshots/04 - measurements.png and b/fastlane/metadata/android/ca/images/phoneScreenshots/04 - measurements.png differ diff --git a/fastlane/metadata/android/ca/images/phoneScreenshots/05 - nutritional plan.png b/fastlane/metadata/android/ca/images/phoneScreenshots/05 - nutritional plan.png index 9e3c76557..581f3e97a 100644 Binary files a/fastlane/metadata/android/ca/images/phoneScreenshots/05 - nutritional plan.png and b/fastlane/metadata/android/ca/images/phoneScreenshots/05 - nutritional plan.png differ diff --git a/fastlane/metadata/android/ca/images/phoneScreenshots/06 - weight.png b/fastlane/metadata/android/ca/images/phoneScreenshots/06 - weight.png index 2022b26c5..9838a3a73 100644 Binary files a/fastlane/metadata/android/ca/images/phoneScreenshots/06 - weight.png and b/fastlane/metadata/android/ca/images/phoneScreenshots/06 - weight.png differ diff --git a/fastlane/metadata/android/ca/images/sevenInchScreenshots/01 - dashboard.png b/fastlane/metadata/android/ca/images/sevenInchScreenshots/01 - dashboard.png index 0699a1e64..21eadcf47 100644 Binary files a/fastlane/metadata/android/ca/images/sevenInchScreenshots/01 - dashboard.png and b/fastlane/metadata/android/ca/images/sevenInchScreenshots/01 - dashboard.png differ diff --git a/fastlane/metadata/android/ca/images/sevenInchScreenshots/02 - workout detail.png b/fastlane/metadata/android/ca/images/sevenInchScreenshots/02 - workout detail.png index 50519d246..01b75bacc 100644 Binary files a/fastlane/metadata/android/ca/images/sevenInchScreenshots/02 - workout detail.png and b/fastlane/metadata/android/ca/images/sevenInchScreenshots/02 - workout detail.png differ diff --git a/fastlane/metadata/android/ca/images/sevenInchScreenshots/03 - gym mode.png b/fastlane/metadata/android/ca/images/sevenInchScreenshots/03 - gym mode.png index 2a151d9fb..f9e0626fc 100644 Binary files a/fastlane/metadata/android/ca/images/sevenInchScreenshots/03 - gym mode.png and b/fastlane/metadata/android/ca/images/sevenInchScreenshots/03 - gym mode.png differ diff --git a/fastlane/metadata/android/ca/images/sevenInchScreenshots/04 - measurements.png b/fastlane/metadata/android/ca/images/sevenInchScreenshots/04 - measurements.png index d58acda11..ba7d5eb68 100644 Binary files a/fastlane/metadata/android/ca/images/sevenInchScreenshots/04 - measurements.png and b/fastlane/metadata/android/ca/images/sevenInchScreenshots/04 - measurements.png differ diff --git a/fastlane/metadata/android/ca/images/sevenInchScreenshots/05 - nutritional plan.png b/fastlane/metadata/android/ca/images/sevenInchScreenshots/05 - nutritional plan.png index 5e1e20896..9218a1cdb 100644 Binary files a/fastlane/metadata/android/ca/images/sevenInchScreenshots/05 - nutritional plan.png and b/fastlane/metadata/android/ca/images/sevenInchScreenshots/05 - nutritional plan.png differ diff --git a/fastlane/metadata/android/ca/images/sevenInchScreenshots/06 - weight.png b/fastlane/metadata/android/ca/images/sevenInchScreenshots/06 - weight.png index 6bcd006f8..8f57de359 100644 Binary files a/fastlane/metadata/android/ca/images/sevenInchScreenshots/06 - weight.png and b/fastlane/metadata/android/ca/images/sevenInchScreenshots/06 - weight.png differ diff --git a/fastlane/metadata/android/ca/images/tenInchScreenshots/01 - dashboard.png b/fastlane/metadata/android/ca/images/tenInchScreenshots/01 - dashboard.png index 06031ac6d..40b3470bc 100644 Binary files a/fastlane/metadata/android/ca/images/tenInchScreenshots/01 - dashboard.png and b/fastlane/metadata/android/ca/images/tenInchScreenshots/01 - dashboard.png differ diff --git a/fastlane/metadata/android/ca/images/tenInchScreenshots/02 - workout detail.png b/fastlane/metadata/android/ca/images/tenInchScreenshots/02 - workout detail.png index b41a02ba0..9166a3527 100644 Binary files a/fastlane/metadata/android/ca/images/tenInchScreenshots/02 - workout detail.png and b/fastlane/metadata/android/ca/images/tenInchScreenshots/02 - workout detail.png differ diff --git a/fastlane/metadata/android/ca/images/tenInchScreenshots/03 - gym mode.png b/fastlane/metadata/android/ca/images/tenInchScreenshots/03 - gym mode.png index 368fb88ad..33ef8a94b 100644 Binary files a/fastlane/metadata/android/ca/images/tenInchScreenshots/03 - gym mode.png and b/fastlane/metadata/android/ca/images/tenInchScreenshots/03 - gym mode.png differ diff --git a/fastlane/metadata/android/ca/images/tenInchScreenshots/04 - measurements.png b/fastlane/metadata/android/ca/images/tenInchScreenshots/04 - measurements.png index 535d73796..7c6beafbf 100644 Binary files a/fastlane/metadata/android/ca/images/tenInchScreenshots/04 - measurements.png and b/fastlane/metadata/android/ca/images/tenInchScreenshots/04 - measurements.png differ diff --git a/fastlane/metadata/android/ca/images/tenInchScreenshots/05 - nutritional plan.png b/fastlane/metadata/android/ca/images/tenInchScreenshots/05 - nutritional plan.png index 090189b67..f93ca99a6 100644 Binary files a/fastlane/metadata/android/ca/images/tenInchScreenshots/05 - nutritional plan.png and b/fastlane/metadata/android/ca/images/tenInchScreenshots/05 - nutritional plan.png differ diff --git a/fastlane/metadata/android/ca/images/tenInchScreenshots/06 - weight.png b/fastlane/metadata/android/ca/images/tenInchScreenshots/06 - weight.png index 67533eabc..1641cbd0d 100644 Binary files a/fastlane/metadata/android/ca/images/tenInchScreenshots/06 - weight.png and b/fastlane/metadata/android/ca/images/tenInchScreenshots/06 - weight.png differ diff --git a/fastlane/metadata/android/cs-CZ/images/phoneScreenshots/01 - dashboard.png b/fastlane/metadata/android/cs-CZ/images/phoneScreenshots/01 - dashboard.png index 7577b1d07..901e1409e 100644 Binary files a/fastlane/metadata/android/cs-CZ/images/phoneScreenshots/01 - dashboard.png and b/fastlane/metadata/android/cs-CZ/images/phoneScreenshots/01 - dashboard.png differ diff --git a/fastlane/metadata/android/cs-CZ/images/phoneScreenshots/02 - workout detail.png b/fastlane/metadata/android/cs-CZ/images/phoneScreenshots/02 - workout detail.png index 33b92d7e5..345db1459 100644 Binary files a/fastlane/metadata/android/cs-CZ/images/phoneScreenshots/02 - workout detail.png and b/fastlane/metadata/android/cs-CZ/images/phoneScreenshots/02 - workout detail.png differ diff --git a/fastlane/metadata/android/cs-CZ/images/phoneScreenshots/03 - gym mode.png b/fastlane/metadata/android/cs-CZ/images/phoneScreenshots/03 - gym mode.png index 1d358c33c..0c0318c1b 100644 Binary files a/fastlane/metadata/android/cs-CZ/images/phoneScreenshots/03 - gym mode.png and b/fastlane/metadata/android/cs-CZ/images/phoneScreenshots/03 - gym mode.png differ diff --git a/fastlane/metadata/android/cs-CZ/images/phoneScreenshots/04 - measurements.png b/fastlane/metadata/android/cs-CZ/images/phoneScreenshots/04 - measurements.png index 54d6893e5..d9f943b04 100644 Binary files a/fastlane/metadata/android/cs-CZ/images/phoneScreenshots/04 - measurements.png and b/fastlane/metadata/android/cs-CZ/images/phoneScreenshots/04 - measurements.png differ diff --git a/fastlane/metadata/android/cs-CZ/images/phoneScreenshots/05 - nutritional plan.png b/fastlane/metadata/android/cs-CZ/images/phoneScreenshots/05 - nutritional plan.png index 7d9bb18ea..82ec4ead7 100644 Binary files a/fastlane/metadata/android/cs-CZ/images/phoneScreenshots/05 - nutritional plan.png and b/fastlane/metadata/android/cs-CZ/images/phoneScreenshots/05 - nutritional plan.png differ diff --git a/fastlane/metadata/android/cs-CZ/images/phoneScreenshots/06 - weight.png b/fastlane/metadata/android/cs-CZ/images/phoneScreenshots/06 - weight.png index d8ccd2790..107fc14c6 100644 Binary files a/fastlane/metadata/android/cs-CZ/images/phoneScreenshots/06 - weight.png and b/fastlane/metadata/android/cs-CZ/images/phoneScreenshots/06 - weight.png differ diff --git a/fastlane/metadata/android/cs-CZ/images/sevenInchScreenshots/01 - dashboard.png b/fastlane/metadata/android/cs-CZ/images/sevenInchScreenshots/01 - dashboard.png index 56fa63133..93fdc25af 100644 Binary files a/fastlane/metadata/android/cs-CZ/images/sevenInchScreenshots/01 - dashboard.png and b/fastlane/metadata/android/cs-CZ/images/sevenInchScreenshots/01 - dashboard.png differ diff --git a/fastlane/metadata/android/cs-CZ/images/sevenInchScreenshots/02 - workout detail.png b/fastlane/metadata/android/cs-CZ/images/sevenInchScreenshots/02 - workout detail.png index 1a8ef29a3..01b75bacc 100644 Binary files a/fastlane/metadata/android/cs-CZ/images/sevenInchScreenshots/02 - workout detail.png and b/fastlane/metadata/android/cs-CZ/images/sevenInchScreenshots/02 - workout detail.png differ diff --git a/fastlane/metadata/android/cs-CZ/images/sevenInchScreenshots/03 - gym mode.png b/fastlane/metadata/android/cs-CZ/images/sevenInchScreenshots/03 - gym mode.png index 78086b03a..bcd7fd913 100644 Binary files a/fastlane/metadata/android/cs-CZ/images/sevenInchScreenshots/03 - gym mode.png and b/fastlane/metadata/android/cs-CZ/images/sevenInchScreenshots/03 - gym mode.png differ diff --git a/fastlane/metadata/android/cs-CZ/images/sevenInchScreenshots/04 - measurements.png b/fastlane/metadata/android/cs-CZ/images/sevenInchScreenshots/04 - measurements.png index e6c581b4b..177ad432e 100644 Binary files a/fastlane/metadata/android/cs-CZ/images/sevenInchScreenshots/04 - measurements.png and b/fastlane/metadata/android/cs-CZ/images/sevenInchScreenshots/04 - measurements.png differ diff --git a/fastlane/metadata/android/cs-CZ/images/sevenInchScreenshots/05 - nutritional plan.png b/fastlane/metadata/android/cs-CZ/images/sevenInchScreenshots/05 - nutritional plan.png index e1875f011..b635041f8 100644 Binary files a/fastlane/metadata/android/cs-CZ/images/sevenInchScreenshots/05 - nutritional plan.png and b/fastlane/metadata/android/cs-CZ/images/sevenInchScreenshots/05 - nutritional plan.png differ diff --git a/fastlane/metadata/android/cs-CZ/images/sevenInchScreenshots/06 - weight.png b/fastlane/metadata/android/cs-CZ/images/sevenInchScreenshots/06 - weight.png index 05d4559f8..926940c25 100644 Binary files a/fastlane/metadata/android/cs-CZ/images/sevenInchScreenshots/06 - weight.png and b/fastlane/metadata/android/cs-CZ/images/sevenInchScreenshots/06 - weight.png differ diff --git a/fastlane/metadata/android/cs-CZ/images/tenInchScreenshots/01 - dashboard.png b/fastlane/metadata/android/cs-CZ/images/tenInchScreenshots/01 - dashboard.png index 5653a08bb..6ed500db6 100644 Binary files a/fastlane/metadata/android/cs-CZ/images/tenInchScreenshots/01 - dashboard.png and b/fastlane/metadata/android/cs-CZ/images/tenInchScreenshots/01 - dashboard.png differ diff --git a/fastlane/metadata/android/cs-CZ/images/tenInchScreenshots/02 - workout detail.png b/fastlane/metadata/android/cs-CZ/images/tenInchScreenshots/02 - workout detail.png index a8d5bf544..9166a3527 100644 Binary files a/fastlane/metadata/android/cs-CZ/images/tenInchScreenshots/02 - workout detail.png and b/fastlane/metadata/android/cs-CZ/images/tenInchScreenshots/02 - workout detail.png differ diff --git a/fastlane/metadata/android/cs-CZ/images/tenInchScreenshots/03 - gym mode.png b/fastlane/metadata/android/cs-CZ/images/tenInchScreenshots/03 - gym mode.png index 2a9badc87..6ec234624 100644 Binary files a/fastlane/metadata/android/cs-CZ/images/tenInchScreenshots/03 - gym mode.png and b/fastlane/metadata/android/cs-CZ/images/tenInchScreenshots/03 - gym mode.png differ diff --git a/fastlane/metadata/android/cs-CZ/images/tenInchScreenshots/04 - measurements.png b/fastlane/metadata/android/cs-CZ/images/tenInchScreenshots/04 - measurements.png index b5a5ed95b..d378343d1 100644 Binary files a/fastlane/metadata/android/cs-CZ/images/tenInchScreenshots/04 - measurements.png and b/fastlane/metadata/android/cs-CZ/images/tenInchScreenshots/04 - measurements.png differ diff --git a/fastlane/metadata/android/cs-CZ/images/tenInchScreenshots/05 - nutritional plan.png b/fastlane/metadata/android/cs-CZ/images/tenInchScreenshots/05 - nutritional plan.png index e6f0689db..93e61cbc9 100644 Binary files a/fastlane/metadata/android/cs-CZ/images/tenInchScreenshots/05 - nutritional plan.png and b/fastlane/metadata/android/cs-CZ/images/tenInchScreenshots/05 - nutritional plan.png differ diff --git a/fastlane/metadata/android/cs-CZ/images/tenInchScreenshots/06 - weight.png b/fastlane/metadata/android/cs-CZ/images/tenInchScreenshots/06 - weight.png index 7a8b6dddd..95674f9ef 100644 Binary files a/fastlane/metadata/android/cs-CZ/images/tenInchScreenshots/06 - weight.png and b/fastlane/metadata/android/cs-CZ/images/tenInchScreenshots/06 - weight.png differ diff --git a/fastlane/metadata/android/de-DE/images/phoneScreenshots/01 - dashboard.png b/fastlane/metadata/android/de-DE/images/phoneScreenshots/01 - dashboard.png index e0516161f..8f2782046 100644 Binary files a/fastlane/metadata/android/de-DE/images/phoneScreenshots/01 - dashboard.png and b/fastlane/metadata/android/de-DE/images/phoneScreenshots/01 - dashboard.png differ diff --git a/fastlane/metadata/android/de-DE/images/phoneScreenshots/02 - workout detail.png b/fastlane/metadata/android/de-DE/images/phoneScreenshots/02 - workout detail.png index 05579cc1f..7a73883ee 100644 Binary files a/fastlane/metadata/android/de-DE/images/phoneScreenshots/02 - workout detail.png and b/fastlane/metadata/android/de-DE/images/phoneScreenshots/02 - workout detail.png differ diff --git a/fastlane/metadata/android/de-DE/images/phoneScreenshots/03 - gym mode.png b/fastlane/metadata/android/de-DE/images/phoneScreenshots/03 - gym mode.png index 01da793d9..81e9e63fe 100644 Binary files a/fastlane/metadata/android/de-DE/images/phoneScreenshots/03 - gym mode.png and b/fastlane/metadata/android/de-DE/images/phoneScreenshots/03 - gym mode.png differ diff --git a/fastlane/metadata/android/de-DE/images/phoneScreenshots/04 - measurements.png b/fastlane/metadata/android/de-DE/images/phoneScreenshots/04 - measurements.png index 438171b50..e802f607c 100644 Binary files a/fastlane/metadata/android/de-DE/images/phoneScreenshots/04 - measurements.png and b/fastlane/metadata/android/de-DE/images/phoneScreenshots/04 - measurements.png differ diff --git a/fastlane/metadata/android/de-DE/images/phoneScreenshots/05 - nutritional plan.png b/fastlane/metadata/android/de-DE/images/phoneScreenshots/05 - nutritional plan.png index 2d4e910cd..49dfb5ca6 100644 Binary files a/fastlane/metadata/android/de-DE/images/phoneScreenshots/05 - nutritional plan.png and b/fastlane/metadata/android/de-DE/images/phoneScreenshots/05 - nutritional plan.png differ diff --git a/fastlane/metadata/android/de-DE/images/phoneScreenshots/06 - weight.png b/fastlane/metadata/android/de-DE/images/phoneScreenshots/06 - weight.png index 83d2df98a..5c8824f1a 100644 Binary files a/fastlane/metadata/android/de-DE/images/phoneScreenshots/06 - weight.png and b/fastlane/metadata/android/de-DE/images/phoneScreenshots/06 - weight.png differ diff --git a/fastlane/metadata/android/de-DE/images/sevenInchScreenshots/01 - dashboard.png b/fastlane/metadata/android/de-DE/images/sevenInchScreenshots/01 - dashboard.png index 7a5177c73..47eb4e398 100644 Binary files a/fastlane/metadata/android/de-DE/images/sevenInchScreenshots/01 - dashboard.png and b/fastlane/metadata/android/de-DE/images/sevenInchScreenshots/01 - dashboard.png differ diff --git a/fastlane/metadata/android/de-DE/images/sevenInchScreenshots/02 - workout detail.png b/fastlane/metadata/android/de-DE/images/sevenInchScreenshots/02 - workout detail.png index 6b528352d..d812e4e5e 100644 Binary files a/fastlane/metadata/android/de-DE/images/sevenInchScreenshots/02 - workout detail.png and b/fastlane/metadata/android/de-DE/images/sevenInchScreenshots/02 - workout detail.png differ diff --git a/fastlane/metadata/android/de-DE/images/sevenInchScreenshots/03 - gym mode.png b/fastlane/metadata/android/de-DE/images/sevenInchScreenshots/03 - gym mode.png index ad63db9cb..cfabd431a 100644 Binary files a/fastlane/metadata/android/de-DE/images/sevenInchScreenshots/03 - gym mode.png and b/fastlane/metadata/android/de-DE/images/sevenInchScreenshots/03 - gym mode.png differ diff --git a/fastlane/metadata/android/de-DE/images/sevenInchScreenshots/04 - measurements.png b/fastlane/metadata/android/de-DE/images/sevenInchScreenshots/04 - measurements.png index 3e9208764..e832911e8 100644 Binary files a/fastlane/metadata/android/de-DE/images/sevenInchScreenshots/04 - measurements.png and b/fastlane/metadata/android/de-DE/images/sevenInchScreenshots/04 - measurements.png differ diff --git a/fastlane/metadata/android/de-DE/images/sevenInchScreenshots/05 - nutritional plan.png b/fastlane/metadata/android/de-DE/images/sevenInchScreenshots/05 - nutritional plan.png index 48861b91d..d8d13c999 100644 Binary files a/fastlane/metadata/android/de-DE/images/sevenInchScreenshots/05 - nutritional plan.png and b/fastlane/metadata/android/de-DE/images/sevenInchScreenshots/05 - nutritional plan.png differ diff --git a/fastlane/metadata/android/de-DE/images/sevenInchScreenshots/06 - weight.png b/fastlane/metadata/android/de-DE/images/sevenInchScreenshots/06 - weight.png index 5cdc24566..06be8b2ca 100644 Binary files a/fastlane/metadata/android/de-DE/images/sevenInchScreenshots/06 - weight.png and b/fastlane/metadata/android/de-DE/images/sevenInchScreenshots/06 - weight.png differ diff --git a/fastlane/metadata/android/de-DE/images/tenInchScreenshots/01 - dashboard.png b/fastlane/metadata/android/de-DE/images/tenInchScreenshots/01 - dashboard.png index 4ba14a656..b07dd63ad 100644 Binary files a/fastlane/metadata/android/de-DE/images/tenInchScreenshots/01 - dashboard.png and b/fastlane/metadata/android/de-DE/images/tenInchScreenshots/01 - dashboard.png differ diff --git a/fastlane/metadata/android/de-DE/images/tenInchScreenshots/02 - workout detail.png b/fastlane/metadata/android/de-DE/images/tenInchScreenshots/02 - workout detail.png index 297ad2ed5..cb4afa9df 100644 Binary files a/fastlane/metadata/android/de-DE/images/tenInchScreenshots/02 - workout detail.png and b/fastlane/metadata/android/de-DE/images/tenInchScreenshots/02 - workout detail.png differ diff --git a/fastlane/metadata/android/de-DE/images/tenInchScreenshots/03 - gym mode.png b/fastlane/metadata/android/de-DE/images/tenInchScreenshots/03 - gym mode.png index b0d62e234..7652081f6 100644 Binary files a/fastlane/metadata/android/de-DE/images/tenInchScreenshots/03 - gym mode.png and b/fastlane/metadata/android/de-DE/images/tenInchScreenshots/03 - gym mode.png differ diff --git a/fastlane/metadata/android/de-DE/images/tenInchScreenshots/04 - measurements.png b/fastlane/metadata/android/de-DE/images/tenInchScreenshots/04 - measurements.png index 5969a2819..49ca2fce5 100644 Binary files a/fastlane/metadata/android/de-DE/images/tenInchScreenshots/04 - measurements.png and b/fastlane/metadata/android/de-DE/images/tenInchScreenshots/04 - measurements.png differ diff --git a/fastlane/metadata/android/de-DE/images/tenInchScreenshots/05 - nutritional plan.png b/fastlane/metadata/android/de-DE/images/tenInchScreenshots/05 - nutritional plan.png index 7b3088bec..3dbc4e2c3 100644 Binary files a/fastlane/metadata/android/de-DE/images/tenInchScreenshots/05 - nutritional plan.png and b/fastlane/metadata/android/de-DE/images/tenInchScreenshots/05 - nutritional plan.png differ diff --git a/fastlane/metadata/android/de-DE/images/tenInchScreenshots/06 - weight.png b/fastlane/metadata/android/de-DE/images/tenInchScreenshots/06 - weight.png index eb2154ae5..d759d1c1e 100644 Binary files a/fastlane/metadata/android/de-DE/images/tenInchScreenshots/06 - weight.png and b/fastlane/metadata/android/de-DE/images/tenInchScreenshots/06 - weight.png differ diff --git a/fastlane/metadata/android/el-GR/images/phoneScreenshots/01 - dashboard.png b/fastlane/metadata/android/el-GR/images/phoneScreenshots/01 - dashboard.png index 4050df89c..688940bff 100644 Binary files a/fastlane/metadata/android/el-GR/images/phoneScreenshots/01 - dashboard.png and b/fastlane/metadata/android/el-GR/images/phoneScreenshots/01 - dashboard.png differ diff --git a/fastlane/metadata/android/el-GR/images/phoneScreenshots/02 - workout detail.png b/fastlane/metadata/android/el-GR/images/phoneScreenshots/02 - workout detail.png index 79ef22b0b..4322651a3 100644 Binary files a/fastlane/metadata/android/el-GR/images/phoneScreenshots/02 - workout detail.png and b/fastlane/metadata/android/el-GR/images/phoneScreenshots/02 - workout detail.png differ diff --git a/fastlane/metadata/android/el-GR/images/phoneScreenshots/03 - gym mode.png b/fastlane/metadata/android/el-GR/images/phoneScreenshots/03 - gym mode.png index c9c4403c4..664104112 100644 Binary files a/fastlane/metadata/android/el-GR/images/phoneScreenshots/03 - gym mode.png and b/fastlane/metadata/android/el-GR/images/phoneScreenshots/03 - gym mode.png differ diff --git a/fastlane/metadata/android/el-GR/images/phoneScreenshots/04 - measurements.png b/fastlane/metadata/android/el-GR/images/phoneScreenshots/04 - measurements.png index 1876b9664..5fd85afbe 100644 Binary files a/fastlane/metadata/android/el-GR/images/phoneScreenshots/04 - measurements.png and b/fastlane/metadata/android/el-GR/images/phoneScreenshots/04 - measurements.png differ diff --git a/fastlane/metadata/android/el-GR/images/phoneScreenshots/05 - nutritional plan.png b/fastlane/metadata/android/el-GR/images/phoneScreenshots/05 - nutritional plan.png index 167a30965..5cf32eb58 100644 Binary files a/fastlane/metadata/android/el-GR/images/phoneScreenshots/05 - nutritional plan.png and b/fastlane/metadata/android/el-GR/images/phoneScreenshots/05 - nutritional plan.png differ diff --git a/fastlane/metadata/android/el-GR/images/phoneScreenshots/06 - weight.png b/fastlane/metadata/android/el-GR/images/phoneScreenshots/06 - weight.png index 3862bef0e..81d55fe94 100644 Binary files a/fastlane/metadata/android/el-GR/images/phoneScreenshots/06 - weight.png and b/fastlane/metadata/android/el-GR/images/phoneScreenshots/06 - weight.png differ diff --git a/fastlane/metadata/android/el-GR/images/sevenInchScreenshots/01 - dashboard.png b/fastlane/metadata/android/el-GR/images/sevenInchScreenshots/01 - dashboard.png index 2dc921b5b..485145c35 100644 Binary files a/fastlane/metadata/android/el-GR/images/sevenInchScreenshots/01 - dashboard.png and b/fastlane/metadata/android/el-GR/images/sevenInchScreenshots/01 - dashboard.png differ diff --git a/fastlane/metadata/android/el-GR/images/sevenInchScreenshots/02 - workout detail.png b/fastlane/metadata/android/el-GR/images/sevenInchScreenshots/02 - workout detail.png index 4c243f1d1..4c88b53fc 100644 Binary files a/fastlane/metadata/android/el-GR/images/sevenInchScreenshots/02 - workout detail.png and b/fastlane/metadata/android/el-GR/images/sevenInchScreenshots/02 - workout detail.png differ diff --git a/fastlane/metadata/android/el-GR/images/sevenInchScreenshots/03 - gym mode.png b/fastlane/metadata/android/el-GR/images/sevenInchScreenshots/03 - gym mode.png index 686db3937..907c4648e 100644 Binary files a/fastlane/metadata/android/el-GR/images/sevenInchScreenshots/03 - gym mode.png and b/fastlane/metadata/android/el-GR/images/sevenInchScreenshots/03 - gym mode.png differ diff --git a/fastlane/metadata/android/el-GR/images/sevenInchScreenshots/04 - measurements.png b/fastlane/metadata/android/el-GR/images/sevenInchScreenshots/04 - measurements.png index 53243ffac..503f8279e 100644 Binary files a/fastlane/metadata/android/el-GR/images/sevenInchScreenshots/04 - measurements.png and b/fastlane/metadata/android/el-GR/images/sevenInchScreenshots/04 - measurements.png differ diff --git a/fastlane/metadata/android/el-GR/images/sevenInchScreenshots/05 - nutritional plan.png b/fastlane/metadata/android/el-GR/images/sevenInchScreenshots/05 - nutritional plan.png index 12de51f6f..3080e412f 100644 Binary files a/fastlane/metadata/android/el-GR/images/sevenInchScreenshots/05 - nutritional plan.png and b/fastlane/metadata/android/el-GR/images/sevenInchScreenshots/05 - nutritional plan.png differ diff --git a/fastlane/metadata/android/el-GR/images/sevenInchScreenshots/06 - weight.png b/fastlane/metadata/android/el-GR/images/sevenInchScreenshots/06 - weight.png index e2df023f4..5391f9717 100644 Binary files a/fastlane/metadata/android/el-GR/images/sevenInchScreenshots/06 - weight.png and b/fastlane/metadata/android/el-GR/images/sevenInchScreenshots/06 - weight.png differ diff --git a/fastlane/metadata/android/el-GR/images/tenInchScreenshots/01 - dashboard.png b/fastlane/metadata/android/el-GR/images/tenInchScreenshots/01 - dashboard.png index 6cb991ed8..f33782007 100644 Binary files a/fastlane/metadata/android/el-GR/images/tenInchScreenshots/01 - dashboard.png and b/fastlane/metadata/android/el-GR/images/tenInchScreenshots/01 - dashboard.png differ diff --git a/fastlane/metadata/android/el-GR/images/tenInchScreenshots/02 - workout detail.png b/fastlane/metadata/android/el-GR/images/tenInchScreenshots/02 - workout detail.png index 1215c110e..7bc8d52cb 100644 Binary files a/fastlane/metadata/android/el-GR/images/tenInchScreenshots/02 - workout detail.png and b/fastlane/metadata/android/el-GR/images/tenInchScreenshots/02 - workout detail.png differ diff --git a/fastlane/metadata/android/el-GR/images/tenInchScreenshots/03 - gym mode.png b/fastlane/metadata/android/el-GR/images/tenInchScreenshots/03 - gym mode.png index 2b02c90ac..2227ee157 100644 Binary files a/fastlane/metadata/android/el-GR/images/tenInchScreenshots/03 - gym mode.png and b/fastlane/metadata/android/el-GR/images/tenInchScreenshots/03 - gym mode.png differ diff --git a/fastlane/metadata/android/el-GR/images/tenInchScreenshots/04 - measurements.png b/fastlane/metadata/android/el-GR/images/tenInchScreenshots/04 - measurements.png index 070082c55..d27d12207 100644 Binary files a/fastlane/metadata/android/el-GR/images/tenInchScreenshots/04 - measurements.png and b/fastlane/metadata/android/el-GR/images/tenInchScreenshots/04 - measurements.png differ diff --git a/fastlane/metadata/android/el-GR/images/tenInchScreenshots/05 - nutritional plan.png b/fastlane/metadata/android/el-GR/images/tenInchScreenshots/05 - nutritional plan.png index b96103f3f..10fd0b799 100644 Binary files a/fastlane/metadata/android/el-GR/images/tenInchScreenshots/05 - nutritional plan.png and b/fastlane/metadata/android/el-GR/images/tenInchScreenshots/05 - nutritional plan.png differ diff --git a/fastlane/metadata/android/el-GR/images/tenInchScreenshots/06 - weight.png b/fastlane/metadata/android/el-GR/images/tenInchScreenshots/06 - weight.png index 23d86ba89..5e0e13519 100644 Binary files a/fastlane/metadata/android/el-GR/images/tenInchScreenshots/06 - weight.png and b/fastlane/metadata/android/el-GR/images/tenInchScreenshots/06 - weight.png differ diff --git a/fastlane/metadata/android/en-US/images/phoneScreenshots/01 - dashboard.png b/fastlane/metadata/android/en-US/images/phoneScreenshots/01 - dashboard.png index 20cefcd14..8684175d0 100644 Binary files a/fastlane/metadata/android/en-US/images/phoneScreenshots/01 - dashboard.png and b/fastlane/metadata/android/en-US/images/phoneScreenshots/01 - dashboard.png differ diff --git a/fastlane/metadata/android/en-US/images/phoneScreenshots/02 - workout detail.png b/fastlane/metadata/android/en-US/images/phoneScreenshots/02 - workout detail.png index bfb62a999..345db1459 100644 Binary files a/fastlane/metadata/android/en-US/images/phoneScreenshots/02 - workout detail.png and b/fastlane/metadata/android/en-US/images/phoneScreenshots/02 - workout detail.png differ diff --git a/fastlane/metadata/android/en-US/images/phoneScreenshots/03 - gym mode.png b/fastlane/metadata/android/en-US/images/phoneScreenshots/03 - gym mode.png index aa5430647..de51f40ed 100644 Binary files a/fastlane/metadata/android/en-US/images/phoneScreenshots/03 - gym mode.png and b/fastlane/metadata/android/en-US/images/phoneScreenshots/03 - gym mode.png differ diff --git a/fastlane/metadata/android/en-US/images/phoneScreenshots/04 - measurements.png b/fastlane/metadata/android/en-US/images/phoneScreenshots/04 - measurements.png index c37b78db7..7bc613ca5 100644 Binary files a/fastlane/metadata/android/en-US/images/phoneScreenshots/04 - measurements.png and b/fastlane/metadata/android/en-US/images/phoneScreenshots/04 - measurements.png differ diff --git a/fastlane/metadata/android/en-US/images/phoneScreenshots/05 - nutritional plan.png b/fastlane/metadata/android/en-US/images/phoneScreenshots/05 - nutritional plan.png index fccd30e84..a17be360b 100644 Binary files a/fastlane/metadata/android/en-US/images/phoneScreenshots/05 - nutritional plan.png and b/fastlane/metadata/android/en-US/images/phoneScreenshots/05 - nutritional plan.png differ diff --git a/fastlane/metadata/android/en-US/images/phoneScreenshots/06 - weight.png b/fastlane/metadata/android/en-US/images/phoneScreenshots/06 - weight.png index 8d76c0dd3..4a16c4442 100644 Binary files a/fastlane/metadata/android/en-US/images/phoneScreenshots/06 - weight.png and b/fastlane/metadata/android/en-US/images/phoneScreenshots/06 - weight.png differ diff --git a/fastlane/metadata/android/en-US/images/sevenInchScreenshots/01 - dashboard.png b/fastlane/metadata/android/en-US/images/sevenInchScreenshots/01 - dashboard.png index c6d258ceb..0f59f52dc 100644 Binary files a/fastlane/metadata/android/en-US/images/sevenInchScreenshots/01 - dashboard.png and b/fastlane/metadata/android/en-US/images/sevenInchScreenshots/01 - dashboard.png differ diff --git a/fastlane/metadata/android/en-US/images/sevenInchScreenshots/02 - workout detail.png b/fastlane/metadata/android/en-US/images/sevenInchScreenshots/02 - workout detail.png index 572dd06ed..01b75bacc 100644 Binary files a/fastlane/metadata/android/en-US/images/sevenInchScreenshots/02 - workout detail.png and b/fastlane/metadata/android/en-US/images/sevenInchScreenshots/02 - workout detail.png differ diff --git a/fastlane/metadata/android/en-US/images/sevenInchScreenshots/03 - gym mode.png b/fastlane/metadata/android/en-US/images/sevenInchScreenshots/03 - gym mode.png index e03358bd9..f4ec012b5 100644 Binary files a/fastlane/metadata/android/en-US/images/sevenInchScreenshots/03 - gym mode.png and b/fastlane/metadata/android/en-US/images/sevenInchScreenshots/03 - gym mode.png differ diff --git a/fastlane/metadata/android/en-US/images/sevenInchScreenshots/04 - measurements.png b/fastlane/metadata/android/en-US/images/sevenInchScreenshots/04 - measurements.png index dfc1e6474..84d5c4734 100644 Binary files a/fastlane/metadata/android/en-US/images/sevenInchScreenshots/04 - measurements.png and b/fastlane/metadata/android/en-US/images/sevenInchScreenshots/04 - measurements.png differ diff --git a/fastlane/metadata/android/en-US/images/sevenInchScreenshots/05 - nutritional plan.png b/fastlane/metadata/android/en-US/images/sevenInchScreenshots/05 - nutritional plan.png index decdb0a9f..d5fc88832 100644 Binary files a/fastlane/metadata/android/en-US/images/sevenInchScreenshots/05 - nutritional plan.png and b/fastlane/metadata/android/en-US/images/sevenInchScreenshots/05 - nutritional plan.png differ diff --git a/fastlane/metadata/android/en-US/images/sevenInchScreenshots/06 - weight.png b/fastlane/metadata/android/en-US/images/sevenInchScreenshots/06 - weight.png index 98469d7e4..e6b4f4c20 100644 Binary files a/fastlane/metadata/android/en-US/images/sevenInchScreenshots/06 - weight.png and b/fastlane/metadata/android/en-US/images/sevenInchScreenshots/06 - weight.png differ diff --git a/fastlane/metadata/android/en-US/images/tenInchScreenshots/01 - dashboard.png b/fastlane/metadata/android/en-US/images/tenInchScreenshots/01 - dashboard.png index 79edc0409..4cf8833a4 100644 Binary files a/fastlane/metadata/android/en-US/images/tenInchScreenshots/01 - dashboard.png and b/fastlane/metadata/android/en-US/images/tenInchScreenshots/01 - dashboard.png differ diff --git a/fastlane/metadata/android/en-US/images/tenInchScreenshots/02 - workout detail.png b/fastlane/metadata/android/en-US/images/tenInchScreenshots/02 - workout detail.png index 97b4b2a92..9166a3527 100644 Binary files a/fastlane/metadata/android/en-US/images/tenInchScreenshots/02 - workout detail.png and b/fastlane/metadata/android/en-US/images/tenInchScreenshots/02 - workout detail.png differ diff --git a/fastlane/metadata/android/en-US/images/tenInchScreenshots/03 - gym mode.png b/fastlane/metadata/android/en-US/images/tenInchScreenshots/03 - gym mode.png index d090759d1..960aa01e7 100644 Binary files a/fastlane/metadata/android/en-US/images/tenInchScreenshots/03 - gym mode.png and b/fastlane/metadata/android/en-US/images/tenInchScreenshots/03 - gym mode.png differ diff --git a/fastlane/metadata/android/en-US/images/tenInchScreenshots/04 - measurements.png b/fastlane/metadata/android/en-US/images/tenInchScreenshots/04 - measurements.png index 884c83519..c127856b4 100644 Binary files a/fastlane/metadata/android/en-US/images/tenInchScreenshots/04 - measurements.png and b/fastlane/metadata/android/en-US/images/tenInchScreenshots/04 - measurements.png differ diff --git a/fastlane/metadata/android/en-US/images/tenInchScreenshots/05 - nutritional plan.png b/fastlane/metadata/android/en-US/images/tenInchScreenshots/05 - nutritional plan.png index 3385edc95..0f1a41b56 100644 Binary files a/fastlane/metadata/android/en-US/images/tenInchScreenshots/05 - nutritional plan.png and b/fastlane/metadata/android/en-US/images/tenInchScreenshots/05 - nutritional plan.png differ diff --git a/fastlane/metadata/android/en-US/images/tenInchScreenshots/06 - weight.png b/fastlane/metadata/android/en-US/images/tenInchScreenshots/06 - weight.png index 9fdac9ab2..d96730be7 100644 Binary files a/fastlane/metadata/android/en-US/images/tenInchScreenshots/06 - weight.png and b/fastlane/metadata/android/en-US/images/tenInchScreenshots/06 - weight.png differ diff --git a/fastlane/metadata/android/es-ES/images/phoneScreenshots/01 - dashboard.png b/fastlane/metadata/android/es-ES/images/phoneScreenshots/01 - dashboard.png index 2fbbe3d10..b0b90bcde 100644 Binary files a/fastlane/metadata/android/es-ES/images/phoneScreenshots/01 - dashboard.png and b/fastlane/metadata/android/es-ES/images/phoneScreenshots/01 - dashboard.png differ diff --git a/fastlane/metadata/android/es-ES/images/phoneScreenshots/02 - workout detail.png b/fastlane/metadata/android/es-ES/images/phoneScreenshots/02 - workout detail.png index e1389756c..345db1459 100644 Binary files a/fastlane/metadata/android/es-ES/images/phoneScreenshots/02 - workout detail.png and b/fastlane/metadata/android/es-ES/images/phoneScreenshots/02 - workout detail.png differ diff --git a/fastlane/metadata/android/es-ES/images/phoneScreenshots/03 - gym mode.png b/fastlane/metadata/android/es-ES/images/phoneScreenshots/03 - gym mode.png index 7f87d2d67..a3cf82f8e 100644 Binary files a/fastlane/metadata/android/es-ES/images/phoneScreenshots/03 - gym mode.png and b/fastlane/metadata/android/es-ES/images/phoneScreenshots/03 - gym mode.png differ diff --git a/fastlane/metadata/android/es-ES/images/phoneScreenshots/04 - measurements.png b/fastlane/metadata/android/es-ES/images/phoneScreenshots/04 - measurements.png index 823c88ef2..65f2f0462 100644 Binary files a/fastlane/metadata/android/es-ES/images/phoneScreenshots/04 - measurements.png and b/fastlane/metadata/android/es-ES/images/phoneScreenshots/04 - measurements.png differ diff --git a/fastlane/metadata/android/es-ES/images/phoneScreenshots/05 - nutritional plan.png b/fastlane/metadata/android/es-ES/images/phoneScreenshots/05 - nutritional plan.png index 80e4642e6..0443f4b76 100644 Binary files a/fastlane/metadata/android/es-ES/images/phoneScreenshots/05 - nutritional plan.png and b/fastlane/metadata/android/es-ES/images/phoneScreenshots/05 - nutritional plan.png differ diff --git a/fastlane/metadata/android/es-ES/images/phoneScreenshots/06 - weight.png b/fastlane/metadata/android/es-ES/images/phoneScreenshots/06 - weight.png index d4f083626..f04c955b1 100644 Binary files a/fastlane/metadata/android/es-ES/images/phoneScreenshots/06 - weight.png and b/fastlane/metadata/android/es-ES/images/phoneScreenshots/06 - weight.png differ diff --git a/fastlane/metadata/android/es-ES/images/sevenInchScreenshots/01 - dashboard.png b/fastlane/metadata/android/es-ES/images/sevenInchScreenshots/01 - dashboard.png index 6c3c094db..01e8c688e 100644 Binary files a/fastlane/metadata/android/es-ES/images/sevenInchScreenshots/01 - dashboard.png and b/fastlane/metadata/android/es-ES/images/sevenInchScreenshots/01 - dashboard.png differ diff --git a/fastlane/metadata/android/es-ES/images/sevenInchScreenshots/02 - workout detail.png b/fastlane/metadata/android/es-ES/images/sevenInchScreenshots/02 - workout detail.png index ba7e17dbe..01b75bacc 100644 Binary files a/fastlane/metadata/android/es-ES/images/sevenInchScreenshots/02 - workout detail.png and b/fastlane/metadata/android/es-ES/images/sevenInchScreenshots/02 - workout detail.png differ diff --git a/fastlane/metadata/android/es-ES/images/sevenInchScreenshots/03 - gym mode.png b/fastlane/metadata/android/es-ES/images/sevenInchScreenshots/03 - gym mode.png index ab19bb4cb..a887bf8f4 100644 Binary files a/fastlane/metadata/android/es-ES/images/sevenInchScreenshots/03 - gym mode.png and b/fastlane/metadata/android/es-ES/images/sevenInchScreenshots/03 - gym mode.png differ diff --git a/fastlane/metadata/android/es-ES/images/sevenInchScreenshots/04 - measurements.png b/fastlane/metadata/android/es-ES/images/sevenInchScreenshots/04 - measurements.png index fda5f2681..caa04b061 100644 Binary files a/fastlane/metadata/android/es-ES/images/sevenInchScreenshots/04 - measurements.png and b/fastlane/metadata/android/es-ES/images/sevenInchScreenshots/04 - measurements.png differ diff --git a/fastlane/metadata/android/es-ES/images/sevenInchScreenshots/05 - nutritional plan.png b/fastlane/metadata/android/es-ES/images/sevenInchScreenshots/05 - nutritional plan.png index dc0148d61..53a729b5d 100644 Binary files a/fastlane/metadata/android/es-ES/images/sevenInchScreenshots/05 - nutritional plan.png and b/fastlane/metadata/android/es-ES/images/sevenInchScreenshots/05 - nutritional plan.png differ diff --git a/fastlane/metadata/android/es-ES/images/sevenInchScreenshots/06 - weight.png b/fastlane/metadata/android/es-ES/images/sevenInchScreenshots/06 - weight.png index df8e4ec48..0040ce660 100644 Binary files a/fastlane/metadata/android/es-ES/images/sevenInchScreenshots/06 - weight.png and b/fastlane/metadata/android/es-ES/images/sevenInchScreenshots/06 - weight.png differ diff --git a/fastlane/metadata/android/es-ES/images/tenInchScreenshots/01 - dashboard.png b/fastlane/metadata/android/es-ES/images/tenInchScreenshots/01 - dashboard.png index cadef0f9a..fc7d8dced 100644 Binary files a/fastlane/metadata/android/es-ES/images/tenInchScreenshots/01 - dashboard.png and b/fastlane/metadata/android/es-ES/images/tenInchScreenshots/01 - dashboard.png differ diff --git a/fastlane/metadata/android/es-ES/images/tenInchScreenshots/02 - workout detail.png b/fastlane/metadata/android/es-ES/images/tenInchScreenshots/02 - workout detail.png index d967c47df..9166a3527 100644 Binary files a/fastlane/metadata/android/es-ES/images/tenInchScreenshots/02 - workout detail.png and b/fastlane/metadata/android/es-ES/images/tenInchScreenshots/02 - workout detail.png differ diff --git a/fastlane/metadata/android/es-ES/images/tenInchScreenshots/03 - gym mode.png b/fastlane/metadata/android/es-ES/images/tenInchScreenshots/03 - gym mode.png index 98f475cdb..08ef80a28 100644 Binary files a/fastlane/metadata/android/es-ES/images/tenInchScreenshots/03 - gym mode.png and b/fastlane/metadata/android/es-ES/images/tenInchScreenshots/03 - gym mode.png differ diff --git a/fastlane/metadata/android/es-ES/images/tenInchScreenshots/04 - measurements.png b/fastlane/metadata/android/es-ES/images/tenInchScreenshots/04 - measurements.png index d1bb641b7..9b1666d3e 100644 Binary files a/fastlane/metadata/android/es-ES/images/tenInchScreenshots/04 - measurements.png and b/fastlane/metadata/android/es-ES/images/tenInchScreenshots/04 - measurements.png differ diff --git a/fastlane/metadata/android/es-ES/images/tenInchScreenshots/05 - nutritional plan.png b/fastlane/metadata/android/es-ES/images/tenInchScreenshots/05 - nutritional plan.png index 2ab75d513..3301172ff 100644 Binary files a/fastlane/metadata/android/es-ES/images/tenInchScreenshots/05 - nutritional plan.png and b/fastlane/metadata/android/es-ES/images/tenInchScreenshots/05 - nutritional plan.png differ diff --git a/fastlane/metadata/android/es-ES/images/tenInchScreenshots/06 - weight.png b/fastlane/metadata/android/es-ES/images/tenInchScreenshots/06 - weight.png index 5b5e14b29..41609158f 100644 Binary files a/fastlane/metadata/android/es-ES/images/tenInchScreenshots/06 - weight.png and b/fastlane/metadata/android/es-ES/images/tenInchScreenshots/06 - weight.png differ diff --git a/fastlane/metadata/android/fr-FR/images/phoneScreenshots/01 - dashboard.png b/fastlane/metadata/android/fr-FR/images/phoneScreenshots/01 - dashboard.png index 14cc37b87..d3397c2e5 100644 Binary files a/fastlane/metadata/android/fr-FR/images/phoneScreenshots/01 - dashboard.png and b/fastlane/metadata/android/fr-FR/images/phoneScreenshots/01 - dashboard.png differ diff --git a/fastlane/metadata/android/fr-FR/images/phoneScreenshots/02 - workout detail.png b/fastlane/metadata/android/fr-FR/images/phoneScreenshots/02 - workout detail.png index e9fb2950c..d4fd8ef56 100644 Binary files a/fastlane/metadata/android/fr-FR/images/phoneScreenshots/02 - workout detail.png and b/fastlane/metadata/android/fr-FR/images/phoneScreenshots/02 - workout detail.png differ diff --git a/fastlane/metadata/android/fr-FR/images/phoneScreenshots/03 - gym mode.png b/fastlane/metadata/android/fr-FR/images/phoneScreenshots/03 - gym mode.png index b1a314160..6877e7dbc 100644 Binary files a/fastlane/metadata/android/fr-FR/images/phoneScreenshots/03 - gym mode.png and b/fastlane/metadata/android/fr-FR/images/phoneScreenshots/03 - gym mode.png differ diff --git a/fastlane/metadata/android/fr-FR/images/phoneScreenshots/04 - measurements.png b/fastlane/metadata/android/fr-FR/images/phoneScreenshots/04 - measurements.png index 8d27a7b47..30744f924 100644 Binary files a/fastlane/metadata/android/fr-FR/images/phoneScreenshots/04 - measurements.png and b/fastlane/metadata/android/fr-FR/images/phoneScreenshots/04 - measurements.png differ diff --git a/fastlane/metadata/android/fr-FR/images/phoneScreenshots/05 - nutritional plan.png b/fastlane/metadata/android/fr-FR/images/phoneScreenshots/05 - nutritional plan.png index a9d2cf2e0..aba07e222 100644 Binary files a/fastlane/metadata/android/fr-FR/images/phoneScreenshots/05 - nutritional plan.png and b/fastlane/metadata/android/fr-FR/images/phoneScreenshots/05 - nutritional plan.png differ diff --git a/fastlane/metadata/android/fr-FR/images/phoneScreenshots/06 - weight.png b/fastlane/metadata/android/fr-FR/images/phoneScreenshots/06 - weight.png index 440aa47e6..e0da08aaf 100644 Binary files a/fastlane/metadata/android/fr-FR/images/phoneScreenshots/06 - weight.png and b/fastlane/metadata/android/fr-FR/images/phoneScreenshots/06 - weight.png differ diff --git a/fastlane/metadata/android/fr-FR/images/sevenInchScreenshots/01 - dashboard.png b/fastlane/metadata/android/fr-FR/images/sevenInchScreenshots/01 - dashboard.png index 997dc604f..d53613e7d 100644 Binary files a/fastlane/metadata/android/fr-FR/images/sevenInchScreenshots/01 - dashboard.png and b/fastlane/metadata/android/fr-FR/images/sevenInchScreenshots/01 - dashboard.png differ diff --git a/fastlane/metadata/android/fr-FR/images/sevenInchScreenshots/02 - workout detail.png b/fastlane/metadata/android/fr-FR/images/sevenInchScreenshots/02 - workout detail.png index b8dac70b2..5c000c235 100644 Binary files a/fastlane/metadata/android/fr-FR/images/sevenInchScreenshots/02 - workout detail.png and b/fastlane/metadata/android/fr-FR/images/sevenInchScreenshots/02 - workout detail.png differ diff --git a/fastlane/metadata/android/fr-FR/images/sevenInchScreenshots/03 - gym mode.png b/fastlane/metadata/android/fr-FR/images/sevenInchScreenshots/03 - gym mode.png index 25436c637..e1e37b2c3 100644 Binary files a/fastlane/metadata/android/fr-FR/images/sevenInchScreenshots/03 - gym mode.png and b/fastlane/metadata/android/fr-FR/images/sevenInchScreenshots/03 - gym mode.png differ diff --git a/fastlane/metadata/android/fr-FR/images/sevenInchScreenshots/04 - measurements.png b/fastlane/metadata/android/fr-FR/images/sevenInchScreenshots/04 - measurements.png index 79262d4af..46ee343e2 100644 Binary files a/fastlane/metadata/android/fr-FR/images/sevenInchScreenshots/04 - measurements.png and b/fastlane/metadata/android/fr-FR/images/sevenInchScreenshots/04 - measurements.png differ diff --git a/fastlane/metadata/android/fr-FR/images/sevenInchScreenshots/05 - nutritional plan.png b/fastlane/metadata/android/fr-FR/images/sevenInchScreenshots/05 - nutritional plan.png index a51eede7c..45a6ac534 100644 Binary files a/fastlane/metadata/android/fr-FR/images/sevenInchScreenshots/05 - nutritional plan.png and b/fastlane/metadata/android/fr-FR/images/sevenInchScreenshots/05 - nutritional plan.png differ diff --git a/fastlane/metadata/android/fr-FR/images/sevenInchScreenshots/06 - weight.png b/fastlane/metadata/android/fr-FR/images/sevenInchScreenshots/06 - weight.png index 78765b420..75fa266fd 100644 Binary files a/fastlane/metadata/android/fr-FR/images/sevenInchScreenshots/06 - weight.png and b/fastlane/metadata/android/fr-FR/images/sevenInchScreenshots/06 - weight.png differ diff --git a/fastlane/metadata/android/fr-FR/images/tenInchScreenshots/01 - dashboard.png b/fastlane/metadata/android/fr-FR/images/tenInchScreenshots/01 - dashboard.png index 176cf83b9..36ce47eb3 100644 Binary files a/fastlane/metadata/android/fr-FR/images/tenInchScreenshots/01 - dashboard.png and b/fastlane/metadata/android/fr-FR/images/tenInchScreenshots/01 - dashboard.png differ diff --git a/fastlane/metadata/android/fr-FR/images/tenInchScreenshots/02 - workout detail.png b/fastlane/metadata/android/fr-FR/images/tenInchScreenshots/02 - workout detail.png index bac0addf1..dd2d89500 100644 Binary files a/fastlane/metadata/android/fr-FR/images/tenInchScreenshots/02 - workout detail.png and b/fastlane/metadata/android/fr-FR/images/tenInchScreenshots/02 - workout detail.png differ diff --git a/fastlane/metadata/android/fr-FR/images/tenInchScreenshots/03 - gym mode.png b/fastlane/metadata/android/fr-FR/images/tenInchScreenshots/03 - gym mode.png index bf3c4a32b..c9a2d68d6 100644 Binary files a/fastlane/metadata/android/fr-FR/images/tenInchScreenshots/03 - gym mode.png and b/fastlane/metadata/android/fr-FR/images/tenInchScreenshots/03 - gym mode.png differ diff --git a/fastlane/metadata/android/fr-FR/images/tenInchScreenshots/04 - measurements.png b/fastlane/metadata/android/fr-FR/images/tenInchScreenshots/04 - measurements.png index cf06366b3..83f7d2157 100644 Binary files a/fastlane/metadata/android/fr-FR/images/tenInchScreenshots/04 - measurements.png and b/fastlane/metadata/android/fr-FR/images/tenInchScreenshots/04 - measurements.png differ diff --git a/fastlane/metadata/android/fr-FR/images/tenInchScreenshots/05 - nutritional plan.png b/fastlane/metadata/android/fr-FR/images/tenInchScreenshots/05 - nutritional plan.png index 42305cf6f..3cf5dab3a 100644 Binary files a/fastlane/metadata/android/fr-FR/images/tenInchScreenshots/05 - nutritional plan.png and b/fastlane/metadata/android/fr-FR/images/tenInchScreenshots/05 - nutritional plan.png differ diff --git a/fastlane/metadata/android/fr-FR/images/tenInchScreenshots/06 - weight.png b/fastlane/metadata/android/fr-FR/images/tenInchScreenshots/06 - weight.png index 117d133b0..0f3a5ce61 100644 Binary files a/fastlane/metadata/android/fr-FR/images/tenInchScreenshots/06 - weight.png and b/fastlane/metadata/android/fr-FR/images/tenInchScreenshots/06 - weight.png differ diff --git a/fastlane/metadata/android/hi-IN/images/phoneScreenshots/01 - dashboard.png b/fastlane/metadata/android/hi-IN/images/phoneScreenshots/01 - dashboard.png index b3e4b1c70..7ae3ef4af 100644 Binary files a/fastlane/metadata/android/hi-IN/images/phoneScreenshots/01 - dashboard.png and b/fastlane/metadata/android/hi-IN/images/phoneScreenshots/01 - dashboard.png differ diff --git a/fastlane/metadata/android/hi-IN/images/phoneScreenshots/02 - workout detail.png b/fastlane/metadata/android/hi-IN/images/phoneScreenshots/02 - workout detail.png index 68fef52c1..345db1459 100644 Binary files a/fastlane/metadata/android/hi-IN/images/phoneScreenshots/02 - workout detail.png and b/fastlane/metadata/android/hi-IN/images/phoneScreenshots/02 - workout detail.png differ diff --git a/fastlane/metadata/android/hi-IN/images/phoneScreenshots/03 - gym mode.png b/fastlane/metadata/android/hi-IN/images/phoneScreenshots/03 - gym mode.png index 10f8ef5b8..a07df670f 100644 Binary files a/fastlane/metadata/android/hi-IN/images/phoneScreenshots/03 - gym mode.png and b/fastlane/metadata/android/hi-IN/images/phoneScreenshots/03 - gym mode.png differ diff --git a/fastlane/metadata/android/hi-IN/images/phoneScreenshots/04 - measurements.png b/fastlane/metadata/android/hi-IN/images/phoneScreenshots/04 - measurements.png index d0083b750..d0d4931f5 100644 Binary files a/fastlane/metadata/android/hi-IN/images/phoneScreenshots/04 - measurements.png and b/fastlane/metadata/android/hi-IN/images/phoneScreenshots/04 - measurements.png differ diff --git a/fastlane/metadata/android/hi-IN/images/phoneScreenshots/05 - nutritional plan.png b/fastlane/metadata/android/hi-IN/images/phoneScreenshots/05 - nutritional plan.png index 6d8500893..c2badd203 100644 Binary files a/fastlane/metadata/android/hi-IN/images/phoneScreenshots/05 - nutritional plan.png and b/fastlane/metadata/android/hi-IN/images/phoneScreenshots/05 - nutritional plan.png differ diff --git a/fastlane/metadata/android/hi-IN/images/phoneScreenshots/06 - weight.png b/fastlane/metadata/android/hi-IN/images/phoneScreenshots/06 - weight.png index af3b041a2..7907e92ae 100644 Binary files a/fastlane/metadata/android/hi-IN/images/phoneScreenshots/06 - weight.png and b/fastlane/metadata/android/hi-IN/images/phoneScreenshots/06 - weight.png differ diff --git a/fastlane/metadata/android/hi-IN/images/sevenInchScreenshots/01 - dashboard.png b/fastlane/metadata/android/hi-IN/images/sevenInchScreenshots/01 - dashboard.png index a169d5766..d4440715c 100644 Binary files a/fastlane/metadata/android/hi-IN/images/sevenInchScreenshots/01 - dashboard.png and b/fastlane/metadata/android/hi-IN/images/sevenInchScreenshots/01 - dashboard.png differ diff --git a/fastlane/metadata/android/hi-IN/images/sevenInchScreenshots/02 - workout detail.png b/fastlane/metadata/android/hi-IN/images/sevenInchScreenshots/02 - workout detail.png index d44e71eca..01b75bacc 100644 Binary files a/fastlane/metadata/android/hi-IN/images/sevenInchScreenshots/02 - workout detail.png and b/fastlane/metadata/android/hi-IN/images/sevenInchScreenshots/02 - workout detail.png differ diff --git a/fastlane/metadata/android/hi-IN/images/sevenInchScreenshots/03 - gym mode.png b/fastlane/metadata/android/hi-IN/images/sevenInchScreenshots/03 - gym mode.png index 571e01240..2458a4cb2 100644 Binary files a/fastlane/metadata/android/hi-IN/images/sevenInchScreenshots/03 - gym mode.png and b/fastlane/metadata/android/hi-IN/images/sevenInchScreenshots/03 - gym mode.png differ diff --git a/fastlane/metadata/android/hi-IN/images/sevenInchScreenshots/04 - measurements.png b/fastlane/metadata/android/hi-IN/images/sevenInchScreenshots/04 - measurements.png index 88ded47dc..89e2e8f4d 100644 Binary files a/fastlane/metadata/android/hi-IN/images/sevenInchScreenshots/04 - measurements.png and b/fastlane/metadata/android/hi-IN/images/sevenInchScreenshots/04 - measurements.png differ diff --git a/fastlane/metadata/android/hi-IN/images/sevenInchScreenshots/05 - nutritional plan.png b/fastlane/metadata/android/hi-IN/images/sevenInchScreenshots/05 - nutritional plan.png index ddcec9abd..a18e5a830 100644 Binary files a/fastlane/metadata/android/hi-IN/images/sevenInchScreenshots/05 - nutritional plan.png and b/fastlane/metadata/android/hi-IN/images/sevenInchScreenshots/05 - nutritional plan.png differ diff --git a/fastlane/metadata/android/hi-IN/images/sevenInchScreenshots/06 - weight.png b/fastlane/metadata/android/hi-IN/images/sevenInchScreenshots/06 - weight.png index 79ef3e052..9609d17fc 100644 Binary files a/fastlane/metadata/android/hi-IN/images/sevenInchScreenshots/06 - weight.png and b/fastlane/metadata/android/hi-IN/images/sevenInchScreenshots/06 - weight.png differ diff --git a/fastlane/metadata/android/hi-IN/images/tenInchScreenshots/01 - dashboard.png b/fastlane/metadata/android/hi-IN/images/tenInchScreenshots/01 - dashboard.png index e5d9192f6..3f33af67b 100644 Binary files a/fastlane/metadata/android/hi-IN/images/tenInchScreenshots/01 - dashboard.png and b/fastlane/metadata/android/hi-IN/images/tenInchScreenshots/01 - dashboard.png differ diff --git a/fastlane/metadata/android/hi-IN/images/tenInchScreenshots/02 - workout detail.png b/fastlane/metadata/android/hi-IN/images/tenInchScreenshots/02 - workout detail.png index eace0bba6..9166a3527 100644 Binary files a/fastlane/metadata/android/hi-IN/images/tenInchScreenshots/02 - workout detail.png and b/fastlane/metadata/android/hi-IN/images/tenInchScreenshots/02 - workout detail.png differ diff --git a/fastlane/metadata/android/hi-IN/images/tenInchScreenshots/03 - gym mode.png b/fastlane/metadata/android/hi-IN/images/tenInchScreenshots/03 - gym mode.png index 5ed2b940e..cbd02399e 100644 Binary files a/fastlane/metadata/android/hi-IN/images/tenInchScreenshots/03 - gym mode.png and b/fastlane/metadata/android/hi-IN/images/tenInchScreenshots/03 - gym mode.png differ diff --git a/fastlane/metadata/android/hi-IN/images/tenInchScreenshots/04 - measurements.png b/fastlane/metadata/android/hi-IN/images/tenInchScreenshots/04 - measurements.png index 86c2b68f5..c4dcc8468 100644 Binary files a/fastlane/metadata/android/hi-IN/images/tenInchScreenshots/04 - measurements.png and b/fastlane/metadata/android/hi-IN/images/tenInchScreenshots/04 - measurements.png differ diff --git a/fastlane/metadata/android/hi-IN/images/tenInchScreenshots/05 - nutritional plan.png b/fastlane/metadata/android/hi-IN/images/tenInchScreenshots/05 - nutritional plan.png index 1029d4711..e14b2c71b 100644 Binary files a/fastlane/metadata/android/hi-IN/images/tenInchScreenshots/05 - nutritional plan.png and b/fastlane/metadata/android/hi-IN/images/tenInchScreenshots/05 - nutritional plan.png differ diff --git a/fastlane/metadata/android/hi-IN/images/tenInchScreenshots/06 - weight.png b/fastlane/metadata/android/hi-IN/images/tenInchScreenshots/06 - weight.png index 4ce4c3f6d..5ee521ba9 100644 Binary files a/fastlane/metadata/android/hi-IN/images/tenInchScreenshots/06 - weight.png and b/fastlane/metadata/android/hi-IN/images/tenInchScreenshots/06 - weight.png differ diff --git a/fastlane/metadata/android/hr/images/phoneScreenshots/01 - dashboard.png b/fastlane/metadata/android/hr/images/phoneScreenshots/01 - dashboard.png index e154bbd33..974d4825a 100644 Binary files a/fastlane/metadata/android/hr/images/phoneScreenshots/01 - dashboard.png and b/fastlane/metadata/android/hr/images/phoneScreenshots/01 - dashboard.png differ diff --git a/fastlane/metadata/android/hr/images/phoneScreenshots/02 - workout detail.png b/fastlane/metadata/android/hr/images/phoneScreenshots/02 - workout detail.png index 978c43efe..345db1459 100644 Binary files a/fastlane/metadata/android/hr/images/phoneScreenshots/02 - workout detail.png and b/fastlane/metadata/android/hr/images/phoneScreenshots/02 - workout detail.png differ diff --git a/fastlane/metadata/android/hr/images/phoneScreenshots/03 - gym mode.png b/fastlane/metadata/android/hr/images/phoneScreenshots/03 - gym mode.png index 2eb1a3d1a..a22b1f4f5 100644 Binary files a/fastlane/metadata/android/hr/images/phoneScreenshots/03 - gym mode.png and b/fastlane/metadata/android/hr/images/phoneScreenshots/03 - gym mode.png differ diff --git a/fastlane/metadata/android/hr/images/phoneScreenshots/04 - measurements.png b/fastlane/metadata/android/hr/images/phoneScreenshots/04 - measurements.png index c3cad1443..a0f3b4185 100644 Binary files a/fastlane/metadata/android/hr/images/phoneScreenshots/04 - measurements.png and b/fastlane/metadata/android/hr/images/phoneScreenshots/04 - measurements.png differ diff --git a/fastlane/metadata/android/hr/images/phoneScreenshots/05 - nutritional plan.png b/fastlane/metadata/android/hr/images/phoneScreenshots/05 - nutritional plan.png index f9d3893a8..68dd3cd63 100644 Binary files a/fastlane/metadata/android/hr/images/phoneScreenshots/05 - nutritional plan.png and b/fastlane/metadata/android/hr/images/phoneScreenshots/05 - nutritional plan.png differ diff --git a/fastlane/metadata/android/hr/images/phoneScreenshots/06 - weight.png b/fastlane/metadata/android/hr/images/phoneScreenshots/06 - weight.png index 73d56830e..363de5eb5 100644 Binary files a/fastlane/metadata/android/hr/images/phoneScreenshots/06 - weight.png and b/fastlane/metadata/android/hr/images/phoneScreenshots/06 - weight.png differ diff --git a/fastlane/metadata/android/hr/images/sevenInchScreenshots/01 - dashboard.png b/fastlane/metadata/android/hr/images/sevenInchScreenshots/01 - dashboard.png index 15358c7cf..2f964e3ac 100644 Binary files a/fastlane/metadata/android/hr/images/sevenInchScreenshots/01 - dashboard.png and b/fastlane/metadata/android/hr/images/sevenInchScreenshots/01 - dashboard.png differ diff --git a/fastlane/metadata/android/hr/images/sevenInchScreenshots/02 - workout detail.png b/fastlane/metadata/android/hr/images/sevenInchScreenshots/02 - workout detail.png index bb14bfe0e..01b75bacc 100644 Binary files a/fastlane/metadata/android/hr/images/sevenInchScreenshots/02 - workout detail.png and b/fastlane/metadata/android/hr/images/sevenInchScreenshots/02 - workout detail.png differ diff --git a/fastlane/metadata/android/hr/images/sevenInchScreenshots/03 - gym mode.png b/fastlane/metadata/android/hr/images/sevenInchScreenshots/03 - gym mode.png index 8fbd4f675..e209b2cae 100644 Binary files a/fastlane/metadata/android/hr/images/sevenInchScreenshots/03 - gym mode.png and b/fastlane/metadata/android/hr/images/sevenInchScreenshots/03 - gym mode.png differ diff --git a/fastlane/metadata/android/hr/images/sevenInchScreenshots/04 - measurements.png b/fastlane/metadata/android/hr/images/sevenInchScreenshots/04 - measurements.png index f664b9b52..5f5a59048 100644 Binary files a/fastlane/metadata/android/hr/images/sevenInchScreenshots/04 - measurements.png and b/fastlane/metadata/android/hr/images/sevenInchScreenshots/04 - measurements.png differ diff --git a/fastlane/metadata/android/hr/images/sevenInchScreenshots/05 - nutritional plan.png b/fastlane/metadata/android/hr/images/sevenInchScreenshots/05 - nutritional plan.png index fd71e194d..ffd251341 100644 Binary files a/fastlane/metadata/android/hr/images/sevenInchScreenshots/05 - nutritional plan.png and b/fastlane/metadata/android/hr/images/sevenInchScreenshots/05 - nutritional plan.png differ diff --git a/fastlane/metadata/android/hr/images/sevenInchScreenshots/06 - weight.png b/fastlane/metadata/android/hr/images/sevenInchScreenshots/06 - weight.png index c8279c689..957e9e185 100644 Binary files a/fastlane/metadata/android/hr/images/sevenInchScreenshots/06 - weight.png and b/fastlane/metadata/android/hr/images/sevenInchScreenshots/06 - weight.png differ diff --git a/fastlane/metadata/android/hr/images/tenInchScreenshots/01 - dashboard.png b/fastlane/metadata/android/hr/images/tenInchScreenshots/01 - dashboard.png index ed60e83b6..6d0e97dd0 100644 Binary files a/fastlane/metadata/android/hr/images/tenInchScreenshots/01 - dashboard.png and b/fastlane/metadata/android/hr/images/tenInchScreenshots/01 - dashboard.png differ diff --git a/fastlane/metadata/android/hr/images/tenInchScreenshots/02 - workout detail.png b/fastlane/metadata/android/hr/images/tenInchScreenshots/02 - workout detail.png index aeae552ba..9166a3527 100644 Binary files a/fastlane/metadata/android/hr/images/tenInchScreenshots/02 - workout detail.png and b/fastlane/metadata/android/hr/images/tenInchScreenshots/02 - workout detail.png differ diff --git a/fastlane/metadata/android/hr/images/tenInchScreenshots/03 - gym mode.png b/fastlane/metadata/android/hr/images/tenInchScreenshots/03 - gym mode.png index 6db552e30..30da74496 100644 Binary files a/fastlane/metadata/android/hr/images/tenInchScreenshots/03 - gym mode.png and b/fastlane/metadata/android/hr/images/tenInchScreenshots/03 - gym mode.png differ diff --git a/fastlane/metadata/android/hr/images/tenInchScreenshots/04 - measurements.png b/fastlane/metadata/android/hr/images/tenInchScreenshots/04 - measurements.png index 929574405..3165acbc3 100644 Binary files a/fastlane/metadata/android/hr/images/tenInchScreenshots/04 - measurements.png and b/fastlane/metadata/android/hr/images/tenInchScreenshots/04 - measurements.png differ diff --git a/fastlane/metadata/android/hr/images/tenInchScreenshots/05 - nutritional plan.png b/fastlane/metadata/android/hr/images/tenInchScreenshots/05 - nutritional plan.png index b20047e34..c573b5e69 100644 Binary files a/fastlane/metadata/android/hr/images/tenInchScreenshots/05 - nutritional plan.png and b/fastlane/metadata/android/hr/images/tenInchScreenshots/05 - nutritional plan.png differ diff --git a/fastlane/metadata/android/hr/images/tenInchScreenshots/06 - weight.png b/fastlane/metadata/android/hr/images/tenInchScreenshots/06 - weight.png index 5e6c42227..e3197d245 100644 Binary files a/fastlane/metadata/android/hr/images/tenInchScreenshots/06 - weight.png and b/fastlane/metadata/android/hr/images/tenInchScreenshots/06 - weight.png differ diff --git a/fastlane/metadata/android/it-IT/images/phoneScreenshots/01 - dashboard.png b/fastlane/metadata/android/it-IT/images/phoneScreenshots/01 - dashboard.png index 3e9788d3d..7fdf49aad 100644 Binary files a/fastlane/metadata/android/it-IT/images/phoneScreenshots/01 - dashboard.png and b/fastlane/metadata/android/it-IT/images/phoneScreenshots/01 - dashboard.png differ diff --git a/fastlane/metadata/android/it-IT/images/phoneScreenshots/02 - workout detail.png b/fastlane/metadata/android/it-IT/images/phoneScreenshots/02 - workout detail.png index a21540fc0..9cb5f42ff 100644 Binary files a/fastlane/metadata/android/it-IT/images/phoneScreenshots/02 - workout detail.png and b/fastlane/metadata/android/it-IT/images/phoneScreenshots/02 - workout detail.png differ diff --git a/fastlane/metadata/android/it-IT/images/phoneScreenshots/03 - gym mode.png b/fastlane/metadata/android/it-IT/images/phoneScreenshots/03 - gym mode.png index de216c42c..dbbac6362 100644 Binary files a/fastlane/metadata/android/it-IT/images/phoneScreenshots/03 - gym mode.png and b/fastlane/metadata/android/it-IT/images/phoneScreenshots/03 - gym mode.png differ diff --git a/fastlane/metadata/android/it-IT/images/phoneScreenshots/04 - measurements.png b/fastlane/metadata/android/it-IT/images/phoneScreenshots/04 - measurements.png index 3eac3726e..42c0d8c43 100644 Binary files a/fastlane/metadata/android/it-IT/images/phoneScreenshots/04 - measurements.png and b/fastlane/metadata/android/it-IT/images/phoneScreenshots/04 - measurements.png differ diff --git a/fastlane/metadata/android/it-IT/images/phoneScreenshots/05 - nutritional plan.png b/fastlane/metadata/android/it-IT/images/phoneScreenshots/05 - nutritional plan.png index 238c7ad01..fde42488c 100644 Binary files a/fastlane/metadata/android/it-IT/images/phoneScreenshots/05 - nutritional plan.png and b/fastlane/metadata/android/it-IT/images/phoneScreenshots/05 - nutritional plan.png differ diff --git a/fastlane/metadata/android/it-IT/images/phoneScreenshots/06 - weight.png b/fastlane/metadata/android/it-IT/images/phoneScreenshots/06 - weight.png index e7e9bf6d6..78a9b06fb 100644 Binary files a/fastlane/metadata/android/it-IT/images/phoneScreenshots/06 - weight.png and b/fastlane/metadata/android/it-IT/images/phoneScreenshots/06 - weight.png differ diff --git a/fastlane/metadata/android/it-IT/images/sevenInchScreenshots/01 - dashboard.png b/fastlane/metadata/android/it-IT/images/sevenInchScreenshots/01 - dashboard.png index 1f4ae964b..cb83d9335 100644 Binary files a/fastlane/metadata/android/it-IT/images/sevenInchScreenshots/01 - dashboard.png and b/fastlane/metadata/android/it-IT/images/sevenInchScreenshots/01 - dashboard.png differ diff --git a/fastlane/metadata/android/it-IT/images/sevenInchScreenshots/02 - workout detail.png b/fastlane/metadata/android/it-IT/images/sevenInchScreenshots/02 - workout detail.png index 8f0f593f5..b06574b7b 100644 Binary files a/fastlane/metadata/android/it-IT/images/sevenInchScreenshots/02 - workout detail.png and b/fastlane/metadata/android/it-IT/images/sevenInchScreenshots/02 - workout detail.png differ diff --git a/fastlane/metadata/android/it-IT/images/sevenInchScreenshots/03 - gym mode.png b/fastlane/metadata/android/it-IT/images/sevenInchScreenshots/03 - gym mode.png index 6255a79df..17211b335 100644 Binary files a/fastlane/metadata/android/it-IT/images/sevenInchScreenshots/03 - gym mode.png and b/fastlane/metadata/android/it-IT/images/sevenInchScreenshots/03 - gym mode.png differ diff --git a/fastlane/metadata/android/it-IT/images/sevenInchScreenshots/04 - measurements.png b/fastlane/metadata/android/it-IT/images/sevenInchScreenshots/04 - measurements.png index d376fa6f9..a1fe71deb 100644 Binary files a/fastlane/metadata/android/it-IT/images/sevenInchScreenshots/04 - measurements.png and b/fastlane/metadata/android/it-IT/images/sevenInchScreenshots/04 - measurements.png differ diff --git a/fastlane/metadata/android/it-IT/images/sevenInchScreenshots/05 - nutritional plan.png b/fastlane/metadata/android/it-IT/images/sevenInchScreenshots/05 - nutritional plan.png index a4a17a200..14a35f398 100644 Binary files a/fastlane/metadata/android/it-IT/images/sevenInchScreenshots/05 - nutritional plan.png and b/fastlane/metadata/android/it-IT/images/sevenInchScreenshots/05 - nutritional plan.png differ diff --git a/fastlane/metadata/android/it-IT/images/sevenInchScreenshots/06 - weight.png b/fastlane/metadata/android/it-IT/images/sevenInchScreenshots/06 - weight.png index 939c3d87a..3a9c3213e 100644 Binary files a/fastlane/metadata/android/it-IT/images/sevenInchScreenshots/06 - weight.png and b/fastlane/metadata/android/it-IT/images/sevenInchScreenshots/06 - weight.png differ diff --git a/fastlane/metadata/android/it-IT/images/tenInchScreenshots/01 - dashboard.png b/fastlane/metadata/android/it-IT/images/tenInchScreenshots/01 - dashboard.png index 730783220..f8efc4f59 100644 Binary files a/fastlane/metadata/android/it-IT/images/tenInchScreenshots/01 - dashboard.png and b/fastlane/metadata/android/it-IT/images/tenInchScreenshots/01 - dashboard.png differ diff --git a/fastlane/metadata/android/it-IT/images/tenInchScreenshots/02 - workout detail.png b/fastlane/metadata/android/it-IT/images/tenInchScreenshots/02 - workout detail.png index d24bce51d..c9149c6c3 100644 Binary files a/fastlane/metadata/android/it-IT/images/tenInchScreenshots/02 - workout detail.png and b/fastlane/metadata/android/it-IT/images/tenInchScreenshots/02 - workout detail.png differ diff --git a/fastlane/metadata/android/it-IT/images/tenInchScreenshots/03 - gym mode.png b/fastlane/metadata/android/it-IT/images/tenInchScreenshots/03 - gym mode.png index d407d30b0..1e1436923 100644 Binary files a/fastlane/metadata/android/it-IT/images/tenInchScreenshots/03 - gym mode.png and b/fastlane/metadata/android/it-IT/images/tenInchScreenshots/03 - gym mode.png differ diff --git a/fastlane/metadata/android/it-IT/images/tenInchScreenshots/04 - measurements.png b/fastlane/metadata/android/it-IT/images/tenInchScreenshots/04 - measurements.png index 36b14e9ee..bbb76bf09 100644 Binary files a/fastlane/metadata/android/it-IT/images/tenInchScreenshots/04 - measurements.png and b/fastlane/metadata/android/it-IT/images/tenInchScreenshots/04 - measurements.png differ diff --git a/fastlane/metadata/android/it-IT/images/tenInchScreenshots/05 - nutritional plan.png b/fastlane/metadata/android/it-IT/images/tenInchScreenshots/05 - nutritional plan.png index ae996658b..bd87f3271 100644 Binary files a/fastlane/metadata/android/it-IT/images/tenInchScreenshots/05 - nutritional plan.png and b/fastlane/metadata/android/it-IT/images/tenInchScreenshots/05 - nutritional plan.png differ diff --git a/fastlane/metadata/android/it-IT/images/tenInchScreenshots/06 - weight.png b/fastlane/metadata/android/it-IT/images/tenInchScreenshots/06 - weight.png index 21539da11..6af74b03f 100644 Binary files a/fastlane/metadata/android/it-IT/images/tenInchScreenshots/06 - weight.png and b/fastlane/metadata/android/it-IT/images/tenInchScreenshots/06 - weight.png differ diff --git a/fastlane/metadata/android/nb-NO/images/phoneScreenshots/01 - dashboard.png b/fastlane/metadata/android/nb-NO/images/phoneScreenshots/01 - dashboard.png index 82b65b28b..ef250a88d 100644 Binary files a/fastlane/metadata/android/nb-NO/images/phoneScreenshots/01 - dashboard.png and b/fastlane/metadata/android/nb-NO/images/phoneScreenshots/01 - dashboard.png differ diff --git a/fastlane/metadata/android/nb-NO/images/phoneScreenshots/02 - workout detail.png b/fastlane/metadata/android/nb-NO/images/phoneScreenshots/02 - workout detail.png index 1567d609f..345db1459 100644 Binary files a/fastlane/metadata/android/nb-NO/images/phoneScreenshots/02 - workout detail.png and b/fastlane/metadata/android/nb-NO/images/phoneScreenshots/02 - workout detail.png differ diff --git a/fastlane/metadata/android/nb-NO/images/phoneScreenshots/03 - gym mode.png b/fastlane/metadata/android/nb-NO/images/phoneScreenshots/03 - gym mode.png index aa5430647..de51f40ed 100644 Binary files a/fastlane/metadata/android/nb-NO/images/phoneScreenshots/03 - gym mode.png and b/fastlane/metadata/android/nb-NO/images/phoneScreenshots/03 - gym mode.png differ diff --git a/fastlane/metadata/android/nb-NO/images/phoneScreenshots/04 - measurements.png b/fastlane/metadata/android/nb-NO/images/phoneScreenshots/04 - measurements.png index 5e06570bc..4d1e640f9 100644 Binary files a/fastlane/metadata/android/nb-NO/images/phoneScreenshots/04 - measurements.png and b/fastlane/metadata/android/nb-NO/images/phoneScreenshots/04 - measurements.png differ diff --git a/fastlane/metadata/android/nb-NO/images/phoneScreenshots/05 - nutritional plan.png b/fastlane/metadata/android/nb-NO/images/phoneScreenshots/05 - nutritional plan.png index 5af5bf796..d8e35f365 100644 Binary files a/fastlane/metadata/android/nb-NO/images/phoneScreenshots/05 - nutritional plan.png and b/fastlane/metadata/android/nb-NO/images/phoneScreenshots/05 - nutritional plan.png differ diff --git a/fastlane/metadata/android/nb-NO/images/phoneScreenshots/06 - weight.png b/fastlane/metadata/android/nb-NO/images/phoneScreenshots/06 - weight.png index 9c0441b5f..163b8d6de 100644 Binary files a/fastlane/metadata/android/nb-NO/images/phoneScreenshots/06 - weight.png and b/fastlane/metadata/android/nb-NO/images/phoneScreenshots/06 - weight.png differ diff --git a/fastlane/metadata/android/nb-NO/images/sevenInchScreenshots/01 - dashboard.png b/fastlane/metadata/android/nb-NO/images/sevenInchScreenshots/01 - dashboard.png index 0e8559aab..dbd5e8edc 100644 Binary files a/fastlane/metadata/android/nb-NO/images/sevenInchScreenshots/01 - dashboard.png and b/fastlane/metadata/android/nb-NO/images/sevenInchScreenshots/01 - dashboard.png differ diff --git a/fastlane/metadata/android/nb-NO/images/sevenInchScreenshots/02 - workout detail.png b/fastlane/metadata/android/nb-NO/images/sevenInchScreenshots/02 - workout detail.png index 2c33087f9..01b75bacc 100644 Binary files a/fastlane/metadata/android/nb-NO/images/sevenInchScreenshots/02 - workout detail.png and b/fastlane/metadata/android/nb-NO/images/sevenInchScreenshots/02 - workout detail.png differ diff --git a/fastlane/metadata/android/nb-NO/images/sevenInchScreenshots/03 - gym mode.png b/fastlane/metadata/android/nb-NO/images/sevenInchScreenshots/03 - gym mode.png index e03358bd9..f4ec012b5 100644 Binary files a/fastlane/metadata/android/nb-NO/images/sevenInchScreenshots/03 - gym mode.png and b/fastlane/metadata/android/nb-NO/images/sevenInchScreenshots/03 - gym mode.png differ diff --git a/fastlane/metadata/android/nb-NO/images/sevenInchScreenshots/04 - measurements.png b/fastlane/metadata/android/nb-NO/images/sevenInchScreenshots/04 - measurements.png index cca2ce418..2a5d9ebce 100644 Binary files a/fastlane/metadata/android/nb-NO/images/sevenInchScreenshots/04 - measurements.png and b/fastlane/metadata/android/nb-NO/images/sevenInchScreenshots/04 - measurements.png differ diff --git a/fastlane/metadata/android/nb-NO/images/sevenInchScreenshots/05 - nutritional plan.png b/fastlane/metadata/android/nb-NO/images/sevenInchScreenshots/05 - nutritional plan.png index ff06a8cbc..babf7acd1 100644 Binary files a/fastlane/metadata/android/nb-NO/images/sevenInchScreenshots/05 - nutritional plan.png and b/fastlane/metadata/android/nb-NO/images/sevenInchScreenshots/05 - nutritional plan.png differ diff --git a/fastlane/metadata/android/nb-NO/images/sevenInchScreenshots/06 - weight.png b/fastlane/metadata/android/nb-NO/images/sevenInchScreenshots/06 - weight.png index dcf8c68f0..bbe444986 100644 Binary files a/fastlane/metadata/android/nb-NO/images/sevenInchScreenshots/06 - weight.png and b/fastlane/metadata/android/nb-NO/images/sevenInchScreenshots/06 - weight.png differ diff --git a/fastlane/metadata/android/nb-NO/images/tenInchScreenshots/01 - dashboard.png b/fastlane/metadata/android/nb-NO/images/tenInchScreenshots/01 - dashboard.png index 3972eecec..1366436fc 100644 Binary files a/fastlane/metadata/android/nb-NO/images/tenInchScreenshots/01 - dashboard.png and b/fastlane/metadata/android/nb-NO/images/tenInchScreenshots/01 - dashboard.png differ diff --git a/fastlane/metadata/android/nb-NO/images/tenInchScreenshots/02 - workout detail.png b/fastlane/metadata/android/nb-NO/images/tenInchScreenshots/02 - workout detail.png index 9e3b3db46..9166a3527 100644 Binary files a/fastlane/metadata/android/nb-NO/images/tenInchScreenshots/02 - workout detail.png and b/fastlane/metadata/android/nb-NO/images/tenInchScreenshots/02 - workout detail.png differ diff --git a/fastlane/metadata/android/nb-NO/images/tenInchScreenshots/03 - gym mode.png b/fastlane/metadata/android/nb-NO/images/tenInchScreenshots/03 - gym mode.png index d090759d1..960aa01e7 100644 Binary files a/fastlane/metadata/android/nb-NO/images/tenInchScreenshots/03 - gym mode.png and b/fastlane/metadata/android/nb-NO/images/tenInchScreenshots/03 - gym mode.png differ diff --git a/fastlane/metadata/android/nb-NO/images/tenInchScreenshots/04 - measurements.png b/fastlane/metadata/android/nb-NO/images/tenInchScreenshots/04 - measurements.png index 35057b6d7..c2acba86c 100644 Binary files a/fastlane/metadata/android/nb-NO/images/tenInchScreenshots/04 - measurements.png and b/fastlane/metadata/android/nb-NO/images/tenInchScreenshots/04 - measurements.png differ diff --git a/fastlane/metadata/android/nb-NO/images/tenInchScreenshots/05 - nutritional plan.png b/fastlane/metadata/android/nb-NO/images/tenInchScreenshots/05 - nutritional plan.png index 7f54f7646..6cf4c7bdb 100644 Binary files a/fastlane/metadata/android/nb-NO/images/tenInchScreenshots/05 - nutritional plan.png and b/fastlane/metadata/android/nb-NO/images/tenInchScreenshots/05 - nutritional plan.png differ diff --git a/fastlane/metadata/android/nb-NO/images/tenInchScreenshots/06 - weight.png b/fastlane/metadata/android/nb-NO/images/tenInchScreenshots/06 - weight.png index 36ad43bd9..5d7e2846a 100644 Binary files a/fastlane/metadata/android/nb-NO/images/tenInchScreenshots/06 - weight.png and b/fastlane/metadata/android/nb-NO/images/tenInchScreenshots/06 - weight.png differ diff --git a/fastlane/metadata/android/pl-PL/images/phoneScreenshots/01 - dashboard.png b/fastlane/metadata/android/pl-PL/images/phoneScreenshots/01 - dashboard.png index d338ca57f..f9e9132ed 100644 Binary files a/fastlane/metadata/android/pl-PL/images/phoneScreenshots/01 - dashboard.png and b/fastlane/metadata/android/pl-PL/images/phoneScreenshots/01 - dashboard.png differ diff --git a/fastlane/metadata/android/pl-PL/images/phoneScreenshots/02 - workout detail.png b/fastlane/metadata/android/pl-PL/images/phoneScreenshots/02 - workout detail.png index 8300c697c..345db1459 100644 Binary files a/fastlane/metadata/android/pl-PL/images/phoneScreenshots/02 - workout detail.png and b/fastlane/metadata/android/pl-PL/images/phoneScreenshots/02 - workout detail.png differ diff --git a/fastlane/metadata/android/pl-PL/images/phoneScreenshots/03 - gym mode.png b/fastlane/metadata/android/pl-PL/images/phoneScreenshots/03 - gym mode.png index 6d696b257..412a08507 100644 Binary files a/fastlane/metadata/android/pl-PL/images/phoneScreenshots/03 - gym mode.png and b/fastlane/metadata/android/pl-PL/images/phoneScreenshots/03 - gym mode.png differ diff --git a/fastlane/metadata/android/pl-PL/images/phoneScreenshots/04 - measurements.png b/fastlane/metadata/android/pl-PL/images/phoneScreenshots/04 - measurements.png index d65884c69..e88d447f4 100644 Binary files a/fastlane/metadata/android/pl-PL/images/phoneScreenshots/04 - measurements.png and b/fastlane/metadata/android/pl-PL/images/phoneScreenshots/04 - measurements.png differ diff --git a/fastlane/metadata/android/pl-PL/images/phoneScreenshots/05 - nutritional plan.png b/fastlane/metadata/android/pl-PL/images/phoneScreenshots/05 - nutritional plan.png index ebf7b3f2d..3b013f9dd 100644 Binary files a/fastlane/metadata/android/pl-PL/images/phoneScreenshots/05 - nutritional plan.png and b/fastlane/metadata/android/pl-PL/images/phoneScreenshots/05 - nutritional plan.png differ diff --git a/fastlane/metadata/android/pl-PL/images/phoneScreenshots/06 - weight.png b/fastlane/metadata/android/pl-PL/images/phoneScreenshots/06 - weight.png index 6cca626f0..dd271280c 100644 Binary files a/fastlane/metadata/android/pl-PL/images/phoneScreenshots/06 - weight.png and b/fastlane/metadata/android/pl-PL/images/phoneScreenshots/06 - weight.png differ diff --git a/fastlane/metadata/android/pl-PL/images/sevenInchScreenshots/01 - dashboard.png b/fastlane/metadata/android/pl-PL/images/sevenInchScreenshots/01 - dashboard.png index a86888ed1..926ddba33 100644 Binary files a/fastlane/metadata/android/pl-PL/images/sevenInchScreenshots/01 - dashboard.png and b/fastlane/metadata/android/pl-PL/images/sevenInchScreenshots/01 - dashboard.png differ diff --git a/fastlane/metadata/android/pl-PL/images/sevenInchScreenshots/02 - workout detail.png b/fastlane/metadata/android/pl-PL/images/sevenInchScreenshots/02 - workout detail.png index 897d73466..01b75bacc 100644 Binary files a/fastlane/metadata/android/pl-PL/images/sevenInchScreenshots/02 - workout detail.png and b/fastlane/metadata/android/pl-PL/images/sevenInchScreenshots/02 - workout detail.png differ diff --git a/fastlane/metadata/android/pl-PL/images/sevenInchScreenshots/03 - gym mode.png b/fastlane/metadata/android/pl-PL/images/sevenInchScreenshots/03 - gym mode.png index 11230cd83..a40c724b6 100644 Binary files a/fastlane/metadata/android/pl-PL/images/sevenInchScreenshots/03 - gym mode.png and b/fastlane/metadata/android/pl-PL/images/sevenInchScreenshots/03 - gym mode.png differ diff --git a/fastlane/metadata/android/pl-PL/images/sevenInchScreenshots/04 - measurements.png b/fastlane/metadata/android/pl-PL/images/sevenInchScreenshots/04 - measurements.png index 11a315094..7bfc0a797 100644 Binary files a/fastlane/metadata/android/pl-PL/images/sevenInchScreenshots/04 - measurements.png and b/fastlane/metadata/android/pl-PL/images/sevenInchScreenshots/04 - measurements.png differ diff --git a/fastlane/metadata/android/pl-PL/images/sevenInchScreenshots/05 - nutritional plan.png b/fastlane/metadata/android/pl-PL/images/sevenInchScreenshots/05 - nutritional plan.png index 5bfd00a3c..2f1650c65 100644 Binary files a/fastlane/metadata/android/pl-PL/images/sevenInchScreenshots/05 - nutritional plan.png and b/fastlane/metadata/android/pl-PL/images/sevenInchScreenshots/05 - nutritional plan.png differ diff --git a/fastlane/metadata/android/pl-PL/images/sevenInchScreenshots/06 - weight.png b/fastlane/metadata/android/pl-PL/images/sevenInchScreenshots/06 - weight.png index 57452319e..a1ab2808b 100644 Binary files a/fastlane/metadata/android/pl-PL/images/sevenInchScreenshots/06 - weight.png and b/fastlane/metadata/android/pl-PL/images/sevenInchScreenshots/06 - weight.png differ diff --git a/fastlane/metadata/android/pl-PL/images/tenInchScreenshots/01 - dashboard.png b/fastlane/metadata/android/pl-PL/images/tenInchScreenshots/01 - dashboard.png index 061bbfc02..bf67ead0f 100644 Binary files a/fastlane/metadata/android/pl-PL/images/tenInchScreenshots/01 - dashboard.png and b/fastlane/metadata/android/pl-PL/images/tenInchScreenshots/01 - dashboard.png differ diff --git a/fastlane/metadata/android/pl-PL/images/tenInchScreenshots/02 - workout detail.png b/fastlane/metadata/android/pl-PL/images/tenInchScreenshots/02 - workout detail.png index 15b1ad1d1..9166a3527 100644 Binary files a/fastlane/metadata/android/pl-PL/images/tenInchScreenshots/02 - workout detail.png and b/fastlane/metadata/android/pl-PL/images/tenInchScreenshots/02 - workout detail.png differ diff --git a/fastlane/metadata/android/pl-PL/images/tenInchScreenshots/03 - gym mode.png b/fastlane/metadata/android/pl-PL/images/tenInchScreenshots/03 - gym mode.png index a38e846f3..54b1eb573 100644 Binary files a/fastlane/metadata/android/pl-PL/images/tenInchScreenshots/03 - gym mode.png and b/fastlane/metadata/android/pl-PL/images/tenInchScreenshots/03 - gym mode.png differ diff --git a/fastlane/metadata/android/pl-PL/images/tenInchScreenshots/04 - measurements.png b/fastlane/metadata/android/pl-PL/images/tenInchScreenshots/04 - measurements.png index 10f328b49..da4e42ed3 100644 Binary files a/fastlane/metadata/android/pl-PL/images/tenInchScreenshots/04 - measurements.png and b/fastlane/metadata/android/pl-PL/images/tenInchScreenshots/04 - measurements.png differ diff --git a/fastlane/metadata/android/pl-PL/images/tenInchScreenshots/05 - nutritional plan.png b/fastlane/metadata/android/pl-PL/images/tenInchScreenshots/05 - nutritional plan.png index 097448d60..52a66ce14 100644 Binary files a/fastlane/metadata/android/pl-PL/images/tenInchScreenshots/05 - nutritional plan.png and b/fastlane/metadata/android/pl-PL/images/tenInchScreenshots/05 - nutritional plan.png differ diff --git a/fastlane/metadata/android/pl-PL/images/tenInchScreenshots/06 - weight.png b/fastlane/metadata/android/pl-PL/images/tenInchScreenshots/06 - weight.png index e8a716f2a..3b29f7858 100644 Binary files a/fastlane/metadata/android/pl-PL/images/tenInchScreenshots/06 - weight.png and b/fastlane/metadata/android/pl-PL/images/tenInchScreenshots/06 - weight.png differ diff --git a/fastlane/metadata/android/pt-BR/images/phoneScreenshots/01 - dashboard.png b/fastlane/metadata/android/pt-BR/images/phoneScreenshots/01 - dashboard.png index 098d4fef7..b6b77b178 100644 Binary files a/fastlane/metadata/android/pt-BR/images/phoneScreenshots/01 - dashboard.png and b/fastlane/metadata/android/pt-BR/images/phoneScreenshots/01 - dashboard.png differ diff --git a/fastlane/metadata/android/pt-BR/images/phoneScreenshots/02 - workout detail.png b/fastlane/metadata/android/pt-BR/images/phoneScreenshots/02 - workout detail.png index 87bc52f70..c84248e14 100644 Binary files a/fastlane/metadata/android/pt-BR/images/phoneScreenshots/02 - workout detail.png and b/fastlane/metadata/android/pt-BR/images/phoneScreenshots/02 - workout detail.png differ diff --git a/fastlane/metadata/android/pt-BR/images/phoneScreenshots/03 - gym mode.png b/fastlane/metadata/android/pt-BR/images/phoneScreenshots/03 - gym mode.png index f6c363705..b17ec320b 100644 Binary files a/fastlane/metadata/android/pt-BR/images/phoneScreenshots/03 - gym mode.png and b/fastlane/metadata/android/pt-BR/images/phoneScreenshots/03 - gym mode.png differ diff --git a/fastlane/metadata/android/pt-BR/images/phoneScreenshots/04 - measurements.png b/fastlane/metadata/android/pt-BR/images/phoneScreenshots/04 - measurements.png index b841b776f..cdb7fe82d 100644 Binary files a/fastlane/metadata/android/pt-BR/images/phoneScreenshots/04 - measurements.png and b/fastlane/metadata/android/pt-BR/images/phoneScreenshots/04 - measurements.png differ diff --git a/fastlane/metadata/android/pt-BR/images/phoneScreenshots/05 - nutritional plan.png b/fastlane/metadata/android/pt-BR/images/phoneScreenshots/05 - nutritional plan.png index ad5c3ff61..4d0b2e938 100644 Binary files a/fastlane/metadata/android/pt-BR/images/phoneScreenshots/05 - nutritional plan.png and b/fastlane/metadata/android/pt-BR/images/phoneScreenshots/05 - nutritional plan.png differ diff --git a/fastlane/metadata/android/pt-BR/images/phoneScreenshots/06 - weight.png b/fastlane/metadata/android/pt-BR/images/phoneScreenshots/06 - weight.png index 21df0fe26..3cdf93fa1 100644 Binary files a/fastlane/metadata/android/pt-BR/images/phoneScreenshots/06 - weight.png and b/fastlane/metadata/android/pt-BR/images/phoneScreenshots/06 - weight.png differ diff --git a/fastlane/metadata/android/pt-BR/images/sevenInchScreenshots/01 - dashboard.png b/fastlane/metadata/android/pt-BR/images/sevenInchScreenshots/01 - dashboard.png index 86815628c..78bea1692 100644 Binary files a/fastlane/metadata/android/pt-BR/images/sevenInchScreenshots/01 - dashboard.png and b/fastlane/metadata/android/pt-BR/images/sevenInchScreenshots/01 - dashboard.png differ diff --git a/fastlane/metadata/android/pt-BR/images/sevenInchScreenshots/02 - workout detail.png b/fastlane/metadata/android/pt-BR/images/sevenInchScreenshots/02 - workout detail.png index 83b6cfb3e..c59a6f5b3 100644 Binary files a/fastlane/metadata/android/pt-BR/images/sevenInchScreenshots/02 - workout detail.png and b/fastlane/metadata/android/pt-BR/images/sevenInchScreenshots/02 - workout detail.png differ diff --git a/fastlane/metadata/android/pt-BR/images/sevenInchScreenshots/03 - gym mode.png b/fastlane/metadata/android/pt-BR/images/sevenInchScreenshots/03 - gym mode.png index d87db1346..7fe209dc2 100644 Binary files a/fastlane/metadata/android/pt-BR/images/sevenInchScreenshots/03 - gym mode.png and b/fastlane/metadata/android/pt-BR/images/sevenInchScreenshots/03 - gym mode.png differ diff --git a/fastlane/metadata/android/pt-BR/images/sevenInchScreenshots/04 - measurements.png b/fastlane/metadata/android/pt-BR/images/sevenInchScreenshots/04 - measurements.png index 9fc122396..8e56f838f 100644 Binary files a/fastlane/metadata/android/pt-BR/images/sevenInchScreenshots/04 - measurements.png and b/fastlane/metadata/android/pt-BR/images/sevenInchScreenshots/04 - measurements.png differ diff --git a/fastlane/metadata/android/pt-BR/images/sevenInchScreenshots/05 - nutritional plan.png b/fastlane/metadata/android/pt-BR/images/sevenInchScreenshots/05 - nutritional plan.png index cc61b9528..7e3b0ed2a 100644 Binary files a/fastlane/metadata/android/pt-BR/images/sevenInchScreenshots/05 - nutritional plan.png and b/fastlane/metadata/android/pt-BR/images/sevenInchScreenshots/05 - nutritional plan.png differ diff --git a/fastlane/metadata/android/pt-BR/images/sevenInchScreenshots/06 - weight.png b/fastlane/metadata/android/pt-BR/images/sevenInchScreenshots/06 - weight.png index 1e8930d54..0381b77f2 100644 Binary files a/fastlane/metadata/android/pt-BR/images/sevenInchScreenshots/06 - weight.png and b/fastlane/metadata/android/pt-BR/images/sevenInchScreenshots/06 - weight.png differ diff --git a/fastlane/metadata/android/pt-BR/images/tenInchScreenshots/01 - dashboard.png b/fastlane/metadata/android/pt-BR/images/tenInchScreenshots/01 - dashboard.png index 38d494b91..c5c48366f 100644 Binary files a/fastlane/metadata/android/pt-BR/images/tenInchScreenshots/01 - dashboard.png and b/fastlane/metadata/android/pt-BR/images/tenInchScreenshots/01 - dashboard.png differ diff --git a/fastlane/metadata/android/pt-BR/images/tenInchScreenshots/02 - workout detail.png b/fastlane/metadata/android/pt-BR/images/tenInchScreenshots/02 - workout detail.png index d03d7a55f..9ac26272b 100644 Binary files a/fastlane/metadata/android/pt-BR/images/tenInchScreenshots/02 - workout detail.png and b/fastlane/metadata/android/pt-BR/images/tenInchScreenshots/02 - workout detail.png differ diff --git a/fastlane/metadata/android/pt-BR/images/tenInchScreenshots/03 - gym mode.png b/fastlane/metadata/android/pt-BR/images/tenInchScreenshots/03 - gym mode.png index c3f0ab18a..8dbeb4565 100644 Binary files a/fastlane/metadata/android/pt-BR/images/tenInchScreenshots/03 - gym mode.png and b/fastlane/metadata/android/pt-BR/images/tenInchScreenshots/03 - gym mode.png differ diff --git a/fastlane/metadata/android/pt-BR/images/tenInchScreenshots/04 - measurements.png b/fastlane/metadata/android/pt-BR/images/tenInchScreenshots/04 - measurements.png index 68e0e43d8..3dca15dc7 100644 Binary files a/fastlane/metadata/android/pt-BR/images/tenInchScreenshots/04 - measurements.png and b/fastlane/metadata/android/pt-BR/images/tenInchScreenshots/04 - measurements.png differ diff --git a/fastlane/metadata/android/pt-BR/images/tenInchScreenshots/05 - nutritional plan.png b/fastlane/metadata/android/pt-BR/images/tenInchScreenshots/05 - nutritional plan.png index bbabdf54c..9e7661086 100644 Binary files a/fastlane/metadata/android/pt-BR/images/tenInchScreenshots/05 - nutritional plan.png and b/fastlane/metadata/android/pt-BR/images/tenInchScreenshots/05 - nutritional plan.png differ diff --git a/fastlane/metadata/android/pt-BR/images/tenInchScreenshots/06 - weight.png b/fastlane/metadata/android/pt-BR/images/tenInchScreenshots/06 - weight.png index 370c43f5f..7ff7d62dd 100644 Binary files a/fastlane/metadata/android/pt-BR/images/tenInchScreenshots/06 - weight.png and b/fastlane/metadata/android/pt-BR/images/tenInchScreenshots/06 - weight.png differ diff --git a/fastlane/metadata/android/pt-PT/images/phoneScreenshots/01 - dashboard.png b/fastlane/metadata/android/pt-PT/images/phoneScreenshots/01 - dashboard.png index b8b676c95..b3c994b3b 100644 Binary files a/fastlane/metadata/android/pt-PT/images/phoneScreenshots/01 - dashboard.png and b/fastlane/metadata/android/pt-PT/images/phoneScreenshots/01 - dashboard.png differ diff --git a/fastlane/metadata/android/pt-PT/images/phoneScreenshots/02 - workout detail.png b/fastlane/metadata/android/pt-PT/images/phoneScreenshots/02 - workout detail.png index 87bc52f70..c84248e14 100644 Binary files a/fastlane/metadata/android/pt-PT/images/phoneScreenshots/02 - workout detail.png and b/fastlane/metadata/android/pt-PT/images/phoneScreenshots/02 - workout detail.png differ diff --git a/fastlane/metadata/android/pt-PT/images/phoneScreenshots/03 - gym mode.png b/fastlane/metadata/android/pt-PT/images/phoneScreenshots/03 - gym mode.png index f6c363705..b17ec320b 100644 Binary files a/fastlane/metadata/android/pt-PT/images/phoneScreenshots/03 - gym mode.png and b/fastlane/metadata/android/pt-PT/images/phoneScreenshots/03 - gym mode.png differ diff --git a/fastlane/metadata/android/pt-PT/images/phoneScreenshots/04 - measurements.png b/fastlane/metadata/android/pt-PT/images/phoneScreenshots/04 - measurements.png index b841b776f..cdb7fe82d 100644 Binary files a/fastlane/metadata/android/pt-PT/images/phoneScreenshots/04 - measurements.png and b/fastlane/metadata/android/pt-PT/images/phoneScreenshots/04 - measurements.png differ diff --git a/fastlane/metadata/android/pt-PT/images/phoneScreenshots/05 - nutritional plan.png b/fastlane/metadata/android/pt-PT/images/phoneScreenshots/05 - nutritional plan.png index feb9efe43..59f6ce150 100644 Binary files a/fastlane/metadata/android/pt-PT/images/phoneScreenshots/05 - nutritional plan.png and b/fastlane/metadata/android/pt-PT/images/phoneScreenshots/05 - nutritional plan.png differ diff --git a/fastlane/metadata/android/pt-PT/images/phoneScreenshots/06 - weight.png b/fastlane/metadata/android/pt-PT/images/phoneScreenshots/06 - weight.png index 21df0fe26..3cdf93fa1 100644 Binary files a/fastlane/metadata/android/pt-PT/images/phoneScreenshots/06 - weight.png and b/fastlane/metadata/android/pt-PT/images/phoneScreenshots/06 - weight.png differ diff --git a/fastlane/metadata/android/pt-PT/images/sevenInchScreenshots/01 - dashboard.png b/fastlane/metadata/android/pt-PT/images/sevenInchScreenshots/01 - dashboard.png index 8a7de00a2..11a0f03c2 100644 Binary files a/fastlane/metadata/android/pt-PT/images/sevenInchScreenshots/01 - dashboard.png and b/fastlane/metadata/android/pt-PT/images/sevenInchScreenshots/01 - dashboard.png differ diff --git a/fastlane/metadata/android/pt-PT/images/sevenInchScreenshots/02 - workout detail.png b/fastlane/metadata/android/pt-PT/images/sevenInchScreenshots/02 - workout detail.png index 83b6cfb3e..c59a6f5b3 100644 Binary files a/fastlane/metadata/android/pt-PT/images/sevenInchScreenshots/02 - workout detail.png and b/fastlane/metadata/android/pt-PT/images/sevenInchScreenshots/02 - workout detail.png differ diff --git a/fastlane/metadata/android/pt-PT/images/sevenInchScreenshots/03 - gym mode.png b/fastlane/metadata/android/pt-PT/images/sevenInchScreenshots/03 - gym mode.png index d87db1346..7fe209dc2 100644 Binary files a/fastlane/metadata/android/pt-PT/images/sevenInchScreenshots/03 - gym mode.png and b/fastlane/metadata/android/pt-PT/images/sevenInchScreenshots/03 - gym mode.png differ diff --git a/fastlane/metadata/android/pt-PT/images/sevenInchScreenshots/04 - measurements.png b/fastlane/metadata/android/pt-PT/images/sevenInchScreenshots/04 - measurements.png index 9fc122396..8e56f838f 100644 Binary files a/fastlane/metadata/android/pt-PT/images/sevenInchScreenshots/04 - measurements.png and b/fastlane/metadata/android/pt-PT/images/sevenInchScreenshots/04 - measurements.png differ diff --git a/fastlane/metadata/android/pt-PT/images/sevenInchScreenshots/05 - nutritional plan.png b/fastlane/metadata/android/pt-PT/images/sevenInchScreenshots/05 - nutritional plan.png index db9cf08eb..e0b844f15 100644 Binary files a/fastlane/metadata/android/pt-PT/images/sevenInchScreenshots/05 - nutritional plan.png and b/fastlane/metadata/android/pt-PT/images/sevenInchScreenshots/05 - nutritional plan.png differ diff --git a/fastlane/metadata/android/pt-PT/images/sevenInchScreenshots/06 - weight.png b/fastlane/metadata/android/pt-PT/images/sevenInchScreenshots/06 - weight.png index 1e8930d54..0381b77f2 100644 Binary files a/fastlane/metadata/android/pt-PT/images/sevenInchScreenshots/06 - weight.png and b/fastlane/metadata/android/pt-PT/images/sevenInchScreenshots/06 - weight.png differ diff --git a/fastlane/metadata/android/pt-PT/images/tenInchScreenshots/01 - dashboard.png b/fastlane/metadata/android/pt-PT/images/tenInchScreenshots/01 - dashboard.png index 1c04c7c77..27673bbde 100644 Binary files a/fastlane/metadata/android/pt-PT/images/tenInchScreenshots/01 - dashboard.png and b/fastlane/metadata/android/pt-PT/images/tenInchScreenshots/01 - dashboard.png differ diff --git a/fastlane/metadata/android/pt-PT/images/tenInchScreenshots/02 - workout detail.png b/fastlane/metadata/android/pt-PT/images/tenInchScreenshots/02 - workout detail.png index d03d7a55f..9ac26272b 100644 Binary files a/fastlane/metadata/android/pt-PT/images/tenInchScreenshots/02 - workout detail.png and b/fastlane/metadata/android/pt-PT/images/tenInchScreenshots/02 - workout detail.png differ diff --git a/fastlane/metadata/android/pt-PT/images/tenInchScreenshots/03 - gym mode.png b/fastlane/metadata/android/pt-PT/images/tenInchScreenshots/03 - gym mode.png index c3f0ab18a..8dbeb4565 100644 Binary files a/fastlane/metadata/android/pt-PT/images/tenInchScreenshots/03 - gym mode.png and b/fastlane/metadata/android/pt-PT/images/tenInchScreenshots/03 - gym mode.png differ diff --git a/fastlane/metadata/android/pt-PT/images/tenInchScreenshots/04 - measurements.png b/fastlane/metadata/android/pt-PT/images/tenInchScreenshots/04 - measurements.png index 68e0e43d8..3dca15dc7 100644 Binary files a/fastlane/metadata/android/pt-PT/images/tenInchScreenshots/04 - measurements.png and b/fastlane/metadata/android/pt-PT/images/tenInchScreenshots/04 - measurements.png differ diff --git a/fastlane/metadata/android/pt-PT/images/tenInchScreenshots/05 - nutritional plan.png b/fastlane/metadata/android/pt-PT/images/tenInchScreenshots/05 - nutritional plan.png index 33e907552..a0ab80259 100644 Binary files a/fastlane/metadata/android/pt-PT/images/tenInchScreenshots/05 - nutritional plan.png and b/fastlane/metadata/android/pt-PT/images/tenInchScreenshots/05 - nutritional plan.png differ diff --git a/fastlane/metadata/android/pt-PT/images/tenInchScreenshots/06 - weight.png b/fastlane/metadata/android/pt-PT/images/tenInchScreenshots/06 - weight.png index 370c43f5f..7ff7d62dd 100644 Binary files a/fastlane/metadata/android/pt-PT/images/tenInchScreenshots/06 - weight.png and b/fastlane/metadata/android/pt-PT/images/tenInchScreenshots/06 - weight.png differ diff --git a/fastlane/metadata/android/ru-RU/images/phoneScreenshots/01 - dashboard.png b/fastlane/metadata/android/ru-RU/images/phoneScreenshots/01 - dashboard.png index 782122722..345ed115b 100644 Binary files a/fastlane/metadata/android/ru-RU/images/phoneScreenshots/01 - dashboard.png and b/fastlane/metadata/android/ru-RU/images/phoneScreenshots/01 - dashboard.png differ diff --git a/fastlane/metadata/android/ru-RU/images/phoneScreenshots/02 - workout detail.png b/fastlane/metadata/android/ru-RU/images/phoneScreenshots/02 - workout detail.png index f5ace6b3f..345db1459 100644 Binary files a/fastlane/metadata/android/ru-RU/images/phoneScreenshots/02 - workout detail.png and b/fastlane/metadata/android/ru-RU/images/phoneScreenshots/02 - workout detail.png differ diff --git a/fastlane/metadata/android/ru-RU/images/phoneScreenshots/03 - gym mode.png b/fastlane/metadata/android/ru-RU/images/phoneScreenshots/03 - gym mode.png index 38fc06352..22d628856 100644 Binary files a/fastlane/metadata/android/ru-RU/images/phoneScreenshots/03 - gym mode.png and b/fastlane/metadata/android/ru-RU/images/phoneScreenshots/03 - gym mode.png differ diff --git a/fastlane/metadata/android/ru-RU/images/phoneScreenshots/04 - measurements.png b/fastlane/metadata/android/ru-RU/images/phoneScreenshots/04 - measurements.png index 928dfe3cc..3904576a7 100644 Binary files a/fastlane/metadata/android/ru-RU/images/phoneScreenshots/04 - measurements.png and b/fastlane/metadata/android/ru-RU/images/phoneScreenshots/04 - measurements.png differ diff --git a/fastlane/metadata/android/ru-RU/images/phoneScreenshots/05 - nutritional plan.png b/fastlane/metadata/android/ru-RU/images/phoneScreenshots/05 - nutritional plan.png index 284c496de..2768d0a6c 100644 Binary files a/fastlane/metadata/android/ru-RU/images/phoneScreenshots/05 - nutritional plan.png and b/fastlane/metadata/android/ru-RU/images/phoneScreenshots/05 - nutritional plan.png differ diff --git a/fastlane/metadata/android/ru-RU/images/phoneScreenshots/06 - weight.png b/fastlane/metadata/android/ru-RU/images/phoneScreenshots/06 - weight.png index 2e1e3b15b..392216f5f 100644 Binary files a/fastlane/metadata/android/ru-RU/images/phoneScreenshots/06 - weight.png and b/fastlane/metadata/android/ru-RU/images/phoneScreenshots/06 - weight.png differ diff --git a/fastlane/metadata/android/ru-RU/images/sevenInchScreenshots/01 - dashboard.png b/fastlane/metadata/android/ru-RU/images/sevenInchScreenshots/01 - dashboard.png index 10690ef60..11c62cc95 100644 Binary files a/fastlane/metadata/android/ru-RU/images/sevenInchScreenshots/01 - dashboard.png and b/fastlane/metadata/android/ru-RU/images/sevenInchScreenshots/01 - dashboard.png differ diff --git a/fastlane/metadata/android/ru-RU/images/sevenInchScreenshots/02 - workout detail.png b/fastlane/metadata/android/ru-RU/images/sevenInchScreenshots/02 - workout detail.png index 7e730d4b5..01b75bacc 100644 Binary files a/fastlane/metadata/android/ru-RU/images/sevenInchScreenshots/02 - workout detail.png and b/fastlane/metadata/android/ru-RU/images/sevenInchScreenshots/02 - workout detail.png differ diff --git a/fastlane/metadata/android/ru-RU/images/sevenInchScreenshots/03 - gym mode.png b/fastlane/metadata/android/ru-RU/images/sevenInchScreenshots/03 - gym mode.png index 6ba7b89a2..b14fd290f 100644 Binary files a/fastlane/metadata/android/ru-RU/images/sevenInchScreenshots/03 - gym mode.png and b/fastlane/metadata/android/ru-RU/images/sevenInchScreenshots/03 - gym mode.png differ diff --git a/fastlane/metadata/android/ru-RU/images/sevenInchScreenshots/04 - measurements.png b/fastlane/metadata/android/ru-RU/images/sevenInchScreenshots/04 - measurements.png index a877fc837..6e461af0b 100644 Binary files a/fastlane/metadata/android/ru-RU/images/sevenInchScreenshots/04 - measurements.png and b/fastlane/metadata/android/ru-RU/images/sevenInchScreenshots/04 - measurements.png differ diff --git a/fastlane/metadata/android/ru-RU/images/sevenInchScreenshots/05 - nutritional plan.png b/fastlane/metadata/android/ru-RU/images/sevenInchScreenshots/05 - nutritional plan.png index f5f26a319..9d8319324 100644 Binary files a/fastlane/metadata/android/ru-RU/images/sevenInchScreenshots/05 - nutritional plan.png and b/fastlane/metadata/android/ru-RU/images/sevenInchScreenshots/05 - nutritional plan.png differ diff --git a/fastlane/metadata/android/ru-RU/images/sevenInchScreenshots/06 - weight.png b/fastlane/metadata/android/ru-RU/images/sevenInchScreenshots/06 - weight.png index a590a0c3c..092a88a53 100644 Binary files a/fastlane/metadata/android/ru-RU/images/sevenInchScreenshots/06 - weight.png and b/fastlane/metadata/android/ru-RU/images/sevenInchScreenshots/06 - weight.png differ diff --git a/fastlane/metadata/android/ru-RU/images/tenInchScreenshots/01 - dashboard.png b/fastlane/metadata/android/ru-RU/images/tenInchScreenshots/01 - dashboard.png index 874567a40..483be7e30 100644 Binary files a/fastlane/metadata/android/ru-RU/images/tenInchScreenshots/01 - dashboard.png and b/fastlane/metadata/android/ru-RU/images/tenInchScreenshots/01 - dashboard.png differ diff --git a/fastlane/metadata/android/ru-RU/images/tenInchScreenshots/02 - workout detail.png b/fastlane/metadata/android/ru-RU/images/tenInchScreenshots/02 - workout detail.png index d42f3cdba..9166a3527 100644 Binary files a/fastlane/metadata/android/ru-RU/images/tenInchScreenshots/02 - workout detail.png and b/fastlane/metadata/android/ru-RU/images/tenInchScreenshots/02 - workout detail.png differ diff --git a/fastlane/metadata/android/ru-RU/images/tenInchScreenshots/03 - gym mode.png b/fastlane/metadata/android/ru-RU/images/tenInchScreenshots/03 - gym mode.png index d29ee7a06..5da54606a 100644 Binary files a/fastlane/metadata/android/ru-RU/images/tenInchScreenshots/03 - gym mode.png and b/fastlane/metadata/android/ru-RU/images/tenInchScreenshots/03 - gym mode.png differ diff --git a/fastlane/metadata/android/ru-RU/images/tenInchScreenshots/04 - measurements.png b/fastlane/metadata/android/ru-RU/images/tenInchScreenshots/04 - measurements.png index 6eca6d25c..4d3d8dd5e 100644 Binary files a/fastlane/metadata/android/ru-RU/images/tenInchScreenshots/04 - measurements.png and b/fastlane/metadata/android/ru-RU/images/tenInchScreenshots/04 - measurements.png differ diff --git a/fastlane/metadata/android/ru-RU/images/tenInchScreenshots/05 - nutritional plan.png b/fastlane/metadata/android/ru-RU/images/tenInchScreenshots/05 - nutritional plan.png index db0d9cde6..b26d78b93 100644 Binary files a/fastlane/metadata/android/ru-RU/images/tenInchScreenshots/05 - nutritional plan.png and b/fastlane/metadata/android/ru-RU/images/tenInchScreenshots/05 - nutritional plan.png differ diff --git a/fastlane/metadata/android/ru-RU/images/tenInchScreenshots/06 - weight.png b/fastlane/metadata/android/ru-RU/images/tenInchScreenshots/06 - weight.png index 3edefdc84..f3b65c464 100644 Binary files a/fastlane/metadata/android/ru-RU/images/tenInchScreenshots/06 - weight.png and b/fastlane/metadata/android/ru-RU/images/tenInchScreenshots/06 - weight.png differ diff --git a/fastlane/metadata/android/sr/images/phoneScreenshots/01 - dashboard.png b/fastlane/metadata/android/sr/images/phoneScreenshots/01 - dashboard.png new file mode 100644 index 000000000..783879983 Binary files /dev/null and b/fastlane/metadata/android/sr/images/phoneScreenshots/01 - dashboard.png differ diff --git a/fastlane/metadata/android/sr/images/phoneScreenshots/02 - workout detail.png b/fastlane/metadata/android/sr/images/phoneScreenshots/02 - workout detail.png new file mode 100644 index 000000000..345db1459 Binary files /dev/null and b/fastlane/metadata/android/sr/images/phoneScreenshots/02 - workout detail.png differ diff --git a/fastlane/metadata/android/sr/images/phoneScreenshots/03 - gym mode.png b/fastlane/metadata/android/sr/images/phoneScreenshots/03 - gym mode.png new file mode 100644 index 000000000..de51f40ed Binary files /dev/null and b/fastlane/metadata/android/sr/images/phoneScreenshots/03 - gym mode.png differ diff --git a/fastlane/metadata/android/sr/images/phoneScreenshots/04 - measurements.png b/fastlane/metadata/android/sr/images/phoneScreenshots/04 - measurements.png new file mode 100644 index 000000000..7bc613ca5 Binary files /dev/null and b/fastlane/metadata/android/sr/images/phoneScreenshots/04 - measurements.png differ diff --git a/fastlane/metadata/android/sr/images/phoneScreenshots/05 - nutritional plan.png b/fastlane/metadata/android/sr/images/phoneScreenshots/05 - nutritional plan.png new file mode 100644 index 000000000..6c438a9f0 Binary files /dev/null and b/fastlane/metadata/android/sr/images/phoneScreenshots/05 - nutritional plan.png differ diff --git a/fastlane/metadata/android/sr/images/phoneScreenshots/06 - weight.png b/fastlane/metadata/android/sr/images/phoneScreenshots/06 - weight.png new file mode 100644 index 000000000..4a16c4442 Binary files /dev/null and b/fastlane/metadata/android/sr/images/phoneScreenshots/06 - weight.png differ diff --git a/fastlane/metadata/android/sr/images/sevenInchScreenshots/01 - dashboard.png b/fastlane/metadata/android/sr/images/sevenInchScreenshots/01 - dashboard.png new file mode 100644 index 000000000..ff2090a0e Binary files /dev/null and b/fastlane/metadata/android/sr/images/sevenInchScreenshots/01 - dashboard.png differ diff --git a/fastlane/metadata/android/sr/images/sevenInchScreenshots/02 - workout detail.png b/fastlane/metadata/android/sr/images/sevenInchScreenshots/02 - workout detail.png new file mode 100644 index 000000000..01b75bacc Binary files /dev/null and b/fastlane/metadata/android/sr/images/sevenInchScreenshots/02 - workout detail.png differ diff --git a/fastlane/metadata/android/sr/images/sevenInchScreenshots/03 - gym mode.png b/fastlane/metadata/android/sr/images/sevenInchScreenshots/03 - gym mode.png new file mode 100644 index 000000000..f4ec012b5 Binary files /dev/null and b/fastlane/metadata/android/sr/images/sevenInchScreenshots/03 - gym mode.png differ diff --git a/fastlane/metadata/android/sr/images/sevenInchScreenshots/04 - measurements.png b/fastlane/metadata/android/sr/images/sevenInchScreenshots/04 - measurements.png new file mode 100644 index 000000000..84d5c4734 Binary files /dev/null and b/fastlane/metadata/android/sr/images/sevenInchScreenshots/04 - measurements.png differ diff --git a/fastlane/metadata/android/sr/images/sevenInchScreenshots/05 - nutritional plan.png b/fastlane/metadata/android/sr/images/sevenInchScreenshots/05 - nutritional plan.png new file mode 100644 index 000000000..c32be4d72 Binary files /dev/null and b/fastlane/metadata/android/sr/images/sevenInchScreenshots/05 - nutritional plan.png differ diff --git a/fastlane/metadata/android/sr/images/sevenInchScreenshots/06 - weight.png b/fastlane/metadata/android/sr/images/sevenInchScreenshots/06 - weight.png new file mode 100644 index 000000000..e6b4f4c20 Binary files /dev/null and b/fastlane/metadata/android/sr/images/sevenInchScreenshots/06 - weight.png differ diff --git a/fastlane/metadata/android/sr/images/tenInchScreenshots/01 - dashboard.png b/fastlane/metadata/android/sr/images/tenInchScreenshots/01 - dashboard.png new file mode 100644 index 000000000..bcaeadda0 Binary files /dev/null and b/fastlane/metadata/android/sr/images/tenInchScreenshots/01 - dashboard.png differ diff --git a/fastlane/metadata/android/sr/images/tenInchScreenshots/02 - workout detail.png b/fastlane/metadata/android/sr/images/tenInchScreenshots/02 - workout detail.png new file mode 100644 index 000000000..9166a3527 Binary files /dev/null and b/fastlane/metadata/android/sr/images/tenInchScreenshots/02 - workout detail.png differ diff --git a/fastlane/metadata/android/sr/images/tenInchScreenshots/03 - gym mode.png b/fastlane/metadata/android/sr/images/tenInchScreenshots/03 - gym mode.png new file mode 100644 index 000000000..960aa01e7 Binary files /dev/null and b/fastlane/metadata/android/sr/images/tenInchScreenshots/03 - gym mode.png differ diff --git a/fastlane/metadata/android/sr/images/tenInchScreenshots/04 - measurements.png b/fastlane/metadata/android/sr/images/tenInchScreenshots/04 - measurements.png new file mode 100644 index 000000000..c127856b4 Binary files /dev/null and b/fastlane/metadata/android/sr/images/tenInchScreenshots/04 - measurements.png differ diff --git a/fastlane/metadata/android/sr/images/tenInchScreenshots/05 - nutritional plan.png b/fastlane/metadata/android/sr/images/tenInchScreenshots/05 - nutritional plan.png new file mode 100644 index 000000000..7627ad84b Binary files /dev/null and b/fastlane/metadata/android/sr/images/tenInchScreenshots/05 - nutritional plan.png differ diff --git a/fastlane/metadata/android/sr/images/tenInchScreenshots/06 - weight.png b/fastlane/metadata/android/sr/images/tenInchScreenshots/06 - weight.png new file mode 100644 index 000000000..d96730be7 Binary files /dev/null and b/fastlane/metadata/android/sr/images/tenInchScreenshots/06 - weight.png differ diff --git a/fastlane/metadata/android/tr-TR/images/phoneScreenshots/01 - dashboard.png b/fastlane/metadata/android/tr-TR/images/phoneScreenshots/01 - dashboard.png index 4fe3a0717..94b1027d6 100644 Binary files a/fastlane/metadata/android/tr-TR/images/phoneScreenshots/01 - dashboard.png and b/fastlane/metadata/android/tr-TR/images/phoneScreenshots/01 - dashboard.png differ diff --git a/fastlane/metadata/android/tr-TR/images/phoneScreenshots/02 - workout detail.png b/fastlane/metadata/android/tr-TR/images/phoneScreenshots/02 - workout detail.png index 22f0a2501..09c4ea38d 100644 Binary files a/fastlane/metadata/android/tr-TR/images/phoneScreenshots/02 - workout detail.png and b/fastlane/metadata/android/tr-TR/images/phoneScreenshots/02 - workout detail.png differ diff --git a/fastlane/metadata/android/tr-TR/images/phoneScreenshots/03 - gym mode.png b/fastlane/metadata/android/tr-TR/images/phoneScreenshots/03 - gym mode.png index 8a89f676f..c894c5dda 100644 Binary files a/fastlane/metadata/android/tr-TR/images/phoneScreenshots/03 - gym mode.png and b/fastlane/metadata/android/tr-TR/images/phoneScreenshots/03 - gym mode.png differ diff --git a/fastlane/metadata/android/tr-TR/images/phoneScreenshots/04 - measurements.png b/fastlane/metadata/android/tr-TR/images/phoneScreenshots/04 - measurements.png index a320ecb20..8b86a1b81 100644 Binary files a/fastlane/metadata/android/tr-TR/images/phoneScreenshots/04 - measurements.png and b/fastlane/metadata/android/tr-TR/images/phoneScreenshots/04 - measurements.png differ diff --git a/fastlane/metadata/android/tr-TR/images/phoneScreenshots/05 - nutritional plan.png b/fastlane/metadata/android/tr-TR/images/phoneScreenshots/05 - nutritional plan.png index cfe850ca1..0f68e78e5 100644 Binary files a/fastlane/metadata/android/tr-TR/images/phoneScreenshots/05 - nutritional plan.png and b/fastlane/metadata/android/tr-TR/images/phoneScreenshots/05 - nutritional plan.png differ diff --git a/fastlane/metadata/android/tr-TR/images/phoneScreenshots/06 - weight.png b/fastlane/metadata/android/tr-TR/images/phoneScreenshots/06 - weight.png index 5e0217197..c1f209449 100644 Binary files a/fastlane/metadata/android/tr-TR/images/phoneScreenshots/06 - weight.png and b/fastlane/metadata/android/tr-TR/images/phoneScreenshots/06 - weight.png differ diff --git a/fastlane/metadata/android/tr-TR/images/sevenInchScreenshots/01 - dashboard.png b/fastlane/metadata/android/tr-TR/images/sevenInchScreenshots/01 - dashboard.png index 951f90117..2f535677e 100644 Binary files a/fastlane/metadata/android/tr-TR/images/sevenInchScreenshots/01 - dashboard.png and b/fastlane/metadata/android/tr-TR/images/sevenInchScreenshots/01 - dashboard.png differ diff --git a/fastlane/metadata/android/tr-TR/images/sevenInchScreenshots/02 - workout detail.png b/fastlane/metadata/android/tr-TR/images/sevenInchScreenshots/02 - workout detail.png index 358bb5549..0a4105553 100644 Binary files a/fastlane/metadata/android/tr-TR/images/sevenInchScreenshots/02 - workout detail.png and b/fastlane/metadata/android/tr-TR/images/sevenInchScreenshots/02 - workout detail.png differ diff --git a/fastlane/metadata/android/tr-TR/images/sevenInchScreenshots/03 - gym mode.png b/fastlane/metadata/android/tr-TR/images/sevenInchScreenshots/03 - gym mode.png index f84335a79..a85cfe414 100644 Binary files a/fastlane/metadata/android/tr-TR/images/sevenInchScreenshots/03 - gym mode.png and b/fastlane/metadata/android/tr-TR/images/sevenInchScreenshots/03 - gym mode.png differ diff --git a/fastlane/metadata/android/tr-TR/images/sevenInchScreenshots/04 - measurements.png b/fastlane/metadata/android/tr-TR/images/sevenInchScreenshots/04 - measurements.png index dc0027061..72bc805a5 100644 Binary files a/fastlane/metadata/android/tr-TR/images/sevenInchScreenshots/04 - measurements.png and b/fastlane/metadata/android/tr-TR/images/sevenInchScreenshots/04 - measurements.png differ diff --git a/fastlane/metadata/android/tr-TR/images/sevenInchScreenshots/05 - nutritional plan.png b/fastlane/metadata/android/tr-TR/images/sevenInchScreenshots/05 - nutritional plan.png index 5104adbed..5c60deb20 100644 Binary files a/fastlane/metadata/android/tr-TR/images/sevenInchScreenshots/05 - nutritional plan.png and b/fastlane/metadata/android/tr-TR/images/sevenInchScreenshots/05 - nutritional plan.png differ diff --git a/fastlane/metadata/android/tr-TR/images/sevenInchScreenshots/06 - weight.png b/fastlane/metadata/android/tr-TR/images/sevenInchScreenshots/06 - weight.png index 2f16a3de4..84409f12d 100644 Binary files a/fastlane/metadata/android/tr-TR/images/sevenInchScreenshots/06 - weight.png and b/fastlane/metadata/android/tr-TR/images/sevenInchScreenshots/06 - weight.png differ diff --git a/fastlane/metadata/android/tr-TR/images/tenInchScreenshots/01 - dashboard.png b/fastlane/metadata/android/tr-TR/images/tenInchScreenshots/01 - dashboard.png index 3e19ca809..faf33e8c9 100644 Binary files a/fastlane/metadata/android/tr-TR/images/tenInchScreenshots/01 - dashboard.png and b/fastlane/metadata/android/tr-TR/images/tenInchScreenshots/01 - dashboard.png differ diff --git a/fastlane/metadata/android/tr-TR/images/tenInchScreenshots/02 - workout detail.png b/fastlane/metadata/android/tr-TR/images/tenInchScreenshots/02 - workout detail.png index fc6e01d07..1d2eca52c 100644 Binary files a/fastlane/metadata/android/tr-TR/images/tenInchScreenshots/02 - workout detail.png and b/fastlane/metadata/android/tr-TR/images/tenInchScreenshots/02 - workout detail.png differ diff --git a/fastlane/metadata/android/tr-TR/images/tenInchScreenshots/03 - gym mode.png b/fastlane/metadata/android/tr-TR/images/tenInchScreenshots/03 - gym mode.png index 84534b743..e7f0874c7 100644 Binary files a/fastlane/metadata/android/tr-TR/images/tenInchScreenshots/03 - gym mode.png and b/fastlane/metadata/android/tr-TR/images/tenInchScreenshots/03 - gym mode.png differ diff --git a/fastlane/metadata/android/tr-TR/images/tenInchScreenshots/04 - measurements.png b/fastlane/metadata/android/tr-TR/images/tenInchScreenshots/04 - measurements.png index ee579c100..41022f87c 100644 Binary files a/fastlane/metadata/android/tr-TR/images/tenInchScreenshots/04 - measurements.png and b/fastlane/metadata/android/tr-TR/images/tenInchScreenshots/04 - measurements.png differ diff --git a/fastlane/metadata/android/tr-TR/images/tenInchScreenshots/05 - nutritional plan.png b/fastlane/metadata/android/tr-TR/images/tenInchScreenshots/05 - nutritional plan.png index 40a158afa..74dbe9c29 100644 Binary files a/fastlane/metadata/android/tr-TR/images/tenInchScreenshots/05 - nutritional plan.png and b/fastlane/metadata/android/tr-TR/images/tenInchScreenshots/05 - nutritional plan.png differ diff --git a/fastlane/metadata/android/tr-TR/images/tenInchScreenshots/06 - weight.png b/fastlane/metadata/android/tr-TR/images/tenInchScreenshots/06 - weight.png index 88eee5050..7e30233f7 100644 Binary files a/fastlane/metadata/android/tr-TR/images/tenInchScreenshots/06 - weight.png and b/fastlane/metadata/android/tr-TR/images/tenInchScreenshots/06 - weight.png differ diff --git a/fastlane/metadata/android/uk/images/phoneScreenshots/01 - dashboard.png b/fastlane/metadata/android/uk/images/phoneScreenshots/01 - dashboard.png index be80c9e7b..ee6084591 100644 Binary files a/fastlane/metadata/android/uk/images/phoneScreenshots/01 - dashboard.png and b/fastlane/metadata/android/uk/images/phoneScreenshots/01 - dashboard.png differ diff --git a/fastlane/metadata/android/uk/images/phoneScreenshots/02 - workout detail.png b/fastlane/metadata/android/uk/images/phoneScreenshots/02 - workout detail.png index 6d77e9f1d..345db1459 100644 Binary files a/fastlane/metadata/android/uk/images/phoneScreenshots/02 - workout detail.png and b/fastlane/metadata/android/uk/images/phoneScreenshots/02 - workout detail.png differ diff --git a/fastlane/metadata/android/uk/images/phoneScreenshots/03 - gym mode.png b/fastlane/metadata/android/uk/images/phoneScreenshots/03 - gym mode.png index e1d716cce..5950daf5c 100644 Binary files a/fastlane/metadata/android/uk/images/phoneScreenshots/03 - gym mode.png and b/fastlane/metadata/android/uk/images/phoneScreenshots/03 - gym mode.png differ diff --git a/fastlane/metadata/android/uk/images/phoneScreenshots/04 - measurements.png b/fastlane/metadata/android/uk/images/phoneScreenshots/04 - measurements.png index 1ce15ae21..af5855d8a 100644 Binary files a/fastlane/metadata/android/uk/images/phoneScreenshots/04 - measurements.png and b/fastlane/metadata/android/uk/images/phoneScreenshots/04 - measurements.png differ diff --git a/fastlane/metadata/android/uk/images/phoneScreenshots/05 - nutritional plan.png b/fastlane/metadata/android/uk/images/phoneScreenshots/05 - nutritional plan.png index f512981ed..2a6249d92 100644 Binary files a/fastlane/metadata/android/uk/images/phoneScreenshots/05 - nutritional plan.png and b/fastlane/metadata/android/uk/images/phoneScreenshots/05 - nutritional plan.png differ diff --git a/fastlane/metadata/android/uk/images/phoneScreenshots/06 - weight.png b/fastlane/metadata/android/uk/images/phoneScreenshots/06 - weight.png index bc3eefda0..05b18b670 100644 Binary files a/fastlane/metadata/android/uk/images/phoneScreenshots/06 - weight.png and b/fastlane/metadata/android/uk/images/phoneScreenshots/06 - weight.png differ diff --git a/fastlane/metadata/android/uk/images/sevenInchScreenshots/01 - dashboard.png b/fastlane/metadata/android/uk/images/sevenInchScreenshots/01 - dashboard.png index 9ff5b2626..da409c3ba 100644 Binary files a/fastlane/metadata/android/uk/images/sevenInchScreenshots/01 - dashboard.png and b/fastlane/metadata/android/uk/images/sevenInchScreenshots/01 - dashboard.png differ diff --git a/fastlane/metadata/android/uk/images/sevenInchScreenshots/02 - workout detail.png b/fastlane/metadata/android/uk/images/sevenInchScreenshots/02 - workout detail.png index e90fe7e0f..01b75bacc 100644 Binary files a/fastlane/metadata/android/uk/images/sevenInchScreenshots/02 - workout detail.png and b/fastlane/metadata/android/uk/images/sevenInchScreenshots/02 - workout detail.png differ diff --git a/fastlane/metadata/android/uk/images/sevenInchScreenshots/03 - gym mode.png b/fastlane/metadata/android/uk/images/sevenInchScreenshots/03 - gym mode.png index d4e79496f..c3bbd4260 100644 Binary files a/fastlane/metadata/android/uk/images/sevenInchScreenshots/03 - gym mode.png and b/fastlane/metadata/android/uk/images/sevenInchScreenshots/03 - gym mode.png differ diff --git a/fastlane/metadata/android/uk/images/sevenInchScreenshots/04 - measurements.png b/fastlane/metadata/android/uk/images/sevenInchScreenshots/04 - measurements.png index 21ab8aa2c..cbe825e2f 100644 Binary files a/fastlane/metadata/android/uk/images/sevenInchScreenshots/04 - measurements.png and b/fastlane/metadata/android/uk/images/sevenInchScreenshots/04 - measurements.png differ diff --git a/fastlane/metadata/android/uk/images/sevenInchScreenshots/05 - nutritional plan.png b/fastlane/metadata/android/uk/images/sevenInchScreenshots/05 - nutritional plan.png index 9a8d43248..e55e675ef 100644 Binary files a/fastlane/metadata/android/uk/images/sevenInchScreenshots/05 - nutritional plan.png and b/fastlane/metadata/android/uk/images/sevenInchScreenshots/05 - nutritional plan.png differ diff --git a/fastlane/metadata/android/uk/images/sevenInchScreenshots/06 - weight.png b/fastlane/metadata/android/uk/images/sevenInchScreenshots/06 - weight.png index efb62929c..3c0c5616c 100644 Binary files a/fastlane/metadata/android/uk/images/sevenInchScreenshots/06 - weight.png and b/fastlane/metadata/android/uk/images/sevenInchScreenshots/06 - weight.png differ diff --git a/fastlane/metadata/android/uk/images/tenInchScreenshots/01 - dashboard.png b/fastlane/metadata/android/uk/images/tenInchScreenshots/01 - dashboard.png index f9acf0d34..920bbeeca 100644 Binary files a/fastlane/metadata/android/uk/images/tenInchScreenshots/01 - dashboard.png and b/fastlane/metadata/android/uk/images/tenInchScreenshots/01 - dashboard.png differ diff --git a/fastlane/metadata/android/uk/images/tenInchScreenshots/02 - workout detail.png b/fastlane/metadata/android/uk/images/tenInchScreenshots/02 - workout detail.png index 824f66178..9166a3527 100644 Binary files a/fastlane/metadata/android/uk/images/tenInchScreenshots/02 - workout detail.png and b/fastlane/metadata/android/uk/images/tenInchScreenshots/02 - workout detail.png differ diff --git a/fastlane/metadata/android/uk/images/tenInchScreenshots/03 - gym mode.png b/fastlane/metadata/android/uk/images/tenInchScreenshots/03 - gym mode.png index 518c86169..997a5671b 100644 Binary files a/fastlane/metadata/android/uk/images/tenInchScreenshots/03 - gym mode.png and b/fastlane/metadata/android/uk/images/tenInchScreenshots/03 - gym mode.png differ diff --git a/fastlane/metadata/android/uk/images/tenInchScreenshots/04 - measurements.png b/fastlane/metadata/android/uk/images/tenInchScreenshots/04 - measurements.png index cccb2b2bd..a547b83c8 100644 Binary files a/fastlane/metadata/android/uk/images/tenInchScreenshots/04 - measurements.png and b/fastlane/metadata/android/uk/images/tenInchScreenshots/04 - measurements.png differ diff --git a/fastlane/metadata/android/uk/images/tenInchScreenshots/05 - nutritional plan.png b/fastlane/metadata/android/uk/images/tenInchScreenshots/05 - nutritional plan.png index f7bde648a..96bd0c627 100644 Binary files a/fastlane/metadata/android/uk/images/tenInchScreenshots/05 - nutritional plan.png and b/fastlane/metadata/android/uk/images/tenInchScreenshots/05 - nutritional plan.png differ diff --git a/fastlane/metadata/android/uk/images/tenInchScreenshots/06 - weight.png b/fastlane/metadata/android/uk/images/tenInchScreenshots/06 - weight.png index 7f847ecaf..cd3fd25d6 100644 Binary files a/fastlane/metadata/android/uk/images/tenInchScreenshots/06 - weight.png and b/fastlane/metadata/android/uk/images/tenInchScreenshots/06 - weight.png differ diff --git a/fastlane/metadata/android/zh-CN/images/phoneScreenshots/01 - dashboard.png b/fastlane/metadata/android/zh-CN/images/phoneScreenshots/01 - dashboard.png index 6c8d85d70..bdc83be30 100644 Binary files a/fastlane/metadata/android/zh-CN/images/phoneScreenshots/01 - dashboard.png and b/fastlane/metadata/android/zh-CN/images/phoneScreenshots/01 - dashboard.png differ diff --git a/fastlane/metadata/android/zh-CN/images/phoneScreenshots/02 - workout detail.png b/fastlane/metadata/android/zh-CN/images/phoneScreenshots/02 - workout detail.png index 629d9c0f3..e99b91114 100644 Binary files a/fastlane/metadata/android/zh-CN/images/phoneScreenshots/02 - workout detail.png and b/fastlane/metadata/android/zh-CN/images/phoneScreenshots/02 - workout detail.png differ diff --git a/fastlane/metadata/android/zh-CN/images/phoneScreenshots/03 - gym mode.png b/fastlane/metadata/android/zh-CN/images/phoneScreenshots/03 - gym mode.png index f53aadeb6..3c55a7b7f 100644 Binary files a/fastlane/metadata/android/zh-CN/images/phoneScreenshots/03 - gym mode.png and b/fastlane/metadata/android/zh-CN/images/phoneScreenshots/03 - gym mode.png differ diff --git a/fastlane/metadata/android/zh-CN/images/phoneScreenshots/04 - measurements.png b/fastlane/metadata/android/zh-CN/images/phoneScreenshots/04 - measurements.png index ce09484f1..977ae6821 100644 Binary files a/fastlane/metadata/android/zh-CN/images/phoneScreenshots/04 - measurements.png and b/fastlane/metadata/android/zh-CN/images/phoneScreenshots/04 - measurements.png differ diff --git a/fastlane/metadata/android/zh-CN/images/phoneScreenshots/05 - nutritional plan.png b/fastlane/metadata/android/zh-CN/images/phoneScreenshots/05 - nutritional plan.png index 1d968cab4..940f2c1dc 100644 Binary files a/fastlane/metadata/android/zh-CN/images/phoneScreenshots/05 - nutritional plan.png and b/fastlane/metadata/android/zh-CN/images/phoneScreenshots/05 - nutritional plan.png differ diff --git a/fastlane/metadata/android/zh-CN/images/phoneScreenshots/06 - weight.png b/fastlane/metadata/android/zh-CN/images/phoneScreenshots/06 - weight.png index e05870ac1..1a568c449 100644 Binary files a/fastlane/metadata/android/zh-CN/images/phoneScreenshots/06 - weight.png and b/fastlane/metadata/android/zh-CN/images/phoneScreenshots/06 - weight.png differ diff --git a/fastlane/metadata/android/zh-CN/images/sevenInchScreenshots/01 - dashboard.png b/fastlane/metadata/android/zh-CN/images/sevenInchScreenshots/01 - dashboard.png index d7c3a6bc1..7d88ef309 100644 Binary files a/fastlane/metadata/android/zh-CN/images/sevenInchScreenshots/01 - dashboard.png and b/fastlane/metadata/android/zh-CN/images/sevenInchScreenshots/01 - dashboard.png differ diff --git a/fastlane/metadata/android/zh-CN/images/sevenInchScreenshots/02 - workout detail.png b/fastlane/metadata/android/zh-CN/images/sevenInchScreenshots/02 - workout detail.png index 98c1a796e..9d4eee5ec 100644 Binary files a/fastlane/metadata/android/zh-CN/images/sevenInchScreenshots/02 - workout detail.png and b/fastlane/metadata/android/zh-CN/images/sevenInchScreenshots/02 - workout detail.png differ diff --git a/fastlane/metadata/android/zh-CN/images/sevenInchScreenshots/03 - gym mode.png b/fastlane/metadata/android/zh-CN/images/sevenInchScreenshots/03 - gym mode.png index 9c501f3c7..ff908c9bb 100644 Binary files a/fastlane/metadata/android/zh-CN/images/sevenInchScreenshots/03 - gym mode.png and b/fastlane/metadata/android/zh-CN/images/sevenInchScreenshots/03 - gym mode.png differ diff --git a/fastlane/metadata/android/zh-CN/images/sevenInchScreenshots/04 - measurements.png b/fastlane/metadata/android/zh-CN/images/sevenInchScreenshots/04 - measurements.png index 0029855c6..227976323 100644 Binary files a/fastlane/metadata/android/zh-CN/images/sevenInchScreenshots/04 - measurements.png and b/fastlane/metadata/android/zh-CN/images/sevenInchScreenshots/04 - measurements.png differ diff --git a/fastlane/metadata/android/zh-CN/images/sevenInchScreenshots/05 - nutritional plan.png b/fastlane/metadata/android/zh-CN/images/sevenInchScreenshots/05 - nutritional plan.png index 06198224a..8986f6f23 100644 Binary files a/fastlane/metadata/android/zh-CN/images/sevenInchScreenshots/05 - nutritional plan.png and b/fastlane/metadata/android/zh-CN/images/sevenInchScreenshots/05 - nutritional plan.png differ diff --git a/fastlane/metadata/android/zh-CN/images/sevenInchScreenshots/06 - weight.png b/fastlane/metadata/android/zh-CN/images/sevenInchScreenshots/06 - weight.png index 1350b8eb4..514608d1b 100644 Binary files a/fastlane/metadata/android/zh-CN/images/sevenInchScreenshots/06 - weight.png and b/fastlane/metadata/android/zh-CN/images/sevenInchScreenshots/06 - weight.png differ diff --git a/fastlane/metadata/android/zh-CN/images/tenInchScreenshots/01 - dashboard.png b/fastlane/metadata/android/zh-CN/images/tenInchScreenshots/01 - dashboard.png index e1327e0b9..dcd34d766 100644 Binary files a/fastlane/metadata/android/zh-CN/images/tenInchScreenshots/01 - dashboard.png and b/fastlane/metadata/android/zh-CN/images/tenInchScreenshots/01 - dashboard.png differ diff --git a/fastlane/metadata/android/zh-CN/images/tenInchScreenshots/02 - workout detail.png b/fastlane/metadata/android/zh-CN/images/tenInchScreenshots/02 - workout detail.png index fbc2fe449..2ff93d03b 100644 Binary files a/fastlane/metadata/android/zh-CN/images/tenInchScreenshots/02 - workout detail.png and b/fastlane/metadata/android/zh-CN/images/tenInchScreenshots/02 - workout detail.png differ diff --git a/fastlane/metadata/android/zh-CN/images/tenInchScreenshots/03 - gym mode.png b/fastlane/metadata/android/zh-CN/images/tenInchScreenshots/03 - gym mode.png index 189af1b99..8e6cba312 100644 Binary files a/fastlane/metadata/android/zh-CN/images/tenInchScreenshots/03 - gym mode.png and b/fastlane/metadata/android/zh-CN/images/tenInchScreenshots/03 - gym mode.png differ diff --git a/fastlane/metadata/android/zh-CN/images/tenInchScreenshots/04 - measurements.png b/fastlane/metadata/android/zh-CN/images/tenInchScreenshots/04 - measurements.png index b6005dbbe..87928b482 100644 Binary files a/fastlane/metadata/android/zh-CN/images/tenInchScreenshots/04 - measurements.png and b/fastlane/metadata/android/zh-CN/images/tenInchScreenshots/04 - measurements.png differ diff --git a/fastlane/metadata/android/zh-CN/images/tenInchScreenshots/05 - nutritional plan.png b/fastlane/metadata/android/zh-CN/images/tenInchScreenshots/05 - nutritional plan.png index 4808fe115..57ffcd75b 100644 Binary files a/fastlane/metadata/android/zh-CN/images/tenInchScreenshots/05 - nutritional plan.png and b/fastlane/metadata/android/zh-CN/images/tenInchScreenshots/05 - nutritional plan.png differ diff --git a/fastlane/metadata/android/zh-CN/images/tenInchScreenshots/06 - weight.png b/fastlane/metadata/android/zh-CN/images/tenInchScreenshots/06 - weight.png index ff63c2cb9..0ab13b8fa 100644 Binary files a/fastlane/metadata/android/zh-CN/images/tenInchScreenshots/06 - weight.png and b/fastlane/metadata/android/zh-CN/images/tenInchScreenshots/06 - weight.png differ diff --git a/integration_test/1_dashboard.dart b/integration_test/1_dashboard.dart index 4550fea77..e72f977a0 100644 --- a/integration_test/1_dashboard.dart +++ b/integration_test/1_dashboard.dart @@ -1,52 +1,49 @@ import 'package:flutter/material.dart'; -import 'package:flutter_gen/gen_l10n/app_localizations.dart'; import 'package:mockito/mockito.dart'; import 'package:provider/provider.dart'; +import 'package:wger/l10n/generated/app_localizations.dart'; +import 'package:wger/models/workouts/session.dart'; import 'package:wger/providers/body_weight.dart'; import 'package:wger/providers/measurement.dart'; import 'package:wger/providers/nutrition.dart'; +import 'package:wger/providers/routines.dart'; import 'package:wger/providers/user.dart'; -import 'package:wger/providers/workout_plans.dart'; import 'package:wger/screens/dashboard.dart'; import 'package:wger/theme/theme.dart'; import '../test/exercises/contribute_exercise_test.mocks.dart'; import '../test/measurements/measurement_categories_screen_test.mocks.dart'; -import '../test/nutrition/nutritional_plan_form_test.mocks.dart'; +import '../test/weight/weight_screen_test.mocks.dart' as weight; import '../test/workout/weight_unit_form_widget_test.mocks.dart'; -import '../test/workout/workout_form_test.mocks.dart'; import '../test_data/body_weight.dart'; import '../test_data/exercises.dart'; import '../test_data/measurements.dart'; import '../test_data/nutritional_plans.dart'; import '../test_data/profile.dart'; -import '../test_data/workouts.dart'; +import '../test_data/routines.dart'; Widget createDashboardScreen({locale = 'en'}) { - final mockWorkoutProvider = MockWorkoutPlansProvider(); - when(mockWorkoutProvider.activePlan).thenReturn(getWorkout(exercises: getScreenshotExercises())); + final mockWorkoutProvider = MockRoutinesProvider(); + when(mockWorkoutProvider.activeRoutine) + .thenReturn(getTestRoutine(exercises: getScreenshotExercises())); - final Map logs = { - 'results': [ - { - 'id': 1, - 'workout': 1, - 'date': '2022-12-01', - 'impression': '3', - 'time_start': '17:00', - 'time_end': '19:00', - }, - ], - }; - when(mockWorkoutProvider.fetchSessionData()).thenAnswer((a) => Future.value(logs)); + when(mockWorkoutProvider.fetchSessionData()).thenAnswer((a) => Future.value([ + WorkoutSession( + routineId: 1, + date: DateTime.now().add(const Duration(days: -1)), + timeStart: const TimeOfDay(hour: 17, minute: 34), + timeEnd: const TimeOfDay(hour: 19, minute: 3), + impression: 3, + ), + ])); - final mockNutritionProvider = MockNutritionPlansProvider(); + final mockNutritionProvider = weight.MockNutritionPlansProvider(); when(mockNutritionProvider.currentPlan) .thenAnswer((realInvocation) => getNutritionalPlanScreenshot()); when(mockNutritionProvider.items).thenReturn([getNutritionalPlanScreenshot()]); - final mockWeightProvider = MockBodyWeightProvider(); + final mockWeightProvider = weight.MockBodyWeightProvider(); when(mockWeightProvider.items).thenReturn(getScreenshotWeightEntries()); final mockMeasurementProvider = MockMeasurementProvider(); @@ -60,7 +57,7 @@ Widget createDashboardScreen({locale = 'en'}) { ChangeNotifierProvider( create: (context) => mockUserProvider, ), - ChangeNotifierProvider( + ChangeNotifierProvider( create: (context) => mockWorkoutProvider, ), ChangeNotifierProvider( diff --git a/integration_test/2_workout.dart b/integration_test/2_workout.dart index 96bad963c..19dddee65 100644 --- a/integration_test/2_workout.dart +++ b/integration_test/2_workout.dart @@ -1,27 +1,28 @@ import 'package:flutter/material.dart'; -import 'package:flutter_gen/gen_l10n/app_localizations.dart'; import 'package:mockito/mockito.dart'; import 'package:provider/provider.dart'; -import 'package:wger/providers/workout_plans.dart'; -import 'package:wger/screens/workout_plan_screen.dart'; +import 'package:wger/l10n/generated/app_localizations.dart'; +import 'package:wger/providers/routines.dart'; +import 'package:wger/screens/routine_screen.dart'; import 'package:wger/theme/theme.dart'; -import '../test/workout/workout_form_test.mocks.dart'; +import '../test/workout/routine_form_test.mocks.dart'; import '../test_data/exercises.dart'; -import '../test_data/workouts.dart'; +import '../test_data/routines.dart'; Widget createWorkoutDetailScreen({locale = 'en'}) { final key = GlobalKey(); - final mockWorkoutProvider = MockWorkoutPlansProvider(); - final workout = getWorkout(exercises: getScreenshotExercises()); - when(mockWorkoutProvider.activePlan).thenReturn(workout); - when(mockWorkoutProvider.fetchAndSetWorkoutPlanFull(1)).thenAnswer((_) => Future.value(workout)); + final mockRoutinesProvider = MockRoutinesProvider(); + final routine = getTestRoutine(exercises: getScreenshotExercises()); + // when(mockRoutinesProvider.activeRoutine).thenReturn(routine); + when(mockRoutinesProvider.findById(1)).thenReturn(routine); + // when(mockRoutinesProvider.fetchAndSetRoutineFull(1)).thenAnswer((_) => Future.value(routine)); return MultiProvider( providers: [ - ChangeNotifierProvider( - create: (context) => mockWorkoutProvider, + ChangeNotifierProvider( + create: (context) => mockRoutinesProvider, ), ], child: MaterialApp( @@ -34,8 +35,8 @@ Widget createWorkoutDetailScreen({locale = 'en'}) { home: TextButton( onPressed: () => key.currentState!.push( MaterialPageRoute( - settings: RouteSettings(arguments: workout), - builder: (_) => const WorkoutPlanScreen(), + settings: RouteSettings(arguments: routine.id), + builder: (_) => const RoutineScreen(), ), ), child: const SizedBox(), diff --git a/integration_test/3_gym_mode.dart b/integration_test/3_gym_mode.dart index 202b7c299..a91277599 100644 --- a/integration_test/3_gym_mode.dart +++ b/integration_test/3_gym_mode.dart @@ -1,38 +1,44 @@ import 'package:flutter/material.dart'; -import 'package:flutter_gen/gen_l10n/app_localizations.dart'; +import 'package:flutter_riverpod/flutter_riverpod.dart' as riverpod; import 'package:mockito/mockito.dart'; import 'package:provider/provider.dart'; +import 'package:wger/l10n/generated/app_localizations.dart'; import 'package:wger/providers/exercises.dart'; -import 'package:wger/providers/workout_plans.dart'; +import 'package:wger/providers/routines.dart'; import 'package:wger/screens/gym_mode.dart'; -import 'package:wger/screens/workout_plan_screen.dart'; +import 'package:wger/screens/routine_screen.dart'; import 'package:wger/theme/theme.dart'; -import '../test/utils.dart'; import '../test/workout/gym_mode_screen_test.mocks.dart'; import '../test_data/exercises.dart'; -import '../test_data/workouts.dart'; +import '../test_data/routines.dart'; Widget createGymModeScreen({locale = 'en'}) { final key = GlobalKey(); - final bases = getTestExercises(); - final workout = getWorkout(exercises: getScreenshotExercises()); - + final exercises = getTestExercises(); + final routine = getTestRoutine(exercises: getScreenshotExercises()); + final mockBaseProvider = MockWgerBaseProvider(); final mockExerciseProvider = MockExercisesProvider(); - when(mockExerciseProvider.findExerciseById(1)).thenReturn(bases[0]); // bench press - when(mockExerciseProvider.findExerciseById(6)).thenReturn(bases[5]); // side raises + when(mockExerciseProvider.findExerciseById(1)).thenReturn(exercises[0]); // bench press + when(mockExerciseProvider.findExerciseById(6)).thenReturn(exercises[5]); // side raises //when(mockExerciseProvider.findExerciseBaseById(2)).thenReturn(bases[1]); // crunches //when(mockExerciseProvider.findExerciseBaseById(3)).thenReturn(bases[2]); // dead lift - return ChangeNotifierProvider( - create: (context) => WorkoutPlansProvider( - mockBaseProvider, - mockExerciseProvider, - [workout], - ), - child: ChangeNotifierProvider( - create: (context) => mockExerciseProvider, + return riverpod.ProviderScope( + child: MultiProvider( + providers: [ + ChangeNotifierProvider( + create: (context) => RoutinesProvider( + mockBaseProvider, + mockExerciseProvider, + [routine], + ), + ), + ChangeNotifierProvider( + create: (context) => mockExerciseProvider, + ), + ], child: MaterialApp( locale: Locale(locale), debugShowCheckedModeBanner: false, @@ -43,14 +49,16 @@ Widget createGymModeScreen({locale = 'en'}) { home: TextButton( onPressed: () => key.currentState!.push( MaterialPageRoute( - settings: RouteSettings(arguments: workout.days.first), + settings: RouteSettings( + arguments: GymModeArguments(routine.id!, routine.days.first.id!, 1), + ), builder: (_) => const GymModeScreen(), ), ), child: const SizedBox(), ), routes: { - WorkoutPlanScreen.routeName: (ctx) => const WorkoutPlanScreen(), + RoutineScreen.routeName: (ctx) => const RoutineScreen(), }, ), ), diff --git a/integration_test/4_measurements.dart b/integration_test/4_measurements.dart index 8db33ba0d..d2dce6059 100644 --- a/integration_test/4_measurements.dart +++ b/integration_test/4_measurements.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; -import 'package:flutter_gen/gen_l10n/app_localizations.dart'; import 'package:mockito/mockito.dart'; import 'package:provider/provider.dart'; +import 'package:wger/l10n/generated/app_localizations.dart'; import 'package:wger/providers/measurement.dart'; import 'package:wger/screens/measurement_categories_screen.dart'; import 'package:wger/theme/theme.dart'; diff --git a/integration_test/5_nutritional_plan.dart b/integration_test/5_nutritional_plan.dart index 54ab26450..dacb17251 100644 --- a/integration_test/5_nutritional_plan.dart +++ b/integration_test/5_nutritional_plan.dart @@ -1,8 +1,8 @@ import 'package:drift/native.dart'; import 'package:flutter/material.dart'; -import 'package:flutter_gen/gen_l10n/app_localizations.dart'; import 'package:provider/provider.dart'; import 'package:wger/database/ingredients/ingredients_database.dart'; +import 'package:wger/l10n/generated/app_localizations.dart'; import 'package:wger/providers/body_weight.dart'; import 'package:wger/providers/nutrition.dart'; import 'package:wger/screens/nutritional_plan_screen.dart'; diff --git a/integration_test/6_weight.dart b/integration_test/6_weight.dart index 925d607fc..967d57424 100644 --- a/integration_test/6_weight.dart +++ b/integration_test/6_weight.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; -import 'package:flutter_gen/gen_l10n/app_localizations.dart'; import 'package:mockito/mockito.dart'; import 'package:provider/provider.dart'; +import 'package:wger/l10n/generated/app_localizations.dart'; import 'package:wger/providers/body_weight.dart'; import 'package:wger/providers/nutrition.dart'; import 'package:wger/providers/user.dart'; diff --git a/integration_test/make_screenshots_test.dart b/integration_test/make_screenshots_test.dart index 3d8c7f48d..2273affb2 100644 --- a/integration_test/make_screenshots_test.dart +++ b/integration_test/make_screenshots_test.dart @@ -20,7 +20,7 @@ enum DeviceType { wearScreenshots } -final destination = DeviceType.tenInchScreenshots.name; +final destination = DeviceType.phoneScreenshots.name; Future takeScreenshot(tester, binding, String language, String name) async { if (Platform.isAndroid) { @@ -55,9 +55,11 @@ const languages = [ 'pt-BR', 'pt-PT', 'ru-RU', + 'sr', 'tr-TR', 'uk', 'zh-CN', + 'zh-TW', ]; void main() { diff --git a/l10n.yaml b/l10n.yaml index 3c41bfca7..45d910eec 100644 --- a/l10n.yaml +++ b/l10n.yaml @@ -1,4 +1,7 @@ +synthetic-package: false # see https://docs.flutter.dev/release/breaking-changes/flutter-generate-i10n-source + arb-dir: lib/l10n +output-dir: lib/l10n/generated template-arb-file: app_en.arb output-localization-file: app_localizations.dart nullable-getter: false diff --git a/lib/database/exercises/exercise_database.dart b/lib/database/exercises/exercise_database.dart index 6d61d728c..5a58528c5 100644 --- a/lib/database/exercises/exercise_database.dart +++ b/lib/database/exercises/exercise_database.dart @@ -78,7 +78,7 @@ class ExerciseDatabase extends _$ExerciseDatabase { /// Note that this needs to be bumped if the JSON response from the server changes @override - int get schemaVersion => 1; + int get schemaVersion => 2; /// There is not really a migration strategy. If we bump the version /// number, delete everything and recreate the new tables. The provider diff --git a/lib/database/exercises/exercise_database.g.dart b/lib/database/exercises/exercise_database.g.dart index d9b894fc5..05f81233a 100644 --- a/lib/database/exercises/exercise_database.g.dart +++ b/lib/database/exercises/exercise_database.g.dart @@ -270,7 +270,6 @@ class $MusclesTable extends Muscles with TableInfo<$MusclesTable, MuscleTable> { @override late final GeneratedColumn id = GeneratedColumn('id', aliasedName, false, type: DriftSqlType.int, requiredDuringInsert: true); - static const VerificationMeta _dataMeta = const VerificationMeta('data'); @override late final GeneratedColumnWithTypeConverter data = GeneratedColumn( 'data', aliasedName, false, @@ -293,7 +292,6 @@ class $MusclesTable extends Muscles with TableInfo<$MusclesTable, MuscleTable> { } else if (isInserting) { context.missing(_idMeta); } - context.handle(_dataMeta, const VerificationResult.success()); return context; } @@ -452,7 +450,6 @@ class $EquipmentsTable extends Equipments with TableInfo<$EquipmentsTable, Equip @override late final GeneratedColumn id = GeneratedColumn('id', aliasedName, false, type: DriftSqlType.int, requiredDuringInsert: true); - static const VerificationMeta _dataMeta = const VerificationMeta('data'); @override late final GeneratedColumnWithTypeConverter data = GeneratedColumn( 'data', aliasedName, false, @@ -475,7 +472,6 @@ class $EquipmentsTable extends Equipments with TableInfo<$EquipmentsTable, Equip } else if (isInserting) { context.missing(_idMeta); } - context.handle(_dataMeta, const VerificationResult.success()); return context; } @@ -634,7 +630,6 @@ class $CategoriesTable extends Categories with TableInfo<$CategoriesTable, Categ @override late final GeneratedColumn id = GeneratedColumn('id', aliasedName, false, type: DriftSqlType.int, requiredDuringInsert: true); - static const VerificationMeta _dataMeta = const VerificationMeta('data'); @override late final GeneratedColumnWithTypeConverter data = GeneratedColumn('data', aliasedName, false, @@ -657,7 +652,6 @@ class $CategoriesTable extends Categories with TableInfo<$CategoriesTable, Categ } else if (isInserting) { context.missing(_idMeta); } - context.handle(_dataMeta, const VerificationResult.success()); return context; } @@ -816,7 +810,6 @@ class $LanguagesTable extends Languages with TableInfo<$LanguagesTable, Language @override late final GeneratedColumn id = GeneratedColumn('id', aliasedName, false, type: DriftSqlType.int, requiredDuringInsert: true); - static const VerificationMeta _dataMeta = const VerificationMeta('data'); @override late final GeneratedColumnWithTypeConverter data = GeneratedColumn( 'data', aliasedName, false, @@ -839,7 +832,6 @@ class $LanguagesTable extends Languages with TableInfo<$LanguagesTable, Language } else if (isInserting) { context.missing(_idMeta); } - context.handle(_dataMeta, const VerificationResult.success()); return context; } diff --git a/lib/exceptions/no_such_entry_exception.dart b/lib/exceptions/no_such_entry_exception.dart index 862e2ba08..34dde9e97 100644 --- a/lib/exceptions/no_such_entry_exception.dart +++ b/lib/exceptions/no_such_entry_exception.dart @@ -1,3 +1,8 @@ class NoSuchEntryException implements Exception { const NoSuchEntryException(); + + @override + String toString() { + return 'No such entry found'; + } } diff --git a/lib/helpers/consts.dart b/lib/helpers/consts.dart index 919112cd7..db66b4f83 100644 --- a/lib/helpers/consts.dart +++ b/lib/helpers/consts.dart @@ -35,14 +35,14 @@ const TESTSERVER_PASSWORD = 'flutteruser'; const MANIFEST_KEY_CHECK_UPDATE = 'wger.check_min_app_version'; /// Default weight unit is "kg" -const DEFAULT_WEIGHT_UNIT = 1; +const WEIGHT_UNIT_KG_ID = 1; /// Default impression for a workout session (neutral) const DEFAULT_IMPRESSION = 2; // Weight and repetition units for the workout logs -const REP_UNIT_REPETITIONS = 1; -const REP_UNIT_TILL_FAILURE = 2; +const REP_UNIT_REPETITIONS_ID = 1; +const REP_UNIT_TILL_FAILURE_ID = 2; const WEIGHT_UNIT_KG = 1; const WEIGHT_UNIT_LB = 2; diff --git a/lib/helpers/exercises/forms.dart b/lib/helpers/exercises/forms.dart index 25d92bde4..88a4ca93f 100644 --- a/lib/helpers/exercises/forms.dart +++ b/lib/helpers/exercises/forms.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:flutter_gen/gen_l10n/app_localizations.dart'; +import 'package:wger/l10n/generated/app_localizations.dart'; /// The amount of characters an exercise description needs to have const MIN_CHARS_DESCRIPTION = 40; @@ -14,7 +14,10 @@ String? validateName(String? name, BuildContext context) { } if (name.length < MIN_CHARS_NAME || name.length > MAX_CHARS_NAME) { - return AppLocalizations.of(context).enterCharacters(MIN_CHARS_NAME, MAX_CHARS_NAME); + return AppLocalizations.of(context).enterCharacters( + MIN_CHARS_NAME.toString(), + MAX_CHARS_NAME.toString(), + ); } return null; @@ -26,7 +29,7 @@ String? validateDescription(String? name, BuildContext context) { } if (name.length < MIN_CHARS_DESCRIPTION) { - return AppLocalizations.of(context).enterMinCharacters(MIN_CHARS_DESCRIPTION); + return AppLocalizations.of(context).enterMinCharacters(MIN_CHARS_DESCRIPTION.toString()); } return null; diff --git a/lib/helpers/i18n.dart b/lib/helpers/i18n.dart index ebf02de8b..161bc110e 100644 --- a/lib/helpers/i18n.dart +++ b/lib/helpers/i18n.dart @@ -7,7 +7,7 @@ library; /// probably better ways to do this, but that's the way it is right now). import 'package:flutter/widgets.dart'; -import 'package:flutter_gen/gen_l10n/app_localizations.dart'; +import 'package:wger/l10n/generated/app_localizations.dart'; String getTranslation(String value, BuildContext context) { switch (value) { diff --git a/lib/helpers/json.dart b/lib/helpers/json.dart index bca181948..7e97c37f3 100644 --- a/lib/helpers/json.dart +++ b/lib/helpers/json.dart @@ -23,6 +23,17 @@ num stringToNum(String? e) { return e == null ? 0 : num.parse(e); } +num stringOrIntToNum(dynamic e) { + if (e is int) { + return e.toDouble(); // Convert int to double (a type of num) + } + return num.tryParse(e) ?? 0; +} + +num? stringToNumNull(String? e) { + return e == null ? null : num.parse(e); +} + String? numToString(num? e) { if (e == null) { return null; @@ -35,7 +46,7 @@ String? numToString(num? e) { * Converts a datetime to ISO8601 date format, but only the date. * Needed e.g. when the wger api only expects a date and no time information. */ -String? toDate(DateTime? dateTime) { +String? dateToYYYYMMDD(DateTime? dateTime) { if (dateTime == null) { return null; } diff --git a/lib/helpers/misc.dart b/lib/helpers/misc.dart index b880e8c2d..970273927 100644 --- a/lib/helpers/misc.dart +++ b/lib/helpers/misc.dart @@ -24,33 +24,35 @@ import 'package:wger/models/workouts/weight_unit.dart'; /// Returns the text representation for a single setting, used in the gym mode String repText( - int? reps, - RepetitionUnit repetitionUnitObj, + num? repetitions, + RepetitionUnit? repetitionUnitObj, num? weight, - WeightUnit weightUnitObj, + WeightUnit? weightUnitObj, String? rir, ) { // TODO(x): how to (easily?) translate strings like the units or 'RiR' final List out = []; - if (reps != null) { - out.add(reps.toString()); + if (repetitions != null) { + out.add(formatNum(repetitions).toString()); // The default repetition unit is 'reps', which we don't show unless there // is no weight defined so that we don't just output something like "8" but // rather "8 repetitions". If there is weight we want to output "8 x 50kg", // since the repetitions are implied. If other units are used, we always // print them - if (repetitionUnitObj.id != REP_UNIT_REPETITIONS || weight == 0 || weight == null) { - out.add(repetitionUnitObj.name); + if (repetitionUnitObj != null && repetitionUnitObj.id != REP_UNIT_REPETITIONS_ID || + weight == 0 || + weight == null) { + out.add(repetitionUnitObj!.name); } } if (weight != null && weight != 0) { out.add('×'); - out.add(weight.toString()); - out.add(weightUnitObj.name); + out.add(formatNum(weight).toString()); + out.add(weightUnitObj!.name); } if (rir != null && rir != '') { @@ -72,19 +74,11 @@ List daysInRange(DateTime first, DateTime last) { extension TimeOfDayExtension on TimeOfDay { bool isAfter(TimeOfDay other) { - if (toMinutes() > other.toMinutes()) { - return true; - } else { - return false; - } + return toMinutes() > other.toMinutes(); } bool isBefore(TimeOfDay other) { - if (toMinutes() < other.toMinutes()) { - return true; - } else { - return false; - } + return toMinutes() < other.toMinutes(); } int toMinutes() { @@ -110,3 +104,11 @@ void launchURL(String url, BuildContext context) async { ); } } + +/// Formats a number to an integer if it's a whole number +num formatNum(num value) { + if (value is double && value == value.toInt()) { + return value.toInt(); + } + return value; +} diff --git a/lib/helpers/ui.dart b/lib/helpers/ui.dart index 7e8823e56..bea5f8cb0 100644 --- a/lib/helpers/ui.dart +++ b/lib/helpers/ui.dart @@ -16,16 +16,15 @@ * along with this program. If not, see . */ -import 'dart:developer'; - import 'package:flutter/material.dart'; -import 'package:flutter_gen/gen_l10n/app_localizations.dart'; +import 'package:logging/logging.dart'; import 'package:provider/provider.dart'; import 'package:wger/exceptions/http_exception.dart'; +import 'package:wger/l10n/generated/app_localizations.dart'; import 'package:wger/models/exercises/exercise.dart'; import 'package:wger/models/exercises/translation.dart'; import 'package:wger/models/workouts/log.dart'; -import 'package:wger/providers/workout_plans.dart'; +import 'package:wger/providers/routines.dart'; void showErrorDialog(dynamic exception, BuildContext context) { // log('showErrorDialog: '); @@ -54,9 +53,10 @@ void showHttpExceptionErrorDialog( WgerHttpException exception, BuildContext context, ) { - log('showHttpExceptionErrorDialog: '); - log(exception.toString()); - log('-------------------'); + final logger = Logger('showHttpExceptionErrorDialog'); + + logger.fine(exception.toString()); + logger.fine('-------------------'); final List errorList = []; @@ -134,7 +134,7 @@ dynamic showDeleteDialog( ), onPressed: () { exerciseData[exercise]!.removeWhere((el) => el.id == log.id); - Provider.of(context, listen: false).deleteLog( + Provider.of(context, listen: false).deleteLog( log, ); diff --git a/lib/l10n/app_ar.arb b/lib/l10n/app_ar.arb index 03243ab2e..6e1e074f2 100644 --- a/lib/l10n/app_ar.arb +++ b/lib/l10n/app_ar.arb @@ -48,7 +48,9 @@ "alsoKnownAs": "يُعرف أيضًا باسم: {aliases}", "@alsoKnownAs": { "placeholders": { - "aliases": {} + "aliases": { + "type": "String" + } }, "description": "List of alternative names for an exercise" }, @@ -78,10 +80,6 @@ "@goToToday": { "description": "Label on button to jump back to 'today' in the calendar widget" }, - "enterRepetitionsOrWeight": "يرجى ملء التكرارات أو الوزن لواحدة على الأقل من المجموعات", - "@enterRepetitionsOrWeight": { - "description": "Error message when the user hasn't filled in the forms for exercise sets" - }, "baseData": "الأساسيات بالإنجليزية", "@baseData": { "description": "The base data for an exercise such as category, trained muscles, etc." @@ -145,7 +143,9 @@ "description": "Dialog info when product is not found with barcode", "type": "text", "placeholders": { - "barcode": {} + "barcode": { + "type": "String" + } } }, "setNr": "مجموعة {nr}", @@ -153,7 +153,9 @@ "description": "Header in form indicating the number of the current set. Can also be translated as something like 'Set Nr. xy'.", "type": "text", "placeholders": { - "nr": {} + "nr": { + "type": "String" + } } }, "next": "التالي", @@ -284,8 +286,12 @@ "description": "Error message when the user hasn't entered the correct number of characters in a form", "type": "text", "placeholders": { - "min": {}, - "max": {} + "min": { + "type": "String" + }, + "max": { + "type": "String" + } } }, "recentlyUsedIngredients": "المكونات المضافة مؤخرًا", @@ -351,7 +357,9 @@ "verifiedEmailInfo": "أُرسلت رسالة للتحقق إلى {email}", "@verifiedEmailInfo": { "placeholders": { - "email": {} + "email": { + "type": "String" + } } }, "fatShort": "د", @@ -644,10 +652,6 @@ }, "measurementEntriesHelpText": "الوحدة المستخدمة لقياس الفئة مثل \"سم\" أو \"%\"", "@measurementEntriesHelpText": {}, - "supersetWith": "مجموعة شاملة مع", - "@supersetWith": { - "description": "Text used between exercise cards when adding a new set. Translate as something like 'in a superset with'" - }, "sugars": "سكريات", "@sugars": {}, "customServerUrl": "رابط عنصر wger", @@ -699,7 +703,9 @@ "description": "Confirmation text before the user deletes an object", "type": "text", "placeholders": { - "toDelete": {} + "toDelete": { + "type": "String" + } } }, "passwordsDontMatch": "كلمات المرور غير متطابقة", @@ -731,7 +737,9 @@ "description": "Error message when the user hasn't entered the minimum amount characters in a form", "type": "text", "placeholders": { - "min": {} + "min": { + "type": "String" + } } }, "weekAverage": "متوسط سبع أيام", @@ -759,7 +767,9 @@ "description": "Label shown on the slider where the user selects the nr of sets", "type": "text", "placeholders": { - "nrOfSets": {} + "nrOfSets": { + "type": "String" + } } }, "none__bodyweight_exercise_": "لا شيء (تمرين وزن الجسم)", @@ -779,7 +789,9 @@ "description": "Dialog info when product is found with barcode", "type": "text", "placeholders": { - "productName": {} + "productName": { + "type": "String" + } } }, "exercises": "التمارين", @@ -824,4 +836,4 @@ "@textPromptSubheading": {}, "measurement": "القياس", "@measurement": {} -} +} \ No newline at end of file diff --git a/lib/l10n/app_ca.arb b/lib/l10n/app_ca.arb index 459f3c514..fc21063d3 100644 --- a/lib/l10n/app_ca.arb +++ b/lib/l10n/app_ca.arb @@ -73,10 +73,6 @@ "@searchExercise": { "description": "Label on set form. Selected exercises are added to the set" }, - "supersetWith": "en conjunt amb", - "@supersetWith": { - "description": "Text used between exercise cards when adding a new set. Translate as something like 'in a superset with'" - }, "equipment": "Equipament", "@equipment": { "description": "Equipment needed to perform an exercise" @@ -330,7 +326,9 @@ "description": "Label shown on the slider where the user selects the nr of sets", "type": "text", "placeholders": { - "nrOfSets": {} + "nrOfSets": { + "type": "String" + } } }, "setUnitsAndRir": "Unitats de la sèrie i RER", @@ -401,7 +399,9 @@ "description": "Header in form indicating the number of the current set. Can also be translated as something like 'Set Nr. xy'.", "type": "text", "placeholders": { - "nr": {} + "nr": { + "type": "String" + } } }, "dayDescriptionHelp": "Descripció de què es fa aquest dia (p. e. «dia de tracció») o quines parts del cos d'exerciten (p. e. «pit i espatlles»)", @@ -458,10 +458,6 @@ "@proteinShort": { "description": "The first letter or short name of the word 'Protein', used in overviews" }, - "enterRepetitionsOrWeight": "Ompliu les repeticions o bé el pes per a una de les sèries com a mínim", - "@enterRepetitionsOrWeight": { - "description": "Error message when the user hasn't filled in the forms for exercise sets" - }, "fatShort": "G", "@fatShort": { "description": "The first letter or short name of the word 'Fat', used in overviews" @@ -487,7 +483,9 @@ "description": "Confirmation text before the user deletes an object", "type": "text", "placeholders": { - "toDelete": {} + "toDelete": { + "type": "String" + } } }, "goToToday": "Vés a avui", @@ -503,8 +501,12 @@ "description": "Error message when the user hasn't entered the correct number of characters in a form", "type": "text", "placeholders": { - "min": {}, - "max": {} + "min": { + "type": "String" + }, + "max": { + "type": "String" + } } }, "recentlyUsedIngredients": "Ingredients afegits recentment", @@ -542,7 +544,9 @@ "description": "Dialog info when product is found with barcode", "type": "text", "placeholders": { - "productName": {} + "productName": { + "type": "String" + } } }, "productNotFound": "No s'ha trobat el producte", @@ -554,7 +558,9 @@ "description": "Dialog info when product is not found with barcode", "type": "text", "placeholders": { - "barcode": {} + "barcode": { + "type": "String" + } } }, "alternativeNames": "Noms alternatius", @@ -664,7 +670,9 @@ "description": "A value in kcal, e.g. 500 kcal", "type": "text", "placeholders": { - "value": {} + "value": { + "type": "String" + } } }, "gValue": "{value} g", @@ -672,7 +680,9 @@ "description": "A value in grams, e.g. 5 g", "type": "text", "placeholders": { - "value": {} + "value": { + "type": "String" + } } }, "percentValue": "{value} %", @@ -680,7 +690,9 @@ "description": "A value in percent, e.g. 10 %", "type": "text", "placeholders": { - "value": {} + "value": { + "type": "String" + } } }, "aboutMastodonTitle": "Mastodon", @@ -792,7 +804,9 @@ "description": "Error message when the user hasn't entered the minimum amount characters in a form", "type": "text", "placeholders": { - "min": {} + "min": { + "type": "String" + } } }, "variations": "Variacions", @@ -802,14 +816,18 @@ "alsoKnownAs": "També conegut com: {aliases}", "@alsoKnownAs": { "placeholders": { - "aliases": {} + "aliases": { + "type": "String" + } }, "description": "List of alternative names for an exercise" }, "verifiedEmailInfo": "S'ha enviat un correu electrònic de verificació a {email}", "@verifiedEmailInfo": { "placeholders": { - "email": {} + "email": { + "type": "String" + } } }, "previous": "Anterior", @@ -904,4 +922,4 @@ "@surplus": { "description": "Caloric surplus (either planned or unplanned)" } -} +} \ No newline at end of file diff --git a/lib/l10n/app_cs.arb b/lib/l10n/app_cs.arb index 8245baa07..00fc8f336 100644 --- a/lib/l10n/app_cs.arb +++ b/lib/l10n/app_cs.arb @@ -239,10 +239,6 @@ }, "calendar": "Kalendář", "@calendar": {}, - "enterRepetitionsOrWeight": "Prosím, vyplňte buď počet opakování, nebo hmotnost u alespoň jedné sady", - "@enterRepetitionsOrWeight": { - "description": "Error message when the user hasn't filled in the forms for exercise sets" - }, "enterValue": "Prosím zadejte hodnotu", "@enterValue": { "description": "Error message when the user hasn't entered a value on a required field" @@ -258,8 +254,12 @@ "description": "Error message when the user hasn't entered the correct number of characters in a form", "type": "text", "placeholders": { - "min": {}, - "max": {} + "min": { + "type": "String" + }, + "max": { + "type": "String" + } } }, "enterMinCharacters": "Prosím, zadejte alespoň {min} znaků", @@ -267,7 +267,9 @@ "description": "Error message when the user hasn't entered the minimum amount characters in a form", "type": "text", "placeholders": { - "min": {} + "min": { + "type": "String" + } } }, "baseNameEnglish": "Všechny cviky potřebují mít základní název v angličtině", @@ -372,10 +374,6 @@ "@searchExercise": { "description": "Label on set form. Selected exercises are added to the set" }, - "supersetWith": "superset s", - "@supersetWith": { - "description": "Text used between exercise cards when adding a new set. Translate as something like 'in a superset with'" - }, "logMeal": "Zaznamenat do nutričního diáře", "@logMeal": {}, "muscles": "Svaly", @@ -419,7 +417,9 @@ "description": "Header in form indicating the number of the current set. Can also be translated as something like 'Set Nr. xy'.", "type": "text", "placeholders": { - "nr": {} + "nr": { + "type": "String" + } } }, "newDay": "Nový den", @@ -493,7 +493,9 @@ "description": "Confirmation text before the user deletes an object", "type": "text", "placeholders": { - "toDelete": {} + "toDelete": { + "type": "String" + } } }, "aboutDescription": "Děkujeme Vám za použití wger! wger je komunitní open source projekt, který je tvořen fitness nadšenci z celého světa.", @@ -537,7 +539,9 @@ "description": "Label shown on the slider where the user selects the nr of sets", "type": "text", "placeholders": { - "nrOfSets": {} + "nrOfSets": { + "type": "String" + } } }, "recentlyUsedIngredients": "Naposledy přidané přísady", @@ -581,7 +585,9 @@ "description": "Dialog info when product is found with barcode", "type": "text", "placeholders": { - "productName": {} + "productName": { + "type": "String" + } } }, "scanBarcode": "Naskenovat čárový kód", @@ -614,7 +620,9 @@ "description": "Dialog info when product is not found with barcode", "type": "text", "placeholders": { - "barcode": {} + "barcode": { + "type": "String" + } } }, "useMetric": "Použít metrické jednotky pro tělesnou váhu", @@ -646,7 +654,9 @@ "alsoKnownAs": "Také známé jako: {aliases}", "@alsoKnownAs": { "placeholders": { - "aliases": {} + "aliases": { + "type": "String" + } }, "description": "List of alternative names for an exercise" }, @@ -663,7 +673,9 @@ "verifiedEmailInfo": "Ověřovací e-mail byl odeslán na adresu {email}", "@verifiedEmailInfo": { "placeholders": { - "email": {} + "email": { + "type": "String" + } } }, "translateExercise": "Přeložte toto cvičení", @@ -869,7 +881,9 @@ "description": "A value in kcal, e.g. 500 kcal", "type": "text", "placeholders": { - "value": {} + "value": { + "type": "String" + } } }, "gValue": "{value} g", @@ -877,7 +891,9 @@ "description": "A value in grams, e.g. 5 g", "type": "text", "placeholders": { - "value": {} + "value": { + "type": "String" + } } }, "percentValue": "{value} %", @@ -885,7 +901,9 @@ "description": "A value in percent, e.g. 10 %", "type": "text", "placeholders": { - "value": {} + "value": { + "type": "String" + } } }, "surplus": "přebytek", @@ -908,4 +926,4 @@ "@selectMealToLog": {}, "noIngredientsDefined": "Zatím nebyly nastaveny žádné ingredience", "@noIngredientsDefined": {} -} +} \ No newline at end of file diff --git a/lib/l10n/app_de.arb b/lib/l10n/app_de.arb index 56de99fb0..48b8aae1e 100644 --- a/lib/l10n/app_de.arb +++ b/lib/l10n/app_de.arb @@ -36,10 +36,6 @@ "@toggleDetails": { "description": "Switch to toggle detail / overview" }, - "aboutText": "wger ist copylefted-Software, lizenziert unter der AGPLv3+ und verfügbar auf GitHub:", - "@aboutText": { - "description": "Text in the about dialog" - }, "newNutritionalPlan": "Neuer Ernährungsplan", "@newNutritionalPlan": {}, "delete": "Löschen", @@ -112,8 +108,6 @@ "@weight": { "description": "The weight of a workout log or body weight entry" }, - "dismiss": "Verwerfen", - "@dismiss": {}, "anErrorOccurred": "Es ist ein Fehler aufgetreten!", "@anErrorOccurred": {}, "nutritionalPlans": "Ernährungspläne", @@ -261,7 +255,9 @@ "description": "Confirmation text before the user deletes an object", "type": "text", "placeholders": { - "toDelete": {} + "toDelete": { + "type": "String" + } } }, "noNutritionalPlans": "Du hast keine Ernährungspläne", @@ -279,7 +275,9 @@ "description": "Label shown on the slider where the user selects the nr of sets", "type": "text", "placeholders": { - "nrOfSets": {} + "nrOfSets": { + "type": "String" + } } }, "enterCharacters": "Bitte gebe zwischen {min} und {max} Zeichen ein", @@ -287,8 +285,12 @@ "description": "Error message when the user hasn't entered the correct number of characters in a form", "type": "text", "placeholders": { - "min": {}, - "max": {} + "min": { + "type": "String" + }, + "max": { + "type": "String" + } } }, "selectExercise": "Bitte wähle eine Übung aus", @@ -304,7 +306,9 @@ "description": "Header in form indicating the number of the current set. Can also be translated as something like 'Set Nr. xy'.", "type": "text", "placeholders": { - "nr": {} + "nr": { + "type": "String" + } } }, "dayDescriptionHelp": "Eine Beschreibung was an diesem Tag gemacht wird (z. B. „Zugtag“) oder welche Körperteile trainiert werden (z. B. „Brust und Schultern“)", @@ -321,10 +325,6 @@ "@reps": { "description": "Shorthand for repetitions, used when space constraints are tighter" }, - "enterRepetitionsOrWeight": "Bitte gebe entweder die Wiederholungen oder das Gewicht für mindestens einen der Sätze an", - "@enterRepetitionsOrWeight": { - "description": "Error message when the user hasn't filled in the forms for exercise sets" - }, "start": "Starten", "@start": { "description": "Label on button to start the gym mode (i.e., an imperative)" @@ -464,10 +464,6 @@ }, "timeStartAhead": "Die Startzeit kann nicht vor der Endzeit liegen", "@timeStartAhead": {}, - "supersetWith": "Supersatz mit", - "@supersetWith": { - "description": "Text used between exercise cards when adding a new set. Translate as something like 'in a superset with'" - }, "total": "Summe", "@total": { "description": "Label used for total sums of e.g. calories or similar" @@ -547,7 +543,9 @@ "description": "Dialog info when product is not found with barcode", "type": "text", "placeholders": { - "barcode": {} + "barcode": { + "type": "String" + } } }, "productFound": "Produkt gefunden", @@ -559,7 +557,9 @@ "description": "Dialog info when product is found with barcode", "type": "text", "placeholders": { - "productName": {} + "productName": { + "type": "String" + } } }, "productNotFound": "Produkt nicht gefunden", @@ -639,7 +639,9 @@ "alsoKnownAs": "Auch bekannt als:{aliases}", "@alsoKnownAs": { "placeholders": { - "aliases": {} + "aliases": { + "type": "String" + } }, "description": "List of alternative names for an exercise" }, @@ -658,7 +660,9 @@ "description": "Error message when the user hasn't entered the minimum amount characters in a form", "type": "text", "placeholders": { - "min": {} + "min": { + "type": "String" + } } }, "baseNameEnglish": "Alle Übungen brauchen einen Basisnamen in Englisch", @@ -714,7 +718,9 @@ "verifiedEmailInfo": "Eine Bestätigungs-E-Mail wurde an {email} gesendet", "@verifiedEmailInfo": { "placeholders": { - "email": {} + "email": { + "type": "String" + } } }, "minutes": "Minuten", @@ -832,7 +838,9 @@ "description": "All-time chart of 'name' (e.g. 'weight', 'body fat' etc.)", "type": "text", "placeholders": { - "name": {} + "name": { + "type": "String" + } } }, "chart30DaysTitle": "{name} der letzten 30 Tage", @@ -840,7 +848,9 @@ "description": "last 30 days chart of 'name' (e.g. 'weight', 'body fat' etc.)", "type": "text", "placeholders": { - "name": {} + "name": { + "type": "String" + } } }, "chartDuringPlanTitle": "{chartName} während des Ernährungsplans {planName}", @@ -848,8 +858,12 @@ "description": "chart of 'chartName' (e.g. 'weight', 'body fat' etc.) logged during plan", "type": "text", "placeholders": { - "chartName": {}, - "planName": {} + "chartName": { + "type": "String" + }, + "planName": { + "type": "String" + } } }, "surplus": "Überschuss", @@ -865,7 +879,9 @@ "description": "A value in kcal, e.g. 500 kcal", "type": "text", "placeholders": { - "value": {} + "value": { + "type": "String" + } } }, "gValue": "{value} g", @@ -873,7 +889,9 @@ "description": "A value in grams, e.g. 5 g", "type": "text", "placeholders": { - "value": {} + "value": { + "type": "String" + } } }, "percentValue": "{value} %", @@ -881,9 +899,11 @@ "description": "A value in percent, e.g. 10 %", "type": "text", "placeholders": { - "value": {} + "value": { + "type": "String" + } } }, "settingsIngredientCacheDescription": "Zutaten-Cache", "@settingsIngredientCacheDescription": {} -} +} \ No newline at end of file diff --git a/lib/l10n/app_el.arb b/lib/l10n/app_el.arb index 539298c60..d3304c0e4 100644 --- a/lib/l10n/app_el.arb +++ b/lib/l10n/app_el.arb @@ -208,7 +208,9 @@ "description": "Header in form indicating the number of the current set. Can also be translated as something like 'Set Nr. xy'.", "type": "text", "placeholders": { - "nr": {} + "nr": { + "type": "String" + } } }, "newDay": "Νέα ημέρα", @@ -269,10 +271,6 @@ "@noMatchingExerciseFound": { "description": "Message returned if no exercises match the searched string" }, - "supersetWith": "υπερσύνολο με", - "@supersetWith": { - "description": "Text used between exercise cards when adding a new set. Translate as something like 'in a superset with'" - }, "equipment": "Εξοπλισμός", "@equipment": { "description": "Equipment needed to perform an exercise" @@ -305,4 +303,4 @@ "@gymMode": { "description": "Label when starting the gym mode" } -} +} \ No newline at end of file diff --git a/lib/l10n/app_en.arb b/lib/l10n/app_en.arb index 4ea1e223a..a53350211 100644 --- a/lib/l10n/app_en.arb +++ b/lib/l10n/app_en.arb @@ -69,10 +69,6 @@ "@registerInstead": {}, "loginInstead": "Already have an account? Login", "@loginInstead": {}, - "labelWorkoutPlans": "Workout plans", - "@labelWorkoutPlans": { - "description": "Title for screen workout plans" - }, "labelBottomNavWorkout": "Workout", "@labelBottomNavWorkout": { "description": "Label used in bottom navigation, use a short word" @@ -128,10 +124,6 @@ "description": "Message returned if no exercises match the searched string" }, "searchNamesInEnglish": "Also search for names in English", - "supersetWith": "superset with", - "@supersetWith": { - "description": "Text used between exercise cards when adding a new set. Translate as something like 'in a superset with'" - }, "equipment": "Equipment", "@equipment": { "description": "Equipment needed to perform an exercise" @@ -148,18 +140,18 @@ "@category": { "description": "Category for an exercise, ingredient, etc." }, - "newWorkout": "New workout plan", - "@newWorkout": { - "description": "Header when adding a new workout" - }, - "noWorkoutPlans": "You have no workout plans", - "@noWorkoutPlans": { - "description": "Message shown when the user has no workout plans" - }, + "routines": "Routines", + "newRoutine": "New routine", + "noRoutines": "You have no routines", "reps": "Reps", "@reps": { "description": "Shorthand for repetitions, used when space constraints are tighter" }, + "restTime": "Rest time", + "sets": "Sets", + "@sets": { + "description": "The number of sets to be done for one exercise" + }, "rir": "RiR", "@rir": { "description": "Shorthand for Repetitions In Reserve" @@ -179,12 +171,24 @@ }, "dayDescriptionHelp": "A description of what is done on this day (e.g. 'pull day') or what body parts are trained (e.g. 'chest and shoulders')", "@dayDescriptionHelp": {}, - "setNr": "Set {nr}", - "@setNr": { - "description": "Header in form indicating the number of the current set. Can also be translated as something like 'Set Nr. xy'.", + "exerciseNr": "Exercise {nr}", + "@exerciseNr": { + "description": "Header in form indicating the number of the current exercise. Can also be translated as something like 'Set Nr. xy'.", "type": "text", "placeholders": { - "nr": {} + "nr": { + "type": "String" + } + } + }, + "supersetNr": "Superset {nr}", + "@supersetNr": { + "description": "Header in form indicating the number of the current exercise. Can also be translated as something like 'Superset Nr. xy'.", + "type": "text", + "placeholders": { + "nr": { + "type": "String" + } } }, "sameRepetitions": "If you do the same repetitions and weight for all sets you can just fill in one row. For example for 4 sets just enter 10 for the repetitions, this automatically becomes \"4 x 10\".", @@ -205,6 +209,13 @@ "@workoutSession": { "description": "A (logged) workout session" }, + "restDay": "Rest day", + "isRestDay": "Is rest day", + "isRestDayHelp": "Please note that all sets and exercises will be removed when you mark a day as a rest day.", + "needsLogsToAdvance": "Needs logs to advance", + "needsLogsToAdvanceHelp": "Select if you want the routine to progress to the next scheduled day only if you've logged a workout for the day", + "routineDays": "Days in routine", + "resultingRoutine": "Resulting routine", "newDay": "New day", "@newDay": {}, "newSet": "New set", @@ -293,6 +304,8 @@ "anErrorOccurred": "An Error Occurred!", "@anErrorOccurred": {}, "weight": "Weight", + "min": "Min", + "max": "Max", "@weight": { "description": "The weight of a workout log or body weight entry" }, @@ -301,7 +314,9 @@ "description": "All-time chart of 'name' (e.g. 'weight', 'body fat' etc.)", "type": "text", "placeholders": { - "name": {} + "name": { + "type": "String" + } } }, "chart30DaysTitle": "{name} last 30 days", @@ -309,7 +324,9 @@ "description": "last 30 days chart of 'name' (e.g. 'weight', 'body fat' etc.)", "type": "text", "placeholders": { - "name": {} + "name": { + "type": "String" + } } }, "chartDuringPlanTitle": "{chartName} during nutritional plan {planName}", @@ -317,8 +334,12 @@ "description": "chart of 'chartName' (e.g. 'weight', 'body fat' etc.) logged during plan", "type": "text", "placeholders": { - "chartName": {}, - "planName": {} + "chartName": { + "type": "String" + }, + "planName": { + "type": "String" + } } }, "measurement": "Measurement", @@ -412,7 +433,9 @@ "description": "A value in kcal, e.g. 500 kcal", "type": "text", "placeholders": { - "value": {} + "value": { + "type": "String" + } } }, "kJ": "kJ", @@ -428,7 +451,9 @@ "description": "A value in grams, e.g. 5 g", "type": "text", "placeholders": { - "value": {} + "value": { + "type": "String" + } } }, "percentValue": "{value} %", @@ -436,7 +461,9 @@ "description": "A value in percent, e.g. 10 %", "type": "text", "placeholders": { - "value": {} + "value": { + "type": "String" + } } }, "protein": "Protein", @@ -462,7 +489,6 @@ "saturatedFat": "Saturated fat", "@saturatedFat": {}, "fiber": "Fibers", - "@fibres": {}, "sodium": "Sodium", "@sodium": {}, "amount": "Amount", @@ -502,7 +528,9 @@ "description": "Confirmation text before the user deletes an object", "type": "text", "placeholders": { - "toDelete": {} + "toDelete": { + "type": "String" + } } }, "newNutritionalPlan": "New nutritional plan", @@ -565,10 +593,6 @@ "@goToToday": { "description": "Label on button to jump back to 'today' in the calendar widget" }, - "enterRepetitionsOrWeight": "Please fill in either the repetitions or the weight for at least one of the sets", - "@enterRepetitionsOrWeight": { - "description": "Error message when the user hasn't filled in the forms for exercise sets" - }, "enterValue": "Please enter a value", "@enterValue": { "description": "Error message when the user hasn't entered a value on a required field" @@ -583,8 +607,12 @@ "description": "Error message when the user hasn't entered the correct number of characters in a form", "type": "text", "placeholders": { - "min": {}, - "max": {} + "min": { + "type": "String" + }, + "max": { + "type": "String" + } } }, "enterMinCharacters": "Please enter at least {min} characters", @@ -592,7 +620,9 @@ "description": "Error message when the user hasn't entered the minimum amount characters in a form", "type": "text", "placeholders": { - "min": {} + "min": { + "type": "String" + } } }, "baseNameEnglish": "All exercises need a base name in English", @@ -601,7 +631,9 @@ "description": "Label shown on the slider where the user selects the nr of sets", "type": "text", "placeholders": { - "nrOfSets": {} + "nrOfSets": { + "type": "String" + } } }, "setUnitsAndRir": "Set units and RiR", @@ -654,7 +686,9 @@ "description": "Dialog info when product is found with barcode", "type": "text", "placeholders": { - "productName": {} + "productName": { + "type": "String" + } } }, "productNotFound": "Product not found", @@ -666,7 +700,9 @@ "description": "Dialog info when product is not found with barcode", "type": "text", "placeholders": { - "barcode": {} + "barcode": { + "type": "String" + } } }, "scanBarcode": "Scan barcode", @@ -685,7 +721,9 @@ "alsoKnownAs": "Also known as: {aliases}", "@alsoKnownAs": { "placeholders": { - "aliases": {} + "aliases": { + "type": "String" + } }, "description": "List of alternative names for an exercise" }, @@ -695,7 +733,9 @@ "verifiedEmailInfo": "A verification email was sent to {email}", "@verifiedEmailInfo": { "placeholders": { - "email": {} + "email": { + "type": "String" + } } }, "alternativeNames": "Alternative names", @@ -706,6 +746,12 @@ "images": "Images", "language": "Language", "addExercise": "Add exercise", + "fitInWeek": "Fit in week", + "fitInWeekHelp": "If enabled, the days will repeat in a weekly cycle, otherwise the days will follow sequentially without regards to the start of a new week.", + "addSuperset": "Add superset", + "setHasProgression": "Set has progression", + "setHasProgressionWarning": "Please note that at the moment it is not possible to edit all settings for a set on the mobile application or configure automatic progression. For now, please use the web application.", + "setHasNoExercises": "This set has no exercises yet!", "contributeExercise": "Contribute an exercise", "translation": "Translation", "translateExercise": "Translate this exercise now", @@ -729,6 +775,9 @@ } } }, + "simpleMode": "Simple mode", + "simpleModeHelp": "Hide some of the more advanced settings when editing exercises", + "progressionRules": "This exercise has progression rules and can't be edited on the mobile app. Please use the web application to edit this exercise.", "cacheWarning": "Due to caching it might take some time till the changes are visible throughout the application.", "textPromptTitle": "Ready to start?", "textPromptSubheading": "Press the action button to begin", @@ -917,4 +966,4 @@ "darkMode": "Always dark mode", "lightMode": "Always light mode", "systemMode": "System settings" -} +} \ No newline at end of file diff --git a/lib/l10n/app_es.arb b/lib/l10n/app_es.arb index b3c067f39..6e17c8de8 100644 --- a/lib/l10n/app_es.arb +++ b/lib/l10n/app_es.arb @@ -24,7 +24,9 @@ "description": "Label shown on the slider where the user selects the nr of sets", "type": "text", "placeholders": { - "nrOfSets": {} + "nrOfSets": { + "type": "String" + } } }, "enterCharacters": "Por favor ingresa entre {min} y {max} caracteres", @@ -32,8 +34,12 @@ "description": "Error message when the user hasn't entered the correct number of characters in a form", "type": "text", "placeholders": { - "min": {}, - "max": {} + "min": { + "type": "String" + }, + "max": { + "type": "String" + } } }, "selectExercise": "Por favor selecciona un ejercicio", @@ -44,10 +50,6 @@ "@enterValue": { "description": "Error message when the user hasn't entered a value on a required field" }, - "enterRepetitionsOrWeight": "Por favor completa las repeticiones o pesos para al menos una de las series", - "@enterRepetitionsOrWeight": { - "description": "Error message when the user hasn't filled in the forms for exercise sets" - }, "goToToday": "Ir a \"hoy\"", "@goToToday": { "description": "Label on button to jump back to 'today' in the calendar widget" @@ -101,7 +103,9 @@ "description": "Confirmation text before the user deletes an object", "type": "text", "placeholders": { - "toDelete": {} + "toDelete": { + "type": "String" + } } }, "delete": "Borrar", @@ -180,8 +184,6 @@ "@weight": { "description": "The weight of a workout log or body weight entry" }, - "dismiss": "Cerrar", - "@dismiss": {}, "anErrorOccurred": "¡Un error ha ocurrido!", "@anErrorOccurred": {}, "noNutritionalPlans": "No tienes planes nutricionales", @@ -253,7 +255,9 @@ "description": "Header in form indicating the number of the current set. Can also be translated as something like 'Set Nr. xy'.", "type": "text", "placeholders": { - "nr": {} + "nr": { + "type": "String" + } } }, "dayDescriptionHelp": "Una descripción de lo que se hace este día (ej. 'día de levantamientos') o qué partes del cuerpo se entrenan (ej. 'pecho y hombros')", @@ -494,10 +498,6 @@ "@searchIngredient": { "description": "Label on ingredient search form" }, - "supersetWith": "en conjunto con", - "@supersetWith": { - "description": "Text used between exercise cards when adding a new set. Translate as something like 'in a superset with'" - }, "rirNotUsed": "Valor ReR sin usar", "@rirNotUsed": { "description": "Label used in RiR slider when the RiR value is not used/saved for the current setting or log" @@ -532,7 +532,9 @@ "description": "Dialog info when product is found with barcode", "type": "text", "placeholders": { - "productName": {} + "productName": { + "type": "String" + } } }, "weekAverage": "Promedio de 7 días", @@ -552,7 +554,9 @@ "description": "Dialog info when product is not found with barcode", "type": "text", "placeholders": { - "barcode": {} + "barcode": { + "type": "String" + } } }, "scanBarcode": "Escanear código de barras", @@ -576,7 +580,9 @@ "alsoKnownAs": "También conocido como: {aliases}", "@alsoKnownAs": { "placeholders": { - "aliases": {} + "aliases": { + "type": "String" + } }, "description": "List of alternative names for an exercise" }, @@ -589,7 +595,9 @@ "verifiedEmailInfo": "Se envió un correo electrónico de verificación a {email}", "@verifiedEmailInfo": { "placeholders": { - "email": {} + "email": { + "type": "String" + } } }, "oneNamePerLine": "Un nombre por línea", @@ -687,7 +695,9 @@ "description": "Error message when the user hasn't entered the minimum amount characters in a form", "type": "text", "placeholders": { - "min": {} + "min": { + "type": "String" + } } }, "add_exercise_image_license": "Las imágenes deben ser compatibles con la licencia CC BY SA. Si tienes dudas, sube solamente fotos que hayas tomado tú mismo.", @@ -788,4 +798,4 @@ "@aboutDonateTitle": {}, "aboutDonateText": "Invítanos un café para ayudar al proyecto, cubrir los costos del servidor y mantenernos activos", "@aboutDonateText": {} -} +} \ No newline at end of file diff --git a/lib/l10n/app_fr.arb b/lib/l10n/app_fr.arb index 574c5b2d8..d29e615b0 100644 --- a/lib/l10n/app_fr.arb +++ b/lib/l10n/app_fr.arb @@ -12,7 +12,9 @@ "description": "Confirmation text before the user deletes an object", "type": "text", "placeholders": { - "toDelete": {} + "toDelete": { + "type": "String" + } } }, "selectIngredient": "Veuillez sélectionner un ingrédient", @@ -33,10 +35,6 @@ }, "calendar": "Calendrier", "@calendar": {}, - "aboutText": "wger est un logiciel libre, sous licence AFPLv3+ et disponible sur GitHub:", - "@aboutText": { - "description": "Text in the about dialog" - }, "toggleDetails": "Afficher les détails", "@toggleDetails": { "description": "Switch to toggle detail / overview" @@ -115,8 +113,6 @@ "@date": { "description": "The date of a workout log or body weight entry" }, - "dismiss": "Rejeter", - "@dismiss": {}, "anErrorOccurred": "Une erreur s’est produite !", "@anErrorOccurred": {}, "noNutritionalPlans": "Aucun programme nutritionnel", @@ -284,7 +280,9 @@ "description": "Label shown on the slider where the user selects the nr of sets", "type": "text", "placeholders": { - "nrOfSets": {} + "nrOfSets": { + "type": "String" + } } }, "enterCharacters": "Veuillez saisir un nombre de caractères compris entre {min} et {max}", @@ -292,18 +290,18 @@ "description": "Error message when the user hasn't entered the correct number of characters in a form", "type": "text", "placeholders": { - "min": {}, - "max": {} + "min": { + "type": "String" + }, + "max": { + "type": "String" + } } }, "selectExercise": "Veuillez sélectionner un exercice", "@selectExercise": { "description": "Error message when the user hasn't selected an exercise in the form" }, - "enterRepetitionsOrWeight": "Veuillez indiquer les répétitions ou le poids pour au moins une des séries", - "@enterRepetitionsOrWeight": { - "description": "Error message when the user hasn't filled in the forms for exercise sets" - }, "aboutTranslationText": "Cette application est traduite sur Weblate. Si vous voulez aussi aider, cliquez sur le lien et commencez à traduire", "@aboutTranslationText": { "description": "Text for translation section in the about dialog" @@ -361,7 +359,9 @@ "description": "Header in form indicating the number of the current set. Can also be translated as something like 'Set Nr. xy'.", "type": "text", "placeholders": { - "nr": {} + "nr": { + "type": "String" + } } }, "dayDescriptionHelp": "Une description de ce qui est fait ce jour-ci (par exemple : « journée de tractions ») ou des parties du corps qui sont entraînées (par exemple : « poitrine et épaules »)", @@ -451,10 +451,6 @@ }, "timeStartAhead": "L'heure de début ne peut pas être après à l'heure de fin", "@timeStartAhead": {}, - "supersetWith": "supersérie avec", - "@supersetWith": { - "description": "Text used between exercise cards when adding a new set. Translate as something like 'in a superset with'" - }, "plateCalculatorNotDivisible": "Impossible d'atteindre le poids avec les disques disponibles", "@plateCalculatorNotDivisible": { "description": "Error message when the current weight is not reachable with plates (e.g. 33.1 kg)" @@ -564,7 +560,9 @@ "description": "Dialog info when product is found with barcode", "type": "text", "placeholders": { - "productName": {} + "productName": { + "type": "String" + } } }, "productNotFoundDescription": "Le produit dont le code-barres a été scanné {barcode} n'a pas été trouvé dans la base de données wger", @@ -572,7 +570,9 @@ "description": "Dialog info when product is not found with barcode", "type": "text", "placeholders": { - "barcode": {} + "barcode": { + "type": "String" + } } }, "contributeExerciseWarning": "Vous ne pouvez contribuer aux exercices que si votre compte a plus de {days} jours et si vous avez vérifié votre adresse email", @@ -592,7 +592,9 @@ "description": "Error message when the user hasn't entered the minimum amount characters in a form", "type": "text", "placeholders": { - "min": {} + "min": { + "type": "String" + } } }, "baseNameEnglish": "Tous les exercices doivent avoir un nom de base en anglais", @@ -610,7 +612,9 @@ "alsoKnownAs": "Aussi connu sous le nom de : {aliases}", "@alsoKnownAs": { "placeholders": { - "aliases": {} + "aliases": { + "type": "String" + } }, "description": "List of alternative names for an exercise" }, @@ -619,7 +623,9 @@ "verifiedEmailInfo": "Un email de vérification a été envoyé à {email}", "@verifiedEmailInfo": { "placeholders": { - "email": {} + "email": { + "type": "String" + } } }, "whatVariationsExist": "Quelles sont les variantes de cet exercice, s'il en existe ?", @@ -793,7 +799,9 @@ "description": "A value in kcal, e.g. 500 kcal", "type": "text", "placeholders": { - "value": {} + "value": { + "type": "String" + } } }, "gValue": "{value} g", @@ -801,7 +809,9 @@ "description": "A value in grams, e.g. 5 g", "type": "text", "placeholders": { - "value": {} + "value": { + "type": "String" + } } }, "percentValue": "{value} %", @@ -809,7 +819,9 @@ "description": "A value in percent, e.g. 10 %", "type": "text", "placeholders": { - "value": {} + "value": { + "type": "String" + } } }, "noIngredientsDefined": "Aucun ingrédient défini pour le moment", @@ -865,7 +877,9 @@ "description": "last 30 days chart of 'name' (e.g. 'weight', 'body fat' etc.)", "type": "text", "placeholders": { - "name": {} + "name": { + "type": "String" + } } }, "chartAllTimeTitle": "{name} de tous temps", @@ -873,7 +887,9 @@ "description": "All-time chart of 'name' (e.g. 'weight', 'body fat' etc.)", "type": "text", "placeholders": { - "name": {} + "name": { + "type": "String" + } } } -} +} \ No newline at end of file diff --git a/lib/l10n/app_he.arb b/lib/l10n/app_he.arb index 73485f55c..996df6b77 100644 --- a/lib/l10n/app_he.arb +++ b/lib/l10n/app_he.arb @@ -73,10 +73,6 @@ "@searchExercise": { "description": "Label on set form. Selected exercises are added to the set" }, - "supersetWith": "סט תרגילים ראשי עם", - "@supersetWith": { - "description": "Text used between exercise cards when adding a new set. Translate as something like 'in a superset with'" - }, "muscles": "שרירים", "@muscles": { "description": "(main) muscles trained by an exercise" @@ -128,7 +124,9 @@ "description": "Header in form indicating the number of the current set. Can also be translated as something like 'Set Nr. xy'.", "type": "text", "placeholders": { - "nr": {} + "nr": { + "type": "String" + } } }, "impression": "התרשמות", @@ -304,7 +302,9 @@ "description": "Confirmation text before the user deletes an object", "type": "text", "placeholders": { - "toDelete": {} + "toDelete": { + "type": "String" + } } }, "newNutritionalPlan": "תוכנית תזונה חדשה", @@ -341,10 +341,6 @@ "@aboutSourceText": { "description": "Text for source code section in the about dialog" }, - "enterRepetitionsOrWeight": "אנא מלאו את החזרות או את המשקל בלפחות אחד מהסטים", - "@enterRepetitionsOrWeight": { - "description": "Error message when the user hasn't filled in the forms for exercise sets" - }, "setUnitsAndRir": "יחידות סט וחזרות בעתודה", "@setUnitsAndRir": { "description": "Label shown on the slider where the user can toggle showing units and RiR", @@ -365,8 +361,12 @@ "description": "Error message when the user hasn't entered the correct number of characters in a form", "type": "text", "placeholders": { - "min": {}, - "max": {} + "min": { + "type": "String" + }, + "max": { + "type": "String" + } } }, "nrOfSets": "כמות סטים לאימון: {nrOfSets}", @@ -374,7 +374,9 @@ "description": "Label shown on the slider where the user selects the nr of sets", "type": "text", "placeholders": { - "nrOfSets": {} + "nrOfSets": { + "type": "String" + } } }, "enterValidNumber": "אנא הכנס מספר תקין", @@ -509,4 +511,4 @@ "@noMatchingExerciseFound": { "description": "Message returned if no exercises match the searched string" } -} +} \ No newline at end of file diff --git a/lib/l10n/app_hi.arb b/lib/l10n/app_hi.arb index 480e3561f..0606516a0 100644 --- a/lib/l10n/app_hi.arb +++ b/lib/l10n/app_hi.arb @@ -69,8 +69,6 @@ "@exercise": {}, "searchExercise": "जोड़ने के लिए व्यायाम खोजें", "@searchExercise": {}, - "supersetWith": "सुपरसेट के साथ", - "@supersetWith": {}, "equipment": "उपकरण", "@equipment": {}, "muscles": "मांसपेशियों", @@ -277,8 +275,6 @@ "@aboutTranslationText": {}, "calendar": "कैलेंडर", "@calendar": {}, - "enterRepetitionsOrWeight": "कृपया इनमें से कम से कम एक सेट के लिए दोहराव या वजन भरें", - "@enterRepetitionsOrWeight": {}, "enterValue": "कृपया मान दर्ज करें", "@enterValue": {}, "selectExercise": "कृपया एक पाठ्यक्रम का चयन करें", diff --git a/lib/l10n/app_hr.arb b/lib/l10n/app_hr.arb index 6e61decb3..7e6dcdb2e 100644 --- a/lib/l10n/app_hr.arb +++ b/lib/l10n/app_hr.arb @@ -209,10 +209,6 @@ "@aboutContactUsTitle": { "description": "Title for contact us section in the about dialog" }, - "enterRepetitionsOrWeight": "Upiši broj ponavljanja ili težinu za barem jednu seriju", - "@enterRepetitionsOrWeight": { - "description": "Error message when the user hasn't filled in the forms for exercise sets" - }, "enterValue": "Upiši vrijednost", "@enterValue": { "description": "Error message when the user hasn't entered a value on a required field" @@ -226,8 +222,12 @@ "description": "Error message when the user hasn't entered the correct number of characters in a form", "type": "text", "placeholders": { - "min": {}, - "max": {} + "min": { + "type": "String" + }, + "max": { + "type": "String" + } } }, "nrOfSets": "Broj serija po vježbi: {nrOfSets}", @@ -235,7 +235,9 @@ "description": "Label shown on the slider where the user selects the nr of sets", "type": "text", "placeholders": { - "nrOfSets": {} + "nrOfSets": { + "type": "String" + } } }, "setUnitsAndRir": "Postavi jedinice i PUR", @@ -360,7 +362,9 @@ "description": "Confirmation text before the user deletes an object", "type": "text", "placeholders": { - "toDelete": {} + "toDelete": { + "type": "String" + } } }, "newNutritionalPlan": "Novi plan prehrane", @@ -427,10 +431,6 @@ "@equipment": { "description": "Equipment needed to perform an exercise" }, - "supersetWith": "u nasdkup sa", - "@supersetWith": { - "description": "Text used between exercise cards when adding a new set. Translate as something like 'in a superset with'" - }, "category": "Kategorija", "@category": { "description": "Category for an exercise, ingredient, etc." @@ -454,7 +454,9 @@ "description": "Header in form indicating the number of the current set. Can also be translated as something like 'Set Nr. xy'.", "type": "text", "placeholders": { - "nr": {} + "nr": { + "type": "String" + } } }, "sameRepetitions": "Ako radiš ista ponavljanja i težinu za sve serije, ispuni jedan redak. Na primjer, za 4 serije jednostavno upiši 10 za ponavljanja, to automatski postaje „4 × 10”.", @@ -534,7 +536,9 @@ "description": "Dialog info when product is found with barcode", "type": "text", "placeholders": { - "productName": {} + "productName": { + "type": "String" + } } }, "productNotFound": "Proizvod nije pronađen", @@ -546,7 +550,9 @@ "description": "Dialog info when product is not found with barcode", "type": "text", "placeholders": { - "barcode": {} + "barcode": { + "type": "String" + } } }, "scanBarcode": "Skeniraj barkod", @@ -562,7 +568,9 @@ "description": "Error message when the user hasn't entered the minimum amount characters in a form", "type": "text", "placeholders": { - "min": {} + "min": { + "type": "String" + } } }, "add_exercise_image_license": "Slike moraju biti kompatibilne s licencom CC BY SA. Ako si u nedoumici, prenesi samo svoje vlastite fotografije.", @@ -634,7 +642,9 @@ "alsoKnownAs": "Poznato i kao: {aliases}", "@alsoKnownAs": { "placeholders": { - "aliases": {} + "aliases": { + "type": "String" + } }, "description": "List of alternative names for an exercise" }, @@ -645,7 +655,9 @@ "verifiedEmailInfo": "E-mail poruka za potvrdu je poslana na {email}", "@verifiedEmailInfo": { "placeholders": { - "email": {} + "email": { + "type": "String" + } } }, "contributeExerciseWarning": "Vježbe možeš dodati samo ako je tvoj račun stariji od {days} dana i ako si potvrdio/la tvoju e-mail adresu", @@ -855,7 +867,9 @@ "description": "A value in percent, e.g. 10 %", "type": "text", "placeholders": { - "value": {} + "value": { + "type": "String" + } } }, "addGoalsToPlan": "Dodaj ciljeve ovom planu", @@ -877,7 +891,9 @@ "description": "A value in kcal, e.g. 500 kcal", "type": "text", "placeholders": { - "value": {} + "value": { + "type": "String" + } } }, "gValue": "{value} g", @@ -885,7 +901,9 @@ "description": "A value in grams, e.g. 5 g", "type": "text", "placeholders": { - "value": {} + "value": { + "type": "String" + } } }, "surplus": "višak", @@ -945,7 +963,9 @@ "description": "All-time chart of 'name' (e.g. 'weight', 'body fat' etc.)", "type": "text", "placeholders": { - "name": {} + "name": { + "type": "String" + } } }, "chartDuringPlanTitle": "{chartName} tijekom prehrambenog plana {planName}", @@ -953,8 +973,12 @@ "description": "chart of 'chartName' (e.g. 'weight', 'body fat' etc.) logged during plan", "type": "text", "placeholders": { - "chartName": {}, - "planName": {} + "chartName": { + "type": "String" + }, + "planName": { + "type": "String" + } } }, "settingsIngredientCacheDescription": "Predmemorija sastojaka", @@ -964,7 +988,9 @@ "description": "last 30 days chart of 'name' (e.g. 'weight', 'body fat' etc.)", "type": "text", "placeholders": { - "name": {} + "name": { + "type": "String" + } } } -} +} \ No newline at end of file diff --git a/lib/l10n/app_id.arb b/lib/l10n/app_id.arb index e18079dc5..834bd9a08 100644 --- a/lib/l10n/app_id.arb +++ b/lib/l10n/app_id.arb @@ -108,10 +108,6 @@ "@searchExercise": { "description": "Label on set form. Selected exercises are added to the set" }, - "supersetWith": "tambahkan dengan", - "@supersetWith": { - "description": "Text used between exercise cards when adding a new set. Translate as something like 'in a superset with'" - }, "equipment": "Perlengkapan", "@equipment": { "description": "Equipment needed to perform an exercise" @@ -167,7 +163,9 @@ "description": "Header in form indicating the number of the current set. Can also be translated as something like 'Set Nr. xy'.", "type": "text", "placeholders": { - "nr": {} + "nr": { + "type": "String" + } } }, "sameRepetitions": "Jika Anda melakukan pengulangan dan bobot yang sama untuk semua set, Anda cukup mengisi satu baris. Misalnya untuk 4 set cukup masukkan 10 untuk pengulangan, ini secara otomatis menjadi \"4 x 10\".", @@ -403,7 +401,9 @@ "description": "Confirmation text before the user deletes an object", "type": "text", "placeholders": { - "toDelete": {} + "toDelete": { + "type": "String" + } } }, "newNutritionalPlan": "New nutritional plan", @@ -456,10 +456,6 @@ "@goToToday": { "description": "Label on button to jump back to 'today' in the calendar widget" }, - "enterRepetitionsOrWeight": "Please fill in either the repetitions or the weight for at least one of the sets", - "@enterRepetitionsOrWeight": { - "description": "Error message when the user hasn't filled in the forms for exercise sets" - }, "enterValue": "Please enter a value", "@enterValue": { "description": "Error message when the user hasn't entered a value on a required field" @@ -473,8 +469,12 @@ "description": "Error message when the user hasn't entered the correct number of characters in a form", "type": "text", "placeholders": { - "min": {}, - "max": {} + "min": { + "type": "String" + }, + "max": { + "type": "String" + } } }, "nrOfSets": "Sets per exercise: {nrOfSets}", @@ -482,7 +482,9 @@ "description": "Label shown on the slider where the user selects the nr of sets", "type": "text", "placeholders": { - "nrOfSets": {} + "nrOfSets": { + "type": "String" + } } }, "setUnitsAndRir": "Set units and RiR", @@ -535,7 +537,9 @@ "description": "Dialog info when product is found with barcode", "type": "text", "placeholders": { - "productName": {} + "productName": { + "type": "String" + } } }, "productNotFound": "Product not found", @@ -547,7 +551,9 @@ "description": "Dialog info when product is not found with barcode", "type": "text", "placeholders": { - "barcode": {} + "barcode": { + "type": "String" + } } }, "scanBarcode": "Scan barcode", @@ -602,4 +608,4 @@ "@triceps": { "description": "Generated entry for translation for server strings" } -} +} \ No newline at end of file diff --git a/lib/l10n/app_it.arb b/lib/l10n/app_it.arb index 6d07de5e4..84bae4ae1 100644 --- a/lib/l10n/app_it.arb +++ b/lib/l10n/app_it.arb @@ -19,10 +19,6 @@ }, "calendar": "Calendario", "@calendar": {}, - "aboutText": "wger è rilasciato con \"permesso d'autore\", licenza AGPLv3+ e disponibile su GitHub:", - "@aboutText": { - "description": "Text in the about dialog" - }, "toggleDetails": "Scegli dettagli", "@toggleDetails": { "description": "Switch to toggle detail / overview" @@ -34,7 +30,9 @@ "description": "Confirmation text before the user deletes an object", "type": "text", "placeholders": { - "toDelete": {} + "toDelete": { + "type": "String" + } } }, "delete": "Elimina", @@ -113,8 +111,6 @@ "@weight": { "description": "The weight of a workout log or body weight entry" }, - "dismiss": "Annulla", - "@dismiss": {}, "noNutritionalPlans": "Non hai nessun piano nutrizionale", "@noNutritionalPlans": { "description": "Message shown when the user has no nutritional plans" @@ -272,7 +268,9 @@ "description": "Label shown on the slider where the user selects the nr of sets", "type": "text", "placeholders": { - "nrOfSets": {} + "nrOfSets": { + "type": "String" + } } }, "enterCharacters": "Inserisci una stringa tra {min} e {max} caratteri", @@ -280,8 +278,12 @@ "description": "Error message when the user hasn't entered the correct number of characters in a form", "type": "text", "placeholders": { - "min": {}, - "max": {} + "min": { + "type": "String" + }, + "max": { + "type": "String" + } } }, "selectExercise": "Prego, seleziona un esercizio", @@ -299,7 +301,9 @@ "description": "Header in form indicating the number of the current set. Can also be translated as something like 'Set Nr. xy'.", "type": "text", "placeholders": { - "nr": {} + "nr": { + "type": "String" + } } }, "dayDescriptionHelp": "Una descrizione di ciò che è stato fatto. (p.e. «allenamento gambe») o quale parte del corpo sono state allenate (p.e. «petto e spalle»)", @@ -336,10 +340,6 @@ "@logout": { "description": "Text for logout button" }, - "enterRepetitionsOrWeight": "Inserisci sia le ripetizioni che il peso per almeno una delle serie", - "@enterRepetitionsOrWeight": { - "description": "Error message when the user hasn't filled in the forms for exercise sets" - }, "aboutTranslationText": "Questa applicazione è tradotta su weblate. Se anche tu vuoi contribuire, clicca sul link e inizia a tradurre", "@aboutTranslationText": { "description": "Text for translation section in the about dialog" @@ -515,10 +515,6 @@ "@recentlyUsedIngredients": { "description": "A message when a user adds a new ingredient to a meal." }, - "supersetWith": "superset con", - "@supersetWith": { - "description": "Text used between exercise cards when adding a new set. Translate as something like 'in a superset with'" - }, "plateCalculator": "Piastre", "@plateCalculator": { "description": "Label used for the plate calculator in the gym mode" @@ -532,7 +528,9 @@ "description": "Dialog info when product is not found with barcode", "type": "text", "placeholders": { - "barcode": {} + "barcode": { + "type": "String" + } } }, "productNotFound": "Prodotto non trovato", @@ -556,7 +554,9 @@ "description": "Dialog info when product is found with barcode", "type": "text", "placeholders": { - "productName": {} + "productName": { + "type": "String" + } } }, "close": "Chiudi", @@ -592,7 +592,9 @@ "verifiedEmailInfo": "Un'email di verifica è stata inviata a {email}", "@verifiedEmailInfo": { "placeholders": { - "email": {} + "email": { + "type": "String" + } } }, "oneNamePerLine": "Un nome per linea", @@ -694,7 +696,9 @@ "description": "Error message when the user hasn't entered the minimum amount characters in a form", "type": "text", "placeholders": { - "min": {} + "min": { + "type": "String" + } } }, "sz_bar": "SZ-Bar", @@ -710,7 +714,9 @@ "alsoKnownAs": "Conosciuto anche come: {aliases}", "@alsoKnownAs": { "placeholders": { - "aliases": {} + "aliases": { + "type": "String" + } }, "description": "List of alternative names for an exercise" }, @@ -861,8 +867,12 @@ "description": "chart of 'chartName' (e.g. 'weight', 'body fat' etc.) logged during plan", "type": "text", "placeholders": { - "chartName": {}, - "planName": {} + "chartName": { + "type": "String" + }, + "planName": { + "type": "String" + } } }, "chart30DaysTitle": "{name} ultimi 30 giorni", @@ -870,7 +880,9 @@ "description": "last 30 days chart of 'name' (e.g. 'weight', 'body fat' etc.)", "type": "text", "placeholders": { - "name": {} + "name": { + "type": "String" + } } }, "goalMacro": "Obiettivi dei macronutrienti", @@ -930,7 +942,9 @@ "description": "A value in kcal, e.g. 500 kcal", "type": "text", "placeholders": { - "value": {} + "value": { + "type": "String" + } } }, "gValue": "{value} g", @@ -938,7 +952,9 @@ "description": "A value in grams, e.g. 5 g", "type": "text", "placeholders": { - "value": {} + "value": { + "type": "String" + } } }, "percentValue": "{value} %", @@ -946,7 +962,9 @@ "description": "A value in percent, e.g. 10 %", "type": "text", "placeholders": { - "value": {} + "value": { + "type": "String" + } } }, "onlyLoggingHelpText": "Selezionate la casella se volete registrare solo le calorie e non volete impostare un piano nutrizionale dettagliato con pasti specifici", @@ -968,9 +986,11 @@ "description": "All-time chart of 'name' (e.g. 'weight', 'body fat' etc.)", "type": "text", "placeholders": { - "name": {} + "name": { + "type": "String" + } } }, "darkMode": "Sempre in modalità scura", "@darkMode": {} -} +} \ No newline at end of file diff --git a/lib/l10n/app_ja.arb b/lib/l10n/app_ja.arb index 3f8110a82..c045daf37 100644 --- a/lib/l10n/app_ja.arb +++ b/lib/l10n/app_ja.arb @@ -107,10 +107,6 @@ "@searchExercise": { "description": "Label on set form. Selected exercises are added to the set" }, - "supersetWith": "セットで", - "@supersetWith": { - "description": "Text used between exercise cards when adding a new set. Translate as something like 'in a superset with'" - }, "equipment": "器具", "@equipment": { "description": "Equipment needed to perform an exercise" @@ -166,7 +162,9 @@ "description": "Header in form indicating the number of the current set. Can also be translated as something like 'Set Nr. xy'.", "type": "text", "placeholders": { - "nr": {} + "nr": { + "type": "String" + } } }, "sameRepetitions": "If you do the same repetitions and weight for all sets you can just fill in one row. For example for 4 sets just enter 10 for the repetitions, this automatically becomes \"4 x 10\".", @@ -402,7 +400,9 @@ "description": "Confirmation text before the user deletes an object", "type": "text", "placeholders": { - "toDelete": {} + "toDelete": { + "type": "String" + } } }, "newNutritionalPlan": "New nutritional plan", @@ -455,10 +455,6 @@ "@goToToday": { "description": "Label on button to jump back to 'today' in the calendar widget" }, - "enterRepetitionsOrWeight": "Please fill in either the repetitions or the weight for at least one of the sets", - "@enterRepetitionsOrWeight": { - "description": "Error message when the user hasn't filled in the forms for exercise sets" - }, "enterValue": "Please enter a value", "@enterValue": { "description": "Error message when the user hasn't entered a value on a required field" @@ -472,8 +468,12 @@ "description": "Error message when the user hasn't entered the correct number of characters in a form", "type": "text", "placeholders": { - "min": {}, - "max": {} + "min": { + "type": "String" + }, + "max": { + "type": "String" + } } }, "nrOfSets": "Sets per exercise: {nrOfSets}", @@ -481,7 +481,9 @@ "description": "Label shown on the slider where the user selects the nr of sets", "type": "text", "placeholders": { - "nrOfSets": {} + "nrOfSets": { + "type": "String" + } } }, "setUnitsAndRir": "Set units and RiR", @@ -534,7 +536,9 @@ "description": "Dialog info when product is found with barcode", "type": "text", "placeholders": { - "productName": {} + "productName": { + "type": "String" + } } }, "productNotFound": "Product not found", @@ -546,7 +550,9 @@ "description": "Dialog info when product is not found with barcode", "type": "text", "placeholders": { - "barcode": {} + "barcode": { + "type": "String" + } } }, "scanBarcode": "Scan barcode", @@ -615,4 +621,4 @@ "@calves": { "description": "Generated entry for translation for server strings" } -} +} \ No newline at end of file diff --git a/lib/l10n/app_nb.arb b/lib/l10n/app_nb.arb index f08336692..6b45d15f8 100644 --- a/lib/l10n/app_nb.arb +++ b/lib/l10n/app_nb.arb @@ -1,10 +1,5 @@ { - "aboutText": "wger arbeidsøkthåndterer er gemenhetslig fri programvare, lisensiert AGPLv3+ og tilgjengelig på GitHub:", - "@aboutText": { - "description": "Text in the about dialog" - }, "fiber": "Fiber", - "@fibres": {}, "mealLogged": "Måltid lagt til i dagbok", "@mealLogged": {}, "successfullyDeleted": "Slettet", @@ -91,8 +86,6 @@ "@weight": { "description": "The weight of a workout log or body weight entry" }, - "dismiss": "Forkast", - "@dismiss": {}, "anErrorOccurred": "En feil inntraff.", "@anErrorOccurred": {}, "nutritionalPlans": "Ernæringsplaner", diff --git a/lib/l10n/app_pl.arb b/lib/l10n/app_pl.arb index efa524513..3fdc2b0ae 100644 --- a/lib/l10n/app_pl.arb +++ b/lib/l10n/app_pl.arb @@ -102,7 +102,9 @@ "description": "Dialog info when product is found with barcode", "type": "text", "placeholders": { - "productName": {} + "productName": { + "type": "String" + } } }, "dataCopied": "Dane skopiowane do nowego dziennika", @@ -128,8 +130,12 @@ "description": "Error message when the user hasn't entered the correct number of characters in a form", "type": "text", "placeholders": { - "min": {}, - "max": {} + "min": { + "type": "String" + }, + "max": { + "type": "String" + } } }, "nrOfSets": "Ilość serii ćwiczenia: {nrOfSets}", @@ -137,13 +143,11 @@ "description": "Label shown on the slider where the user selects the nr of sets", "type": "text", "placeholders": { - "nrOfSets": {} + "nrOfSets": { + "type": "String" + } } }, - "supersetWith": "Dodatkowa seria", - "@supersetWith": { - "description": "Text used between exercise cards when adding a new set. Translate as something like 'in a superset with'" - }, "rirNotUsed": "Bez rezerwy powtórzeń", "@rirNotUsed": { "description": "Label used in RiR slider when the RiR value is not used/saved for the current setting or log" @@ -163,7 +167,9 @@ "description": "Header in form indicating the number of the current set. Can also be translated as something like 'Set Nr. xy'.", "type": "text", "placeholders": { - "nr": {} + "nr": { + "type": "String" + } } }, "sameRepetitions": "Jeśli wykonasz tą sama liczbę powtórzenia z tym samym ciężarem dla wszystkich serii, możesz po prostu wypełnić jeden wiersz. Na przykład dla 4 serii wystarczy wpisać 10 dla powtórzeń, automatycznie zmieni się to na „4 x 10”.", @@ -383,7 +389,9 @@ "description": "Confirmation text before the user deletes an object", "type": "text", "placeholders": { - "toDelete": {} + "toDelete": { + "type": "String" + } } }, "planned": "Zaplanowane", @@ -465,7 +473,9 @@ "description": "Dialog info when product is not found with barcode", "type": "text", "placeholders": { - "barcode": {} + "barcode": { + "type": "String" + } } }, "scanBarcode": "Zeskanuj kod kreskowy", @@ -540,10 +550,6 @@ "@goToToday": { "description": "Label on button to jump back to 'today' in the calendar widget" }, - "enterRepetitionsOrWeight": "Proszę wypełnić powtórzenia lub wagę przynajmniej jednej serii", - "@enterRepetitionsOrWeight": { - "description": "Error message when the user hasn't filled in the forms for exercise sets" - }, "enterValue": "proszę wprowadzić wartość", "@enterValue": { "description": "Error message when the user hasn't entered a value on a required field" @@ -568,7 +574,9 @@ "description": "Error message when the user hasn't entered the minimum amount characters in a form", "type": "text", "placeholders": { - "min": {} + "min": { + "type": "String" + } } }, "baseNameEnglish": "Wszystkie ćwiczenia wymagają nazwy podstawowej w języku angielskim", @@ -586,7 +594,9 @@ "alsoKnownAs": "Znany również jako: {aliases}", "@alsoKnownAs": { "placeholders": { - "aliases": {} + "aliases": { + "type": "String" + } }, "description": "List of alternative names for an exercise" }, @@ -599,7 +609,9 @@ "verifiedEmailInfo": "Wiadomość weryfikacyjna została wysłana na adres {email}", "@verifiedEmailInfo": { "placeholders": { - "email": {} + "email": { + "type": "String" + } } }, "alternativeNames": "Alternatywne nazwy", @@ -777,7 +789,9 @@ "description": "A value in kcal, e.g. 500 kcal", "type": "text", "placeholders": { - "value": {} + "value": { + "type": "String" + } } }, "gValue": "{value} g", @@ -785,7 +799,9 @@ "description": "A value in grams, e.g. 5 g", "type": "text", "placeholders": { - "value": {} + "value": { + "type": "String" + } } }, "percentValue": "{value} %", @@ -793,7 +809,9 @@ "description": "A value in percent, e.g. 10 %", "type": "text", "placeholders": { - "value": {} + "value": { + "type": "String" + } } }, "aboutMastodonText": "Obserwuj nas na Mastodonie, aby otrzymywać aktualizacje i aktualności na temat projektu", @@ -853,7 +871,9 @@ "description": "All-time chart of 'name' (e.g. 'weight', 'body fat' etc.)", "type": "text", "placeholders": { - "name": {} + "name": { + "type": "String" + } } }, "chart30DaysTitle": "{name} ostatnie 30 dni", @@ -861,7 +881,9 @@ "description": "last 30 days chart of 'name' (e.g. 'weight', 'body fat' etc.)", "type": "text", "placeholders": { - "name": {} + "name": { + "type": "String" + } } } -} +} \ No newline at end of file diff --git a/lib/l10n/app_pt.arb b/lib/l10n/app_pt.arb index d2b1d619a..a5fb87f51 100644 --- a/lib/l10n/app_pt.arb +++ b/lib/l10n/app_pt.arb @@ -67,10 +67,6 @@ "@exercise": { "description": "An exercise for a workout" }, - "supersetWith": "conjunto com", - "@supersetWith": { - "description": "Text used between exercise cards when adding a new set. Translate as something like 'in a superset with'" - }, "equipment": "Equipamento", "@equipment": { "description": "Equipment needed to perform an exercise" @@ -242,7 +238,9 @@ "description": "Label shown on the slider where the user selects the nr of sets", "type": "text", "placeholders": { - "nrOfSets": {} + "nrOfSets": { + "type": "String" + } } }, "recentlyUsedIngredients": "Ingredientes adicionados recentemente", @@ -346,7 +344,9 @@ "description": "Header in form indicating the number of the current set. Can also be translated as something like 'Set Nr. xy'.", "type": "text", "placeholders": { - "nr": {} + "nr": { + "type": "String" + } } }, "sameRepetitions": "Se você fizer as mesmas repetições e peso para todos os conjuntos, você pode preencher apenas uma linha. Por exemplo, para 4 séries, basta digitar 10 para as repetições, isso se torna automaticamente \"4 x 10\".", @@ -494,17 +494,15 @@ "description": "Confirmation text before the user deletes an object", "type": "text", "placeholders": { - "toDelete": {} + "toDelete": { + "type": "String" + } } }, "aboutSourceText": "Obtenha o código fonte deste aplicativo e seu servidor no github", "@aboutSourceText": { "description": "Text for source code section in the about dialog" }, - "enterRepetitionsOrWeight": "Por favor, preencha as repetições ou o peso para pelo menos um dos conjuntos", - "@enterRepetitionsOrWeight": { - "description": "Error message when the user hasn't filled in the forms for exercise sets" - }, "setUnitsAndRir": "Definir unidades e ReR", "@setUnitsAndRir": { "description": "Label shown on the slider where the user can toggle showing units and RiR", @@ -519,7 +517,9 @@ "description": "Dialog info when product is not found with barcode", "type": "text", "placeholders": { - "barcode": {} + "barcode": { + "type": "String" + } } }, "selectExercise": "Selecione um exercício", @@ -531,8 +531,12 @@ "description": "Error message when the user hasn't entered the correct number of characters in a form", "type": "text", "placeholders": { - "min": {}, - "max": {} + "min": { + "type": "String" + }, + "max": { + "type": "String" + } } }, "optionsLabel": "Opções", @@ -544,13 +548,17 @@ "description": "Dialog info when product is found with barcode", "type": "text", "placeholders": { - "productName": {} + "productName": { + "type": "String" + } } }, "alsoKnownAs": "Também chamado de: {aliases}", "@alsoKnownAs": { "placeholders": { - "aliases": {} + "aliases": { + "type": "String" + } }, "description": "List of alternative names for an exercise" }, @@ -563,7 +571,9 @@ "verifiedEmailInfo": "Um email de verificação foi enviado para {email}", "@verifiedEmailInfo": { "placeholders": { - "email": {} + "email": { + "type": "String" + } } }, "close": "Fechar", @@ -659,7 +669,9 @@ "description": "Error message when the user hasn't entered the minimum amount characters in a form", "type": "text", "placeholders": { - "min": {} + "min": { + "type": "String" + } } }, "baseNameEnglish": "Todos os exercícios precisam de um nome base em inglês", @@ -801,7 +813,9 @@ "description": "A value in kcal, e.g. 500 kcal", "type": "text", "placeholders": { - "value": {} + "value": { + "type": "String" + } } }, "gValue": "{value} g", @@ -809,7 +823,9 @@ "description": "A value in grams, e.g. 5 g", "type": "text", "placeholders": { - "value": {} + "value": { + "type": "String" + } } }, "percentValue": "{value} %", @@ -817,7 +833,9 @@ "description": "A value in percent, e.g. 10 %", "type": "text", "placeholders": { - "value": {} + "value": { + "type": "String" + } } }, "noIngredientsDefined": "Sem ingredientes definido ainda", @@ -847,7 +865,9 @@ "description": "last 30 days chart of 'name' (e.g. 'weight', 'body fat' etc.)", "type": "text", "placeholders": { - "name": {} + "name": { + "type": "String" + } } }, "chartDuringPlanTitle": "{chartName} Durante o plano nutricional {planName}", @@ -855,8 +875,12 @@ "description": "chart of 'chartName' (e.g. 'weight', 'body fat' etc.) logged during plan", "type": "text", "placeholders": { - "chartName": {}, - "planName": {} + "chartName": { + "type": "String" + }, + "planName": { + "type": "String" + } } }, "loggedToday": "Registrado hoje", @@ -866,7 +890,9 @@ "description": "All-time chart of 'name' (e.g. 'weight', 'body fat' etc.)", "type": "text", "placeholders": { - "name": {} + "name": { + "type": "String" + } } }, "overallChangeWeight": "Mudança geral", @@ -903,4 +929,4 @@ "@darkMode": {}, "settingsIngredientCacheDescription": "Princípio de cache", "@settingsIngredientCacheDescription": {} -} +} \ No newline at end of file diff --git a/lib/l10n/app_pt_BR.arb b/lib/l10n/app_pt_BR.arb index fc809f304..82d0b8463 100644 --- a/lib/l10n/app_pt_BR.arb +++ b/lib/l10n/app_pt_BR.arb @@ -125,10 +125,6 @@ "@goToToday": { "description": "Label on button to jump back to 'today' in the calendar widget" }, - "enterRepetitionsOrWeight": "Por favor preencha as repetições ou o peso para pelo menos uma das séries", - "@enterRepetitionsOrWeight": { - "description": "Error message when the user hasn't filled in the forms for exercise sets" - }, "set": "Definir", "@set": { "description": "A set in a workout plan" @@ -154,7 +150,9 @@ "description": "Header in form indicating the number of the current set. Can also be translated as something like 'Set Nr. xy'.", "type": "text", "placeholders": { - "nr": {} + "nr": { + "type": "String" + } } }, "fat": "Gordura", @@ -411,10 +409,6 @@ "@sameRepetitions": {}, "measurementEntriesHelpText": "A unidade usada para medir a categoria, como 'cm' ou '%'", "@measurementEntriesHelpText": {}, - "supersetWith": "superset com", - "@supersetWith": { - "description": "Text used between exercise cards when adding a new set. Translate as something like 'in a superset with'" - }, "sugars": "Açúcar", "@sugars": {}, "aboutBugsTitle": "Tem um problema ou ideia?", @@ -440,7 +434,9 @@ "description": "Confirmation text before the user deletes an object", "type": "text", "placeholders": { - "toDelete": {} + "toDelete": { + "type": "String" + } } }, "gPerBodyKg": "g por kg corporal", @@ -488,7 +484,9 @@ "description": "Label shown on the slider where the user selects the nr of sets", "type": "text", "placeholders": { - "nrOfSets": {} + "nrOfSets": { + "type": "String" + } } }, "useMetric": "Use unidades métricas para peso corporal", @@ -543,8 +541,12 @@ "description": "Error message when the user hasn't entered the correct number of characters in a form", "type": "text", "placeholders": { - "min": {}, - "max": {} + "min": { + "type": "String" + }, + "max": { + "type": "String" + } } }, "enterMinCharacters": "Por favor, utilize pelo menos {min} caracteres", @@ -552,7 +554,9 @@ "description": "Error message when the user hasn't entered the minimum amount characters in a form", "type": "text", "placeholders": { - "min": {} + "min": { + "type": "String" + } } }, "gallery": "Galeria", @@ -560,7 +564,9 @@ "alsoKnownAs": "Também conhecido como:{aliases}", "@alsoKnownAs": { "placeholders": { - "aliases": {} + "aliases": { + "type": "String" + } }, "description": "List of alternative names for an exercise" }, @@ -645,7 +651,9 @@ "verifiedEmailInfo": "Um e-mail foi enviado para {email}", "@verifiedEmailInfo": { "placeholders": { - "email": {} + "email": { + "type": "String" + } } }, "verifiedEmailReason": "Você precisa verificar seu e-mail para contribuir com exercícios", @@ -663,7 +671,9 @@ "description": "Dialog info when product is found with barcode", "type": "text", "placeholders": { - "productName": {} + "productName": { + "type": "String" + } } }, "productNotFoundDescription": "O produto com o código de barras escaneado {barcode} não foi encontrado no banco de dados da wger", @@ -671,7 +681,9 @@ "description": "Dialog info when product is not found with barcode", "type": "text", "placeholders": { - "barcode": {} + "barcode": { + "type": "String" + } } }, "contributeExercise": "Contribuir com um exercício", @@ -793,7 +805,9 @@ "description": "A value in kcal, e.g. 500 kcal", "type": "text", "placeholders": { - "value": {} + "value": { + "type": "String" + } } }, "percentValue": "{value} %", @@ -801,7 +815,9 @@ "description": "A value in percent, e.g. 10 %", "type": "text", "placeholders": { - "value": {} + "value": { + "type": "String" + } } }, "goalMacro": "Macro Objetivos", @@ -825,7 +841,9 @@ "description": "A value in grams, e.g. 5 g", "type": "text", "placeholders": { - "value": {} + "value": { + "type": "String" + } } }, "abs": "Abdômen", @@ -909,7 +927,9 @@ "description": "All-time chart of 'name' (e.g. 'weight', 'body fat' etc.)", "type": "text", "placeholders": { - "name": {} + "name": { + "type": "String" + } } }, "chart30DaysTitle": "{name} últimos 30 dias", @@ -917,7 +937,9 @@ "description": "last 30 days chart of 'name' (e.g. 'weight', 'body fat' etc.)", "type": "text", "placeholders": { - "name": {} + "name": { + "type": "String" + } } }, "chartDuringPlanTitle": "{chartName} durante plano nutricional {planName}", @@ -925,8 +947,12 @@ "description": "chart of 'chartName' (e.g. 'weight', 'body fat' etc.) logged during plan", "type": "text", "placeholders": { - "chartName": {}, - "planName": {} + "chartName": { + "type": "String" + }, + "planName": { + "type": "String" + } } }, "settingsIngredientCacheDescription": "Cache de Ingredientes", @@ -955,4 +981,4 @@ "@biceps": { "description": "Generated entry for translation for server strings" } -} +} \ No newline at end of file diff --git a/lib/l10n/app_ro.arb b/lib/l10n/app_ro.arb index e66c153df..83c5c1e32 100644 --- a/lib/l10n/app_ro.arb +++ b/lib/l10n/app_ro.arb @@ -42,7 +42,9 @@ "description": "Header in form indicating the number of the current set. Can also be translated as something like 'Set Nr. xy'.", "type": "text", "placeholders": { - "nr": {} + "nr": { + "type": "String" + } } }, "noWorkoutPlans": "Nu ai niciun de antrenament", @@ -159,10 +161,6 @@ "@logout": { "description": "Text for logout button" }, - "supersetWith": "superset cu", - "@supersetWith": { - "description": "Text used between exercise cards when adding a new set. Translate as something like 'in a superset with'" - }, "customServerUrl": "URL-ul instanței wger", "@customServerUrl": { "description": "Label in the form where the users can enter their own wger instance" @@ -325,4 +323,4 @@ "@time": { "description": "The time of a meal or workout" } -} +} \ No newline at end of file diff --git a/lib/l10n/app_ru.arb b/lib/l10n/app_ru.arb index 129cdbc42..3097e2652 100644 --- a/lib/l10n/app_ru.arb +++ b/lib/l10n/app_ru.arb @@ -128,8 +128,12 @@ "description": "Error message when the user hasn't entered the correct number of characters in a form", "type": "text", "placeholders": { - "min": {}, - "max": {} + "min": { + "type": "String" + }, + "max": { + "type": "String" + } } }, "nrOfSets": "Количество сетов на упражнение: {nrOfSets}", @@ -137,7 +141,9 @@ "description": "Label shown on the slider where the user selects the nr of sets", "type": "text", "placeholders": { - "nrOfSets": {} + "nrOfSets": { + "type": "String" + } } }, "selectIngredient": "Пожалуйста, выберите ингредиент", @@ -375,7 +381,9 @@ "description": "Confirmation text before the user deletes an object", "type": "text", "placeholders": { - "toDelete": {} + "toDelete": { + "type": "String" + } } }, "setUnitsAndRir": "Установите единицы измерения и ПвЗ", @@ -429,10 +437,6 @@ "@noWeightEntries": { "description": "Message shown when the user has no logged weight entries" }, - "supersetWith": "суперсет с", - "@supersetWith": { - "description": "Text used between exercise cards when adding a new set. Translate as something like 'in a superset with'" - }, "newEntry": "Новая запись", "@newEntry": { "description": "Title when adding a new entry such as a weight or log entry" @@ -479,10 +483,6 @@ "@goToToday": { "description": "Label on button to jump back to 'today' in the calendar widget" }, - "enterRepetitionsOrWeight": "Пожалуйста, укажите количество повторений или вес хотя бы для одного из сетов", - "@enterRepetitionsOrWeight": { - "description": "Error message when the user hasn't filled in the forms for exercise sets" - }, "optionsLabel": "Опции", "@optionsLabel": { "description": "Label for the popup with general app options" @@ -504,7 +504,9 @@ "description": "Header in form indicating the number of the current set. Can also be translated as something like 'Set Nr. xy'.", "type": "text", "placeholders": { - "nr": {} + "nr": { + "type": "String" + } } }, "addSet": "Добавить сет", @@ -530,7 +532,9 @@ "description": "Dialog info when product is not found with barcode", "type": "text", "placeholders": { - "barcode": {} + "barcode": { + "type": "String" + } } }, "scanBarcode": "Сканировать штрихкод", @@ -554,7 +558,9 @@ "description": "Dialog info when product is found with barcode", "type": "text", "placeholders": { - "productName": {} + "productName": { + "type": "String" + } } }, "enterMinCharacters": "Пожалуйста, введите как минимум {min} символов", @@ -562,7 +568,9 @@ "description": "Error message when the user hasn't entered the minimum amount characters in a form", "type": "text", "placeholders": { - "min": {} + "min": { + "type": "String" + } } }, "noMeasurementEntries": "У вас нет записей измерений", @@ -770,7 +778,9 @@ "alsoKnownAs": "Также известно как: {aliases}", "@alsoKnownAs": { "placeholders": { - "aliases": {} + "aliases": { + "type": "String" + } }, "description": "List of alternative names for an exercise" }, @@ -779,7 +789,9 @@ "verifiedEmailInfo": "Письмо с подтверждением отправлено на {email}", "@verifiedEmailInfo": { "placeholders": { - "email": {} + "email": { + "type": "String" + } } }, "alternativeNames": "Альтернативные названия", @@ -809,7 +821,9 @@ "description": "A value in kcal, e.g. 500 kcal", "type": "text", "placeholders": { - "value": {} + "value": { + "type": "String" + } } }, "aboutMastodonText": "Подписывайтесь на нас в Mastodon, чтобы получать обновления и новости о проекте", @@ -857,7 +871,9 @@ "description": "A value in grams, e.g. 5 g", "type": "text", "placeholders": { - "value": {} + "value": { + "type": "String" + } } }, "percentValue": "{value} %", @@ -865,7 +881,9 @@ "description": "A value in percent, e.g. 10 %", "type": "text", "placeholders": { - "value": {} + "value": { + "type": "String" + } } }, "aboutDonateTitle": "Пожертвовать", @@ -937,7 +955,9 @@ "description": "All-time chart of 'name' (e.g. 'weight', 'body fat' etc.)", "type": "text", "placeholders": { - "name": {} + "name": { + "type": "String" + } } }, "chart30DaysTitle": "{name} последние 30 дней", @@ -945,7 +965,9 @@ "description": "last 30 days chart of 'name' (e.g. 'weight', 'body fat' etc.)", "type": "text", "placeholders": { - "name": {} + "name": { + "type": "String" + } } }, "chartDuringPlanTitle": "{chartName} во время плана питания {planName}", @@ -953,10 +975,14 @@ "description": "chart of 'chartName' (e.g. 'weight', 'body fat' etc.) logged during plan", "type": "text", "placeholders": { - "chartName": {}, - "planName": {} + "chartName": { + "type": "String" + }, + "planName": { + "type": "String" + } } }, "settingsIngredientCacheDescription": "Кэш ингредиентов", "@settingsIngredientCacheDescription": {} -} +} \ No newline at end of file diff --git a/lib/l10n/app_ta.arb b/lib/l10n/app_ta.arb index 0220d1eb1..4af2899b7 100644 --- a/lib/l10n/app_ta.arb +++ b/lib/l10n/app_ta.arb @@ -8,7 +8,9 @@ "description": "Header in form indicating the number of the current set. Can also be translated as something like 'Set Nr. xy'.", "type": "text", "placeholders": { - "nr": {} + "nr": { + "type": "String" + } } }, "newSet": "புதிய தொகுப்பு", @@ -221,10 +223,6 @@ }, "searchNamesInEnglish": "ஆங்கிலத்தில் பெயர்களையும் தேடுங்கள்", "@searchNamesInEnglish": {}, - "supersetWith": "உடன் சூப்பர்செட்", - "@supersetWith": { - "description": "Text used between exercise cards when adding a new set. Translate as something like 'in a superset with'" - }, "equipment": "உபகரணங்கள்", "@equipment": { "description": "Equipment needed to perform an exercise" @@ -368,7 +366,9 @@ "description": "All-time chart of 'name' (e.g. 'weight', 'body fat' etc.)", "type": "text", "placeholders": { - "name": {} + "name": { + "type": "String" + } } }, "chart30DaysTitle": "{name} கடைசி 30 நாட்கள்", @@ -376,7 +376,9 @@ "description": "last 30 days chart of 'name' (e.g. 'weight', 'body fat' etc.)", "type": "text", "placeholders": { - "name": {} + "name": { + "type": "String" + } } }, "chartDuringPlanTitle": "{chartName}ஊட்டச்சத்து திட்டத்தின்போது {planName}", @@ -384,8 +386,12 @@ "description": "chart of 'chartName' (e.g. 'weight', 'body fat' etc.) logged during plan", "type": "text", "placeholders": { - "chartName": {}, - "planName": {} + "chartName": { + "type": "String" + }, + "planName": { + "type": "String" + } } }, "measurementCategoriesHelpText": "'பைசெப்ச்' அல்லது 'உடல் கொழுப்பு' போன்ற அளவீட்டு வகை", @@ -455,7 +461,9 @@ "description": "A value in kcal, e.g. 500 kcal", "type": "text", "placeholders": { - "value": {} + "value": { + "type": "String" + } } }, "kJ": "கேசே", @@ -471,7 +479,9 @@ "description": "A value in grams, e.g. 5 g", "type": "text", "placeholders": { - "value": {} + "value": { + "type": "String" + } } }, "percentValue": "{value} %", @@ -479,7 +489,9 @@ "description": "A value in percent, e.g. 10 %", "type": "text", "placeholders": { - "value": {} + "value": { + "type": "String" + } } }, "protein": "புரதம்", @@ -529,7 +541,9 @@ "description": "Confirmation text before the user deletes an object", "type": "text", "placeholders": { - "toDelete": {} + "toDelete": { + "type": "String" + } } }, "newNutritionalPlan": "புதிய ஊட்டச்சத்து திட்டம்", @@ -613,8 +627,12 @@ "description": "Error message when the user hasn't entered the correct number of characters in a form", "type": "text", "placeholders": { - "min": {}, - "max": {} + "min": { + "type": "String" + }, + "max": { + "type": "String" + } } }, "enterMinCharacters": "தயவுசெய்து குறைந்தது {min} எழுத்துக்களை உள்ளிடவும்", @@ -622,7 +640,9 @@ "description": "Error message when the user hasn't entered the minimum amount characters in a form", "type": "text", "placeholders": { - "min": {} + "min": { + "type": "String" + } } }, "baseNameEnglish": "அனைத்து பயிற்சிகளுக்கும் ஆங்கிலத்தில் அடிப்படை பெயர் தேவை", @@ -632,7 +652,9 @@ "description": "Label shown on the slider where the user selects the nr of sets", "type": "text", "placeholders": { - "nrOfSets": {} + "nrOfSets": { + "type": "String" + } } }, "setUnitsAndRir": "அலகுகள் மற்றும் ஆர்.ஐ.ஆர்", @@ -683,7 +705,9 @@ "description": "Dialog info when product is found with barcode", "type": "text", "placeholders": { - "productName": {} + "productName": { + "type": "String" + } } }, "productNotFound": "தயாரிப்பு கிடைக்கவில்லை", @@ -695,7 +719,9 @@ "description": "Dialog info when product is not found with barcode", "type": "text", "placeholders": { - "barcode": {} + "barcode": { + "type": "String" + } } }, "scanBarcode": "ச்கேன் பார்கோடு", @@ -711,7 +737,9 @@ "alsoKnownAs": "என்றும் அழைக்கப்படுகிறது: {aliases}", "@alsoKnownAs": { "placeholders": { - "aliases": {} + "aliases": { + "type": "String" + } }, "description": "List of alternative names for an exercise" }, @@ -724,7 +752,9 @@ "verifiedEmailInfo": "சரிபார்ப்பு மின்னஞ்சல் {email} க்கு அனுப்பப்பட்டது", "@verifiedEmailInfo": { "placeholders": { - "email": {} + "email": { + "type": "String" + } } }, "alternativeNames": "மாற்று பெயர்கள்", @@ -955,4 +985,4 @@ "@indicatorAvg": { "description": "added for localization of Class Indicator's field text" } -} +} \ No newline at end of file diff --git a/lib/l10n/app_tr.arb b/lib/l10n/app_tr.arb index 87ae0b1be..9f32ba8ac 100644 --- a/lib/l10n/app_tr.arb +++ b/lib/l10n/app_tr.arb @@ -141,10 +141,6 @@ "@set": { "description": "A set in a workout plan" }, - "supersetWith": "süper set ile", - "@supersetWith": { - "description": "Text used between exercise cards when adding a new set. Translate as something like 'in a superset with'" - }, "newWorkout": "Yeni antrenman planı", "@newWorkout": { "description": "Header when adding a new workout" @@ -162,7 +158,9 @@ "description": "Header in form indicating the number of the current set. Can also be translated as something like 'Set Nr. xy'.", "type": "text", "placeholders": { - "nr": {} + "nr": { + "type": "String" + } } }, "sameRepetitions": "Eğer tüm setler için aynı ağırlıklarla aynı setleri yapıyorsanız, sadece bir satır doldurabilirsiniz. Örneğin, 4 set için sadece 10 girin, bu otomatik olarak \"4 x 10\"a dönüşüyor.", @@ -392,7 +390,9 @@ "description": "Label shown on the slider where the user selects the nr of sets", "type": "text", "placeholders": { - "nrOfSets": {} + "nrOfSets": { + "type": "String" + } } }, "aboutContactUsTitle": "Merhaba deyin!", @@ -418,7 +418,9 @@ "description": "Dialog info when product is found with barcode", "type": "text", "placeholders": { - "productName": {} + "productName": { + "type": "String" + } } }, "rir": "RiR", @@ -448,7 +450,9 @@ "description": "Confirmation text before the user deletes an object", "type": "text", "placeholders": { - "toDelete": {} + "toDelete": { + "type": "String" + } } }, "toggleDetails": "Ayrıntıları aç/kapat", @@ -471,10 +475,6 @@ "@aboutTranslationText": { "description": "Text for translation section in the about dialog" }, - "enterRepetitionsOrWeight": "Lütfen setlerden en az birinin tekrarlarını veya ağırlığını doldurun", - "@enterRepetitionsOrWeight": { - "description": "Error message when the user hasn't filled in the forms for exercise sets" - }, "selectExercise": "Lütfen bir egzersiz seçin", "@selectExercise": { "description": "Error message when the user hasn't selected an exercise in the form" @@ -484,8 +484,12 @@ "description": "Error message when the user hasn't entered the correct number of characters in a form", "type": "text", "placeholders": { - "min": {}, - "max": {} + "min": { + "type": "String" + }, + "max": { + "type": "String" + } } }, "setUnitsAndRir": "RiR ve birimleri ayarla", @@ -522,7 +526,9 @@ "description": "Dialog info when product is not found with barcode", "type": "text", "placeholders": { - "barcode": {} + "barcode": { + "type": "String" + } } }, "close": "Kapat", @@ -560,7 +566,9 @@ "alsoKnownAs": "{aliases} olarak da bilinir", "@alsoKnownAs": { "placeholders": { - "aliases": {} + "aliases": { + "type": "String" + } }, "description": "List of alternative names for an exercise" }, @@ -577,7 +585,9 @@ "description": "Error message when the user hasn't entered the minimum amount characters in a form", "type": "text", "placeholders": { - "min": {} + "min": { + "type": "String" + } } }, "add_exercise_image_license": "Görseller CC BY SA lisansı ile uyumlu olmalıdır. Emin değilseniz, yalnızca kendi çektiğiniz fotoğrafları yükleyin.", @@ -593,7 +603,9 @@ "verifiedEmailInfo": "{email} adresine bir doğrulama e-postası gönderildi", "@verifiedEmailInfo": { "placeholders": { - "email": {} + "email": { + "type": "String" + } } }, "previous": "Önceki", @@ -789,7 +801,9 @@ "description": "A value in grams, e.g. 5 g", "type": "text", "placeholders": { - "value": {} + "value": { + "type": "String" + } } }, "addGoalsToPlan": "Bu plana hedefler ekle", @@ -811,7 +825,9 @@ "description": "A value in kcal, e.g. 500 kcal", "type": "text", "placeholders": { - "value": {} + "value": { + "type": "String" + } } }, "goalCarbohydrates": "Karbonhidrat hedefi", @@ -825,7 +841,9 @@ "description": "A value in percent, e.g. 10 %", "type": "text", "placeholders": { - "value": {} + "value": { + "type": "String" + } } }, "goalMacro": "Makro hedefleri", @@ -855,7 +873,9 @@ "description": "All-time chart of 'name' (e.g. 'weight', 'body fat' etc.)", "type": "text", "placeholders": { - "name": {} + "name": { + "type": "String" + } } }, "chart30DaysTitle": "son 30 gün {name}", @@ -863,7 +883,9 @@ "description": "last 30 days chart of 'name' (e.g. 'weight', 'body fat' etc.)", "type": "text", "placeholders": { - "name": {} + "name": { + "type": "String" + } } }, "chartDuringPlanTitle": "{planName} beslenme planı boyunca {chartName}", @@ -871,8 +893,12 @@ "description": "chart of 'chartName' (e.g. 'weight', 'body fat' etc.) logged during plan", "type": "text", "placeholders": { - "chartName": {}, - "planName": {} + "chartName": { + "type": "String" + }, + "planName": { + "type": "String" + } } } -} +} \ No newline at end of file diff --git a/lib/l10n/app_uk.arb b/lib/l10n/app_uk.arb index 8886c19c4..f5fa4904a 100644 --- a/lib/l10n/app_uk.arb +++ b/lib/l10n/app_uk.arb @@ -99,10 +99,6 @@ "@searchExercise": { "description": "Label on set form. Selected exercises are added to the set" }, - "supersetWith": "супер-набір з", - "@supersetWith": { - "description": "Text used between exercise cards when adding a new set. Translate as something like 'in a superset with'" - }, "equipment": "Обладнання", "@equipment": { "description": "Equipment needed to perform an exercise" @@ -146,7 +142,9 @@ "description": "Header in form indicating the number of the current set. Can also be translated as something like 'Set Nr. xy'.", "type": "text", "placeholders": { - "nr": {} + "nr": { + "type": "String" + } } }, "sameRepetitions": "Якщо ви робите однакові повторення та вагу для всіх наборів, то ви можете просто заповнити один рядок. Наприклад, для 4 наборів просто введіть 10 для повторень, це автоматично стане «4 x 10».", @@ -284,7 +282,9 @@ "description": "Dialog info when product is found with barcode", "type": "text", "placeholders": { - "productName": {} + "productName": { + "type": "String" + } } }, "description": "Опис", @@ -430,7 +430,9 @@ "description": "Confirmation text before the user deletes an object", "type": "text", "placeholders": { - "toDelete": {} + "toDelete": { + "type": "String" + } } }, "toggleDetails": "Перемкнути відомості", @@ -471,17 +473,17 @@ "@goToToday": { "description": "Label on button to jump back to 'today' in the calendar widget" }, - "enterRepetitionsOrWeight": "Будь ласка, заповніть кількість повторень або вагу принаймні для одного з наборів", - "@enterRepetitionsOrWeight": { - "description": "Error message when the user hasn't filled in the forms for exercise sets" - }, "enterCharacters": "Будь ласка, введіть між{min} та {max} символами", "@enterCharacters": { "description": "Error message when the user hasn't entered the correct number of characters in a form", "type": "text", "placeholders": { - "min": {}, - "max": {} + "min": { + "type": "String" + }, + "max": { + "type": "String" + } } }, "nrOfSets": "Наборів на вправу: {nrOfSets}", @@ -489,7 +491,9 @@ "description": "Label shown on the slider where the user selects the nr of sets", "type": "text", "placeholders": { - "nrOfSets": {} + "nrOfSets": { + "type": "String" + } } }, "setUnitsAndRir": "Встановіть одиниці вимірювання та RiR", @@ -542,7 +546,9 @@ "description": "Dialog info when product is not found with barcode", "type": "text", "placeholders": { - "barcode": {} + "barcode": { + "type": "String" + } } }, "scanBarcode": "Сканувати штрих-код", @@ -570,7 +576,9 @@ "verifiedEmailInfo": "Повідомлення з підтвердженням електронної пошти надіслано на {email}", "@verifiedEmailInfo": { "placeholders": { - "email": {} + "email": { + "type": "String" + } } }, "addExercise": "Додати вправу", @@ -658,7 +666,9 @@ "description": "Error message when the user hasn't entered the minimum amount characters in a form", "type": "text", "placeholders": { - "min": {} + "min": { + "type": "String" + } } }, "baseNameEnglish": "Всі вправи потребують базової назви англійською", @@ -670,7 +680,9 @@ "alsoKnownAs": "Також відомий як: {aliases}", "@alsoKnownAs": { "placeholders": { - "aliases": {} + "aliases": { + "type": "String" + } }, "description": "List of alternative names for an exercise" }, @@ -779,7 +791,9 @@ "description": "A value in grams, e.g. 5 g", "type": "text", "placeholders": { - "value": {} + "value": { + "type": "String" + } } }, "percentValue": "{value} %", @@ -787,7 +801,9 @@ "description": "A value in percent, e.g. 10 %", "type": "text", "placeholders": { - "value": {} + "value": { + "type": "String" + } } }, "settingsExerciseCacheDescription": "Кеш вправ", @@ -797,7 +813,9 @@ "description": "All-time chart of 'name' (e.g. 'weight', 'body fat' etc.)", "type": "text", "placeholders": { - "name": {} + "name": { + "type": "String" + } } }, "chart30DaysTitle": "{name} останні 30 днів", @@ -805,7 +823,9 @@ "description": "last 30 days chart of 'name' (e.g. 'weight', 'body fat' etc.)", "type": "text", "placeholders": { - "name": {} + "name": { + "type": "String" + } } }, "chartDuringPlanTitle": "{chartName} під час плану харчування {planName}", @@ -813,8 +833,12 @@ "description": "chart of 'chartName' (e.g. 'weight', 'body fat' etc.) logged during plan", "type": "text", "placeholders": { - "chartName": {}, - "planName": {} + "chartName": { + "type": "String" + }, + "planName": { + "type": "String" + } } }, "kcalValue": "{value} ккал", @@ -822,7 +846,9 @@ "description": "A value in kcal, e.g. 500 kcal", "type": "text", "placeholders": { - "value": {} + "value": { + "type": "String" + } } }, "log": "Журнал", @@ -903,4 +929,4 @@ "@lightMode": {}, "systemMode": "Налаштування системи", "@systemMode": {} -} +} \ No newline at end of file diff --git a/lib/l10n/app_zh.arb b/lib/l10n/app_zh.arb index 5cd4f5591..ea839075a 100644 --- a/lib/l10n/app_zh.arb +++ b/lib/l10n/app_zh.arb @@ -194,8 +194,12 @@ "description": "Error message when the user hasn't entered the correct number of characters in a form", "type": "text", "placeholders": { - "min": {}, - "max": {} + "min": { + "type": "String" + }, + "max": { + "type": "String" + } } }, "selectExercise": "请选择一个锻炼项目", @@ -245,7 +249,9 @@ "description": "Confirmation text before the user deletes an object", "type": "text", "placeholders": { - "toDelete": {} + "toDelete": { + "type": "String" + } } }, "delete": "删除", @@ -370,13 +376,11 @@ "description": "Label shown on the slider where the user selects the nr of sets", "type": "text", "placeholders": { - "nrOfSets": {} + "nrOfSets": { + "type": "String" + } } }, - "enterRepetitionsOrWeight": "请至少填写其中一项的重复次数或重量", - "@enterRepetitionsOrWeight": { - "description": "Error message when the user hasn't filled in the forms for exercise sets" - }, "timeStartAhead": "开始时间不能早于结束时间", "@timeStartAhead": {}, "addIngredient": "添加营养成分", @@ -412,7 +416,9 @@ "description": "Header in form indicating the number of the current set. Can also be translated as something like 'Set Nr. xy'.", "type": "text", "placeholders": { - "nr": {} + "nr": { + "type": "String" + } } }, "muscles": "主要部位", @@ -435,10 +441,6 @@ "@newSet": { "description": "Header when adding a new set to a workout day" }, - "supersetWith": "组合", - "@supersetWith": { - "description": "Text used between exercise cards when adding a new set. Translate as something like 'in a superset with'" - }, "aboutContactUsText": "聊一聊", "@aboutContactUsText": { "description": "Text for contact us section in the about dialog" @@ -460,7 +462,9 @@ "description": "Dialog info when product is not found with barcode", "type": "text", "placeholders": { - "barcode": {} + "barcode": { + "type": "String" + } } }, "weekAverage": "7天平均", @@ -472,7 +476,9 @@ "description": "Dialog info when product is found with barcode", "type": "text", "placeholders": { - "productName": {} + "productName": { + "type": "String" + } } }, "measurement": "测量", @@ -650,7 +656,9 @@ "description": "A value in kcal, e.g. 500 kcal", "type": "text", "placeholders": { - "value": {} + "value": { + "type": "String" + } } }, "gValue": "{value} g", @@ -658,7 +666,9 @@ "description": "A value in grams, e.g. 5 g", "type": "text", "placeholders": { - "value": {} + "value": { + "type": "String" + } } }, "percentValue": "{value} %", @@ -666,7 +676,9 @@ "description": "A value in percent, e.g. 10 %", "type": "text", "placeholders": { - "value": {} + "value": { + "type": "String" + } } }, "noMeasurementEntries": "您没有测量条目", @@ -686,7 +698,9 @@ "description": "All-time chart of 'name' (e.g. 'weight', 'body fat' etc.)", "type": "text", "placeholders": { - "name": {} + "name": { + "type": "String" + } } }, "chartDuringPlanTitle": "{chartName} 在计划 \"{planName}\" 期间的改变曲线", @@ -694,8 +708,12 @@ "description": "chart of 'chartName' (e.g. 'weight', 'body fat' etc.) logged during plan", "type": "text", "placeholders": { - "chartName": {}, - "planName": {} + "chartName": { + "type": "String" + }, + "planName": { + "type": "String" + } } }, "indicatorRaw": "原始值", @@ -715,7 +733,9 @@ "description": "Error message when the user hasn't entered the minimum amount characters in a form", "type": "text", "placeholders": { - "min": {} + "min": { + "type": "String" + } } }, "baseNameEnglish": "所有运动需要一个英文代号", @@ -775,7 +795,9 @@ "description": "last 30 days chart of 'name' (e.g. 'weight', 'body fat' etc.)", "type": "text", "placeholders": { - "name": {} + "name": { + "type": "String" + } } }, "oneNamePerLine": "每行一个名字", @@ -857,7 +879,9 @@ "verifiedEmailInfo": "验证邮件已经发往{email}", "@verifiedEmailInfo": { "placeholders": { - "email": {} + "email": { + "type": "String" + } } }, "whatVariationsExist": "这个动作有什么变体吗?", @@ -921,7 +945,9 @@ "alsoKnownAs": "又名:{aliases}", "@alsoKnownAs": { "placeholders": { - "aliases": {} + "aliases": { + "type": "String" + } }, "description": "List of alternative names for an exercise" }, @@ -949,4 +975,4 @@ "@aboutMastodonTitle": { "description": "Title for mastodon section in the about dialog" } -} +} \ No newline at end of file diff --git a/lib/l10n/app_zh_Hant.arb b/lib/l10n/app_zh_Hant.arb index a65af28f8..41c9b8c56 100644 --- a/lib/l10n/app_zh_Hant.arb +++ b/lib/l10n/app_zh_Hant.arb @@ -249,8 +249,6 @@ "@fatShort": { "description": "The first letter or short name of the word 'Fat', used in overviews" }, - "fibres": "纖維", - "@fibres": {}, "sodium": "鈉", "@sodium": {}, "edit": "編輯", @@ -264,7 +262,9 @@ "description": "Confirmation text before the user deletes an object", "type": "text", "placeholders": { - "toDelete": {} + "toDelete": { + "type": "String" + } } }, "aboutBugsTitle": "有問題或想法嗎?", @@ -410,7 +410,9 @@ "description": "Header in form indicating the number of the current set. Can also be translated as something like 'Set Nr. xy'.", "type": "text", "placeholders": { - "nr": {} + "nr": { + "type": "String" + } } }, "notes": "筆記", @@ -568,7 +570,9 @@ "description": "Dialog info when product is not found with barcode", "type": "text", "placeholders": { - "barcode": {} + "barcode": { + "type": "String" + } } }, "images": "圖片", @@ -662,7 +666,9 @@ "verifiedEmailInfo": "驗證郵件已寄送至 {email}", "@verifiedEmailInfo": { "placeholders": { - "email": {} + "email": { + "type": "String" + } } }, "gym_mat": "健身墊", @@ -682,7 +688,9 @@ "description": "A value in grams, e.g. 5 g", "type": "text", "placeholders": { - "value": {} + "value": { + "type": "String" + } } }, "percentValue": "{value} %", @@ -690,7 +698,9 @@ "description": "A value in percent, e.g. 10 %", "type": "text", "placeholders": { - "value": {} + "value": { + "type": "String" + } } }, "noWorkoutPlans": "您沒有健身計劃", @@ -712,13 +722,17 @@ "description": "Label shown on the slider where the user selects the nr of sets", "type": "text", "placeholders": { - "nrOfSets": {} + "nrOfSets": { + "type": "String" + } } }, "alsoKnownAs": "也稱為:{aliases}", "@alsoKnownAs": { "placeholders": { - "aliases": {} + "aliases": { + "type": "String" + } }, "description": "List of alternative names for an exercise" }, @@ -757,7 +771,9 @@ "description": "Dialog info when product is found with barcode", "type": "text", "placeholders": { - "productName": {} + "productName": { + "type": "String" + } } }, "appUpdateContent": "此版本的應用程式與伺服器不相容,請更新您的應用程式。", @@ -771,8 +787,12 @@ "description": "Error message when the user hasn't entered the correct number of characters in a form", "type": "text", "placeholders": { - "min": {}, - "max": {} + "min": { + "type": "String" + }, + "max": { + "type": "String" + } } }, "g": "克", @@ -796,7 +816,9 @@ "description": "A value in kcal, e.g. 500 kcal", "type": "text", "placeholders": { - "value": {} + "value": { + "type": "String" + } } }, "noWeightEntries": "您沒有體重紀錄", @@ -810,7 +832,9 @@ "description": "Error message when the user hasn't entered the minimum amount characters in a form", "type": "text", "placeholders": { - "min": {} + "min": { + "type": "String" + } } }, "baseNameEnglish": "所有動作都需要一個英文基本名稱", @@ -943,7 +967,9 @@ "description": "All-time chart of 'name' (e.g. 'weight', 'body fat' etc.)", "type": "text", "placeholders": { - "name": {} + "name": { + "type": "String" + } } }, "chart30DaysTitle": "{name} 最近 30 天", @@ -951,7 +977,9 @@ "description": "last 30 days chart of 'name' (e.g. 'weight', 'body fat' etc.)", "type": "text", "placeholders": { - "name": {} + "name": { + "type": "String" + } } }, "chartDuringPlanTitle": "營養計劃 {planName} 期間的 {chartName}", @@ -959,8 +987,12 @@ "description": "chart of 'chartName' (e.g. 'weight', 'body fat' etc.) logged during plan", "type": "text", "placeholders": { - "chartName": {}, - "planName": {} + "chartName": { + "type": "String" + }, + "planName": { + "type": "String" + } } }, "noIngredientsDefined": "尚未定義食材", @@ -969,4 +1001,4 @@ "@ingredientLogged": {}, "selectMealToLog": "選擇要紀錄到日記的餐點", "@selectMealToLog": {} -} +} \ No newline at end of file diff --git a/lib/main.dart b/lib/main.dart index d3e33a6d1..9f0aa5c46 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -18,10 +18,11 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; -import 'package:flutter_gen/gen_l10n/app_localizations.dart'; +import 'package:flutter_riverpod/flutter_riverpod.dart' as riverpod; import 'package:logging/logging.dart'; import 'package:provider/provider.dart'; import 'package:wger/core/locator.dart'; +import 'package:wger/l10n/generated/app_localizations.dart'; import 'package:wger/providers/add_exercise.dart'; import 'package:wger/providers/base_provider.dart'; import 'package:wger/providers/body_weight.dart'; @@ -29,8 +30,8 @@ import 'package:wger/providers/exercises.dart'; import 'package:wger/providers/gallery.dart'; import 'package:wger/providers/measurement.dart'; import 'package:wger/providers/nutrition.dart'; +import 'package:wger/providers/routines.dart'; import 'package:wger/providers/user.dart'; -import 'package:wger/providers/workout_plans.dart'; import 'package:wger/screens/add_exercise_screen.dart'; import 'package:wger/screens/auth_screen.dart'; import 'package:wger/screens/dashboard.dart'; @@ -47,10 +48,12 @@ import 'package:wger/screens/measurement_entries_screen.dart'; import 'package:wger/screens/nutritional_diary_screen.dart'; import 'package:wger/screens/nutritional_plan_screen.dart'; import 'package:wger/screens/nutritional_plans_screen.dart'; +import 'package:wger/screens/routine_edit_screen.dart'; +import 'package:wger/screens/routine_list_screen.dart'; +import 'package:wger/screens/routine_logs_screen.dart'; +import 'package:wger/screens/routine_screen.dart'; import 'package:wger/screens/splash_screen.dart'; import 'package:wger/screens/weight_screen.dart'; -import 'package:wger/screens/workout_plan_screen.dart'; -import 'package:wger/screens/workout_plans_screen.dart'; import 'package:wger/theme/theme.dart'; import 'package:wger/widgets/core/about.dart'; import 'package:wger/widgets/core/settings.dart'; @@ -75,7 +78,7 @@ void main() async { await ServiceLocator().configure(); // Application - runApp(const MyApp()); + runApp(const riverpod.ProviderScope(child: MyApp())); } class MyApp extends StatelessWidget { @@ -93,14 +96,14 @@ class MyApp extends StatelessWidget { update: (context, base, previous) => previous ?? ExercisesProvider(WgerBaseProvider(base)), ), - ChangeNotifierProxyProvider2( - create: (context) => WorkoutPlansProvider( + ChangeNotifierProxyProvider2( + create: (context) => RoutinesProvider( WgerBaseProvider(Provider.of(context, listen: false)), Provider.of(context, listen: false), [], ), update: (context, auth, exercises, previous) => - previous ?? WorkoutPlansProvider(WgerBaseProvider(auth), exercises, []), + previous ?? RoutinesProvider(WgerBaseProvider(auth), exercises, []), ), ChangeNotifierProxyProvider( create: (context) => NutritionPlansProvider( @@ -177,8 +180,10 @@ class MyApp extends StatelessWidget { LogMealsScreen.routeName: (ctx) => const LogMealsScreen(), LogMealScreen.routeName: (ctx) => const LogMealScreen(), WeightScreen.routeName: (ctx) => const WeightScreen(), - WorkoutPlanScreen.routeName: (ctx) => const WorkoutPlanScreen(), - WorkoutPlansScreen.routeName: (ctx) => const WorkoutPlansScreen(), + RoutineScreen.routeName: (ctx) => const RoutineScreen(), + RoutineEditScreen.routeName: (ctx) => const RoutineEditScreen(), + WorkoutLogsScreen.routeName: (ctx) => const WorkoutLogsScreen(), + RoutineListScreen.routeName: (ctx) => const RoutineListScreen(), ExercisesScreen.routeName: (ctx) => const ExercisesScreen(), ExerciseDetailScreen.routeName: (ctx) => const ExerciseDetailScreen(), AddExerciseScreen.routeName: (ctx) => const AddExerciseScreen(), diff --git a/lib/models/body_weight/weight_entry.dart b/lib/models/body_weight/weight_entry.dart index 47c8be9fa..7b41c6254 100644 --- a/lib/models/body_weight/weight_entry.dart +++ b/lib/models/body_weight/weight_entry.dart @@ -29,7 +29,7 @@ class WeightEntry { @JsonKey(required: true, fromJson: stringToNum, toJson: numToString) late num weight = 0; - @JsonKey(required: true, toJson: toDate) + @JsonKey(required: true, toJson: dateToYYYYMMDD) late DateTime date; WeightEntry({this.id, weight, DateTime? date}) { diff --git a/lib/models/body_weight/weight_entry.g.dart b/lib/models/body_weight/weight_entry.g.dart index 4120aaac0..c1c690d5e 100644 --- a/lib/models/body_weight/weight_entry.g.dart +++ b/lib/models/body_weight/weight_entry.g.dart @@ -21,5 +21,5 @@ WeightEntry _$WeightEntryFromJson(Map json) { Map _$WeightEntryToJson(WeightEntry instance) => { 'id': instance.id, 'weight': numToString(instance.weight), - 'date': toDate(instance.date), + 'date': dateToYYYYMMDD(instance.date), }; diff --git a/lib/models/exercises/alias.dart b/lib/models/exercises/alias.dart index 33715e648..a5ca1fc42 100644 --- a/lib/models/exercises/alias.dart +++ b/lib/models/exercises/alias.dart @@ -25,15 +25,16 @@ class Alias { @JsonKey(required: true) final int? id; - @JsonKey(name: 'exercise') - final int? exerciseId; + @JsonKey(name: 'translation') + final int? translationId; @JsonKey(required: true) final String alias; - const Alias({this.id, required this.exerciseId, required this.alias}); + const Alias({this.id, required this.translationId, required this.alias}); // Boilerplate factory Alias.fromJson(Map json) => _$AliasFromJson(json); + Map toJson() => _$AliasToJson(this); } diff --git a/lib/models/exercises/alias.g.dart b/lib/models/exercises/alias.g.dart index baafce483..708ee7ab5 100644 --- a/lib/models/exercises/alias.g.dart +++ b/lib/models/exercises/alias.g.dart @@ -13,13 +13,13 @@ Alias _$AliasFromJson(Map json) { ); return Alias( id: (json['id'] as num?)?.toInt(), - exerciseId: (json['exercise'] as num?)?.toInt(), + translationId: (json['translation'] as num?)?.toInt(), alias: json['alias'] as String, ); } Map _$AliasToJson(Alias instance) => { 'id': instance.id, - 'exercise': instance.exerciseId, + 'translation': instance.translationId, 'alias': instance.alias, }; diff --git a/lib/models/exercises/comment.dart b/lib/models/exercises/comment.dart index 5fb5fc58c..5ebd542c3 100644 --- a/lib/models/exercises/comment.dart +++ b/lib/models/exercises/comment.dart @@ -25,19 +25,20 @@ class Comment { @JsonKey(required: true) final int id; - @JsonKey(name: 'exercise') - final int exerciseId; + @JsonKey(name: 'translation') + final int translationId; @JsonKey(required: true) final String comment; const Comment({ required this.id, - required this.exerciseId, + required this.translationId, required this.comment, }); // Boilerplate factory Comment.fromJson(Map json) => _$CommentFromJson(json); + Map toJson() => _$CommentToJson(this); } diff --git a/lib/models/exercises/comment.g.dart b/lib/models/exercises/comment.g.dart index 77d23876f..f5e502c2b 100644 --- a/lib/models/exercises/comment.g.dart +++ b/lib/models/exercises/comment.g.dart @@ -13,13 +13,13 @@ Comment _$CommentFromJson(Map json) { ); return Comment( id: (json['id'] as num).toInt(), - exerciseId: (json['exercise'] as num).toInt(), + translationId: (json['translation'] as num).toInt(), comment: json['comment'] as String, ); } Map _$CommentToJson(Comment instance) => { 'id': instance.id, - 'exercise': instance.exerciseId, + 'translation': instance.translationId, 'comment': instance.comment, }; diff --git a/lib/models/exercises/exercise.dart b/lib/models/exercises/exercise.dart index 4f1d95c4a..74e269f20 100644 --- a/lib/models/exercises/exercise.dart +++ b/lib/models/exercises/exercise.dart @@ -15,9 +15,9 @@ * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ - import 'dart:developer'; +import 'package:collection/collection.dart'; import 'package:equatable/equatable.dart'; import 'package:json_annotation/json_annotation.dart'; import 'package:wger/helpers/consts.dart'; @@ -147,21 +147,21 @@ class Exercise extends Equatable { Exercise.fromApiDataJson(Map baseData, List languages) : this.fromApiData(ExerciseApiData.fromJson(baseData), languages); - Exercise.fromApiData(ExerciseApiData baseData, List languages) { - id = baseData.id; - uuid = baseData.uuid; - categoryId = baseData.category.id; - category = baseData.category; + Exercise.fromApiData(ExerciseApiData exerciseData, List languages) { + id = exerciseData.id; + uuid = exerciseData.uuid; + categoryId = exerciseData.category.id; + category = exerciseData.category; - created = baseData.created; - lastUpdate = baseData.lastUpdate; - lastUpdateGlobal = baseData.lastUpdateGlobal; + created = exerciseData.created; + lastUpdate = exerciseData.lastUpdate; + lastUpdateGlobal = exerciseData.lastUpdateGlobal; - musclesSecondary = baseData.muscles; - muscles = baseData.muscles; - equipment = baseData.equipment; - category = baseData.category; - translations = baseData.translations.map((e) { + musclesSecondary = exerciseData.muscles; + muscles = exerciseData.muscles; + equipment = exerciseData.equipment; + category = exerciseData.category; + translations = exerciseData.translations.map((e) { e.language = languages.firstWhere( (l) => l.id == e.languageId, @@ -173,16 +173,16 @@ class Exercise extends Equatable { ); return e; }).toList(); - videos = baseData.videos; - images = baseData.images; + videos = exerciseData.videos; + images = exerciseData.images; - authors = baseData.authors; - authorsGlobal = baseData.authorsGlobal; + authors = exerciseData.authors; + authorsGlobal = exerciseData.authorsGlobal; - variationId = baseData.variationId; + variationId = exerciseData.variationId; } - /// Returns exercises for the given language + /// Returns translation for the given language /// /// If no translation is found, English will be returned /// @@ -190,7 +190,7 @@ class Exercise extends Equatable { /// translation in English. This is something that should never happen, /// but we can't make sure that no local installation hasn't deleted /// the entry in English. - Translation getExercise(String language) { + Translation getTranslation(String language) { // If the language is in the form en-US, take the language code only final languageCode = language.split('-')[0]; @@ -204,11 +204,7 @@ class Exercise extends Equatable { } ExerciseImage? get getMainImage { - try { - return images.firstWhere((image) => image.isMain); - } on StateError { - return null; - } + return images.firstWhereOrNull((image) => image.isMain); } set setCategory(ExerciseCategory category) { diff --git a/lib/models/exercises/exercise_api.dart b/lib/models/exercises/exercise_api.dart index fb9c36e08..7cf6c687b 100644 --- a/lib/models/exercises/exercise_api.dart +++ b/lib/models/exercises/exercise_api.dart @@ -11,7 +11,7 @@ import 'package:wger/models/exercises/video.dart'; part 'exercise_api.freezed.dart'; part 'exercise_api.g.dart'; -/// Model for an exercise as returned from the exercisebaseinfo endpoint +/// Model for an exercise as returned from the exerciseinfo endpoint /// /// Basically this is just used as a convenience to create "real" exercise /// objects and nothing more @@ -35,7 +35,7 @@ class ExerciseApiData with _$ExerciseApiData { // ignore: invalid_annotation_target required List equipment, // ignore: invalid_annotation_target - @JsonKey(name: 'exercises') required List translations, + @JsonKey(name: 'translations', defaultValue: []) required List translations, required List images, required List

Two Handed Russian Style Kettlebell swing

\n

\n

Pizza (Italian: [ˈpittsa], Neapolitan: [ˈpittsə]) is a dish of Italian origin consisting of a usually round, flat base of leavened wheat-based dough topped with tomatoes, cheese, and often various other ingredients (such as anchovies, mushrooms, onions, olives, pineapple, meat, etc.), which is then baked at a high temperature, traditionally in a wood-fired oven.[1] A small pizza is sometimes called a pizzetta. A person who makes pizza is known as a pizzaiolo.

", "notes": [ { "id": 134, - "exercise": 345, + "translation": 345, "comment": "it's important to do the exercise correctly" }, { "id": 135, - "exercise": 345, + "translation": 345, "comment": "put a lot of effort into this exercise" }, { "id": 136, - "exercise": 345, + "translation": 345, "comment": "have fun" } ], @@ -178,17 +178,17 @@ } ], "name": "Kettlebell Con Dos Manos", - "exercise_base": 9, + "exercise": 9, "description": "

Cualquier descripción aquí...

\n

La pizza es una preparación culinaria que consiste en un pan plano, habitualmente de forma circular, elaborado con harina de trigo, levadura, agua y sal (a veces aceite de oliva) que tradicionalmente se cubre con salsa de tomate y mozzarella y se hornea a alta temperatura en un horno de leña.2​3​4​ El lugar donde se venden pizzas se denomina «pizzería» y al obrador, «pizzero» (pizzaiolo en italiano). Aunque se considera que su origen está en la gastronomía italiana,3​ particularmente la napolitana,2​ su consumo está extendido a casi todos los países del mundo con diversas variantes locales, que incorporan distintos ingredientes para cubrir la masa.1​ Junto con la hamburguesa, la pizza está considerada la comida más difundida del mundo,5​6​ como consecuencia de la diáspora italiana que se estableció en América a lo largo del siglo xx principalmente en Nueva York,3​ Buenos Aires o Chicago.7​8​

", "notes": [ { "id": 137, - "exercise": 856, + "translation": 856, "comment": "haz el ejercicio correctamente" }, { "id": 138, - "exercise": 856, + "translation": 856, "comment": "pasatelo bien!" } ], @@ -209,12 +209,12 @@ "uuid": "2fe5f04b-5c9d-448c-a973-3fad6ddd4f74", "aliases": [], "name": "Zweihändiges Kettlebell", - "exercise_base": 9, + "exercise": 9, "description": "

Irgendeine Beschreibung hier...

\n

Eine Pizza (Aussprache [ˈpɪtsa], ital. [ˈpitːsa], deutscher Plural: die Pizzas oder die Pizzen[1]) ist ein vor dem Backen würzig belegtes Fladenbrot aus einfachem Hefeteig aus der italienischen Küche. Die heutige international verbreitete Variante mit Tomatensauce und Käse als Basis stammt vermutlich aus Neapel. 2017 wurde die neapolitanische Kunst des Pizzabäckers (Art of Neapolitan ‘Pizzaiuolo’) von der UNESCO in die repräsentative Liste des immateriellen Kulturerbes der Menschheit aufgenommen.[2]

", "notes": [ { "id": 139, - "exercise": 855, + "translation": 855, "comment": "mach die Übung richtig" } ], diff --git a/test/fixtures/routines/routine_date_sequence_display.json b/test/fixtures/routines/routine_date_sequence_display.json new file mode 100644 index 000000000..faf59fa8c --- /dev/null +++ b/test/fixtures/routines/routine_date_sequence_display.json @@ -0,0 +1,696 @@ +[ + { + "iteration": 1, + "date": "2025-01-05", + "label": null, + "day": { + "id": 8, + "routine": 2, + "order": 1, + "name": "Leg day", + "description": "Leg day", + "is_rest": false, + "need_logs_to_advance": false, + "type": "custom", + "config": null + }, + "slots": [ + { + "comment": "", + "is_superset": false, + "exercises": [ + 76 + ], + "sets": [ + { + "slot_entry_id": 2, + "exercise": 76, + "sets": 4, + "max_sets": null, + "weight": "80.00", + "max_weight": null, + "weight_unit": 1, + "weight_rounding": null, + "repetitions": "10.00", + "max_repetitions": null, + "repetitions_unit": 1, + "repetitions_rounding": null, + "rir": null, + "max_rir": null, + "rpe": null, + "rest": "120.00", + "max_rest": null, + "type": "normal", + "text_repr": "4 Sätze, 10 × 80 kg 120s rest", + "comment": "" + } + ] + } + ] + }, + { + "iteration": 1, + "date": "2025-01-06", + "label": null, + "day": { + "id": 9, + "routine": 2, + "order": 2, + "name": "", + "description": "", + "is_rest": true, + "need_logs_to_advance": false, + "type": "custom", + "config": null + }, + "slots": [] + }, + { + "iteration": 1, + "date": "2025-01-07", + "label": null, + "day": { + "id": 10, + "routine": 2, + "order": 3, + "name": "Arms day", + "description": "Leg day", + "is_rest": false, + "need_logs_to_advance": false, + "type": "custom", + "config": null + }, + "slots": [ + { + "comment": "", + "is_superset": false, + "exercises": [ + 92 + ], + "sets": [ + { + "slot_entry_id": 3, + "exercise": 92, + "sets": 4, + "max_sets": null, + "weight": "20.00", + "max_weight": "22.00", + "weight_unit": 1, + "weight_rounding": null, + "repetitions": "10.00", + "max_repetitions": null, + "repetitions_unit": 1, + "repetitions_rounding": null, + "rir": null, + "max_rir": null, + "rpe": null, + "rest": "120.00", + "max_rest": null, + "type": "normal", + "text_repr": "4 Sätze, 10 × 20-22 kg 120s rest", + "comment": "" + } + ] + } + ] + }, + { + "iteration": 1, + "date": "2025-01-08", + "label": null, + "day": null, + "slots": [] + }, + { + "iteration": 1, + "date": "2025-01-09", + "label": null, + "day": null, + "slots": [] + }, + { + "iteration": 1, + "date": "2025-01-10", + "label": null, + "day": null, + "slots": [] + }, + { + "iteration": 1, + "date": "2025-01-11", + "label": null, + "day": null, + "slots": [] + }, + { + "iteration": 1, + "date": "2025-01-12", + "label": null, + "day": null, + "slots": [] + }, + { + "iteration": 2, + "date": "2025-01-13", + "label": null, + "day": { + "id": 8, + "routine": 2, + "order": 1, + "name": "Leg day", + "description": "Leg day", + "is_rest": false, + "need_logs_to_advance": false, + "type": "custom", + "config": null + }, + "slots": [ + { + "comment": "", + "is_superset": false, + "exercises": [ + 76 + ], + "sets": [ + { + "slot_entry_id": 2, + "exercise": 76, + "sets": 4, + "max_sets": null, + "weight": "80.00", + "max_weight": null, + "weight_unit": 1, + "weight_rounding": null, + "repetitions": "10.00", + "max_repetitions": null, + "repetitions_unit": 1, + "repetitions_rounding": null, + "rir": null, + "max_rir": null, + "rpe": null, + "rest": "120.00", + "max_rest": null, + "type": "normal", + "text_repr": "4 Sätze, 10 × 80 kg 120s rest", + "comment": "" + } + ] + } + ] + }, + { + "iteration": 2, + "date": "2025-01-14", + "label": null, + "day": { + "id": 9, + "routine": 2, + "order": 2, + "name": "", + "description": "", + "is_rest": true, + "need_logs_to_advance": false, + "type": "custom", + "config": null + }, + "slots": [] + }, + { + "iteration": 2, + "date": "2025-01-15", + "label": null, + "day": { + "id": 10, + "routine": 2, + "order": 3, + "name": "Arms day", + "description": "Leg day", + "is_rest": false, + "need_logs_to_advance": false, + "type": "custom", + "config": null + }, + "slots": [ + { + "comment": "", + "is_superset": false, + "exercises": [ + 92 + ], + "sets": [ + { + "slot_entry_id": 3, + "exercise": 92, + "sets": 4, + "max_sets": null, + "weight": "21.00", + "max_weight": "22.00", + "weight_unit": 1, + "weight_rounding": null, + "repetitions": "10.00", + "max_repetitions": null, + "repetitions_unit": 1, + "repetitions_rounding": null, + "rir": null, + "max_rir": null, + "rpe": null, + "rest": "120.00", + "max_rest": null, + "type": "normal", + "text_repr": "4 Sätze, 10 × 21-22 kg 120s rest", + "comment": "" + } + ] + } + ] + }, + { + "iteration": 2, + "date": "2025-01-16", + "label": null, + "day": null, + "slots": [] + }, + { + "iteration": 2, + "date": "2025-01-17", + "label": null, + "day": null, + "slots": [] + }, + { + "iteration": 2, + "date": "2025-01-18", + "label": null, + "day": null, + "slots": [] + }, + { + "iteration": 2, + "date": "2025-01-19", + "label": null, + "day": null, + "slots": [] + }, + { + "iteration": 3, + "date": "2025-01-20", + "label": null, + "day": { + "id": 8, + "routine": 2, + "order": 1, + "name": "Leg day", + "description": "Leg day", + "is_rest": false, + "need_logs_to_advance": false, + "type": "custom", + "config": null + }, + "slots": [ + { + "comment": "", + "is_superset": false, + "exercises": [ + 76 + ], + "sets": [ + { + "slot_entry_id": 2, + "exercise": 76, + "sets": 4, + "max_sets": null, + "weight": "80.00", + "max_weight": null, + "weight_unit": 1, + "weight_rounding": null, + "repetitions": "10.00", + "max_repetitions": null, + "repetitions_unit": 1, + "repetitions_rounding": null, + "rir": null, + "max_rir": null, + "rpe": null, + "rest": "120.00", + "max_rest": null, + "type": "normal", + "text_repr": "4 Sätze, 10 × 80 kg 120s rest", + "comment": "" + } + ] + } + ] + }, + { + "iteration": 3, + "date": "2025-01-21", + "label": null, + "day": { + "id": 9, + "routine": 2, + "order": 2, + "name": "", + "description": "", + "is_rest": true, + "need_logs_to_advance": false, + "type": "custom", + "config": null + }, + "slots": [] + }, + { + "iteration": 3, + "date": "2025-01-22", + "label": null, + "day": { + "id": 10, + "routine": 2, + "order": 3, + "name": "Arms day", + "description": "Leg day", + "is_rest": false, + "need_logs_to_advance": false, + "type": "custom", + "config": null + }, + "slots": [ + { + "comment": "", + "is_superset": false, + "exercises": [ + 92 + ], + "sets": [ + { + "slot_entry_id": 3, + "exercise": 92, + "sets": 4, + "max_sets": null, + "weight": "22.00", + "max_weight": null, + "weight_unit": 1, + "weight_rounding": null, + "repetitions": "10.00", + "max_repetitions": null, + "repetitions_unit": 1, + "repetitions_rounding": null, + "rir": null, + "max_rir": null, + "rpe": null, + "rest": "120.00", + "max_rest": null, + "type": "normal", + "text_repr": "4 Sätze, 10 × 22 kg 120s rest", + "comment": "" + } + ] + } + ] + }, + { + "iteration": 3, + "date": "2025-01-23", + "label": null, + "day": null, + "slots": [] + }, + { + "iteration": 3, + "date": "2025-01-24", + "label": null, + "day": null, + "slots": [] + }, + { + "iteration": 3, + "date": "2025-01-25", + "label": null, + "day": null, + "slots": [] + }, + { + "iteration": 3, + "date": "2025-01-26", + "label": null, + "day": null, + "slots": [] + }, + { + "iteration": 4, + "date": "2025-01-27", + "label": null, + "day": { + "id": 8, + "routine": 2, + "order": 1, + "name": "Leg day", + "description": "Leg day", + "is_rest": false, + "need_logs_to_advance": false, + "type": "custom", + "config": null + }, + "slots": [ + { + "comment": "", + "is_superset": false, + "exercises": [ + 76 + ], + "sets": [ + { + "slot_entry_id": 2, + "exercise": 76, + "sets": 4, + "max_sets": null, + "weight": "80.00", + "max_weight": null, + "weight_unit": 1, + "weight_rounding": null, + "repetitions": "10.00", + "max_repetitions": null, + "repetitions_unit": 1, + "repetitions_rounding": null, + "rir": null, + "max_rir": null, + "rpe": null, + "rest": "120.00", + "max_rest": null, + "type": "normal", + "text_repr": "4 Sätze, 10 × 80 kg 120s rest", + "comment": "" + } + ] + } + ] + }, + { + "iteration": 4, + "date": "2025-01-28", + "label": null, + "day": { + "id": 9, + "routine": 2, + "order": 2, + "name": "", + "description": "", + "is_rest": true, + "need_logs_to_advance": false, + "type": "custom", + "config": null + }, + "slots": [] + }, + { + "iteration": 4, + "date": "2025-01-29", + "label": null, + "day": { + "id": 10, + "routine": 2, + "order": 3, + "name": "Arms day", + "description": "Leg day", + "is_rest": false, + "need_logs_to_advance": false, + "type": "custom", + "config": null + }, + "slots": [ + { + "comment": "", + "is_superset": false, + "exercises": [ + 92 + ], + "sets": [ + { + "slot_entry_id": 3, + "exercise": 92, + "sets": 4, + "max_sets": null, + "weight": "23.00", + "max_weight": null, + "weight_unit": 1, + "weight_rounding": null, + "repetitions": "10.00", + "max_repetitions": null, + "repetitions_unit": 1, + "repetitions_rounding": null, + "rir": null, + "max_rir": null, + "rpe": null, + "rest": "120.00", + "max_rest": null, + "type": "normal", + "text_repr": "4 Sätze, 10 × 23 kg 120s rest", + "comment": "" + } + ] + } + ] + }, + { + "iteration": 4, + "date": "2025-01-30", + "label": null, + "day": null, + "slots": [] + }, + { + "iteration": 4, + "date": "2025-01-31", + "label": null, + "day": null, + "slots": [] + }, + { + "iteration": 4, + "date": "2025-02-01", + "label": null, + "day": null, + "slots": [] + }, + { + "iteration": 4, + "date": "2025-02-02", + "label": null, + "day": null, + "slots": [] + }, + { + "iteration": 5, + "date": "2025-02-03", + "label": null, + "day": { + "id": 8, + "routine": 2, + "order": 1, + "name": "Leg day", + "description": "Leg day", + "is_rest": false, + "need_logs_to_advance": false, + "type": "custom", + "config": null + }, + "slots": [ + { + "comment": "", + "is_superset": false, + "exercises": [ + 76 + ], + "sets": [ + { + "slot_entry_id": 2, + "exercise": 76, + "sets": 4, + "max_sets": null, + "weight": "80.00", + "max_weight": null, + "weight_unit": 1, + "weight_rounding": null, + "repetitions": "10.00", + "max_repetitions": null, + "repetitions_unit": 1, + "repetitions_rounding": null, + "rir": null, + "max_rir": null, + "rpe": null, + "rest": "120.00", + "max_rest": null, + "type": "normal", + "text_repr": "4 Sätze, 10 × 80 kg 120s rest", + "comment": "" + } + ] + } + ] + }, + { + "iteration": 5, + "date": "2025-02-04", + "label": null, + "day": { + "id": 9, + "routine": 2, + "order": 2, + "name": "", + "description": "", + "is_rest": true, + "need_logs_to_advance": false, + "type": "custom", + "config": null + }, + "slots": [] + }, + { + "iteration": 5, + "date": "2025-02-05", + "label": null, + "day": { + "id": 10, + "routine": 2, + "order": 3, + "name": "Arms day", + "description": "Leg day", + "is_rest": false, + "need_logs_to_advance": false, + "type": "custom", + "config": null + }, + "slots": [ + { + "comment": "", + "is_superset": false, + "exercises": [ + 92 + ], + "sets": [ + { + "slot_entry_id": 3, + "exercise": 92, + "sets": 4, + "max_sets": null, + "weight": "24.00", + "max_weight": null, + "weight_unit": 1, + "weight_rounding": null, + "repetitions": "10.00", + "max_repetitions": null, + "repetitions_unit": 1, + "repetitions_rounding": null, + "rir": null, + "max_rir": null, + "rpe": null, + "rest": "120.00", + "max_rest": null, + "type": "normal", + "text_repr": "4 Sätze, 10 × 24 kg 120s rest", + "comment": "" + } + ] + } + ] + } +] \ No newline at end of file diff --git a/test/fixtures/routines/routine_date_sequence_gym.json b/test/fixtures/routines/routine_date_sequence_gym.json new file mode 100644 index 000000000..b17086327 --- /dev/null +++ b/test/fixtures/routines/routine_date_sequence_gym.json @@ -0,0 +1,1356 @@ +[ + { + "iteration": 1, + "date": "2025-01-05", + "label": null, + "day": { + "id": 8, + "routine": 2, + "order": 1, + "name": "Leg day", + "description": "yes, we really do legs today", + "is_rest": false, + "need_logs_to_advance": false, + "type": "custom", + "config": null + }, + "slots": [ + { + "comment": "", + "is_superset": false, + "exercises": [ + 76 + ], + "sets": [ + { + "slot_entry_id": 2, + "exercise": 76, + "sets": 1, + "max_sets": null, + "weight": "80.00", + "max_weight": null, + "weight_unit": 1, + "weight_rounding": null, + "repetitions": "10.00", + "max_repetitions": null, + "repetitions_unit": 1, + "repetitions_rounding": null, + "rir": null, + "max_rir": null, + "rpe": null, + "rest": "120.00", + "max_rest": null, + "type": "normal", + "text_repr": "10 × 80 kg 120s rest", + "comment": "" + }, + { + "slot_entry_id": 2, + "exercise": 76, + "sets": 1, + "max_sets": null, + "weight": "80.00", + "max_weight": null, + "weight_unit": 1, + "weight_rounding": null, + "repetitions": "10.00", + "max_repetitions": null, + "repetitions_unit": 1, + "repetitions_rounding": null, + "rir": null, + "max_rir": null, + "rpe": null, + "rest": "120.00", + "max_rest": null, + "type": "normal", + "text_repr": "10 × 80 kg 120s rest", + "comment": "" + }, + { + "slot_entry_id": 2, + "exercise": 76, + "sets": 1, + "max_sets": null, + "weight": "80.00", + "max_weight": null, + "weight_unit": 1, + "weight_rounding": null, + "repetitions": "10.00", + "max_repetitions": null, + "repetitions_unit": 1, + "repetitions_rounding": null, + "rir": null, + "max_rir": null, + "rpe": null, + "rest": "120.00", + "max_rest": null, + "type": "normal", + "text_repr": "10 × 80 kg 120s rest", + "comment": "" + }, + { + "slot_entry_id": 2, + "exercise": 76, + "sets": 1, + "max_sets": null, + "weight": "80.00", + "max_weight": null, + "weight_unit": 1, + "weight_rounding": null, + "repetitions": "10.00", + "max_repetitions": null, + "repetitions_unit": 1, + "repetitions_rounding": null, + "rir": null, + "max_rir": null, + "rpe": null, + "rest": "120.00", + "max_rest": null, + "type": "normal", + "text_repr": "10 × 80 kg 120s rest", + "comment": "" + } + ] + } + ] + }, + { + "iteration": 1, + "date": "2025-01-06", + "label": null, + "day": { + "id": 9, + "routine": 2, + "order": 2, + "name": "", + "description": "", + "is_rest": true, + "need_logs_to_advance": false, + "type": "custom", + "config": null + }, + "slots": [] + }, + { + "iteration": 1, + "date": "2025-01-07", + "label": null, + "day": { + "id": 10, + "routine": 2, + "order": 3, + "name": "Arms day", + "description": "Leg day", + "is_rest": false, + "need_logs_to_advance": false, + "type": "custom", + "config": null + }, + "slots": [ + { + "comment": "", + "is_superset": false, + "exercises": [ + 92 + ], + "sets": [ + { + "slot_entry_id": 3, + "exercise": 92, + "sets": 1, + "max_sets": null, + "weight": "20.00", + "max_weight": "22.00", + "weight_unit": 1, + "weight_rounding": null, + "repetitions": "10.00", + "max_repetitions": null, + "repetitions_unit": 1, + "repetitions_rounding": null, + "rir": null, + "max_rir": null, + "rpe": null, + "rest": "120.00", + "max_rest": null, + "type": "normal", + "text_repr": "10 × 20-22 kg 120s rest", + "comment": "" + }, + { + "slot_entry_id": 3, + "exercise": 92, + "sets": 1, + "max_sets": null, + "weight": "20.00", + "max_weight": "22.00", + "weight_unit": 1, + "weight_rounding": null, + "repetitions": "10.00", + "max_repetitions": null, + "repetitions_unit": 1, + "repetitions_rounding": null, + "rir": null, + "max_rir": null, + "rpe": null, + "rest": "120.00", + "max_rest": null, + "type": "normal", + "text_repr": "10 × 20-22 kg 120s rest", + "comment": "" + }, + { + "slot_entry_id": 3, + "exercise": 92, + "sets": 1, + "max_sets": null, + "weight": "20.00", + "max_weight": "22.00", + "weight_unit": 1, + "weight_rounding": null, + "repetitions": "10.00", + "max_repetitions": null, + "repetitions_unit": 1, + "repetitions_rounding": null, + "rir": null, + "max_rir": null, + "rpe": null, + "rest": "120.00", + "max_rest": null, + "type": "normal", + "text_repr": "10 × 20-22 kg 120s rest", + "comment": "" + }, + { + "slot_entry_id": 3, + "exercise": 92, + "sets": 1, + "max_sets": null, + "weight": "20.00", + "max_weight": "22.00", + "weight_unit": 1, + "weight_rounding": null, + "repetitions": "10.00", + "max_repetitions": null, + "repetitions_unit": 1, + "repetitions_rounding": null, + "rir": null, + "max_rir": null, + "rpe": null, + "rest": "120.00", + "max_rest": null, + "type": "normal", + "text_repr": "10 × 20-22 kg 120s rest", + "comment": "" + } + ] + } + ] + }, + { + "iteration": 1, + "date": "2025-01-08", + "label": null, + "day": null, + "slots": [] + }, + { + "iteration": 1, + "date": "2025-01-09", + "label": null, + "day": null, + "slots": [] + }, + { + "iteration": 1, + "date": "2025-01-10", + "label": null, + "day": null, + "slots": [] + }, + { + "iteration": 1, + "date": "2025-01-11", + "label": null, + "day": null, + "slots": [] + }, + { + "iteration": 1, + "date": "2025-01-12", + "label": null, + "day": null, + "slots": [] + }, + { + "iteration": 2, + "date": "2025-01-13", + "label": null, + "day": { + "id": 8, + "routine": 2, + "order": 1, + "name": "Leg day", + "description": "Leg day", + "is_rest": false, + "need_logs_to_advance": false, + "type": "custom", + "config": null + }, + "slots": [ + { + "comment": "", + "is_superset": false, + "exercises": [ + 76 + ], + "sets": [ + { + "slot_entry_id": 2, + "exercise": 76, + "sets": 1, + "max_sets": null, + "weight": "80.00", + "max_weight": null, + "weight_unit": 1, + "weight_rounding": null, + "repetitions": "10.00", + "max_repetitions": null, + "repetitions_unit": 1, + "repetitions_rounding": null, + "rir": null, + "max_rir": null, + "rpe": null, + "rest": "120.00", + "max_rest": null, + "type": "normal", + "text_repr": "10 × 80 kg 120s rest", + "comment": "" + }, + { + "slot_entry_id": 2, + "exercise": 76, + "sets": 1, + "max_sets": null, + "weight": "80.00", + "max_weight": null, + "weight_unit": 1, + "weight_rounding": null, + "repetitions": "10.00", + "max_repetitions": null, + "repetitions_unit": 1, + "repetitions_rounding": null, + "rir": null, + "max_rir": null, + "rpe": null, + "rest": "120.00", + "max_rest": null, + "type": "normal", + "text_repr": "10 × 80 kg 120s rest", + "comment": "" + }, + { + "slot_entry_id": 2, + "exercise": 76, + "sets": 1, + "max_sets": null, + "weight": "80.00", + "max_weight": null, + "weight_unit": 1, + "weight_rounding": null, + "repetitions": "10.00", + "max_repetitions": null, + "repetitions_unit": 1, + "repetitions_rounding": null, + "rir": null, + "max_rir": null, + "rpe": null, + "rest": "120.00", + "max_rest": null, + "type": "normal", + "text_repr": "10 × 80 kg 120s rest", + "comment": "" + }, + { + "slot_entry_id": 2, + "exercise": 76, + "sets": 1, + "max_sets": null, + "weight": "80.00", + "max_weight": null, + "weight_unit": 1, + "weight_rounding": null, + "repetitions": "10.00", + "max_repetitions": null, + "repetitions_unit": 1, + "repetitions_rounding": null, + "rir": null, + "max_rir": null, + "rpe": null, + "rest": "120.00", + "max_rest": null, + "type": "normal", + "text_repr": "10 × 80 kg 120s rest", + "comment": "" + } + ] + } + ] + }, + { + "iteration": 2, + "date": "2025-01-14", + "label": null, + "day": { + "id": 9, + "routine": 2, + "order": 2, + "name": "", + "description": "", + "is_rest": true, + "need_logs_to_advance": false, + "type": "custom", + "config": null + }, + "slots": [] + }, + { + "iteration": 2, + "date": "2025-01-15", + "label": null, + "day": { + "id": 10, + "routine": 2, + "order": 3, + "name": "Arms day", + "description": "Leg day", + "is_rest": false, + "need_logs_to_advance": false, + "type": "custom", + "config": null + }, + "slots": [ + { + "comment": "", + "is_superset": false, + "exercises": [ + 92 + ], + "sets": [ + { + "slot_entry_id": 3, + "exercise": 92, + "sets": 1, + "max_sets": null, + "weight": "21.00", + "max_weight": "22.00", + "weight_unit": 1, + "weight_rounding": null, + "repetitions": "10.00", + "max_repetitions": null, + "repetitions_unit": 1, + "repetitions_rounding": null, + "rir": null, + "max_rir": null, + "rpe": null, + "rest": "120.00", + "max_rest": null, + "type": "normal", + "text_repr": "10 × 21-22 kg 120s rest", + "comment": "" + }, + { + "slot_entry_id": 3, + "exercise": 92, + "sets": 1, + "max_sets": null, + "weight": "21.00", + "max_weight": "22.00", + "weight_unit": 1, + "weight_rounding": null, + "repetitions": "10.00", + "max_repetitions": null, + "repetitions_unit": 1, + "repetitions_rounding": null, + "rir": null, + "max_rir": null, + "rpe": null, + "rest": "120.00", + "max_rest": null, + "type": "normal", + "text_repr": "10 × 21-22 kg 120s rest", + "comment": "" + }, + { + "slot_entry_id": 3, + "exercise": 92, + "sets": 1, + "max_sets": null, + "weight": "21.00", + "max_weight": "22.00", + "weight_unit": 1, + "weight_rounding": null, + "repetitions": "10.00", + "max_repetitions": null, + "repetitions_unit": 1, + "repetitions_rounding": null, + "rir": null, + "max_rir": null, + "rpe": null, + "rest": "120.00", + "max_rest": null, + "type": "normal", + "text_repr": "10 × 21-22 kg 120s rest", + "comment": "" + }, + { + "slot_entry_id": 3, + "exercise": 92, + "sets": 1, + "max_sets": null, + "weight": "21.00", + "max_weight": "22.00", + "weight_unit": 1, + "weight_rounding": null, + "repetitions": "10.00", + "max_repetitions": null, + "repetitions_unit": 1, + "repetitions_rounding": null, + "rir": null, + "max_rir": null, + "rpe": null, + "rest": "120.00", + "max_rest": null, + "type": "normal", + "text_repr": "10 × 21-22 kg 120s rest", + "comment": "" + } + ] + } + ] + }, + { + "iteration": 2, + "date": "2025-01-16", + "label": null, + "day": null, + "slots": [] + }, + { + "iteration": 2, + "date": "2025-01-17", + "label": null, + "day": null, + "slots": [] + }, + { + "iteration": 2, + "date": "2025-01-18", + "label": null, + "day": null, + "slots": [] + }, + { + "iteration": 2, + "date": "2025-01-19", + "label": null, + "day": null, + "slots": [] + }, + { + "iteration": 3, + "date": "2025-01-20", + "label": null, + "day": { + "id": 8, + "routine": 2, + "order": 1, + "name": "Leg day", + "description": "Leg day", + "is_rest": false, + "need_logs_to_advance": false, + "type": "custom", + "config": null + }, + "slots": [ + { + "comment": "", + "is_superset": false, + "exercises": [ + 76 + ], + "sets": [ + { + "slot_entry_id": 2, + "exercise": 76, + "sets": 1, + "max_sets": null, + "weight": "80.00", + "max_weight": null, + "weight_unit": 1, + "weight_rounding": null, + "repetitions": "10.00", + "max_repetitions": null, + "repetitions_unit": 1, + "repetitions_rounding": null, + "rir": null, + "max_rir": null, + "rpe": null, + "rest": "120.00", + "max_rest": null, + "type": "normal", + "text_repr": "10 × 80 kg 120s rest", + "comment": "" + }, + { + "slot_entry_id": 2, + "exercise": 76, + "sets": 1, + "max_sets": null, + "weight": "80.00", + "max_weight": null, + "weight_unit": 1, + "weight_rounding": null, + "repetitions": "10.00", + "max_repetitions": null, + "repetitions_unit": 1, + "repetitions_rounding": null, + "rir": null, + "max_rir": null, + "rpe": null, + "rest": "120.00", + "max_rest": null, + "type": "normal", + "text_repr": "10 × 80 kg 120s rest", + "comment": "" + }, + { + "slot_entry_id": 2, + "exercise": 76, + "sets": 1, + "max_sets": null, + "weight": "80.00", + "max_weight": null, + "weight_unit": 1, + "weight_rounding": null, + "repetitions": "10.00", + "max_repetitions": null, + "repetitions_unit": 1, + "repetitions_rounding": null, + "rir": null, + "max_rir": null, + "rpe": null, + "rest": "120.00", + "max_rest": null, + "type": "normal", + "text_repr": "10 × 80 kg 120s rest", + "comment": "" + }, + { + "slot_entry_id": 2, + "exercise": 76, + "sets": 1, + "max_sets": null, + "weight": "80.00", + "max_weight": null, + "weight_unit": 1, + "weight_rounding": null, + "repetitions": "10.00", + "max_repetitions": null, + "repetitions_unit": 1, + "repetitions_rounding": null, + "rir": null, + "max_rir": null, + "rpe": null, + "rest": "120.00", + "max_rest": null, + "type": "normal", + "text_repr": "10 × 80 kg 120s rest", + "comment": "" + } + ] + } + ] + }, + { + "iteration": 3, + "date": "2025-01-21", + "label": null, + "day": { + "id": 9, + "routine": 2, + "order": 2, + "name": "", + "description": "", + "is_rest": true, + "need_logs_to_advance": false, + "type": "custom", + "config": null + }, + "slots": [] + }, + { + "iteration": 3, + "date": "2025-01-22", + "label": null, + "day": { + "id": 10, + "routine": 2, + "order": 3, + "name": "Arms day", + "description": "Leg day", + "is_rest": false, + "need_logs_to_advance": false, + "type": "custom", + "config": null + }, + "slots": [ + { + "comment": "", + "is_superset": false, + "exercises": [ + 92 + ], + "sets": [ + { + "slot_entry_id": 3, + "exercise": 92, + "sets": 1, + "max_sets": null, + "weight": "22.00", + "max_weight": null, + "weight_unit": 1, + "weight_rounding": null, + "repetitions": "10.00", + "max_repetitions": null, + "repetitions_unit": 1, + "repetitions_rounding": null, + "rir": null, + "max_rir": null, + "rpe": null, + "rest": "120.00", + "max_rest": null, + "type": "normal", + "text_repr": "10 × 22 kg 120s rest", + "comment": "" + }, + { + "slot_entry_id": 3, + "exercise": 92, + "sets": 1, + "max_sets": null, + "weight": "22.00", + "max_weight": null, + "weight_unit": 1, + "weight_rounding": null, + "repetitions": "10.00", + "max_repetitions": null, + "repetitions_unit": 1, + "repetitions_rounding": null, + "rir": null, + "max_rir": null, + "rpe": null, + "rest": "120.00", + "max_rest": null, + "type": "normal", + "text_repr": "10 × 22 kg 120s rest", + "comment": "" + }, + { + "slot_entry_id": 3, + "exercise": 92, + "sets": 1, + "max_sets": null, + "weight": "22.00", + "max_weight": null, + "weight_unit": 1, + "weight_rounding": null, + "repetitions": "10.00", + "max_repetitions": null, + "repetitions_unit": 1, + "repetitions_rounding": null, + "rir": null, + "max_rir": null, + "rpe": null, + "rest": "120.00", + "max_rest": null, + "type": "normal", + "text_repr": "10 × 22 kg 120s rest", + "comment": "" + }, + { + "slot_entry_id": 3, + "exercise": 92, + "sets": 1, + "max_sets": null, + "weight": "22.00", + "max_weight": null, + "weight_unit": 1, + "weight_rounding": null, + "repetitions": "10.00", + "max_repetitions": null, + "repetitions_unit": 1, + "repetitions_rounding": null, + "rir": null, + "max_rir": null, + "rpe": null, + "rest": "120.00", + "max_rest": null, + "type": "normal", + "text_repr": "10 × 22 kg 120s rest", + "comment": "" + } + ] + } + ] + }, + { + "iteration": 3, + "date": "2025-01-23", + "label": null, + "day": null, + "slots": [] + }, + { + "iteration": 3, + "date": "2025-01-24", + "label": null, + "day": null, + "slots": [] + }, + { + "iteration": 3, + "date": "2025-01-25", + "label": null, + "day": null, + "slots": [] + }, + { + "iteration": 3, + "date": "2025-01-26", + "label": null, + "day": null, + "slots": [] + }, + { + "iteration": 4, + "date": "2025-01-27", + "label": null, + "day": { + "id": 8, + "routine": 2, + "order": 1, + "name": "Leg day", + "description": "Leg day", + "is_rest": false, + "need_logs_to_advance": false, + "type": "custom", + "config": null + }, + "slots": [ + { + "comment": "", + "is_superset": false, + "exercises": [ + 76 + ], + "sets": [ + { + "slot_entry_id": 2, + "exercise": 76, + "sets": 1, + "max_sets": null, + "weight": "80.00", + "max_weight": null, + "weight_unit": 1, + "weight_rounding": null, + "repetitions": "10.00", + "max_repetitions": null, + "repetitions_unit": 1, + "repetitions_rounding": null, + "rir": null, + "max_rir": null, + "rpe": null, + "rest": "120.00", + "max_rest": null, + "type": "normal", + "text_repr": "10 × 80 kg 120s rest", + "comment": "" + }, + { + "slot_entry_id": 2, + "exercise": 76, + "sets": 1, + "max_sets": null, + "weight": "80.00", + "max_weight": null, + "weight_unit": 1, + "weight_rounding": null, + "repetitions": "10.00", + "max_repetitions": null, + "repetitions_unit": 1, + "repetitions_rounding": null, + "rir": null, + "max_rir": null, + "rpe": null, + "rest": "120.00", + "max_rest": null, + "type": "normal", + "text_repr": "10 × 80 kg 120s rest", + "comment": "" + }, + { + "slot_entry_id": 2, + "exercise": 76, + "sets": 1, + "max_sets": null, + "weight": "80.00", + "max_weight": null, + "weight_unit": 1, + "weight_rounding": null, + "repetitions": "10.00", + "max_repetitions": null, + "repetitions_unit": 1, + "repetitions_rounding": null, + "rir": null, + "max_rir": null, + "rpe": null, + "rest": "120.00", + "max_rest": null, + "type": "normal", + "text_repr": "10 × 80 kg 120s rest", + "comment": "" + }, + { + "slot_entry_id": 2, + "exercise": 76, + "sets": 1, + "max_sets": null, + "weight": "80.00", + "max_weight": null, + "weight_unit": 1, + "weight_rounding": null, + "repetitions": "10.00", + "max_repetitions": null, + "repetitions_unit": 1, + "repetitions_rounding": null, + "rir": null, + "max_rir": null, + "rpe": null, + "rest": "120.00", + "max_rest": null, + "type": "normal", + "text_repr": "10 × 80 kg 120s rest", + "comment": "" + } + ] + } + ] + }, + { + "iteration": 4, + "date": "2025-01-28", + "label": null, + "day": { + "id": 9, + "routine": 2, + "order": 2, + "name": "", + "description": "", + "is_rest": true, + "need_logs_to_advance": false, + "type": "custom", + "config": null + }, + "slots": [] + }, + { + "iteration": 4, + "date": "2025-01-29", + "label": null, + "day": { + "id": 10, + "routine": 2, + "order": 3, + "name": "Arms day", + "description": "Leg day", + "is_rest": false, + "need_logs_to_advance": false, + "type": "custom", + "config": null + }, + "slots": [ + { + "comment": "", + "is_superset": false, + "exercises": [ + 92 + ], + "sets": [ + { + "slot_entry_id": 3, + "exercise": 92, + "sets": 1, + "max_sets": null, + "weight": "23.00", + "max_weight": null, + "weight_unit": 1, + "weight_rounding": null, + "repetitions": "10.00", + "max_repetitions": null, + "repetitions_unit": 1, + "repetitions_rounding": null, + "rir": null, + "max_rir": null, + "rpe": null, + "rest": "120.00", + "max_rest": null, + "type": "normal", + "text_repr": "10 × 23 kg 120s rest", + "comment": "" + }, + { + "slot_entry_id": 3, + "exercise": 92, + "sets": 1, + "max_sets": null, + "weight": "23.00", + "max_weight": null, + "weight_unit": 1, + "weight_rounding": null, + "repetitions": "10.00", + "max_repetitions": null, + "repetitions_unit": 1, + "repetitions_rounding": null, + "rir": null, + "max_rir": null, + "rpe": null, + "rest": "120.00", + "max_rest": null, + "type": "normal", + "text_repr": "10 × 23 kg 120s rest", + "comment": "" + }, + { + "slot_entry_id": 3, + "exercise": 92, + "sets": 1, + "max_sets": null, + "weight": "23.00", + "max_weight": null, + "weight_unit": 1, + "weight_rounding": null, + "repetitions": "10.00", + "max_repetitions": null, + "repetitions_unit": 1, + "repetitions_rounding": null, + "rir": null, + "max_rir": null, + "rpe": null, + "rest": "120.00", + "max_rest": null, + "type": "normal", + "text_repr": "10 × 23 kg 120s rest", + "comment": "" + }, + { + "slot_entry_id": 3, + "exercise": 92, + "sets": 1, + "max_sets": null, + "weight": "23.00", + "max_weight": null, + "weight_unit": 1, + "weight_rounding": null, + "repetitions": "10.00", + "max_repetitions": null, + "repetitions_unit": 1, + "repetitions_rounding": null, + "rir": null, + "max_rir": null, + "rpe": null, + "rest": "120.00", + "max_rest": null, + "type": "normal", + "text_repr": "10 × 23 kg 120s rest", + "comment": "" + } + ] + } + ] + }, + { + "iteration": 4, + "date": "2025-01-30", + "label": null, + "day": null, + "slots": [] + }, + { + "iteration": 4, + "date": "2025-01-31", + "label": null, + "day": null, + "slots": [] + }, + { + "iteration": 4, + "date": "2025-02-01", + "label": null, + "day": null, + "slots": [] + }, + { + "iteration": 4, + "date": "2025-02-02", + "label": null, + "day": null, + "slots": [] + }, + { + "iteration": 5, + "date": "2025-02-03", + "label": null, + "day": { + "id": 8, + "routine": 2, + "order": 1, + "name": "Leg day", + "description": "Leg day", + "is_rest": false, + "need_logs_to_advance": false, + "type": "custom", + "config": null + }, + "slots": [ + { + "comment": "", + "is_superset": false, + "exercises": [ + 76 + ], + "sets": [ + { + "slot_entry_id": 2, + "exercise": 76, + "sets": 1, + "max_sets": null, + "weight": "80.00", + "max_weight": null, + "weight_unit": 1, + "weight_rounding": null, + "repetitions": "10.00", + "max_repetitions": null, + "repetitions_unit": 1, + "repetitions_rounding": null, + "rir": null, + "max_rir": null, + "rpe": null, + "rest": "120.00", + "max_rest": null, + "type": "normal", + "text_repr": "10 × 80 kg 120s rest", + "comment": "" + }, + { + "slot_entry_id": 2, + "exercise": 76, + "sets": 1, + "max_sets": null, + "weight": "80.00", + "max_weight": null, + "weight_unit": 1, + "weight_rounding": null, + "repetitions": "10.00", + "max_repetitions": null, + "repetitions_unit": 1, + "repetitions_rounding": null, + "rir": null, + "max_rir": null, + "rpe": null, + "rest": "120.00", + "max_rest": null, + "type": "normal", + "text_repr": "10 × 80 kg 120s rest", + "comment": "" + }, + { + "slot_entry_id": 2, + "exercise": 76, + "sets": 1, + "max_sets": null, + "weight": "80.00", + "max_weight": null, + "weight_unit": 1, + "weight_rounding": null, + "repetitions": "10.00", + "max_repetitions": null, + "repetitions_unit": 1, + "repetitions_rounding": null, + "rir": null, + "max_rir": null, + "rpe": null, + "rest": "120.00", + "max_rest": null, + "type": "normal", + "text_repr": "10 × 80 kg 120s rest", + "comment": "" + }, + { + "slot_entry_id": 2, + "exercise": 76, + "sets": 1, + "max_sets": null, + "weight": "80.00", + "max_weight": null, + "weight_unit": 1, + "weight_rounding": null, + "repetitions": "10.00", + "max_repetitions": null, + "repetitions_unit": 1, + "repetitions_rounding": null, + "rir": null, + "max_rir": null, + "rpe": null, + "rest": "120.00", + "max_rest": null, + "type": "normal", + "text_repr": "10 × 80 kg 120s rest", + "comment": "" + } + ] + } + ] + }, + { + "iteration": 5, + "date": "2025-02-04", + "label": null, + "day": { + "id": 9, + "routine": 2, + "order": 2, + "name": "", + "description": "", + "is_rest": true, + "need_logs_to_advance": false, + "type": "custom", + "config": null + }, + "slots": [] + }, + { + "iteration": 5, + "date": "2025-02-05", + "label": null, + "day": { + "id": 10, + "routine": 2, + "order": 3, + "name": "Arms day", + "description": "Leg day", + "is_rest": false, + "need_logs_to_advance": false, + "type": "custom", + "config": null + }, + "slots": [ + { + "comment": "", + "is_superset": false, + "exercises": [ + 92 + ], + "sets": [ + { + "slot_entry_id": 3, + "exercise": 92, + "sets": 1, + "max_sets": null, + "weight": "24.00", + "max_weight": null, + "weight_unit": 1, + "weight_rounding": null, + "repetitions": "10.00", + "max_repetitions": null, + "repetitions_unit": 1, + "repetitions_rounding": null, + "rir": null, + "max_rir": null, + "rpe": null, + "rest": "120.00", + "max_rest": null, + "type": "normal", + "text_repr": "10 × 24 kg 120s rest", + "comment": "" + }, + { + "slot_entry_id": 3, + "exercise": 92, + "sets": 1, + "max_sets": null, + "weight": "24.00", + "max_weight": null, + "weight_unit": 1, + "weight_rounding": null, + "repetitions": "10.00", + "max_repetitions": null, + "repetitions_unit": 1, + "repetitions_rounding": null, + "rir": null, + "max_rir": null, + "rpe": null, + "rest": "120.00", + "max_rest": null, + "type": "normal", + "text_repr": "10 × 24 kg 120s rest", + "comment": "" + }, + { + "slot_entry_id": 3, + "exercise": 92, + "sets": 1, + "max_sets": null, + "weight": "24.00", + "max_weight": null, + "weight_unit": 1, + "weight_rounding": null, + "repetitions": "10.00", + "max_repetitions": null, + "repetitions_unit": 1, + "repetitions_rounding": null, + "rir": null, + "max_rir": null, + "rpe": null, + "rest": "120.00", + "max_rest": null, + "type": "normal", + "text_repr": "10 × 24 kg 120s rest", + "comment": "" + }, + { + "slot_entry_id": 3, + "exercise": 92, + "sets": 1, + "max_sets": null, + "weight": "24.00", + "max_weight": null, + "weight_unit": 1, + "weight_rounding": null, + "repetitions": "10.00", + "max_repetitions": null, + "repetitions_unit": 1, + "repetitions_rounding": null, + "rir": null, + "max_rir": null, + "rpe": null, + "rest": "120.00", + "max_rest": null, + "type": "normal", + "text_repr": "10 × 24 kg 120s rest", + "comment": "" + } + ] + } + ] + } +] \ No newline at end of file diff --git a/test/fixtures/routines/routine_logs.json b/test/fixtures/routines/routine_logs.json new file mode 100644 index 000000000..cca048294 --- /dev/null +++ b/test/fixtures/routines/routine_logs.json @@ -0,0 +1,284 @@ +[ + { + "session": { + "id": 5, + "routine": 2, + "day": null, + "date": "2025-01-06", + "notes": null, + "impression": "2", + "time_start": "20:28:49", + "time_end": "23:35:53" + }, + "logs": [ + { + "id": 4, + "date": "2025-01-06T00:00:00+01:00", + "session": 5, + "routine": 2, + "iteration": 1, + "slot_entry": 2, + "next_log": null, + "exercise": 76, + "repetitions_unit": 1, + "repetitions": "11.00", + "repetitions_target": "10.00", + "weight_unit": 1, + "weight": "78.00", + "weight_target": "80.00", + "rir": "4", + "rir_target": null, + "rest": 150, + "rest_target": 120 + }, + { + "id": 2, + "date": "2025-01-06T00:00:00+01:00", + "session": 5, + "routine": 2, + "iteration": 1, + "slot_entry": 2, + "next_log": null, + "exercise": 76, + "repetitions_unit": 1, + "repetitions": "12.00", + "repetitions_target": "10.00", + "weight_unit": 1, + "weight": "77.00", + "weight_target": "80.00", + "rir": "2", + "rir_target": null, + "rest": 159, + "rest_target": 120 + }, + { + "id": 1, + "date": "2025-01-06T00:00:00+01:00", + "session": 5, + "routine": 2, + "iteration": 1, + "slot_entry": 2, + "next_log": null, + "exercise": 76, + "repetitions_unit": 1, + "repetitions": "12.00", + "repetitions_target": "10.00", + "weight_unit": 1, + "weight": "78.00", + "weight_target": "80.00", + "rir": "2.5", + "rir_target": null, + "rest": 143, + "rest_target": 120 + }, + { + "id": 3, + "date": "2025-01-06T00:00:00+01:00", + "session": 5, + "routine": 2, + "iteration": 1, + "slot_entry": 2, + "next_log": null, + "exercise": 76, + "repetitions_unit": 1, + "repetitions": "12.00", + "repetitions_target": "10.00", + "weight_unit": 1, + "weight": "83.00", + "weight_target": "80.00", + "rir": "0.5", + "rir_target": null, + "rest": 160, + "rest_target": 120 + } + ] + }, + { + "session": { + "id": 6, + "routine": 2, + "day": null, + "date": "2025-01-08", + "notes": null, + "impression": "2", + "time_start": "12:55:54", + "time_end": "14:25:31" + }, + "logs": [ + { + "id": 7, + "date": "2025-01-08T00:00:00+01:00", + "session": 6, + "routine": 2, + "iteration": 1, + "slot_entry": 3, + "next_log": null, + "exercise": 76, + "repetitions_unit": 1, + "repetitions": "10.00", + "repetitions_target": "10.00", + "weight_unit": 1, + "weight": "80.00", + "weight_target": "80.00", + "rir": "3", + "rir_target": null, + "rest": 131, + "rest_target": 120 + }, + { + "id": 8, + "date": "2025-01-08T00:00:00+01:00", + "session": 6, + "routine": 2, + "iteration": 1, + "slot_entry": 3, + "next_log": null, + "exercise": 76, + "repetitions_unit": 1, + "repetitions": "11.00", + "repetitions_target": "10.00", + "weight_unit": 1, + "weight": "83.00", + "weight_target": "80.00", + "rir": "3", + "rir_target": null, + "rest": 128, + "rest_target": 120 + }, + { + "id": 5, + "date": "2025-01-08T00:00:00+01:00", + "session": 6, + "routine": 2, + "iteration": 1, + "slot_entry": 3, + "next_log": null, + "exercise": 76, + "repetitions_unit": 1, + "repetitions": "11.00", + "repetitions_target": "10.00", + "weight_unit": 1, + "weight": "90.00", + "weight_target": "80.00", + "rir": "0.5", + "rir_target": null, + "rest": 121, + "rest_target": 120 + }, + { + "id": 6, + "date": "2025-01-08T00:00:00+01:00", + "session": 6, + "routine": 2, + "iteration": 1, + "slot_entry": 3, + "next_log": null, + "exercise": 76, + "repetitions_unit": 1, + "repetitions": "12.00", + "repetitions_target": "10.00", + "weight_unit": 1, + "weight": "77.00", + "weight_target": "80.00", + "rir": "1.5", + "rir_target": null, + "rest": 129, + "rest_target": 120 + } + ] + }, + { + "session": { + "id": 7, + "routine": 2, + "day": null, + "date": "2025-01-13", + "notes": null, + "impression": "2", + "time_start": "18:48:45", + "time_end": "20:20:52" + }, + "logs": [ + { + "id": 11, + "date": "2025-01-13T00:00:00+01:00", + "session": 7, + "routine": 2, + "iteration": 2, + "slot_entry": 2, + "next_log": null, + "exercise": 76, + "repetitions_unit": 1, + "repetitions": "9.00", + "repetitions_target": "10.00", + "weight_unit": 1, + "weight": "84.00", + "weight_target": "80.00", + "rir": "0", + "rir_target": null, + "rest": 128, + "rest_target": 120 + }, + { + "id": 10, + "date": "2025-01-13T00:00:00+01:00", + "session": 7, + "routine": 2, + "iteration": 2, + "slot_entry": 2, + "next_log": null, + "exercise": 76, + "repetitions_unit": 1, + "repetitions": "10.00", + "repetitions_target": "10.00", + "weight_unit": 1, + "weight": "84.00", + "weight_target": "80.00", + "rir": "4", + "rir_target": null, + "rest": 149, + "rest_target": 120 + }, + { + "id": 12, + "date": "2025-01-13T00:00:00+01:00", + "session": 7, + "routine": 2, + "iteration": 2, + "slot_entry": 2, + "next_log": null, + "exercise": 76, + "repetitions_unit": 1, + "repetitions": "10.00", + "repetitions_target": "10.00", + "weight_unit": 1, + "weight": "89.00", + "weight_target": "80.00", + "rir": "1.5", + "rir_target": null, + "rest": 120, + "rest_target": 120 + }, + { + "id": 9, + "date": "2025-01-13T00:00:00+01:00", + "session": 7, + "routine": 2, + "iteration": 2, + "slot_entry": 2, + "next_log": null, + "exercise": 76, + "repetitions_unit": 1, + "repetitions": "12.00", + "repetitions_target": "10.00", + "weight_unit": 1, + "weight": "90.00", + "weight_target": "80.00", + "rir": "2.5", + "rir_target": null, + "rest": 119, + "rest_target": 120 + } + ] + } +] \ No newline at end of file diff --git a/test/fixtures/routines/routine_structure.json b/test/fixtures/routines/routine_structure.json new file mode 100644 index 000000000..aadf28cd4 --- /dev/null +++ b/test/fixtures/routines/routine_structure.json @@ -0,0 +1,266 @@ +{ + "id": 101, + "name": "Test 123", + "description": "", + "created": "2025-02-02T17:52:36.245680+01:00", + "start": "2025-01-06", + "end": "2025-03-28", + "fit_in_week": true, + "days": [ + { + "id": 8, + "routine": 2, + "order": 1, + "name": "Leg day", + "description": "Leg day", + "is_rest": false, + "need_logs_to_advance": false, + "type": "custom", + "config": null, + "slots": [ + { + "id": 2, + "day": 8, + "order": 1, + "comment": "", + "entries": [ + { + "id": 2, + "slot": 2, + "exercise": 76, + "order": 1, + "comment": "", + "type": "normal", + "class_name": null, + "config": null, + "repetition_unit": 1, + "repetition_rounding": null, + "repetitions_configs": [ + { + "id": 2, + "slot_entry": 2, + "iteration": 1, + "value": "10.00", + "operation": "r", + "step": "abs", + "repeat": false, + "requirements": null + } + ], + "max_repetitions_configs": [], + "weight_unit": 1, + "weight_rounding": null, + "weight_configs": [ + { + "id": 1, + "slot_entry": 2, + "iteration": 1, + "value": "80.00", + "operation": "r", + "step": "abs", + "repeat": false, + "requirements": null + } + ], + "max_weight_configs": [], + "set_nr_configs": [ + { + "id": 2, + "slot_entry": 2, + "iteration": 1, + "value": 4, + "operation": "r", + "step": "abs", + "repeat": false, + "requirements": null + } + ], + "max_set_nr_configs": [], + "rir_configs": [], + "max_rir_configs": [], + "rest_configs": [ + { + "id": 2, + "slot_entry": 2, + "iteration": 1, + "value": 120, + "operation": "r", + "step": "abs", + "repeat": false, + "requirements": null + } + ], + "max_rest_configs": [] + } + ], + "config": null + } + ] + }, + { + "id": 9, + "routine": 2, + "order": 2, + "name": "", + "description": "", + "is_rest": true, + "need_logs_to_advance": false, + "type": "custom", + "config": null, + "slots": [] + }, + { + "id": 10, + "routine": 2, + "order": 3, + "name": "Arms day", + "description": "Leg day", + "is_rest": false, + "need_logs_to_advance": false, + "type": "custom", + "config": null, + "slots": [ + { + "id": 3, + "day": 10, + "order": 1, + "comment": "", + "entries": [ + { + "id": 3, + "slot": 3, + "exercise": 92, + "order": 1, + "comment": "", + "type": "normal", + "class_name": null, + "config": null, + "repetition_unit": 1, + "repetition_rounding": null, + "repetitions_configs": [ + { + "id": 3, + "slot_entry": 3, + "iteration": 1, + "value": "10.00", + "operation": "r", + "step": "abs", + "repeat": false, + "requirements": null + } + ], + "max_repetitions_configs": [], + "weight_unit": 1, + "weight_rounding": null, + "weight_configs": [ + { + "id": 2, + "slot_entry": 3, + "iteration": 1, + "value": "20.00", + "operation": "r", + "step": "na", + "repeat": false, + "requirements": { + "rules": [] + } + }, + { + "id": 7, + "slot_entry": 3, + "iteration": 2, + "value": "1.00", + "operation": "+", + "step": "abs", + "repeat": true, + "requirements": { + "rules": [] + } + }, + { + "id": 8, + "slot_entry": 3, + "iteration": 8, + "value": "20.00", + "operation": "r", + "step": "na", + "repeat": false, + "requirements": { + "rules": [] + } + } + ], + "max_weight_configs": [ + { + "id": 1, + "slot_entry": 3, + "iteration": 1, + "value": "22.00", + "operation": "r", + "step": "na", + "repeat": false, + "requirements": { + "rules": [] + } + }, + { + "id": 2, + "slot_entry": 3, + "iteration": 2, + "value": "1.00", + "operation": "+", + "step": "abs", + "repeat": true, + "requirements": { + "rules": [] + } + }, + { + "id": 3, + "slot_entry": 3, + "iteration": 8, + "value": "22.00", + "operation": "r", + "step": "na", + "repeat": false, + "requirements": { + "rules": [] + } + } + ], + "set_nr_configs": [ + { + "id": 3, + "slot_entry": 3, + "iteration": 1, + "value": 4, + "operation": "r", + "step": "abs", + "repeat": false, + "requirements": null + } + ], + "max_set_nr_configs": [], + "rir_configs": [], + "max_rir_configs": [], + "rest_configs": [ + { + "id": 3, + "slot_entry": 3, + "iteration": 1, + "value": 120, + "operation": "r", + "step": "abs", + "repeat": false, + "requirements": null + } + ], + "max_rest_configs": [] + } + ], + "config": null + } + ] + } + ] +} \ No newline at end of file diff --git a/test/fixtures/routines/slot_entry.json b/test/fixtures/routines/slot_entry.json new file mode 100644 index 000000000..75b9b1931 --- /dev/null +++ b/test/fixtures/routines/slot_entry.json @@ -0,0 +1,132 @@ +{ + "id": 143, + "slot": 140, + "exercise": 294, + "order": 2, + "comment": "lorem ipsum", + "type": "normal", + "class_name": null, + "config": null, + "repetition_unit": 1, + "repetition_rounding": "1.25", + "repetitions_configs": [ + { + "id": 139, + "slot_entry": 143, + "iteration": 1, + "value": "2.00", + "operation": "r", + "step": "na", + "need_log_to_apply": false, + "repeat": false, + "requirements": null + } + ], + "max_repetitions_configs": [ + { + "id": 1, + "slot_entry": 143, + "iteration": 1, + "value": "5.00", + "operation": "r", + "step": "na", + "need_log_to_apply": false, + "repeat": false, + "requirements": null + } + ], + "weight_unit": 1, + "weight_rounding": "2.50", + "weight_configs": [ + { + "id": 10, + "slot_entry": 143, + "iteration": 1, + "value": "11.00", + "operation": "r", + "step": "na", + "need_log_to_apply": false, + "repeat": false, + "requirements": null + } + ], + "max_weight_configs": [ + { + "id": 1, + "slot_entry": 143, + "iteration": 1, + "value": "14.00", + "operation": "r", + "step": "na", + "need_log_to_apply": false, + "repeat": false, + "requirements": null + } + ], + "set_nr_configs": [ + { + "id": 143, + "slot_entry": 143, + "iteration": 1, + "value": 1, + "operation": "r", + "step": "na", + "need_log_to_apply": false, + "repeat": false, + "requirements": null + } + ], + "max_set_nr_configs": [ + { + "id": 2, + "slot_entry": 143, + "iteration": 1, + "value": 2, + "operation": "r", + "step": "na", + "need_log_to_apply": false, + "repeat": false, + "requirements": null + } + ], + "rir_configs": [ + { + "id": 1, + "slot_entry": 143, + "iteration": 1, + "value": "1.0", + "operation": "r", + "step": "na", + "need_log_to_apply": false, + "repeat": false, + "requirements": null + } + ], + "max_rir_configs": [], + "rest_configs": [ + { + "id": 138, + "slot_entry": 143, + "iteration": 1, + "value": 100, + "operation": "r", + "step": "na", + "need_log_to_apply": false, + "repeat": false, + "requirements": null + } + ], + "max_rest_configs": [ + { + "id": 1, + "slot_entry": 143, + "iteration": 1, + "value": 150, + "operation": "r", + "step": "na", + "need_log_to_apply": false, + "repeat": false, + "requirements": null + } + ] +} \ No newline at end of file diff --git a/test/gallery/gallery_form_test.dart b/test/gallery/gallery_form_test.dart index 6fdc69e01..e33c74bea 100644 --- a/test/gallery/gallery_form_test.dart +++ b/test/gallery/gallery_form_test.dart @@ -17,16 +17,17 @@ */ import 'package:flutter/material.dart'; -import 'package:flutter_gen/gen_l10n/app_localizations.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/annotations.dart'; import 'package:mockito/mockito.dart'; import 'package:network_image_mock/network_image_mock.dart'; import 'package:provider/provider.dart'; import 'package:wger/helpers/consts.dart'; +import 'package:wger/l10n/generated/app_localizations.dart'; import 'package:wger/models/gallery/image.dart' as gallery; import 'package:wger/providers/gallery.dart'; import 'package:wger/widgets/gallery/forms.dart'; + import '../../test_data/gallery.dart'; import 'gallery_form_test.mocks.dart'; diff --git a/test/gallery/gallery_form_test.mocks.dart b/test/gallery/gallery_form_test.mocks.dart index 22fe45cea..d8bf09cc4 100644 --- a/test/gallery/gallery_form_test.mocks.dart +++ b/test/gallery/gallery_form_test.mocks.dart @@ -157,12 +157,10 @@ class MockGalleryProvider extends _i1.Mock implements _i4.GalleryProvider { ) as Uri); @override - _i6.Future> fetch(Uri? uri) => (super.noSuchMethod( + _i6.Future fetch(Uri? uri) => (super.noSuchMethod( Invocation.method(#fetch, [uri]), - returnValue: _i6.Future>.value( - {}, - ), - ) as _i6.Future>); + returnValue: _i6.Future.value(), + ) as _i6.Future); @override _i6.Future> fetchPaginated(Uri? uri) => (super.noSuchMethod( diff --git a/test/gallery/gallery_screen_test.dart b/test/gallery/gallery_screen_test.dart index 0f796ab19..b7b01458f 100644 --- a/test/gallery/gallery_screen_test.dart +++ b/test/gallery/gallery_screen_test.dart @@ -17,15 +17,14 @@ */ import 'package:flutter/material.dart'; -import 'package:flutter_gen/gen_l10n/app_localizations.dart'; import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/annotations.dart'; import 'package:mockito/mockito.dart'; import 'package:network_image_mock/network_image_mock.dart'; import 'package:provider/provider.dart'; +import 'package:wger/l10n/generated/app_localizations.dart'; import 'package:wger/providers/gallery.dart'; -import 'package:wger/screens/form_screen.dart'; import 'package:wger/widgets/gallery/overview.dart'; import '../../test_data/gallery.dart'; @@ -40,7 +39,7 @@ void main() { when(mockGalleryProvider.images).thenAnswer((_) => getTestImages()); }); - Widget createScreen({locale = 'en'}) { + Widget renderScreen({locale = 'en'}) { return ChangeNotifierProvider( create: (context) => mockGalleryProvider, child: MaterialApp( @@ -48,51 +47,38 @@ void main() { localizationsDelegates: AppLocalizations.localizationsDelegates, supportedLocales: AppLocalizations.supportedLocales, home: const Gallery(), - routes: {FormScreen.routeName: (ctx) => const FormScreen()}, + ), + ); + } + + Widget renderDetail({locale = 'en'}) { + return ChangeNotifierProvider( + create: (context) => mockGalleryProvider, + child: MaterialApp( + locale: Locale(locale), + localizationsDelegates: AppLocalizations.localizationsDelegates, + supportedLocales: AppLocalizations.supportedLocales, + home: ImageDetail(image: getTestImages()[0]), ), ); } testWidgets('Test the widgets on the gallery screen', (WidgetTester tester) async { - await mockNetworkImagesFor(() => tester.pumpWidget(createScreen())); + await mockNetworkImagesFor(() => tester.pumpWidget(renderScreen())); expect(find.byType(SliverMasonryGrid), findsOneWidget); expect(find.byType(GestureDetector, skipOffstage: false), findsNWidgets(4)); }); - testWidgets('Test opening the form for an existing image', (WidgetTester tester) async { - await mockNetworkImagesFor(() => tester.pumpWidget(createScreen())); - - await tester.tap(find.byKey(const Key('image-1'))); - await tester.pumpAndSettle(); - - // Detail dialog opens - expect(find.byKey(const Key('image-1-detail')), findsOneWidget); - expect(find.byType(Image), findsNWidgets(5)); // four in the overview, one in the popup - expect(find.text('A very cool image from the gym'), findsOneWidget); - expect(find.byIcon(Icons.edit), findsOneWidget); - expect(find.byIcon(Icons.delete), findsOneWidget); - - // Edit form opens - await tester.tap(find.byIcon(Icons.edit)); - await tester.pumpAndSettle(); - - expect(find.text('A very cool image from the gym'), findsOneWidget); - expect(find.byType(TextFormField), findsNWidgets(2)); - expect(find.byType(ElevatedButton), findsOneWidget); - }); - testWidgets('Tests the localization of dates - EN', (WidgetTester tester) async { - await mockNetworkImagesFor(() => tester.pumpWidget(createScreen())); - await tester.tap(find.byKey(const Key('image-1'))); + await mockNetworkImagesFor(() => tester.pumpWidget(renderDetail())); await tester.pumpAndSettle(); expect(find.text('5/30/2021'), findsOneWidget); }); testWidgets('Tests the localization of dates - DE', (WidgetTester tester) async { - await mockNetworkImagesFor(() => tester.pumpWidget(createScreen(locale: 'de'))); - await tester.tap(find.byKey(const Key('image-1'))); + await mockNetworkImagesFor(() => tester.pumpWidget(renderDetail(locale: 'de'))); await tester.pumpAndSettle(); expect(find.text('30.5.2021'), findsOneWidget); diff --git a/test/gallery/gallery_screen_test.mocks.dart b/test/gallery/gallery_screen_test.mocks.dart index 8ea249dd8..d387e32e4 100644 --- a/test/gallery/gallery_screen_test.mocks.dart +++ b/test/gallery/gallery_screen_test.mocks.dart @@ -157,12 +157,10 @@ class MockGalleryProvider extends _i1.Mock implements _i4.GalleryProvider { ) as Uri); @override - _i6.Future> fetch(Uri? uri) => (super.noSuchMethod( + _i6.Future fetch(Uri? uri) => (super.noSuchMethod( Invocation.method(#fetch, [uri]), - returnValue: _i6.Future>.value( - {}, - ), - ) as _i6.Future>); + returnValue: _i6.Future.value(), + ) as _i6.Future); @override _i6.Future> fetchPaginated(Uri? uri) => (super.noSuchMethod( diff --git a/test/helpers/json_test.dart b/test/helpers/json_test.dart index 66787dc51..c0ac1d8c5 100644 --- a/test/helpers/json_test.dart +++ b/test/helpers/json_test.dart @@ -30,12 +30,12 @@ void main() { group('toDate', () { test('should return null for null input', () { - expect(toDate(null), isNull); + expect(dateToYYYYMMDD(null), isNull); }); test('should format DateTime to yyyy-MM-dd', () { final dateTime = DateTime(2022, 1, 30); - expect(toDate(dateTime), '2022-01-30'); + expect(dateToYYYYMMDD(dateTime), '2022-01-30'); }); }); diff --git a/test/measurements/measurement_categories_screen_test.dart b/test/measurements/measurement_categories_screen_test.dart index 75d8ad181..ff4d94c31 100644 --- a/test/measurements/measurement_categories_screen_test.dart +++ b/test/measurements/measurement_categories_screen_test.dart @@ -17,11 +17,11 @@ */ import 'package:flutter/material.dart'; -import 'package:flutter_gen/gen_l10n/app_localizations.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/annotations.dart'; import 'package:mockito/mockito.dart'; import 'package:provider/provider.dart'; +import 'package:wger/l10n/generated/app_localizations.dart'; import 'package:wger/models/measurements/measurement_category.dart'; import 'package:wger/models/measurements/measurement_entry.dart'; import 'package:wger/providers/measurement.dart'; diff --git a/test/measurements/measurement_entries_screen_test.dart b/test/measurements/measurement_entries_screen_test.dart index fef0b2efe..85862dd5a 100644 --- a/test/measurements/measurement_entries_screen_test.dart +++ b/test/measurements/measurement_entries_screen_test.dart @@ -17,10 +17,10 @@ */ import 'package:flutter/material.dart'; -import 'package:flutter_gen/gen_l10n/app_localizations.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/mockito.dart'; import 'package:provider/provider.dart'; +import 'package:wger/l10n/generated/app_localizations.dart'; import 'package:wger/models/measurements/measurement_category.dart'; import 'package:wger/models/measurements/measurement_entry.dart'; import 'package:wger/providers/measurement.dart'; diff --git a/test/measurements/measurement_provider_test.mocks.dart b/test/measurements/measurement_provider_test.mocks.dart index 867c70f81..830a4440a 100644 --- a/test/measurements/measurement_provider_test.mocks.dart +++ b/test/measurements/measurement_provider_test.mocks.dart @@ -104,12 +104,10 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider { ) as Uri); @override - _i5.Future> fetch(Uri? uri) => (super.noSuchMethod( + _i5.Future fetch(Uri? uri) => (super.noSuchMethod( Invocation.method(#fetch, [uri]), - returnValue: _i5.Future>.value( - {}, - ), - ) as _i5.Future>); + returnValue: _i5.Future.value(), + ) as _i5.Future); @override _i5.Future> fetchPaginated(Uri? uri) => (super.noSuchMethod( diff --git a/test/nutrition/nutritional_diary_test.dart b/test/nutrition/nutritional_diary_test.dart index 515b20d47..8280f1cb2 100644 --- a/test/nutrition/nutritional_diary_test.dart +++ b/test/nutrition/nutritional_diary_test.dart @@ -17,8 +17,8 @@ */ import 'package:flutter/material.dart'; -import 'package:flutter_gen/gen_l10n/app_localizations.dart'; import 'package:flutter_test/flutter_test.dart'; +import 'package:wger/l10n/generated/app_localizations.dart'; import 'package:wger/widgets/nutrition/charts.dart'; import 'package:wger/widgets/nutrition/nutritional_diary_detail.dart'; diff --git a/test/nutrition/nutritional_meal_form_test.dart b/test/nutrition/nutritional_meal_form_test.dart index fdb781f64..6f914bb2d 100644 --- a/test/nutrition/nutritional_meal_form_test.dart +++ b/test/nutrition/nutritional_meal_form_test.dart @@ -18,13 +18,13 @@ import 'package:clock/clock.dart'; import 'package:flutter/material.dart'; -import 'package:flutter_gen/gen_l10n/app_localizations.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/annotations.dart'; import 'package:mockito/mockito.dart'; import 'package:provider/provider.dart'; import 'package:wger/helpers/consts.dart'; import 'package:wger/helpers/json.dart'; +import 'package:wger/l10n/generated/app_localizations.dart'; import 'package:wger/models/nutrition/meal.dart'; import 'package:wger/models/nutrition/nutritional_plan.dart'; import 'package:wger/providers/nutrition.dart'; diff --git a/test/nutrition/nutritional_meal_item_form_test.dart b/test/nutrition/nutritional_meal_item_form_test.dart index e37435e98..1dbd28b06 100644 --- a/test/nutrition/nutritional_meal_item_form_test.dart +++ b/test/nutrition/nutritional_meal_item_form_test.dart @@ -2,7 +2,6 @@ import 'dart:convert'; import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; -import 'package:flutter_gen/gen_l10n/app_localizations.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:flutter_typeahead/flutter_typeahead.dart'; import 'package:http/http.dart' as http; @@ -10,6 +9,7 @@ import 'package:mockito/mockito.dart'; import 'package:network_image_mock/network_image_mock.dart'; import 'package:provider/provider.dart'; import 'package:wger/helpers/consts.dart'; +import 'package:wger/l10n/generated/app_localizations.dart'; import 'package:wger/models/exercises/ingredient_api.dart'; import 'package:wger/models/nutrition/ingredient.dart'; import 'package:wger/models/nutrition/meal.dart'; diff --git a/test/nutrition/nutritional_plan_form_test.dart b/test/nutrition/nutritional_plan_form_test.dart index e366ef51f..47fae1ff9 100644 --- a/test/nutrition/nutritional_plan_form_test.dart +++ b/test/nutrition/nutritional_plan_form_test.dart @@ -17,12 +17,12 @@ */ import 'package:flutter/material.dart'; -import 'package:flutter_gen/gen_l10n/app_localizations.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/annotations.dart'; import 'package:mockito/mockito.dart'; import 'package:provider/provider.dart'; import 'package:wger/helpers/consts.dart'; +import 'package:wger/l10n/generated/app_localizations.dart'; import 'package:wger/models/nutrition/nutritional_plan.dart'; import 'package:wger/providers/nutrition.dart'; import 'package:wger/screens/nutritional_plan_screen.dart'; diff --git a/test/nutrition/nutritional_plan_screen_test.dart b/test/nutrition/nutritional_plan_screen_test.dart index e22f93083..d4829ef0d 100644 --- a/test/nutrition/nutritional_plan_screen_test.dart +++ b/test/nutrition/nutritional_plan_screen_test.dart @@ -16,15 +16,17 @@ * along with this program. If not, see . */ +import 'dart:io'; + import 'package:drift/native.dart'; import 'package:flutter/material.dart'; -import 'package:flutter_gen/gen_l10n/app_localizations.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:golden_toolkit/golden_toolkit.dart'; import 'package:http/http.dart' as http; import 'package:mockito/annotations.dart'; import 'package:provider/provider.dart'; import 'package:wger/database/ingredients/ingredients_database.dart'; +import 'package:wger/l10n/generated/app_localizations.dart'; import 'package:wger/providers/auth.dart'; import 'package:wger/providers/base_provider.dart'; import 'package:wger/providers/body_weight.dart'; @@ -98,7 +100,7 @@ void main() { await tester.tap(find.byType(TextButton)); await tester.pumpAndSettle(); - await screenMatchesGolden(tester, 'nutritional_plan_1_default_view'); + await screenMatchesGolden(tester, 'nutritional_plan_1_default_view', skip: !Platform.isLinux); // Default view shows plan description, info button, and no ingredients expect(find.text('Less fat, more protein'), findsOneWidget); @@ -111,7 +113,11 @@ void main() { var infoOutlineButtons = find.byIcon(Icons.info_outline); await tester.tap(infoOutlineButtons.first); // 2nd button shows up also, but is off-screen await tester.pumpAndSettle(); - await screenMatchesGolden(tester, 'nutritional_plan_2_one_meal_with_ingredients'); + await screenMatchesGolden( + tester, + 'nutritional_plan_2_one_meal_with_ingredients', + skip: !Platform.isLinux, + ); // Ingredients show up now expect(find.text('100g Water'), findsOneWidget); @@ -130,7 +136,11 @@ void main() { await tester.tap(infoOutlineButtons.first); await tester.pumpAndSettle(); - await screenMatchesGolden(tester, 'nutritional_plan_3_both_meals_with_ingredients'); + await screenMatchesGolden( + tester, + 'nutritional_plan_3_both_meals_with_ingredients', + skip: !Platform.isLinux, + ); expect(find.byIcon(Icons.info_outline), findsOneWidget); expect(find.byIcon(Icons.info), findsNWidgets(2)); diff --git a/test/nutrition/nutritional_plan_screen_test.mocks.dart b/test/nutrition/nutritional_plan_screen_test.mocks.dart index d616d092e..09ca8fcb5 100644 --- a/test/nutrition/nutritional_plan_screen_test.mocks.dart +++ b/test/nutrition/nutritional_plan_screen_test.mocks.dart @@ -114,12 +114,10 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider { ) as Uri); @override - _i5.Future> fetch(Uri? uri) => (super.noSuchMethod( + _i5.Future fetch(Uri? uri) => (super.noSuchMethod( Invocation.method(#fetch, [uri]), - returnValue: _i5.Future>.value( - {}, - ), - ) as _i5.Future>); + returnValue: _i5.Future.value(), + ) as _i5.Future); @override _i5.Future> fetchPaginated(Uri? uri) => (super.noSuchMethod( diff --git a/test/nutrition/nutritional_plans_screen_test.dart b/test/nutrition/nutritional_plans_screen_test.dart index 5a60b2503..d3ff76574 100644 --- a/test/nutrition/nutritional_plans_screen_test.dart +++ b/test/nutrition/nutritional_plans_screen_test.dart @@ -18,13 +18,13 @@ import 'package:drift/native.dart'; import 'package:flutter/material.dart'; -import 'package:flutter_gen/gen_l10n/app_localizations.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:http/http.dart' as http; import 'package:mockito/annotations.dart'; import 'package:mockito/mockito.dart'; import 'package:provider/provider.dart'; import 'package:wger/database/ingredients/ingredients_database.dart'; +import 'package:wger/l10n/generated/app_localizations.dart'; import 'package:wger/models/nutrition/nutritional_plan.dart'; import 'package:wger/providers/auth.dart'; import 'package:wger/providers/base_provider.dart'; diff --git a/test/nutrition/nutritional_plans_screen_test.mocks.dart b/test/nutrition/nutritional_plans_screen_test.mocks.dart index 27a1aa938..dff174c10 100644 --- a/test/nutrition/nutritional_plans_screen_test.mocks.dart +++ b/test/nutrition/nutritional_plans_screen_test.mocks.dart @@ -310,12 +310,10 @@ class MockWgerBaseProvider extends _i1.Mock implements _i8.WgerBaseProvider { ) as Uri); @override - _i5.Future> fetch(Uri? uri) => (super.noSuchMethod( + _i5.Future fetch(Uri? uri) => (super.noSuchMethod( Invocation.method(#fetch, [uri]), - returnValue: _i5.Future>.value( - {}, - ), - ) as _i5.Future>); + returnValue: _i5.Future.value(), + ) as _i5.Future); @override _i5.Future> fetchPaginated(Uri? uri) => (super.noSuchMethod( diff --git a/test/user/provider_test.mocks.dart b/test/user/provider_test.mocks.dart index da5aae951..aa49e069a 100644 --- a/test/user/provider_test.mocks.dart +++ b/test/user/provider_test.mocks.dart @@ -104,12 +104,10 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider { ) as Uri); @override - _i5.Future> fetch(Uri? uri) => (super.noSuchMethod( + _i5.Future fetch(Uri? uri) => (super.noSuchMethod( Invocation.method(#fetch, [uri]), - returnValue: _i5.Future>.value( - {}, - ), - ) as _i5.Future>); + returnValue: _i5.Future.value(), + ) as _i5.Future); @override _i5.Future> fetchPaginated(Uri? uri) => (super.noSuchMethod( diff --git a/test/weight/weight_form_test.dart b/test/weight/weight_form_test.dart index 7c81ef7e7..443f07f56 100644 --- a/test/weight/weight_form_test.dart +++ b/test/weight/weight_form_test.dart @@ -17,8 +17,8 @@ */ import 'package:flutter/material.dart'; -import 'package:flutter_gen/gen_l10n/app_localizations.dart'; import 'package:flutter_test/flutter_test.dart'; +import 'package:wger/l10n/generated/app_localizations.dart'; import 'package:wger/models/body_weight/weight_entry.dart'; import 'package:wger/widgets/weight/forms.dart'; diff --git a/test/weight/weight_provider_test.mocks.dart b/test/weight/weight_provider_test.mocks.dart index e0d8746b4..7b1bd5649 100644 --- a/test/weight/weight_provider_test.mocks.dart +++ b/test/weight/weight_provider_test.mocks.dart @@ -104,12 +104,10 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider { ) as Uri); @override - _i5.Future> fetch(Uri? uri) => (super.noSuchMethod( + _i5.Future fetch(Uri? uri) => (super.noSuchMethod( Invocation.method(#fetch, [uri]), - returnValue: _i5.Future>.value( - {}, - ), - ) as _i5.Future>); + returnValue: _i5.Future.value(), + ) as _i5.Future); @override _i5.Future> fetchPaginated(Uri? uri) => (super.noSuchMethod( diff --git a/test/weight/weight_screen_test.dart b/test/weight/weight_screen_test.dart index 43d8639e1..8c057a5b1 100644 --- a/test/weight/weight_screen_test.dart +++ b/test/weight/weight_screen_test.dart @@ -17,11 +17,11 @@ */ import 'package:flutter/material.dart'; -import 'package:flutter_gen/gen_l10n/app_localizations.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/annotations.dart'; import 'package:mockito/mockito.dart'; import 'package:provider/provider.dart'; +import 'package:wger/l10n/generated/app_localizations.dart'; import 'package:wger/providers/body_weight.dart'; import 'package:wger/providers/nutrition.dart'; import 'package:wger/providers/user.dart'; diff --git a/test/workout/day_form_test.dart b/test/workout/day_form_test.dart new file mode 100644 index 000000000..d0f399268 --- /dev/null +++ b/test/workout/day_form_test.dart @@ -0,0 +1,106 @@ +/* + * This file is part of wger Workout Manager . + * Copyright (C) 2020, 2021 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. + * + * wger Workout Manager is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +import 'package:flutter/material.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:mockito/annotations.dart'; +import 'package:mockito/mockito.dart'; +import 'package:provider/provider.dart'; +import 'package:wger/helpers/consts.dart'; +import 'package:wger/l10n/generated/app_localizations.dart'; +import 'package:wger/models/workouts/day.dart'; +import 'package:wger/providers/routines.dart'; +import 'package:wger/widgets/routines/forms/day.dart'; + +import '../../test_data/routines.dart'; +import 'routine_edit_test.mocks.dart'; + +@GenerateMocks([RoutinesProvider]) +void main() { + late MockRoutinesProvider mockRoutinesProvider; + + setUp(() { + mockRoutinesProvider = MockRoutinesProvider(); + when(mockRoutinesProvider.editDay(any)).thenAnswer((_) async => getTestRoutine().days[0]); + }); + + Widget renderWidget() { + return ChangeNotifierProvider.value( + value: mockRoutinesProvider, + child: MaterialApp( + locale: const Locale('en'), + localizationsDelegates: AppLocalizations.localizationsDelegates, + supportedLocales: AppLocalizations.supportedLocales, + home: Scaffold( + body: SingleChildScrollView( + child: DayFormWidget(routineId: 125, day: getTestRoutine().days[0]), + ), + ), + ), + ); + } + + group('DayFormWidget test', () { + testWidgets('Fields are disabled for rest days', (WidgetTester tester) async { + await tester.pumpWidget(renderWidget()); + await tester.pumpAndSettle(); + await tester.tap(find.byKey(const Key('field-is-rest-day'))); + await tester.pumpAndSettle(); + + final nameField = find.byKey(const Key('field-name')); + final TextFormField nameTextField = tester.widget(nameField); + expect(nameTextField.enabled, isFalse); + + final descriptionField = find.byKey(const Key('field-description')); + final TextFormField descriptionTextField = tester.widget(descriptionField); + expect(descriptionTextField.enabled, isFalse); + + final switchListTileFinder = find.byKey(const Key('field-need-logs-to-advance')); + final SwitchListTile switchListTile = tester.widget(switchListTileFinder); + expect(switchListTile.onChanged, isNull); + }); + + testWidgets('Call server', (WidgetTester tester) async { + await tester.pumpWidget(renderWidget()); + await tester.pumpAndSettle(); + + final nameField = find.byKey(const Key('field-name')); + await tester.enterText(nameField, ''); + await tester.enterText(nameField, 'Day 1'); + + final descriptionField = find.byKey(const Key('field-description')); + await tester.enterText(descriptionField, ''); + await tester.enterText(descriptionField, 'Day 1 description'); + + await tester.tap(find.byKey(const Key(SUBMIT_BUTTON_KEY_NAME))); + await tester.pumpAndSettle(); + + verify( + mockRoutinesProvider.editDay( + argThat( + isA() + .having((d) => d.routineId, 'routineId', 125) + .having((d) => d.id, 'id', 1) + .having((d) => d.name, 'name', 'Day 1') + .having((d) => d.description, 'description', 'Day 1 description'), + ), + ), + ); + }); + }); +} diff --git a/test/workout/day_form_test.mocks.dart b/test/workout/day_form_test.mocks.dart new file mode 100644 index 000000000..24b2ae302 --- /dev/null +++ b/test/workout/day_form_test.mocks.dart @@ -0,0 +1,509 @@ +// Mocks generated by Mockito 5.4.5 from annotations +// in wger/test/workout/day_form_test.dart. +// Do not manually edit this file. + +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'dart:async' as _i13; +import 'dart:ui' as _i16; + +import 'package:mockito/mockito.dart' as _i1; +import 'package:mockito/src/dummies.dart' as _i15; +import 'package:wger/models/workouts/base_config.dart' as _i9; +import 'package:wger/models/workouts/day.dart' as _i6; +import 'package:wger/models/workouts/day_data.dart' as _i14; +import 'package:wger/models/workouts/log.dart' as _i11; +import 'package:wger/models/workouts/repetition_unit.dart' as _i4; +import 'package:wger/models/workouts/routine.dart' as _i5; +import 'package:wger/models/workouts/session.dart' as _i10; +import 'package:wger/models/workouts/slot.dart' as _i7; +import 'package:wger/models/workouts/slot_entry.dart' as _i8; +import 'package:wger/models/workouts/weight_unit.dart' as _i3; +import 'package:wger/providers/base_provider.dart' as _i2; +import 'package:wger/providers/routines.dart' as _i12; + +// ignore_for_file: type=lint +// ignore_for_file: avoid_redundant_argument_values +// ignore_for_file: avoid_setters_without_getters +// ignore_for_file: comment_references +// ignore_for_file: deprecated_member_use +// ignore_for_file: deprecated_member_use_from_same_package +// ignore_for_file: implementation_imports +// ignore_for_file: invalid_use_of_visible_for_testing_member +// ignore_for_file: must_be_immutable +// ignore_for_file: prefer_const_constructors +// ignore_for_file: unnecessary_parenthesis +// ignore_for_file: camel_case_types +// ignore_for_file: subtype_of_sealed_class + +class _FakeWgerBaseProvider_0 extends _i1.SmartFake implements _i2.WgerBaseProvider { + _FakeWgerBaseProvider_0(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); +} + +class _FakeWeightUnit_1 extends _i1.SmartFake implements _i3.WeightUnit { + _FakeWeightUnit_1(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); +} + +class _FakeRepetitionUnit_2 extends _i1.SmartFake implements _i4.RepetitionUnit { + _FakeRepetitionUnit_2(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); +} + +class _FakeRoutine_3 extends _i1.SmartFake implements _i5.Routine { + _FakeRoutine_3(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); +} + +class _FakeDay_4 extends _i1.SmartFake implements _i6.Day { + _FakeDay_4(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); +} + +class _FakeSlot_5 extends _i1.SmartFake implements _i7.Slot { + _FakeSlot_5(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); +} + +class _FakeSlotEntry_6 extends _i1.SmartFake implements _i8.SlotEntry { + _FakeSlotEntry_6(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); +} + +class _FakeBaseConfig_7 extends _i1.SmartFake implements _i9.BaseConfig { + _FakeBaseConfig_7(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); +} + +class _FakeWorkoutSession_8 extends _i1.SmartFake implements _i10.WorkoutSession { + _FakeWorkoutSession_8(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); +} + +class _FakeLog_9 extends _i1.SmartFake implements _i11.Log { + _FakeLog_9(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); +} + +/// A class which mocks [RoutinesProvider]. +/// +/// See the documentation for Mockito's code generation for more information. +class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { + MockRoutinesProvider() { + _i1.throwOnMissingStub(this); + } + + @override + _i2.WgerBaseProvider get baseProvider => (super.noSuchMethod( + Invocation.getter(#baseProvider), + returnValue: _FakeWgerBaseProvider_0( + this, + Invocation.getter(#baseProvider), + ), + ) as _i2.WgerBaseProvider); + + @override + List<_i5.Routine> get items => (super.noSuchMethod( + Invocation.getter(#items), + returnValue: <_i5.Routine>[], + ) as List<_i5.Routine>); + + @override + List<_i3.WeightUnit> get weightUnits => (super.noSuchMethod( + Invocation.getter(#weightUnits), + returnValue: <_i3.WeightUnit>[], + ) as List<_i3.WeightUnit>); + + @override + set weightUnits(List<_i3.WeightUnit>? weightUnits) => super.noSuchMethod( + Invocation.setter(#weightUnits, weightUnits), + returnValueForMissingStub: null, + ); + + @override + _i3.WeightUnit get defaultWeightUnit => (super.noSuchMethod( + Invocation.getter(#defaultWeightUnit), + returnValue: _FakeWeightUnit_1( + this, + Invocation.getter(#defaultWeightUnit), + ), + ) as _i3.WeightUnit); + + @override + List<_i4.RepetitionUnit> get repetitionUnits => (super.noSuchMethod( + Invocation.getter(#repetitionUnits), + returnValue: <_i4.RepetitionUnit>[], + ) as List<_i4.RepetitionUnit>); + + @override + set repetitionUnits(List<_i4.RepetitionUnit>? repetitionUnits) => super.noSuchMethod( + Invocation.setter(#repetitionUnits, repetitionUnits), + returnValueForMissingStub: null, + ); + + @override + _i4.RepetitionUnit get defaultRepetitionUnit => (super.noSuchMethod( + Invocation.getter(#defaultRepetitionUnit), + returnValue: _FakeRepetitionUnit_2( + this, + Invocation.getter(#defaultRepetitionUnit), + ), + ) as _i4.RepetitionUnit); + + @override + bool get hasListeners => + (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) as bool); + + @override + void clear() => super.noSuchMethod( + Invocation.method(#clear, []), + returnValueForMissingStub: null, + ); + + @override + _i3.WeightUnit findWeightUnitById(int? id) => (super.noSuchMethod( + Invocation.method(#findWeightUnitById, [id]), + returnValue: _FakeWeightUnit_1( + this, + Invocation.method(#findWeightUnitById, [id]), + ), + ) as _i3.WeightUnit); + + @override + _i4.RepetitionUnit findRepetitionUnitById(int? id) => (super.noSuchMethod( + Invocation.method(#findRepetitionUnitById, [id]), + returnValue: _FakeRepetitionUnit_2( + this, + Invocation.method(#findRepetitionUnitById, [id]), + ), + ) as _i4.RepetitionUnit); + + @override + List<_i5.Routine> getPlans() => (super.noSuchMethod( + Invocation.method(#getPlans, []), + returnValue: <_i5.Routine>[], + ) as List<_i5.Routine>); + + @override + _i5.Routine findById(int? id) => (super.noSuchMethod( + Invocation.method(#findById, [id]), + returnValue: _FakeRoutine_3( + this, + Invocation.method(#findById, [id]), + ), + ) as _i5.Routine); + + @override + int findIndexById(int? id) => (super.noSuchMethod( + Invocation.method(#findIndexById, [id]), + returnValue: 0, + ) as int); + + @override + void setCurrentPlan(int? id) => super.noSuchMethod( + Invocation.method(#setCurrentPlan, [id]), + returnValueForMissingStub: null, + ); + + @override + void resetCurrentRoutine() => super.noSuchMethod( + Invocation.method(#resetCurrentRoutine, []), + returnValueForMissingStub: null, + ); + + @override + _i13.Future fetchAndSetAllRoutinesFull() => (super.noSuchMethod( + Invocation.method(#fetchAndSetAllRoutinesFull, []), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); + + @override + _i13.Future fetchAndSetAllPlansSparse() => (super.noSuchMethod( + Invocation.method(#fetchAndSetAllPlansSparse, []), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); + + @override + void setExercisesAndUnits(List<_i14.DayData>? entries) => super.noSuchMethod( + Invocation.method(#setExercisesAndUnits, [entries]), + returnValueForMissingStub: null, + ); + + @override + _i13.Future<_i5.Routine> fetchAndSetRoutineSparse(int? planId) => (super.noSuchMethod( + Invocation.method(#fetchAndSetRoutineSparse, [planId]), + returnValue: _i13.Future<_i5.Routine>.value( + _FakeRoutine_3( + this, + Invocation.method(#fetchAndSetRoutineSparse, [planId]), + ), + ), + ) as _i13.Future<_i5.Routine>); + + @override + _i13.Future<_i5.Routine> fetchAndSetRoutineFull(int? routineId) => (super.noSuchMethod( + Invocation.method(#fetchAndSetRoutineFull, [routineId]), + returnValue: _i13.Future<_i5.Routine>.value( + _FakeRoutine_3( + this, + Invocation.method(#fetchAndSetRoutineFull, [routineId]), + ), + ), + ) as _i13.Future<_i5.Routine>); + + @override + _i13.Future<_i5.Routine> addRoutine(_i5.Routine? routine) => (super.noSuchMethod( + Invocation.method(#addRoutine, [routine]), + returnValue: _i13.Future<_i5.Routine>.value( + _FakeRoutine_3(this, Invocation.method(#addRoutine, [routine])), + ), + ) as _i13.Future<_i5.Routine>); + + @override + _i13.Future editRoutine(_i5.Routine? routine) => (super.noSuchMethod( + Invocation.method(#editRoutine, [routine]), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); + + @override + _i13.Future deleteRoutine(int? id) => (super.noSuchMethod( + Invocation.method(#deleteRoutine, [id]), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); + + @override + _i13.Future fetchAndSetRepetitionUnits() => (super.noSuchMethod( + Invocation.method(#fetchAndSetRepetitionUnits, []), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); + + @override + _i13.Future fetchAndSetWeightUnits() => (super.noSuchMethod( + Invocation.method(#fetchAndSetWeightUnits, []), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); + + @override + _i13.Future fetchAndSetUnits() => (super.noSuchMethod( + Invocation.method(#fetchAndSetUnits, []), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); + + @override + _i13.Future<_i6.Day> addDay(_i6.Day? day) => (super.noSuchMethod( + Invocation.method(#addDay, [day]), + returnValue: _i13.Future<_i6.Day>.value( + _FakeDay_4(this, Invocation.method(#addDay, [day])), + ), + ) as _i13.Future<_i6.Day>); + + @override + _i13.Future editDay(_i6.Day? day) => (super.noSuchMethod( + Invocation.method(#editDay, [day]), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); + + @override + _i13.Future editDays(List<_i6.Day>? days) => (super.noSuchMethod( + Invocation.method(#editDays, [days]), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); + + @override + _i13.Future deleteDay(int? dayId) => (super.noSuchMethod( + Invocation.method(#deleteDay, [dayId]), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); + + @override + _i13.Future<_i7.Slot> addSlot(_i7.Slot? slot, int? routineId) => (super.noSuchMethod( + Invocation.method(#addSlot, [slot, routineId]), + returnValue: _i13.Future<_i7.Slot>.value( + _FakeSlot_5(this, Invocation.method(#addSlot, [slot, routineId])), + ), + ) as _i13.Future<_i7.Slot>); + + @override + _i13.Future deleteSlot(int? slotId, int? routineId) => (super.noSuchMethod( + Invocation.method(#deleteSlot, [slotId, routineId]), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); + + @override + _i13.Future editSlot(_i7.Slot? slot, int? routineId) => (super.noSuchMethod( + Invocation.method(#editSlot, [slot, routineId]), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); + + @override + _i13.Future editSlots(List<_i7.Slot>? slots, int? routineId) => (super.noSuchMethod( + Invocation.method(#editSlots, [slots, routineId]), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); + + @override + _i13.Future<_i8.SlotEntry> addSlotEntry( + _i8.SlotEntry? entry, + int? routineId, + ) => + (super.noSuchMethod( + Invocation.method(#addSlotEntry, [entry, routineId]), + returnValue: _i13.Future<_i8.SlotEntry>.value( + _FakeSlotEntry_6( + this, + Invocation.method(#addSlotEntry, [entry, routineId]), + ), + ), + ) as _i13.Future<_i8.SlotEntry>); + + @override + _i13.Future deleteSlotEntry(int? id, int? routineId) => (super.noSuchMethod( + Invocation.method(#deleteSlotEntry, [id, routineId]), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); + + @override + _i13.Future editSlotEntry(_i8.SlotEntry? entry, int? routineId) => (super.noSuchMethod( + Invocation.method(#editSlotEntry, [entry, routineId]), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); + + @override + String getConfigUrl(_i8.ConfigType? type) => (super.noSuchMethod( + Invocation.method(#getConfigUrl, [type]), + returnValue: _i15.dummyValue( + this, + Invocation.method(#getConfigUrl, [type]), + ), + ) as String); + + @override + _i13.Future<_i9.BaseConfig> editConfig( + _i9.BaseConfig? config, + _i8.ConfigType? type, + ) => + (super.noSuchMethod( + Invocation.method(#editConfig, [config, type]), + returnValue: _i13.Future<_i9.BaseConfig>.value( + _FakeBaseConfig_7( + this, + Invocation.method(#editConfig, [config, type]), + ), + ), + ) as _i13.Future<_i9.BaseConfig>); + + @override + _i13.Future<_i9.BaseConfig> addConfig( + _i9.BaseConfig? config, + _i8.ConfigType? type, + ) => + (super.noSuchMethod( + Invocation.method(#addConfig, [config, type]), + returnValue: _i13.Future<_i9.BaseConfig>.value( + _FakeBaseConfig_7( + this, + Invocation.method(#addConfig, [config, type]), + ), + ), + ) as _i13.Future<_i9.BaseConfig>); + + @override + _i13.Future deleteConfig(int? id, _i8.ConfigType? type) => (super.noSuchMethod( + Invocation.method(#deleteConfig, [id, type]), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); + + @override + _i13.Future handleConfig( + _i8.SlotEntry? entry, + String? input, + _i8.ConfigType? type, + ) => + (super.noSuchMethod( + Invocation.method(#handleConfig, [entry, input, type]), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); + + @override + _i13.Future> fetchSessionData() => (super.noSuchMethod( + Invocation.method(#fetchSessionData, []), + returnValue: _i13.Future>.value( + <_i10.WorkoutSession>[], + ), + ) as _i13.Future>); + + @override + _i13.Future<_i10.WorkoutSession> addSession( + _i10.WorkoutSession? session, + int? routineId, + ) => + (super.noSuchMethod( + Invocation.method(#addSession, [session, routineId]), + returnValue: _i13.Future<_i10.WorkoutSession>.value( + _FakeWorkoutSession_8( + this, + Invocation.method(#addSession, [session, routineId]), + ), + ), + ) as _i13.Future<_i10.WorkoutSession>); + + @override + _i13.Future<_i10.WorkoutSession> editSession(_i10.WorkoutSession? session) => (super.noSuchMethod( + Invocation.method(#editSession, [session]), + returnValue: _i13.Future<_i10.WorkoutSession>.value( + _FakeWorkoutSession_8( + this, + Invocation.method(#editSession, [session]), + ), + ), + ) as _i13.Future<_i10.WorkoutSession>); + + @override + _i13.Future<_i11.Log> addLog(_i11.Log? log) => (super.noSuchMethod( + Invocation.method(#addLog, [log]), + returnValue: _i13.Future<_i11.Log>.value( + _FakeLog_9(this, Invocation.method(#addLog, [log])), + ), + ) as _i13.Future<_i11.Log>); + + @override + _i13.Future deleteLog(_i11.Log? log) => (super.noSuchMethod( + Invocation.method(#deleteLog, [log]), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); + + @override + void addListener(_i16.VoidCallback? listener) => super.noSuchMethod( + Invocation.method(#addListener, [listener]), + returnValueForMissingStub: null, + ); + + @override + void removeListener(_i16.VoidCallback? listener) => super.noSuchMethod( + Invocation.method(#removeListener, [listener]), + returnValueForMissingStub: null, + ); + + @override + void dispose() => super.noSuchMethod( + Invocation.method(#dispose, []), + returnValueForMissingStub: null, + ); + + @override + void notifyListeners() => super.noSuchMethod( + Invocation.method(#notifyListeners, []), + returnValueForMissingStub: null, + ); +} diff --git a/test/workout/goldens/routine_logs_screen_detail.png b/test/workout/goldens/routine_logs_screen_detail.png new file mode 100644 index 000000000..0af52b65a Binary files /dev/null and b/test/workout/goldens/routine_logs_screen_detail.png differ diff --git a/test/workout/goldens/routine_screen_detail.png b/test/workout/goldens/routine_screen_detail.png new file mode 100644 index 000000000..5474be8ce Binary files /dev/null and b/test/workout/goldens/routine_screen_detail.png differ diff --git a/test/workout/gym_mode_screen_test.dart b/test/workout/gym_mode_screen_test.dart index 5175ef8da..f20df62c8 100644 --- a/test/workout/gym_mode_screen_test.dart +++ b/test/workout/gym_mode_screen_test.dart @@ -17,21 +17,28 @@ */ import 'package:flutter/material.dart'; -import 'package:flutter_gen/gen_l10n/app_localizations.dart'; +import 'package:flutter_riverpod/flutter_riverpod.dart' as riverpod; import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/annotations.dart'; import 'package:mockito/mockito.dart'; import 'package:provider/provider.dart'; +import 'package:wger/l10n/generated/app_localizations.dart'; import 'package:wger/providers/base_provider.dart'; import 'package:wger/providers/exercises.dart'; -import 'package:wger/providers/workout_plans.dart'; +import 'package:wger/providers/routines.dart'; import 'package:wger/screens/gym_mode.dart'; -import 'package:wger/screens/workout_plan_screen.dart'; -import 'package:wger/widgets/workouts/forms.dart'; -import 'package:wger/widgets/workouts/gym_mode.dart'; +import 'package:wger/screens/routine_screen.dart'; +import 'package:wger/widgets/routines/forms/reps_unit.dart'; +import 'package:wger/widgets/routines/forms/rir.dart'; +import 'package:wger/widgets/routines/forms/weight_unit.dart'; +import 'package:wger/widgets/routines/gym_mode/exercise_overview.dart'; +import 'package:wger/widgets/routines/gym_mode/log_page.dart'; +import 'package:wger/widgets/routines/gym_mode/session_page.dart'; +import 'package:wger/widgets/routines/gym_mode/start_page.dart'; +import 'package:wger/widgets/routines/gym_mode/timer.dart'; import '../../test_data/exercises.dart'; -import '../../test_data/workouts.dart'; +import '../../test_data/routines.dart'; import 'gym_mode_screen_test.mocks.dart'; @GenerateMocks([WgerBaseProvider, ExercisesProvider]) @@ -40,45 +47,47 @@ void main() { final key = GlobalKey(); final mockExerciseProvider = MockExercisesProvider(); - final workoutPlan = getWorkout(); - final bases = getTestExercises(); + final testRoutine = getTestRoutine(); + final testExercises = getTestExercises(); - Widget createHomeScreen({locale = 'en'}) { - return ChangeNotifierProvider( - create: (context) => WorkoutPlansProvider( + Widget renderGymMode({locale = 'en'}) { + return ChangeNotifierProvider( + create: (context) => RoutinesProvider( mockBaseProvider, mockExerciseProvider, - [workoutPlan], + [testRoutine], + repetitionUnits: testRepetitionUnits, + weightUnits: testWeightUnits, ), child: ChangeNotifierProvider( create: (context) => mockExerciseProvider, - child: MaterialApp( - locale: Locale(locale), - localizationsDelegates: AppLocalizations.localizationsDelegates, - supportedLocales: AppLocalizations.supportedLocales, - navigatorKey: key, - home: TextButton( - onPressed: () => key.currentState!.push( - MaterialPageRoute( - settings: RouteSettings(arguments: workoutPlan.days.first), - builder: (_) => const GymModeScreen(), + child: riverpod.ProviderScope( + child: MaterialApp( + locale: Locale(locale), + localizationsDelegates: AppLocalizations.localizationsDelegates, + supportedLocales: AppLocalizations.supportedLocales, + navigatorKey: key, + home: TextButton( + onPressed: () => key.currentState!.push( + MaterialPageRoute( + settings: const RouteSettings(arguments: GymModeArguments(1, 1, 1)), + builder: (_) => const GymModeScreen(), + ), ), + child: const SizedBox(), ), - child: const SizedBox(), + routes: {RoutineScreen.routeName: (ctx) => const RoutineScreen()}, ), - routes: { - WorkoutPlanScreen.routeName: (ctx) => const WorkoutPlanScreen(), - }, ), ), ); } testWidgets('Test the widgets on the gym mode screen', (WidgetTester tester) async { - when(mockExerciseProvider.findExerciseById(1)).thenReturn(bases[0]); - when(mockExerciseProvider.findExerciseById(6)).thenReturn(bases[5]); + when(mockExerciseProvider.findExerciseById(1)).thenReturn(testExercises[0]); + when(mockExerciseProvider.findExerciseById(6)).thenReturn(testExercises[5]); - await tester.pumpWidget(createHomeScreen()); + await tester.pumpWidget(renderGymMode()); await tester.tap(find.byType(TextButton)); await tester.pumpAndSettle(); @@ -143,7 +152,7 @@ void main() { // Bench press - pause // expect(find.text('Pause'), findsOneWidget); - expect(find.byType(TimerWidget), findsOneWidget); + expect(find.byType(TimerCountdownWidget), findsOneWidget); expect(find.byIcon(Icons.close), findsOneWidget); expect(find.byIcon(Icons.toc), findsOneWidget); expect(find.byIcon(Icons.chevron_left), findsOneWidget); @@ -164,7 +173,7 @@ void main() { // Pause // expect(find.text('Pause'), findsOneWidget); - expect(find.byType(TimerWidget), findsOneWidget); + expect(find.byType(TimerCountdownWidget), findsOneWidget); expect(find.byIcon(Icons.chevron_left), findsOneWidget); expect(find.byIcon(Icons.close), findsOneWidget); expect(find.byIcon(Icons.chevron_right), findsOneWidget); @@ -172,7 +181,24 @@ void main() { await tester.pumpAndSettle(); // - // Side raises - exercise overview page + // Bench press - log + // + expect(find.text('Bench press'), findsOneWidget); + expect(find.byType(LogPage), findsOneWidget); + expect(find.byType(Form), findsOneWidget); + await tester.tap(find.byIcon(Icons.chevron_right)); + await tester.pumpAndSettle(); + + // + // Pause + // + expect(find.text('Pause'), findsOneWidget); + expect(find.byType(TimerCountdownWidget), findsOneWidget); + await tester.tap(find.byIcon(Icons.chevron_right)); + await tester.pumpAndSettle(); + + // + // Side raises - overview // expect(find.text('Side raises'), findsOneWidget); expect(find.byType(ExerciseOverview), findsOneWidget); @@ -182,6 +208,7 @@ void main() { // // Side raises - log // + expect(find.text('Side raises'), findsOneWidget); expect(find.byType(LogPage), findsOneWidget); await tester.tap(find.byIcon(Icons.chevron_right)); await tester.pumpAndSettle(); @@ -196,6 +223,22 @@ void main() { // // Side raises - log // + expect(find.text('Side raises'), findsOneWidget); + expect(find.byType(LogPage), findsOneWidget); + await tester.tap(find.byIcon(Icons.chevron_right)); + await tester.pumpAndSettle(); + + // + // Side raises - timer + // + expect(find.byType(TimerWidget), findsOneWidget); + await tester.tap(find.byIcon(Icons.chevron_right)); + await tester.pumpAndSettle(); + + // + // Side raises - log + // + expect(find.text('Side raises'), findsOneWidget); expect(find.byType(LogPage), findsOneWidget); await tester.tap(find.byIcon(Icons.chevron_right)); await tester.pumpAndSettle(); diff --git a/test/workout/gym_mode_screen_test.mocks.dart b/test/workout/gym_mode_screen_test.mocks.dart index 54faf0899..f841ade96 100644 --- a/test/workout/gym_mode_screen_test.mocks.dart +++ b/test/workout/gym_mode_screen_test.mocks.dart @@ -143,12 +143,10 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider { ) as Uri); @override - _i11.Future> fetch(Uri? uri) => (super.noSuchMethod( + _i11.Future fetch(Uri? uri) => (super.noSuchMethod( Invocation.method(#fetch, [uri]), - returnValue: _i11.Future>.value( - {}, - ), - ) as _i11.Future>); + returnValue: _i11.Future.value(), + ) as _i11.Future); @override _i11.Future> fetchPaginated(Uri? uri) => (super.noSuchMethod( @@ -325,14 +323,14 @@ class MockExercisesProvider extends _i1.Mock implements _i12.ExercisesProvider { @override List<_i6.Exercise> findExercisesByVariationId( - int? id, { - int? exerciseBaseIdToExclude, + int? variationId, { + int? exerciseIdToExclude, }) => (super.noSuchMethod( Invocation.method( #findExercisesByVariationId, - [id], - {#exerciseBaseIdToExclude: exerciseBaseIdToExclude}, + [variationId], + {#exerciseIdToExclude: exerciseIdToExclude}, ), returnValue: <_i6.Exercise>[], ) as List<_i6.Exercise>); @@ -402,15 +400,10 @@ class MockExercisesProvider extends _i1.Mock implements _i12.ExercisesProvider { ) as _i11.Future); @override - _i11.Future<_i6.Exercise> fetchAndSetExercise(int? exerciseId) => (super.noSuchMethod( + _i11.Future<_i6.Exercise?> fetchAndSetExercise(int? exerciseId) => (super.noSuchMethod( Invocation.method(#fetchAndSetExercise, [exerciseId]), - returnValue: _i11.Future<_i6.Exercise>.value( - _FakeExercise_6( - this, - Invocation.method(#fetchAndSetExercise, [exerciseId]), - ), - ), - ) as _i11.Future<_i6.Exercise>); + returnValue: _i11.Future<_i6.Exercise?>.value(), + ) as _i11.Future<_i6.Exercise?>); @override _i11.Future<_i6.Exercise> handleUpdateExerciseFromApi( diff --git a/test/workout/repetition_unit_form_widget_test.dart b/test/workout/repetition_unit_form_widget_test.dart index 423860073..96f94b4bb 100644 --- a/test/workout/repetition_unit_form_widget_test.dart +++ b/test/workout/repetition_unit_form_widget_test.dart @@ -17,56 +17,61 @@ */ import 'package:flutter/material.dart'; -import 'package:flutter_gen/gen_l10n/app_localizations.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/annotations.dart'; import 'package:mockito/mockito.dart'; import 'package:provider/provider.dart'; +import 'package:wger/l10n/generated/app_localizations.dart'; import 'package:wger/models/workouts/repetition_unit.dart'; -import 'package:wger/models/workouts/setting.dart'; -import 'package:wger/providers/workout_plans.dart'; -import 'package:wger/screens/workout_plan_screen.dart'; -import 'package:wger/widgets/workouts/forms.dart'; +import 'package:wger/models/workouts/slot_entry.dart'; +import 'package:wger/providers/routines.dart'; +import 'package:wger/screens/routine_screen.dart'; +import 'package:wger/widgets/routines/forms/reps_unit.dart'; import 'repetition_unit_form_widget_test.mocks.dart'; -@GenerateMocks([WorkoutPlansProvider]) +@GenerateMocks([RoutinesProvider]) void main() { - var mockWorkoutPlans = MockWorkoutPlansProvider(); - + var mockWorkoutPlans = MockRoutinesProvider(); const unit1 = RepetitionUnit(id: 1, name: 'some rep unit'); const unit2 = RepetitionUnit(id: 2, name: 'another name'); const unit3 = RepetitionUnit(id: 3, name: 'this is repetition number 3'); - final setting1 = Setting( - setId: 1, + int? result; + + final slotEntry = SlotEntry( + slotId: 1, + type: 'normal', order: 1, exerciseId: 1, repetitionUnitId: 1, - reps: 2, + repetitionRounding: 0.25, weightUnitId: 1, + weightRounding: 0.25, comment: 'comment', - rir: '1', ); - setting1.repetitionUnitObj = unit1; + slotEntry.repetitionUnitObj = unit1; setUp(() { - mockWorkoutPlans = MockWorkoutPlansProvider(); + mockWorkoutPlans = MockRoutinesProvider(); + result = null; when(mockWorkoutPlans.repetitionUnits).thenAnswer((_) => [unit1, unit2, unit3]); + when(mockWorkoutPlans.findRepetitionUnitById(1)).thenReturn(unit1); + when(mockWorkoutPlans.findRepetitionUnitById(2)).thenReturn(unit2); }); - Widget createHomeScreen() { + Widget renderWidget() { final key = GlobalKey(); - return ChangeNotifierProvider( + return ChangeNotifierProvider( create: (context) => mockWorkoutPlans, child: MaterialApp( localizationsDelegates: AppLocalizations.localizationsDelegates, supportedLocales: AppLocalizations.supportedLocales, navigatorKey: key, - home: Scaffold(body: RepetitionUnitInputWidget(setting1)), + home: Scaffold(body: RepetitionUnitInputWidget(1, onChanged: (value) => result = value)), routes: { - WorkoutPlanScreen.routeName: (ctx) => const WorkoutPlanScreen(), + RoutineScreen.routeName: (ctx) => const RoutineScreen(), }, ), ); @@ -74,7 +79,7 @@ void main() { testWidgets('Test that the entries are shown', (WidgetTester tester) async { // arrange - await tester.pumpWidget(createHomeScreen()); + await tester.pumpWidget(renderWidget()); await tester.tap(find.byKey(const Key('1'))); await tester.pump(); @@ -86,16 +91,15 @@ void main() { testWidgets('Test that the correct units are set after selection', (WidgetTester tester) async { // arrange - await tester.pumpWidget(createHomeScreen()); + await tester.pumpWidget(renderWidget()); await tester.pump(); // act - expect(setting1.repetitionUnitObj, equals(unit1)); await tester.tap(find.byKey(const Key('1'))); await tester.pump(); await tester.tap(find.text('another name').last); // assert - expect(setting1.repetitionUnitObj, equals(unit2)); + expect(result, equals(2)); }); } diff --git a/test/workout/repetition_unit_form_widget_test.mocks.dart b/test/workout/repetition_unit_form_widget_test.mocks.dart index ec0569c53..2f5d7e781 100644 --- a/test/workout/repetition_unit_form_widget_test.mocks.dart +++ b/test/workout/repetition_unit_form_widget_test.mocks.dart @@ -3,23 +3,23 @@ // Do not manually edit this file. // ignore_for_file: no_leading_underscores_for_library_prefixes -import 'dart:async' as _i12; +import 'dart:async' as _i13; import 'dart:ui' as _i16; import 'package:mockito/mockito.dart' as _i1; import 'package:mockito/src/dummies.dart' as _i15; -import 'package:wger/models/exercises/exercise.dart' as _i13; -import 'package:wger/models/exercises/translation.dart' as _i14; +import 'package:wger/models/workouts/base_config.dart' as _i9; import 'package:wger/models/workouts/day.dart' as _i6; -import 'package:wger/models/workouts/log.dart' as _i10; +import 'package:wger/models/workouts/day_data.dart' as _i14; +import 'package:wger/models/workouts/log.dart' as _i11; import 'package:wger/models/workouts/repetition_unit.dart' as _i4; -import 'package:wger/models/workouts/session.dart' as _i9; -import 'package:wger/models/workouts/set.dart' as _i7; -import 'package:wger/models/workouts/setting.dart' as _i8; +import 'package:wger/models/workouts/routine.dart' as _i5; +import 'package:wger/models/workouts/session.dart' as _i10; +import 'package:wger/models/workouts/slot.dart' as _i7; +import 'package:wger/models/workouts/slot_entry.dart' as _i8; import 'package:wger/models/workouts/weight_unit.dart' as _i3; -import 'package:wger/models/workouts/workout_plan.dart' as _i5; import 'package:wger/providers/base_provider.dart' as _i2; -import 'package:wger/providers/workout_plans.dart' as _i11; +import 'package:wger/providers/routines.dart' as _i12; // ignore_for_file: type=lint // ignore_for_file: avoid_redundant_argument_values @@ -49,36 +49,40 @@ class _FakeRepetitionUnit_2 extends _i1.SmartFake implements _i4.RepetitionUnit : super(parent, parentInvocation); } -class _FakeWorkoutPlan_3 extends _i1.SmartFake implements _i5.WorkoutPlan { - _FakeWorkoutPlan_3(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); +class _FakeRoutine_3 extends _i1.SmartFake implements _i5.Routine { + _FakeRoutine_3(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } class _FakeDay_4 extends _i1.SmartFake implements _i6.Day { _FakeDay_4(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } -class _FakeSet_5 extends _i1.SmartFake implements _i7.Set { - _FakeSet_5(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); +class _FakeSlot_5 extends _i1.SmartFake implements _i7.Slot { + _FakeSlot_5(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } -class _FakeSetting_6 extends _i1.SmartFake implements _i8.Setting { - _FakeSetting_6(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); +class _FakeSlotEntry_6 extends _i1.SmartFake implements _i8.SlotEntry { + _FakeSlotEntry_6(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } -class _FakeWorkoutSession_7 extends _i1.SmartFake implements _i9.WorkoutSession { - _FakeWorkoutSession_7(Object parent, Invocation parentInvocation) +class _FakeBaseConfig_7 extends _i1.SmartFake implements _i9.BaseConfig { + _FakeBaseConfig_7(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); +} + +class _FakeWorkoutSession_8 extends _i1.SmartFake implements _i10.WorkoutSession { + _FakeWorkoutSession_8(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } -class _FakeLog_8 extends _i1.SmartFake implements _i10.Log { - _FakeLog_8(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); +class _FakeLog_9 extends _i1.SmartFake implements _i11.Log { + _FakeLog_9(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } -/// A class which mocks [WorkoutPlansProvider]. +/// A class which mocks [RoutinesProvider]. /// /// See the documentation for Mockito's code generation for more information. -class MockWorkoutPlansProvider extends _i1.Mock implements _i11.WorkoutPlansProvider { - MockWorkoutPlansProvider() { +class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { + MockRoutinesProvider() { _i1.throwOnMissingStub(this); } @@ -92,10 +96,10 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i11.WorkoutPlansProv ) as _i2.WgerBaseProvider); @override - List<_i5.WorkoutPlan> get items => (super.noSuchMethod( + List<_i5.Routine> get items => (super.noSuchMethod( Invocation.getter(#items), - returnValue: <_i5.WorkoutPlan>[], - ) as List<_i5.WorkoutPlan>); + returnValue: <_i5.Routine>[], + ) as List<_i5.Routine>); @override List<_i3.WeightUnit> get weightUnits => (super.noSuchMethod( @@ -103,6 +107,12 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i11.WorkoutPlansProv returnValue: <_i3.WeightUnit>[], ) as List<_i3.WeightUnit>); + @override + set weightUnits(List<_i3.WeightUnit>? weightUnits) => super.noSuchMethod( + Invocation.setter(#weightUnits, weightUnits), + returnValueForMissingStub: null, + ); + @override _i3.WeightUnit get defaultWeightUnit => (super.noSuchMethod( Invocation.getter(#defaultWeightUnit), @@ -118,6 +128,12 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i11.WorkoutPlansProv returnValue: <_i4.RepetitionUnit>[], ) as List<_i4.RepetitionUnit>); + @override + set repetitionUnits(List<_i4.RepetitionUnit>? repetitionUnits) => super.noSuchMethod( + Invocation.setter(#repetitionUnits, repetitionUnits), + returnValueForMissingStub: null, + ); + @override _i4.RepetitionUnit get defaultRepetitionUnit => (super.noSuchMethod( Invocation.getter(#defaultRepetitionUnit), @@ -138,19 +154,37 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i11.WorkoutPlansProv ); @override - List<_i5.WorkoutPlan> getPlans() => (super.noSuchMethod( - Invocation.method(#getPlans, []), - returnValue: <_i5.WorkoutPlan>[], - ) as List<_i5.WorkoutPlan>); + _i3.WeightUnit findWeightUnitById(int? id) => (super.noSuchMethod( + Invocation.method(#findWeightUnitById, [id]), + returnValue: _FakeWeightUnit_1( + this, + Invocation.method(#findWeightUnitById, [id]), + ), + ) as _i3.WeightUnit); @override - _i5.WorkoutPlan findById(int? id) => (super.noSuchMethod( + _i4.RepetitionUnit findRepetitionUnitById(int? id) => (super.noSuchMethod( + Invocation.method(#findRepetitionUnitById, [id]), + returnValue: _FakeRepetitionUnit_2( + this, + Invocation.method(#findRepetitionUnitById, [id]), + ), + ) as _i4.RepetitionUnit); + + @override + List<_i5.Routine> getPlans() => (super.noSuchMethod( + Invocation.method(#getPlans, []), + returnValue: <_i5.Routine>[], + ) as List<_i5.Routine>); + + @override + _i5.Routine findById(int? id) => (super.noSuchMethod( Invocation.method(#findById, [id]), - returnValue: _FakeWorkoutPlan_3( + returnValue: _FakeRoutine_3( this, Invocation.method(#findById, [id]), ), - ) as _i5.WorkoutPlan); + ) as _i5.Routine); @override int findIndexById(int? id) => (super.noSuchMethod( @@ -165,223 +199,289 @@ class MockWorkoutPlansProvider extends _i1.Mock implements _i11.WorkoutPlansProv ); @override - void resetCurrentPlan() => super.noSuchMethod( - Invocation.method(#resetCurrentPlan, []), + void resetCurrentRoutine() => super.noSuchMethod( + Invocation.method(#resetCurrentRoutine, []), returnValueForMissingStub: null, ); @override - _i12.Future fetchAndSetAllPlansFull() => (super.noSuchMethod( - Invocation.method(#fetchAndSetAllPlansFull, []), - returnValue: _i12.Future.value(), - returnValueForMissingStub: _i12.Future.value(), - ) as _i12.Future); + _i13.Future fetchAndSetAllRoutinesFull() => (super.noSuchMethod( + Invocation.method(#fetchAndSetAllRoutinesFull, []), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); @override - _i12.Future fetchAndSetAllPlansSparse() => (super.noSuchMethod( + _i13.Future fetchAndSetAllPlansSparse() => (super.noSuchMethod( Invocation.method(#fetchAndSetAllPlansSparse, []), - returnValue: _i12.Future.value(), - returnValueForMissingStub: _i12.Future.value(), - ) as _i12.Future); + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); @override - _i12.Future<_i5.WorkoutPlan> fetchAndSetPlanSparse(int? planId) => (super.noSuchMethod( - Invocation.method(#fetchAndSetPlanSparse, [planId]), - returnValue: _i12.Future<_i5.WorkoutPlan>.value( - _FakeWorkoutPlan_3( + void setExercisesAndUnits(List<_i14.DayData>? entries) => super.noSuchMethod( + Invocation.method(#setExercisesAndUnits, [entries]), + returnValueForMissingStub: null, + ); + + @override + _i13.Future<_i5.Routine> fetchAndSetRoutineSparse(int? planId) => (super.noSuchMethod( + Invocation.method(#fetchAndSetRoutineSparse, [planId]), + returnValue: _i13.Future<_i5.Routine>.value( + _FakeRoutine_3( this, - Invocation.method(#fetchAndSetPlanSparse, [planId]), + Invocation.method(#fetchAndSetRoutineSparse, [planId]), ), ), - ) as _i12.Future<_i5.WorkoutPlan>); + ) as _i13.Future<_i5.Routine>); @override - _i12.Future<_i5.WorkoutPlan> fetchAndSetWorkoutPlanFull(int? workoutId) => (super.noSuchMethod( - Invocation.method(#fetchAndSetWorkoutPlanFull, [workoutId]), - returnValue: _i12.Future<_i5.WorkoutPlan>.value( - _FakeWorkoutPlan_3( + _i13.Future<_i5.Routine> fetchAndSetRoutineFull(int? routineId) => (super.noSuchMethod( + Invocation.method(#fetchAndSetRoutineFull, [routineId]), + returnValue: _i13.Future<_i5.Routine>.value( + _FakeRoutine_3( this, - Invocation.method(#fetchAndSetWorkoutPlanFull, [workoutId]), + Invocation.method(#fetchAndSetRoutineFull, [routineId]), ), ), - ) as _i12.Future<_i5.WorkoutPlan>); + ) as _i13.Future<_i5.Routine>); @override - _i12.Future<_i5.WorkoutPlan> addWorkout(_i5.WorkoutPlan? workout) => (super.noSuchMethod( - Invocation.method(#addWorkout, [workout]), - returnValue: _i12.Future<_i5.WorkoutPlan>.value( - _FakeWorkoutPlan_3( - this, - Invocation.method(#addWorkout, [workout]), - ), + _i13.Future<_i5.Routine> addRoutine(_i5.Routine? routine) => (super.noSuchMethod( + Invocation.method(#addRoutine, [routine]), + returnValue: _i13.Future<_i5.Routine>.value( + _FakeRoutine_3(this, Invocation.method(#addRoutine, [routine])), ), - ) as _i12.Future<_i5.WorkoutPlan>); + ) as _i13.Future<_i5.Routine>); @override - _i12.Future editWorkout(_i5.WorkoutPlan? workout) => (super.noSuchMethod( - Invocation.method(#editWorkout, [workout]), - returnValue: _i12.Future.value(), - returnValueForMissingStub: _i12.Future.value(), - ) as _i12.Future); + _i13.Future editRoutine(_i5.Routine? routine) => (super.noSuchMethod( + Invocation.method(#editRoutine, [routine]), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); @override - _i12.Future deleteWorkout(int? id) => (super.noSuchMethod( - Invocation.method(#deleteWorkout, [id]), - returnValue: _i12.Future.value(), - returnValueForMissingStub: _i12.Future.value(), - ) as _i12.Future); + _i13.Future deleteRoutine(int? id) => (super.noSuchMethod( + Invocation.method(#deleteRoutine, [id]), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); @override - _i12.Future> fetchLogData( - _i5.WorkoutPlan? workout, - _i13.Exercise? base, - ) => - (super.noSuchMethod( - Invocation.method(#fetchLogData, [workout, base]), - returnValue: _i12.Future>.value( - {}, - ), - ) as _i12.Future>); - - @override - _i12.Future fetchAndSetRepetitionUnits() => (super.noSuchMethod( + _i13.Future fetchAndSetRepetitionUnits() => (super.noSuchMethod( Invocation.method(#fetchAndSetRepetitionUnits, []), - returnValue: _i12.Future.value(), - returnValueForMissingStub: _i12.Future.value(), - ) as _i12.Future); + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); @override - _i12.Future fetchAndSetWeightUnits() => (super.noSuchMethod( + _i13.Future fetchAndSetWeightUnits() => (super.noSuchMethod( Invocation.method(#fetchAndSetWeightUnits, []), - returnValue: _i12.Future.value(), - returnValueForMissingStub: _i12.Future.value(), - ) as _i12.Future); + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); @override - _i12.Future fetchAndSetUnits() => (super.noSuchMethod( + _i13.Future fetchAndSetUnits() => (super.noSuchMethod( Invocation.method(#fetchAndSetUnits, []), - returnValue: _i12.Future.value(), - returnValueForMissingStub: _i12.Future.value(), - ) as _i12.Future); + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); @override - _i12.Future<_i6.Day> addDay(_i6.Day? day, _i5.WorkoutPlan? workout) => (super.noSuchMethod( - Invocation.method(#addDay, [day, workout]), - returnValue: _i12.Future<_i6.Day>.value( - _FakeDay_4(this, Invocation.method(#addDay, [day, workout])), + _i13.Future<_i6.Day> addDay(_i6.Day? day) => (super.noSuchMethod( + Invocation.method(#addDay, [day]), + returnValue: _i13.Future<_i6.Day>.value( + _FakeDay_4(this, Invocation.method(#addDay, [day])), ), - ) as _i12.Future<_i6.Day>); + ) as _i13.Future<_i6.Day>); @override - _i12.Future editDay(_i6.Day? day) => (super.noSuchMethod( + _i13.Future editDay(_i6.Day? day) => (super.noSuchMethod( Invocation.method(#editDay, [day]), - returnValue: _i12.Future.value(), - returnValueForMissingStub: _i12.Future.value(), - ) as _i12.Future); + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); @override - _i12.Future deleteDay(_i6.Day? day) => (super.noSuchMethod( - Invocation.method(#deleteDay, [day]), - returnValue: _i12.Future.value(), - returnValueForMissingStub: _i12.Future.value(), - ) as _i12.Future); + _i13.Future editDays(List<_i6.Day>? days) => (super.noSuchMethod( + Invocation.method(#editDays, [days]), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); @override - _i12.Future<_i7.Set> addSet(_i7.Set? workoutSet) => (super.noSuchMethod( - Invocation.method(#addSet, [workoutSet]), - returnValue: _i12.Future<_i7.Set>.value( - _FakeSet_5(this, Invocation.method(#addSet, [workoutSet])), + _i13.Future deleteDay(int? dayId) => (super.noSuchMethod( + Invocation.method(#deleteDay, [dayId]), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); + + @override + _i13.Future<_i7.Slot> addSlot(_i7.Slot? slot, int? routineId) => (super.noSuchMethod( + Invocation.method(#addSlot, [slot, routineId]), + returnValue: _i13.Future<_i7.Slot>.value( + _FakeSlot_5(this, Invocation.method(#addSlot, [slot, routineId])), ), - ) as _i12.Future<_i7.Set>); + ) as _i13.Future<_i7.Slot>); @override - _i12.Future editSet(_i7.Set? workoutSet) => (super.noSuchMethod( - Invocation.method(#editSet, [workoutSet]), - returnValue: _i12.Future.value(), - returnValueForMissingStub: _i12.Future.value(), - ) as _i12.Future); + _i13.Future deleteSlot(int? slotId, int? routineId) => (super.noSuchMethod( + Invocation.method(#deleteSlot, [slotId, routineId]), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); @override - _i12.Future> reorderSets( - List<_i7.Set>? sets, - int? startIndex, + _i13.Future editSlot(_i7.Slot? slot, int? routineId) => (super.noSuchMethod( + Invocation.method(#editSlot, [slot, routineId]), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); + + @override + _i13.Future editSlots(List<_i7.Slot>? slots, int? routineId) => (super.noSuchMethod( + Invocation.method(#editSlots, [slots, routineId]), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); + + @override + _i13.Future<_i8.SlotEntry> addSlotEntry( + _i8.SlotEntry? entry, + int? routineId, ) => (super.noSuchMethod( - Invocation.method(#reorderSets, [sets, startIndex]), - returnValue: _i12.Future>.value(<_i7.Set>[]), - ) as _i12.Future>); + Invocation.method(#addSlotEntry, [entry, routineId]), + returnValue: _i13.Future<_i8.SlotEntry>.value( + _FakeSlotEntry_6( + this, + Invocation.method(#addSlotEntry, [entry, routineId]), + ), + ), + ) as _i13.Future<_i8.SlotEntry>); @override - _i12.Future fetchComputedSettings(_i7.Set? workoutSet) => (super.noSuchMethod( - Invocation.method(#fetchComputedSettings, [workoutSet]), - returnValue: _i12.Future.value(), - returnValueForMissingStub: _i12.Future.value(), - ) as _i12.Future); + _i13.Future deleteSlotEntry(int? id, int? routineId) => (super.noSuchMethod( + Invocation.method(#deleteSlotEntry, [id, routineId]), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); @override - _i12.Future fetchSmartText( - _i7.Set? workoutSet, - _i14.Translation? exercise, + _i13.Future editSlotEntry(_i8.SlotEntry? entry, int? routineId) => (super.noSuchMethod( + Invocation.method(#editSlotEntry, [entry, routineId]), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); + + @override + String getConfigUrl(_i8.ConfigType? type) => (super.noSuchMethod( + Invocation.method(#getConfigUrl, [type]), + returnValue: _i15.dummyValue( + this, + Invocation.method(#getConfigUrl, [type]), + ), + ) as String); + + @override + _i13.Future<_i9.BaseConfig> editConfig( + _i9.BaseConfig? config, + _i8.ConfigType? type, ) => (super.noSuchMethod( - Invocation.method(#fetchSmartText, [workoutSet, exercise]), - returnValue: _i12.Future.value( - _i15.dummyValue( + Invocation.method(#editConfig, [config, type]), + returnValue: _i13.Future<_i9.BaseConfig>.value( + _FakeBaseConfig_7( this, - Invocation.method(#fetchSmartText, [workoutSet, exercise]), + Invocation.method(#editConfig, [config, type]), ), ), - ) as _i12.Future); + ) as _i13.Future<_i9.BaseConfig>); @override - _i12.Future deleteSet(_i7.Set? workoutSet) => (super.noSuchMethod( - Invocation.method(#deleteSet, [workoutSet]), - returnValue: _i12.Future.value(), - returnValueForMissingStub: _i12.Future.value(), - ) as _i12.Future); - - @override - _i12.Future<_i8.Setting> addSetting(_i8.Setting? workoutSetting) => (super.noSuchMethod( - Invocation.method(#addSetting, [workoutSetting]), - returnValue: _i12.Future<_i8.Setting>.value( - _FakeSetting_6( + _i13.Future<_i9.BaseConfig> addConfig( + _i9.BaseConfig? config, + _i8.ConfigType? type, + ) => + (super.noSuchMethod( + Invocation.method(#addConfig, [config, type]), + returnValue: _i13.Future<_i9.BaseConfig>.value( + _FakeBaseConfig_7( this, - Invocation.method(#addSetting, [workoutSetting]), + Invocation.method(#addConfig, [config, type]), ), ), - ) as _i12.Future<_i8.Setting>); + ) as _i13.Future<_i9.BaseConfig>); @override - _i12.Future fetchSessionData() => (super.noSuchMethod( + _i13.Future deleteConfig(int? id, _i8.ConfigType? type) => (super.noSuchMethod( + Invocation.method(#deleteConfig, [id, type]), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); + + @override + _i13.Future handleConfig( + _i8.SlotEntry? entry, + String? input, + _i8.ConfigType? type, + ) => + (super.noSuchMethod( + Invocation.method(#handleConfig, [entry, input, type]), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); + + @override + _i13.Future> fetchSessionData() => (super.noSuchMethod( Invocation.method(#fetchSessionData, []), - returnValue: _i12.Future.value(), - ) as _i12.Future); + returnValue: _i13.Future>.value( + <_i10.WorkoutSession>[], + ), + ) as _i13.Future>); @override - _i12.Future<_i9.WorkoutSession> addSession(_i9.WorkoutSession? session) => (super.noSuchMethod( - Invocation.method(#addSession, [session]), - returnValue: _i12.Future<_i9.WorkoutSession>.value( - _FakeWorkoutSession_7( + _i13.Future<_i10.WorkoutSession> addSession( + _i10.WorkoutSession? session, + int? routineId, + ) => + (super.noSuchMethod( + Invocation.method(#addSession, [session, routineId]), + returnValue: _i13.Future<_i10.WorkoutSession>.value( + _FakeWorkoutSession_8( this, - Invocation.method(#addSession, [session]), + Invocation.method(#addSession, [session, routineId]), ), ), - ) as _i12.Future<_i9.WorkoutSession>); + ) as _i13.Future<_i10.WorkoutSession>); @override - _i12.Future<_i10.Log> addLog(_i10.Log? log) => (super.noSuchMethod( - Invocation.method(#addLog, [log]), - returnValue: _i12.Future<_i10.Log>.value( - _FakeLog_8(this, Invocation.method(#addLog, [log])), + _i13.Future<_i10.WorkoutSession> editSession(_i10.WorkoutSession? session) => (super.noSuchMethod( + Invocation.method(#editSession, [session]), + returnValue: _i13.Future<_i10.WorkoutSession>.value( + _FakeWorkoutSession_8( + this, + Invocation.method(#editSession, [session]), + ), ), - ) as _i12.Future<_i10.Log>); + ) as _i13.Future<_i10.WorkoutSession>); @override - _i12.Future deleteLog(_i10.Log? log) => (super.noSuchMethod( + _i13.Future<_i11.Log> addLog(_i11.Log? log) => (super.noSuchMethod( + Invocation.method(#addLog, [log]), + returnValue: _i13.Future<_i11.Log>.value( + _FakeLog_9(this, Invocation.method(#addLog, [log])), + ), + ) as _i13.Future<_i11.Log>); + + @override + _i13.Future deleteLog(_i11.Log? log) => (super.noSuchMethod( Invocation.method(#deleteLog, [log]), - returnValue: _i12.Future.value(), - returnValueForMissingStub: _i12.Future.value(), - ) as _i12.Future); + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); @override void addListener(_i16.VoidCallback? listener) => super.noSuchMethod( diff --git a/test/workout/routine_edit_screen_test.dart b/test/workout/routine_edit_screen_test.dart new file mode 100644 index 000000000..2341a61b5 --- /dev/null +++ b/test/workout/routine_edit_screen_test.dart @@ -0,0 +1,72 @@ +/* + * This file is part of wger Workout Manager . + * Copyright (C) 2020, 2021 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. + * + * wger Workout Manager is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +import 'package:flutter/material.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:mockito/annotations.dart'; +import 'package:mockito/mockito.dart'; +import 'package:provider/provider.dart'; +import 'package:wger/l10n/generated/app_localizations.dart'; +import 'package:wger/providers/routines.dart'; +import 'package:wger/screens/routine_edit_screen.dart'; + +import '../../test_data/routines.dart'; +import 'routine_edit_screen_test.mocks.dart'; + +@GenerateMocks([RoutinesProvider]) +void main() { + final key = GlobalKey(); + + testWidgets('RoutineEditScreen smoke test', (WidgetTester tester) async { + // Create a mock RoutinesProvider + final mockRoutinesProvider = MockRoutinesProvider(); + when(mockRoutinesProvider.fetchAndSetRoutineFull(1)).thenAnswer((_) async => getTestRoutine()); + when(mockRoutinesProvider.findById(1)).thenReturn(getTestRoutine()); + + // Build the RoutineEditScreen widget with the correct arguments + await tester.pumpWidget( + ChangeNotifierProvider.value( + value: mockRoutinesProvider, + child: MaterialApp( + locale: const Locale('en'), + localizationsDelegates: AppLocalizations.localizationsDelegates, + supportedLocales: AppLocalizations.supportedLocales, + navigatorKey: key, + home: TextButton( + onPressed: () => key.currentState!.push( + MaterialPageRoute( + settings: const RouteSettings(arguments: 1), + builder: (_) => const RoutineEditScreen(), + ), + ), + child: const SizedBox(), + ), + ), + ), + ); + + // Navigate to RoutineEditScreen with the correct arguments + await tester.pumpAndSettle(); + await tester.tap(find.byType(TextButton)); + await tester.pumpAndSettle(); + + // Verify the title is correct + verify(mockRoutinesProvider.findById(1)); + expect(find.text('3 day workout'), findsNWidgets(2)); + }); +} diff --git a/test/workout/routine_edit_screen_test.mocks.dart b/test/workout/routine_edit_screen_test.mocks.dart new file mode 100644 index 000000000..9ad52bf3f --- /dev/null +++ b/test/workout/routine_edit_screen_test.mocks.dart @@ -0,0 +1,509 @@ +// Mocks generated by Mockito 5.4.5 from annotations +// in wger/test/workout/routine_edit_screen_test.dart. +// Do not manually edit this file. + +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'dart:async' as _i13; +import 'dart:ui' as _i16; + +import 'package:mockito/mockito.dart' as _i1; +import 'package:mockito/src/dummies.dart' as _i15; +import 'package:wger/models/workouts/base_config.dart' as _i9; +import 'package:wger/models/workouts/day.dart' as _i6; +import 'package:wger/models/workouts/day_data.dart' as _i14; +import 'package:wger/models/workouts/log.dart' as _i11; +import 'package:wger/models/workouts/repetition_unit.dart' as _i4; +import 'package:wger/models/workouts/routine.dart' as _i5; +import 'package:wger/models/workouts/session.dart' as _i10; +import 'package:wger/models/workouts/slot.dart' as _i7; +import 'package:wger/models/workouts/slot_entry.dart' as _i8; +import 'package:wger/models/workouts/weight_unit.dart' as _i3; +import 'package:wger/providers/base_provider.dart' as _i2; +import 'package:wger/providers/routines.dart' as _i12; + +// ignore_for_file: type=lint +// ignore_for_file: avoid_redundant_argument_values +// ignore_for_file: avoid_setters_without_getters +// ignore_for_file: comment_references +// ignore_for_file: deprecated_member_use +// ignore_for_file: deprecated_member_use_from_same_package +// ignore_for_file: implementation_imports +// ignore_for_file: invalid_use_of_visible_for_testing_member +// ignore_for_file: must_be_immutable +// ignore_for_file: prefer_const_constructors +// ignore_for_file: unnecessary_parenthesis +// ignore_for_file: camel_case_types +// ignore_for_file: subtype_of_sealed_class + +class _FakeWgerBaseProvider_0 extends _i1.SmartFake implements _i2.WgerBaseProvider { + _FakeWgerBaseProvider_0(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); +} + +class _FakeWeightUnit_1 extends _i1.SmartFake implements _i3.WeightUnit { + _FakeWeightUnit_1(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); +} + +class _FakeRepetitionUnit_2 extends _i1.SmartFake implements _i4.RepetitionUnit { + _FakeRepetitionUnit_2(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); +} + +class _FakeRoutine_3 extends _i1.SmartFake implements _i5.Routine { + _FakeRoutine_3(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); +} + +class _FakeDay_4 extends _i1.SmartFake implements _i6.Day { + _FakeDay_4(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); +} + +class _FakeSlot_5 extends _i1.SmartFake implements _i7.Slot { + _FakeSlot_5(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); +} + +class _FakeSlotEntry_6 extends _i1.SmartFake implements _i8.SlotEntry { + _FakeSlotEntry_6(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); +} + +class _FakeBaseConfig_7 extends _i1.SmartFake implements _i9.BaseConfig { + _FakeBaseConfig_7(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); +} + +class _FakeWorkoutSession_8 extends _i1.SmartFake implements _i10.WorkoutSession { + _FakeWorkoutSession_8(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); +} + +class _FakeLog_9 extends _i1.SmartFake implements _i11.Log { + _FakeLog_9(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); +} + +/// A class which mocks [RoutinesProvider]. +/// +/// See the documentation for Mockito's code generation for more information. +class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { + MockRoutinesProvider() { + _i1.throwOnMissingStub(this); + } + + @override + _i2.WgerBaseProvider get baseProvider => (super.noSuchMethod( + Invocation.getter(#baseProvider), + returnValue: _FakeWgerBaseProvider_0( + this, + Invocation.getter(#baseProvider), + ), + ) as _i2.WgerBaseProvider); + + @override + List<_i5.Routine> get items => (super.noSuchMethod( + Invocation.getter(#items), + returnValue: <_i5.Routine>[], + ) as List<_i5.Routine>); + + @override + List<_i3.WeightUnit> get weightUnits => (super.noSuchMethod( + Invocation.getter(#weightUnits), + returnValue: <_i3.WeightUnit>[], + ) as List<_i3.WeightUnit>); + + @override + set weightUnits(List<_i3.WeightUnit>? weightUnits) => super.noSuchMethod( + Invocation.setter(#weightUnits, weightUnits), + returnValueForMissingStub: null, + ); + + @override + _i3.WeightUnit get defaultWeightUnit => (super.noSuchMethod( + Invocation.getter(#defaultWeightUnit), + returnValue: _FakeWeightUnit_1( + this, + Invocation.getter(#defaultWeightUnit), + ), + ) as _i3.WeightUnit); + + @override + List<_i4.RepetitionUnit> get repetitionUnits => (super.noSuchMethod( + Invocation.getter(#repetitionUnits), + returnValue: <_i4.RepetitionUnit>[], + ) as List<_i4.RepetitionUnit>); + + @override + set repetitionUnits(List<_i4.RepetitionUnit>? repetitionUnits) => super.noSuchMethod( + Invocation.setter(#repetitionUnits, repetitionUnits), + returnValueForMissingStub: null, + ); + + @override + _i4.RepetitionUnit get defaultRepetitionUnit => (super.noSuchMethod( + Invocation.getter(#defaultRepetitionUnit), + returnValue: _FakeRepetitionUnit_2( + this, + Invocation.getter(#defaultRepetitionUnit), + ), + ) as _i4.RepetitionUnit); + + @override + bool get hasListeners => + (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) as bool); + + @override + void clear() => super.noSuchMethod( + Invocation.method(#clear, []), + returnValueForMissingStub: null, + ); + + @override + _i3.WeightUnit findWeightUnitById(int? id) => (super.noSuchMethod( + Invocation.method(#findWeightUnitById, [id]), + returnValue: _FakeWeightUnit_1( + this, + Invocation.method(#findWeightUnitById, [id]), + ), + ) as _i3.WeightUnit); + + @override + _i4.RepetitionUnit findRepetitionUnitById(int? id) => (super.noSuchMethod( + Invocation.method(#findRepetitionUnitById, [id]), + returnValue: _FakeRepetitionUnit_2( + this, + Invocation.method(#findRepetitionUnitById, [id]), + ), + ) as _i4.RepetitionUnit); + + @override + List<_i5.Routine> getPlans() => (super.noSuchMethod( + Invocation.method(#getPlans, []), + returnValue: <_i5.Routine>[], + ) as List<_i5.Routine>); + + @override + _i5.Routine findById(int? id) => (super.noSuchMethod( + Invocation.method(#findById, [id]), + returnValue: _FakeRoutine_3( + this, + Invocation.method(#findById, [id]), + ), + ) as _i5.Routine); + + @override + int findIndexById(int? id) => (super.noSuchMethod( + Invocation.method(#findIndexById, [id]), + returnValue: 0, + ) as int); + + @override + void setCurrentPlan(int? id) => super.noSuchMethod( + Invocation.method(#setCurrentPlan, [id]), + returnValueForMissingStub: null, + ); + + @override + void resetCurrentRoutine() => super.noSuchMethod( + Invocation.method(#resetCurrentRoutine, []), + returnValueForMissingStub: null, + ); + + @override + _i13.Future fetchAndSetAllRoutinesFull() => (super.noSuchMethod( + Invocation.method(#fetchAndSetAllRoutinesFull, []), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); + + @override + _i13.Future fetchAndSetAllPlansSparse() => (super.noSuchMethod( + Invocation.method(#fetchAndSetAllPlansSparse, []), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); + + @override + void setExercisesAndUnits(List<_i14.DayData>? entries) => super.noSuchMethod( + Invocation.method(#setExercisesAndUnits, [entries]), + returnValueForMissingStub: null, + ); + + @override + _i13.Future<_i5.Routine> fetchAndSetRoutineSparse(int? planId) => (super.noSuchMethod( + Invocation.method(#fetchAndSetRoutineSparse, [planId]), + returnValue: _i13.Future<_i5.Routine>.value( + _FakeRoutine_3( + this, + Invocation.method(#fetchAndSetRoutineSparse, [planId]), + ), + ), + ) as _i13.Future<_i5.Routine>); + + @override + _i13.Future<_i5.Routine> fetchAndSetRoutineFull(int? routineId) => (super.noSuchMethod( + Invocation.method(#fetchAndSetRoutineFull, [routineId]), + returnValue: _i13.Future<_i5.Routine>.value( + _FakeRoutine_3( + this, + Invocation.method(#fetchAndSetRoutineFull, [routineId]), + ), + ), + ) as _i13.Future<_i5.Routine>); + + @override + _i13.Future<_i5.Routine> addRoutine(_i5.Routine? routine) => (super.noSuchMethod( + Invocation.method(#addRoutine, [routine]), + returnValue: _i13.Future<_i5.Routine>.value( + _FakeRoutine_3(this, Invocation.method(#addRoutine, [routine])), + ), + ) as _i13.Future<_i5.Routine>); + + @override + _i13.Future editRoutine(_i5.Routine? routine) => (super.noSuchMethod( + Invocation.method(#editRoutine, [routine]), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); + + @override + _i13.Future deleteRoutine(int? id) => (super.noSuchMethod( + Invocation.method(#deleteRoutine, [id]), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); + + @override + _i13.Future fetchAndSetRepetitionUnits() => (super.noSuchMethod( + Invocation.method(#fetchAndSetRepetitionUnits, []), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); + + @override + _i13.Future fetchAndSetWeightUnits() => (super.noSuchMethod( + Invocation.method(#fetchAndSetWeightUnits, []), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); + + @override + _i13.Future fetchAndSetUnits() => (super.noSuchMethod( + Invocation.method(#fetchAndSetUnits, []), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); + + @override + _i13.Future<_i6.Day> addDay(_i6.Day? day) => (super.noSuchMethod( + Invocation.method(#addDay, [day]), + returnValue: _i13.Future<_i6.Day>.value( + _FakeDay_4(this, Invocation.method(#addDay, [day])), + ), + ) as _i13.Future<_i6.Day>); + + @override + _i13.Future editDay(_i6.Day? day) => (super.noSuchMethod( + Invocation.method(#editDay, [day]), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); + + @override + _i13.Future editDays(List<_i6.Day>? days) => (super.noSuchMethod( + Invocation.method(#editDays, [days]), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); + + @override + _i13.Future deleteDay(int? dayId) => (super.noSuchMethod( + Invocation.method(#deleteDay, [dayId]), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); + + @override + _i13.Future<_i7.Slot> addSlot(_i7.Slot? slot, int? routineId) => (super.noSuchMethod( + Invocation.method(#addSlot, [slot, routineId]), + returnValue: _i13.Future<_i7.Slot>.value( + _FakeSlot_5(this, Invocation.method(#addSlot, [slot, routineId])), + ), + ) as _i13.Future<_i7.Slot>); + + @override + _i13.Future deleteSlot(int? slotId, int? routineId) => (super.noSuchMethod( + Invocation.method(#deleteSlot, [slotId, routineId]), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); + + @override + _i13.Future editSlot(_i7.Slot? slot, int? routineId) => (super.noSuchMethod( + Invocation.method(#editSlot, [slot, routineId]), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); + + @override + _i13.Future editSlots(List<_i7.Slot>? slots, int? routineId) => (super.noSuchMethod( + Invocation.method(#editSlots, [slots, routineId]), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); + + @override + _i13.Future<_i8.SlotEntry> addSlotEntry( + _i8.SlotEntry? entry, + int? routineId, + ) => + (super.noSuchMethod( + Invocation.method(#addSlotEntry, [entry, routineId]), + returnValue: _i13.Future<_i8.SlotEntry>.value( + _FakeSlotEntry_6( + this, + Invocation.method(#addSlotEntry, [entry, routineId]), + ), + ), + ) as _i13.Future<_i8.SlotEntry>); + + @override + _i13.Future deleteSlotEntry(int? id, int? routineId) => (super.noSuchMethod( + Invocation.method(#deleteSlotEntry, [id, routineId]), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); + + @override + _i13.Future editSlotEntry(_i8.SlotEntry? entry, int? routineId) => (super.noSuchMethod( + Invocation.method(#editSlotEntry, [entry, routineId]), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); + + @override + String getConfigUrl(_i8.ConfigType? type) => (super.noSuchMethod( + Invocation.method(#getConfigUrl, [type]), + returnValue: _i15.dummyValue( + this, + Invocation.method(#getConfigUrl, [type]), + ), + ) as String); + + @override + _i13.Future<_i9.BaseConfig> editConfig( + _i9.BaseConfig? config, + _i8.ConfigType? type, + ) => + (super.noSuchMethod( + Invocation.method(#editConfig, [config, type]), + returnValue: _i13.Future<_i9.BaseConfig>.value( + _FakeBaseConfig_7( + this, + Invocation.method(#editConfig, [config, type]), + ), + ), + ) as _i13.Future<_i9.BaseConfig>); + + @override + _i13.Future<_i9.BaseConfig> addConfig( + _i9.BaseConfig? config, + _i8.ConfigType? type, + ) => + (super.noSuchMethod( + Invocation.method(#addConfig, [config, type]), + returnValue: _i13.Future<_i9.BaseConfig>.value( + _FakeBaseConfig_7( + this, + Invocation.method(#addConfig, [config, type]), + ), + ), + ) as _i13.Future<_i9.BaseConfig>); + + @override + _i13.Future deleteConfig(int? id, _i8.ConfigType? type) => (super.noSuchMethod( + Invocation.method(#deleteConfig, [id, type]), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); + + @override + _i13.Future handleConfig( + _i8.SlotEntry? entry, + String? input, + _i8.ConfigType? type, + ) => + (super.noSuchMethod( + Invocation.method(#handleConfig, [entry, input, type]), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); + + @override + _i13.Future> fetchSessionData() => (super.noSuchMethod( + Invocation.method(#fetchSessionData, []), + returnValue: _i13.Future>.value( + <_i10.WorkoutSession>[], + ), + ) as _i13.Future>); + + @override + _i13.Future<_i10.WorkoutSession> addSession( + _i10.WorkoutSession? session, + int? routineId, + ) => + (super.noSuchMethod( + Invocation.method(#addSession, [session, routineId]), + returnValue: _i13.Future<_i10.WorkoutSession>.value( + _FakeWorkoutSession_8( + this, + Invocation.method(#addSession, [session, routineId]), + ), + ), + ) as _i13.Future<_i10.WorkoutSession>); + + @override + _i13.Future<_i10.WorkoutSession> editSession(_i10.WorkoutSession? session) => (super.noSuchMethod( + Invocation.method(#editSession, [session]), + returnValue: _i13.Future<_i10.WorkoutSession>.value( + _FakeWorkoutSession_8( + this, + Invocation.method(#editSession, [session]), + ), + ), + ) as _i13.Future<_i10.WorkoutSession>); + + @override + _i13.Future<_i11.Log> addLog(_i11.Log? log) => (super.noSuchMethod( + Invocation.method(#addLog, [log]), + returnValue: _i13.Future<_i11.Log>.value( + _FakeLog_9(this, Invocation.method(#addLog, [log])), + ), + ) as _i13.Future<_i11.Log>); + + @override + _i13.Future deleteLog(_i11.Log? log) => (super.noSuchMethod( + Invocation.method(#deleteLog, [log]), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); + + @override + void addListener(_i16.VoidCallback? listener) => super.noSuchMethod( + Invocation.method(#addListener, [listener]), + returnValueForMissingStub: null, + ); + + @override + void removeListener(_i16.VoidCallback? listener) => super.noSuchMethod( + Invocation.method(#removeListener, [listener]), + returnValueForMissingStub: null, + ); + + @override + void dispose() => super.noSuchMethod( + Invocation.method(#dispose, []), + returnValueForMissingStub: null, + ); + + @override + void notifyListeners() => super.noSuchMethod( + Invocation.method(#notifyListeners, []), + returnValueForMissingStub: null, + ); +} diff --git a/test/workout/routine_edit_test.dart b/test/workout/routine_edit_test.dart new file mode 100644 index 000000000..abe0b66dc --- /dev/null +++ b/test/workout/routine_edit_test.dart @@ -0,0 +1,105 @@ +/* + * This file is part of wger Workout Manager . + * Copyright (C) 2020, 2021 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. + * + * wger Workout Manager is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +import 'package:flutter/material.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:mockito/annotations.dart'; +import 'package:mockito/mockito.dart'; +import 'package:provider/provider.dart'; +import 'package:wger/l10n/generated/app_localizations.dart'; +import 'package:wger/providers/routines.dart'; +import 'package:wger/widgets/routines/forms/day.dart'; +import 'package:wger/widgets/routines/routine_edit.dart'; + +import '../../test_data/routines.dart'; +import 'routine_edit_test.mocks.dart'; + +@GenerateMocks([RoutinesProvider]) +void main() { + late MockRoutinesProvider mockRoutinesProvider; + + setUp(() { + mockRoutinesProvider = MockRoutinesProvider(); + when(mockRoutinesProvider.fetchAndSetRoutineFull(1)).thenAnswer((_) async => getTestRoutine()); + }); + + testWidgets('RoutineEditScreen smoke test', (WidgetTester tester) async { + // Build the RoutineEditScreen widget with the correct arguments + await tester.pumpWidget( + ChangeNotifierProvider.value( + value: mockRoutinesProvider, + child: MaterialApp( + locale: const Locale('en'), + localizationsDelegates: AppLocalizations.localizationsDelegates, + supportedLocales: AppLocalizations.supportedLocales, + home: Scaffold( + body: RoutineEdit(getTestRoutine()), + ), + ), + ), + ); + await tester.pumpAndSettle(); + + // Always two widgets, one in the edit list, one in the generated routine + expect(find.text('3 day workout'), findsOne, reason: 'title'); + expect( + find.text('This is a 3 day workout and this text is important'), + findsNWidgets(2), + reason: 'description', + ); + + expect(find.text('first day'), findsNWidgets(2)); + expect(find.text('chest, shoulders'), findsNWidgets(2), reason: 'description'); + + expect(find.text('second day'), findsNWidgets(2)); + expect(find.text('legs'), findsNWidgets(2), reason: 'description'); + + // Edit the first day + expect(find.byElementType(DayFormWidget), findsNothing); + expect(find.byIcon(Icons.edit), findsNWidgets(2)); + expect(find.byIcon(Icons.edit_off), findsNothing); + expect(find.byKey(const ValueKey('edit-day-1')), findsOne); + expect(find.byKey(const ValueKey('edit-day-2')), findsOne); + expect(find.text('is rest day'), findsNothing); + + await tester.tap(find.byKey(const ValueKey('edit-day-1'))); + await tester.pumpAndSettle(); + + expect( + find.byIcon(Icons.edit), + findsNWidgets(3), + reason: 'also for the days', + ); + expect(find.byIcon(Icons.edit_off), findsOne); + expect(find.text('Is rest day'), findsOne); + + expect(find.text('Exercise 1'), findsOne); + expect( + find.text('Bench press'), + findsNWidgets(3), + reason: 'resulting routine plus edit', + ); + + expect(find.text('Exercise 2'), findsOne); + expect( + find.text('Side raises'), + findsNWidgets(2), + reason: 'resulting routine plus edit', + ); + }); +} diff --git a/test/workout/routine_edit_test.mocks.dart b/test/workout/routine_edit_test.mocks.dart new file mode 100644 index 000000000..2a4b9ea29 --- /dev/null +++ b/test/workout/routine_edit_test.mocks.dart @@ -0,0 +1,509 @@ +// Mocks generated by Mockito 5.4.5 from annotations +// in wger/test/workout/routine_edit_test.dart. +// Do not manually edit this file. + +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'dart:async' as _i13; +import 'dart:ui' as _i16; + +import 'package:mockito/mockito.dart' as _i1; +import 'package:mockito/src/dummies.dart' as _i15; +import 'package:wger/models/workouts/base_config.dart' as _i9; +import 'package:wger/models/workouts/day.dart' as _i6; +import 'package:wger/models/workouts/day_data.dart' as _i14; +import 'package:wger/models/workouts/log.dart' as _i11; +import 'package:wger/models/workouts/repetition_unit.dart' as _i4; +import 'package:wger/models/workouts/routine.dart' as _i5; +import 'package:wger/models/workouts/session.dart' as _i10; +import 'package:wger/models/workouts/slot.dart' as _i7; +import 'package:wger/models/workouts/slot_entry.dart' as _i8; +import 'package:wger/models/workouts/weight_unit.dart' as _i3; +import 'package:wger/providers/base_provider.dart' as _i2; +import 'package:wger/providers/routines.dart' as _i12; + +// ignore_for_file: type=lint +// ignore_for_file: avoid_redundant_argument_values +// ignore_for_file: avoid_setters_without_getters +// ignore_for_file: comment_references +// ignore_for_file: deprecated_member_use +// ignore_for_file: deprecated_member_use_from_same_package +// ignore_for_file: implementation_imports +// ignore_for_file: invalid_use_of_visible_for_testing_member +// ignore_for_file: must_be_immutable +// ignore_for_file: prefer_const_constructors +// ignore_for_file: unnecessary_parenthesis +// ignore_for_file: camel_case_types +// ignore_for_file: subtype_of_sealed_class + +class _FakeWgerBaseProvider_0 extends _i1.SmartFake implements _i2.WgerBaseProvider { + _FakeWgerBaseProvider_0(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); +} + +class _FakeWeightUnit_1 extends _i1.SmartFake implements _i3.WeightUnit { + _FakeWeightUnit_1(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); +} + +class _FakeRepetitionUnit_2 extends _i1.SmartFake implements _i4.RepetitionUnit { + _FakeRepetitionUnit_2(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); +} + +class _FakeRoutine_3 extends _i1.SmartFake implements _i5.Routine { + _FakeRoutine_3(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); +} + +class _FakeDay_4 extends _i1.SmartFake implements _i6.Day { + _FakeDay_4(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); +} + +class _FakeSlot_5 extends _i1.SmartFake implements _i7.Slot { + _FakeSlot_5(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); +} + +class _FakeSlotEntry_6 extends _i1.SmartFake implements _i8.SlotEntry { + _FakeSlotEntry_6(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); +} + +class _FakeBaseConfig_7 extends _i1.SmartFake implements _i9.BaseConfig { + _FakeBaseConfig_7(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); +} + +class _FakeWorkoutSession_8 extends _i1.SmartFake implements _i10.WorkoutSession { + _FakeWorkoutSession_8(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); +} + +class _FakeLog_9 extends _i1.SmartFake implements _i11.Log { + _FakeLog_9(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); +} + +/// A class which mocks [RoutinesProvider]. +/// +/// See the documentation for Mockito's code generation for more information. +class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { + MockRoutinesProvider() { + _i1.throwOnMissingStub(this); + } + + @override + _i2.WgerBaseProvider get baseProvider => (super.noSuchMethod( + Invocation.getter(#baseProvider), + returnValue: _FakeWgerBaseProvider_0( + this, + Invocation.getter(#baseProvider), + ), + ) as _i2.WgerBaseProvider); + + @override + List<_i5.Routine> get items => (super.noSuchMethod( + Invocation.getter(#items), + returnValue: <_i5.Routine>[], + ) as List<_i5.Routine>); + + @override + List<_i3.WeightUnit> get weightUnits => (super.noSuchMethod( + Invocation.getter(#weightUnits), + returnValue: <_i3.WeightUnit>[], + ) as List<_i3.WeightUnit>); + + @override + set weightUnits(List<_i3.WeightUnit>? weightUnits) => super.noSuchMethod( + Invocation.setter(#weightUnits, weightUnits), + returnValueForMissingStub: null, + ); + + @override + _i3.WeightUnit get defaultWeightUnit => (super.noSuchMethod( + Invocation.getter(#defaultWeightUnit), + returnValue: _FakeWeightUnit_1( + this, + Invocation.getter(#defaultWeightUnit), + ), + ) as _i3.WeightUnit); + + @override + List<_i4.RepetitionUnit> get repetitionUnits => (super.noSuchMethod( + Invocation.getter(#repetitionUnits), + returnValue: <_i4.RepetitionUnit>[], + ) as List<_i4.RepetitionUnit>); + + @override + set repetitionUnits(List<_i4.RepetitionUnit>? repetitionUnits) => super.noSuchMethod( + Invocation.setter(#repetitionUnits, repetitionUnits), + returnValueForMissingStub: null, + ); + + @override + _i4.RepetitionUnit get defaultRepetitionUnit => (super.noSuchMethod( + Invocation.getter(#defaultRepetitionUnit), + returnValue: _FakeRepetitionUnit_2( + this, + Invocation.getter(#defaultRepetitionUnit), + ), + ) as _i4.RepetitionUnit); + + @override + bool get hasListeners => + (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) as bool); + + @override + void clear() => super.noSuchMethod( + Invocation.method(#clear, []), + returnValueForMissingStub: null, + ); + + @override + _i3.WeightUnit findWeightUnitById(int? id) => (super.noSuchMethod( + Invocation.method(#findWeightUnitById, [id]), + returnValue: _FakeWeightUnit_1( + this, + Invocation.method(#findWeightUnitById, [id]), + ), + ) as _i3.WeightUnit); + + @override + _i4.RepetitionUnit findRepetitionUnitById(int? id) => (super.noSuchMethod( + Invocation.method(#findRepetitionUnitById, [id]), + returnValue: _FakeRepetitionUnit_2( + this, + Invocation.method(#findRepetitionUnitById, [id]), + ), + ) as _i4.RepetitionUnit); + + @override + List<_i5.Routine> getPlans() => (super.noSuchMethod( + Invocation.method(#getPlans, []), + returnValue: <_i5.Routine>[], + ) as List<_i5.Routine>); + + @override + _i5.Routine findById(int? id) => (super.noSuchMethod( + Invocation.method(#findById, [id]), + returnValue: _FakeRoutine_3( + this, + Invocation.method(#findById, [id]), + ), + ) as _i5.Routine); + + @override + int findIndexById(int? id) => (super.noSuchMethod( + Invocation.method(#findIndexById, [id]), + returnValue: 0, + ) as int); + + @override + void setCurrentPlan(int? id) => super.noSuchMethod( + Invocation.method(#setCurrentPlan, [id]), + returnValueForMissingStub: null, + ); + + @override + void resetCurrentRoutine() => super.noSuchMethod( + Invocation.method(#resetCurrentRoutine, []), + returnValueForMissingStub: null, + ); + + @override + _i13.Future fetchAndSetAllRoutinesFull() => (super.noSuchMethod( + Invocation.method(#fetchAndSetAllRoutinesFull, []), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); + + @override + _i13.Future fetchAndSetAllPlansSparse() => (super.noSuchMethod( + Invocation.method(#fetchAndSetAllPlansSparse, []), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); + + @override + void setExercisesAndUnits(List<_i14.DayData>? entries) => super.noSuchMethod( + Invocation.method(#setExercisesAndUnits, [entries]), + returnValueForMissingStub: null, + ); + + @override + _i13.Future<_i5.Routine> fetchAndSetRoutineSparse(int? planId) => (super.noSuchMethod( + Invocation.method(#fetchAndSetRoutineSparse, [planId]), + returnValue: _i13.Future<_i5.Routine>.value( + _FakeRoutine_3( + this, + Invocation.method(#fetchAndSetRoutineSparse, [planId]), + ), + ), + ) as _i13.Future<_i5.Routine>); + + @override + _i13.Future<_i5.Routine> fetchAndSetRoutineFull(int? routineId) => (super.noSuchMethod( + Invocation.method(#fetchAndSetRoutineFull, [routineId]), + returnValue: _i13.Future<_i5.Routine>.value( + _FakeRoutine_3( + this, + Invocation.method(#fetchAndSetRoutineFull, [routineId]), + ), + ), + ) as _i13.Future<_i5.Routine>); + + @override + _i13.Future<_i5.Routine> addRoutine(_i5.Routine? routine) => (super.noSuchMethod( + Invocation.method(#addRoutine, [routine]), + returnValue: _i13.Future<_i5.Routine>.value( + _FakeRoutine_3(this, Invocation.method(#addRoutine, [routine])), + ), + ) as _i13.Future<_i5.Routine>); + + @override + _i13.Future editRoutine(_i5.Routine? routine) => (super.noSuchMethod( + Invocation.method(#editRoutine, [routine]), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); + + @override + _i13.Future deleteRoutine(int? id) => (super.noSuchMethod( + Invocation.method(#deleteRoutine, [id]), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); + + @override + _i13.Future fetchAndSetRepetitionUnits() => (super.noSuchMethod( + Invocation.method(#fetchAndSetRepetitionUnits, []), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); + + @override + _i13.Future fetchAndSetWeightUnits() => (super.noSuchMethod( + Invocation.method(#fetchAndSetWeightUnits, []), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); + + @override + _i13.Future fetchAndSetUnits() => (super.noSuchMethod( + Invocation.method(#fetchAndSetUnits, []), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); + + @override + _i13.Future<_i6.Day> addDay(_i6.Day? day) => (super.noSuchMethod( + Invocation.method(#addDay, [day]), + returnValue: _i13.Future<_i6.Day>.value( + _FakeDay_4(this, Invocation.method(#addDay, [day])), + ), + ) as _i13.Future<_i6.Day>); + + @override + _i13.Future editDay(_i6.Day? day) => (super.noSuchMethod( + Invocation.method(#editDay, [day]), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); + + @override + _i13.Future editDays(List<_i6.Day>? days) => (super.noSuchMethod( + Invocation.method(#editDays, [days]), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); + + @override + _i13.Future deleteDay(int? dayId) => (super.noSuchMethod( + Invocation.method(#deleteDay, [dayId]), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); + + @override + _i13.Future<_i7.Slot> addSlot(_i7.Slot? slot, int? routineId) => (super.noSuchMethod( + Invocation.method(#addSlot, [slot, routineId]), + returnValue: _i13.Future<_i7.Slot>.value( + _FakeSlot_5(this, Invocation.method(#addSlot, [slot, routineId])), + ), + ) as _i13.Future<_i7.Slot>); + + @override + _i13.Future deleteSlot(int? slotId, int? routineId) => (super.noSuchMethod( + Invocation.method(#deleteSlot, [slotId, routineId]), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); + + @override + _i13.Future editSlot(_i7.Slot? slot, int? routineId) => (super.noSuchMethod( + Invocation.method(#editSlot, [slot, routineId]), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); + + @override + _i13.Future editSlots(List<_i7.Slot>? slots, int? routineId) => (super.noSuchMethod( + Invocation.method(#editSlots, [slots, routineId]), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); + + @override + _i13.Future<_i8.SlotEntry> addSlotEntry( + _i8.SlotEntry? entry, + int? routineId, + ) => + (super.noSuchMethod( + Invocation.method(#addSlotEntry, [entry, routineId]), + returnValue: _i13.Future<_i8.SlotEntry>.value( + _FakeSlotEntry_6( + this, + Invocation.method(#addSlotEntry, [entry, routineId]), + ), + ), + ) as _i13.Future<_i8.SlotEntry>); + + @override + _i13.Future deleteSlotEntry(int? id, int? routineId) => (super.noSuchMethod( + Invocation.method(#deleteSlotEntry, [id, routineId]), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); + + @override + _i13.Future editSlotEntry(_i8.SlotEntry? entry, int? routineId) => (super.noSuchMethod( + Invocation.method(#editSlotEntry, [entry, routineId]), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); + + @override + String getConfigUrl(_i8.ConfigType? type) => (super.noSuchMethod( + Invocation.method(#getConfigUrl, [type]), + returnValue: _i15.dummyValue( + this, + Invocation.method(#getConfigUrl, [type]), + ), + ) as String); + + @override + _i13.Future<_i9.BaseConfig> editConfig( + _i9.BaseConfig? config, + _i8.ConfigType? type, + ) => + (super.noSuchMethod( + Invocation.method(#editConfig, [config, type]), + returnValue: _i13.Future<_i9.BaseConfig>.value( + _FakeBaseConfig_7( + this, + Invocation.method(#editConfig, [config, type]), + ), + ), + ) as _i13.Future<_i9.BaseConfig>); + + @override + _i13.Future<_i9.BaseConfig> addConfig( + _i9.BaseConfig? config, + _i8.ConfigType? type, + ) => + (super.noSuchMethod( + Invocation.method(#addConfig, [config, type]), + returnValue: _i13.Future<_i9.BaseConfig>.value( + _FakeBaseConfig_7( + this, + Invocation.method(#addConfig, [config, type]), + ), + ), + ) as _i13.Future<_i9.BaseConfig>); + + @override + _i13.Future deleteConfig(int? id, _i8.ConfigType? type) => (super.noSuchMethod( + Invocation.method(#deleteConfig, [id, type]), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); + + @override + _i13.Future handleConfig( + _i8.SlotEntry? entry, + String? input, + _i8.ConfigType? type, + ) => + (super.noSuchMethod( + Invocation.method(#handleConfig, [entry, input, type]), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); + + @override + _i13.Future> fetchSessionData() => (super.noSuchMethod( + Invocation.method(#fetchSessionData, []), + returnValue: _i13.Future>.value( + <_i10.WorkoutSession>[], + ), + ) as _i13.Future>); + + @override + _i13.Future<_i10.WorkoutSession> addSession( + _i10.WorkoutSession? session, + int? routineId, + ) => + (super.noSuchMethod( + Invocation.method(#addSession, [session, routineId]), + returnValue: _i13.Future<_i10.WorkoutSession>.value( + _FakeWorkoutSession_8( + this, + Invocation.method(#addSession, [session, routineId]), + ), + ), + ) as _i13.Future<_i10.WorkoutSession>); + + @override + _i13.Future<_i10.WorkoutSession> editSession(_i10.WorkoutSession? session) => (super.noSuchMethod( + Invocation.method(#editSession, [session]), + returnValue: _i13.Future<_i10.WorkoutSession>.value( + _FakeWorkoutSession_8( + this, + Invocation.method(#editSession, [session]), + ), + ), + ) as _i13.Future<_i10.WorkoutSession>); + + @override + _i13.Future<_i11.Log> addLog(_i11.Log? log) => (super.noSuchMethod( + Invocation.method(#addLog, [log]), + returnValue: _i13.Future<_i11.Log>.value( + _FakeLog_9(this, Invocation.method(#addLog, [log])), + ), + ) as _i13.Future<_i11.Log>); + + @override + _i13.Future deleteLog(_i11.Log? log) => (super.noSuchMethod( + Invocation.method(#deleteLog, [log]), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); + + @override + void addListener(_i16.VoidCallback? listener) => super.noSuchMethod( + Invocation.method(#addListener, [listener]), + returnValueForMissingStub: null, + ); + + @override + void removeListener(_i16.VoidCallback? listener) => super.noSuchMethod( + Invocation.method(#removeListener, [listener]), + returnValueForMissingStub: null, + ); + + @override + void dispose() => super.noSuchMethod( + Invocation.method(#dispose, []), + returnValueForMissingStub: null, + ); + + @override + void notifyListeners() => super.noSuchMethod( + Invocation.method(#notifyListeners, []), + returnValueForMissingStub: null, + ); +} diff --git a/test/workout/workout_form_test.dart b/test/workout/routine_form_test.dart similarity index 56% rename from test/workout/workout_form_test.dart rename to test/workout/routine_form_test.dart index 7528c09fa..214eeb427 100644 --- a/test/workout/workout_form_test.dart +++ b/test/workout/routine_form_test.dart @@ -17,66 +17,73 @@ */ import 'package:flutter/material.dart'; -import 'package:flutter_gen/gen_l10n/app_localizations.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/annotations.dart'; import 'package:mockito/mockito.dart'; import 'package:provider/provider.dart'; import 'package:wger/helpers/consts.dart'; -import 'package:wger/models/workouts/workout_plan.dart'; -import 'package:wger/providers/workout_plans.dart'; -import 'package:wger/screens/workout_plan_screen.dart'; -import 'package:wger/widgets/workouts/forms.dart'; +import 'package:wger/l10n/generated/app_localizations.dart'; +import 'package:wger/models/workouts/routine.dart'; +import 'package:wger/providers/routines.dart'; +import 'package:wger/screens/routine_edit_screen.dart'; +import 'package:wger/screens/routine_screen.dart'; +import 'package:wger/widgets/routines/forms/routine.dart'; -import './workout_form_test.mocks.dart'; +import './routine_form_test.mocks.dart'; -@GenerateMocks([WorkoutPlansProvider]) +@GenerateMocks([RoutinesProvider]) void main() { - var mockWorkoutPlans = MockWorkoutPlansProvider(); + var mockRoutinesProvider = MockRoutinesProvider(); - final existingPlan = WorkoutPlan( + final existingRoutine = Routine( id: 1, - creationDate: DateTime(2021, 1, 1), + created: DateTime(2021, 1, 1), + start: DateTime(2024, 11, 1), + end: DateTime(2024, 12, 1), name: 'test 1', description: 'description 1', + fitInWeek: false, ); - final newPlan = WorkoutPlan.empty(); + var newRoutine = Routine.empty(); setUp(() { - mockWorkoutPlans = MockWorkoutPlansProvider(); - when(mockWorkoutPlans.editWorkout(any)).thenAnswer((_) => Future.value(existingPlan)); - when(mockWorkoutPlans.fetchAndSetWorkoutPlanFull(any)) - .thenAnswer((_) => Future.value(existingPlan)); + newRoutine = Routine.empty(); + mockRoutinesProvider = MockRoutinesProvider(); + when(mockRoutinesProvider.findById(any)).thenAnswer((_) => existingRoutine); + when(mockRoutinesProvider.editRoutine(any)).thenAnswer((_) => Future.value(existingRoutine)); + when(mockRoutinesProvider.fetchAndSetRoutineFull(any)) + .thenAnswer((_) => Future.value(existingRoutine)); }); - Widget createHomeScreen(WorkoutPlan workoutPlan, {locale = 'en'}) { + Widget renderWidget(Routine routine, {locale = 'en'}) { final key = GlobalKey(); - return ChangeNotifierProvider( - create: (context) => mockWorkoutPlans, + return ChangeNotifierProvider( + create: (context) => mockRoutinesProvider, child: MaterialApp( locale: Locale(locale), localizationsDelegates: AppLocalizations.localizationsDelegates, supportedLocales: AppLocalizations.supportedLocales, navigatorKey: key, - home: Scaffold(body: WorkoutForm(workoutPlan)), + home: Scaffold(body: RoutineForm(routine)), routes: { - WorkoutPlanScreen.routeName: (ctx) => const WorkoutPlanScreen(), + RoutineScreen.routeName: (ctx) => const RoutineScreen(), + RoutineEditScreen.routeName: (ctx) => const RoutineEditScreen(), }, ), ); } testWidgets('Test the widgets on the workout form', (WidgetTester tester) async { - await tester.pumpWidget(createHomeScreen(existingPlan)); + await tester.pumpWidget(renderWidget(existingRoutine)); await tester.pumpAndSettle(); - expect(find.byType(TextFormField), findsNWidgets(2)); + expect(find.byType(TextFormField), findsNWidgets(4)); expect(find.byType(ElevatedButton), findsOneWidget); }); testWidgets('Test editing an existing workout', (WidgetTester tester) async { - await tester.pumpWidget(createHomeScreen(existingPlan)); + await tester.pumpWidget(renderWidget(existingRoutine)); await tester.pumpAndSettle(); expect( @@ -93,8 +100,8 @@ void main() { await tester.tap(find.byKey(const Key(SUBMIT_BUTTON_KEY_NAME))); // Correct method was called - verify(mockWorkoutPlans.editWorkout(any)); - verifyNever(mockWorkoutPlans.addWorkout(any)); + verify(mockRoutinesProvider.editRoutine(any)); + verifyNever(mockRoutinesProvider.addRoutine(any)); // TODO(x): edit calls Navigator.pop(), since the form can only be reached from the // detail page. The test needs to add the detail page to the stack so that @@ -106,51 +113,57 @@ void main() { }); testWidgets('Test creating a new workout - only name', (WidgetTester tester) async { - final editWorkout = WorkoutPlan( + final editRoutine = Routine( id: 2, - creationDate: newPlan.creationDate, + created: newRoutine.created, + start: DateTime(2024, 11, 1), + end: DateTime(2024, 12, 1), name: 'New cool workout', ); - when(mockWorkoutPlans.addWorkout(any)).thenAnswer((_) => Future.value(editWorkout)); + when(mockRoutinesProvider.addRoutine(any)).thenAnswer((_) => Future.value(editRoutine)); + when(mockRoutinesProvider.findById(any)).thenAnswer((_) => editRoutine); - await tester.pumpWidget(createHomeScreen(newPlan)); + await tester.pumpWidget(renderWidget(newRoutine)); await tester.pumpAndSettle(); expect(find.text(''), findsNWidgets(2), reason: 'New workout has no name or description'); - await tester.enterText(find.byKey(const Key('field-name')), editWorkout.name); + await tester.enterText(find.byKey(const Key('field-name')), editRoutine.name); await tester.tap(find.byKey(const Key(SUBMIT_BUTTON_KEY_NAME))); - verifyNever(mockWorkoutPlans.editWorkout(any)); - verify(mockWorkoutPlans.addWorkout(any)); + verifyNever(mockRoutinesProvider.editRoutine(any)); + verify(mockRoutinesProvider.addRoutine(any)); // Detail page await tester.pumpAndSettle(); - expect(find.text('New cool workout'), findsOneWidget, reason: 'Workout plan detail page'); + expect(find.text('New cool workout'), findsWidgets, reason: 'Workout plan detail page'); }); testWidgets('Test creating a new workout - name and description', (WidgetTester tester) async { - final editWorkout = WorkoutPlan( + final editRoutine = Routine( id: 2, - creationDate: newPlan.creationDate, + created: newRoutine.created, + start: DateTime(2024, 11, 1), + end: DateTime(2024, 12, 1), name: 'My workout', description: 'Get yuuuge', ); - when(mockWorkoutPlans.addWorkout(any)).thenAnswer((_) => Future.value(editWorkout)); + when(mockRoutinesProvider.addRoutine(any)).thenAnswer((_) => Future.value(editRoutine)); + when(mockRoutinesProvider.findById(any)).thenAnswer((_) => editRoutine); - await tester.pumpWidget(createHomeScreen(newPlan)); + await tester.pumpWidget(renderWidget(newRoutine)); await tester.pumpAndSettle(); expect(find.text(''), findsNWidgets(2), reason: 'New workout has no name or description'); - await tester.enterText(find.byKey(const Key('field-name')), editWorkout.name); - await tester.enterText(find.byKey(const Key('field-description')), editWorkout.description); + await tester.enterText(find.byKey(const Key('field-name')), editRoutine.name); + await tester.enterText(find.byKey(const Key('field-description')), editRoutine.description); await tester.tap(find.byKey(const Key(SUBMIT_BUTTON_KEY_NAME))); - verifyNever(mockWorkoutPlans.editWorkout(any)); - verify(mockWorkoutPlans.addWorkout(any)); + verifyNever(mockRoutinesProvider.editRoutine(any)); + verify(mockRoutinesProvider.addRoutine(any)); // Detail page await tester.pumpAndSettle(); - expect(find.text('My workout'), findsOneWidget, reason: 'Workout plan detail page'); + expect(find.text('My workout'), findsWidgets, reason: 'Workout plan detail page'); }); } diff --git a/test/workout/routine_form_test.mocks.dart b/test/workout/routine_form_test.mocks.dart new file mode 100644 index 000000000..cbe251df8 --- /dev/null +++ b/test/workout/routine_form_test.mocks.dart @@ -0,0 +1,509 @@ +// Mocks generated by Mockito 5.4.5 from annotations +// in wger/test/workout/routine_form_test.dart. +// Do not manually edit this file. + +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'dart:async' as _i13; +import 'dart:ui' as _i16; + +import 'package:mockito/mockito.dart' as _i1; +import 'package:mockito/src/dummies.dart' as _i15; +import 'package:wger/models/workouts/base_config.dart' as _i9; +import 'package:wger/models/workouts/day.dart' as _i6; +import 'package:wger/models/workouts/day_data.dart' as _i14; +import 'package:wger/models/workouts/log.dart' as _i11; +import 'package:wger/models/workouts/repetition_unit.dart' as _i4; +import 'package:wger/models/workouts/routine.dart' as _i5; +import 'package:wger/models/workouts/session.dart' as _i10; +import 'package:wger/models/workouts/slot.dart' as _i7; +import 'package:wger/models/workouts/slot_entry.dart' as _i8; +import 'package:wger/models/workouts/weight_unit.dart' as _i3; +import 'package:wger/providers/base_provider.dart' as _i2; +import 'package:wger/providers/routines.dart' as _i12; + +// ignore_for_file: type=lint +// ignore_for_file: avoid_redundant_argument_values +// ignore_for_file: avoid_setters_without_getters +// ignore_for_file: comment_references +// ignore_for_file: deprecated_member_use +// ignore_for_file: deprecated_member_use_from_same_package +// ignore_for_file: implementation_imports +// ignore_for_file: invalid_use_of_visible_for_testing_member +// ignore_for_file: must_be_immutable +// ignore_for_file: prefer_const_constructors +// ignore_for_file: unnecessary_parenthesis +// ignore_for_file: camel_case_types +// ignore_for_file: subtype_of_sealed_class + +class _FakeWgerBaseProvider_0 extends _i1.SmartFake implements _i2.WgerBaseProvider { + _FakeWgerBaseProvider_0(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); +} + +class _FakeWeightUnit_1 extends _i1.SmartFake implements _i3.WeightUnit { + _FakeWeightUnit_1(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); +} + +class _FakeRepetitionUnit_2 extends _i1.SmartFake implements _i4.RepetitionUnit { + _FakeRepetitionUnit_2(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); +} + +class _FakeRoutine_3 extends _i1.SmartFake implements _i5.Routine { + _FakeRoutine_3(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); +} + +class _FakeDay_4 extends _i1.SmartFake implements _i6.Day { + _FakeDay_4(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); +} + +class _FakeSlot_5 extends _i1.SmartFake implements _i7.Slot { + _FakeSlot_5(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); +} + +class _FakeSlotEntry_6 extends _i1.SmartFake implements _i8.SlotEntry { + _FakeSlotEntry_6(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); +} + +class _FakeBaseConfig_7 extends _i1.SmartFake implements _i9.BaseConfig { + _FakeBaseConfig_7(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); +} + +class _FakeWorkoutSession_8 extends _i1.SmartFake implements _i10.WorkoutSession { + _FakeWorkoutSession_8(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); +} + +class _FakeLog_9 extends _i1.SmartFake implements _i11.Log { + _FakeLog_9(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); +} + +/// A class which mocks [RoutinesProvider]. +/// +/// See the documentation for Mockito's code generation for more information. +class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { + MockRoutinesProvider() { + _i1.throwOnMissingStub(this); + } + + @override + _i2.WgerBaseProvider get baseProvider => (super.noSuchMethod( + Invocation.getter(#baseProvider), + returnValue: _FakeWgerBaseProvider_0( + this, + Invocation.getter(#baseProvider), + ), + ) as _i2.WgerBaseProvider); + + @override + List<_i5.Routine> get items => (super.noSuchMethod( + Invocation.getter(#items), + returnValue: <_i5.Routine>[], + ) as List<_i5.Routine>); + + @override + List<_i3.WeightUnit> get weightUnits => (super.noSuchMethod( + Invocation.getter(#weightUnits), + returnValue: <_i3.WeightUnit>[], + ) as List<_i3.WeightUnit>); + + @override + set weightUnits(List<_i3.WeightUnit>? weightUnits) => super.noSuchMethod( + Invocation.setter(#weightUnits, weightUnits), + returnValueForMissingStub: null, + ); + + @override + _i3.WeightUnit get defaultWeightUnit => (super.noSuchMethod( + Invocation.getter(#defaultWeightUnit), + returnValue: _FakeWeightUnit_1( + this, + Invocation.getter(#defaultWeightUnit), + ), + ) as _i3.WeightUnit); + + @override + List<_i4.RepetitionUnit> get repetitionUnits => (super.noSuchMethod( + Invocation.getter(#repetitionUnits), + returnValue: <_i4.RepetitionUnit>[], + ) as List<_i4.RepetitionUnit>); + + @override + set repetitionUnits(List<_i4.RepetitionUnit>? repetitionUnits) => super.noSuchMethod( + Invocation.setter(#repetitionUnits, repetitionUnits), + returnValueForMissingStub: null, + ); + + @override + _i4.RepetitionUnit get defaultRepetitionUnit => (super.noSuchMethod( + Invocation.getter(#defaultRepetitionUnit), + returnValue: _FakeRepetitionUnit_2( + this, + Invocation.getter(#defaultRepetitionUnit), + ), + ) as _i4.RepetitionUnit); + + @override + bool get hasListeners => + (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) as bool); + + @override + void clear() => super.noSuchMethod( + Invocation.method(#clear, []), + returnValueForMissingStub: null, + ); + + @override + _i3.WeightUnit findWeightUnitById(int? id) => (super.noSuchMethod( + Invocation.method(#findWeightUnitById, [id]), + returnValue: _FakeWeightUnit_1( + this, + Invocation.method(#findWeightUnitById, [id]), + ), + ) as _i3.WeightUnit); + + @override + _i4.RepetitionUnit findRepetitionUnitById(int? id) => (super.noSuchMethod( + Invocation.method(#findRepetitionUnitById, [id]), + returnValue: _FakeRepetitionUnit_2( + this, + Invocation.method(#findRepetitionUnitById, [id]), + ), + ) as _i4.RepetitionUnit); + + @override + List<_i5.Routine> getPlans() => (super.noSuchMethod( + Invocation.method(#getPlans, []), + returnValue: <_i5.Routine>[], + ) as List<_i5.Routine>); + + @override + _i5.Routine findById(int? id) => (super.noSuchMethod( + Invocation.method(#findById, [id]), + returnValue: _FakeRoutine_3( + this, + Invocation.method(#findById, [id]), + ), + ) as _i5.Routine); + + @override + int findIndexById(int? id) => (super.noSuchMethod( + Invocation.method(#findIndexById, [id]), + returnValue: 0, + ) as int); + + @override + void setCurrentPlan(int? id) => super.noSuchMethod( + Invocation.method(#setCurrentPlan, [id]), + returnValueForMissingStub: null, + ); + + @override + void resetCurrentRoutine() => super.noSuchMethod( + Invocation.method(#resetCurrentRoutine, []), + returnValueForMissingStub: null, + ); + + @override + _i13.Future fetchAndSetAllRoutinesFull() => (super.noSuchMethod( + Invocation.method(#fetchAndSetAllRoutinesFull, []), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); + + @override + _i13.Future fetchAndSetAllPlansSparse() => (super.noSuchMethod( + Invocation.method(#fetchAndSetAllPlansSparse, []), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); + + @override + void setExercisesAndUnits(List<_i14.DayData>? entries) => super.noSuchMethod( + Invocation.method(#setExercisesAndUnits, [entries]), + returnValueForMissingStub: null, + ); + + @override + _i13.Future<_i5.Routine> fetchAndSetRoutineSparse(int? planId) => (super.noSuchMethod( + Invocation.method(#fetchAndSetRoutineSparse, [planId]), + returnValue: _i13.Future<_i5.Routine>.value( + _FakeRoutine_3( + this, + Invocation.method(#fetchAndSetRoutineSparse, [planId]), + ), + ), + ) as _i13.Future<_i5.Routine>); + + @override + _i13.Future<_i5.Routine> fetchAndSetRoutineFull(int? routineId) => (super.noSuchMethod( + Invocation.method(#fetchAndSetRoutineFull, [routineId]), + returnValue: _i13.Future<_i5.Routine>.value( + _FakeRoutine_3( + this, + Invocation.method(#fetchAndSetRoutineFull, [routineId]), + ), + ), + ) as _i13.Future<_i5.Routine>); + + @override + _i13.Future<_i5.Routine> addRoutine(_i5.Routine? routine) => (super.noSuchMethod( + Invocation.method(#addRoutine, [routine]), + returnValue: _i13.Future<_i5.Routine>.value( + _FakeRoutine_3(this, Invocation.method(#addRoutine, [routine])), + ), + ) as _i13.Future<_i5.Routine>); + + @override + _i13.Future editRoutine(_i5.Routine? routine) => (super.noSuchMethod( + Invocation.method(#editRoutine, [routine]), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); + + @override + _i13.Future deleteRoutine(int? id) => (super.noSuchMethod( + Invocation.method(#deleteRoutine, [id]), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); + + @override + _i13.Future fetchAndSetRepetitionUnits() => (super.noSuchMethod( + Invocation.method(#fetchAndSetRepetitionUnits, []), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); + + @override + _i13.Future fetchAndSetWeightUnits() => (super.noSuchMethod( + Invocation.method(#fetchAndSetWeightUnits, []), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); + + @override + _i13.Future fetchAndSetUnits() => (super.noSuchMethod( + Invocation.method(#fetchAndSetUnits, []), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); + + @override + _i13.Future<_i6.Day> addDay(_i6.Day? day) => (super.noSuchMethod( + Invocation.method(#addDay, [day]), + returnValue: _i13.Future<_i6.Day>.value( + _FakeDay_4(this, Invocation.method(#addDay, [day])), + ), + ) as _i13.Future<_i6.Day>); + + @override + _i13.Future editDay(_i6.Day? day) => (super.noSuchMethod( + Invocation.method(#editDay, [day]), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); + + @override + _i13.Future editDays(List<_i6.Day>? days) => (super.noSuchMethod( + Invocation.method(#editDays, [days]), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); + + @override + _i13.Future deleteDay(int? dayId) => (super.noSuchMethod( + Invocation.method(#deleteDay, [dayId]), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); + + @override + _i13.Future<_i7.Slot> addSlot(_i7.Slot? slot, int? routineId) => (super.noSuchMethod( + Invocation.method(#addSlot, [slot, routineId]), + returnValue: _i13.Future<_i7.Slot>.value( + _FakeSlot_5(this, Invocation.method(#addSlot, [slot, routineId])), + ), + ) as _i13.Future<_i7.Slot>); + + @override + _i13.Future deleteSlot(int? slotId, int? routineId) => (super.noSuchMethod( + Invocation.method(#deleteSlot, [slotId, routineId]), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); + + @override + _i13.Future editSlot(_i7.Slot? slot, int? routineId) => (super.noSuchMethod( + Invocation.method(#editSlot, [slot, routineId]), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); + + @override + _i13.Future editSlots(List<_i7.Slot>? slots, int? routineId) => (super.noSuchMethod( + Invocation.method(#editSlots, [slots, routineId]), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); + + @override + _i13.Future<_i8.SlotEntry> addSlotEntry( + _i8.SlotEntry? entry, + int? routineId, + ) => + (super.noSuchMethod( + Invocation.method(#addSlotEntry, [entry, routineId]), + returnValue: _i13.Future<_i8.SlotEntry>.value( + _FakeSlotEntry_6( + this, + Invocation.method(#addSlotEntry, [entry, routineId]), + ), + ), + ) as _i13.Future<_i8.SlotEntry>); + + @override + _i13.Future deleteSlotEntry(int? id, int? routineId) => (super.noSuchMethod( + Invocation.method(#deleteSlotEntry, [id, routineId]), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); + + @override + _i13.Future editSlotEntry(_i8.SlotEntry? entry, int? routineId) => (super.noSuchMethod( + Invocation.method(#editSlotEntry, [entry, routineId]), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); + + @override + String getConfigUrl(_i8.ConfigType? type) => (super.noSuchMethod( + Invocation.method(#getConfigUrl, [type]), + returnValue: _i15.dummyValue( + this, + Invocation.method(#getConfigUrl, [type]), + ), + ) as String); + + @override + _i13.Future<_i9.BaseConfig> editConfig( + _i9.BaseConfig? config, + _i8.ConfigType? type, + ) => + (super.noSuchMethod( + Invocation.method(#editConfig, [config, type]), + returnValue: _i13.Future<_i9.BaseConfig>.value( + _FakeBaseConfig_7( + this, + Invocation.method(#editConfig, [config, type]), + ), + ), + ) as _i13.Future<_i9.BaseConfig>); + + @override + _i13.Future<_i9.BaseConfig> addConfig( + _i9.BaseConfig? config, + _i8.ConfigType? type, + ) => + (super.noSuchMethod( + Invocation.method(#addConfig, [config, type]), + returnValue: _i13.Future<_i9.BaseConfig>.value( + _FakeBaseConfig_7( + this, + Invocation.method(#addConfig, [config, type]), + ), + ), + ) as _i13.Future<_i9.BaseConfig>); + + @override + _i13.Future deleteConfig(int? id, _i8.ConfigType? type) => (super.noSuchMethod( + Invocation.method(#deleteConfig, [id, type]), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); + + @override + _i13.Future handleConfig( + _i8.SlotEntry? entry, + String? input, + _i8.ConfigType? type, + ) => + (super.noSuchMethod( + Invocation.method(#handleConfig, [entry, input, type]), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); + + @override + _i13.Future> fetchSessionData() => (super.noSuchMethod( + Invocation.method(#fetchSessionData, []), + returnValue: _i13.Future>.value( + <_i10.WorkoutSession>[], + ), + ) as _i13.Future>); + + @override + _i13.Future<_i10.WorkoutSession> addSession( + _i10.WorkoutSession? session, + int? routineId, + ) => + (super.noSuchMethod( + Invocation.method(#addSession, [session, routineId]), + returnValue: _i13.Future<_i10.WorkoutSession>.value( + _FakeWorkoutSession_8( + this, + Invocation.method(#addSession, [session, routineId]), + ), + ), + ) as _i13.Future<_i10.WorkoutSession>); + + @override + _i13.Future<_i10.WorkoutSession> editSession(_i10.WorkoutSession? session) => (super.noSuchMethod( + Invocation.method(#editSession, [session]), + returnValue: _i13.Future<_i10.WorkoutSession>.value( + _FakeWorkoutSession_8( + this, + Invocation.method(#editSession, [session]), + ), + ), + ) as _i13.Future<_i10.WorkoutSession>); + + @override + _i13.Future<_i11.Log> addLog(_i11.Log? log) => (super.noSuchMethod( + Invocation.method(#addLog, [log]), + returnValue: _i13.Future<_i11.Log>.value( + _FakeLog_9(this, Invocation.method(#addLog, [log])), + ), + ) as _i13.Future<_i11.Log>); + + @override + _i13.Future deleteLog(_i11.Log? log) => (super.noSuchMethod( + Invocation.method(#deleteLog, [log]), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); + + @override + void addListener(_i16.VoidCallback? listener) => super.noSuchMethod( + Invocation.method(#addListener, [listener]), + returnValueForMissingStub: null, + ); + + @override + void removeListener(_i16.VoidCallback? listener) => super.noSuchMethod( + Invocation.method(#removeListener, [listener]), + returnValueForMissingStub: null, + ); + + @override + void dispose() => super.noSuchMethod( + Invocation.method(#dispose, []), + returnValueForMissingStub: null, + ); + + @override + void notifyListeners() => super.noSuchMethod( + Invocation.method(#notifyListeners, []), + returnValueForMissingStub: null, + ); +} diff --git a/test/workout/routine_logs_screen_test.dart b/test/workout/routine_logs_screen_test.dart new file mode 100644 index 000000000..e1cad8ab4 --- /dev/null +++ b/test/workout/routine_logs_screen_test.dart @@ -0,0 +1,90 @@ +/* + * This file is part of wger Workout Manager . + * Copyright (C) 2020, 2021 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. + * + * wger Workout Manager 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 'dart:io'; + +import 'package:flutter/material.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:golden_toolkit/golden_toolkit.dart'; +import 'package:mockito/annotations.dart'; +import 'package:provider/provider.dart'; +import 'package:wger/l10n/generated/app_localizations.dart'; +import 'package:wger/models/workouts/routine.dart'; +import 'package:wger/providers/routines.dart'; +import 'package:wger/screens/routine_logs_screen.dart'; +import 'package:wger/screens/routine_screen.dart'; + +import '../../test_data/routines.dart'; +import 'routine_logs_screen_test.mocks.dart'; + +@GenerateMocks([RoutinesProvider]) +void main() { + late Routine routine; + final mockRoutinesProvider = MockRoutinesProvider(); + + setUp(() { + routine = getTestRoutine(); + routine.logs[0].date = DateTime.now(); + }); + + Widget renderWidget({locale = 'en'}) { + final key = GlobalKey(); + + return ChangeNotifierProvider( + create: (context) => mockRoutinesProvider, + child: MaterialApp( + locale: Locale(locale), + localizationsDelegates: AppLocalizations.localizationsDelegates, + supportedLocales: AppLocalizations.supportedLocales, + navigatorKey: key, + home: TextButton( + onPressed: () => key.currentState!.push( + MaterialPageRoute( + settings: RouteSettings(arguments: routine), + builder: (_) => const WorkoutLogsScreen(), + ), + ), + child: const SizedBox(), + ), + routes: { + RoutineScreen.routeName: (ctx) => const WorkoutLogsScreen(), + }, + ), + ); + } + + testGoldens('Test the widgets on the routine logs screen', (WidgetTester tester) async { + await loadAppFonts(); + await tester.pumpWidget(renderWidget()); + await tester.tap(find.byType(TextButton)); + await tester.pumpAndSettle(); + + await screenMatchesGolden(tester, 'routine_logs_screen_detail', skip: !Platform.isLinux); + + // expect(find.text('3 day workout'), findsOneWidget); + + // expect(find.text('first day'), findsOneWidget); + // expect(find.text('chest, shoulders'), findsOneWidget); + + // The second day is repeated + // expect(find.text('second day'), findsNWidgets(2)); + // expect(find.text('legs'), findsNWidgets(2)); + + // expect(find.byType(Card), findsNWidgets(3)); + }); +} diff --git a/test/workout/routine_logs_screen_test.mocks.dart b/test/workout/routine_logs_screen_test.mocks.dart new file mode 100644 index 000000000..46b705680 --- /dev/null +++ b/test/workout/routine_logs_screen_test.mocks.dart @@ -0,0 +1,509 @@ +// Mocks generated by Mockito 5.4.5 from annotations +// in wger/test/workout/routine_logs_screen_test.dart. +// Do not manually edit this file. + +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'dart:async' as _i13; +import 'dart:ui' as _i16; + +import 'package:mockito/mockito.dart' as _i1; +import 'package:mockito/src/dummies.dart' as _i15; +import 'package:wger/models/workouts/base_config.dart' as _i9; +import 'package:wger/models/workouts/day.dart' as _i6; +import 'package:wger/models/workouts/day_data.dart' as _i14; +import 'package:wger/models/workouts/log.dart' as _i11; +import 'package:wger/models/workouts/repetition_unit.dart' as _i4; +import 'package:wger/models/workouts/routine.dart' as _i5; +import 'package:wger/models/workouts/session.dart' as _i10; +import 'package:wger/models/workouts/slot.dart' as _i7; +import 'package:wger/models/workouts/slot_entry.dart' as _i8; +import 'package:wger/models/workouts/weight_unit.dart' as _i3; +import 'package:wger/providers/base_provider.dart' as _i2; +import 'package:wger/providers/routines.dart' as _i12; + +// ignore_for_file: type=lint +// ignore_for_file: avoid_redundant_argument_values +// ignore_for_file: avoid_setters_without_getters +// ignore_for_file: comment_references +// ignore_for_file: deprecated_member_use +// ignore_for_file: deprecated_member_use_from_same_package +// ignore_for_file: implementation_imports +// ignore_for_file: invalid_use_of_visible_for_testing_member +// ignore_for_file: must_be_immutable +// ignore_for_file: prefer_const_constructors +// ignore_for_file: unnecessary_parenthesis +// ignore_for_file: camel_case_types +// ignore_for_file: subtype_of_sealed_class + +class _FakeWgerBaseProvider_0 extends _i1.SmartFake implements _i2.WgerBaseProvider { + _FakeWgerBaseProvider_0(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); +} + +class _FakeWeightUnit_1 extends _i1.SmartFake implements _i3.WeightUnit { + _FakeWeightUnit_1(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); +} + +class _FakeRepetitionUnit_2 extends _i1.SmartFake implements _i4.RepetitionUnit { + _FakeRepetitionUnit_2(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); +} + +class _FakeRoutine_3 extends _i1.SmartFake implements _i5.Routine { + _FakeRoutine_3(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); +} + +class _FakeDay_4 extends _i1.SmartFake implements _i6.Day { + _FakeDay_4(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); +} + +class _FakeSlot_5 extends _i1.SmartFake implements _i7.Slot { + _FakeSlot_5(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); +} + +class _FakeSlotEntry_6 extends _i1.SmartFake implements _i8.SlotEntry { + _FakeSlotEntry_6(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); +} + +class _FakeBaseConfig_7 extends _i1.SmartFake implements _i9.BaseConfig { + _FakeBaseConfig_7(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); +} + +class _FakeWorkoutSession_8 extends _i1.SmartFake implements _i10.WorkoutSession { + _FakeWorkoutSession_8(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); +} + +class _FakeLog_9 extends _i1.SmartFake implements _i11.Log { + _FakeLog_9(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); +} + +/// A class which mocks [RoutinesProvider]. +/// +/// See the documentation for Mockito's code generation for more information. +class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { + MockRoutinesProvider() { + _i1.throwOnMissingStub(this); + } + + @override + _i2.WgerBaseProvider get baseProvider => (super.noSuchMethod( + Invocation.getter(#baseProvider), + returnValue: _FakeWgerBaseProvider_0( + this, + Invocation.getter(#baseProvider), + ), + ) as _i2.WgerBaseProvider); + + @override + List<_i5.Routine> get items => (super.noSuchMethod( + Invocation.getter(#items), + returnValue: <_i5.Routine>[], + ) as List<_i5.Routine>); + + @override + List<_i3.WeightUnit> get weightUnits => (super.noSuchMethod( + Invocation.getter(#weightUnits), + returnValue: <_i3.WeightUnit>[], + ) as List<_i3.WeightUnit>); + + @override + set weightUnits(List<_i3.WeightUnit>? weightUnits) => super.noSuchMethod( + Invocation.setter(#weightUnits, weightUnits), + returnValueForMissingStub: null, + ); + + @override + _i3.WeightUnit get defaultWeightUnit => (super.noSuchMethod( + Invocation.getter(#defaultWeightUnit), + returnValue: _FakeWeightUnit_1( + this, + Invocation.getter(#defaultWeightUnit), + ), + ) as _i3.WeightUnit); + + @override + List<_i4.RepetitionUnit> get repetitionUnits => (super.noSuchMethod( + Invocation.getter(#repetitionUnits), + returnValue: <_i4.RepetitionUnit>[], + ) as List<_i4.RepetitionUnit>); + + @override + set repetitionUnits(List<_i4.RepetitionUnit>? repetitionUnits) => super.noSuchMethod( + Invocation.setter(#repetitionUnits, repetitionUnits), + returnValueForMissingStub: null, + ); + + @override + _i4.RepetitionUnit get defaultRepetitionUnit => (super.noSuchMethod( + Invocation.getter(#defaultRepetitionUnit), + returnValue: _FakeRepetitionUnit_2( + this, + Invocation.getter(#defaultRepetitionUnit), + ), + ) as _i4.RepetitionUnit); + + @override + bool get hasListeners => + (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) as bool); + + @override + void clear() => super.noSuchMethod( + Invocation.method(#clear, []), + returnValueForMissingStub: null, + ); + + @override + _i3.WeightUnit findWeightUnitById(int? id) => (super.noSuchMethod( + Invocation.method(#findWeightUnitById, [id]), + returnValue: _FakeWeightUnit_1( + this, + Invocation.method(#findWeightUnitById, [id]), + ), + ) as _i3.WeightUnit); + + @override + _i4.RepetitionUnit findRepetitionUnitById(int? id) => (super.noSuchMethod( + Invocation.method(#findRepetitionUnitById, [id]), + returnValue: _FakeRepetitionUnit_2( + this, + Invocation.method(#findRepetitionUnitById, [id]), + ), + ) as _i4.RepetitionUnit); + + @override + List<_i5.Routine> getPlans() => (super.noSuchMethod( + Invocation.method(#getPlans, []), + returnValue: <_i5.Routine>[], + ) as List<_i5.Routine>); + + @override + _i5.Routine findById(int? id) => (super.noSuchMethod( + Invocation.method(#findById, [id]), + returnValue: _FakeRoutine_3( + this, + Invocation.method(#findById, [id]), + ), + ) as _i5.Routine); + + @override + int findIndexById(int? id) => (super.noSuchMethod( + Invocation.method(#findIndexById, [id]), + returnValue: 0, + ) as int); + + @override + void setCurrentPlan(int? id) => super.noSuchMethod( + Invocation.method(#setCurrentPlan, [id]), + returnValueForMissingStub: null, + ); + + @override + void resetCurrentRoutine() => super.noSuchMethod( + Invocation.method(#resetCurrentRoutine, []), + returnValueForMissingStub: null, + ); + + @override + _i13.Future fetchAndSetAllRoutinesFull() => (super.noSuchMethod( + Invocation.method(#fetchAndSetAllRoutinesFull, []), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); + + @override + _i13.Future fetchAndSetAllPlansSparse() => (super.noSuchMethod( + Invocation.method(#fetchAndSetAllPlansSparse, []), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); + + @override + void setExercisesAndUnits(List<_i14.DayData>? entries) => super.noSuchMethod( + Invocation.method(#setExercisesAndUnits, [entries]), + returnValueForMissingStub: null, + ); + + @override + _i13.Future<_i5.Routine> fetchAndSetRoutineSparse(int? planId) => (super.noSuchMethod( + Invocation.method(#fetchAndSetRoutineSparse, [planId]), + returnValue: _i13.Future<_i5.Routine>.value( + _FakeRoutine_3( + this, + Invocation.method(#fetchAndSetRoutineSparse, [planId]), + ), + ), + ) as _i13.Future<_i5.Routine>); + + @override + _i13.Future<_i5.Routine> fetchAndSetRoutineFull(int? routineId) => (super.noSuchMethod( + Invocation.method(#fetchAndSetRoutineFull, [routineId]), + returnValue: _i13.Future<_i5.Routine>.value( + _FakeRoutine_3( + this, + Invocation.method(#fetchAndSetRoutineFull, [routineId]), + ), + ), + ) as _i13.Future<_i5.Routine>); + + @override + _i13.Future<_i5.Routine> addRoutine(_i5.Routine? routine) => (super.noSuchMethod( + Invocation.method(#addRoutine, [routine]), + returnValue: _i13.Future<_i5.Routine>.value( + _FakeRoutine_3(this, Invocation.method(#addRoutine, [routine])), + ), + ) as _i13.Future<_i5.Routine>); + + @override + _i13.Future editRoutine(_i5.Routine? routine) => (super.noSuchMethod( + Invocation.method(#editRoutine, [routine]), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); + + @override + _i13.Future deleteRoutine(int? id) => (super.noSuchMethod( + Invocation.method(#deleteRoutine, [id]), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); + + @override + _i13.Future fetchAndSetRepetitionUnits() => (super.noSuchMethod( + Invocation.method(#fetchAndSetRepetitionUnits, []), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); + + @override + _i13.Future fetchAndSetWeightUnits() => (super.noSuchMethod( + Invocation.method(#fetchAndSetWeightUnits, []), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); + + @override + _i13.Future fetchAndSetUnits() => (super.noSuchMethod( + Invocation.method(#fetchAndSetUnits, []), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); + + @override + _i13.Future<_i6.Day> addDay(_i6.Day? day) => (super.noSuchMethod( + Invocation.method(#addDay, [day]), + returnValue: _i13.Future<_i6.Day>.value( + _FakeDay_4(this, Invocation.method(#addDay, [day])), + ), + ) as _i13.Future<_i6.Day>); + + @override + _i13.Future editDay(_i6.Day? day) => (super.noSuchMethod( + Invocation.method(#editDay, [day]), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); + + @override + _i13.Future editDays(List<_i6.Day>? days) => (super.noSuchMethod( + Invocation.method(#editDays, [days]), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); + + @override + _i13.Future deleteDay(int? dayId) => (super.noSuchMethod( + Invocation.method(#deleteDay, [dayId]), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); + + @override + _i13.Future<_i7.Slot> addSlot(_i7.Slot? slot, int? routineId) => (super.noSuchMethod( + Invocation.method(#addSlot, [slot, routineId]), + returnValue: _i13.Future<_i7.Slot>.value( + _FakeSlot_5(this, Invocation.method(#addSlot, [slot, routineId])), + ), + ) as _i13.Future<_i7.Slot>); + + @override + _i13.Future deleteSlot(int? slotId, int? routineId) => (super.noSuchMethod( + Invocation.method(#deleteSlot, [slotId, routineId]), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); + + @override + _i13.Future editSlot(_i7.Slot? slot, int? routineId) => (super.noSuchMethod( + Invocation.method(#editSlot, [slot, routineId]), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); + + @override + _i13.Future editSlots(List<_i7.Slot>? slots, int? routineId) => (super.noSuchMethod( + Invocation.method(#editSlots, [slots, routineId]), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); + + @override + _i13.Future<_i8.SlotEntry> addSlotEntry( + _i8.SlotEntry? entry, + int? routineId, + ) => + (super.noSuchMethod( + Invocation.method(#addSlotEntry, [entry, routineId]), + returnValue: _i13.Future<_i8.SlotEntry>.value( + _FakeSlotEntry_6( + this, + Invocation.method(#addSlotEntry, [entry, routineId]), + ), + ), + ) as _i13.Future<_i8.SlotEntry>); + + @override + _i13.Future deleteSlotEntry(int? id, int? routineId) => (super.noSuchMethod( + Invocation.method(#deleteSlotEntry, [id, routineId]), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); + + @override + _i13.Future editSlotEntry(_i8.SlotEntry? entry, int? routineId) => (super.noSuchMethod( + Invocation.method(#editSlotEntry, [entry, routineId]), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); + + @override + String getConfigUrl(_i8.ConfigType? type) => (super.noSuchMethod( + Invocation.method(#getConfigUrl, [type]), + returnValue: _i15.dummyValue( + this, + Invocation.method(#getConfigUrl, [type]), + ), + ) as String); + + @override + _i13.Future<_i9.BaseConfig> editConfig( + _i9.BaseConfig? config, + _i8.ConfigType? type, + ) => + (super.noSuchMethod( + Invocation.method(#editConfig, [config, type]), + returnValue: _i13.Future<_i9.BaseConfig>.value( + _FakeBaseConfig_7( + this, + Invocation.method(#editConfig, [config, type]), + ), + ), + ) as _i13.Future<_i9.BaseConfig>); + + @override + _i13.Future<_i9.BaseConfig> addConfig( + _i9.BaseConfig? config, + _i8.ConfigType? type, + ) => + (super.noSuchMethod( + Invocation.method(#addConfig, [config, type]), + returnValue: _i13.Future<_i9.BaseConfig>.value( + _FakeBaseConfig_7( + this, + Invocation.method(#addConfig, [config, type]), + ), + ), + ) as _i13.Future<_i9.BaseConfig>); + + @override + _i13.Future deleteConfig(int? id, _i8.ConfigType? type) => (super.noSuchMethod( + Invocation.method(#deleteConfig, [id, type]), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); + + @override + _i13.Future handleConfig( + _i8.SlotEntry? entry, + String? input, + _i8.ConfigType? type, + ) => + (super.noSuchMethod( + Invocation.method(#handleConfig, [entry, input, type]), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); + + @override + _i13.Future> fetchSessionData() => (super.noSuchMethod( + Invocation.method(#fetchSessionData, []), + returnValue: _i13.Future>.value( + <_i10.WorkoutSession>[], + ), + ) as _i13.Future>); + + @override + _i13.Future<_i10.WorkoutSession> addSession( + _i10.WorkoutSession? session, + int? routineId, + ) => + (super.noSuchMethod( + Invocation.method(#addSession, [session, routineId]), + returnValue: _i13.Future<_i10.WorkoutSession>.value( + _FakeWorkoutSession_8( + this, + Invocation.method(#addSession, [session, routineId]), + ), + ), + ) as _i13.Future<_i10.WorkoutSession>); + + @override + _i13.Future<_i10.WorkoutSession> editSession(_i10.WorkoutSession? session) => (super.noSuchMethod( + Invocation.method(#editSession, [session]), + returnValue: _i13.Future<_i10.WorkoutSession>.value( + _FakeWorkoutSession_8( + this, + Invocation.method(#editSession, [session]), + ), + ), + ) as _i13.Future<_i10.WorkoutSession>); + + @override + _i13.Future<_i11.Log> addLog(_i11.Log? log) => (super.noSuchMethod( + Invocation.method(#addLog, [log]), + returnValue: _i13.Future<_i11.Log>.value( + _FakeLog_9(this, Invocation.method(#addLog, [log])), + ), + ) as _i13.Future<_i11.Log>); + + @override + _i13.Future deleteLog(_i11.Log? log) => (super.noSuchMethod( + Invocation.method(#deleteLog, [log]), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); + + @override + void addListener(_i16.VoidCallback? listener) => super.noSuchMethod( + Invocation.method(#addListener, [listener]), + returnValueForMissingStub: null, + ); + + @override + void removeListener(_i16.VoidCallback? listener) => super.noSuchMethod( + Invocation.method(#removeListener, [listener]), + returnValueForMissingStub: null, + ); + + @override + void dispose() => super.noSuchMethod( + Invocation.method(#dispose, []), + returnValueForMissingStub: null, + ); + + @override + void notifyListeners() => super.noSuchMethod( + Invocation.method(#notifyListeners, []), + returnValueForMissingStub: null, + ); +} diff --git a/test/workout/workout_plan_model_test.dart b/test/workout/routine_model_test.dart similarity index 63% rename from test/workout/workout_plan_model_test.dart rename to test/workout/routine_model_test.dart index 57be4bb30..2ec646a04 100644 --- a/test/workout/workout_plan_model_test.dart +++ b/test/workout/routine_model_test.dart @@ -18,25 +18,35 @@ import 'package:flutter_test/flutter_test.dart'; -import '../../test_data/exercises.dart'; -import '../../test_data/workouts.dart'; +import '../../test_data/routines.dart'; void main() { group('model tests', () { test('Test the filterLogsByExercise method', () { - final workout = getWorkout(); + final routine = getTestRoutine(); - expect(workout.logs.length, 3); - final logExercise1 = workout.filterLogsByExerciseBase(getTestExercises()[0]); + expect(routine.logs.length, 3); + final logExercise1 = routine.filterLogsByExercise(1); expect(logExercise1.length, 2); expect(logExercise1[0].id, 1); expect(logExercise1[1].id, 2); - final logExercise2 = workout.filterLogsByExerciseBase(getTestExercises()[1]); + final logExercise2 = routine.filterLogsByExercise(2); expect(logExercise2.length, 1); expect(logExercise2[0].id, 3); - expect(workout.filterLogsByExerciseBase(getTestExercises()[2]).length, 0); + expect(routine.filterLogsByExercise(3).length, 0); + }); + + test('Test the groupLogsByRepetition method', () { + final routine = getTestRoutine(); + + expect(routine.logs.length, 3); + final result = routine.groupLogsByRepetition(); + expect(result.keys, [10, 12, 8]); + expect(result[8], [routine.logs[2]]); + expect(result[10], [routine.logs[0]]); + expect(result[12], [routine.logs[1]]); }); }); } diff --git a/test/workout/workout_plan_screen_test.dart b/test/workout/routine_screen_test.dart similarity index 58% rename from test/workout/workout_plan_screen_test.dart rename to test/workout/routine_screen_test.dart index b3bad988f..8f3e4c14f 100644 --- a/test/workout/workout_plan_screen_test.dart +++ b/test/workout/routine_screen_test.dart @@ -16,20 +16,23 @@ * along with this program. If not, see . */ +import 'dart:io'; + import 'package:drift/native.dart'; import 'package:flutter/material.dart'; -import 'package:flutter_gen/gen_l10n/app_localizations.dart'; import 'package:flutter_test/flutter_test.dart'; +import 'package:golden_toolkit/golden_toolkit.dart'; import 'package:mockito/annotations.dart'; import 'package:provider/provider.dart'; import 'package:wger/database/exercises/exercise_database.dart'; +import 'package:wger/l10n/generated/app_localizations.dart'; import 'package:wger/providers/base_provider.dart'; import 'package:wger/providers/exercises.dart'; -import 'package:wger/providers/workout_plans.dart'; -import 'package:wger/screens/workout_plan_screen.dart'; +import 'package:wger/providers/routines.dart'; +import 'package:wger/screens/routine_screen.dart'; -import '../../test_data/workouts.dart'; -import 'workout_plan_screen_test.mocks.dart'; +import '../../test_data/routines.dart'; +import 'routine_screen_test.mocks.dart'; @GenerateMocks([WgerBaseProvider]) void main() { @@ -38,11 +41,16 @@ void main() { mockBaseProvider, database: ExerciseDatabase.inMemory(NativeDatabase.memory()), ); - Widget createHomeScreen({locale = 'en'}) { + + Widget renderWidget({locale = 'en'}) { final key = GlobalKey(); - return ChangeNotifierProvider( - create: (context) => WorkoutPlansProvider(mockBaseProvider, exercisesProvider, []), + return ChangeNotifierProvider( + create: (context) => RoutinesProvider( + mockBaseProvider, + exercisesProvider, + [getTestRoutine()], + ), child: MaterialApp( locale: Locale(locale), localizationsDelegates: AppLocalizations.localizationsDelegates, @@ -51,45 +59,34 @@ void main() { home: TextButton( onPressed: () => key.currentState!.push( MaterialPageRoute( - settings: RouteSettings(arguments: getWorkout()), - builder: (_) => const WorkoutPlanScreen(), + settings: const RouteSettings(arguments: 1), + builder: (_) => const RoutineScreen(), ), ), child: const SizedBox(), ), - routes: { - WorkoutPlanScreen.routeName: (ctx) => const WorkoutPlanScreen(), - }, + routes: {RoutineScreen.routeName: (ctx) => const RoutineScreen()}, ), ); } - testWidgets('Test the widgets on the nutritional plan screen', (WidgetTester tester) async { - await tester.pumpWidget(createHomeScreen()); + testGoldens('Test the widgets on the routine screen', (WidgetTester tester) async { + await loadAppFonts(); + await tester.pumpWidget(renderWidget()); await tester.tap(find.byType(TextButton)); await tester.pumpAndSettle(); + await screenMatchesGolden(tester, 'routine_screen_detail', skip: !Platform.isLinux); + expect(find.text('3 day workout'), findsOneWidget); + + expect(find.text('first day'), findsOneWidget); expect(find.text('chest, shoulders'), findsOneWidget); + + expect(find.text('second day'), findsOneWidget); expect(find.text('legs'), findsOneWidget); - expect(find.byType(Card), findsNWidgets(2)); - }); - testWidgets('Tests the localization of times - EN', (WidgetTester tester) async { - await tester.pumpWidget(createHomeScreen()); - await tester.tap(find.byType(TextButton)); - await tester.pumpAndSettle(); - - expect(find.text('Monday, Tuesday'), findsOneWidget); - expect(find.text('Thursday'), findsOneWidget); - }); - - testWidgets('Tests the localization of times - DE', (WidgetTester tester) async { - await tester.pumpWidget(createHomeScreen(locale: 'de')); - await tester.tap(find.byType(TextButton)); - await tester.pumpAndSettle(); - - expect(find.text('Montag, Dienstag'), findsOneWidget); - expect(find.text('Donnerstag'), findsOneWidget); + expect(find.byType(Card), findsWidgets); + // expect(find.byType(Card), findsNWidgets(4)); }); } diff --git a/test/workout/workout_provider_test.mocks.dart b/test/workout/routine_screen_test.mocks.dart similarity index 94% rename from test/workout/workout_provider_test.mocks.dart rename to test/workout/routine_screen_test.mocks.dart index bf831382a..4edf94096 100644 --- a/test/workout/workout_provider_test.mocks.dart +++ b/test/workout/routine_screen_test.mocks.dart @@ -1,5 +1,5 @@ // Mocks generated by Mockito 5.4.5 from annotations -// in wger/test/workout/workout_provider_test.dart. +// in wger/test/workout/routine_screen_test.dart. // Do not manually edit this file. // ignore_for_file: no_leading_underscores_for_library_prefixes @@ -104,12 +104,10 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider { ) as Uri); @override - _i5.Future> fetch(Uri? uri) => (super.noSuchMethod( + _i5.Future fetch(Uri? uri) => (super.noSuchMethod( Invocation.method(#fetch, [uri]), - returnValue: _i5.Future>.value( - {}, - ), - ) as _i5.Future>); + returnValue: _i5.Future.value(), + ) as _i5.Future); @override _i5.Future> fetchPaginated(Uri? uri) => (super.noSuchMethod( diff --git a/test/workout/workout_provider_test.dart b/test/workout/routines_provider_test.dart similarity index 61% rename from test/workout/workout_provider_test.dart rename to test/workout/routines_provider_test.dart index d6a17e4e3..8f16666fc 100644 --- a/test/workout/workout_provider_test.dart +++ b/test/workout/routines_provider_test.dart @@ -27,16 +27,18 @@ import 'package:shared_preferences/shared_preferences.dart'; import 'package:wger/core/locator.dart'; import 'package:wger/helpers/consts.dart'; import 'package:wger/models/workouts/repetition_unit.dart'; +import 'package:wger/models/workouts/routine.dart'; import 'package:wger/models/workouts/weight_unit.dart'; -import 'package:wger/models/workouts/workout_plan.dart'; import 'package:wger/providers/base_provider.dart'; import 'package:wger/providers/exercises.dart'; -import 'package:wger/providers/workout_plans.dart'; +import 'package:wger/providers/routines.dart'; +import '../../test_data/exercises.dart'; +import '../../test_data/routines.dart'; import '../fixtures/fixture_reader.dart'; -import 'workout_provider_test.mocks.dart'; +import 'routines_provider_test.mocks.dart'; -@GenerateMocks([WgerBaseProvider]) +@GenerateMocks([WgerBaseProvider, ExercisesProvider]) void main() { final mockBaseProvider = MockWgerBaseProvider(); @@ -49,24 +51,27 @@ void main() { test('Test fetching and setting a plan', () async { final exercisesProvider = ExercisesProvider(mockBaseProvider); - final uri = Uri.https('localhost', 'api/v2/workout/325397/'); - when(mockBaseProvider.makeUrl('workout', id: 325397)).thenReturn(uri); + final uri = Uri.https('localhost', 'api/v2/routine/325397/'); + when(mockBaseProvider.makeUrl('routine', id: 325397)).thenReturn(uri); when(mockBaseProvider.fetch(uri)).thenAnswer( (_) async => Future.value({ 'id': 325397, + 'created': '2022-10-10', 'name': 'Test workout', - 'creation_date': '2022-10-10', 'description': 'Test workout abcd', + 'start': '2021-12-20', + 'end': '2022-06-06', + 'fit_in_week': false, }), ); // Load the entries - final provider = WorkoutPlansProvider(mockBaseProvider, exercisesProvider, []); - final plan = await provider.fetchAndSetPlanSparse(325397); + final provider = RoutinesProvider(mockBaseProvider, exercisesProvider, []); + final plan = await provider.fetchAndSetRoutineSparse(325397); final plans = provider.getPlans(); // Check that everything is ok - expect(plan, isA()); + expect(plan, isA()); expect(plan.id, 325397); expect(plan.description, 'Test workout abcd'); expect(plans.length, 1); @@ -84,15 +89,15 @@ void main() { 'description': 'Test workout abcd', }), ); - when(mockBaseProvider.deleteRequest('workout', 325397)).thenAnswer( + when(mockBaseProvider.deleteRequest('routine', 325397)).thenAnswer( (_) => Future.value(Response('', 204)), ); // Load the entries - final provider = WorkoutPlansProvider(mockBaseProvider, exercisesProvider, []); + final provider = RoutinesProvider(mockBaseProvider, exercisesProvider, []); - await provider.fetchAndSetPlanSparse(325397); - await provider.deleteWorkout(325397); + await provider.fetchAndSetRoutineSparse(325397); + await provider.deleteRoutine(325397); final plans = provider.getPlans(); expect(plans.length, 0); }); @@ -107,7 +112,7 @@ void main() { .thenAnswer((_) => Future.value(tRepetitionUnits['results'])); // Load the entries - final provider = WorkoutPlansProvider(mockBaseProvider, exercisesProvider, []); + final provider = RoutinesProvider(mockBaseProvider, exercisesProvider, []); await provider.fetchAndSetRepetitionUnits(); final repetitionUnits = provider.repetitionUnits; @@ -124,7 +129,7 @@ void main() { final ExercisesProvider testExercisesProvider = ExercisesProvider(mockBaseProvider); // Load the entries - final provider = WorkoutPlansProvider(mockBaseProvider, testExercisesProvider, []); + final provider = RoutinesProvider(mockBaseProvider, testExercisesProvider, []); await provider.fetchAndSetWeightUnits(); final weightUnits = provider.weightUnits; @@ -151,7 +156,7 @@ void main() { final prefs = await SharedPreferences.getInstance(); // Load the entries - final provider = WorkoutPlansProvider(mockBaseProvider, exercisesProvider, []); + final provider = RoutinesProvider(mockBaseProvider, exercisesProvider, []); await provider.fetchAndSetUnits(); final prefsJson = jsonDecode(prefs.getString(PREFS_WORKOUT_UNITS)!); @@ -160,5 +165,62 @@ void main() { expect(true, DateTime.parse(prefsJson['date']).isBefore(DateTime.now())); expect(true, DateTime.parse(prefsJson['expiresIn']).isAfter(DateTime.now())); }); + + test('Smoke test fetchAndSetRoutineFull', () async { + //Arrange + final structureUri = Uri.https('localhost', 'api/v2/routine/101/structure/'); + when(mockBaseProvider.makeUrl('routine', objectMethod: 'structure', id: 101)) + .thenReturn(structureUri); + when(mockBaseProvider.fetch(structureUri)).thenAnswer((_) async => Future.value( + jsonDecode(fixture('routines/routine_structure.json')), + )); + + final dateSequenceDisplayUri = + Uri.https('localhost', 'api/v2/routine/101/date-sequence-display/'); + when(mockBaseProvider.makeUrl('routine', objectMethod: 'date-sequence-display', id: 101)) + .thenReturn(dateSequenceDisplayUri); + when(mockBaseProvider.fetch(dateSequenceDisplayUri)).thenAnswer((_) async => Future.value( + jsonDecode(fixture('routines/routine_date_sequence_display.json')), + )); + + final dateSequenceGymUri = Uri.https('localhost', 'api/v2/routine/101/date-sequence-gym/'); + when(mockBaseProvider.makeUrl('routine', objectMethod: 'date-sequence-gym', id: 101)) + .thenReturn(dateSequenceGymUri); + when(mockBaseProvider.fetch(dateSequenceGymUri)).thenAnswer((_) async => Future.value( + jsonDecode(fixture('routines/routine_date_sequence_gym.json')), + )); + + final logsUri = Uri.https('localhost', 'api/v2/routine/101/logs/'); + when(mockBaseProvider.makeUrl('routine', objectMethod: 'logs', id: 101)).thenReturn(logsUri); + when(mockBaseProvider.fetch(logsUri)).thenAnswer((_) async => Future.value( + jsonDecode(fixture('routines/routine_logs.json')), + )); + + final mockExercisesProvider = MockExercisesProvider(); + when(mockExercisesProvider.fetchAndSetExercise(76)).thenAnswer( + (_) async => Future.value(testBenchPress), + ); + when(mockExercisesProvider.fetchAndSetExercise(92)).thenAnswer( + (_) async => Future.value(testCrunches), + ); + + final provider = RoutinesProvider(mockBaseProvider, mockExercisesProvider, []); + provider.repetitionUnits = testRepetitionUnits; + provider.weightUnits = testWeightUnits; + + // Act + final result = await provider.fetchAndSetRoutineFull(101); + + // Assert + expect(result, isA()); + expect(result.id, 101); + expect(result.sessions.length, 3); + expect(result.days.length, 3); + expect(result.logs.length, 12); + expect(result.dayDataCurrentIteration.length, 8); + expect(result.dayDataCurrentIterationGym.length, 8); + expect(result.dayData.length, 32); + expect(result.dayDataGym.length, 32); + }); }); } diff --git a/test/workout/routines_provider_test.mocks.dart b/test/workout/routines_provider_test.mocks.dart new file mode 100644 index 000000000..2cdcce330 --- /dev/null +++ b/test/workout/routines_provider_test.mocks.dart @@ -0,0 +1,542 @@ +// Mocks generated by Mockito 5.4.5 from annotations +// in wger/test/workout/routines_provider_test.dart. +// Do not manually edit this file. + +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'dart:async' as _i11; +import 'dart:ui' as _i13; + +import 'package:http/http.dart' as _i3; +import 'package:mockito/mockito.dart' as _i1; +import 'package:wger/database/exercises/exercise_database.dart' as _i5; +import 'package:wger/models/exercises/category.dart' as _i7; +import 'package:wger/models/exercises/equipment.dart' as _i8; +import 'package:wger/models/exercises/exercise.dart' as _i6; +import 'package:wger/models/exercises/language.dart' as _i10; +import 'package:wger/models/exercises/muscle.dart' as _i9; +import 'package:wger/providers/auth.dart' as _i2; +import 'package:wger/providers/base_provider.dart' as _i4; +import 'package:wger/providers/exercises.dart' as _i12; + +// ignore_for_file: type=lint +// ignore_for_file: avoid_redundant_argument_values +// ignore_for_file: avoid_setters_without_getters +// ignore_for_file: comment_references +// ignore_for_file: deprecated_member_use +// ignore_for_file: deprecated_member_use_from_same_package +// ignore_for_file: implementation_imports +// ignore_for_file: invalid_use_of_visible_for_testing_member +// ignore_for_file: must_be_immutable +// ignore_for_file: prefer_const_constructors +// ignore_for_file: unnecessary_parenthesis +// ignore_for_file: camel_case_types +// ignore_for_file: subtype_of_sealed_class + +class _FakeAuthProvider_0 extends _i1.SmartFake implements _i2.AuthProvider { + _FakeAuthProvider_0(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); +} + +class _FakeClient_1 extends _i1.SmartFake implements _i3.Client { + _FakeClient_1(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); +} + +class _FakeUri_2 extends _i1.SmartFake implements Uri { + _FakeUri_2(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); +} + +class _FakeResponse_3 extends _i1.SmartFake implements _i3.Response { + _FakeResponse_3(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); +} + +class _FakeWgerBaseProvider_4 extends _i1.SmartFake implements _i4.WgerBaseProvider { + _FakeWgerBaseProvider_4(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); +} + +class _FakeExerciseDatabase_5 extends _i1.SmartFake implements _i5.ExerciseDatabase { + _FakeExerciseDatabase_5(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); +} + +class _FakeExercise_6 extends _i1.SmartFake implements _i6.Exercise { + _FakeExercise_6(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); +} + +class _FakeExerciseCategory_7 extends _i1.SmartFake implements _i7.ExerciseCategory { + _FakeExerciseCategory_7(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); +} + +class _FakeEquipment_8 extends _i1.SmartFake implements _i8.Equipment { + _FakeEquipment_8(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); +} + +class _FakeMuscle_9 extends _i1.SmartFake implements _i9.Muscle { + _FakeMuscle_9(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); +} + +class _FakeLanguage_10 extends _i1.SmartFake implements _i10.Language { + _FakeLanguage_10(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); +} + +/// A class which mocks [WgerBaseProvider]. +/// +/// See the documentation for Mockito's code generation for more information. +class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider { + MockWgerBaseProvider() { + _i1.throwOnMissingStub(this); + } + + @override + _i2.AuthProvider get auth => (super.noSuchMethod( + Invocation.getter(#auth), + returnValue: _FakeAuthProvider_0(this, Invocation.getter(#auth)), + ) as _i2.AuthProvider); + + @override + set auth(_i2.AuthProvider? _auth) => super.noSuchMethod( + Invocation.setter(#auth, _auth), + returnValueForMissingStub: null, + ); + + @override + _i3.Client get client => (super.noSuchMethod( + Invocation.getter(#client), + returnValue: _FakeClient_1(this, Invocation.getter(#client)), + ) as _i3.Client); + + @override + set client(_i3.Client? _client) => super.noSuchMethod( + Invocation.setter(#client, _client), + returnValueForMissingStub: null, + ); + + @override + Map getDefaultHeaders({bool? includeAuth = false}) => (super.noSuchMethod( + Invocation.method(#getDefaultHeaders, [], { + #includeAuth: includeAuth, + }), + returnValue: {}, + ) as Map); + + @override + Uri makeUrl( + String? path, { + int? id, + String? objectMethod, + Map? query, + }) => + (super.noSuchMethod( + Invocation.method( + #makeUrl, + [path], + {#id: id, #objectMethod: objectMethod, #query: query}, + ), + returnValue: _FakeUri_2( + this, + Invocation.method( + #makeUrl, + [path], + {#id: id, #objectMethod: objectMethod, #query: query}, + ), + ), + ) as Uri); + + @override + _i11.Future fetch(Uri? uri) => (super.noSuchMethod( + Invocation.method(#fetch, [uri]), + returnValue: _i11.Future.value(), + ) as _i11.Future); + + @override + _i11.Future> fetchPaginated(Uri? uri) => (super.noSuchMethod( + Invocation.method(#fetchPaginated, [uri]), + returnValue: _i11.Future>.value([]), + ) as _i11.Future>); + + @override + _i11.Future> post( + Map? data, + Uri? uri, + ) => + (super.noSuchMethod( + Invocation.method(#post, [data, uri]), + returnValue: _i11.Future>.value( + {}, + ), + ) as _i11.Future>); + + @override + _i11.Future> patch( + Map? data, + Uri? uri, + ) => + (super.noSuchMethod( + Invocation.method(#patch, [data, uri]), + returnValue: _i11.Future>.value( + {}, + ), + ) as _i11.Future>); + + @override + _i11.Future<_i3.Response> deleteRequest(String? url, int? id) => (super.noSuchMethod( + Invocation.method(#deleteRequest, [url, id]), + returnValue: _i11.Future<_i3.Response>.value( + _FakeResponse_3( + this, + Invocation.method(#deleteRequest, [url, id]), + ), + ), + ) as _i11.Future<_i3.Response>); +} + +/// A class which mocks [ExercisesProvider]. +/// +/// See the documentation for Mockito's code generation for more information. +class MockExercisesProvider extends _i1.Mock implements _i12.ExercisesProvider { + MockExercisesProvider() { + _i1.throwOnMissingStub(this); + } + + @override + _i4.WgerBaseProvider get baseProvider => (super.noSuchMethod( + Invocation.getter(#baseProvider), + returnValue: _FakeWgerBaseProvider_4( + this, + Invocation.getter(#baseProvider), + ), + ) as _i4.WgerBaseProvider); + + @override + _i5.ExerciseDatabase get database => (super.noSuchMethod( + Invocation.getter(#database), + returnValue: _FakeExerciseDatabase_5( + this, + Invocation.getter(#database), + ), + ) as _i5.ExerciseDatabase); + + @override + set database(_i5.ExerciseDatabase? _database) => super.noSuchMethod( + Invocation.setter(#database, _database), + returnValueForMissingStub: null, + ); + + @override + List<_i6.Exercise> get exercises => (super.noSuchMethod( + Invocation.getter(#exercises), + returnValue: <_i6.Exercise>[], + ) as List<_i6.Exercise>); + + @override + set exercises(List<_i6.Exercise>? _exercises) => super.noSuchMethod( + Invocation.setter(#exercises, _exercises), + returnValueForMissingStub: null, + ); + + @override + List<_i6.Exercise> get filteredExercises => (super.noSuchMethod( + Invocation.getter(#filteredExercises), + returnValue: <_i6.Exercise>[], + ) as List<_i6.Exercise>); + + @override + set filteredExercises(List<_i6.Exercise>? newFilteredExercises) => super.noSuchMethod( + Invocation.setter(#filteredExercises, newFilteredExercises), + returnValueForMissingStub: null, + ); + + @override + Map> get exerciseBasesByVariation => (super.noSuchMethod( + Invocation.getter(#exerciseBasesByVariation), + returnValue: >{}, + ) as Map>); + + @override + List<_i7.ExerciseCategory> get categories => (super.noSuchMethod( + Invocation.getter(#categories), + returnValue: <_i7.ExerciseCategory>[], + ) as List<_i7.ExerciseCategory>); + + @override + List<_i9.Muscle> get muscles => (super.noSuchMethod( + Invocation.getter(#muscles), + returnValue: <_i9.Muscle>[], + ) as List<_i9.Muscle>); + + @override + List<_i8.Equipment> get equipment => (super.noSuchMethod( + Invocation.getter(#equipment), + returnValue: <_i8.Equipment>[], + ) as List<_i8.Equipment>); + + @override + List<_i10.Language> get languages => (super.noSuchMethod( + Invocation.getter(#languages), + returnValue: <_i10.Language>[], + ) as List<_i10.Language>); + + @override + set languages(List<_i10.Language>? languages) => super.noSuchMethod( + Invocation.setter(#languages, languages), + returnValueForMissingStub: null, + ); + + @override + bool get hasListeners => + (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) as bool); + + @override + _i11.Future setFilters(_i12.Filters? newFilters) => (super.noSuchMethod( + Invocation.method(#setFilters, [newFilters]), + returnValue: _i11.Future.value(), + returnValueForMissingStub: _i11.Future.value(), + ) as _i11.Future); + + @override + void initFilters() => super.noSuchMethod( + Invocation.method(#initFilters, []), + returnValueForMissingStub: null, + ); + + @override + _i11.Future findByFilters() => (super.noSuchMethod( + Invocation.method(#findByFilters, []), + returnValue: _i11.Future.value(), + returnValueForMissingStub: _i11.Future.value(), + ) as _i11.Future); + + @override + void clear() => super.noSuchMethod( + Invocation.method(#clear, []), + returnValueForMissingStub: null, + ); + + @override + _i6.Exercise findExerciseById(int? id) => (super.noSuchMethod( + Invocation.method(#findExerciseById, [id]), + returnValue: _FakeExercise_6( + this, + Invocation.method(#findExerciseById, [id]), + ), + ) as _i6.Exercise); + + @override + List<_i6.Exercise> findExercisesByVariationId( + int? variationId, { + int? exerciseIdToExclude, + }) => + (super.noSuchMethod( + Invocation.method( + #findExercisesByVariationId, + [variationId], + {#exerciseIdToExclude: exerciseIdToExclude}, + ), + returnValue: <_i6.Exercise>[], + ) as List<_i6.Exercise>); + + @override + _i7.ExerciseCategory findCategoryById(int? id) => (super.noSuchMethod( + Invocation.method(#findCategoryById, [id]), + returnValue: _FakeExerciseCategory_7( + this, + Invocation.method(#findCategoryById, [id]), + ), + ) as _i7.ExerciseCategory); + + @override + _i8.Equipment findEquipmentById(int? id) => (super.noSuchMethod( + Invocation.method(#findEquipmentById, [id]), + returnValue: _FakeEquipment_8( + this, + Invocation.method(#findEquipmentById, [id]), + ), + ) as _i8.Equipment); + + @override + _i9.Muscle findMuscleById(int? id) => (super.noSuchMethod( + Invocation.method(#findMuscleById, [id]), + returnValue: _FakeMuscle_9( + this, + Invocation.method(#findMuscleById, [id]), + ), + ) as _i9.Muscle); + + @override + _i10.Language findLanguageById(int? id) => (super.noSuchMethod( + Invocation.method(#findLanguageById, [id]), + returnValue: _FakeLanguage_10( + this, + Invocation.method(#findLanguageById, [id]), + ), + ) as _i10.Language); + + @override + _i11.Future fetchAndSetCategoriesFromApi() => (super.noSuchMethod( + Invocation.method(#fetchAndSetCategoriesFromApi, []), + returnValue: _i11.Future.value(), + returnValueForMissingStub: _i11.Future.value(), + ) as _i11.Future); + + @override + _i11.Future fetchAndSetMusclesFromApi() => (super.noSuchMethod( + Invocation.method(#fetchAndSetMusclesFromApi, []), + returnValue: _i11.Future.value(), + returnValueForMissingStub: _i11.Future.value(), + ) as _i11.Future); + + @override + _i11.Future fetchAndSetEquipmentsFromApi() => (super.noSuchMethod( + Invocation.method(#fetchAndSetEquipmentsFromApi, []), + returnValue: _i11.Future.value(), + returnValueForMissingStub: _i11.Future.value(), + ) as _i11.Future); + + @override + _i11.Future fetchAndSetLanguagesFromApi() => (super.noSuchMethod( + Invocation.method(#fetchAndSetLanguagesFromApi, []), + returnValue: _i11.Future.value(), + returnValueForMissingStub: _i11.Future.value(), + ) as _i11.Future); + + @override + _i11.Future<_i6.Exercise?> fetchAndSetExercise(int? exerciseId) => (super.noSuchMethod( + Invocation.method(#fetchAndSetExercise, [exerciseId]), + returnValue: _i11.Future<_i6.Exercise?>.value(), + ) as _i11.Future<_i6.Exercise?>); + + @override + _i11.Future<_i6.Exercise> handleUpdateExerciseFromApi( + _i5.ExerciseDatabase? database, + int? exerciseId, + ) => + (super.noSuchMethod( + Invocation.method(#handleUpdateExerciseFromApi, [ + database, + exerciseId, + ]), + returnValue: _i11.Future<_i6.Exercise>.value( + _FakeExercise_6( + this, + Invocation.method(#handleUpdateExerciseFromApi, [ + database, + exerciseId, + ]), + ), + ), + ) as _i11.Future<_i6.Exercise>); + + @override + _i11.Future initCacheTimesLocalPrefs({dynamic forceInit = false}) => (super.noSuchMethod( + Invocation.method(#initCacheTimesLocalPrefs, [], { + #forceInit: forceInit, + }), + returnValue: _i11.Future.value(), + returnValueForMissingStub: _i11.Future.value(), + ) as _i11.Future); + + @override + _i11.Future clearAllCachesAndPrefs() => (super.noSuchMethod( + Invocation.method(#clearAllCachesAndPrefs, []), + returnValue: _i11.Future.value(), + returnValueForMissingStub: _i11.Future.value(), + ) as _i11.Future); + + @override + _i11.Future fetchAndSetInitialData() => (super.noSuchMethod( + Invocation.method(#fetchAndSetInitialData, []), + returnValue: _i11.Future.value(), + returnValueForMissingStub: _i11.Future.value(), + ) as _i11.Future); + + @override + _i11.Future setExercisesFromDatabase( + _i5.ExerciseDatabase? database, { + bool? forceDeleteCache = false, + }) => + (super.noSuchMethod( + Invocation.method( + #setExercisesFromDatabase, + [database], + {#forceDeleteCache: forceDeleteCache}, + ), + returnValue: _i11.Future.value(), + returnValueForMissingStub: _i11.Future.value(), + ) as _i11.Future); + + @override + _i11.Future updateExerciseCache(_i5.ExerciseDatabase? database) => (super.noSuchMethod( + Invocation.method(#updateExerciseCache, [database]), + returnValue: _i11.Future.value(), + returnValueForMissingStub: _i11.Future.value(), + ) as _i11.Future); + + @override + _i11.Future fetchAndSetMuscles(_i5.ExerciseDatabase? database) => (super.noSuchMethod( + Invocation.method(#fetchAndSetMuscles, [database]), + returnValue: _i11.Future.value(), + returnValueForMissingStub: _i11.Future.value(), + ) as _i11.Future); + + @override + _i11.Future fetchAndSetCategories(_i5.ExerciseDatabase? database) => (super.noSuchMethod( + Invocation.method(#fetchAndSetCategories, [database]), + returnValue: _i11.Future.value(), + returnValueForMissingStub: _i11.Future.value(), + ) as _i11.Future); + + @override + _i11.Future fetchAndSetLanguages(_i5.ExerciseDatabase? database) => (super.noSuchMethod( + Invocation.method(#fetchAndSetLanguages, [database]), + returnValue: _i11.Future.value(), + returnValueForMissingStub: _i11.Future.value(), + ) as _i11.Future); + + @override + _i11.Future fetchAndSetEquipments(_i5.ExerciseDatabase? database) => (super.noSuchMethod( + Invocation.method(#fetchAndSetEquipments, [database]), + returnValue: _i11.Future.value(), + returnValueForMissingStub: _i11.Future.value(), + ) as _i11.Future); + + @override + _i11.Future> searchExercise( + String? name, { + String? languageCode = 'en', + bool? searchEnglish = false, + }) => + (super.noSuchMethod( + Invocation.method( + #searchExercise, + [name], + {#languageCode: languageCode, #searchEnglish: searchEnglish}, + ), + returnValue: _i11.Future>.value( + <_i6.Exercise>[], + ), + ) as _i11.Future>); + + @override + void addListener(_i13.VoidCallback? listener) => super.noSuchMethod( + Invocation.method(#addListener, [listener]), + returnValueForMissingStub: null, + ); + + @override + void removeListener(_i13.VoidCallback? listener) => super.noSuchMethod( + Invocation.method(#removeListener, [listener]), + returnValueForMissingStub: null, + ); + + @override + void dispose() => super.noSuchMethod( + Invocation.method(#dispose, []), + returnValueForMissingStub: null, + ); + + @override + void notifyListeners() => super.noSuchMethod( + Invocation.method(#notifyListeners, []), + returnValueForMissingStub: null, + ); +} diff --git a/test/workout/workout_plans_screen_test.dart b/test/workout/routines_screen_test.dart similarity index 69% rename from test/workout/workout_plans_screen_test.dart rename to test/workout/routines_screen_test.dart index ebc8095bf..6c7740588 100644 --- a/test/workout/workout_plans_screen_test.dart +++ b/test/workout/routines_screen_test.dart @@ -18,23 +18,23 @@ import 'package:drift/native.dart'; import 'package:flutter/material.dart'; -import 'package:flutter_gen/gen_l10n/app_localizations.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:http/http.dart' as http; import 'package:mockito/annotations.dart'; import 'package:mockito/mockito.dart'; import 'package:provider/provider.dart'; import 'package:wger/database/exercises/exercise_database.dart'; -import 'package:wger/models/workouts/workout_plan.dart'; +import 'package:wger/l10n/generated/app_localizations.dart'; +import 'package:wger/models/workouts/routine.dart'; import 'package:wger/providers/base_provider.dart'; import 'package:wger/providers/exercises.dart'; -import 'package:wger/providers/workout_plans.dart'; +import 'package:wger/providers/routines.dart'; import 'package:wger/screens/form_screen.dart'; -import 'package:wger/screens/workout_plans_screen.dart'; +import 'package:wger/screens/routine_list_screen.dart'; import 'package:wger/widgets/nutrition/forms.dart'; -import 'package:wger/widgets/workouts/forms.dart'; +import 'package:wger/widgets/routines/forms/routine.dart'; -import 'workout_plans_screen_test.mocks.dart'; +import 'routines_screen_test.mocks.dart'; @GenerateMocks([WgerBaseProvider]) void main() { @@ -48,7 +48,7 @@ void main() { mockBaseProvider = MockWgerBaseProvider(); }); - Widget createHomeScreen({locale = 'en'}) { + Widget renderWidget({locale = 'en'}) { final uri = Uri( scheme: 'https', host: 'localhost', @@ -57,36 +57,52 @@ void main() { when(mockBaseProvider.makeUrl('workout', query: anyNamed('query'))).thenReturn(uri); when(mockBaseProvider.deleteRequest(any, any)).thenAnswer((_) async => http.Response('', 204)); - return ChangeNotifierProvider( - create: (context) => WorkoutPlansProvider( + return ChangeNotifierProvider( + create: (context) => RoutinesProvider( mockBaseProvider, testExercisesProvider, [ - WorkoutPlan(id: 1, creationDate: DateTime(2021, 01, 01), name: 'test 1'), - WorkoutPlan(id: 2, creationDate: DateTime(2021, 02, 12), name: 'test 2'), + Routine( + id: 1, + created: DateTime(2021, 01, 01), + start: DateTime(2024, 11, 1), + end: DateTime(2024, 12, 1), + name: 'test 1', + fitInWeek: false, + ), + Routine( + id: 2, + created: DateTime(2021, 02, 12), + start: DateTime(2024, 5, 5), + end: DateTime(2024, 6, 6), + name: 'test 2', + fitInWeek: false, + ), ], ), child: MaterialApp( locale: Locale(locale), localizationsDelegates: AppLocalizations.localizationsDelegates, supportedLocales: AppLocalizations.supportedLocales, - home: const WorkoutPlansScreen(), + home: const RoutineListScreen(), routes: {FormScreen.routeName: (ctx) => const FormScreen()}, ), ); } testWidgets('Test the widgets on the workout plans screen', (WidgetTester tester) async { - await tester.pumpWidget(createHomeScreen()); + await tester.pumpWidget(renderWidget()); //debugDumpApp(); - expect(find.text('Workout plans'), findsOneWidget); + expect(find.text('Routines'), findsOneWidget); + expect(find.text('test 1'), findsOneWidget); + expect(find.text('test 2'), findsOneWidget); expect(find.byType(Card), findsNWidgets(2)); expect(find.byType(ListTile), findsNWidgets(2)); }); testWidgets('Test deleting an item using the Delete button', (WidgetTester tester) async { - await tester.pumpWidget(createHomeScreen()); + await tester.pumpWidget(renderWidget()); await tester.tap(find.byIcon(Icons.delete).first); @@ -113,25 +129,25 @@ void main() { */ testWidgets('Test the form on the workout plan screen', (WidgetTester tester) async { - await tester.pumpWidget(createHomeScreen()); + await tester.pumpWidget(renderWidget()); expect(find.byType(PlanForm), findsNothing); await tester.tap(find.byType(FloatingActionButton)); await tester.pumpAndSettle(); - expect(find.byType(WorkoutForm), findsOneWidget); + expect(find.byType(RoutineForm), findsOneWidget); }); testWidgets('Tests the localization of dates - EN', (WidgetTester tester) async { - await tester.pumpWidget(createHomeScreen()); + await tester.pumpWidget(renderWidget()); - expect(find.text('1/1/2021'), findsOneWidget); - expect(find.text('2/12/2021'), findsOneWidget); + expect(find.text('11/1/2024 - 12/1/2024'), findsOneWidget); + expect(find.text('5/5/2024 - 6/6/2024'), findsOneWidget); }); testWidgets('Tests the localization of dates - DE', (WidgetTester tester) async { - await tester.pumpWidget(createHomeScreen(locale: 'de')); + await tester.pumpWidget(renderWidget(locale: 'de')); - expect(find.text('1.1.2021'), findsOneWidget); - expect(find.text('12.2.2021'), findsOneWidget); + expect(find.text('1.11.2024 - 1.12.2024'), findsOneWidget); + expect(find.text('5.5.2024 - 6.6.2024'), findsOneWidget); }); } diff --git a/test/workout/workout_plan_screen_test.mocks.dart b/test/workout/routines_screen_test.mocks.dart similarity index 94% rename from test/workout/workout_plan_screen_test.mocks.dart rename to test/workout/routines_screen_test.mocks.dart index 566bf6784..da873d63c 100644 --- a/test/workout/workout_plan_screen_test.mocks.dart +++ b/test/workout/routines_screen_test.mocks.dart @@ -1,5 +1,5 @@ // Mocks generated by Mockito 5.4.5 from annotations -// in wger/test/workout/workout_plan_screen_test.dart. +// in wger/test/workout/routines_screen_test.dart. // Do not manually edit this file. // ignore_for_file: no_leading_underscores_for_library_prefixes @@ -104,12 +104,10 @@ class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider { ) as Uri); @override - _i5.Future> fetch(Uri? uri) => (super.noSuchMethod( + _i5.Future fetch(Uri? uri) => (super.noSuchMethod( Invocation.method(#fetch, [uri]), - returnValue: _i5.Future>.value( - {}, - ), - ) as _i5.Future>); + returnValue: _i5.Future.value(), + ) as _i5.Future); @override _i5.Future> fetchPaginated(Uri? uri) => (super.noSuchMethod( diff --git a/test/workout/setting_model_test.dart b/test/workout/setting_model_test.dart deleted file mode 100644 index bec0a0523..000000000 --- a/test/workout/setting_model_test.dart +++ /dev/null @@ -1,91 +0,0 @@ -/* - * This file is part of wger Workout Manager . - * Copyright (C) 2020, 2021 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. - * - * wger Workout Manager 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/models/workouts/repetition_unit.dart'; -import 'package:wger/models/workouts/setting.dart'; -import 'package:wger/models/workouts/weight_unit.dart'; - -void main() { - group('Test the singleSettingRepText method', () { - test('Default rep and weight units, no RiR', () { - const repUnit = RepetitionUnit(id: 1, name: 'mol'); - const weightUnit = WeightUnit(id: 1, name: 'mg'); - - final setting = Setting.empty(); - setting.reps = 2; - setting.weight = 30; - setting.rir = ''; - setting.repetitionUnit = repUnit; - setting.weightUnit = weightUnit; - expect(setting.singleSettingRepText, '2 × 30 mg'); - }); - - test('Default rep and weight units', () { - const repUnit = RepetitionUnit(id: 1, name: 'mol'); - const weightUnit = WeightUnit(id: 1, name: 'mg'); - - final setting = Setting.empty(); - setting.reps = 2; - setting.weight = 30; - setting.rir = '1.5'; - setting.repetitionUnit = repUnit; - setting.weightUnit = weightUnit; - expect(setting.singleSettingRepText, '2 × 30 mg \n (1.5 RiR)'); - }); - - test('No weight, default rep and weight units', () { - const repUnit = RepetitionUnit(id: 1, name: 'mol'); - const weightUnit = WeightUnit(id: 1, name: 'mg'); - - final setting = Setting.empty(); - setting.reps = 2; - setting.weight = null; - setting.rir = '1.5'; - setting.repetitionUnit = repUnit; - setting.weightUnit = weightUnit; - expect(setting.singleSettingRepText, '2 mol \n (1.5 RiR)'); - }); - - test('Custom rep and weight units, no RiR', () { - const repUnit = RepetitionUnit(id: 2, name: 'mol'); - const weightUnit = WeightUnit(id: 2, name: 'mg'); - - final setting = Setting.empty(); - setting.reps = 2; - setting.weight = 30; - setting.rir = ''; - setting.repetitionUnit = repUnit; - setting.weightUnit = weightUnit; - expect(setting.singleSettingRepText, '2 mol × 30 mg'); - }); - - test('Custom rep and weight units, RiR', () { - const repUnit = RepetitionUnit(id: 2, name: 'mol'); - const weightUnit = WeightUnit(id: 2, name: 'mg'); - - final setting = Setting.empty(); - setting.reps = 2; - setting.weight = 30; - setting.rir = '3'; - setting.repetitionUnit = repUnit; - setting.weightUnit = weightUnit; - expect(setting.singleSettingRepText, '2 mol × 30 mg \n (3 RiR)'); - }); - }); -} diff --git a/test/workout/slot_entry_form_test.dart b/test/workout/slot_entry_form_test.dart new file mode 100644 index 000000000..557b11a3b --- /dev/null +++ b/test/workout/slot_entry_form_test.dart @@ -0,0 +1,95 @@ +/* + * This file is part of wger Workout Manager . + * Copyright (C) 2020, 2021 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. + * + * wger Workout Manager is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +import 'package:flutter/material.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:mockito/annotations.dart'; +import 'package:mockito/mockito.dart'; +import 'package:provider/provider.dart'; +import 'package:wger/helpers/consts.dart'; +import 'package:wger/l10n/generated/app_localizations.dart'; +import 'package:wger/providers/routines.dart'; +import 'package:wger/widgets/routines/forms/reps_unit.dart'; +import 'package:wger/widgets/routines/forms/rir.dart'; +import 'package:wger/widgets/routines/forms/slot.dart'; +import 'package:wger/widgets/routines/forms/weight_unit.dart'; + +import '../../test_data/routines.dart'; +import './slot_entry_form_test.mocks.dart'; + +@GenerateMocks([RoutinesProvider]) +void main() { + var mockRoutinesProvider = MockRoutinesProvider(); + + final slotEntry = getTestRoutine().days[0].slots[0].entries[0]; + + setUp(() { + mockRoutinesProvider = MockRoutinesProvider(); + when(mockRoutinesProvider.weightUnits).thenReturn(testWeightUnits); + when(mockRoutinesProvider.findWeightUnitById(any)).thenReturn(testWeightUnit1); + when(mockRoutinesProvider.repetitionUnits).thenReturn(testRepetitionUnits); + when(mockRoutinesProvider.findRepetitionUnitById(any)).thenReturn(testRepetitionUnit1); + }); + + Widget renderWidget({simpleMode = true, locale = 'en'}) { + final key = GlobalKey(); + + return ChangeNotifierProvider( + create: (context) => mockRoutinesProvider, + child: MaterialApp( + locale: Locale(locale), + localizationsDelegates: AppLocalizations.localizationsDelegates, + supportedLocales: AppLocalizations.supportedLocales, + navigatorKey: key, + home: Scaffold(body: SlotEntryForm(slotEntry, 1, simpleMode: simpleMode)), + ), + ); + } + + testWidgets('Checks correct widgets are rendered in simple mode', (WidgetTester tester) async { + await tester.pumpWidget(renderWidget()); + await tester.pumpAndSettle(); + + expect(find.byType(TextFormField), findsNWidgets(2)); + expect(find.byType(Slider), findsOne); + expect(find.byType(WeightUnitInputWidget), findsNothing); + expect(find.byType(RepetitionUnitInputWidget), findsNothing); + expect(find.byType(RiRInputWidget), findsNothing); + }); + + testWidgets('Checks correct widgets are rendered in expanded mode', (WidgetTester tester) async { + await tester.pumpWidget(renderWidget(simpleMode: false)); + await tester.pumpAndSettle(); + + expect(find.byType(TextFormField), findsNWidgets(6)); + expect(find.byType(Slider), findsNWidgets(2)); + expect(find.byType(WeightUnitInputWidget), findsOne); + expect(find.byType(RepetitionUnitInputWidget), findsOne); + expect(find.byType(RiRInputWidget), findsOne); + }); + + testWidgets('Correctly updates the values on the server', (WidgetTester tester) async { + await tester.pumpWidget(renderWidget(simpleMode: true)); + await tester.pumpAndSettle(); + await tester.tap(find.byKey(const Key(SUBMIT_BUTTON_KEY_NAME))); + await tester.pumpAndSettle(); + + verify(mockRoutinesProvider.editSlotEntry(any, any)).called(1); + verify(mockRoutinesProvider.handleConfig(any, any, any)).called(8); + }); +} diff --git a/test/workout/slot_entry_form_test.mocks.dart b/test/workout/slot_entry_form_test.mocks.dart new file mode 100644 index 000000000..9acd1110e --- /dev/null +++ b/test/workout/slot_entry_form_test.mocks.dart @@ -0,0 +1,509 @@ +// Mocks generated by Mockito 5.4.5 from annotations +// in wger/test/workout/slot_entry_form_test.dart. +// Do not manually edit this file. + +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'dart:async' as _i13; +import 'dart:ui' as _i16; + +import 'package:mockito/mockito.dart' as _i1; +import 'package:mockito/src/dummies.dart' as _i15; +import 'package:wger/models/workouts/base_config.dart' as _i9; +import 'package:wger/models/workouts/day.dart' as _i6; +import 'package:wger/models/workouts/day_data.dart' as _i14; +import 'package:wger/models/workouts/log.dart' as _i11; +import 'package:wger/models/workouts/repetition_unit.dart' as _i4; +import 'package:wger/models/workouts/routine.dart' as _i5; +import 'package:wger/models/workouts/session.dart' as _i10; +import 'package:wger/models/workouts/slot.dart' as _i7; +import 'package:wger/models/workouts/slot_entry.dart' as _i8; +import 'package:wger/models/workouts/weight_unit.dart' as _i3; +import 'package:wger/providers/base_provider.dart' as _i2; +import 'package:wger/providers/routines.dart' as _i12; + +// ignore_for_file: type=lint +// ignore_for_file: avoid_redundant_argument_values +// ignore_for_file: avoid_setters_without_getters +// ignore_for_file: comment_references +// ignore_for_file: deprecated_member_use +// ignore_for_file: deprecated_member_use_from_same_package +// ignore_for_file: implementation_imports +// ignore_for_file: invalid_use_of_visible_for_testing_member +// ignore_for_file: must_be_immutable +// ignore_for_file: prefer_const_constructors +// ignore_for_file: unnecessary_parenthesis +// ignore_for_file: camel_case_types +// ignore_for_file: subtype_of_sealed_class + +class _FakeWgerBaseProvider_0 extends _i1.SmartFake implements _i2.WgerBaseProvider { + _FakeWgerBaseProvider_0(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); +} + +class _FakeWeightUnit_1 extends _i1.SmartFake implements _i3.WeightUnit { + _FakeWeightUnit_1(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); +} + +class _FakeRepetitionUnit_2 extends _i1.SmartFake implements _i4.RepetitionUnit { + _FakeRepetitionUnit_2(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); +} + +class _FakeRoutine_3 extends _i1.SmartFake implements _i5.Routine { + _FakeRoutine_3(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); +} + +class _FakeDay_4 extends _i1.SmartFake implements _i6.Day { + _FakeDay_4(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); +} + +class _FakeSlot_5 extends _i1.SmartFake implements _i7.Slot { + _FakeSlot_5(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); +} + +class _FakeSlotEntry_6 extends _i1.SmartFake implements _i8.SlotEntry { + _FakeSlotEntry_6(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); +} + +class _FakeBaseConfig_7 extends _i1.SmartFake implements _i9.BaseConfig { + _FakeBaseConfig_7(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); +} + +class _FakeWorkoutSession_8 extends _i1.SmartFake implements _i10.WorkoutSession { + _FakeWorkoutSession_8(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); +} + +class _FakeLog_9 extends _i1.SmartFake implements _i11.Log { + _FakeLog_9(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); +} + +/// A class which mocks [RoutinesProvider]. +/// +/// See the documentation for Mockito's code generation for more information. +class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { + MockRoutinesProvider() { + _i1.throwOnMissingStub(this); + } + + @override + _i2.WgerBaseProvider get baseProvider => (super.noSuchMethod( + Invocation.getter(#baseProvider), + returnValue: _FakeWgerBaseProvider_0( + this, + Invocation.getter(#baseProvider), + ), + ) as _i2.WgerBaseProvider); + + @override + List<_i5.Routine> get items => (super.noSuchMethod( + Invocation.getter(#items), + returnValue: <_i5.Routine>[], + ) as List<_i5.Routine>); + + @override + List<_i3.WeightUnit> get weightUnits => (super.noSuchMethod( + Invocation.getter(#weightUnits), + returnValue: <_i3.WeightUnit>[], + ) as List<_i3.WeightUnit>); + + @override + set weightUnits(List<_i3.WeightUnit>? weightUnits) => super.noSuchMethod( + Invocation.setter(#weightUnits, weightUnits), + returnValueForMissingStub: null, + ); + + @override + _i3.WeightUnit get defaultWeightUnit => (super.noSuchMethod( + Invocation.getter(#defaultWeightUnit), + returnValue: _FakeWeightUnit_1( + this, + Invocation.getter(#defaultWeightUnit), + ), + ) as _i3.WeightUnit); + + @override + List<_i4.RepetitionUnit> get repetitionUnits => (super.noSuchMethod( + Invocation.getter(#repetitionUnits), + returnValue: <_i4.RepetitionUnit>[], + ) as List<_i4.RepetitionUnit>); + + @override + set repetitionUnits(List<_i4.RepetitionUnit>? repetitionUnits) => super.noSuchMethod( + Invocation.setter(#repetitionUnits, repetitionUnits), + returnValueForMissingStub: null, + ); + + @override + _i4.RepetitionUnit get defaultRepetitionUnit => (super.noSuchMethod( + Invocation.getter(#defaultRepetitionUnit), + returnValue: _FakeRepetitionUnit_2( + this, + Invocation.getter(#defaultRepetitionUnit), + ), + ) as _i4.RepetitionUnit); + + @override + bool get hasListeners => + (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) as bool); + + @override + void clear() => super.noSuchMethod( + Invocation.method(#clear, []), + returnValueForMissingStub: null, + ); + + @override + _i3.WeightUnit findWeightUnitById(int? id) => (super.noSuchMethod( + Invocation.method(#findWeightUnitById, [id]), + returnValue: _FakeWeightUnit_1( + this, + Invocation.method(#findWeightUnitById, [id]), + ), + ) as _i3.WeightUnit); + + @override + _i4.RepetitionUnit findRepetitionUnitById(int? id) => (super.noSuchMethod( + Invocation.method(#findRepetitionUnitById, [id]), + returnValue: _FakeRepetitionUnit_2( + this, + Invocation.method(#findRepetitionUnitById, [id]), + ), + ) as _i4.RepetitionUnit); + + @override + List<_i5.Routine> getPlans() => (super.noSuchMethod( + Invocation.method(#getPlans, []), + returnValue: <_i5.Routine>[], + ) as List<_i5.Routine>); + + @override + _i5.Routine findById(int? id) => (super.noSuchMethod( + Invocation.method(#findById, [id]), + returnValue: _FakeRoutine_3( + this, + Invocation.method(#findById, [id]), + ), + ) as _i5.Routine); + + @override + int findIndexById(int? id) => (super.noSuchMethod( + Invocation.method(#findIndexById, [id]), + returnValue: 0, + ) as int); + + @override + void setCurrentPlan(int? id) => super.noSuchMethod( + Invocation.method(#setCurrentPlan, [id]), + returnValueForMissingStub: null, + ); + + @override + void resetCurrentRoutine() => super.noSuchMethod( + Invocation.method(#resetCurrentRoutine, []), + returnValueForMissingStub: null, + ); + + @override + _i13.Future fetchAndSetAllRoutinesFull() => (super.noSuchMethod( + Invocation.method(#fetchAndSetAllRoutinesFull, []), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); + + @override + _i13.Future fetchAndSetAllPlansSparse() => (super.noSuchMethod( + Invocation.method(#fetchAndSetAllPlansSparse, []), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); + + @override + void setExercisesAndUnits(List<_i14.DayData>? entries) => super.noSuchMethod( + Invocation.method(#setExercisesAndUnits, [entries]), + returnValueForMissingStub: null, + ); + + @override + _i13.Future<_i5.Routine> fetchAndSetRoutineSparse(int? planId) => (super.noSuchMethod( + Invocation.method(#fetchAndSetRoutineSparse, [planId]), + returnValue: _i13.Future<_i5.Routine>.value( + _FakeRoutine_3( + this, + Invocation.method(#fetchAndSetRoutineSparse, [planId]), + ), + ), + ) as _i13.Future<_i5.Routine>); + + @override + _i13.Future<_i5.Routine> fetchAndSetRoutineFull(int? routineId) => (super.noSuchMethod( + Invocation.method(#fetchAndSetRoutineFull, [routineId]), + returnValue: _i13.Future<_i5.Routine>.value( + _FakeRoutine_3( + this, + Invocation.method(#fetchAndSetRoutineFull, [routineId]), + ), + ), + ) as _i13.Future<_i5.Routine>); + + @override + _i13.Future<_i5.Routine> addRoutine(_i5.Routine? routine) => (super.noSuchMethod( + Invocation.method(#addRoutine, [routine]), + returnValue: _i13.Future<_i5.Routine>.value( + _FakeRoutine_3(this, Invocation.method(#addRoutine, [routine])), + ), + ) as _i13.Future<_i5.Routine>); + + @override + _i13.Future editRoutine(_i5.Routine? routine) => (super.noSuchMethod( + Invocation.method(#editRoutine, [routine]), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); + + @override + _i13.Future deleteRoutine(int? id) => (super.noSuchMethod( + Invocation.method(#deleteRoutine, [id]), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); + + @override + _i13.Future fetchAndSetRepetitionUnits() => (super.noSuchMethod( + Invocation.method(#fetchAndSetRepetitionUnits, []), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); + + @override + _i13.Future fetchAndSetWeightUnits() => (super.noSuchMethod( + Invocation.method(#fetchAndSetWeightUnits, []), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); + + @override + _i13.Future fetchAndSetUnits() => (super.noSuchMethod( + Invocation.method(#fetchAndSetUnits, []), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); + + @override + _i13.Future<_i6.Day> addDay(_i6.Day? day) => (super.noSuchMethod( + Invocation.method(#addDay, [day]), + returnValue: _i13.Future<_i6.Day>.value( + _FakeDay_4(this, Invocation.method(#addDay, [day])), + ), + ) as _i13.Future<_i6.Day>); + + @override + _i13.Future editDay(_i6.Day? day) => (super.noSuchMethod( + Invocation.method(#editDay, [day]), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); + + @override + _i13.Future editDays(List<_i6.Day>? days) => (super.noSuchMethod( + Invocation.method(#editDays, [days]), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); + + @override + _i13.Future deleteDay(int? dayId) => (super.noSuchMethod( + Invocation.method(#deleteDay, [dayId]), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); + + @override + _i13.Future<_i7.Slot> addSlot(_i7.Slot? slot, int? routineId) => (super.noSuchMethod( + Invocation.method(#addSlot, [slot, routineId]), + returnValue: _i13.Future<_i7.Slot>.value( + _FakeSlot_5(this, Invocation.method(#addSlot, [slot, routineId])), + ), + ) as _i13.Future<_i7.Slot>); + + @override + _i13.Future deleteSlot(int? slotId, int? routineId) => (super.noSuchMethod( + Invocation.method(#deleteSlot, [slotId, routineId]), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); + + @override + _i13.Future editSlot(_i7.Slot? slot, int? routineId) => (super.noSuchMethod( + Invocation.method(#editSlot, [slot, routineId]), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); + + @override + _i13.Future editSlots(List<_i7.Slot>? slots, int? routineId) => (super.noSuchMethod( + Invocation.method(#editSlots, [slots, routineId]), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); + + @override + _i13.Future<_i8.SlotEntry> addSlotEntry( + _i8.SlotEntry? entry, + int? routineId, + ) => + (super.noSuchMethod( + Invocation.method(#addSlotEntry, [entry, routineId]), + returnValue: _i13.Future<_i8.SlotEntry>.value( + _FakeSlotEntry_6( + this, + Invocation.method(#addSlotEntry, [entry, routineId]), + ), + ), + ) as _i13.Future<_i8.SlotEntry>); + + @override + _i13.Future deleteSlotEntry(int? id, int? routineId) => (super.noSuchMethod( + Invocation.method(#deleteSlotEntry, [id, routineId]), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); + + @override + _i13.Future editSlotEntry(_i8.SlotEntry? entry, int? routineId) => (super.noSuchMethod( + Invocation.method(#editSlotEntry, [entry, routineId]), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); + + @override + String getConfigUrl(_i8.ConfigType? type) => (super.noSuchMethod( + Invocation.method(#getConfigUrl, [type]), + returnValue: _i15.dummyValue( + this, + Invocation.method(#getConfigUrl, [type]), + ), + ) as String); + + @override + _i13.Future<_i9.BaseConfig> editConfig( + _i9.BaseConfig? config, + _i8.ConfigType? type, + ) => + (super.noSuchMethod( + Invocation.method(#editConfig, [config, type]), + returnValue: _i13.Future<_i9.BaseConfig>.value( + _FakeBaseConfig_7( + this, + Invocation.method(#editConfig, [config, type]), + ), + ), + ) as _i13.Future<_i9.BaseConfig>); + + @override + _i13.Future<_i9.BaseConfig> addConfig( + _i9.BaseConfig? config, + _i8.ConfigType? type, + ) => + (super.noSuchMethod( + Invocation.method(#addConfig, [config, type]), + returnValue: _i13.Future<_i9.BaseConfig>.value( + _FakeBaseConfig_7( + this, + Invocation.method(#addConfig, [config, type]), + ), + ), + ) as _i13.Future<_i9.BaseConfig>); + + @override + _i13.Future deleteConfig(int? id, _i8.ConfigType? type) => (super.noSuchMethod( + Invocation.method(#deleteConfig, [id, type]), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); + + @override + _i13.Future handleConfig( + _i8.SlotEntry? entry, + String? input, + _i8.ConfigType? type, + ) => + (super.noSuchMethod( + Invocation.method(#handleConfig, [entry, input, type]), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); + + @override + _i13.Future> fetchSessionData() => (super.noSuchMethod( + Invocation.method(#fetchSessionData, []), + returnValue: _i13.Future>.value( + <_i10.WorkoutSession>[], + ), + ) as _i13.Future>); + + @override + _i13.Future<_i10.WorkoutSession> addSession( + _i10.WorkoutSession? session, + int? routineId, + ) => + (super.noSuchMethod( + Invocation.method(#addSession, [session, routineId]), + returnValue: _i13.Future<_i10.WorkoutSession>.value( + _FakeWorkoutSession_8( + this, + Invocation.method(#addSession, [session, routineId]), + ), + ), + ) as _i13.Future<_i10.WorkoutSession>); + + @override + _i13.Future<_i10.WorkoutSession> editSession(_i10.WorkoutSession? session) => (super.noSuchMethod( + Invocation.method(#editSession, [session]), + returnValue: _i13.Future<_i10.WorkoutSession>.value( + _FakeWorkoutSession_8( + this, + Invocation.method(#editSession, [session]), + ), + ), + ) as _i13.Future<_i10.WorkoutSession>); + + @override + _i13.Future<_i11.Log> addLog(_i11.Log? log) => (super.noSuchMethod( + Invocation.method(#addLog, [log]), + returnValue: _i13.Future<_i11.Log>.value( + _FakeLog_9(this, Invocation.method(#addLog, [log])), + ), + ) as _i13.Future<_i11.Log>); + + @override + _i13.Future deleteLog(_i11.Log? log) => (super.noSuchMethod( + Invocation.method(#deleteLog, [log]), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); + + @override + void addListener(_i16.VoidCallback? listener) => super.noSuchMethod( + Invocation.method(#addListener, [listener]), + returnValueForMissingStub: null, + ); + + @override + void removeListener(_i16.VoidCallback? listener) => super.noSuchMethod( + Invocation.method(#removeListener, [listener]), + returnValueForMissingStub: null, + ); + + @override + void dispose() => super.noSuchMethod( + Invocation.method(#dispose, []), + returnValueForMissingStub: null, + ); + + @override + void notifyListeners() => super.noSuchMethod( + Invocation.method(#notifyListeners, []), + returnValueForMissingStub: null, + ); +} diff --git a/test/workout/slot_entry_model_test.dart b/test/workout/slot_entry_model_test.dart new file mode 100644 index 000000000..96fde3b06 --- /dev/null +++ b/test/workout/slot_entry_model_test.dart @@ -0,0 +1,64 @@ +/* + * This file is part of wger Workout Manager . + * Copyright (C) 2020, 2021 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. + * + * wger Workout Manager 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 'dart:convert'; + +import 'package:flutter_test/flutter_test.dart'; +import 'package:wger/models/workouts/base_config.dart'; +import 'package:wger/models/workouts/slot_entry.dart'; + +import '../fixtures/fixture_reader.dart'; + +void main() { + test('Checks that the data is correctly read from the server', () { + final apiResponse = fixture('routines/slot_entry.json'); + + final slotEntry = SlotEntry.fromJson(json.decode(apiResponse)); + expect(slotEntry.id, 143); + expect(slotEntry.slotId, 140); + expect(slotEntry.order, 2); + expect(slotEntry.config, null); + expect(slotEntry.repetitionUnitId, 1); + expect(slotEntry.repetitionRounding, 1.25); + expect(slotEntry.weightUnitId, 1); + expect(slotEntry.weightRounding, 2.5); + expect(slotEntry.repetitionsConfigs.length, 1); + expect(slotEntry.repetitionsConfigs[0].id, 139); + expect(slotEntry.maxRepetitionsConfigs.length, 1); + expect(slotEntry.weightConfigs.length, 1); + expect(slotEntry.maxWeightConfigs.length, 1); + expect(slotEntry.nrOfSetsConfigs.length, 1); + expect(slotEntry.maxNrOfSetsConfigs.length, 1); + expect(slotEntry.rirConfigs.length, 1); + expect(slotEntry.maxRirConfigs.length, 0); + expect(slotEntry.restTimeConfigs.length, 1); + expect(slotEntry.maxRestTimeConfigs.length, 1); + }); + + test('Checks that an empty model correctly calculates hasProgressionRules', () { + final slotEntry = SlotEntry.empty(); + expect(slotEntry.hasProgressionRules, false); + }); + + test('Checks that an model with data correctly calculates hasProgressionRules', () { + final slotEntry = SlotEntry.empty(); + slotEntry.weightConfigs.add(BaseConfig.firstIteration(3, 1)); + slotEntry.weightConfigs.add(BaseConfig.firstIteration(4, 1)); + expect(slotEntry.hasProgressionRules, true); + }); +} diff --git a/test/workout/weight_unit_form_widget_test.dart b/test/workout/weight_unit_form_widget_test.dart index ed68f0448..ad0966564 100644 --- a/test/workout/weight_unit_form_widget_test.dart +++ b/test/workout/weight_unit_form_widget_test.dart @@ -17,65 +17,67 @@ */ import 'package:flutter/material.dart'; -import 'package:flutter_gen/gen_l10n/app_localizations.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/annotations.dart'; import 'package:mockito/mockito.dart'; import 'package:provider/provider.dart'; -import 'package:wger/models/workouts/setting.dart'; +import 'package:wger/l10n/generated/app_localizations.dart'; +import 'package:wger/models/workouts/slot_entry.dart'; import 'package:wger/models/workouts/weight_unit.dart'; -import 'package:wger/providers/body_weight.dart'; -import 'package:wger/providers/workout_plans.dart'; -import 'package:wger/screens/workout_plan_screen.dart'; -import 'package:wger/widgets/workouts/forms.dart'; +import 'package:wger/providers/routines.dart'; +import 'package:wger/screens/routine_screen.dart'; +import 'package:wger/widgets/routines/forms/weight_unit.dart'; -import './workout_form_test.mocks.dart'; +import 'weight_unit_form_widget_test.mocks.dart'; -@GenerateMocks([BodyWeightProvider]) +@GenerateMocks([RoutinesProvider]) void main() { - var mockWorkoutPlans = MockWorkoutPlansProvider(); + var mockWorkoutPlans = MockRoutinesProvider(); + int? result; const unit1 = WeightUnit(id: 1, name: 'kg'); const unit2 = WeightUnit(id: 2, name: 'donkeys'); const unit3 = WeightUnit(id: 3, name: 'plates'); - final setting1 = Setting( - setId: 1, + final slotEntry = SlotEntry( + slotId: 1, + type: 'normal', order: 1, exerciseId: 1, repetitionUnitId: 1, - reps: 2, + repetitionRounding: 0.25, weightUnitId: 1, + weightRounding: 0.25, comment: 'comment', - rir: '1', ); - setting1.weightUnitObj = unit1; + slotEntry.weightUnitObj = unit1; setUp(() { - mockWorkoutPlans = MockWorkoutPlansProvider(); + result = null; + mockWorkoutPlans = MockRoutinesProvider(); when(mockWorkoutPlans.weightUnits).thenAnswer((_) => [unit1, unit2, unit3]); + when(mockWorkoutPlans.findWeightUnitById(1)).thenReturn(unit1); + when(mockWorkoutPlans.findWeightUnitById(2)).thenReturn(unit2); }); - Widget createHomeScreen() { + Widget renderWidget() { final key = GlobalKey(); - return ChangeNotifierProvider( + return ChangeNotifierProvider( create: (context) => mockWorkoutPlans, child: MaterialApp( localizationsDelegates: AppLocalizations.localizationsDelegates, supportedLocales: AppLocalizations.supportedLocales, navigatorKey: key, - home: Scaffold(body: WeightUnitInputWidget(setting1)), - routes: { - WorkoutPlanScreen.routeName: (ctx) => const WorkoutPlanScreen(), - }, + home: Scaffold(body: WeightUnitInputWidget(1, onChanged: (value) => result = value)), + routes: {RoutineScreen.routeName: (ctx) => const RoutineScreen()}, ), ); } testWidgets('Test that the entries are shown', (WidgetTester tester) async { // arrange - await tester.pumpWidget(createHomeScreen()); + await tester.pumpWidget(renderWidget()); await tester.tap(find.byKey(const Key('1'))); await tester.pump(); @@ -87,16 +89,16 @@ void main() { testWidgets('Test that the correct units are set after selection', (WidgetTester tester) async { // arrange - await tester.pumpWidget(createHomeScreen()); + await tester.pumpWidget(renderWidget()); await tester.pump(); // act - expect(setting1.weightUnitObj, equals(unit1)); + expect(slotEntry.weightUnitObj, equals(unit1)); await tester.tap(find.byKey(const Key('1'))); await tester.pump(); await tester.tap(find.text('donkeys').last); // assert - expect(setting1.weightUnitObj, equals(unit2)); + expect(result, equals(2)); }); } diff --git a/test/workout/weight_unit_form_widget_test.mocks.dart b/test/workout/weight_unit_form_widget_test.mocks.dart index 9b805458d..afd63b454 100644 --- a/test/workout/weight_unit_form_widget_test.mocks.dart +++ b/test/workout/weight_unit_form_widget_test.mocks.dart @@ -3,13 +3,23 @@ // Do not manually edit this file. // ignore_for_file: no_leading_underscores_for_library_prefixes -import 'dart:async' as _i5; -import 'dart:ui' as _i6; +import 'dart:async' as _i13; +import 'dart:ui' as _i16; import 'package:mockito/mockito.dart' as _i1; -import 'package:wger/models/body_weight/weight_entry.dart' as _i3; +import 'package:mockito/src/dummies.dart' as _i15; +import 'package:wger/models/workouts/base_config.dart' as _i9; +import 'package:wger/models/workouts/day.dart' as _i6; +import 'package:wger/models/workouts/day_data.dart' as _i14; +import 'package:wger/models/workouts/log.dart' as _i11; +import 'package:wger/models/workouts/repetition_unit.dart' as _i4; +import 'package:wger/models/workouts/routine.dart' as _i5; +import 'package:wger/models/workouts/session.dart' as _i10; +import 'package:wger/models/workouts/slot.dart' as _i7; +import 'package:wger/models/workouts/slot_entry.dart' as _i8; +import 'package:wger/models/workouts/weight_unit.dart' as _i3; import 'package:wger/providers/base_provider.dart' as _i2; -import 'package:wger/providers/body_weight.dart' as _i4; +import 'package:wger/providers/routines.dart' as _i12; // ignore_for_file: type=lint // ignore_for_file: avoid_redundant_argument_values @@ -30,15 +40,49 @@ class _FakeWgerBaseProvider_0 extends _i1.SmartFake implements _i2.WgerBaseProvi : super(parent, parentInvocation); } -class _FakeWeightEntry_1 extends _i1.SmartFake implements _i3.WeightEntry { - _FakeWeightEntry_1(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); +class _FakeWeightUnit_1 extends _i1.SmartFake implements _i3.WeightUnit { + _FakeWeightUnit_1(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } -/// A class which mocks [BodyWeightProvider]. +class _FakeRepetitionUnit_2 extends _i1.SmartFake implements _i4.RepetitionUnit { + _FakeRepetitionUnit_2(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); +} + +class _FakeRoutine_3 extends _i1.SmartFake implements _i5.Routine { + _FakeRoutine_3(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); +} + +class _FakeDay_4 extends _i1.SmartFake implements _i6.Day { + _FakeDay_4(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); +} + +class _FakeSlot_5 extends _i1.SmartFake implements _i7.Slot { + _FakeSlot_5(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); +} + +class _FakeSlotEntry_6 extends _i1.SmartFake implements _i8.SlotEntry { + _FakeSlotEntry_6(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); +} + +class _FakeBaseConfig_7 extends _i1.SmartFake implements _i9.BaseConfig { + _FakeBaseConfig_7(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); +} + +class _FakeWorkoutSession_8 extends _i1.SmartFake implements _i10.WorkoutSession { + _FakeWorkoutSession_8(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); +} + +class _FakeLog_9 extends _i1.SmartFake implements _i11.Log { + _FakeLog_9(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); +} + +/// A class which mocks [RoutinesProvider]. /// /// See the documentation for Mockito's code generation for more information. -class MockBodyWeightProvider extends _i1.Mock implements _i4.BodyWeightProvider { - MockBodyWeightProvider() { +class MockRoutinesProvider extends _i1.Mock implements _i12.RoutinesProvider { + MockRoutinesProvider() { _i1.throwOnMissingStub(this); } @@ -52,17 +96,53 @@ class MockBodyWeightProvider extends _i1.Mock implements _i4.BodyWeightProvider ) as _i2.WgerBaseProvider); @override - List<_i3.WeightEntry> get items => (super.noSuchMethod( + List<_i5.Routine> get items => (super.noSuchMethod( Invocation.getter(#items), - returnValue: <_i3.WeightEntry>[], - ) as List<_i3.WeightEntry>); + returnValue: <_i5.Routine>[], + ) as List<_i5.Routine>); @override - set items(List<_i3.WeightEntry>? entries) => super.noSuchMethod( - Invocation.setter(#items, entries), + List<_i3.WeightUnit> get weightUnits => (super.noSuchMethod( + Invocation.getter(#weightUnits), + returnValue: <_i3.WeightUnit>[], + ) as List<_i3.WeightUnit>); + + @override + set weightUnits(List<_i3.WeightUnit>? weightUnits) => super.noSuchMethod( + Invocation.setter(#weightUnits, weightUnits), returnValueForMissingStub: null, ); + @override + _i3.WeightUnit get defaultWeightUnit => (super.noSuchMethod( + Invocation.getter(#defaultWeightUnit), + returnValue: _FakeWeightUnit_1( + this, + Invocation.getter(#defaultWeightUnit), + ), + ) as _i3.WeightUnit); + + @override + List<_i4.RepetitionUnit> get repetitionUnits => (super.noSuchMethod( + Invocation.getter(#repetitionUnits), + returnValue: <_i4.RepetitionUnit>[], + ) as List<_i4.RepetitionUnit>); + + @override + set repetitionUnits(List<_i4.RepetitionUnit>? repetitionUnits) => super.noSuchMethod( + Invocation.setter(#repetitionUnits, repetitionUnits), + returnValueForMissingStub: null, + ); + + @override + _i4.RepetitionUnit get defaultRepetitionUnit => (super.noSuchMethod( + Invocation.getter(#defaultRepetitionUnit), + returnValue: _FakeRepetitionUnit_2( + this, + Invocation.getter(#defaultRepetitionUnit), + ), + ) as _i4.RepetitionUnit); + @override bool get hasListeners => (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) as bool); @@ -74,56 +154,343 @@ class MockBodyWeightProvider extends _i1.Mock implements _i4.BodyWeightProvider ); @override - _i3.WeightEntry findById(int? id) => (super.noSuchMethod( + _i3.WeightUnit findWeightUnitById(int? id) => (super.noSuchMethod( + Invocation.method(#findWeightUnitById, [id]), + returnValue: _FakeWeightUnit_1( + this, + Invocation.method(#findWeightUnitById, [id]), + ), + ) as _i3.WeightUnit); + + @override + _i4.RepetitionUnit findRepetitionUnitById(int? id) => (super.noSuchMethod( + Invocation.method(#findRepetitionUnitById, [id]), + returnValue: _FakeRepetitionUnit_2( + this, + Invocation.method(#findRepetitionUnitById, [id]), + ), + ) as _i4.RepetitionUnit); + + @override + List<_i5.Routine> getPlans() => (super.noSuchMethod( + Invocation.method(#getPlans, []), + returnValue: <_i5.Routine>[], + ) as List<_i5.Routine>); + + @override + _i5.Routine findById(int? id) => (super.noSuchMethod( Invocation.method(#findById, [id]), - returnValue: _FakeWeightEntry_1( + returnValue: _FakeRoutine_3( this, Invocation.method(#findById, [id]), ), - ) as _i3.WeightEntry); + ) as _i5.Routine); @override - _i3.WeightEntry? findByDate(DateTime? date) => - (super.noSuchMethod(Invocation.method(#findByDate, [date])) as _i3.WeightEntry?); + int findIndexById(int? id) => (super.noSuchMethod( + Invocation.method(#findIndexById, [id]), + returnValue: 0, + ) as int); @override - _i5.Future> fetchAndSetEntries() => (super.noSuchMethod( - Invocation.method(#fetchAndSetEntries, []), - returnValue: _i5.Future>.value( - <_i3.WeightEntry>[], + void setCurrentPlan(int? id) => super.noSuchMethod( + Invocation.method(#setCurrentPlan, [id]), + returnValueForMissingStub: null, + ); + + @override + void resetCurrentRoutine() => super.noSuchMethod( + Invocation.method(#resetCurrentRoutine, []), + returnValueForMissingStub: null, + ); + + @override + _i13.Future fetchAndSetAllRoutinesFull() => (super.noSuchMethod( + Invocation.method(#fetchAndSetAllRoutinesFull, []), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); + + @override + _i13.Future fetchAndSetAllPlansSparse() => (super.noSuchMethod( + Invocation.method(#fetchAndSetAllPlansSparse, []), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); + + @override + void setExercisesAndUnits(List<_i14.DayData>? entries) => super.noSuchMethod( + Invocation.method(#setExercisesAndUnits, [entries]), + returnValueForMissingStub: null, + ); + + @override + _i13.Future<_i5.Routine> fetchAndSetRoutineSparse(int? planId) => (super.noSuchMethod( + Invocation.method(#fetchAndSetRoutineSparse, [planId]), + returnValue: _i13.Future<_i5.Routine>.value( + _FakeRoutine_3( + this, + Invocation.method(#fetchAndSetRoutineSparse, [planId]), + ), ), - ) as _i5.Future>); + ) as _i13.Future<_i5.Routine>); @override - _i5.Future<_i3.WeightEntry> addEntry(_i3.WeightEntry? entry) => (super.noSuchMethod( - Invocation.method(#addEntry, [entry]), - returnValue: _i5.Future<_i3.WeightEntry>.value( - _FakeWeightEntry_1(this, Invocation.method(#addEntry, [entry])), + _i13.Future<_i5.Routine> fetchAndSetRoutineFull(int? routineId) => (super.noSuchMethod( + Invocation.method(#fetchAndSetRoutineFull, [routineId]), + returnValue: _i13.Future<_i5.Routine>.value( + _FakeRoutine_3( + this, + Invocation.method(#fetchAndSetRoutineFull, [routineId]), + ), ), - ) as _i5.Future<_i3.WeightEntry>); + ) as _i13.Future<_i5.Routine>); @override - _i5.Future editEntry(_i3.WeightEntry? entry) => (super.noSuchMethod( - Invocation.method(#editEntry, [entry]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + _i13.Future<_i5.Routine> addRoutine(_i5.Routine? routine) => (super.noSuchMethod( + Invocation.method(#addRoutine, [routine]), + returnValue: _i13.Future<_i5.Routine>.value( + _FakeRoutine_3(this, Invocation.method(#addRoutine, [routine])), + ), + ) as _i13.Future<_i5.Routine>); @override - _i5.Future deleteEntry(int? id) => (super.noSuchMethod( - Invocation.method(#deleteEntry, [id]), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + _i13.Future editRoutine(_i5.Routine? routine) => (super.noSuchMethod( + Invocation.method(#editRoutine, [routine]), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); @override - void addListener(_i6.VoidCallback? listener) => super.noSuchMethod( + _i13.Future deleteRoutine(int? id) => (super.noSuchMethod( + Invocation.method(#deleteRoutine, [id]), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); + + @override + _i13.Future fetchAndSetRepetitionUnits() => (super.noSuchMethod( + Invocation.method(#fetchAndSetRepetitionUnits, []), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); + + @override + _i13.Future fetchAndSetWeightUnits() => (super.noSuchMethod( + Invocation.method(#fetchAndSetWeightUnits, []), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); + + @override + _i13.Future fetchAndSetUnits() => (super.noSuchMethod( + Invocation.method(#fetchAndSetUnits, []), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); + + @override + _i13.Future<_i6.Day> addDay(_i6.Day? day) => (super.noSuchMethod( + Invocation.method(#addDay, [day]), + returnValue: _i13.Future<_i6.Day>.value( + _FakeDay_4(this, Invocation.method(#addDay, [day])), + ), + ) as _i13.Future<_i6.Day>); + + @override + _i13.Future editDay(_i6.Day? day) => (super.noSuchMethod( + Invocation.method(#editDay, [day]), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); + + @override + _i13.Future editDays(List<_i6.Day>? days) => (super.noSuchMethod( + Invocation.method(#editDays, [days]), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); + + @override + _i13.Future deleteDay(int? dayId) => (super.noSuchMethod( + Invocation.method(#deleteDay, [dayId]), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); + + @override + _i13.Future<_i7.Slot> addSlot(_i7.Slot? slot, int? routineId) => (super.noSuchMethod( + Invocation.method(#addSlot, [slot, routineId]), + returnValue: _i13.Future<_i7.Slot>.value( + _FakeSlot_5(this, Invocation.method(#addSlot, [slot, routineId])), + ), + ) as _i13.Future<_i7.Slot>); + + @override + _i13.Future deleteSlot(int? slotId, int? routineId) => (super.noSuchMethod( + Invocation.method(#deleteSlot, [slotId, routineId]), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); + + @override + _i13.Future editSlot(_i7.Slot? slot, int? routineId) => (super.noSuchMethod( + Invocation.method(#editSlot, [slot, routineId]), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); + + @override + _i13.Future editSlots(List<_i7.Slot>? slots, int? routineId) => (super.noSuchMethod( + Invocation.method(#editSlots, [slots, routineId]), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); + + @override + _i13.Future<_i8.SlotEntry> addSlotEntry( + _i8.SlotEntry? entry, + int? routineId, + ) => + (super.noSuchMethod( + Invocation.method(#addSlotEntry, [entry, routineId]), + returnValue: _i13.Future<_i8.SlotEntry>.value( + _FakeSlotEntry_6( + this, + Invocation.method(#addSlotEntry, [entry, routineId]), + ), + ), + ) as _i13.Future<_i8.SlotEntry>); + + @override + _i13.Future deleteSlotEntry(int? id, int? routineId) => (super.noSuchMethod( + Invocation.method(#deleteSlotEntry, [id, routineId]), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); + + @override + _i13.Future editSlotEntry(_i8.SlotEntry? entry, int? routineId) => (super.noSuchMethod( + Invocation.method(#editSlotEntry, [entry, routineId]), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); + + @override + String getConfigUrl(_i8.ConfigType? type) => (super.noSuchMethod( + Invocation.method(#getConfigUrl, [type]), + returnValue: _i15.dummyValue( + this, + Invocation.method(#getConfigUrl, [type]), + ), + ) as String); + + @override + _i13.Future<_i9.BaseConfig> editConfig( + _i9.BaseConfig? config, + _i8.ConfigType? type, + ) => + (super.noSuchMethod( + Invocation.method(#editConfig, [config, type]), + returnValue: _i13.Future<_i9.BaseConfig>.value( + _FakeBaseConfig_7( + this, + Invocation.method(#editConfig, [config, type]), + ), + ), + ) as _i13.Future<_i9.BaseConfig>); + + @override + _i13.Future<_i9.BaseConfig> addConfig( + _i9.BaseConfig? config, + _i8.ConfigType? type, + ) => + (super.noSuchMethod( + Invocation.method(#addConfig, [config, type]), + returnValue: _i13.Future<_i9.BaseConfig>.value( + _FakeBaseConfig_7( + this, + Invocation.method(#addConfig, [config, type]), + ), + ), + ) as _i13.Future<_i9.BaseConfig>); + + @override + _i13.Future deleteConfig(int? id, _i8.ConfigType? type) => (super.noSuchMethod( + Invocation.method(#deleteConfig, [id, type]), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); + + @override + _i13.Future handleConfig( + _i8.SlotEntry? entry, + String? input, + _i8.ConfigType? type, + ) => + (super.noSuchMethod( + Invocation.method(#handleConfig, [entry, input, type]), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); + + @override + _i13.Future> fetchSessionData() => (super.noSuchMethod( + Invocation.method(#fetchSessionData, []), + returnValue: _i13.Future>.value( + <_i10.WorkoutSession>[], + ), + ) as _i13.Future>); + + @override + _i13.Future<_i10.WorkoutSession> addSession( + _i10.WorkoutSession? session, + int? routineId, + ) => + (super.noSuchMethod( + Invocation.method(#addSession, [session, routineId]), + returnValue: _i13.Future<_i10.WorkoutSession>.value( + _FakeWorkoutSession_8( + this, + Invocation.method(#addSession, [session, routineId]), + ), + ), + ) as _i13.Future<_i10.WorkoutSession>); + + @override + _i13.Future<_i10.WorkoutSession> editSession(_i10.WorkoutSession? session) => (super.noSuchMethod( + Invocation.method(#editSession, [session]), + returnValue: _i13.Future<_i10.WorkoutSession>.value( + _FakeWorkoutSession_8( + this, + Invocation.method(#editSession, [session]), + ), + ), + ) as _i13.Future<_i10.WorkoutSession>); + + @override + _i13.Future<_i11.Log> addLog(_i11.Log? log) => (super.noSuchMethod( + Invocation.method(#addLog, [log]), + returnValue: _i13.Future<_i11.Log>.value( + _FakeLog_9(this, Invocation.method(#addLog, [log])), + ), + ) as _i13.Future<_i11.Log>); + + @override + _i13.Future deleteLog(_i11.Log? log) => (super.noSuchMethod( + Invocation.method(#deleteLog, [log]), + returnValue: _i13.Future.value(), + returnValueForMissingStub: _i13.Future.value(), + ) as _i13.Future); + + @override + void addListener(_i16.VoidCallback? listener) => super.noSuchMethod( Invocation.method(#addListener, [listener]), returnValueForMissingStub: null, ); @override - void removeListener(_i6.VoidCallback? listener) => super.noSuchMethod( + void removeListener(_i16.VoidCallback? listener) => super.noSuchMethod( Invocation.method(#removeListener, [listener]), returnValueForMissingStub: null, ); diff --git a/test/workout/workout_day_form_test.dart b/test/workout/workout_day_form_test.dart deleted file mode 100644 index ef466062b..000000000 --- a/test/workout/workout_day_form_test.dart +++ /dev/null @@ -1,101 +0,0 @@ -/* - * This file is part of wger Workout Manager . - * Copyright (C) 2020, 2021 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. - * - * wger Workout Manager is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -import 'package:flutter/material.dart'; -import 'package:flutter_gen/gen_l10n/app_localizations.dart'; -import 'package:flutter_test/flutter_test.dart'; -import 'package:mockito/annotations.dart'; -import 'package:mockito/mockito.dart'; -import 'package:provider/provider.dart'; -import 'package:wger/helpers/consts.dart'; -import 'package:wger/models/workouts/day.dart'; -import 'package:wger/models/workouts/workout_plan.dart'; -import 'package:wger/providers/workout_plans.dart'; -import 'package:wger/widgets/workouts/forms.dart'; - -import '../../test_data/workouts.dart'; -import 'workout_day_form_test.mocks.dart'; - -@GenerateMocks([WorkoutPlansProvider]) -void main() { - var mockWorkoutPlans = MockWorkoutPlansProvider(); - WorkoutPlan workoutPlan = WorkoutPlan.empty(); - - setUp(() { - workoutPlan = getWorkout(); - mockWorkoutPlans = MockWorkoutPlansProvider(); - }); - - Widget createHomeScreen({locale = 'en'}) { - final key = GlobalKey(); - - return ChangeNotifierProvider( - create: (context) => mockWorkoutPlans, - child: MaterialApp( - locale: Locale(locale), - localizationsDelegates: AppLocalizations.localizationsDelegates, - supportedLocales: AppLocalizations.supportedLocales, - navigatorKey: key, - home: Scaffold(body: DayFormWidget(workoutPlan)), - ), - ); - } - - testWidgets('Test the widgets on the DayFormWidget', (WidgetTester tester) async { - await tester.pumpWidget(createHomeScreen()); - await tester.pumpAndSettle(); - - expect(find.byType(TextFormField), findsOneWidget); - expect(find.byType(CheckboxListTile), findsNWidgets(7)); - expect(find.byType(ElevatedButton), findsOneWidget); - }); - - testWidgets('Test creating a new day', (WidgetTester tester) async { - when(mockWorkoutPlans.addDay(any, any)).thenAnswer((_) => Future.value(Day())); - - await tester.pumpWidget(createHomeScreen()); - await tester.pumpAndSettle(); - - expect(find.text(''), findsOneWidget, reason: 'New day has no description'); - await tester.enterText(find.byKey(const Key('field-description')), 'Leg day!'); - await tester.tap(find.byKey(const Key('field-checkbox-1'))); - await tester.tap(find.byKey(const Key(SUBMIT_BUTTON_KEY_NAME))); - - verify(mockWorkoutPlans.addDay(any, any)); - - // Successful redirect to workout plan detail page - //await tester.pumpAndSettle(); - //verify(mockObserver.didPop(any, any)); - }); - - testWidgets('Tests the localization of days - EN', (WidgetTester tester) async { - await tester.pumpWidget(createHomeScreen()); - - expect(find.text('Monday'), findsOneWidget); - expect(find.text('Tuesday'), findsOneWidget); - expect(find.text('Thursday'), findsOneWidget); - }); - - testWidgets('Tests the localization of days - DE', (WidgetTester tester) async { - await tester.pumpWidget(createHomeScreen(locale: 'de')); - - expect(find.text('Montag'), findsOneWidget); - expect(find.text('Dienstag'), findsOneWidget); - expect(find.text('Donnerstag'), findsOneWidget); - }); -} diff --git a/test/workout/workout_day_form_test.mocks.dart b/test/workout/workout_day_form_test.mocks.dart deleted file mode 100644 index 384b24bed..000000000 --- a/test/workout/workout_day_form_test.mocks.dart +++ /dev/null @@ -1,409 +0,0 @@ -// Mocks generated by Mockito 5.4.5 from annotations -// in wger/test/workout/workout_day_form_test.dart. -// Do not manually edit this file. - -// ignore_for_file: no_leading_underscores_for_library_prefixes -import 'dart:async' as _i12; -import 'dart:ui' as _i16; - -import 'package:mockito/mockito.dart' as _i1; -import 'package:mockito/src/dummies.dart' as _i15; -import 'package:wger/models/exercises/exercise.dart' as _i13; -import 'package:wger/models/exercises/translation.dart' as _i14; -import 'package:wger/models/workouts/day.dart' as _i6; -import 'package:wger/models/workouts/log.dart' as _i10; -import 'package:wger/models/workouts/repetition_unit.dart' as _i4; -import 'package:wger/models/workouts/session.dart' as _i9; -import 'package:wger/models/workouts/set.dart' as _i7; -import 'package:wger/models/workouts/setting.dart' as _i8; -import 'package:wger/models/workouts/weight_unit.dart' as _i3; -import 'package:wger/models/workouts/workout_plan.dart' as _i5; -import 'package:wger/providers/base_provider.dart' as _i2; -import 'package:wger/providers/workout_plans.dart' as _i11; - -// ignore_for_file: type=lint -// ignore_for_file: avoid_redundant_argument_values -// ignore_for_file: avoid_setters_without_getters -// ignore_for_file: comment_references -// ignore_for_file: deprecated_member_use -// ignore_for_file: deprecated_member_use_from_same_package -// ignore_for_file: implementation_imports -// ignore_for_file: invalid_use_of_visible_for_testing_member -// ignore_for_file: must_be_immutable -// ignore_for_file: prefer_const_constructors -// ignore_for_file: unnecessary_parenthesis -// ignore_for_file: camel_case_types -// ignore_for_file: subtype_of_sealed_class - -class _FakeWgerBaseProvider_0 extends _i1.SmartFake implements _i2.WgerBaseProvider { - _FakeWgerBaseProvider_0(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); -} - -class _FakeWeightUnit_1 extends _i1.SmartFake implements _i3.WeightUnit { - _FakeWeightUnit_1(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); -} - -class _FakeRepetitionUnit_2 extends _i1.SmartFake implements _i4.RepetitionUnit { - _FakeRepetitionUnit_2(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); -} - -class _FakeWorkoutPlan_3 extends _i1.SmartFake implements _i5.WorkoutPlan { - _FakeWorkoutPlan_3(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); -} - -class _FakeDay_4 extends _i1.SmartFake implements _i6.Day { - _FakeDay_4(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); -} - -class _FakeSet_5 extends _i1.SmartFake implements _i7.Set { - _FakeSet_5(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); -} - -class _FakeSetting_6 extends _i1.SmartFake implements _i8.Setting { - _FakeSetting_6(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); -} - -class _FakeWorkoutSession_7 extends _i1.SmartFake implements _i9.WorkoutSession { - _FakeWorkoutSession_7(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); -} - -class _FakeLog_8 extends _i1.SmartFake implements _i10.Log { - _FakeLog_8(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); -} - -/// A class which mocks [WorkoutPlansProvider]. -/// -/// See the documentation for Mockito's code generation for more information. -class MockWorkoutPlansProvider extends _i1.Mock implements _i11.WorkoutPlansProvider { - MockWorkoutPlansProvider() { - _i1.throwOnMissingStub(this); - } - - @override - _i2.WgerBaseProvider get baseProvider => (super.noSuchMethod( - Invocation.getter(#baseProvider), - returnValue: _FakeWgerBaseProvider_0( - this, - Invocation.getter(#baseProvider), - ), - ) as _i2.WgerBaseProvider); - - @override - List<_i5.WorkoutPlan> get items => (super.noSuchMethod( - Invocation.getter(#items), - returnValue: <_i5.WorkoutPlan>[], - ) as List<_i5.WorkoutPlan>); - - @override - List<_i3.WeightUnit> get weightUnits => (super.noSuchMethod( - Invocation.getter(#weightUnits), - returnValue: <_i3.WeightUnit>[], - ) as List<_i3.WeightUnit>); - - @override - _i3.WeightUnit get defaultWeightUnit => (super.noSuchMethod( - Invocation.getter(#defaultWeightUnit), - returnValue: _FakeWeightUnit_1( - this, - Invocation.getter(#defaultWeightUnit), - ), - ) as _i3.WeightUnit); - - @override - List<_i4.RepetitionUnit> get repetitionUnits => (super.noSuchMethod( - Invocation.getter(#repetitionUnits), - returnValue: <_i4.RepetitionUnit>[], - ) as List<_i4.RepetitionUnit>); - - @override - _i4.RepetitionUnit get defaultRepetitionUnit => (super.noSuchMethod( - Invocation.getter(#defaultRepetitionUnit), - returnValue: _FakeRepetitionUnit_2( - this, - Invocation.getter(#defaultRepetitionUnit), - ), - ) as _i4.RepetitionUnit); - - @override - bool get hasListeners => - (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) as bool); - - @override - void clear() => super.noSuchMethod( - Invocation.method(#clear, []), - returnValueForMissingStub: null, - ); - - @override - List<_i5.WorkoutPlan> getPlans() => (super.noSuchMethod( - Invocation.method(#getPlans, []), - returnValue: <_i5.WorkoutPlan>[], - ) as List<_i5.WorkoutPlan>); - - @override - _i5.WorkoutPlan findById(int? id) => (super.noSuchMethod( - Invocation.method(#findById, [id]), - returnValue: _FakeWorkoutPlan_3( - this, - Invocation.method(#findById, [id]), - ), - ) as _i5.WorkoutPlan); - - @override - int findIndexById(int? id) => (super.noSuchMethod( - Invocation.method(#findIndexById, [id]), - returnValue: 0, - ) as int); - - @override - void setCurrentPlan(int? id) => super.noSuchMethod( - Invocation.method(#setCurrentPlan, [id]), - returnValueForMissingStub: null, - ); - - @override - void resetCurrentPlan() => super.noSuchMethod( - Invocation.method(#resetCurrentPlan, []), - returnValueForMissingStub: null, - ); - - @override - _i12.Future fetchAndSetAllPlansFull() => (super.noSuchMethod( - Invocation.method(#fetchAndSetAllPlansFull, []), - returnValue: _i12.Future.value(), - returnValueForMissingStub: _i12.Future.value(), - ) as _i12.Future); - - @override - _i12.Future fetchAndSetAllPlansSparse() => (super.noSuchMethod( - Invocation.method(#fetchAndSetAllPlansSparse, []), - returnValue: _i12.Future.value(), - returnValueForMissingStub: _i12.Future.value(), - ) as _i12.Future); - - @override - _i12.Future<_i5.WorkoutPlan> fetchAndSetPlanSparse(int? planId) => (super.noSuchMethod( - Invocation.method(#fetchAndSetPlanSparse, [planId]), - returnValue: _i12.Future<_i5.WorkoutPlan>.value( - _FakeWorkoutPlan_3( - this, - Invocation.method(#fetchAndSetPlanSparse, [planId]), - ), - ), - ) as _i12.Future<_i5.WorkoutPlan>); - - @override - _i12.Future<_i5.WorkoutPlan> fetchAndSetWorkoutPlanFull(int? workoutId) => (super.noSuchMethod( - Invocation.method(#fetchAndSetWorkoutPlanFull, [workoutId]), - returnValue: _i12.Future<_i5.WorkoutPlan>.value( - _FakeWorkoutPlan_3( - this, - Invocation.method(#fetchAndSetWorkoutPlanFull, [workoutId]), - ), - ), - ) as _i12.Future<_i5.WorkoutPlan>); - - @override - _i12.Future<_i5.WorkoutPlan> addWorkout(_i5.WorkoutPlan? workout) => (super.noSuchMethod( - Invocation.method(#addWorkout, [workout]), - returnValue: _i12.Future<_i5.WorkoutPlan>.value( - _FakeWorkoutPlan_3( - this, - Invocation.method(#addWorkout, [workout]), - ), - ), - ) as _i12.Future<_i5.WorkoutPlan>); - - @override - _i12.Future editWorkout(_i5.WorkoutPlan? workout) => (super.noSuchMethod( - Invocation.method(#editWorkout, [workout]), - returnValue: _i12.Future.value(), - returnValueForMissingStub: _i12.Future.value(), - ) as _i12.Future); - - @override - _i12.Future deleteWorkout(int? id) => (super.noSuchMethod( - Invocation.method(#deleteWorkout, [id]), - returnValue: _i12.Future.value(), - returnValueForMissingStub: _i12.Future.value(), - ) as _i12.Future); - - @override - _i12.Future> fetchLogData( - _i5.WorkoutPlan? workout, - _i13.Exercise? base, - ) => - (super.noSuchMethod( - Invocation.method(#fetchLogData, [workout, base]), - returnValue: _i12.Future>.value( - {}, - ), - ) as _i12.Future>); - - @override - _i12.Future fetchAndSetRepetitionUnits() => (super.noSuchMethod( - Invocation.method(#fetchAndSetRepetitionUnits, []), - returnValue: _i12.Future.value(), - returnValueForMissingStub: _i12.Future.value(), - ) as _i12.Future); - - @override - _i12.Future fetchAndSetWeightUnits() => (super.noSuchMethod( - Invocation.method(#fetchAndSetWeightUnits, []), - returnValue: _i12.Future.value(), - returnValueForMissingStub: _i12.Future.value(), - ) as _i12.Future); - - @override - _i12.Future fetchAndSetUnits() => (super.noSuchMethod( - Invocation.method(#fetchAndSetUnits, []), - returnValue: _i12.Future.value(), - returnValueForMissingStub: _i12.Future.value(), - ) as _i12.Future); - - @override - _i12.Future<_i6.Day> addDay(_i6.Day? day, _i5.WorkoutPlan? workout) => (super.noSuchMethod( - Invocation.method(#addDay, [day, workout]), - returnValue: _i12.Future<_i6.Day>.value( - _FakeDay_4(this, Invocation.method(#addDay, [day, workout])), - ), - ) as _i12.Future<_i6.Day>); - - @override - _i12.Future editDay(_i6.Day? day) => (super.noSuchMethod( - Invocation.method(#editDay, [day]), - returnValue: _i12.Future.value(), - returnValueForMissingStub: _i12.Future.value(), - ) as _i12.Future); - - @override - _i12.Future deleteDay(_i6.Day? day) => (super.noSuchMethod( - Invocation.method(#deleteDay, [day]), - returnValue: _i12.Future.value(), - returnValueForMissingStub: _i12.Future.value(), - ) as _i12.Future); - - @override - _i12.Future<_i7.Set> addSet(_i7.Set? workoutSet) => (super.noSuchMethod( - Invocation.method(#addSet, [workoutSet]), - returnValue: _i12.Future<_i7.Set>.value( - _FakeSet_5(this, Invocation.method(#addSet, [workoutSet])), - ), - ) as _i12.Future<_i7.Set>); - - @override - _i12.Future editSet(_i7.Set? workoutSet) => (super.noSuchMethod( - Invocation.method(#editSet, [workoutSet]), - returnValue: _i12.Future.value(), - returnValueForMissingStub: _i12.Future.value(), - ) as _i12.Future); - - @override - _i12.Future> reorderSets( - List<_i7.Set>? sets, - int? startIndex, - ) => - (super.noSuchMethod( - Invocation.method(#reorderSets, [sets, startIndex]), - returnValue: _i12.Future>.value(<_i7.Set>[]), - ) as _i12.Future>); - - @override - _i12.Future fetchComputedSettings(_i7.Set? workoutSet) => (super.noSuchMethod( - Invocation.method(#fetchComputedSettings, [workoutSet]), - returnValue: _i12.Future.value(), - returnValueForMissingStub: _i12.Future.value(), - ) as _i12.Future); - - @override - _i12.Future fetchSmartText( - _i7.Set? workoutSet, - _i14.Translation? exercise, - ) => - (super.noSuchMethod( - Invocation.method(#fetchSmartText, [workoutSet, exercise]), - returnValue: _i12.Future.value( - _i15.dummyValue( - this, - Invocation.method(#fetchSmartText, [workoutSet, exercise]), - ), - ), - ) as _i12.Future); - - @override - _i12.Future deleteSet(_i7.Set? workoutSet) => (super.noSuchMethod( - Invocation.method(#deleteSet, [workoutSet]), - returnValue: _i12.Future.value(), - returnValueForMissingStub: _i12.Future.value(), - ) as _i12.Future); - - @override - _i12.Future<_i8.Setting> addSetting(_i8.Setting? workoutSetting) => (super.noSuchMethod( - Invocation.method(#addSetting, [workoutSetting]), - returnValue: _i12.Future<_i8.Setting>.value( - _FakeSetting_6( - this, - Invocation.method(#addSetting, [workoutSetting]), - ), - ), - ) as _i12.Future<_i8.Setting>); - - @override - _i12.Future fetchSessionData() => (super.noSuchMethod( - Invocation.method(#fetchSessionData, []), - returnValue: _i12.Future.value(), - ) as _i12.Future); - - @override - _i12.Future<_i9.WorkoutSession> addSession(_i9.WorkoutSession? session) => (super.noSuchMethod( - Invocation.method(#addSession, [session]), - returnValue: _i12.Future<_i9.WorkoutSession>.value( - _FakeWorkoutSession_7( - this, - Invocation.method(#addSession, [session]), - ), - ), - ) as _i12.Future<_i9.WorkoutSession>); - - @override - _i12.Future<_i10.Log> addLog(_i10.Log? log) => (super.noSuchMethod( - Invocation.method(#addLog, [log]), - returnValue: _i12.Future<_i10.Log>.value( - _FakeLog_8(this, Invocation.method(#addLog, [log])), - ), - ) as _i12.Future<_i10.Log>); - - @override - _i12.Future deleteLog(_i10.Log? log) => (super.noSuchMethod( - Invocation.method(#deleteLog, [log]), - returnValue: _i12.Future.value(), - returnValueForMissingStub: _i12.Future.value(), - ) as _i12.Future); - - @override - void addListener(_i16.VoidCallback? listener) => super.noSuchMethod( - Invocation.method(#addListener, [listener]), - returnValueForMissingStub: null, - ); - - @override - void removeListener(_i16.VoidCallback? listener) => super.noSuchMethod( - Invocation.method(#removeListener, [listener]), - returnValueForMissingStub: null, - ); - - @override - void dispose() => super.noSuchMethod( - Invocation.method(#dispose, []), - returnValueForMissingStub: null, - ); - - @override - void notifyListeners() => super.noSuchMethod( - Invocation.method(#notifyListeners, []), - returnValueForMissingStub: null, - ); -} diff --git a/test/workout/workout_form_test.mocks.dart b/test/workout/workout_form_test.mocks.dart deleted file mode 100644 index 53a53f75f..000000000 --- a/test/workout/workout_form_test.mocks.dart +++ /dev/null @@ -1,409 +0,0 @@ -// Mocks generated by Mockito 5.4.5 from annotations -// in wger/test/workout/workout_form_test.dart. -// Do not manually edit this file. - -// ignore_for_file: no_leading_underscores_for_library_prefixes -import 'dart:async' as _i12; -import 'dart:ui' as _i16; - -import 'package:mockito/mockito.dart' as _i1; -import 'package:mockito/src/dummies.dart' as _i15; -import 'package:wger/models/exercises/exercise.dart' as _i13; -import 'package:wger/models/exercises/translation.dart' as _i14; -import 'package:wger/models/workouts/day.dart' as _i6; -import 'package:wger/models/workouts/log.dart' as _i10; -import 'package:wger/models/workouts/repetition_unit.dart' as _i4; -import 'package:wger/models/workouts/session.dart' as _i9; -import 'package:wger/models/workouts/set.dart' as _i7; -import 'package:wger/models/workouts/setting.dart' as _i8; -import 'package:wger/models/workouts/weight_unit.dart' as _i3; -import 'package:wger/models/workouts/workout_plan.dart' as _i5; -import 'package:wger/providers/base_provider.dart' as _i2; -import 'package:wger/providers/workout_plans.dart' as _i11; - -// ignore_for_file: type=lint -// ignore_for_file: avoid_redundant_argument_values -// ignore_for_file: avoid_setters_without_getters -// ignore_for_file: comment_references -// ignore_for_file: deprecated_member_use -// ignore_for_file: deprecated_member_use_from_same_package -// ignore_for_file: implementation_imports -// ignore_for_file: invalid_use_of_visible_for_testing_member -// ignore_for_file: must_be_immutable -// ignore_for_file: prefer_const_constructors -// ignore_for_file: unnecessary_parenthesis -// ignore_for_file: camel_case_types -// ignore_for_file: subtype_of_sealed_class - -class _FakeWgerBaseProvider_0 extends _i1.SmartFake implements _i2.WgerBaseProvider { - _FakeWgerBaseProvider_0(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); -} - -class _FakeWeightUnit_1 extends _i1.SmartFake implements _i3.WeightUnit { - _FakeWeightUnit_1(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); -} - -class _FakeRepetitionUnit_2 extends _i1.SmartFake implements _i4.RepetitionUnit { - _FakeRepetitionUnit_2(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); -} - -class _FakeWorkoutPlan_3 extends _i1.SmartFake implements _i5.WorkoutPlan { - _FakeWorkoutPlan_3(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); -} - -class _FakeDay_4 extends _i1.SmartFake implements _i6.Day { - _FakeDay_4(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); -} - -class _FakeSet_5 extends _i1.SmartFake implements _i7.Set { - _FakeSet_5(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); -} - -class _FakeSetting_6 extends _i1.SmartFake implements _i8.Setting { - _FakeSetting_6(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); -} - -class _FakeWorkoutSession_7 extends _i1.SmartFake implements _i9.WorkoutSession { - _FakeWorkoutSession_7(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); -} - -class _FakeLog_8 extends _i1.SmartFake implements _i10.Log { - _FakeLog_8(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); -} - -/// A class which mocks [WorkoutPlansProvider]. -/// -/// See the documentation for Mockito's code generation for more information. -class MockWorkoutPlansProvider extends _i1.Mock implements _i11.WorkoutPlansProvider { - MockWorkoutPlansProvider() { - _i1.throwOnMissingStub(this); - } - - @override - _i2.WgerBaseProvider get baseProvider => (super.noSuchMethod( - Invocation.getter(#baseProvider), - returnValue: _FakeWgerBaseProvider_0( - this, - Invocation.getter(#baseProvider), - ), - ) as _i2.WgerBaseProvider); - - @override - List<_i5.WorkoutPlan> get items => (super.noSuchMethod( - Invocation.getter(#items), - returnValue: <_i5.WorkoutPlan>[], - ) as List<_i5.WorkoutPlan>); - - @override - List<_i3.WeightUnit> get weightUnits => (super.noSuchMethod( - Invocation.getter(#weightUnits), - returnValue: <_i3.WeightUnit>[], - ) as List<_i3.WeightUnit>); - - @override - _i3.WeightUnit get defaultWeightUnit => (super.noSuchMethod( - Invocation.getter(#defaultWeightUnit), - returnValue: _FakeWeightUnit_1( - this, - Invocation.getter(#defaultWeightUnit), - ), - ) as _i3.WeightUnit); - - @override - List<_i4.RepetitionUnit> get repetitionUnits => (super.noSuchMethod( - Invocation.getter(#repetitionUnits), - returnValue: <_i4.RepetitionUnit>[], - ) as List<_i4.RepetitionUnit>); - - @override - _i4.RepetitionUnit get defaultRepetitionUnit => (super.noSuchMethod( - Invocation.getter(#defaultRepetitionUnit), - returnValue: _FakeRepetitionUnit_2( - this, - Invocation.getter(#defaultRepetitionUnit), - ), - ) as _i4.RepetitionUnit); - - @override - bool get hasListeners => - (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) as bool); - - @override - void clear() => super.noSuchMethod( - Invocation.method(#clear, []), - returnValueForMissingStub: null, - ); - - @override - List<_i5.WorkoutPlan> getPlans() => (super.noSuchMethod( - Invocation.method(#getPlans, []), - returnValue: <_i5.WorkoutPlan>[], - ) as List<_i5.WorkoutPlan>); - - @override - _i5.WorkoutPlan findById(int? id) => (super.noSuchMethod( - Invocation.method(#findById, [id]), - returnValue: _FakeWorkoutPlan_3( - this, - Invocation.method(#findById, [id]), - ), - ) as _i5.WorkoutPlan); - - @override - int findIndexById(int? id) => (super.noSuchMethod( - Invocation.method(#findIndexById, [id]), - returnValue: 0, - ) as int); - - @override - void setCurrentPlan(int? id) => super.noSuchMethod( - Invocation.method(#setCurrentPlan, [id]), - returnValueForMissingStub: null, - ); - - @override - void resetCurrentPlan() => super.noSuchMethod( - Invocation.method(#resetCurrentPlan, []), - returnValueForMissingStub: null, - ); - - @override - _i12.Future fetchAndSetAllPlansFull() => (super.noSuchMethod( - Invocation.method(#fetchAndSetAllPlansFull, []), - returnValue: _i12.Future.value(), - returnValueForMissingStub: _i12.Future.value(), - ) as _i12.Future); - - @override - _i12.Future fetchAndSetAllPlansSparse() => (super.noSuchMethod( - Invocation.method(#fetchAndSetAllPlansSparse, []), - returnValue: _i12.Future.value(), - returnValueForMissingStub: _i12.Future.value(), - ) as _i12.Future); - - @override - _i12.Future<_i5.WorkoutPlan> fetchAndSetPlanSparse(int? planId) => (super.noSuchMethod( - Invocation.method(#fetchAndSetPlanSparse, [planId]), - returnValue: _i12.Future<_i5.WorkoutPlan>.value( - _FakeWorkoutPlan_3( - this, - Invocation.method(#fetchAndSetPlanSparse, [planId]), - ), - ), - ) as _i12.Future<_i5.WorkoutPlan>); - - @override - _i12.Future<_i5.WorkoutPlan> fetchAndSetWorkoutPlanFull(int? workoutId) => (super.noSuchMethod( - Invocation.method(#fetchAndSetWorkoutPlanFull, [workoutId]), - returnValue: _i12.Future<_i5.WorkoutPlan>.value( - _FakeWorkoutPlan_3( - this, - Invocation.method(#fetchAndSetWorkoutPlanFull, [workoutId]), - ), - ), - ) as _i12.Future<_i5.WorkoutPlan>); - - @override - _i12.Future<_i5.WorkoutPlan> addWorkout(_i5.WorkoutPlan? workout) => (super.noSuchMethod( - Invocation.method(#addWorkout, [workout]), - returnValue: _i12.Future<_i5.WorkoutPlan>.value( - _FakeWorkoutPlan_3( - this, - Invocation.method(#addWorkout, [workout]), - ), - ), - ) as _i12.Future<_i5.WorkoutPlan>); - - @override - _i12.Future editWorkout(_i5.WorkoutPlan? workout) => (super.noSuchMethod( - Invocation.method(#editWorkout, [workout]), - returnValue: _i12.Future.value(), - returnValueForMissingStub: _i12.Future.value(), - ) as _i12.Future); - - @override - _i12.Future deleteWorkout(int? id) => (super.noSuchMethod( - Invocation.method(#deleteWorkout, [id]), - returnValue: _i12.Future.value(), - returnValueForMissingStub: _i12.Future.value(), - ) as _i12.Future); - - @override - _i12.Future> fetchLogData( - _i5.WorkoutPlan? workout, - _i13.Exercise? base, - ) => - (super.noSuchMethod( - Invocation.method(#fetchLogData, [workout, base]), - returnValue: _i12.Future>.value( - {}, - ), - ) as _i12.Future>); - - @override - _i12.Future fetchAndSetRepetitionUnits() => (super.noSuchMethod( - Invocation.method(#fetchAndSetRepetitionUnits, []), - returnValue: _i12.Future.value(), - returnValueForMissingStub: _i12.Future.value(), - ) as _i12.Future); - - @override - _i12.Future fetchAndSetWeightUnits() => (super.noSuchMethod( - Invocation.method(#fetchAndSetWeightUnits, []), - returnValue: _i12.Future.value(), - returnValueForMissingStub: _i12.Future.value(), - ) as _i12.Future); - - @override - _i12.Future fetchAndSetUnits() => (super.noSuchMethod( - Invocation.method(#fetchAndSetUnits, []), - returnValue: _i12.Future.value(), - returnValueForMissingStub: _i12.Future.value(), - ) as _i12.Future); - - @override - _i12.Future<_i6.Day> addDay(_i6.Day? day, _i5.WorkoutPlan? workout) => (super.noSuchMethod( - Invocation.method(#addDay, [day, workout]), - returnValue: _i12.Future<_i6.Day>.value( - _FakeDay_4(this, Invocation.method(#addDay, [day, workout])), - ), - ) as _i12.Future<_i6.Day>); - - @override - _i12.Future editDay(_i6.Day? day) => (super.noSuchMethod( - Invocation.method(#editDay, [day]), - returnValue: _i12.Future.value(), - returnValueForMissingStub: _i12.Future.value(), - ) as _i12.Future); - - @override - _i12.Future deleteDay(_i6.Day? day) => (super.noSuchMethod( - Invocation.method(#deleteDay, [day]), - returnValue: _i12.Future.value(), - returnValueForMissingStub: _i12.Future.value(), - ) as _i12.Future); - - @override - _i12.Future<_i7.Set> addSet(_i7.Set? workoutSet) => (super.noSuchMethod( - Invocation.method(#addSet, [workoutSet]), - returnValue: _i12.Future<_i7.Set>.value( - _FakeSet_5(this, Invocation.method(#addSet, [workoutSet])), - ), - ) as _i12.Future<_i7.Set>); - - @override - _i12.Future editSet(_i7.Set? workoutSet) => (super.noSuchMethod( - Invocation.method(#editSet, [workoutSet]), - returnValue: _i12.Future.value(), - returnValueForMissingStub: _i12.Future.value(), - ) as _i12.Future); - - @override - _i12.Future> reorderSets( - List<_i7.Set>? sets, - int? startIndex, - ) => - (super.noSuchMethod( - Invocation.method(#reorderSets, [sets, startIndex]), - returnValue: _i12.Future>.value(<_i7.Set>[]), - ) as _i12.Future>); - - @override - _i12.Future fetchComputedSettings(_i7.Set? workoutSet) => (super.noSuchMethod( - Invocation.method(#fetchComputedSettings, [workoutSet]), - returnValue: _i12.Future.value(), - returnValueForMissingStub: _i12.Future.value(), - ) as _i12.Future); - - @override - _i12.Future fetchSmartText( - _i7.Set? workoutSet, - _i14.Translation? exercise, - ) => - (super.noSuchMethod( - Invocation.method(#fetchSmartText, [workoutSet, exercise]), - returnValue: _i12.Future.value( - _i15.dummyValue( - this, - Invocation.method(#fetchSmartText, [workoutSet, exercise]), - ), - ), - ) as _i12.Future); - - @override - _i12.Future deleteSet(_i7.Set? workoutSet) => (super.noSuchMethod( - Invocation.method(#deleteSet, [workoutSet]), - returnValue: _i12.Future.value(), - returnValueForMissingStub: _i12.Future.value(), - ) as _i12.Future); - - @override - _i12.Future<_i8.Setting> addSetting(_i8.Setting? workoutSetting) => (super.noSuchMethod( - Invocation.method(#addSetting, [workoutSetting]), - returnValue: _i12.Future<_i8.Setting>.value( - _FakeSetting_6( - this, - Invocation.method(#addSetting, [workoutSetting]), - ), - ), - ) as _i12.Future<_i8.Setting>); - - @override - _i12.Future fetchSessionData() => (super.noSuchMethod( - Invocation.method(#fetchSessionData, []), - returnValue: _i12.Future.value(), - ) as _i12.Future); - - @override - _i12.Future<_i9.WorkoutSession> addSession(_i9.WorkoutSession? session) => (super.noSuchMethod( - Invocation.method(#addSession, [session]), - returnValue: _i12.Future<_i9.WorkoutSession>.value( - _FakeWorkoutSession_7( - this, - Invocation.method(#addSession, [session]), - ), - ), - ) as _i12.Future<_i9.WorkoutSession>); - - @override - _i12.Future<_i10.Log> addLog(_i10.Log? log) => (super.noSuchMethod( - Invocation.method(#addLog, [log]), - returnValue: _i12.Future<_i10.Log>.value( - _FakeLog_8(this, Invocation.method(#addLog, [log])), - ), - ) as _i12.Future<_i10.Log>); - - @override - _i12.Future deleteLog(_i10.Log? log) => (super.noSuchMethod( - Invocation.method(#deleteLog, [log]), - returnValue: _i12.Future.value(), - returnValueForMissingStub: _i12.Future.value(), - ) as _i12.Future); - - @override - void addListener(_i16.VoidCallback? listener) => super.noSuchMethod( - Invocation.method(#addListener, [listener]), - returnValueForMissingStub: null, - ); - - @override - void removeListener(_i16.VoidCallback? listener) => super.noSuchMethod( - Invocation.method(#removeListener, [listener]), - returnValueForMissingStub: null, - ); - - @override - void dispose() => super.noSuchMethod( - Invocation.method(#dispose, []), - returnValueForMissingStub: null, - ); - - @override - void notifyListeners() => super.noSuchMethod( - Invocation.method(#notifyListeners, []), - returnValueForMissingStub: null, - ); -} diff --git a/test/workout/workout_log_model_test.dart b/test/workout/workout_log_model_test.dart index a53e7ae3b..9bfdfe936 100644 --- a/test/workout/workout_log_model_test.dart +++ b/test/workout/workout_log_model_test.dart @@ -27,22 +27,26 @@ void main() { setUp(() { log1 = Log( id: 123, - workoutPlan: 100, - exerciseBaseId: 1, - reps: 10, + iteration: 1, + slotEntryId: 100, + routineId: 100, + exerciseId: 1, + repetitions: 10, rir: '1.5', - repetitionUnitId: 1, + repetitionsUnitId: 1, weight: 20, weightUnitId: 1, date: DateTime(2010, 10, 1), ); log2 = Log( id: 9, - workoutPlan: 42, - exerciseBaseId: 1, - reps: 10, + iteration: 2, + slotEntryId: 42, + routineId: 42, + exerciseId: 1, + repetitions: 10, rir: '1.5', - repetitionUnitId: 1, + repetitionsUnitId: 1, weight: 20, weightUnitId: 1, date: DateTime(2063, 4, 5), @@ -69,12 +73,12 @@ void main() { }); test('Test different reps', () { - log1.reps = 99; + log1.repetitions = 99; expect(log1, isNot(log2)); }); test('Test different rep units', () { - log1.repetitionUnitId = 44; + log1.repetitionsUnitId = 44; expect(log1, isNot(log2)); }); }); diff --git a/test/workout/workout_plans_screen_test.mocks.dart b/test/workout/workout_plans_screen_test.mocks.dart deleted file mode 100644 index 0eb0af70b..000000000 --- a/test/workout/workout_plans_screen_test.mocks.dart +++ /dev/null @@ -1,151 +0,0 @@ -// Mocks generated by Mockito 5.4.5 from annotations -// in wger/test/workout/workout_plans_screen_test.dart. -// Do not manually edit this file. - -// ignore_for_file: no_leading_underscores_for_library_prefixes -import 'dart:async' as _i5; - -import 'package:http/http.dart' as _i3; -import 'package:mockito/mockito.dart' as _i1; -import 'package:wger/providers/auth.dart' as _i2; -import 'package:wger/providers/base_provider.dart' as _i4; - -// ignore_for_file: type=lint -// ignore_for_file: avoid_redundant_argument_values -// ignore_for_file: avoid_setters_without_getters -// ignore_for_file: comment_references -// ignore_for_file: deprecated_member_use -// ignore_for_file: deprecated_member_use_from_same_package -// ignore_for_file: implementation_imports -// ignore_for_file: invalid_use_of_visible_for_testing_member -// ignore_for_file: must_be_immutable -// ignore_for_file: prefer_const_constructors -// ignore_for_file: unnecessary_parenthesis -// ignore_for_file: camel_case_types -// ignore_for_file: subtype_of_sealed_class - -class _FakeAuthProvider_0 extends _i1.SmartFake implements _i2.AuthProvider { - _FakeAuthProvider_0(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); -} - -class _FakeClient_1 extends _i1.SmartFake implements _i3.Client { - _FakeClient_1(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); -} - -class _FakeUri_2 extends _i1.SmartFake implements Uri { - _FakeUri_2(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); -} - -class _FakeResponse_3 extends _i1.SmartFake implements _i3.Response { - _FakeResponse_3(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); -} - -/// A class which mocks [WgerBaseProvider]. -/// -/// See the documentation for Mockito's code generation for more information. -class MockWgerBaseProvider extends _i1.Mock implements _i4.WgerBaseProvider { - MockWgerBaseProvider() { - _i1.throwOnMissingStub(this); - } - - @override - _i2.AuthProvider get auth => (super.noSuchMethod( - Invocation.getter(#auth), - returnValue: _FakeAuthProvider_0(this, Invocation.getter(#auth)), - ) as _i2.AuthProvider); - - @override - set auth(_i2.AuthProvider? _auth) => super.noSuchMethod( - Invocation.setter(#auth, _auth), - returnValueForMissingStub: null, - ); - - @override - _i3.Client get client => (super.noSuchMethod( - Invocation.getter(#client), - returnValue: _FakeClient_1(this, Invocation.getter(#client)), - ) as _i3.Client); - - @override - set client(_i3.Client? _client) => super.noSuchMethod( - Invocation.setter(#client, _client), - returnValueForMissingStub: null, - ); - - @override - Map getDefaultHeaders({bool? includeAuth = false}) => (super.noSuchMethod( - Invocation.method(#getDefaultHeaders, [], { - #includeAuth: includeAuth, - }), - returnValue: {}, - ) as Map); - - @override - Uri makeUrl( - String? path, { - int? id, - String? objectMethod, - Map? query, - }) => - (super.noSuchMethod( - Invocation.method( - #makeUrl, - [path], - {#id: id, #objectMethod: objectMethod, #query: query}, - ), - returnValue: _FakeUri_2( - this, - Invocation.method( - #makeUrl, - [path], - {#id: id, #objectMethod: objectMethod, #query: query}, - ), - ), - ) as Uri); - - @override - _i5.Future> fetch(Uri? uri) => (super.noSuchMethod( - Invocation.method(#fetch, [uri]), - returnValue: _i5.Future>.value( - {}, - ), - ) as _i5.Future>); - - @override - _i5.Future> fetchPaginated(Uri? uri) => (super.noSuchMethod( - Invocation.method(#fetchPaginated, [uri]), - returnValue: _i5.Future>.value([]), - ) as _i5.Future>); - - @override - _i5.Future> post(Map? data, Uri? uri) => - (super.noSuchMethod( - Invocation.method(#post, [data, uri]), - returnValue: _i5.Future>.value( - {}, - ), - ) as _i5.Future>); - - @override - _i5.Future> patch( - Map? data, - Uri? uri, - ) => - (super.noSuchMethod( - Invocation.method(#patch, [data, uri]), - returnValue: _i5.Future>.value( - {}, - ), - ) as _i5.Future>); - - @override - _i5.Future<_i3.Response> deleteRequest(String? url, int? id) => (super.noSuchMethod( - Invocation.method(#deleteRequest, [url, id]), - returnValue: _i5.Future<_i3.Response>.value( - _FakeResponse_3( - this, - Invocation.method(#deleteRequest, [url, id]), - ), - ), - ) as _i5.Future<_i3.Response>); -} diff --git a/test/workout/workout_set_form_test.dart b/test/workout/workout_set_form_test.dart deleted file mode 100644 index 089618543..000000000 --- a/test/workout/workout_set_form_test.dart +++ /dev/null @@ -1,106 +0,0 @@ -/* - * This file is part of wger Workout Manager . - * Copyright (C) 2020, 2021 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. - * - * wger Workout Manager is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -import 'package:flutter/material.dart'; -import 'package:flutter_gen/gen_l10n/app_localizations.dart'; -import 'package:flutter_test/flutter_test.dart'; -import 'package:mockito/annotations.dart'; -import 'package:mockito/mockito.dart'; -import 'package:provider/provider.dart'; -import 'package:wger/helpers/consts.dart'; -import 'package:wger/models/workouts/day.dart'; -import 'package:wger/models/workouts/set.dart'; -import 'package:wger/models/workouts/setting.dart'; -import 'package:wger/providers/base_provider.dart'; -import 'package:wger/providers/exercises.dart'; -import 'package:wger/providers/workout_plans.dart'; -import 'package:wger/widgets/workouts/forms.dart'; - -import '../../test_data/exercises.dart'; -import '../../test_data/workouts.dart'; -import 'workout_set_form_test.mocks.dart'; - -@GenerateMocks([ExercisesProvider, WgerBaseProvider, WorkoutPlansProvider]) -void main() { - var mockWorkoutPlans = MockWorkoutPlansProvider(); - final mockBaseProvider = MockWgerBaseProvider(); - final mockExerciseProvider = MockExercisesProvider(); - final workoutPlan = getWorkout(); - - Day day = Day(); - - setUp(() { - day = workoutPlan.days.first; - mockWorkoutPlans = MockWorkoutPlansProvider(); - }); - - Widget createHomeScreen({locale = 'en'}) { - return ChangeNotifierProvider( - create: (context) => WorkoutPlansProvider( - mockBaseProvider, - mockExerciseProvider, - [workoutPlan], - ), - child: ChangeNotifierProvider( - create: (context) => mockExerciseProvider, - child: MaterialApp( - locale: Locale(locale), - localizationsDelegates: AppLocalizations.localizationsDelegates, - supportedLocales: AppLocalizations.supportedLocales, - navigatorKey: GlobalKey(), - home: Scaffold(body: SetFormWidget(day)), - ), - ), - ); - } - - testWidgets('Test the widgets on the SetFormWidget', (WidgetTester tester) async { - await tester.pumpWidget(createHomeScreen()); - await tester.pumpAndSettle(); - - //TODO: why doesn't it find the typeahead? - //expect(find.byType(TypeAheadFormField), findsOneWidget); - expect(find.byType(Slider), findsOneWidget); - expect(find.byKey(const Key(SUBMIT_BUTTON_KEY_NAME)), findsOneWidget); - expect(find.byType(ElevatedButton), findsOneWidget); - }); - - testWidgets('Test creating a new set', (WidgetTester tester) async { - when(mockWorkoutPlans.addSet(any)).thenAnswer((_) => Future.value(Set.empty())); - when(mockWorkoutPlans.addSetting(any)).thenAnswer((_) => Future.value(Setting.empty())); - when(mockWorkoutPlans.fetchSmartText(any, any)).thenAnswer((_) => Future.value('2 x 10')); - when(mockExerciseProvider.searchExercise( - any, - languageCode: anyNamed('languageCode'), - searchEnglish: anyNamed('searchEnglish'), - )).thenAnswer((_) => Future.value([getTestExercises().first])); - - await tester.pumpWidget(createHomeScreen()); - await tester.pumpAndSettle(); - - await tester.enterText(find.byKey(const Key('field-typeahead')), 'exercise'); - await tester.pumpAndSettle(); - - //await tester.tap(find.byKey(const Key('exercise-1'))); - await tester.tap(find.byKey(const Key(SUBMIT_BUTTON_KEY_NAME))); - - //verify(mockWorkoutPlans.addSet(any)); - //verify(mockWorkoutPlans.addSettinbg(any)); - //verify(mockWorkoutPlans.fetchSmartText(any, any)); - }); -} diff --git a/test/workout/workout_set_form_test.mocks.dart b/test/workout/workout_set_form_test.mocks.dart deleted file mode 100644 index 733627ec2..000000000 --- a/test/workout/workout_set_form_test.mocks.dart +++ /dev/null @@ -1,928 +0,0 @@ -// Mocks generated by Mockito 5.4.5 from annotations -// in wger/test/workout/workout_set_form_test.dart. -// Do not manually edit this file. - -// ignore_for_file: no_leading_underscores_for_library_prefixes -import 'dart:async' as _i20; -import 'dart:ui' as _i21; - -import 'package:http/http.dart' as _i10; -import 'package:mockito/mockito.dart' as _i1; -import 'package:mockito/src/dummies.dart' as _i24; -import 'package:wger/database/exercises/exercise_database.dart' as _i3; -import 'package:wger/models/exercises/category.dart' as _i5; -import 'package:wger/models/exercises/equipment.dart' as _i6; -import 'package:wger/models/exercises/exercise.dart' as _i4; -import 'package:wger/models/exercises/language.dart' as _i8; -import 'package:wger/models/exercises/muscle.dart' as _i7; -import 'package:wger/models/exercises/translation.dart' as _i23; -import 'package:wger/models/workouts/day.dart' as _i14; -import 'package:wger/models/workouts/log.dart' as _i18; -import 'package:wger/models/workouts/repetition_unit.dart' as _i12; -import 'package:wger/models/workouts/session.dart' as _i17; -import 'package:wger/models/workouts/set.dart' as _i15; -import 'package:wger/models/workouts/setting.dart' as _i16; -import 'package:wger/models/workouts/weight_unit.dart' as _i11; -import 'package:wger/models/workouts/workout_plan.dart' as _i13; -import 'package:wger/providers/auth.dart' as _i9; -import 'package:wger/providers/base_provider.dart' as _i2; -import 'package:wger/providers/exercises.dart' as _i19; -import 'package:wger/providers/workout_plans.dart' as _i22; - -// ignore_for_file: type=lint -// ignore_for_file: avoid_redundant_argument_values -// ignore_for_file: avoid_setters_without_getters -// ignore_for_file: comment_references -// ignore_for_file: deprecated_member_use -// ignore_for_file: deprecated_member_use_from_same_package -// ignore_for_file: implementation_imports -// ignore_for_file: invalid_use_of_visible_for_testing_member -// ignore_for_file: must_be_immutable -// ignore_for_file: prefer_const_constructors -// ignore_for_file: unnecessary_parenthesis -// ignore_for_file: camel_case_types -// ignore_for_file: subtype_of_sealed_class - -class _FakeWgerBaseProvider_0 extends _i1.SmartFake implements _i2.WgerBaseProvider { - _FakeWgerBaseProvider_0(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); -} - -class _FakeExerciseDatabase_1 extends _i1.SmartFake implements _i3.ExerciseDatabase { - _FakeExerciseDatabase_1(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); -} - -class _FakeExercise_2 extends _i1.SmartFake implements _i4.Exercise { - _FakeExercise_2(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); -} - -class _FakeExerciseCategory_3 extends _i1.SmartFake implements _i5.ExerciseCategory { - _FakeExerciseCategory_3(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); -} - -class _FakeEquipment_4 extends _i1.SmartFake implements _i6.Equipment { - _FakeEquipment_4(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); -} - -class _FakeMuscle_5 extends _i1.SmartFake implements _i7.Muscle { - _FakeMuscle_5(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); -} - -class _FakeLanguage_6 extends _i1.SmartFake implements _i8.Language { - _FakeLanguage_6(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); -} - -class _FakeAuthProvider_7 extends _i1.SmartFake implements _i9.AuthProvider { - _FakeAuthProvider_7(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); -} - -class _FakeClient_8 extends _i1.SmartFake implements _i10.Client { - _FakeClient_8(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); -} - -class _FakeUri_9 extends _i1.SmartFake implements Uri { - _FakeUri_9(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); -} - -class _FakeResponse_10 extends _i1.SmartFake implements _i10.Response { - _FakeResponse_10(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); -} - -class _FakeWeightUnit_11 extends _i1.SmartFake implements _i11.WeightUnit { - _FakeWeightUnit_11(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); -} - -class _FakeRepetitionUnit_12 extends _i1.SmartFake implements _i12.RepetitionUnit { - _FakeRepetitionUnit_12(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); -} - -class _FakeWorkoutPlan_13 extends _i1.SmartFake implements _i13.WorkoutPlan { - _FakeWorkoutPlan_13(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); -} - -class _FakeDay_14 extends _i1.SmartFake implements _i14.Day { - _FakeDay_14(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); -} - -class _FakeSet_15 extends _i1.SmartFake implements _i15.Set { - _FakeSet_15(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); -} - -class _FakeSetting_16 extends _i1.SmartFake implements _i16.Setting { - _FakeSetting_16(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); -} - -class _FakeWorkoutSession_17 extends _i1.SmartFake implements _i17.WorkoutSession { - _FakeWorkoutSession_17(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); -} - -class _FakeLog_18 extends _i1.SmartFake implements _i18.Log { - _FakeLog_18(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); -} - -/// A class which mocks [ExercisesProvider]. -/// -/// See the documentation for Mockito's code generation for more information. -class MockExercisesProvider extends _i1.Mock implements _i19.ExercisesProvider { - MockExercisesProvider() { - _i1.throwOnMissingStub(this); - } - - @override - _i2.WgerBaseProvider get baseProvider => (super.noSuchMethod( - Invocation.getter(#baseProvider), - returnValue: _FakeWgerBaseProvider_0( - this, - Invocation.getter(#baseProvider), - ), - ) as _i2.WgerBaseProvider); - - @override - _i3.ExerciseDatabase get database => (super.noSuchMethod( - Invocation.getter(#database), - returnValue: _FakeExerciseDatabase_1( - this, - Invocation.getter(#database), - ), - ) as _i3.ExerciseDatabase); - - @override - set database(_i3.ExerciseDatabase? _database) => super.noSuchMethod( - Invocation.setter(#database, _database), - returnValueForMissingStub: null, - ); - - @override - List<_i4.Exercise> get exercises => (super.noSuchMethod( - Invocation.getter(#exercises), - returnValue: <_i4.Exercise>[], - ) as List<_i4.Exercise>); - - @override - set exercises(List<_i4.Exercise>? _exercises) => super.noSuchMethod( - Invocation.setter(#exercises, _exercises), - returnValueForMissingStub: null, - ); - - @override - List<_i4.Exercise> get filteredExercises => (super.noSuchMethod( - Invocation.getter(#filteredExercises), - returnValue: <_i4.Exercise>[], - ) as List<_i4.Exercise>); - - @override - set filteredExercises(List<_i4.Exercise>? newFilteredExercises) => super.noSuchMethod( - Invocation.setter(#filteredExercises, newFilteredExercises), - returnValueForMissingStub: null, - ); - - @override - Map> get exerciseBasesByVariation => (super.noSuchMethod( - Invocation.getter(#exerciseBasesByVariation), - returnValue: >{}, - ) as Map>); - - @override - List<_i5.ExerciseCategory> get categories => (super.noSuchMethod( - Invocation.getter(#categories), - returnValue: <_i5.ExerciseCategory>[], - ) as List<_i5.ExerciseCategory>); - - @override - List<_i7.Muscle> get muscles => (super.noSuchMethod( - Invocation.getter(#muscles), - returnValue: <_i7.Muscle>[], - ) as List<_i7.Muscle>); - - @override - List<_i6.Equipment> get equipment => (super.noSuchMethod( - Invocation.getter(#equipment), - returnValue: <_i6.Equipment>[], - ) as List<_i6.Equipment>); - - @override - List<_i8.Language> get languages => (super.noSuchMethod( - Invocation.getter(#languages), - returnValue: <_i8.Language>[], - ) as List<_i8.Language>); - - @override - set languages(List<_i8.Language>? languages) => super.noSuchMethod( - Invocation.setter(#languages, languages), - returnValueForMissingStub: null, - ); - - @override - bool get hasListeners => - (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) as bool); - - @override - _i20.Future setFilters(_i19.Filters? newFilters) => (super.noSuchMethod( - Invocation.method(#setFilters, [newFilters]), - returnValue: _i20.Future.value(), - returnValueForMissingStub: _i20.Future.value(), - ) as _i20.Future); - - @override - void initFilters() => super.noSuchMethod( - Invocation.method(#initFilters, []), - returnValueForMissingStub: null, - ); - - @override - _i20.Future findByFilters() => (super.noSuchMethod( - Invocation.method(#findByFilters, []), - returnValue: _i20.Future.value(), - returnValueForMissingStub: _i20.Future.value(), - ) as _i20.Future); - - @override - void clear() => super.noSuchMethod( - Invocation.method(#clear, []), - returnValueForMissingStub: null, - ); - - @override - _i4.Exercise findExerciseById(int? id) => (super.noSuchMethod( - Invocation.method(#findExerciseById, [id]), - returnValue: _FakeExercise_2( - this, - Invocation.method(#findExerciseById, [id]), - ), - ) as _i4.Exercise); - - @override - List<_i4.Exercise> findExercisesByVariationId( - int? id, { - int? exerciseBaseIdToExclude, - }) => - (super.noSuchMethod( - Invocation.method( - #findExercisesByVariationId, - [id], - {#exerciseBaseIdToExclude: exerciseBaseIdToExclude}, - ), - returnValue: <_i4.Exercise>[], - ) as List<_i4.Exercise>); - - @override - _i5.ExerciseCategory findCategoryById(int? id) => (super.noSuchMethod( - Invocation.method(#findCategoryById, [id]), - returnValue: _FakeExerciseCategory_3( - this, - Invocation.method(#findCategoryById, [id]), - ), - ) as _i5.ExerciseCategory); - - @override - _i6.Equipment findEquipmentById(int? id) => (super.noSuchMethod( - Invocation.method(#findEquipmentById, [id]), - returnValue: _FakeEquipment_4( - this, - Invocation.method(#findEquipmentById, [id]), - ), - ) as _i6.Equipment); - - @override - _i7.Muscle findMuscleById(int? id) => (super.noSuchMethod( - Invocation.method(#findMuscleById, [id]), - returnValue: _FakeMuscle_5( - this, - Invocation.method(#findMuscleById, [id]), - ), - ) as _i7.Muscle); - - @override - _i8.Language findLanguageById(int? id) => (super.noSuchMethod( - Invocation.method(#findLanguageById, [id]), - returnValue: _FakeLanguage_6( - this, - Invocation.method(#findLanguageById, [id]), - ), - ) as _i8.Language); - - @override - _i20.Future fetchAndSetCategoriesFromApi() => (super.noSuchMethod( - Invocation.method(#fetchAndSetCategoriesFromApi, []), - returnValue: _i20.Future.value(), - returnValueForMissingStub: _i20.Future.value(), - ) as _i20.Future); - - @override - _i20.Future fetchAndSetMusclesFromApi() => (super.noSuchMethod( - Invocation.method(#fetchAndSetMusclesFromApi, []), - returnValue: _i20.Future.value(), - returnValueForMissingStub: _i20.Future.value(), - ) as _i20.Future); - - @override - _i20.Future fetchAndSetEquipmentsFromApi() => (super.noSuchMethod( - Invocation.method(#fetchAndSetEquipmentsFromApi, []), - returnValue: _i20.Future.value(), - returnValueForMissingStub: _i20.Future.value(), - ) as _i20.Future); - - @override - _i20.Future fetchAndSetLanguagesFromApi() => (super.noSuchMethod( - Invocation.method(#fetchAndSetLanguagesFromApi, []), - returnValue: _i20.Future.value(), - returnValueForMissingStub: _i20.Future.value(), - ) as _i20.Future); - - @override - _i20.Future<_i4.Exercise> fetchAndSetExercise(int? exerciseId) => (super.noSuchMethod( - Invocation.method(#fetchAndSetExercise, [exerciseId]), - returnValue: _i20.Future<_i4.Exercise>.value( - _FakeExercise_2( - this, - Invocation.method(#fetchAndSetExercise, [exerciseId]), - ), - ), - ) as _i20.Future<_i4.Exercise>); - - @override - _i20.Future<_i4.Exercise> handleUpdateExerciseFromApi( - _i3.ExerciseDatabase? database, - int? exerciseId, - ) => - (super.noSuchMethod( - Invocation.method(#handleUpdateExerciseFromApi, [ - database, - exerciseId, - ]), - returnValue: _i20.Future<_i4.Exercise>.value( - _FakeExercise_2( - this, - Invocation.method(#handleUpdateExerciseFromApi, [ - database, - exerciseId, - ]), - ), - ), - ) as _i20.Future<_i4.Exercise>); - - @override - _i20.Future initCacheTimesLocalPrefs({dynamic forceInit = false}) => (super.noSuchMethod( - Invocation.method(#initCacheTimesLocalPrefs, [], { - #forceInit: forceInit, - }), - returnValue: _i20.Future.value(), - returnValueForMissingStub: _i20.Future.value(), - ) as _i20.Future); - - @override - _i20.Future clearAllCachesAndPrefs() => (super.noSuchMethod( - Invocation.method(#clearAllCachesAndPrefs, []), - returnValue: _i20.Future.value(), - returnValueForMissingStub: _i20.Future.value(), - ) as _i20.Future); - - @override - _i20.Future fetchAndSetInitialData() => (super.noSuchMethod( - Invocation.method(#fetchAndSetInitialData, []), - returnValue: _i20.Future.value(), - returnValueForMissingStub: _i20.Future.value(), - ) as _i20.Future); - - @override - _i20.Future setExercisesFromDatabase( - _i3.ExerciseDatabase? database, { - bool? forceDeleteCache = false, - }) => - (super.noSuchMethod( - Invocation.method( - #setExercisesFromDatabase, - [database], - {#forceDeleteCache: forceDeleteCache}, - ), - returnValue: _i20.Future.value(), - returnValueForMissingStub: _i20.Future.value(), - ) as _i20.Future); - - @override - _i20.Future updateExerciseCache(_i3.ExerciseDatabase? database) => (super.noSuchMethod( - Invocation.method(#updateExerciseCache, [database]), - returnValue: _i20.Future.value(), - returnValueForMissingStub: _i20.Future.value(), - ) as _i20.Future); - - @override - _i20.Future fetchAndSetMuscles(_i3.ExerciseDatabase? database) => (super.noSuchMethod( - Invocation.method(#fetchAndSetMuscles, [database]), - returnValue: _i20.Future.value(), - returnValueForMissingStub: _i20.Future.value(), - ) as _i20.Future); - - @override - _i20.Future fetchAndSetCategories(_i3.ExerciseDatabase? database) => (super.noSuchMethod( - Invocation.method(#fetchAndSetCategories, [database]), - returnValue: _i20.Future.value(), - returnValueForMissingStub: _i20.Future.value(), - ) as _i20.Future); - - @override - _i20.Future fetchAndSetLanguages(_i3.ExerciseDatabase? database) => (super.noSuchMethod( - Invocation.method(#fetchAndSetLanguages, [database]), - returnValue: _i20.Future.value(), - returnValueForMissingStub: _i20.Future.value(), - ) as _i20.Future); - - @override - _i20.Future fetchAndSetEquipments(_i3.ExerciseDatabase? database) => (super.noSuchMethod( - Invocation.method(#fetchAndSetEquipments, [database]), - returnValue: _i20.Future.value(), - returnValueForMissingStub: _i20.Future.value(), - ) as _i20.Future); - - @override - _i20.Future> searchExercise( - String? name, { - String? languageCode = 'en', - bool? searchEnglish = false, - }) => - (super.noSuchMethod( - Invocation.method( - #searchExercise, - [name], - {#languageCode: languageCode, #searchEnglish: searchEnglish}, - ), - returnValue: _i20.Future>.value( - <_i4.Exercise>[], - ), - ) as _i20.Future>); - - @override - void addListener(_i21.VoidCallback? listener) => super.noSuchMethod( - Invocation.method(#addListener, [listener]), - returnValueForMissingStub: null, - ); - - @override - void removeListener(_i21.VoidCallback? listener) => super.noSuchMethod( - Invocation.method(#removeListener, [listener]), - returnValueForMissingStub: null, - ); - - @override - void dispose() => super.noSuchMethod( - Invocation.method(#dispose, []), - returnValueForMissingStub: null, - ); - - @override - void notifyListeners() => super.noSuchMethod( - Invocation.method(#notifyListeners, []), - returnValueForMissingStub: null, - ); -} - -/// A class which mocks [WgerBaseProvider]. -/// -/// See the documentation for Mockito's code generation for more information. -class MockWgerBaseProvider extends _i1.Mock implements _i2.WgerBaseProvider { - MockWgerBaseProvider() { - _i1.throwOnMissingStub(this); - } - - @override - _i9.AuthProvider get auth => (super.noSuchMethod( - Invocation.getter(#auth), - returnValue: _FakeAuthProvider_7(this, Invocation.getter(#auth)), - ) as _i9.AuthProvider); - - @override - set auth(_i9.AuthProvider? _auth) => super.noSuchMethod( - Invocation.setter(#auth, _auth), - returnValueForMissingStub: null, - ); - - @override - _i10.Client get client => (super.noSuchMethod( - Invocation.getter(#client), - returnValue: _FakeClient_8(this, Invocation.getter(#client)), - ) as _i10.Client); - - @override - set client(_i10.Client? _client) => super.noSuchMethod( - Invocation.setter(#client, _client), - returnValueForMissingStub: null, - ); - - @override - Map getDefaultHeaders({bool? includeAuth = false}) => (super.noSuchMethod( - Invocation.method(#getDefaultHeaders, [], { - #includeAuth: includeAuth, - }), - returnValue: {}, - ) as Map); - - @override - Uri makeUrl( - String? path, { - int? id, - String? objectMethod, - Map? query, - }) => - (super.noSuchMethod( - Invocation.method( - #makeUrl, - [path], - {#id: id, #objectMethod: objectMethod, #query: query}, - ), - returnValue: _FakeUri_9( - this, - Invocation.method( - #makeUrl, - [path], - {#id: id, #objectMethod: objectMethod, #query: query}, - ), - ), - ) as Uri); - - @override - _i20.Future> fetch(Uri? uri) => (super.noSuchMethod( - Invocation.method(#fetch, [uri]), - returnValue: _i20.Future>.value( - {}, - ), - ) as _i20.Future>); - - @override - _i20.Future> fetchPaginated(Uri? uri) => (super.noSuchMethod( - Invocation.method(#fetchPaginated, [uri]), - returnValue: _i20.Future>.value([]), - ) as _i20.Future>); - - @override - _i20.Future> post( - Map? data, - Uri? uri, - ) => - (super.noSuchMethod( - Invocation.method(#post, [data, uri]), - returnValue: _i20.Future>.value( - {}, - ), - ) as _i20.Future>); - - @override - _i20.Future> patch( - Map? data, - Uri? uri, - ) => - (super.noSuchMethod( - Invocation.method(#patch, [data, uri]), - returnValue: _i20.Future>.value( - {}, - ), - ) as _i20.Future>); - - @override - _i20.Future<_i10.Response> deleteRequest(String? url, int? id) => (super.noSuchMethod( - Invocation.method(#deleteRequest, [url, id]), - returnValue: _i20.Future<_i10.Response>.value( - _FakeResponse_10( - this, - Invocation.method(#deleteRequest, [url, id]), - ), - ), - ) as _i20.Future<_i10.Response>); -} - -/// A class which mocks [WorkoutPlansProvider]. -/// -/// See the documentation for Mockito's code generation for more information. -class MockWorkoutPlansProvider extends _i1.Mock implements _i22.WorkoutPlansProvider { - MockWorkoutPlansProvider() { - _i1.throwOnMissingStub(this); - } - - @override - _i2.WgerBaseProvider get baseProvider => (super.noSuchMethod( - Invocation.getter(#baseProvider), - returnValue: _FakeWgerBaseProvider_0( - this, - Invocation.getter(#baseProvider), - ), - ) as _i2.WgerBaseProvider); - - @override - List<_i13.WorkoutPlan> get items => (super.noSuchMethod( - Invocation.getter(#items), - returnValue: <_i13.WorkoutPlan>[], - ) as List<_i13.WorkoutPlan>); - - @override - List<_i11.WeightUnit> get weightUnits => (super.noSuchMethod( - Invocation.getter(#weightUnits), - returnValue: <_i11.WeightUnit>[], - ) as List<_i11.WeightUnit>); - - @override - _i11.WeightUnit get defaultWeightUnit => (super.noSuchMethod( - Invocation.getter(#defaultWeightUnit), - returnValue: _FakeWeightUnit_11( - this, - Invocation.getter(#defaultWeightUnit), - ), - ) as _i11.WeightUnit); - - @override - List<_i12.RepetitionUnit> get repetitionUnits => (super.noSuchMethod( - Invocation.getter(#repetitionUnits), - returnValue: <_i12.RepetitionUnit>[], - ) as List<_i12.RepetitionUnit>); - - @override - _i12.RepetitionUnit get defaultRepetitionUnit => (super.noSuchMethod( - Invocation.getter(#defaultRepetitionUnit), - returnValue: _FakeRepetitionUnit_12( - this, - Invocation.getter(#defaultRepetitionUnit), - ), - ) as _i12.RepetitionUnit); - - @override - bool get hasListeners => - (super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false) as bool); - - @override - void clear() => super.noSuchMethod( - Invocation.method(#clear, []), - returnValueForMissingStub: null, - ); - - @override - List<_i13.WorkoutPlan> getPlans() => (super.noSuchMethod( - Invocation.method(#getPlans, []), - returnValue: <_i13.WorkoutPlan>[], - ) as List<_i13.WorkoutPlan>); - - @override - _i13.WorkoutPlan findById(int? id) => (super.noSuchMethod( - Invocation.method(#findById, [id]), - returnValue: _FakeWorkoutPlan_13( - this, - Invocation.method(#findById, [id]), - ), - ) as _i13.WorkoutPlan); - - @override - int findIndexById(int? id) => (super.noSuchMethod( - Invocation.method(#findIndexById, [id]), - returnValue: 0, - ) as int); - - @override - void setCurrentPlan(int? id) => super.noSuchMethod( - Invocation.method(#setCurrentPlan, [id]), - returnValueForMissingStub: null, - ); - - @override - void resetCurrentPlan() => super.noSuchMethod( - Invocation.method(#resetCurrentPlan, []), - returnValueForMissingStub: null, - ); - - @override - _i20.Future fetchAndSetAllPlansFull() => (super.noSuchMethod( - Invocation.method(#fetchAndSetAllPlansFull, []), - returnValue: _i20.Future.value(), - returnValueForMissingStub: _i20.Future.value(), - ) as _i20.Future); - - @override - _i20.Future fetchAndSetAllPlansSparse() => (super.noSuchMethod( - Invocation.method(#fetchAndSetAllPlansSparse, []), - returnValue: _i20.Future.value(), - returnValueForMissingStub: _i20.Future.value(), - ) as _i20.Future); - - @override - _i20.Future<_i13.WorkoutPlan> fetchAndSetPlanSparse(int? planId) => (super.noSuchMethod( - Invocation.method(#fetchAndSetPlanSparse, [planId]), - returnValue: _i20.Future<_i13.WorkoutPlan>.value( - _FakeWorkoutPlan_13( - this, - Invocation.method(#fetchAndSetPlanSparse, [planId]), - ), - ), - ) as _i20.Future<_i13.WorkoutPlan>); - - @override - _i20.Future<_i13.WorkoutPlan> fetchAndSetWorkoutPlanFull(int? workoutId) => (super.noSuchMethod( - Invocation.method(#fetchAndSetWorkoutPlanFull, [workoutId]), - returnValue: _i20.Future<_i13.WorkoutPlan>.value( - _FakeWorkoutPlan_13( - this, - Invocation.method(#fetchAndSetWorkoutPlanFull, [workoutId]), - ), - ), - ) as _i20.Future<_i13.WorkoutPlan>); - - @override - _i20.Future<_i13.WorkoutPlan> addWorkout(_i13.WorkoutPlan? workout) => (super.noSuchMethod( - Invocation.method(#addWorkout, [workout]), - returnValue: _i20.Future<_i13.WorkoutPlan>.value( - _FakeWorkoutPlan_13( - this, - Invocation.method(#addWorkout, [workout]), - ), - ), - ) as _i20.Future<_i13.WorkoutPlan>); - - @override - _i20.Future editWorkout(_i13.WorkoutPlan? workout) => (super.noSuchMethod( - Invocation.method(#editWorkout, [workout]), - returnValue: _i20.Future.value(), - returnValueForMissingStub: _i20.Future.value(), - ) as _i20.Future); - - @override - _i20.Future deleteWorkout(int? id) => (super.noSuchMethod( - Invocation.method(#deleteWorkout, [id]), - returnValue: _i20.Future.value(), - returnValueForMissingStub: _i20.Future.value(), - ) as _i20.Future); - - @override - _i20.Future> fetchLogData( - _i13.WorkoutPlan? workout, - _i4.Exercise? base, - ) => - (super.noSuchMethod( - Invocation.method(#fetchLogData, [workout, base]), - returnValue: _i20.Future>.value( - {}, - ), - ) as _i20.Future>); - - @override - _i20.Future fetchAndSetRepetitionUnits() => (super.noSuchMethod( - Invocation.method(#fetchAndSetRepetitionUnits, []), - returnValue: _i20.Future.value(), - returnValueForMissingStub: _i20.Future.value(), - ) as _i20.Future); - - @override - _i20.Future fetchAndSetWeightUnits() => (super.noSuchMethod( - Invocation.method(#fetchAndSetWeightUnits, []), - returnValue: _i20.Future.value(), - returnValueForMissingStub: _i20.Future.value(), - ) as _i20.Future); - - @override - _i20.Future fetchAndSetUnits() => (super.noSuchMethod( - Invocation.method(#fetchAndSetUnits, []), - returnValue: _i20.Future.value(), - returnValueForMissingStub: _i20.Future.value(), - ) as _i20.Future); - - @override - _i20.Future<_i14.Day> addDay(_i14.Day? day, _i13.WorkoutPlan? workout) => (super.noSuchMethod( - Invocation.method(#addDay, [day, workout]), - returnValue: _i20.Future<_i14.Day>.value( - _FakeDay_14(this, Invocation.method(#addDay, [day, workout])), - ), - ) as _i20.Future<_i14.Day>); - - @override - _i20.Future editDay(_i14.Day? day) => (super.noSuchMethod( - Invocation.method(#editDay, [day]), - returnValue: _i20.Future.value(), - returnValueForMissingStub: _i20.Future.value(), - ) as _i20.Future); - - @override - _i20.Future deleteDay(_i14.Day? day) => (super.noSuchMethod( - Invocation.method(#deleteDay, [day]), - returnValue: _i20.Future.value(), - returnValueForMissingStub: _i20.Future.value(), - ) as _i20.Future); - - @override - _i20.Future<_i15.Set> addSet(_i15.Set? workoutSet) => (super.noSuchMethod( - Invocation.method(#addSet, [workoutSet]), - returnValue: _i20.Future<_i15.Set>.value( - _FakeSet_15(this, Invocation.method(#addSet, [workoutSet])), - ), - ) as _i20.Future<_i15.Set>); - - @override - _i20.Future editSet(_i15.Set? workoutSet) => (super.noSuchMethod( - Invocation.method(#editSet, [workoutSet]), - returnValue: _i20.Future.value(), - returnValueForMissingStub: _i20.Future.value(), - ) as _i20.Future); - - @override - _i20.Future> reorderSets( - List<_i15.Set>? sets, - int? startIndex, - ) => - (super.noSuchMethod( - Invocation.method(#reorderSets, [sets, startIndex]), - returnValue: _i20.Future>.value(<_i15.Set>[]), - ) as _i20.Future>); - - @override - _i20.Future fetchComputedSettings(_i15.Set? workoutSet) => (super.noSuchMethod( - Invocation.method(#fetchComputedSettings, [workoutSet]), - returnValue: _i20.Future.value(), - returnValueForMissingStub: _i20.Future.value(), - ) as _i20.Future); - - @override - _i20.Future fetchSmartText( - _i15.Set? workoutSet, - _i23.Translation? exercise, - ) => - (super.noSuchMethod( - Invocation.method(#fetchSmartText, [workoutSet, exercise]), - returnValue: _i20.Future.value( - _i24.dummyValue( - this, - Invocation.method(#fetchSmartText, [workoutSet, exercise]), - ), - ), - ) as _i20.Future); - - @override - _i20.Future deleteSet(_i15.Set? workoutSet) => (super.noSuchMethod( - Invocation.method(#deleteSet, [workoutSet]), - returnValue: _i20.Future.value(), - returnValueForMissingStub: _i20.Future.value(), - ) as _i20.Future); - - @override - _i20.Future<_i16.Setting> addSetting(_i16.Setting? workoutSetting) => (super.noSuchMethod( - Invocation.method(#addSetting, [workoutSetting]), - returnValue: _i20.Future<_i16.Setting>.value( - _FakeSetting_16( - this, - Invocation.method(#addSetting, [workoutSetting]), - ), - ), - ) as _i20.Future<_i16.Setting>); - - @override - _i20.Future fetchSessionData() => (super.noSuchMethod( - Invocation.method(#fetchSessionData, []), - returnValue: _i20.Future.value(), - ) as _i20.Future); - - @override - _i20.Future<_i17.WorkoutSession> addSession(_i17.WorkoutSession? session) => (super.noSuchMethod( - Invocation.method(#addSession, [session]), - returnValue: _i20.Future<_i17.WorkoutSession>.value( - _FakeWorkoutSession_17( - this, - Invocation.method(#addSession, [session]), - ), - ), - ) as _i20.Future<_i17.WorkoutSession>); - - @override - _i20.Future<_i18.Log> addLog(_i18.Log? log) => (super.noSuchMethod( - Invocation.method(#addLog, [log]), - returnValue: _i20.Future<_i18.Log>.value( - _FakeLog_18(this, Invocation.method(#addLog, [log])), - ), - ) as _i20.Future<_i18.Log>); - - @override - _i20.Future deleteLog(_i18.Log? log) => (super.noSuchMethod( - Invocation.method(#deleteLog, [log]), - returnValue: _i20.Future.value(), - returnValueForMissingStub: _i20.Future.value(), - ) as _i20.Future); - - @override - void addListener(_i21.VoidCallback? listener) => super.noSuchMethod( - Invocation.method(#addListener, [listener]), - returnValueForMissingStub: null, - ); - - @override - void removeListener(_i21.VoidCallback? listener) => super.noSuchMethod( - Invocation.method(#removeListener, [listener]), - returnValueForMissingStub: null, - ); - - @override - void dispose() => super.noSuchMethod( - Invocation.method(#dispose, []), - returnValueForMissingStub: null, - ); - - @override - void notifyListeners() => super.noSuchMethod( - Invocation.method(#notifyListeners, []), - returnValueForMissingStub: null, - ); -} diff --git a/test_data/exercises.dart b/test_data/exercises.dart index f9ea5789b..ab23e2659 100644 --- a/test_data/exercises.dart +++ b/test_data/exercises.dart @@ -50,7 +50,7 @@ const tEquipment3 = Equipment(id: 3, name: 'Bench'); const tEquipment4 = Equipment(id: 10, name: 'Gym mat'); const testEquipment = [tEquipment1, tEquipment2, tEquipment3]; -final benchPress = Exercise( +final testBenchPress = Exercise( id: 1, uuid: '364f196c-881b-4839-8bfc-9e8f651521b6', created: DateTime(2021, 09, 01), @@ -59,9 +59,10 @@ final benchPress = Exercise( equipment: const [tEquipment1, tEquipment2], muscles: const [tMuscle1, tMuscle2], musclesSecondary: const [tMuscle3], + translations: [benchPressEn, benchPressDe], ); -final crunches = Exercise( +final testCrunches = Exercise( id: 2, uuid: '82415754-fc4c-49ea-8ca7-1516dd36d5a0', created: DateTime(2021, 08, 01), @@ -70,9 +71,10 @@ final crunches = Exercise( equipment: const [tEquipment2], muscles: const [tMuscle1], musclesSecondary: const [tMuscle2], + translations: [crunchesEn, crunchesDe, crunchesFr], ); -final deadLift = Exercise( +final testDeadLift = Exercise( id: 3, uuid: 'ca84e2c5-5608-4d6d-ba57-6d4b6b5e7acd', created: DateTime(2021, 08, 01), @@ -81,9 +83,10 @@ final deadLift = Exercise( equipment: const [tEquipment2], muscles: const [tMuscle1], musclesSecondary: const [tMuscle2], + translations: [deadLiftEn], ); -final curls = Exercise( +final testCurls = Exercise( id: 4, uuid: '361f024c-fdf8-4146-b7d7-0c1b67c58141', created: DateTime(2021, 08, 01), @@ -92,8 +95,10 @@ final curls = Exercise( equipment: const [tEquipment2], muscles: const [tMuscle1], musclesSecondary: const [tMuscle2], + translations: [curlsEn], ); -final squats = Exercise( + +final testSquats = Exercise( id: 5, uuid: '361f024c-fdf8-4146-b7d7-0c1b67c58141', created: DateTime(2021, 08, 01), @@ -102,8 +107,10 @@ final squats = Exercise( equipment: const [tEquipment2], muscles: const [tMuscle1], musclesSecondary: const [tMuscle2], + translations: [squatsEn], ); -final sideRaises = Exercise( + +final testSideRaises = Exercise( id: 6, uuid: '721ff972-c568-41e3-8cf5-cf1e5c5c801c', created: DateTime(2022, 11, 01), @@ -112,6 +119,7 @@ final sideRaises = Exercise( equipment: const [tEquipment2], muscles: const [tMuscle1], musclesSecondary: const [tMuscle2], + translations: [sideRaisesEn], ); final benchPressDe = Translation( @@ -120,16 +128,17 @@ final benchPressDe = Translation( created: DateTime(2021, 1, 15), name: 'Bankdrücken', description: 'add clever text', - exerciseId: benchPress.id, + exerciseId: 1, language: tLanguage1, ); + final benchPressEn = Translation( id: 7, uuid: 'f4cc326b-e497-4bd7-a71d-0eb1db522743', created: DateTime(2021, 1, 15), name: 'Bench press', description: 'add clever text', - exerciseId: benchPress.id, + exerciseId: 1, language: tLanguage1, ); @@ -139,7 +148,7 @@ final deadLiftEn = Translation( created: DateTime(2021, 1, 15), name: 'Dead Lift', description: 'Lorem ipsum etc', - exerciseId: crunches.id, + exerciseId: 3, language: tLanguage2, ); @@ -149,7 +158,7 @@ final crunchesFr = Translation( created: DateTime(2021, 4, 1), name: 'Crunches', description: 'The man in black fled across the desert, and the gunslinger followed', - exerciseId: deadLift.id, + exerciseId: 2, language: tLanguage3, ); @@ -159,7 +168,7 @@ final crunchesDe = Translation( created: DateTime(2021, 4, 1), name: 'Crunches', description: 'The story so far: in the beginning, the universe was created', - exerciseId: deadLift.id, + exerciseId: 2, language: tLanguage1, ); @@ -169,7 +178,7 @@ final crunchesEn = Translation( created: DateTime(2021, 4, 1), name: 'test exercise 5', description: 'I am an invisible man', - exerciseId: deadLift.id, + exerciseId: 2, language: tLanguage2, ); @@ -179,7 +188,7 @@ final curlsEn = Translation( created: DateTime(2021, 4, 1), name: 'Curls', description: 'It was a bright cold day in April, and the clocks were striking thirteen', - exerciseId: curls.id, + exerciseId: 4, language: tLanguage2, ); @@ -189,7 +198,7 @@ final squatsEn = Translation( created: DateTime(2021, 4, 1), name: 'Squats', description: 'It was a bright cold day in April, and the clocks were striking thirteen', - exerciseId: curls.id, + exerciseId: 5, language: tLanguage2, ); @@ -199,28 +208,21 @@ final sideRaisesEn = Translation( created: DateTime(2022, 11, 1), name: 'Side raises', description: 'It was a bright cold day in April, and the clocks were striking thirteen', - exerciseId: curls.id, + exerciseId: 6, language: tLanguage2, ); List getTestExercises() { - benchPress.translations = [benchPressEn, benchPressDe]; - crunches.translations = [crunchesEn, crunchesDe, crunchesFr]; - deadLift.translations = [deadLiftEn]; - curls.translations = [curlsEn]; - squats.translations = [squatsEn]; - sideRaises.translations = [sideRaisesEn]; - - return [benchPress, crunches, deadLift, curls, squats, sideRaises]; + return [testBenchPress, testCrunches, testDeadLift, testCurls, testSquats, testSideRaises]; } List getScreenshotExercises() { - benchPress.translations = benchPressTranslations; - crunches.translations = crunchesTranslations; - deadLift.translations = deadLiftTranslations; - curls.translations = curlsTranslations; - squats.translations = squatsTranslations; - sideRaises.translations = raisesTranslations; + testBenchPress.translations = benchPressTranslations; + testCrunches.translations = crunchesTranslations; + testDeadLift.translations = deadLiftTranslations; + testCurls.translations = curlsTranslations; + testSquats.translations = squatsTranslations; + testSideRaises.translations = raisesTranslations; - return [benchPress, crunches, deadLift, curls, squats, sideRaises]; + return [testBenchPress, testCrunches, testDeadLift, testCurls, testSquats, testSideRaises]; } diff --git a/test_data/routines.dart b/test_data/routines.dart new file mode 100644 index 000000000..6885ce64f --- /dev/null +++ b/test_data/routines.dart @@ -0,0 +1,505 @@ +/* + * This file is part of wger Workout Manager . + * Copyright (C) 2020, 2021 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. + * + * wger Workout Manager is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +import 'package:flutter/material.dart'; +import 'package:wger/models/exercises/exercise.dart'; +import 'package:wger/models/workouts/base_config.dart'; +import 'package:wger/models/workouts/day.dart'; +import 'package:wger/models/workouts/day_data.dart'; +import 'package:wger/models/workouts/log.dart'; +import 'package:wger/models/workouts/repetition_unit.dart'; +import 'package:wger/models/workouts/routine.dart'; +import 'package:wger/models/workouts/session.dart'; +import 'package:wger/models/workouts/session_api.dart'; +import 'package:wger/models/workouts/set_config_data.dart'; +import 'package:wger/models/workouts/slot.dart'; +import 'package:wger/models/workouts/slot_data.dart'; +import 'package:wger/models/workouts/slot_entry.dart'; +import 'package:wger/models/workouts/weight_unit.dart'; + +import './exercises.dart'; + +const testWeightUnit1 = WeightUnit(id: 1, name: 'kg'); +const testWeightUnit2 = WeightUnit(id: 2, name: 'metric tonnes'); +const testWeightUnits = [testWeightUnit1, testWeightUnit2]; + +const RepetitionUnit testRepetitionUnit1 = RepetitionUnit(id: 1, name: 'Repetitions'); +const RepetitionUnit testRepetitionUnit2 = RepetitionUnit(id: 2, name: 'Hours'); +const testRepetitionUnits = [testRepetitionUnit1, testRepetitionUnit2]; + +Routine getTestRoutine({List? exercises}) { + final testExercises = exercises ?? getTestExercises(); + + final log1 = Log.empty() + ..id = 1 + ..iteration = 2 + ..slotEntryId = 3 + ..weight = 10 + ..rir = '1.5' + ..date = DateTime(2021, 5, 1) + ..repetitions = 10 + ..routineId = 1; + log1.exerciseBase = testExercises[0]; + log1.weightUnit = testWeightUnit1; + log1.repetitionUnit = testRepetitionUnit1; + + final log2 = Log.empty() + ..id = 2 + ..iteration = 4 + ..slotEntryId = 1 + ..weight = 10 + ..rir = '2' + ..date = DateTime(2021, 5, 1) + ..repetitions = 12 + ..routineId = 1; + log2.exerciseBase = testExercises[0]; + log2.weightUnit = testWeightUnit1; + log2.repetitionUnit = testRepetitionUnit1; + + final log3 = Log.empty() + ..id = 3 + ..iteration = 5 + ..slotEntryId = 1 + ..weight = 50 + ..rir = '' + ..date = DateTime(2021, 5, 2) + ..repetitions = 8 + ..routineId = 1; + log3.exerciseBase = testExercises[1]; + log3.weightUnit = testWeightUnit1; + log3.repetitionUnit = testRepetitionUnit1; + + final session1 = WorkoutSessionApi( + session: WorkoutSession( + id: 1, + routineId: 1, + date: DateTime(2021, 5, 1), + impression: 3, + notes: 'This is a note', + timeStart: const TimeOfDay(hour: 10, minute: 0), + timeEnd: const TimeOfDay(hour: 12, minute: 34), + ), + logs: [log1, log2], + ); + + final session2 = WorkoutSessionApi( + session: WorkoutSession( + id: 2, + routineId: 1, + date: DateTime(2021, 5, 2), + impression: 1, + notes: 'This is a note', + timeStart: const TimeOfDay(hour: 6, minute: 12), + timeEnd: const TimeOfDay(hour: 8, minute: 1), + ), + logs: [log3], + ); + + final slotEntryBenchPress = SlotEntry( + slotId: 1, + type: 'normal', + order: 1, + exerciseId: 1, + repetitionUnitId: 1, + repetitionRounding: 1, + weightUnitId: 1, + weightRounding: 1.25, + comment: 'ddd', + repetitionUnit: testRepetitionUnit1, + weightUnit: testWeightUnit1, + exercise: testExercises[0], + nrOfSetsConfigs: [ + BaseConfig.firstIteration(4, 1), + ], + repetitionsConfigs: [ + BaseConfig.firstIteration(3, 1), + ], + weightConfigs: [ + BaseConfig.firstIteration(100, 1), + BaseConfig( + id: 1, + slotEntryId: 1, + iteration: 2, + value: 5, + operation: '+', + step: 'abs', + requirements: null, + repeat: true, + ), + ], + ); + + final slotBenchPress = Slot.withData( + id: 1, + day: 1, + order: 1, + comment: 'Make sure to warm up', + ); + slotBenchPress.addExerciseBase(testExercises[0]); + slotBenchPress.entries.add(slotEntryBenchPress); + + final slotEntrySquat = SlotEntry( + slotId: 2, + type: 'normal', + order: 1, + exerciseId: 8, + repetitionUnitId: 1, + repetitionRounding: 0.25, + weightUnitId: 1, + weightRounding: 0.25, + comment: 'ddd', + repetitionUnit: testRepetitionUnit1, + weightUnit: testWeightUnit1, + exercise: testExercises[4], + weightConfigs: [ + BaseConfig.firstIteration(80, 1), + ], + repetitionsConfigs: [ + BaseConfig.firstIteration(5, 1), + ], + nrOfSetsConfigs: [ + BaseConfig.firstIteration(3, 1), + ], + ); + + final slotSquat = Slot.withData(id: 2, day: 1, order: 1); + slotSquat.addExerciseBase(testExercises[4]); + slotSquat.entries.add(slotEntrySquat); + + final slotEntrySideRaises = SlotEntry( + slotId: 2, + type: 'normal', + order: 1, + exerciseId: 8, + repetitionUnitId: 1, + repetitionRounding: 0.25, + weightUnitId: 1, + weightRounding: 0.25, + comment: 'ddd', + repetitionUnit: testRepetitionUnit1, + weightUnit: testWeightUnit1, + exercise: testExercises[5], + nrOfSetsConfigs: [ + BaseConfig.firstIteration(4, 1), + ], + repetitionsConfigs: [ + BaseConfig.firstIteration(12, 1), + ], + weightConfigs: [ + BaseConfig.firstIteration(10, 1), + ], + ); + // settingSideRaises.weight = 6; + + final slotSideRaises = Slot.withData(id: 3, day: 1, order: 1); + slotSideRaises.addExerciseBase(testExercises[5]); + slotSideRaises.entries.add(slotEntrySideRaises); + + final dayChestShoulders = Day( + id: 1, + routineId: 1, + name: 'first day', + description: 'chest, shoulders', + slots: [slotBenchPress, slotSideRaises], + ); + + final dayLegs = Day( + id: 2, + routineId: 1, + name: 'second day', + description: 'legs', + slots: [slotSquat], + ); + + final List dayDataGym = [ + DayData( + iteration: 1, + date: DateTime(2024, 11, 01), + label: '', + day: dayChestShoulders, + slots: [ + SlotData( + comment: 'Make sure to warm up', + isSuperset: false, + exerciseIds: [testExercises[0].id!], + setConfigs: [ + SetConfigData( + exerciseId: 1, + exercise: testExercises[0], + slotEntryId: 1, + nrOfSets: 1, + repetitions: 3, + repetitionsUnit: testRepetitionUnit1, + weight: 100, + weightUnit: testWeightUnit1, + restTime: 120, + rir: '1.5', + rpe: '8', + textRepr: '3x100kg', + ), + SetConfigData( + exerciseId: testExercises[0].id!, + exercise: testExercises[0], + slotEntryId: 1, + nrOfSets: 1, + repetitions: 3, + repetitionsUnit: testRepetitionUnit1, + weight: 100, + weightUnit: testWeightUnit1, + restTime: 120, + rir: '1.5', + rpe: '8', + textRepr: '3x100kg', + ), + SetConfigData( + exerciseId: testExercises[0].id!, + exercise: testExercises[0], + slotEntryId: 1, + nrOfSets: 1, + repetitions: 3, + repetitionsUnit: testRepetitionUnit1, + weight: 100, + weightUnit: testWeightUnit1, + restTime: 120, + rir: '1.5', + rpe: '8', + textRepr: '3x100kg', + ), + ], + ), + SlotData( + comment: 'Side rises', + isSuperset: false, + exerciseIds: [testExercises[5].id!], + setConfigs: [ + SetConfigData( + exerciseId: testExercises[5].id!, + exercise: testExercises[5], + slotEntryId: 1, + nrOfSets: 1, + repetitions: 12, + repetitionsUnit: testRepetitionUnit1, + weight: 10, + weightUnit: testWeightUnit1, + restTime: null, + rir: '', + rpe: '', + textRepr: '12x10kg', + ), + SetConfigData( + exerciseId: testExercises[5].id!, + exercise: testExercises[5], + slotEntryId: 1, + nrOfSets: 1, + repetitions: 12, + repetitionsUnit: testRepetitionUnit1, + weight: 10, + weightUnit: testWeightUnit1, + restTime: null, + rir: '', + rpe: '', + textRepr: '12x10kg', + ), + SetConfigData( + exerciseId: testExercises[5].id!, + exercise: testExercises[5], + slotEntryId: 1, + nrOfSets: 1, + repetitions: 12, + repetitionsUnit: testRepetitionUnit1, + weight: 10, + weightUnit: testWeightUnit1, + restTime: null, + rir: '', + rpe: '', + textRepr: '12x10kg', + ), + ], + ), + ], + ), + DayData( + iteration: 1, + date: DateTime(2024, 11, 02), + label: '', + day: dayLegs, + slots: [ + SlotData( + comment: 'Squats', + isSuperset: false, + exerciseIds: [testExercises[4].id!], + setConfigs: [ + SetConfigData( + exerciseId: 8, + exercise: testExercises[4], + slotEntryId: 1, + nrOfSets: 1, + repetitions: 3, + repetitionsUnit: testRepetitionUnit1, + weight: 100, + weightUnit: testWeightUnit1, + restTime: 120, + rir: '1.5', + rpe: '8', + textRepr: '3x100kg', + ), + SetConfigData( + exerciseId: testExercises[4].id!, + exercise: testExercises[4], + slotEntryId: 1, + nrOfSets: 1, + repetitions: 3, + repetitionsUnit: testRepetitionUnit1, + weight: 100, + weightUnit: testWeightUnit1, + restTime: 120, + rir: '1.5', + rpe: '8', + textRepr: '3x100kg', + ), + SetConfigData( + exerciseId: testExercises[4].id!, + exercise: testExercises[4], + slotEntryId: 1, + nrOfSets: 1, + repetitions: 3, + repetitionsUnit: testRepetitionUnit1, + weight: 100, + weightUnit: testWeightUnit1, + restTime: 120, + rir: '1.5', + rpe: '8', + textRepr: '3x100kg', + ), + ], + ), + ], + ), + ]; + + final List dayDataDisplay = [ + DayData( + iteration: 1, + date: DateTime(2024, 11, 01), + label: '', + day: dayChestShoulders, + slots: [ + SlotData( + comment: 'Bench press', + isSuperset: false, + exerciseIds: [1], + setConfigs: [ + SetConfigData( + exerciseId: 1, + exercise: testExercises[0], + slotEntryId: 1, + nrOfSets: 4, + repetitions: 3, + repetitionsUnit: testRepetitionUnit1, + weight: 100, + weightUnit: testWeightUnit1, + restTime: 120, + rir: '1.5', + rpe: '8', + textRepr: '4 sets 3x100kg', + ), + ], + ), + SlotData( + comment: 'Side rises', + isSuperset: false, + exerciseIds: [6], + setConfigs: [ + SetConfigData( + exerciseId: 6, + exercise: testExercises[5], + slotEntryId: 1, + nrOfSets: 4, + repetitions: 12, + repetitionsUnit: testRepetitionUnit1, + weight: 10, + weightUnit: testWeightUnit1, + restTime: 60, + rir: '', + rpe: '', + textRepr: '4 sets 12x10kg', + ), + ], + ), + ], + ), + DayData( + iteration: 1, + date: DateTime(2024, 11, 02), + label: '', + day: dayLegs, + slots: [ + SlotData( + comment: 'Squats', + isSuperset: false, + exerciseIds: [8], + setConfigs: [ + SetConfigData( + exerciseId: 8, + exercise: testExercises[4], + slotEntryId: 1, + nrOfSets: 4, + repetitions: 3, + repetitionsUnit: testRepetitionUnit1, + weight: 100, + weightUnit: testWeightUnit1, + restTime: 120, + rir: '1.5', + rpe: '8', + textRepr: '4 sets 3x100kg', + ), + ], + ), + ], + ), + DayData( + iteration: 1, + date: DateTime(2024, 11, 02), + label: 'null day (filled because of fitInWeek flag)', + day: null, + slots: [], + ), + DayData( + iteration: 1, + date: DateTime(2024, 11, 02), + label: 'null day (filled because of fitInWeek flag)', + day: null, + slots: [], + ), + ]; + + final routine = Routine( + id: 1, + created: DateTime(2021, 01, 01), + name: '3 day workout', + description: 'This is a 3 day workout and this text is important', + start: DateTime(2024, 11, 01), + end: DateTime(2024, 12, 01), + days: [dayChestShoulders, dayLegs], + sessions: [session1, session2], + dayData: dayDataDisplay, + dayDataGym: dayDataGym, + ); + + return routine; +} diff --git a/test_data/workouts.dart b/test_data/workouts.dart deleted file mode 100644 index 2491c50d8..000000000 --- a/test_data/workouts.dart +++ /dev/null @@ -1,162 +0,0 @@ -/* - * This file is part of wger Workout Manager . - * Copyright (C) 2020, 2021 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. - * - * wger Workout Manager 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:wger/models/exercises/exercise.dart'; -import 'package:wger/models/workouts/day.dart'; -import 'package:wger/models/workouts/log.dart'; -import 'package:wger/models/workouts/repetition_unit.dart'; -import 'package:wger/models/workouts/set.dart'; -import 'package:wger/models/workouts/setting.dart'; -import 'package:wger/models/workouts/weight_unit.dart'; -import 'package:wger/models/workouts/workout_plan.dart'; - -import './exercises.dart'; - -const weightUnit1 = WeightUnit(id: 1, name: 'kg'); -const weightUnit2 = WeightUnit(id: 2, name: 'metric tonnes'); - -const RepetitionUnit repetitionUnit1 = RepetitionUnit(id: 1, name: 'Repetitions'); -const RepetitionUnit repetitionUnit2 = RepetitionUnit(id: 2, name: 'Hours'); - -WorkoutPlan getWorkout({List? exercises}) { - final testBases = exercises ?? getTestExercises(); - - final log1 = Log.empty() - ..id = 1 - ..weight = 10 - ..rir = '1.5' - ..date = DateTime(2021, 5, 1) - ..reps = 10 - ..workoutPlan = 1; - log1.exerciseBase = testBases[0]; - log1.weightUnit = weightUnit1; - log1.repetitionUnit = repetitionUnit1; - - final log2 = Log.empty() - ..id = 2 - ..weight = 10 - ..rir = '2' - ..date = DateTime(2021, 5, 1) - ..reps = 12 - ..workoutPlan = 1; - log2.exerciseBase = testBases[0]; - log2.weightUnit = weightUnit1; - log2.repetitionUnit = repetitionUnit1; - - final log3 = Log.empty() - ..id = 3 - ..weight = 50 - ..rir = '' - ..date = DateTime(2021, 5, 2) - ..reps = 8 - ..workoutPlan = 1; - log3.exerciseBase = testBases[1]; - log3.weightUnit = weightUnit1; - log3.repetitionUnit = repetitionUnit1; - - final settingBenchPress = Setting( - setId: 1, - order: 1, - exerciseId: 1, - repetitionUnitId: 1, - reps: 6, - weightUnitId: 1, - comment: 'ddd', - rir: '3', - ); - settingBenchPress.repetitionUnit = repetitionUnit1; - settingBenchPress.weightUnit = weightUnit1; - settingBenchPress.exercise = testBases[0]; - settingBenchPress.weight = 80; - - final setBenchPress = Set.withData( - id: 1, - day: 1, - sets: 3, - order: 1, - comment: 'Make sure to warm up', - ); - setBenchPress.addExerciseBase(testBases[0]); - setBenchPress.settings.add(settingBenchPress); - setBenchPress.settingsComputed = [settingBenchPress, settingBenchPress]; - - final settingSquat = Setting( - setId: 2, - order: 1, - exerciseId: 8, - repetitionUnitId: 1, - reps: 8, - weightUnitId: 1, - comment: 'ddd', - rir: '2', - ); - settingSquat.repetitionUnit = repetitionUnit1; - settingSquat.weightUnit = weightUnit1; - settingSquat.exercise = testBases[4]; - settingSquat.weight = 120; - - final setSquat = Set.withData(id: 2, day: 1, sets: 3, order: 1); - setSquat.addExerciseBase(testBases[4]); - setSquat.settings.add(settingSquat); - setSquat.settingsComputed = [settingSquat, settingSquat]; - - final settingSideRaises = Setting( - setId: 2, - order: 1, - exerciseId: 8, - repetitionUnitId: 1, - reps: 12, - weightUnitId: 1, - comment: 'ddd', - rir: '', - ); - settingSideRaises.repetitionUnit = repetitionUnit1; - settingSideRaises.weightUnit = weightUnit1; - settingSideRaises.exercise = testBases[5]; - settingSideRaises.weight = 6; - - final setSideRaises = Set.withData(id: 3, day: 1, sets: 3, order: 1); - setSideRaises.addExerciseBase(testBases[5]); - setSideRaises.settings.add(settingSideRaises); - setSideRaises.settingsComputed = [settingSideRaises, settingSideRaises]; - - final dayChestShoulders = Day() - ..id = 1 - ..workoutId = 1 - ..description = 'chest, shoulders' - ..daysOfWeek = [1, 2]; - dayChestShoulders.sets.add(setBenchPress); - dayChestShoulders.sets.add(setSideRaises); - - final dayLegs = Day() - ..id = 2 - ..workoutId = 1 - ..description = 'legs' - ..daysOfWeek = [4]; - dayLegs.sets.add(setSquat); - - final workout = WorkoutPlan( - id: 1, - creationDate: DateTime(2021, 01, 01), - name: '3 day workout', - days: [dayChestShoulders, dayLegs], - logs: [log1, log2, log3], - ); - - return workout; -}