Merge branch 'master' into fork/Oknarb258/master

# Conflicts:
#	test/exercises/contribute_exercise_test.mocks.dart
This commit is contained in:
Roland Geider
2025-11-11 14:27:36 +01:00
244 changed files with 19392 additions and 19932 deletions

View File

@@ -9,7 +9,7 @@ runs:
uses: subosito/flutter-action@v2
with:
channel: stable
flutter-version: 3.35.2
flutter-version: 3.35.7
cache: true
- name: Install Flutter dependencies

View File

@@ -36,7 +36,7 @@ jobs:
- name: Build APK
run: flutter build apk --release
- uses: actions/upload-artifact@v4
- uses: actions/upload-artifact@v5
with:
name: builds-apk
path: build/app/outputs/flutter-apk/app-release.apk
@@ -67,7 +67,7 @@ jobs:
- name: Build AAB
run: flutter build appbundle --release
- uses: actions/upload-artifact@v4
- uses: actions/upload-artifact@v5
with:
name: builds-aab
path: build/app/outputs/bundle/release/app-release.aab

View File

@@ -31,7 +31,7 @@ jobs:
cd build/ios/iphoneos
zip -r Runner.app.zip Runner.app
- uses: actions/upload-artifact@v4
- uses: actions/upload-artifact@v5
with:
name: builds-ios
path: build/ios/iphoneos/Runner.app.zip
@@ -61,7 +61,7 @@ jobs:
cd build/ios/archive
zip -r Runner.xcarchive.zip Runner.xcarchive
- uses: actions/upload-artifact@v4
- uses: actions/upload-artifact@v5
with:
name: builds-ipa
path: build/ios/archive/Runner.xcarchive.zip
@@ -84,7 +84,7 @@ jobs:
cd build/macos/Build/Products/Release
zip -r wger.app.zip wger.app
- uses: actions/upload-artifact@v4
- uses: actions/upload-artifact@v5
with:
name: builds-macos
path: build/macos/Build/Products/Release/wger.app.zip

View File

@@ -39,7 +39,7 @@ jobs:
sudo apt install -y pkg-config libgtk-3-dev liblzma-dev libstdc++-12-dev --no-install-recommends
flutter build linux --release
tar -zcvf linux-${{ matrix.platform }}.tar.gz build/linux/${{ matrix.platform }}/release/bundle
- uses: actions/upload-artifact@v4
- uses: actions/upload-artifact@v5
with:
name: builds-linux
path: |
@@ -67,14 +67,19 @@ jobs:
python bump-wger-version.py ${{ inputs.ref }}
../flatpak-flutter/flatpak-flutter.py --app-module wger flatpak-flutter.json
- name: Push updated config to flathub repository
uses: cpina/github-action-push-to-another-repository@main
env:
SSH_DEPLOY_KEY: ${{ secrets.SSH_DEPLOY_KEY }}
with:
destination-github-username: wger-project
destination-repository-name: de.wger.flutter
user-email: github-actions@github.com
target-branch: release-${{ inputs.ref }}
create-target-branch-if-needed: true
commit-message: Update to ${{ inputs.ref }}
# TODO: this is currently commented out because it seems the action used below
# doesn't work anymore. This is probably not all that surprising as it
# isn't being developed anymore. This should be update so that the process
# works automatically again, till then this can be done manually.
#- name: Push updated config to flathub repository
# uses: cpina/github-action-push-to-another-repository@main
# env:
# SSH_DEPLOY_KEY: ${{ secrets.SSH_DEPLOY_KEY }}
# with:
# destination-github-username: wger-project
# destination-repository-name: de.wger.flutter
# user-email: github-actions@github.com
# target-branch: release-${{ inputs.ref }}
# create-target-branch-if-needed: true
# commit-message: Update to ${{ inputs.ref }}

View File

@@ -25,7 +25,7 @@ jobs:
- name: Build .exe
run: flutter build windows --release
- uses: actions/upload-artifact@v4
- uses: actions/upload-artifact@v5
with:
name: builds-windows
path: build\windows\x64\runner\Release\wger.exe

View File

@@ -22,7 +22,7 @@ jobs:
uses: ./.github/actions/flutter-common
- name: Setup uv
uses: astral-sh/setup-uv@v6
uses: astral-sh/setup-uv@v7
- name: Validate version
run: |

View File

@@ -66,7 +66,7 @@ jobs:
ref: ${{ github.event.inputs.version }}
- name: Download builds
uses: actions/download-artifact@v5
uses: actions/download-artifact@v6
with:
path: /tmp/
@@ -114,7 +114,7 @@ jobs:
# uses: ./.github/actions/flutter-common
#
# - name: Download builds
# uses: actions/download-artifact@v5
# uses: actions/download-artifact@v6
# with:
# path: /tmp/
#
@@ -133,7 +133,7 @@ jobs:
steps:
- name: Download builds
uses: actions/download-artifact@v5
uses: actions/download-artifact@v6
- name: Make Github release
uses: softprops/action-gh-release@v2

3
.gitignore vendored
View File

@@ -30,6 +30,8 @@
.pub-cache/
.pub/
/build/
/**/build/
/android/app/.cxx
**/failures/*.png
@@ -62,3 +64,4 @@ ios/fastlane/Preview.html
ios/fastlane/output
ios/Runner.ipa
ios/Runner.app.dSYM.zip

View File

@@ -2,6 +2,10 @@
Thank you all for contributing to the project, you are true heroes! 🫶
*Generated on 2025-11-10*
---
## Contributors
- thisisyoussef - [https://github.com/thisisyoussef](https://github.com/thisisyoussef)
@@ -89,7 +93,7 @@ Thank you all for contributing to the project, you are true heroes! 🫶
- Thilina Herath - [https://github.com/thilinatnt](https://github.com/thilinatnt)
- ToldYouThat
- Yair Chen - [https://github.com/chenyair](https://github.com/chenyair)
- henok3878 - [https://github.com/henok3878](https://github.com/henok3878)
- henok3878 - [https://github.com/h3nock](https://github.com/h3nock)
- Patrick Witter - [https://github.com/patrickwitter](https://github.com/patrickwitter)
- ton-An - [https://github.com/ton-An](https://github.com/ton-An)
- Prakash Shekhar - [https://github.com/prakash-shekhar](https://github.com/prakash-shekhar)
@@ -100,40 +104,50 @@ Thank you all for contributing to the project, you are true heroes! 🫶
- Jannik Norden
- Allan Nordhøy - [https://github.com/comradekingu](https://github.com/comradekingu)
- Stefano Rossi - [https://github.com/stefanorossiti](https://github.com/stefanorossiti)
- Dylan Aird - [https://github.com/Dolaned](https://github.com/Dolaned)
## Translators
### Amharic
- henok3878 - [https://github.com/h3nock](https://github.com/h3nock)
### Arabic
- Anonymous - [https://github.com/weblate](https://github.com/weblate)
- Hanaa - [https://github.com/hn-n](https://github.com/hn-n)
- Ahmed zein - [https://github.com/Ahmed-Zein](https://github.com/Ahmed-Zein)
### Catalan
- Zixu Sun - [https://github.com/ziixu](https://github.com/ziixu)
- Anonymous - [https://github.com/weblate](https://github.com/weblate)
- guillem - [https://github.com/gbuendia](https://github.com/gbuendia)
### Chinese (Simplified Han script)
- Herb Huang
### Chinese (Simplified)
- 纪颖志 - [https://github.com/jiyingzhi](https://github.com/jiyingzhi)
- Yi-Han Hsiung - [https://github.com/AaronHsiung](https://github.com/AaronHsiung)
- Tsz Hong CHAN - [https://github.com/tomyan112](https://github.com/tomyan112)
- Eddie Tang - [https://github.com/EDED2314](https://github.com/EDED2314)
- Jing - [https://github.com/jingcheng16](https://github.com/jingcheng16)
- sr-c - [https://github.com/sr-c](https://github.com/sr-c)
- tony - [https://github.com/tonyxxliu](https://github.com/tonyxxliu)
- yiter
### Chinese (Traditional Han script)
- Peter Dave Hello - [https://github.com/PeterDaveHello](https://github.com/PeterDaveHello)
### Polish
### Chinese (Traditional)
- Karol Solecki - [https://github.com/karolsol](https://github.com/karolsol)
- Piotr Strebski - [https://github.com/strebski](https://github.com/strebski)
- Dawid Panyło
- Anonymous - [https://github.com/weblate](https://github.com/weblate)
- Marcin Schoenknecht
- Patryk - [https://github.com/byakurau](https://github.com/byakurau)
- Michał Homza - [https://github.com/HagiaHaya](https://github.com/HagiaHaya)
- Jacob - [https://github.com/devzom](https://github.com/devzom)
### Serbian
- Mladen Trišić - [https://github.com/mtrisic](https://github.com/mtrisic)
### Dutch
- Joey Haalboom - [https://github.com/JoeyHaalboom](https://github.com/JoeyHaalboom)
### Russian
- Алексей Курышко - [https://github.com/alexkuryshko](https://github.com/alexkuryshko)
- lightningcpu - [https://github.com/lightningcpu](https://github.com/lightningcpu)
- Кирилл Александрович Злобин - [https://github.com/gungstarbeiter](https://github.com/gungstarbeiter)
- Ivan Katkov - [https://github.com/Porphyrion](https://github.com/Porphyrion)
- Nikita Epifanov
- hugoalh
- Tsz Hong CHAN - [https://github.com/tomyan112](https://github.com/tomyan112)
- Chung-Wei Chung - [https://github.com/webb790709](https://github.com/webb790709)
- HY Cheng
### Croatian
@@ -141,18 +155,78 @@ Thank you all for contributing to the project, you are true heroes! 🫶
- Roland Geider - [https://github.com/rolandgeider](https://github.com/rolandgeider)
- SMilohanic - [https://github.com/sandimilohanic](https://github.com/sandimilohanic)
### Portuguese
### Czech
- Edson Wolf - [https://github.com/edsonblwolf](https://github.com/edsonblwolf)
- Fjuro - [https://github.com/Fjuro](https://github.com/Fjuro)
- Fjuro
- CaptainDolphy - [https://github.com/CaptainDolphy](https://github.com/CaptainDolphy)
- Roman Kalivoda - [https://github.com/RKCZ](https://github.com/RKCZ)
### Dutch
- Joey Haalboom - [https://github.com/JoeyHaalboom](https://github.com/JoeyHaalboom)
### English
- guillem - [https://github.com/gbuendia](https://github.com/gbuendia)
- Allan Nordhøy - [https://github.com/comradekingu](https://github.com/comradekingu)
- Roland Geider - [https://github.com/rolandgeider](https://github.com/rolandgeider)
### French
- William - [https://github.com/WilliamR312](https://github.com/WilliamR312)
- florent4014 - [https://github.com/florent4014](https://github.com/florent4014)
- Anonymous - [https://github.com/weblate](https://github.com/weblate)
- Wilton Rodrigues
- Guilherme Salomão - [https://github.com/salomaoparkour](https://github.com/salomaoparkour)
- Bruno de Moura - [https://github.com/bruunomooura](https://github.com/bruunomooura)
- Dalton Scavassa
- Stefan Taiguara - [https://github.com/Teitei011](https://github.com/Teitei011)
- Eduardo Menges Mattje - [https://github.com/EduMenges](https://github.com/EduMenges)
- Edu Cavalheiro - [https://github.com/EduCavalheiro](https://github.com/EduCavalheiro)
- João Goulart - [https://github.com/usehalter](https://github.com/usehalter)
- Xav Basco
- David Olewski - [https://github.com/Arigowin](https://github.com/Arigowin)
- yoyomax80400 - [https://github.com/yoyomax80400](https://github.com/yoyomax80400)
- loued - [https://github.com/Loued](https://github.com/Loued)
- Célian
- MrSniikyz - [https://github.com/BabyGeek](https://github.com/BabyGeek)
- Roland Geider - [https://github.com/rolandgeider](https://github.com/rolandgeider)
- J. Lavoie
- Antoine Vibien - [https://github.com/r1llettes](https://github.com/r1llettes)
- Stefano Rossi - [https://github.com/stefanorossiti](https://github.com/stefanorossiti)
### German
- kvnrmnn - [https://github.com/rmnn92](https://github.com/rmnn92)
- Anonymous - [https://github.com/weblate](https://github.com/weblate)
- Roland Geider - [https://github.com/rolandgeider](https://github.com/rolandgeider)
- Victor Jouhoff - [https://github.com/jouhoffv](https://github.com/jouhoffv)
- m4skedbyte
- Axel Steinbrecher
- Christoph Suesser - [https://github.com/TheFitzZZ](https://github.com/TheFitzZZ)
- Luis Lüscher - [https://github.com/lslschr](https://github.com/lslschr)
- mondstern
- J. Lavoie
- Marvin M - [https://github.com/M123-dev](https://github.com/M123-dev)
- Lydia
- Allan Nordhøy - [https://github.com/comradekingu](https://github.com/comradekingu)
### Greek
- Dimitrys Meliates
- Antonis-geo - [https://github.com/Antonis-geo](https://github.com/Antonis-geo)
### Hebrew
- Anonymous - [https://github.com/weblate](https://github.com/weblate)
- n,rdo
- Tomer Ben Rachel - [https://github.com/TomerPacific](https://github.com/TomerPacific)
### Hindi
- pavan arun bagwe - [https://github.com/pavanb0](https://github.com/pavanb0)
- Anonymous - [https://github.com/weblate](https://github.com/weblate)
- Debayan Sutradhar - [https://github.com/rnayabed](https://github.com/rnayabed)
### Indonesian
- aryakdaniswara - [https://github.com/aryakdaniswara](https://github.com/aryakdaniswara)
- Anonymous - [https://github.com/weblate](https://github.com/weblate)
- Debi Maulana Ahsan Halla
- Roland Geider - [https://github.com/rolandgeider](https://github.com/rolandgeider)
### Italian
@@ -171,32 +245,41 @@ Thank you all for contributing to the project, you are true heroes! 🫶
- mondstern
- Stefano Rossi - [https://github.com/stefanorossiti](https://github.com/stefanorossiti)
### French
### Japanese
- William - [https://github.com/WilliamR312](https://github.com/WilliamR312)
- florent4014 - [https://github.com/florent4014](https://github.com/florent4014)
- Anonymous - [https://github.com/weblate](https://github.com/weblate)
- Xav Basco
- David Olewski - [https://github.com/Arigowin](https://github.com/Arigowin)
- yoyomax80400 - [https://github.com/yoyomax80400](https://github.com/yoyomax80400)
- loued - [https://github.com/Loued](https://github.com/Loued)
- Célian
- MrSniikyz - [https://github.com/BabyGeek](https://github.com/BabyGeek)
- Roland Geider - [https://github.com/rolandgeider](https://github.com/rolandgeider)
- J. Lavoie
- Antoine Vibien - [https://github.com/r1llettes](https://github.com/r1llettes)
- Stefano Rossi - [https://github.com/stefanorossiti](https://github.com/stefanorossiti)
- Tsz Hong CHAN - [https://github.com/tomyan112](https://github.com/tomyan112)
- sasukeiscool - [https://github.com/sasukeiscool](https://github.com/sasukeiscool)
- yiter
### Ukrainian
### Norwegian Bokmål
- Максим Горпиніч - [https://github.com/Maksim2005UA](https://github.com/Maksim2005UA)
- Roland Geider - [https://github.com/rolandgeider](https://github.com/rolandgeider)
- Максим Горпиніч
- Allan Nordhøy - [https://github.com/comradekingu](https://github.com/comradekingu)
### Polish
- Karol Solecki - [https://github.com/karolsol](https://github.com/karolsol)
- Piotr Strebski - [https://github.com/strebski](https://github.com/strebski)
- Dawid Panyło
- Anonymous - [https://github.com/weblate](https://github.com/weblate)
- Dan - [https://github.com/Kefir2105](https://github.com/Kefir2105)
- Dan
- Tymofii Lytvynenko
- Artem - [https://github.com/defaultpage](https://github.com/defaultpage)
- Marcin Schoenknecht
- Patryk - [https://github.com/byakurau](https://github.com/byakurau)
- Michał Homza - [https://github.com/HagiaHaya](https://github.com/HagiaHaya)
- Jacob - [https://github.com/devzom](https://github.com/devzom)
### Portuguese
- Edson Wolf - [https://github.com/edsonblwolf](https://github.com/edsonblwolf)
- Anonymous - [https://github.com/weblate](https://github.com/weblate)
- Wilton Rodrigues
- Guilherme Salomão - [https://github.com/salomaoparkour](https://github.com/salomaoparkour)
- Bruno de Moura - [https://github.com/bruunomooura](https://github.com/bruunomooura)
- Dalton Scavassa
- Stefan Taiguara - [https://github.com/Teitei011](https://github.com/Teitei011)
- Eduardo Menges Mattje - [https://github.com/EduMenges](https://github.com/EduMenges)
- Edu Cavalheiro - [https://github.com/EduCavalheiro](https://github.com/EduCavalheiro)
- João Goulart - [https://github.com/usehalter](https://github.com/usehalter)
### Portuguese (Brazil)
@@ -210,99 +293,26 @@ Thank you all for contributing to the project, you are true heroes! 🫶
- Luigi Henrick Feitoza Silva - [https://github.com/luigihenrick](https://github.com/luigihenrick)
- João Hortêncio Moraes - [https://github.com/joaohortencio](https://github.com/joaohortencio)
### Tamil
- தமிழ்நேரம் - [https://github.com/TamilNeram](https://github.com/TamilNeram)
### Chinese (Simplified Han script)
- Herb Huang
### Hindi
- pavan arun bagwe - [https://github.com/pavanb0](https://github.com/pavanb0)
- Anonymous - [https://github.com/weblate](https://github.com/weblate)
- Debayan Sutradhar - [https://github.com/rnayabed](https://github.com/rnayabed)
### Turkish
- Oğuz Ersen - [https://github.com/oersen](https://github.com/oersen)
- Roland Geider - [https://github.com/rolandgeider](https://github.com/rolandgeider)
- Cem Avcı - [https://github.com/cem256](https://github.com/cem256)
- Oğuz Ersen
- Cenk Cidecio - [https://github.com/ccidecio](https://github.com/ccidecio)
- ToldYouThat
### German
- kvnrmnn - [https://github.com/rmnn92](https://github.com/rmnn92)
- Anonymous - [https://github.com/weblate](https://github.com/weblate)
- Roland Geider - [https://github.com/rolandgeider](https://github.com/rolandgeider)
- Victor Jouhoff - [https://github.com/jouhoffv](https://github.com/jouhoffv)
- m4skedbyte
- Axel Steinbrecher
- Christoph Suesser - [https://github.com/TheFitzZZ](https://github.com/TheFitzZZ)
- Luis Lüscher - [https://github.com/lslschr](https://github.com/lslschr)
- mondstern
- J. Lavoie
- Marvin M - [https://github.com/M123-dev](https://github.com/M123-dev)
- Lydia
- Allan Nordhøy - [https://github.com/comradekingu](https://github.com/comradekingu)
### Indonesian
- aryakdaniswara - [https://github.com/aryakdaniswara](https://github.com/aryakdaniswara)
- Anonymous - [https://github.com/weblate](https://github.com/weblate)
- Debi Maulana Ahsan Halla
- Roland Geider - [https://github.com/rolandgeider](https://github.com/rolandgeider)
### Catalan
- Zixu Sun - [https://github.com/ziixu](https://github.com/ziixu)
- Anonymous - [https://github.com/weblate](https://github.com/weblate)
- guillem - [https://github.com/gbuendia](https://github.com/gbuendia)
### Chinese (Simplified)
- 纪颖志 - [https://github.com/jiyingzhi](https://github.com/jiyingzhi)
- Yi-Han Hsiung - [https://github.com/AaronHsiung](https://github.com/AaronHsiung)
- Tsz Hong CHAN - [https://github.com/tomyan112](https://github.com/tomyan112)
- Eddie Tang - [https://github.com/EDED2314](https://github.com/EDED2314)
- Jing - [https://github.com/jingcheng16](https://github.com/jingcheng16)
- sr-c - [https://github.com/sr-c](https://github.com/sr-c)
- tony - [https://github.com/tonyxxliu](https://github.com/tonyxxliu)
- yiter
### Greek
- Dimitrys Meliates
- Antonis-geo - [https://github.com/Antonis-geo](https://github.com/Antonis-geo)
### Czech
- Fjuro - [https://github.com/Fjuro](https://github.com/Fjuro)
- Fjuro
- CaptainDolphy - [https://github.com/CaptainDolphy](https://github.com/CaptainDolphy)
- Roman Kalivoda - [https://github.com/RKCZ](https://github.com/RKCZ)
### Arabic
### Portuguese (Portugal)
- Anonymous - [https://github.com/weblate](https://github.com/weblate)
- Hanaa - [https://github.com/hn-n](https://github.com/hn-n)
- Ahmed zein - [https://github.com/Ahmed-Zein](https://github.com/Ahmed-Zein)
### Hebrew
### Romanian
- Anonymous - [https://github.com/weblate](https://github.com/weblate)
- n,rdo
- Tomer Ben Rachel - [https://github.com/TomerPacific](https://github.com/TomerPacific)
- Bogdan Bujor - [https://github.com/qSharpy](https://github.com/qSharpy)
- dimii27 - [https://github.com/dimii27](https://github.com/dimii27)
### Japanese
### Russian
- Anonymous - [https://github.com/weblate](https://github.com/weblate)
- Tsz Hong CHAN - [https://github.com/tomyan112](https://github.com/tomyan112)
- sasukeiscool - [https://github.com/sasukeiscool](https://github.com/sasukeiscool)
- yiter
- Алексей Курышко - [https://github.com/alexkuryshko](https://github.com/alexkuryshko)
- lightningcpu - [https://github.com/lightningcpu](https://github.com/lightningcpu)
- Кирилл Александрович Злобин - [https://github.com/gungstarbeiter](https://github.com/gungstarbeiter)
- Ivan Katkov - [https://github.com/Porphyrion](https://github.com/Porphyrion)
- Nikita Epifanov
### Serbian
- Mladen Trišić - [https://github.com/mtrisic](https://github.com/mtrisic)
### Spanish
@@ -317,33 +327,26 @@ Thank you all for contributing to the project, you are true heroes! 🫶
- Roland Geider - [https://github.com/rolandgeider](https://github.com/rolandgeider)
- martingetzel - [https://github.com/martingetzel](https://github.com/martingetzel)
### Chinese (Traditional)
### Tamil
- hugoalh
- Tsz Hong CHAN - [https://github.com/tomyan112](https://github.com/tomyan112)
- Chung-Wei Chung - [https://github.com/webb790709](https://github.com/webb790709)
- HY Cheng
- தமிழ்நேரம் - [https://github.com/TamilNeram](https://github.com/TamilNeram)
### Portuguese (Portugal)
### Turkish
- Oğuz Ersen - [https://github.com/oersen](https://github.com/oersen)
- Roland Geider - [https://github.com/rolandgeider](https://github.com/rolandgeider)
- Cem Avcı - [https://github.com/cem256](https://github.com/cem256)
- Oğuz Ersen
- Cenk Cidecio - [https://github.com/ccidecio](https://github.com/ccidecio)
- ToldYouThat
### Ukrainian
- Максим Горпиніч - [https://github.com/Maksim2005UA](https://github.com/Maksim2005UA)
- Roland Geider - [https://github.com/rolandgeider](https://github.com/rolandgeider)
- Максим Горпиніч
- Anonymous - [https://github.com/weblate](https://github.com/weblate)
### Romanian
- Bogdan Bujor - [https://github.com/qSharpy](https://github.com/qSharpy)
- dimii27 - [https://github.com/dimii27](https://github.com/dimii27)
### English
- guillem - [https://github.com/gbuendia](https://github.com/gbuendia)
- Allan Nordhøy - [https://github.com/comradekingu](https://github.com/comradekingu)
- Roland Geider - [https://github.com/rolandgeider](https://github.com/rolandgeider)
### Norwegian Bokmål
- Roland Geider - [https://github.com/rolandgeider](https://github.com/rolandgeider)
- Allan Nordhøy - [https://github.com/comradekingu](https://github.com/comradekingu)
### Amharic
- henok3878 - [https://github.com/henok3878](https://github.com/henok3878)
- Dan - [https://github.com/Kefir2105](https://github.com/Kefir2105)
- Dan
- Tymofii Lytvynenko
- Artem - [https://github.com/defaultpage](https://github.com/defaultpage)

View File

@@ -11,8 +11,8 @@ GEM
artifactory (3.0.17)
atomos (0.1.3)
aws-eventstream (1.4.0)
aws-partitions (1.1163.0)
aws-sdk-core (3.232.0)
aws-partitions (1.1181.0)
aws-sdk-core (3.236.0)
aws-eventstream (~> 1, >= 1.3.0)
aws-partitions (~> 1, >= 1.992.0)
aws-sigv4 (~> 1.9)
@@ -20,18 +20,18 @@ GEM
bigdecimal
jmespath (~> 1, >= 1.6.1)
logger
aws-sdk-kms (1.112.0)
aws-sdk-core (~> 3, >= 3.231.0)
aws-sdk-kms (1.117.0)
aws-sdk-core (~> 3, >= 3.234.0)
aws-sigv4 (~> 1.5)
aws-sdk-s3 (1.199.0)
aws-sdk-core (~> 3, >= 3.231.0)
aws-sdk-s3 (1.203.0)
aws-sdk-core (~> 3, >= 3.234.0)
aws-sdk-kms (~> 1)
aws-sigv4 (~> 1.5)
aws-sigv4 (1.12.1)
aws-eventstream (~> 1, >= 1.0.2)
babosa (1.0.4)
base64 (0.3.0)
bigdecimal (3.2.3)
bigdecimal (3.3.1)
claide (1.1.0)
colored (1.2)
colored2 (3.1.2)
@@ -161,7 +161,7 @@ GEM
httpclient (2.9.0)
mutex_m
jmespath (1.6.2)
json (2.15.0)
json (2.16.0)
jwt (2.10.2)
base64
logger (1.7.0)
@@ -173,11 +173,11 @@ GEM
nanaimo (0.4.0)
naturally (2.3.0)
nkf (0.2.0)
optparse (0.6.0)
optparse (0.8.0)
os (1.1.4)
plist (3.7.2)
public_suffix (6.0.2)
rake (13.3.0)
rake (13.3.1)
representable (3.2.0)
declarative (< 0.1.0)
trailblazer-option (>= 0.1.1, < 0.2.0)
@@ -225,6 +225,7 @@ PLATFORMS
arm64-darwin-22
arm64-darwin-23
arm64-darwin-24
arm64-darwin-25
x86_64-linux
DEPENDENCIES
@@ -235,4 +236,4 @@ DEPENDENCIES
mutex_m
BUNDLED WITH
2.6.9
2.7.2

View File

@@ -21,6 +21,7 @@ analyzer:
formatter:
page_width: 100
trailing_commas: preserve
linter:
rules:

View File

@@ -0,0 +1,57 @@
از طرف ما علاقمندان به تناسب اندام، به شما علاقمندان دیگر!
سلامتتون رو با برنامه مدیریت ورزش WGER، متحول کنید.
آیا اپلیکیشن موردعلاقه‌تون رو پیدا کردید و دوست دارید برنامه ورزشی مخصوص به خودتون رو درست کنید؟
مهم نیست چه جور ورزشکاری هستید، ما همه در یک چیز مشترکیم: عاشق اینیم که پیشرفت و داده‌های سلامتی‌مون رو دنبال کنیم! 3>
ما شما رو به خاطر اینکه هنوز هم سفر ورزشیتون رو با یک دفترچه کوچک پیش می‌برید قضاوت نمی‌کنیم...
اما خب، سلام به قرن ۲۰ ام!
ما یک اپلیکیشن شمارشگر و گزارش وضعیت سلامت و تناسب اندام ۱۰۰٪ رایگان برای شما ساخته‌ایم
که با خلاصه شدن در مهم‌ترین قابلیت‌ها، زندگی رو براتون ساده می‌کنه.
شروع کنید، به ورزش ادامه بدید و پیشرفتتون رو جشن بگیرید!
WGER یک پروژه متن‌باز است و همه‌چیز درباره این چهار مورد است:
بدن شما
تمرین‌های شما
پیشرفت شما
داده‌های شما
بدن شما:
دیگه نیازی نیست مواد تشکیل‌دهنده خوراکی موردعلاقه‌تون رو گوگل کنید!
وعده‌های غذایی روزانه‌تون رو از بین بیش از ۷۸,۰۰۰ محصول انتخاب کنید و ارزش غذایی آن‌ها رو ببینید. وعده‌ها رو به برنامه غذایی اضافه کنید و در تقویم، یک نمای کلی از رژیم‌تون داشته باشید.
تمرین‌های شما:
شما بهتر می‌دونید چه چیزی برای بدنتون مناسبه.
تمرین‌های شخصی خودتون رو از بین ۲۰۰ حرکت متنوع و در حال افزایش بسازید.
بعدش از "حالت باشگاه" استفاده کنید تا شما رو قدم‭ ‬به قدم در طول تمرین راهنمایی کند، در حالی که با یک کلیک وزن‌هایی که زدید رو ثبت می‌کنید.
پیشرفت شما:
هیچ‌وقت هدف‌هاتون رو فراموش نکنید.
وزن‌تون رو زیر نظر بگیرید و آمار پیشرفت‌تون رو ذخیره کنید.
داده‌های شما:
WGER دفترچه خاطرات ورزشی شخصی‌شده شماست – اما این شما هستید که صاحب داده‌هایتان هستید.
از REST API استفاده کنید و با داده‌هاتون کارهای فوق‌العاده انجام بدید.
یک نکته مهم: این اپ رایگان بر اساس بودجه اضافی نیست و از شما کمک مالی نمی‌خواهیم.
بلکه یک پروژه جامعه‌محور است که دائماً در حال رشد است. پس خودتون رو برای قابلیت‌های جدید هیجان‌زده کنید!
متن‌باز – این یعنی چی؟
یعنی تمام کد این برنامه و سرورش رایگان است و در دسترس همه قرار دارد:
می‌خواهید WGER رو روی سرور خودتون برای باشگاه محل اجرا کنید؟ حله!
یک قابلیت خاص کمه و می‌خواهید خودتون اضافهش کنید؟ از همین امروز شروع کنید!
می‌خواهید مطمئن بشوید که اطلاعاتی جایی فرستاده نمی‌شه؟ می‌توانید بررسی کنید!
به جامعه ما بپیوندید! بخشی از علاقه‌مندان به ورزش و متخصصان فناوری از سراسر جهان شوید.
ما دائماً در حال تنظیم و بهینه‌سازی اپلیکیشن متناسب با نیازهایمون هستیم. عاشق مشارکت و نظرات شما هستیم، پس در هر زمانی خوش آمدید که به ما ملحق شوید و آرزوها و ایده‌هاتون رو با ما در میان بگذارید!
-> کد منبع را در اینجا پیدا کنید: https://github.com/wger-project
-> سوال بپرسید یا فقط سلامی بکنید، سرور دیسکورد ما: https://discord.gg/rPWFv6W

View File

@@ -0,0 +1 @@
شمارنده تناسب اندام/ورزش، تغذیه و وزن

View File

@@ -0,0 +1 @@
wger Workout Manager

View File

@@ -1,10 +1,10 @@
Od ljubitelja fitnessa za ljubitelje fitnessa – organiziraj svoje zdravlje s WGER, tvojim upravljačem treninga!
Već si pronašao/la omiljeni program za fitness i voliš stvarati vlastite sportske rutine? Bez obzira na vrstu sportske zvijeri – svi imamo nešto zajedničko: Volimo pratiti naše zdravstvene podatke <3
Već si pronašao/la omiljeni program za fitness i voliš stvarati vlastite sportske rutine? Bez obzira na vrstu sporta kojim se baviš – svi imamo nešto zajedničko: Volimo pratiti naše zdravstvene podatke <3
Stoga te ne osuđujemo što još uvijek upravljaš svojim fitnessom sa svojim praktičnim malim dnevnikom vježbanja, ali nalazimo se u 2025. godini!
Razvili smo 100 % besplatan program za digitalno praćenje zdravlja i fitnessa, s najrelevantnijim funkcijama koje će ti olakšati život. Započni, nastavi trenirati i proslavi svoj napredak!
Razvili smo 100 % besplatan program za digitalno praćenje zdravlja i fitnessa, s najrelevantnijim funkcijama koje će ti olakšati život. Započni i nastavi trenirati te slavi svoj napredak!
wger je projekt otvorenog koda za:
* Tvoje tijelo
@@ -28,12 +28,12 @@ Napomena: Ovaj besplatni program ne temelji se na dodatnim sredstvima i ne traž
#Otvoreni kod – što to znači?
Otvoreni kod znači da je cijeli izvorni kod za ovaj program i poslužitelj s kojim razgovara besplatan i dostupan svima:
* Želiš pokrenuti wger na vlastitom poslužitelju za sebe ili lokalnu teretanu? Izvoli!
Otvoreni kod znači da je cijeli izvorni kod za ovaj program i server s kojim razgovara besplatan i dostupan svima:
* Želiš pokrenuti wger na vlastitom serveru za sebe ili lokalnu teretanu? Izvoli!
* Nedostaje ti funkcija i želiš je implementirati? Počni odmah!
* Želiš provjeriti da se nigdje ništa ne šalje? Možeš!
Pridruži se našoj zajednici i postani dio sportskih entuzijasta i IT geekova iz cijelog svijeta. Nastavljamo raditi na prilagodbi i optimizaciji programa prilagođen našim potrebama. Volimo tvoj doprinos, stoga se slobodno uključi u bilo koje vrijeme i predloži tvoje želje i ideje!
-> pronađi izvorni kod na https://github.com/wger-project
-> postavljaj pitanja ili se jednostavno predstavi na našem Discord poslužitelju https://discord.gg/rPWFv6W
-> postavljaj pitanja ili se jednostavno predstavi na našem Discord serveru https://discord.gg/rPWFv6W

View File

@@ -78,6 +78,12 @@
</screenshot>
</screenshots>
<releases>
<release version="1.9.1" date="2025-11-10">
<description>
<p>Bug fixes and improvements.</p>
</description>
<url>https://github.com/wger-project/flutter/releases/tag/1.9.1</url>
</release>
<release version="1.9.0" date="2025-09-23">
<description>
<p>Bug fixes and improvements.</p>

View File

@@ -25,23 +25,27 @@ import '../test_data/routines.dart';
Widget createDashboardScreen({String locale = 'en'}) {
final mockWorkoutProvider = MockRoutinesProvider();
when(mockWorkoutProvider.items).thenReturn([getTestRoutine(exercises: getScreenshotExercises())]);
when(mockWorkoutProvider.currentRoutine)
.thenReturn(getTestRoutine(exercises: getScreenshotExercises()));
when(
mockWorkoutProvider.currentRoutine,
).thenReturn(getTestRoutine(exercises: getScreenshotExercises()));
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,
),
]));
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 = weight.MockNutritionPlansProvider();
when(mockNutritionProvider.currentPlan)
.thenAnswer((realInvocation) => getNutritionalPlanScreenshot());
when(
mockNutritionProvider.currentPlan,
).thenAnswer((realInvocation) => getNutritionalPlanScreenshot());
when(mockNutritionProvider.items).thenReturn([getNutritionalPlanScreenshot()]);
final mockWeightProvider = weight.MockBodyWeightProvider();

View File

@@ -17,7 +17,7 @@ enum DeviceType {
sevenInchScreenshots,
tenInchScreenshots,
tvScreenshots,
wearScreenshots
wearScreenshots,
}
final destination = DeviceType.phoneScreenshots.name;
@@ -42,7 +42,6 @@ Future<void> takeScreenshot(
const languages = [
// Note: it seems if too many languages are processed at once, some processes
// disappear and no images are written. Doing this in smaller steps works fine
'ar',
'ca',
'cs-CZ',

29
lib/core/validators.dart Normal file
View File

@@ -0,0 +1,29 @@
import 'package:wger/l10n/generated/app_localizations.dart';
String? validateUrl(String? value, AppLocalizations i18n, {bool required = true}) {
// Required?
if (required && (value == null || value.trim().isEmpty)) {
return i18n.enterValue;
}
if (!required && (value == null || value.trim().isEmpty)) {
return null;
}
value = value!.trim();
if (!value.startsWith('http://') && !value.startsWith('https://')) {
return i18n.invalidUrl;
}
// Try to parse as URI
try {
final uri = Uri.parse(value);
if (!uri.hasScheme || !uri.hasAuthority) {
return i18n.invalidUrl;
}
} catch (e) {
return i18n.invalidUrl;
}
return null;
}

View File

@@ -85,20 +85,20 @@ class ExerciseDatabase extends _$ExerciseDatabase {
/// will fetch everything as needed from the server
@override
MigrationStrategy get migration => MigrationStrategy(
onUpgrade: (m, from, to) async {
// no-op, but needs to be defined
return;
},
beforeOpen: (openingDetails) async {
if (openingDetails.hadUpgrade) {
final m = createMigrator();
for (final table in allTables) {
await m.deleteTable(table.actualTableName);
await m.createTable(table);
}
}
},
);
onUpgrade: (m, from, to) async {
// no-op, but needs to be defined
return;
},
beforeOpen: (openingDetails) async {
if (openingDetails.hadUpgrade) {
final m = createMigrator();
for (final table in allTables) {
await m.deleteTable(table.actualTableName);
await m.createTable(table);
}
}
},
);
Future<void> deleteEverything() {
return transaction(() async {

File diff suppressed because it is too large Load Diff

View File

@@ -38,20 +38,20 @@ class IngredientDatabase extends _$IngredientDatabase {
/// will fetch everything as needed from the server
@override
MigrationStrategy get migration => MigrationStrategy(
onUpgrade: (m, from, to) async {
// no-op, but needs to be defined
return;
},
beforeOpen: (openingDetails) async {
if (openingDetails.hadUpgrade) {
final m = createMigrator();
for (final table in allTables) {
await m.deleteTable(table.actualTableName);
await m.createTable(table);
}
}
},
);
onUpgrade: (m, from, to) async {
// no-op, but needs to be defined
return;
},
beforeOpen: (openingDetails) async {
if (openingDetails.hadUpgrade) {
final m = createMigrator();
for (final table in allTables) {
await m.deleteTable(table.actualTableName);
await m.createTable(table);
}
}
},
);
Future<void> deleteEverything() {
return transaction(() async {

View File

@@ -7,30 +7,52 @@ class $IngredientsTable extends Ingredients with TableInfo<$IngredientsTable, In
@override
final GeneratedDatabase attachedDatabase;
final String? _alias;
$IngredientsTable(this.attachedDatabase, [this._alias]);
static const VerificationMeta _idMeta = const VerificationMeta('id');
@override
late final GeneratedColumn<int> id = GeneratedColumn<int>('id', aliasedName, false,
type: DriftSqlType.int, requiredDuringInsert: true);
late final GeneratedColumn<int> id = GeneratedColumn<int>(
'id',
aliasedName,
false,
type: DriftSqlType.int,
requiredDuringInsert: true,
);
static const VerificationMeta _dataMeta = const VerificationMeta('data');
@override
late final GeneratedColumn<String> data = GeneratedColumn<String>('data', aliasedName, false,
type: DriftSqlType.string, requiredDuringInsert: true);
late final GeneratedColumn<String> data = GeneratedColumn<String>(
'data',
aliasedName,
false,
type: DriftSqlType.string,
requiredDuringInsert: true,
);
static const VerificationMeta _lastFetchedMeta = const VerificationMeta('lastFetched');
@override
late final GeneratedColumn<DateTime> lastFetched = GeneratedColumn<DateTime>(
'last_fetched', aliasedName, false,
type: DriftSqlType.dateTime, requiredDuringInsert: true);
'last_fetched',
aliasedName,
false,
type: DriftSqlType.dateTime,
requiredDuringInsert: true,
);
@override
List<GeneratedColumn> get $columns => [id, data, lastFetched];
@override
String get aliasedName => _alias ?? actualTableName;
@override
String get actualTableName => $name;
static const String $name = 'ingredients';
@override
VerificationContext validateIntegrity(Insertable<IngredientTable> instance,
{bool isInserting = false}) {
VerificationContext validateIntegrity(
Insertable<IngredientTable> instance, {
bool isInserting = false,
}) {
final context = VerificationContext();
final data = instance.toColumns(true);
if (data.containsKey('id')) {
@@ -44,8 +66,10 @@ class $IngredientsTable extends Ingredients with TableInfo<$IngredientsTable, In
context.missing(_dataMeta);
}
if (data.containsKey('last_fetched')) {
context.handle(_lastFetchedMeta,
lastFetched.isAcceptableOrUnknown(data['last_fetched']!, _lastFetchedMeta));
context.handle(
_lastFetchedMeta,
lastFetched.isAcceptableOrUnknown(data['last_fetched']!, _lastFetchedMeta),
);
} else if (isInserting) {
context.missing(_lastFetchedMeta);
}
@@ -54,14 +78,17 @@ class $IngredientsTable extends Ingredients with TableInfo<$IngredientsTable, In
@override
Set<GeneratedColumn> get $primaryKey => const {};
@override
IngredientTable map(Map<String, dynamic> data, {String? tablePrefix}) {
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
return IngredientTable(
id: attachedDatabase.typeMapping.read(DriftSqlType.int, data['${effectivePrefix}id'])!,
data: attachedDatabase.typeMapping.read(DriftSqlType.string, data['${effectivePrefix}data'])!,
lastFetched: attachedDatabase.typeMapping
.read(DriftSqlType.dateTime, data['${effectivePrefix}last_fetched'])!,
lastFetched: attachedDatabase.typeMapping.read(
DriftSqlType.dateTime,
data['${effectivePrefix}last_fetched'],
)!,
);
}
@@ -77,7 +104,9 @@ class IngredientTable extends DataClass implements Insertable<IngredientTable> {
/// The date when the ingredient was last fetched from the server
final DateTime lastFetched;
const IngredientTable({required this.id, required this.data, required this.lastFetched});
@override
Map<String, Expression> toColumns(bool nullToAbsent) {
final map = <String, Expression>{};
@@ -88,11 +117,7 @@ class IngredientTable extends DataClass implements Insertable<IngredientTable> {
}
IngredientsCompanion toCompanion(bool nullToAbsent) {
return IngredientsCompanion(
id: Value(id),
data: Value(data),
lastFetched: Value(lastFetched),
);
return IngredientsCompanion(id: Value(id), data: Value(data), lastFetched: Value(lastFetched));
}
factory IngredientTable.fromJson(Map<String, dynamic> json, {ValueSerializer? serializer}) {
@@ -103,6 +128,7 @@ class IngredientTable extends DataClass implements Insertable<IngredientTable> {
lastFetched: serializer.fromJson<DateTime>(json['lastFetched']),
);
}
@override
Map<String, dynamic> toJson({ValueSerializer? serializer}) {
serializer ??= driftRuntimeOptions.defaultSerializer;
@@ -114,10 +140,11 @@ class IngredientTable extends DataClass implements Insertable<IngredientTable> {
}
IngredientTable copyWith({int? id, String? data, DateTime? lastFetched}) => IngredientTable(
id: id ?? this.id,
data: data ?? this.data,
lastFetched: lastFetched ?? this.lastFetched,
);
id: id ?? this.id,
data: data ?? this.data,
lastFetched: lastFetched ?? this.lastFetched,
);
IngredientTable copyWithCompanion(IngredientsCompanion data) {
return IngredientTable(
id: data.id.present ? data.id.value : this.id,
@@ -138,6 +165,7 @@ class IngredientTable extends DataClass implements Insertable<IngredientTable> {
@override
int get hashCode => Object.hash(id, data, lastFetched);
@override
bool operator ==(Object other) =>
identical(this, other) ||
@@ -152,20 +180,23 @@ class IngredientsCompanion extends UpdateCompanion<IngredientTable> {
final Value<String> data;
final Value<DateTime> lastFetched;
final Value<int> rowid;
const IngredientsCompanion({
this.id = const Value.absent(),
this.data = const Value.absent(),
this.lastFetched = const Value.absent(),
this.rowid = const Value.absent(),
});
IngredientsCompanion.insert({
required int id,
required String data,
required DateTime lastFetched,
this.rowid = const Value.absent(),
}) : id = Value(id),
data = Value(data),
lastFetched = Value(lastFetched);
}) : id = Value(id),
data = Value(data),
lastFetched = Value(lastFetched);
static Insertable<IngredientTable> custom({
Expression<int>? id,
Expression<String>? data,
@@ -180,8 +211,12 @@ class IngredientsCompanion extends UpdateCompanion<IngredientTable> {
});
}
IngredientsCompanion copyWith(
{Value<int>? id, Value<String>? data, Value<DateTime>? lastFetched, Value<int>? rowid}) {
IngredientsCompanion copyWith({
Value<int>? id,
Value<String>? data,
Value<DateTime>? lastFetched,
Value<int>? rowid,
}) {
return IngredientsCompanion(
id: id ?? this.id,
data: data ?? this.data,
@@ -222,27 +257,32 @@ class IngredientsCompanion extends UpdateCompanion<IngredientTable> {
abstract class _$IngredientDatabase extends GeneratedDatabase {
_$IngredientDatabase(QueryExecutor e) : super(e);
$IngredientDatabaseManager get managers => $IngredientDatabaseManager(this);
late final $IngredientsTable ingredients = $IngredientsTable(this);
@override
Iterable<TableInfo<Table, Object?>> get allTables =>
allSchemaEntities.whereType<TableInfo<Table, Object?>>();
@override
List<DatabaseSchemaEntity> get allSchemaEntities => [ingredients];
}
typedef $$IngredientsTableCreateCompanionBuilder = IngredientsCompanion Function({
required int id,
required String data,
required DateTime lastFetched,
Value<int> rowid,
});
typedef $$IngredientsTableUpdateCompanionBuilder = IngredientsCompanion Function({
Value<int> id,
Value<String> data,
Value<DateTime> lastFetched,
Value<int> rowid,
});
typedef $$IngredientsTableCreateCompanionBuilder =
IngredientsCompanion Function({
required int id,
required String data,
required DateTime lastFetched,
Value<int> rowid,
});
typedef $$IngredientsTableUpdateCompanionBuilder =
IngredientsCompanion Function({
Value<int> id,
Value<String> data,
Value<DateTime> lastFetched,
Value<int> rowid,
});
class $$IngredientsTableFilterComposer extends Composer<_$IngredientDatabase, $IngredientsTable> {
$$IngredientsTableFilterComposer({
@@ -252,6 +292,7 @@ class $$IngredientsTableFilterComposer extends Composer<_$IngredientDatabase, $I
super.$addJoinBuilderToRootComposer,
super.$removeJoinBuilderFromRootComposer,
});
ColumnFilters<int> get id =>
$composableBuilder(column: $table.id, builder: (column) => ColumnFilters(column));
@@ -270,6 +311,7 @@ class $$IngredientsTableOrderingComposer extends Composer<_$IngredientDatabase,
super.$addJoinBuilderToRootComposer,
super.$removeJoinBuilderFromRootComposer,
});
ColumnOrderings<int> get id =>
$composableBuilder(column: $table.id, builder: (column) => ColumnOrderings(column));
@@ -289,6 +331,7 @@ class $$IngredientsTableAnnotationComposer
super.$addJoinBuilderToRootComposer,
super.$removeJoinBuilderFromRootComposer,
});
GeneratedColumn<int> get id => $composableBuilder(column: $table.id, builder: (column) => column);
GeneratedColumn<String> get data =>
@@ -298,72 +341,80 @@ class $$IngredientsTableAnnotationComposer
$composableBuilder(column: $table.lastFetched, builder: (column) => column);
}
class $$IngredientsTableTableManager extends RootTableManager<
_$IngredientDatabase,
$IngredientsTable,
IngredientTable,
$$IngredientsTableFilterComposer,
$$IngredientsTableOrderingComposer,
$$IngredientsTableAnnotationComposer,
$$IngredientsTableCreateCompanionBuilder,
$$IngredientsTableUpdateCompanionBuilder,
(IngredientTable, BaseReferences<_$IngredientDatabase, $IngredientsTable, IngredientTable>),
IngredientTable,
PrefetchHooks Function()> {
class $$IngredientsTableTableManager
extends
RootTableManager<
_$IngredientDatabase,
$IngredientsTable,
IngredientTable,
$$IngredientsTableFilterComposer,
$$IngredientsTableOrderingComposer,
$$IngredientsTableAnnotationComposer,
$$IngredientsTableCreateCompanionBuilder,
$$IngredientsTableUpdateCompanionBuilder,
(
IngredientTable,
BaseReferences<_$IngredientDatabase, $IngredientsTable, IngredientTable>,
),
IngredientTable,
PrefetchHooks Function()
> {
$$IngredientsTableTableManager(_$IngredientDatabase db, $IngredientsTable table)
: super(TableManagerState(
: super(
TableManagerState(
db: db,
table: table,
createFilteringComposer: () => $$IngredientsTableFilterComposer($db: db, $table: table),
createOrderingComposer: () => $$IngredientsTableOrderingComposer($db: db, $table: table),
createComputedFieldComposer: () =>
$$IngredientsTableAnnotationComposer($db: db, $table: table),
updateCompanionCallback: ({
Value<int> id = const Value.absent(),
Value<String> data = const Value.absent(),
Value<DateTime> lastFetched = const Value.absent(),
Value<int> rowid = const Value.absent(),
}) =>
IngredientsCompanion(
id: id,
data: data,
lastFetched: lastFetched,
rowid: rowid,
),
createCompanionCallback: ({
required int id,
required String data,
required DateTime lastFetched,
Value<int> rowid = const Value.absent(),
}) =>
IngredientsCompanion.insert(
id: id,
data: data,
lastFetched: lastFetched,
rowid: rowid,
),
updateCompanionCallback:
({
Value<int> id = const Value.absent(),
Value<String> data = const Value.absent(),
Value<DateTime> lastFetched = const Value.absent(),
Value<int> rowid = const Value.absent(),
}) =>
IngredientsCompanion(id: id, data: data, lastFetched: lastFetched, rowid: rowid),
createCompanionCallback:
({
required int id,
required String data,
required DateTime lastFetched,
Value<int> rowid = const Value.absent(),
}) => IngredientsCompanion.insert(
id: id,
data: data,
lastFetched: lastFetched,
rowid: rowid,
),
withReferenceMapper: (p0) =>
p0.map((e) => (e.readTable(table), BaseReferences(db, table, e))).toList(),
prefetchHooksCallback: null,
));
),
);
}
typedef $$IngredientsTableProcessedTableManager = ProcessedTableManager<
_$IngredientDatabase,
$IngredientsTable,
IngredientTable,
$$IngredientsTableFilterComposer,
$$IngredientsTableOrderingComposer,
$$IngredientsTableAnnotationComposer,
$$IngredientsTableCreateCompanionBuilder,
$$IngredientsTableUpdateCompanionBuilder,
(IngredientTable, BaseReferences<_$IngredientDatabase, $IngredientsTable, IngredientTable>),
IngredientTable,
PrefetchHooks Function()>;
typedef $$IngredientsTableProcessedTableManager =
ProcessedTableManager<
_$IngredientDatabase,
$IngredientsTable,
IngredientTable,
$$IngredientsTableFilterComposer,
$$IngredientsTableOrderingComposer,
$$IngredientsTableAnnotationComposer,
$$IngredientsTableCreateCompanionBuilder,
$$IngredientsTableUpdateCompanionBuilder,
(IngredientTable, BaseReferences<_$IngredientDatabase, $IngredientsTable, IngredientTable>),
IngredientTable,
PrefetchHooks Function()
>;
class $IngredientDatabaseManager {
final _$IngredientDatabase _db;
$IngredientDatabaseManager(this._db);
$$IngredientsTableTableManager get ingredients =>
$$IngredientsTableTableManager(_db, _db.ingredients);
}

View File

@@ -143,3 +143,6 @@ const String API_RESULTS_PAGE_SIZE = '100';
/// Marker used for identifying interpolated values in a list, e.g. for measurements
/// the milliseconds in the entry date are set to this value
const INTERPOLATION_MARKER = 123;
/// Creative Commons license IDs
const CC_BY_SA_4_ID = 2;

View File

@@ -101,7 +101,8 @@ void showGeneralErrorDialog(dynamic error, StackTrace? stackTrace, {BuildContext
if (error is TimeoutException) {
issueTitle = 'Network Timeout';
issueErrorMessage = 'The connection to the server timed out. Please check your '
issueErrorMessage =
'The connection to the server timed out. Please check your '
'internet connection and try again.';
} else if (error is FlutterErrorDetails) {
issueTitle = 'Application Error';
@@ -116,7 +117,7 @@ void showGeneralErrorDialog(dynamic error, StackTrace? stackTrace, {BuildContext
}
final String fullStackTrace = stackTrace?.toString() ?? 'No stack trace available.';
final applicationLogs = InMemoryLogStore().formattedLogs;
final applicationLogs = InMemoryLogStore().getFormattedLogs();
showDialog(
context: dialogContext,
@@ -127,15 +128,9 @@ void showGeneralErrorDialog(dynamic error, StackTrace? stackTrace, {BuildContext
spacing: 8,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Icon(
icon,
color: Theme.of(context).colorScheme.error,
),
Icon(icon, color: Theme.of(context).colorScheme.error),
Expanded(
child: Text(
errorTitle,
style: TextStyle(color: Theme.of(context).colorScheme.error),
),
child: Text(errorTitle, style: TextStyle(color: Theme.of(context).colorScheme.error)),
),
],
),
@@ -150,10 +145,7 @@ void showGeneralErrorDialog(dynamic error, StackTrace? stackTrace, {BuildContext
tilePadding: EdgeInsets.zero,
title: Text(i18n.errorViewDetails),
children: [
Text(
issueErrorMessage,
style: const TextStyle(fontWeight: FontWeight.bold),
),
Text(issueErrorMessage, style: const TextStyle(fontWeight: FontWeight.bold)),
Container(
alignment: Alignment.topLeft,
padding: const EdgeInsets.symmetric(vertical: 8.0),
@@ -166,15 +158,13 @@ void showGeneralErrorDialog(dynamic error, StackTrace? stackTrace, {BuildContext
),
),
CopyToClipboardButton(
text: 'Error Title: $issueTitle\n'
text:
'Error Title: $issueTitle\n'
'Error Message: $issueErrorMessage\n\n'
'Stack Trace:\n$fullStackTrace',
),
const SizedBox(height: 8),
Text(
i18n.applicationLogs,
style: const TextStyle(fontWeight: FontWeight.bold),
),
Text(i18n.applicationLogs, style: const TextStyle(fontWeight: FontWeight.bold)),
Container(
alignment: Alignment.topLeft,
padding: const EdgeInsets.symmetric(vertical: 8.0),
@@ -182,10 +172,12 @@ void showGeneralErrorDialog(dynamic error, StackTrace? stackTrace, {BuildContext
child: SingleChildScrollView(
child: Column(
children: [
...applicationLogs.map((entry) => Text(
entry,
style: TextStyle(fontSize: 12.0, color: Colors.grey[700]),
))
...applicationLogs.map(
(entry) => Text(
entry,
style: TextStyle(fontSize: 12.0, color: Colors.grey[700]),
),
),
],
),
),
@@ -215,7 +207,8 @@ void showGeneralErrorDialog(dynamic error, StackTrace? stackTrace, {BuildContext
'App logs (last ${applicationLogs.length} entries):\n'
'```\n$logText\n```',
);
final githubIssueUrl = '$GITHUB_ISSUES_BUG_URL'
final githubIssueUrl =
'$GITHUB_ISSUES_BUG_URL'
'&title=$issueTitle'
'&description=$description';
final Uri reportUri = Uri.parse(githubIssueUrl);
@@ -226,9 +219,9 @@ void showGeneralErrorDialog(dynamic error, StackTrace? stackTrace, {BuildContext
if (kDebugMode) {
logger.warning('Error launching URL: $e');
}
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(content: Text('Error opening issue tracker: $e')),
);
ScaffoldMessenger.of(
context,
).showSnackBar(SnackBar(content: Text('Error opening issue tracker: $e')));
}
},
),
@@ -248,10 +241,7 @@ class CopyToClipboardButton extends StatelessWidget {
final logger = Logger('CopyToClipboardButton');
final String text;
CopyToClipboardButton({
required this.text,
super.key,
});
CopyToClipboardButton({required this.text, super.key});
@override
Widget build(BuildContext context) {
@@ -265,21 +255,23 @@ class CopyToClipboardButton extends StatelessWidget {
tapTargetSize: MaterialTapTargetSize.shrinkWrap,
),
onPressed: () {
Clipboard.setData(ClipboardData(text: text)).then((_) {
if (context.mounted) {
ScaffoldMessenger.of(context).showSnackBar(
const SnackBar(content: Text('Details copied to clipboard!')),
);
}
}).catchError((copyError) {
logger.warning('Error copying to clipboard: $copyError');
Clipboard.setData(ClipboardData(text: text))
.then((_) {
if (context.mounted) {
ScaffoldMessenger.of(
context,
).showSnackBar(const SnackBar(content: Text('Details copied to clipboard!')));
}
})
.catchError((copyError) {
logger.warning('Error copying to clipboard: $copyError');
if (context.mounted) {
ScaffoldMessenger.of(context).showSnackBar(
const SnackBar(content: Text('Could not copy details.')),
);
}
});
if (context.mounted) {
ScaffoldMessenger.of(
context,
).showSnackBar(const SnackBar(content: Text('Could not copy details.')));
}
});
},
);
}
@@ -290,9 +282,7 @@ void showDeleteDialog(BuildContext context, String confirmDeleteName, Log log) a
context: context,
builder: (BuildContext contextDialog) {
return AlertDialog(
content: Text(
AppLocalizations.of(context).confirmDelete(confirmDeleteName),
),
content: Text(AppLocalizations.of(context).confirmDelete(confirmDeleteName)),
actions: [
TextButton(
key: const ValueKey('cancel-button'),
@@ -387,7 +377,10 @@ List<Widget> formatApiErrors(List<ApiError> errors, {Color? color}) {
for (final error in errors) {
errorList.add(
Text(error.key, style: TextStyle(fontWeight: FontWeight.bold, color: textColor)),
Text(
error.key,
style: TextStyle(fontWeight: FontWeight.bold, color: textColor),
),
);
print(error.errorMessages);
@@ -408,7 +401,10 @@ List<Widget> formatTextErrors(List<String> errors, {String? title, Color? color}
if (title != null) {
errorList.add(
Text(title, style: TextStyle(fontWeight: FontWeight.bold, color: textColor)),
Text(
title,
style: TextStyle(fontWeight: FontWeight.bold, color: textColor),
),
);
}
@@ -458,11 +454,7 @@ class GeneralErrorsWidget extends StatelessWidget {
child: Column(
children: [
Icon(Icons.error_outline, color: Theme.of(context).colorScheme.error),
...formatTextErrors(
widgets,
title: title,
color: Theme.of(context).colorScheme.error,
),
...formatTextErrors(widgets, title: title, color: Theme.of(context).colorScheme.error),
],
),
),

View File

@@ -14,10 +14,17 @@ 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.toString(),
MAX_CHARS_NAME.toString(),
);
return AppLocalizations.of(
context,
).enterCharacters(MIN_CHARS_NAME.toString(), MAX_CHARS_NAME.toString());
}
return null;
}
String? validateAuthorName(String? name, BuildContext context) {
if (name!.isEmpty) {
return AppLocalizations.of(context).enterValue;
}
return null;

View File

@@ -41,10 +41,16 @@ class InMemoryLogStore {
List<LogRecord> get logs => List.unmodifiable(_logs);
List<String> get formattedLogs => _logs
.map((log) =>
'${log.time.toIso8601String()} ${log.level.name} [${log.loggerName}] ${log.message}')
.toList();
List<String> getFormattedLogs({Level? minLevel}) {
final level = minLevel ?? Logger.root.level;
return _logs
.where((log) => log.level >= level)
.map(
(log) =>
'${log.time.toIso8601String()} ${log.level.name} [${log.loggerName}] ${log.message}',
)
.toList();
}
void clear() => _logs.clear();
}

View File

@@ -25,11 +25,11 @@ extension MeasurementChartEntryListExtensions on List<MeasurementChartEntry> {
return where((e) => e.date.isAfter(start) && (end == null || e.date.isBefore(end))).toList();
}
// assures values on the start (and optionally end) dates exist, by interpolating if needed
// this is used for when you are looking at a specific time frame (e.g. for a nutrition plan)
// while gaps in the middle of a chart can be "visually interpolated", it's good to have a clearer
// explicit interpolation for the start and end dates (if needed)
// this also helps with computing delta's across the entire window
// assures values on the start (and optionally end) dates exist, by interpolating if needed
// this is used for when you are looking at a specific time frame (e.g. for a nutrition plan)
// while gaps in the middle of a chart can be "visually interpolated", it's good to have a clearer
// explicit interpolation for the start and end dates (if needed)
// this also helps with computing delta's across the entire window
List<MeasurementChartEntry> whereDateWithInterpolation(DateTime start, DateTime? end) {
// Make sure our list is sorted by date
sort((a, b) => a.date.compareTo(b.date));
@@ -90,7 +90,10 @@ extension MeasurementChartEntryListExtensions on List<MeasurementChartEntry> {
// caller needs to make sure that before.date < date < after.date
MeasurementChartEntry interpolateBetween(
MeasurementChartEntry before, MeasurementChartEntry after, DateTime date) {
MeasurementChartEntry before,
MeasurementChartEntry after,
DateTime date,
) {
final totalDuration = after.date.difference(before.date).inMilliseconds;
final startDuration = date.difference(before.date).inMilliseconds;

View File

@@ -471,6 +471,26 @@
},
"gallery": "Galeria",
"@gallery": {},
"imageFormatNotSupported": "{imageFormat} no és compatible",
"@imageFormatNotSupported": {
"description": "Label shown on the error container when image format is not supported",
"type": "text",
"placeholders": {
"imageFormat": {
"type": "String"
}
}
},
"imageFormatNotSupportedDetail": "Les imatges {imageFormat} encara no són compatibles.",
"@imageFormatNotSupportedDetail": {
"description": "Label shown on the image preview container when image format is not supported",
"type": "text",
"placeholders": {
"imageFormat": {
"type": "String"
}
}
},
"addImage": "Afegeix imatge",
"@addImage": {},
"dataCopied": "Dades copiades a una nova entrada",

View File

@@ -508,6 +508,26 @@
"@takePicture": {},
"gallery": "Galerie",
"@gallery": {},
"imageFormatNotSupported": "{imageFormat} není podporován",
"@imageFormatNotSupported": {
"description": "Label shown on the error container when image format is not supported",
"type": "text",
"placeholders": {
"imageFormat": {
"type": "String"
}
}
},
"imageFormatNotSupportedDetail": "Obrazy {imageFormat} zatím nejsou podporovány.",
"@imageFormatNotSupportedDetail": {
"description": "Label shown on the image preview container when image format is not supported",
"type": "text",
"placeholders": {
"imageFormat": {
"type": "String"
}
}
},
"productFound": "Produkt nalezen",
"@productFound": {
"description": "Header label for dialog when product is found with barcode"

View File

@@ -357,6 +357,26 @@
"@addImage": {},
"gallery": "Galerie",
"@gallery": {},
"imageFormatNotSupported": "{imageFormat} wird nicht unterstützt",
"@imageFormatNotSupported": {
"description": "Label shown on the error container when image format is not supported",
"type": "text",
"placeholders": {
"imageFormat": {
"type": "String"
}
}
},
"imageFormatNotSupportedDetail": "{imageFormat}-Bilder werden noch nicht unterstützt.",
"@imageFormatNotSupportedDetail": {
"description": "Label shown on the image preview container when image format is not supported",
"type": "text",
"placeholders": {
"imageFormat": {
"type": "String"
}
}
},
"chooseFromLibrary": "Wähle aus der Bibliothek",
"@chooseFromLibrary": {},
"takePicture": "Bild aufnehmen",
@@ -731,7 +751,7 @@
},
"aboutDonateTitle": "Mach eine Spende",
"@aboutDonateTitle": {},
"aboutDonateText": "Das Projekt ist kostenlos und wird es auch bleiben, der Betrieb des Servers hingegen nicht! Die Entwicklung erfordert zudem viel Zeit und Mühe von Freiwilligen. Ihr Beitrag deckt diese Kosten direkt und trägt zur Zuverlässigkeit des Dienstes bei.",
"aboutDonateText": "Das Projekt ist kostenlos und wird es auch bleiben, der Betrieb des Servers hingegen ist es nicht! Die Entwicklung erfordert zudem viel Zeit und Mühe von Freiwilligen. Ihr Beitrag deckt diese Kosten direkt und trägt zur Zuverlässigkeit des Dienstes bei.",
"@aboutDonateText": {},
"settingsCacheTitle": "Zwischenspeicher",
"@settingsCacheTitle": {},
@@ -930,7 +950,7 @@
"@simpleModeHelp": {},
"isRestDayHelp": "Bitte beachten Sie, dass alle Sätze und Übungen entfernt werden, wenn Sie einen Tag als Ruhetag markieren.",
"@isRestDayHelp": {},
"needsLogsToAdvance": "Benötigt Eintrag, um fortzufahren",
"needsLogsToAdvance": "Benötigt Logeinträge, um fortzufahren",
"@needsLogsToAdvance": {},
"needsLogsToAdvanceHelp": "Wählen Sie aus, ob die Routine nur dann zum nächsten geplanten Tag fortgesetzt werden soll, wenn Sie für diesen Tag ein Training protokolliert haben",
"@needsLogsToAdvanceHelp": {},

View File

@@ -155,8 +155,26 @@
"@category": {
"description": "Category for an exercise, ingredient, etc."
},
"endDate": "End date",
"startDate": "Start date",
"@startDate": {
"description": "The start date of a nutritional plan or routine"
},
"dayTypeCustom": "Custom",
"dayTypeEnom": "Every minute on the minute",
"dayTypeAmrap": "As many rounds as possible",
"dayTypeHiit": "High intensity interval training",
"dayTypeTabata": "Tabata",
"dayTypeEdt": "Escalating density training",
"dayTypeRft": "Rounds for time",
"dayTypeAfap": "As fast as possible",
"slotEntryTypeNormal": "Normal",
"slotEntryTypeDropset": "Dropset",
"slotEntryTypeMyo": "Myo",
"slotEntryTypePartial": "Partial",
"slotEntryTypeForced": "Forced",
"slotEntryTypeTut": "Time under Tension",
"slotEntryTypeIso": "Isometric hold",
"slotEntryTypeJump": "Jump",
"routines": "Routines",
"newRoutine": "New routine",
"noRoutines": "You have no routines",
@@ -387,13 +405,9 @@
"@date": {
"description": "The date of a workout log or body weight entry"
},
"creationDate": "Start date",
"@creationDate": {
"description": "The Start date of a nutritional plan"
},
"endDate": "End date",
"@endDate": {
"description": "The End date of a nutritional plan"
"description": "The End date of a nutritional plan or routine"
},
"openEnded": "Open ended",
"@openEnded": {
@@ -719,89 +733,87 @@
}
}
},
"scanBarcode": "Scan barcode",
"@scanBarcode": {
"description": "Label for scan barcode button"
},
"close": "Close",
"@close": {
"description": "Translation for close"
},
"identicalExercisePleaseDiscard": "If you notice an exercise that is identical to the one you're adding, please discard your draft and edit that exercise instead.",
"checkInformationBeforeSubmitting": "Please check that the information you entered is correct before submitting the exercise",
"add_exercise_image_license": "Images must be compatible with the CC BY SA license. If in doubt, upload only photos you've taken yourself.",
"imageDetailsTitle": "Image details",
"@imageDetailsTitle": {
"description": "Title for image details form"
},
"imageDetailsLicenseTitle": "Title",
"@imageDetailsLicenseTitle": {
"description": "Label for image title field"
},
"imageDetailsLicenseTitleHint": "Enter image title",
"@imageDetailsLicenseTitleHint": {
"description": "Hint text for image title field"
},
"imageDetailsSourceLink": "Link to the source website, if available",
"@imageDetailsSourceLink": {
"description": "Label for source link field"
},
"imageDetailsSourceLinkHint": "https://example.com",
"@imageDetailsSourceLinkHint": {
"description": "Hint text for source link field"
},
"imageDetailsAuthor": "Author(s)",
"@imageDetailsAuthor": {
"description": "Label for author field"
},
"imageDetailsAuthorHint": "Enter author name",
"@imageDetailsAuthorHint": {
"description": "Hint text for author field"
},
"imageDetailsAuthorLink": "Link to author website or profile, if available",
"@imageDetailsAuthorLink": {
"description": "Label for author link field"
},
"imageDetailsAuthorLinkHint": "https://example.com/author",
"@imageDetailsAuthorLinkHint": {
"description": "Hint text for author link field"
},
"imageDetailsDerivativeSource": "Link to the original source, if this is a derivative work",
"@imageDetailsDerivativeSource": {
"description": "Label for derivative source field"
},
"imageDetailsDerivativeSourceHint": "https://example.com/original",
"@imageDetailsDerivativeSourceHint": {
"description": "Hint text for derivative source field"
},
"imageDetailsDerivativeHelp": "A derivative work is based on a previous work but contains sufficient new, creative content to entitle it to its own copyright.",
"@imageDetailsDerivativeHelp": {
"description": "Helper text explaining derivative works"
},
"imageDetailsImageType": "Image Type",
"@imageDetailsImageType": {
"description": "Label for image type selector"
},
"imageDetailsLicenseNoticePrefix": "By submitting this image, you agree to release it under the ",
"@imageDetailsLicenseNoticePrefix": {
"description": "First part of license notice text"
},
"imageDetailsLicenseNoticeSuffix": " The image must be either your own work or the author must have released it under a license compatible with CC BY-SA 4.0.",
"@imageDetailsLicenseNoticeSuffix": {
"description": "Second part of license notice text"
},
"imageDetailsCancel": "CANCEL",
"@imageDetailsCancel": {
"description": "Cancel button text"
},
"imageDetailsAdd": "ADD",
"@imageDetailsAdd": {
"description": "Add button text"
},
"variations": "Variations",
"@variations": {
"description": "Variations of one exercise (e.g. benchpress and benchpress narrow)"
},
"scanBarcode": "Scan barcode",
"@scanBarcode": {
"description": "Label for scan barcode button"
},
"close": "Close",
"@close": {
"description": "Translation for close"
},
"identicalExercisePleaseDiscard": "If you notice an exercise that is identical to the one you're adding, please discard your draft and edit that exercise instead.",
"checkInformationBeforeSubmitting": "Please check that the information you entered is correct before submitting the exercise",
"add_exercise_image_license": "Images must be compatible with the CC BY SA license. If in doubt, upload only photos you've taken yourself.",
"imageDetailsTitle": "Image details",
"@imageDetailsTitle": {
"description": "Title for image details form"
},
"imageDetailsLicenseTitle": "Title",
"@imageDetailsLicenseTitle": {
"description": "Label for image title field"
},
"imageDetailsLicenseTitleHint": "Enter image title",
"@imageDetailsLicenseTitleHint": {
"description": "Hint text for image title field"
},
"imageDetailsSourceLink": "Link to the source website",
"@imageDetailsSourceLink": {
"description": "Label for source link field"
},
"author": "Author(s)",
"@Author": {
"description": "Label for author field"
},
"authorHint": "Enter author name",
"@authorHint": {
"description": "Hint text for author field"
},
"imageDetailsAuthorLink": "Link to author website or profile",
"@imageDetailsAuthorLink": {
"description": "Label for author link field"
},
"imageDetailsDerivativeSource": "Link to the original source, if this is a derivative work",
"@imageDetailsDerivativeSource": {
"description": "Label for derivative source field"
},
"imageDetailsDerivativeHelp": "A derivative work is based on a previous work but contains sufficient new, creative content to entitle it to its own copyright.",
"@imageDetailsDerivativeHelp": {
"description": "Helper text explaining derivative works"
},
"imageDetailsImageType": "Image Type",
"@imageDetailsImageType": {
"description": "Label for image type selector"
},
"imageDetailsLicenseNotice": "By submitting this image, you agree to release it under the CC-BY-SA-4. The image must be either your own work or the author must have released it under a license compatible with it.",
"imageDetailsLicenseNoticeLinkToLicense": "See license text.",
"imageFormatNotSupported": "{imageFormat} not supported",
"@imageFormatNotSupported": {
"description": "Label shown on the error container when image format is not supported",
"type": "text",
"placeholders": {
"imageFormat": {
"type": "String"
}
}
},
"imageFormatNotSupportedDetail": "{imageFormat} images are not supported yet.",
"@imageFormatNotSupportedDetail": {
"description": "Label shown on the image preview container when image format is not supported",
"type": "text",
"placeholders": {
"imageFormat": {
"type": "String"
}
}
},
"add": "add",
"@add": {
"description": "Add button text"
},
"variations": "Variations",
"@variations": {
"description": "Variations of one exercise (e.g. benchpress and benchpress narrow)"
},
"alsoKnownAs": "Also known as: {aliases}",
"@alsoKnownAs": {
"placeholders": {
@@ -1051,8 +1063,9 @@
"@indicatorAvg": {
"description": "added for localization of Class Indicator's field text"
},
"endWorkout": "End Workout",
"themeMode": "Theme mode",
"darkMode": "Always dark mode",
"lightMode": "Always light mode",
"systemMode": "System settings"
}
}

View File

@@ -344,6 +344,26 @@
"@addImage": {},
"gallery": "Galería",
"@gallery": {},
"imageFormatNotSupported": "{imageFormat} no compatible",
"@imageFormatNotSupported": {
"description": "Label shown on the error container when image format is not supported",
"type": "text",
"placeholders": {
"imageFormat": {
"type": "String"
}
}
},
"imageFormatNotSupportedDetail": "Las imágenes {imageFormat} aún no son compatibles.",
"@imageFormatNotSupportedDetail": {
"description": "Label shown on the image preview container when image format is not supported",
"type": "text",
"placeholders": {
"imageFormat": {
"type": "String"
}
}
},
"chooseFromLibrary": "Elije de la biblioteca de fotos",
"@chooseFromLibrary": {},
"takePicture": "Toma una foto",
@@ -1016,5 +1036,83 @@
"setHasProgressionWarning": "Tenga en cuenta que, por el momento, no es posible editar todos los ajustes de un set en la aplicación móvil ni configurar la progresión automática. Por ahora, utilice la aplicación web.",
"@setHasProgressionWarning": {},
"applicationLogs": "Registro de la aplicación",
"@applicationLogs": {}
"@applicationLogs": {},
"creationDate": "Fecha de comienzo",
"@creationDate": {
"description": "The Start date of a nutritional plan"
},
"openEnded": "Indefinido",
"@openEnded": {
"description": "When a nutrition plan has no pre-defined end date"
},
"overview": "Descripción general",
"@overview": {},
"identicalExercisePleaseDiscard": "Si observa un ejercicio idéntico al que está agregando, descarte el borrador y edítelo en su lugar.",
"@identicalExercisePleaseDiscard": {},
"checkInformationBeforeSubmitting": "Por favor verifique que la información que ingresó sea correcta antes de enviar el ejercicio",
"@checkInformationBeforeSubmitting": {},
"imageDetailsTitle": "Detalles de la imagen",
"@imageDetailsTitle": {
"description": "Title for image details form"
},
"imageDetailsLicenseTitle": "Título",
"@imageDetailsLicenseTitle": {
"description": "Label for image title field"
},
"imageDetailsLicenseTitleHint": "Introduce el título de la imagen",
"@imageDetailsLicenseTitleHint": {
"description": "Hint text for image title field"
},
"imageDetailsSourceLink": "Enlace al sitio web de origen",
"@imageDetailsSourceLink": {
"description": "Label for source link field"
},
"author": "Autor(es)",
"@author": {},
"authorHint": "Introduce el nombre del autor",
"@authorHint": {
"description": "Hint text for author field"
},
"imageDetailsAuthorLink": "Enlace al sitio web o perfil del autor",
"@imageDetailsAuthorLink": {
"description": "Label for author link field"
},
"imageDetailsDerivativeSource": "Enlace a la fuente original, si se trata de un trabajo derivado",
"@imageDetailsDerivativeSource": {
"description": "Label for derivative source field"
},
"imageDetailsDerivativeHelp": "Un trabajo derivado se basa en un trabajo anterior, pero contiene suficiente contenido nuevo y creativo para darle derecho a sus propios derechos de autor.",
"@imageDetailsDerivativeHelp": {
"description": "Helper text explaining derivative works"
},
"imageDetailsImageType": "Tipo de imagen",
"@imageDetailsImageType": {
"description": "Label for image type selector"
},
"imageDetailsLicenseNotice": "Al enviar esta imagen, acepta divulgarla según la licencia CC-BY-SA-4. La imagen debe ser obra propia o el autor debe haberla publicado bajo una licencia compatible con ella.",
"@imageDetailsLicenseNotice": {},
"imageDetailsLicenseNoticeLinkToLicense": "Ver texto de licencia.",
"@imageDetailsLicenseNoticeLinkToLicense": {},
"add": "agregar",
"@add": {
"description": "Add button text"
},
"enterTextInLanguage": "¡Por favor ingrese el texto en el idioma correcto!",
"@enterTextInLanguage": {},
"galleryImageTypeNotSupported": "Las imágenes {imageType} actualmente no son compatibles con esta plataforma.",
"@galleryImageTypeNotSupported": {
"placeholders": {
"imageType": {
"type": "String"
}
}
},
"galleryImageTypeNotSupportedDetail": "Esta imagen está en formato {imageType}, que actualmente no es compatible con esta plataforma.",
"@galleryImageTypeNotSupportedDetail": {
"placeholders": {
"imageType": {
"type": "String"
}
}
}
}

View File

@@ -1 +1,389 @@
{}
{
"userProfile": "پروفایل شما",
"@userProfile": {},
"login": "ورود",
"@login": {
"description": "Text for login button"
},
"logout": "خروج",
"@logout": {
"description": "Text for logout button"
},
"date": "تاریخ",
"@date": {
"description": "The date of a workout log or body weight entry"
},
"register": "ثبت نام",
"@register": {
"description": "Text for registration button"
},
"useDefaultServer": "استفاده از سرور پیش فرض",
"@useDefaultServer": {
"description": "Toggle button allowing users to switch between the default and a custom wger server"
},
"useCustomServer": "استفاده از سرور سفارشی (خصوصی)",
"@useCustomServer": {
"description": "Toggle button allowing users to switch between the default and a custom wger server"
},
"edit": "ویرایش",
"@edit": {},
"invalidUrl": "لطفا یک لینک معتبر وارد کنید",
"@invalidUrl": {
"description": "Error message when the user enters an invalid URL, e.g. in the login form"
},
"usernameValidChars": "نام کاربری فقط میتواند شامل حروف انگلیسی، اعداد انگلیسی و این کاراکتر ها @ + . - _ باشد",
"@usernameValidChars": {
"description": "Error message when the user tries to register a username with forbidden characters"
},
"delete": "حذف",
"@delete": {},
"passwordsDontMatch": "رمزهای عبور مطابقت ندارند",
"@passwordsDontMatch": {
"description": "Error message when the user enters two different passwords during registration"
},
"passwordTooShort": "رمز عبور خیلی کوتاه است",
"@passwordTooShort": {
"description": "Error message when the user a password that is too short"
},
"selectAvailablePlates": "بشقاب‌های غذایی موجود را انتخاب کنید",
"@selectAvailablePlates": {},
"close": "بستن",
"@close": {
"description": "Translation for close"
},
"difference": "تفاوت",
"@difference": {},
"useColors": "استفاده از رنگ ها",
"@useColors": {},
"password": "رمزعبور",
"@password": {},
"confirmPassword": "تأیید رمز عبور",
"@confirmPassword": {},
"invalidEmail": "لطفا یک آدرس ایمیل معتبر وارد کنید",
"@invalidEmail": {
"description": "Error message when the user enters an invalid email"
},
"email": "آدرس ایمیل",
"@email": {},
"username": "نام کاربری",
"@username": {},
"invalidUsername": "لطفا یک نام کاربری معتبر وارد کنید",
"@invalidUsername": {
"description": "Error message when the user enters an invalid username"
},
"start": "شروع",
"@start": {
"description": "Label on button to start the gym mode (i.e., an imperative)"
},
"useApiToken": "استفاده از توکن API",
"@useApiToken": {},
"useUsernameAndPassword": "استفاده از نام کاربری و رمز عبور",
"@useUsernameAndPassword": {},
"comment": "نظر",
"@comment": {
"description": "Comment, additional information"
},
"apiToken": "توکن API",
"@apiToken": {},
"invalidApiToken": "لطفا یک کلید API معتبر وارد کنید",
"@invalidApiToken": {
"description": "Error message when the user enters an invalid API key"
},
"apiTokenValidChars": "یک کلید API می‌تواند فقط شامل حروف انگلیسی a تا f، اعداد انگلیسی 0 تا 9 و دقیقاً 40 کاراکتر باشد",
"@apiTokenValidChars": {
"description": "Error message when the user tries to input a API key with forbidden characters"
},
"customServerUrl": "آدرس اینترنتی (URL) به منبع WGER",
"@customServerUrl": {
"description": "Label in the form where the users can enter their own wger instance"
},
"customServerHint": "آدرس سرور خودتان را وارد کنید، در غیر این صورت آدرس پیش‌فرض استفاده خواهد شد",
"@customServerHint": {
"description": "Hint text for the form where the users can enter their own wger instance"
},
"reset": "تنظیم مجدد",
"@reset": {
"description": "Button text allowing the user to reset the entered values to the default"
},
"registerInstead": "حساب کاربری ندارید؟ همین حالا ثبت نام کنید",
"@registerInstead": {},
"loginInstead": "حساب کاربری دارید؟ وارد شوید",
"@loginInstead": {},
"nutritionalPlan": "برنامه غذایی",
"@nutritionalPlan": {},
"labelBottomNavWorkout": "تمرین ورزشی",
"@labelBottomNavWorkout": {
"description": "Label used in bottom navigation, use a short word"
},
"labelBottomNavNutrition": "تغذیه",
"@labelBottomNavNutrition": {
"description": "Label used in bottom navigation, use a short word"
},
"labelWorkoutLogs": "گزارش تمرینات",
"@labelWorkoutLogs": {
"description": "(Workout) logs"
},
"labelWorkoutPlan": "برنامه تمرین ورزشی",
"@labelWorkoutPlan": {
"description": "Title for screen workout plan"
},
"labelDashboard": "داشبورد",
"@labelDashboard": {
"description": "Title for screen dashboard"
},
"success": "موفقیت",
"@success": {
"description": "Message when an action completed successfully, usually used as a heading"
},
"successfullyDeleted": "حذف شده",
"@successfullyDeleted": {
"description": "Message when an item was successfully deleted"
},
"successfullySaved": "ذخیره شده",
"@successfullySaved": {
"description": "Message when an item was successfully saved"
},
"notes": "یادداشت‌ها",
"@notes": {
"description": "Personal notes, e.g. for a workout session"
},
"exerciseList": "لیست تمرینات",
"@exerciseList": {},
"value": "مقدار",
"@value": {
"description": "The value of a measurement entry"
},
"newDay": "روز جدید",
"@newDay": {},
"newSet": "مجموعه جدید",
"@newSet": {
"description": "Header when adding a new set to a workout day"
},
"selectExercises": "اگر می‌خواهید مجموعه ای از حرکات را انجام دهید، می‌توانید چندین تمرین را جستجو کنید، آنها در یک گروه قرار می‌گیرند",
"@selectExercises": {},
"gymMode": "حالت باشگاه",
"@gymMode": {
"description": "Label when starting the gym mode"
},
"plateCalculator": "دیسک ها",
"@plateCalculator": {
"description": "Label used for the plate calculator in the gym mode"
},
"plateCalculatorNotDivisible": "با دیسک های موجود نمی‌توان به وزن دلخواه رسید",
"@plateCalculatorNotDivisible": {
"description": "Error message when the current weight is not reachable with plates (e.g. 33.1 kg)"
},
"pause": "توقف",
"@pause": {
"description": "Noun, not an imperative! Label used for the pause when using the gym mode"
},
"jumpTo": "برو به",
"@jumpTo": {
"description": "Imperative. Label used in popup allowing the user to jump to a specific exercise while in the gym mode"
},
"todaysWorkout": "تمرین ورزشی امروز شما",
"@todaysWorkout": {},
"logHelpEntries": "اگر در یک روز واحد بیش از یک ورودی با همان تعداد تکرارها وجود داشته باشد ، اما وزنهای مختلف ، فقط ورودی با وزن بالاتر در نمودار نشان داده می شود.",
"@logHelpEntries": {},
"logHelpEntriesUnits": "توجه داشته باشید که فقط ورودی هایی با واحد وزنی (کیلوگرم یا پوند) و تکرارها نمودار می شوند ، ترکیبات دیگری مانند زمان یا تا زمان خستگی در اینجا نادیده گرفته می شوند.",
"@logHelpEntriesUnits": {},
"description": "توضیحات",
"@description": {},
"name": "نام",
"@name": {
"description": "Name for a workout or nutritional plan"
},
"save": "ذخیره",
"@save": {},
"verify": "تأیید کردن",
"@verify": {},
"addSet": "افزودن مجموعه",
"@addSet": {
"description": "Label for the button that adds a set (to a workout day)"
},
"addMeal": "افزودن وعده",
"@addMeal": {},
"mealLogged": "غذا به دفتر گزارشات وارد شد",
"@mealLogged": {},
"ingredientLogged": "مواد به دفتر گزارشات وارد شد",
"@ingredientLogged": {},
"logMeal": "افزودن وعده به دفتر گزارشات غذایی",
"@logMeal": {},
"addIngredient": "افزودن مواد تشکیل دهنده",
"@addIngredient": {},
"logIngredient": "افزودن مواد تشکیل دهنده به دفتر گزارشات غذایی",
"@logIngredient": {},
"searchIngredient": "جستجو مواد تشکیل دهنده",
"@searchIngredient": {
"description": "Label on ingredient search form"
},
"nutritionalDiary": "دفتر گزارشات غذایی",
"@nutritionalDiary": {},
"nutritionalPlans": "برنامه های غذایی",
"@nutritionalPlans": {},
"noNutritionalPlans": "شما هیچ برنامه غذایی ندارید",
"@noNutritionalPlans": {
"description": "Message shown when the user has no nutritional plans"
},
"onlyLogging": "فقط کالری را شمارش کردن",
"@onlyLogging": {},
"onlyLoggingHelpText": "اگر فقط می خواهید کالری خود را گزارش کنید و نمی خواهید یک برنامه غذایی دقیق را با وعده های غذایی خاص تنظیم کنید ، کادر را تیک بزنید",
"@onlyLoggingHelpText": {},
"goalMacro": "اهداف مواد مغذی",
"@goalMacro": {
"description": "The goal for macronutrients"
},
"selectMealToLog": "یک وعده انتخاب کنید تا به گزارشات اضافه شود",
"@selectMealToLog": {},
"yourCurrentNutritionPlanHasNoMealsDefinedYet": "در برنامه غذایی فعلی شما هیچ وعده ای تعریف نشده است",
"@yourCurrentNutritionPlanHasNoMealsDefinedYet": {
"description": "Message shown when a nutrition plan doesn't have any meals"
},
"toAddMealsToThePlanGoToNutritionalPlanDetails": "برای افزودن وعده های غذایی به برنامه ، به جزئیات برنامه غذایی بروید",
"@toAddMealsToThePlanGoToNutritionalPlanDetails": {
"description": "Message shown to guide users to the nutritional plan details page to add meals"
},
"goalEnergy": "هدف انرژی",
"@goalEnergy": {},
"goalProtein": "هدف پروتئینی",
"@goalProtein": {},
"goalCarbohydrates": "هدف کربوهیدراتی",
"@goalCarbohydrates": {},
"goalFat": "هدف چربی",
"@goalFat": {},
"goalFiber": "هدف فیبری",
"@goalFiber": {},
"anErrorOccurred": "خطایی رخ داد!",
"@anErrorOccurred": {},
"errorInfoDescription": "متأسفیم ، اما مشکلی پیش آمد. شما می توانید با گزارش آن در GitHub به ما در رفع این مشکل کمک کنید.",
"@errorInfoDescription": {},
"errorInfoDescription2": "شما می توانید به استفاده از برنامه ادامه دهید ، اما برخی از ویژگی ها ممکن است کار نکند.",
"@errorInfoDescription2": {},
"errorViewDetails": "جزئیات فنی",
"@errorViewDetails": {},
"applicationLogs": "گزارشات اپلیکیشن",
"@applicationLogs": {},
"errorCouldNotConnectToServer": "اتصال به سرور امکان پذیر نیست",
"@errorCouldNotConnectToServer": {},
"errorCouldNotConnectToServerDetails": "برنامه نمی تواند به سرور وصل شود. لطفاً اتصال اینترنت یا URL سرور خود را بررسی کرده و دوباره امتحان کنید. اگر مشکل ادامه پیدا کرد، با مدیر سرور تماس بگیرید.",
"@errorCouldNotConnectToServerDetails": {},
"copyToClipboard": "کپی در کلیپ بورد",
"@copyToClipboard": {},
"weight": "وزن",
"@weight": {
"description": "The weight of a workout log or body weight entry"
},
"min": "حداقل",
"@min": {},
"max": "حداکثر",
"@max": {},
"chartAllTimeTitle": "نمودار کلی {name}",
"@chartAllTimeTitle": {
"description": "All-time chart of 'name' (e.g. 'weight', 'body fat' etc.)",
"type": "text",
"placeholders": {
"name": {
"type": "String"
}
}
},
"chart30DaysTitle": "نمودار 30 روزه {name}",
"@chart30DaysTitle": {
"description": "last 30 days chart of 'name' (e.g. 'weight', 'body fat' etc.)",
"type": "text",
"placeholders": {
"name": {
"type": "String"
}
}
},
"chartDuringPlanTitle": "نمودار {chartName} در برنامه {planName}",
"@chartDuringPlanTitle": {
"description": "chart of 'chartName' (e.g. 'weight', 'body fat' etc.) logged during plan",
"type": "text",
"placeholders": {
"chartName": {
"type": "String"
},
"planName": {
"type": "String"
}
}
},
"measurement": "اندازه گیری",
"@measurement": {},
"measurements": "اندازه گیری ها",
"@measurements": {
"description": "Categories for the measurements such as biceps size, body fat, etc."
},
"measurementCategoriesHelpText": "دسته اندازه گیری ، مانند \"دوسر\" یا \"چربی بدن\"",
"@measurementCategoriesHelpText": {},
"measurementEntriesHelpText": "واحد مورد استفاده برای اندازه گیری دسته مانند \"سانتی متر\" یا \"٪\"",
"@measurementEntriesHelpText": {},
"creationDate": "تاریخ شروع",
"@creationDate": {
"description": "The Start date of a nutritional plan"
},
"endDate": "تاریخ پایان",
"@endDate": {
"description": "The End date of a nutritional plan"
},
"openEnded": "پایان باز",
"@openEnded": {
"description": "When a nutrition plan has no pre-defined end date"
},
"time": "زمان",
"@time": {
"description": "The time of a meal or workout"
},
"timeStart": "زمان شروع",
"@timeStart": {
"description": "The starting time of a workout"
},
"timeEnd": "زمان پایان",
"@timeEnd": {
"description": "The end time of a workout"
},
"timeStartAhead": "زمان شروع نمیتواند جلوتر از زمان پایان باشد",
"@timeStartAhead": {},
"ingredient": "مواد تشکیل دهنده",
"@ingredient": {},
"energy": "انرژی",
"@energy": {
"description": "Energy in a meal, ingredient etc. e.g. in kJ"
},
"barWeight": "وزن میله",
"@barWeight": {},
"exercise": "تمرین",
"@exercise": {
"description": "An exercise for a workout"
},
"unit": "واحد",
"@unit": {
"description": "The unit used for a repetition (kg, time, etc.)"
},
"exercises": "تمرین ها",
"@exercises": {
"description": "Multiple exercises for a workout"
},
"exerciseName": "نام تمرین",
"@exerciseName": {
"description": "Label for the name of a workout exercise"
},
"searchExercise": "تمرین را برای افزودن جستجو کنید",
"@searchExercise": {
"description": "Label on set form. Selected exercises are added to the set"
},
"noIngredientsDefined": "هنوز هیچ مواد تشکیل دهنده ای تعریف نشده",
"@noIngredientsDefined": {},
"noMatchingExerciseFound": "هیچ تمرین مطابقی پیدا نشد",
"@noMatchingExerciseFound": {
"description": "Message returned if no exercises match the searched string"
},
"searchNamesInEnglish": "اسامی را به زبان انگلیسی هم جستجو کنید",
"@searchNamesInEnglish": {},
"equipment": "تجهیزات",
"@equipment": {
"description": "Equipment needed to perform an exercise"
}
}

View File

@@ -354,6 +354,26 @@
"@addImage": {},
"gallery": "Galerie",
"@gallery": {},
"imageFormatNotSupported": "{imageFormat} non pris en charge",
"@imageFormatNotSupported": {
"description": "Label shown on the error container when image format is not supported",
"type": "text",
"placeholders": {
"imageFormat": {
"type": "String"
}
}
},
"imageFormatNotSupportedDetail": "{imageFormat} non pris en charge",
"@imageFormatNotSupportedDetail": {
"description": "Label shown on the image preview container when image format is not supported",
"type": "text",
"placeholders": {
"imageFormat": {
"type": "String"
}
}
},
"chooseFromLibrary": "Choisir depuis la bibliothèque",
"@chooseFromLibrary": {},
"takePicture": "Prendre une photo",
@@ -1016,5 +1036,95 @@
"endDate": "Date de fin",
"@endDate": {},
"startDate": "Date de début",
"@startDate": {}
"@startDate": {},
"dayTypeCustom": "Personnalisé",
"@dayTypeCustom": {},
"dayTypeEnom": "Un mouvement par minute",
"@dayTypeEnom": {},
"dayTypeAmrap": "Autant de rounds que possible",
"@dayTypeAmrap": {},
"dayTypeHiit": "Entraînement fractionné de haute intensité",
"@dayTypeHiit": {},
"dayTypeTabata": "Tabata",
"@dayTypeTabata": {},
"dayTypeEdt": "Entraînement à densité croissante",
"@dayTypeEdt": {},
"dayTypeAfap": "Aussi vite que possible",
"@dayTypeAfap": {},
"slotEntryTypeNormal": "Normal",
"@slotEntryTypeNormal": {},
"slotEntryTypeDropset": "Dropset",
"@slotEntryTypeDropset": {},
"slotEntryTypeMyo": "Myo",
"@slotEntryTypeMyo": {},
"slotEntryTypePartial": "Partiel",
"@slotEntryTypePartial": {},
"slotEntryTypeForced": "Forcé",
"@slotEntryTypeForced": {},
"slotEntryTypeTut": "Temps sous tension",
"@slotEntryTypeTut": {},
"slotEntryTypeIso": "Maintien isométrique",
"@slotEntryTypeIso": {},
"slotEntryTypeJump": "Saut",
"@slotEntryTypeJump": {},
"applicationLogs": "Journaux d'application",
"@applicationLogs": {},
"openEnded": "Sans date de fin",
"@openEnded": {
"description": "When a nutrition plan has no pre-defined end date"
},
"overview": "Aperçu",
"@overview": {},
"identicalExercisePleaseDiscard": "Si vous remarquez un exercice identique à celui que vous ajoutez, veuillez supprimer votre brouillon et modifier cet exercice à la place.",
"@identicalExercisePleaseDiscard": {},
"checkInformationBeforeSubmitting": "Veuillez vérifier que les informations que vous avez saisies sont correctes avant de soumettre l'exercice",
"@checkInformationBeforeSubmitting": {},
"imageDetailsTitle": "Détails de l'image",
"@imageDetailsTitle": {
"description": "Title for image details form"
},
"dayTypeRft": "Rounds for time",
"@dayTypeRft": {},
"imageDetailsLicenseTitle": "Valeur de l'attribut \"title\" de l'image",
"@imageDetailsLicenseTitle": {
"description": "Label for image title field"
},
"imageDetailsLicenseTitleHint": "Saisir la valeur de l'attribut \"title\" de l'image",
"@imageDetailsLicenseTitleHint": {
"description": "Hint text for image title field"
},
"imageDetailsSourceLink": "Lien vers le site internet source",
"@imageDetailsSourceLink": {
"description": "Label for source link field"
},
"author": "Auteur(s)",
"@author": {},
"authorHint": "Saisir le nom de l'auteur",
"@authorHint": {
"description": "Hint text for author field"
},
"imageDetailsAuthorLink": "Lien vers le site internet de l'auteur ou de son profil",
"@imageDetailsAuthorLink": {
"description": "Label for author link field"
},
"imageDetailsDerivativeSource": "Lien vers la source originale, s'il s'agit d'une œuvre dérivée",
"@imageDetailsDerivativeSource": {
"description": "Label for derivative source field"
},
"imageDetailsDerivativeHelp": "Une œuvre dérivée est basée sur une œuvre antérieure mais contient suffisamment de contenu nouveau et créatif pour lui donner droit à son propre droit d’auteur.",
"@imageDetailsDerivativeHelp": {
"description": "Helper text explaining derivative works"
},
"imageDetailsImageType": "Type de l'image",
"@imageDetailsImageType": {
"description": "Label for image type selector"
},
"imageDetailsLicenseNotice": "En soumettant cette image, vous acceptez sa publication sous licence CC-BY-SA-4. L'image doit être votre propre création ou son auteur doit l'avoir publiée sous une licence compatible.",
"@imageDetailsLicenseNotice": {},
"imageDetailsLicenseNoticeLinkToLicense": "Voir le texte de la licence.",
"@imageDetailsLicenseNoticeLinkToLicense": {},
"enterTextInLanguage": "Veuillez saisir le texte dans la bonne langue !",
"@enterTextInLanguage": {},
"endWorkout": "Terminer l'entraînement",
"@endWorkout": {}
}

View File

@@ -31,15 +31,15 @@
},
"email": "E-mail adresa",
"@email": {},
"invalidUrl": "Upiši važeći URL",
"invalidUrl": "Upiši valjanu URL adresu",
"@invalidUrl": {
"description": "Error message when the user enters an invalid URL, e.g. in the login form"
},
"useCustomServer": "Koristi prilagođeni poslužitelj",
"useCustomServer": "Koristi prilagođeni server",
"@useCustomServer": {
"description": "Toggle button allowing users to switch between the default and a custom wger server"
},
"invalidUsername": "Upiši važeće korisničko ime",
"invalidUsername": "Upiši valjano korisničko ime",
"@invalidUsername": {
"description": "Error message when the user enters an invalid username"
},
@@ -47,7 +47,7 @@
"@customServerUrl": {
"description": "Label in the form where the users can enter their own wger instance"
},
"customServerHint": "Upiši adresu tvog poslužitelja, inače će se koristiti zadani",
"customServerHint": "Upiši adresu tvog servera, inače će se koristiti standardni",
"@customServerHint": {
"description": "Hint text for the form where the users can enter their own wger instance"
},
@@ -205,7 +205,7 @@
"@selectExercise": {
"description": "Error message when the user hasn't selected an exercise in the form"
},
"enterCharacters": "Upiši {min} do {max} znakova",
"enterCharacters": "Upiši između {min} do {max} znaka",
"@enterCharacters": {
"description": "Error message when the user hasn't entered the correct number of characters in a form",
"type": "text",
@@ -233,7 +233,7 @@
"description": "Label shown on the slider where the user can toggle showing units and RiR",
"type": "text"
},
"enterValidNumber": "Upiši važeći broj",
"enterValidNumber": "Upiši valjani broj",
"@enterValidNumber": {
"description": "Error message when the user has submitted an invalid number (e.g. '3,.,.,.')"
},
@@ -261,7 +261,7 @@
"@dataCopied": {
"description": "Snackbar message to show on copying data to a new log entry"
},
"usernameValidChars": "Korisničko ime može sadržavati samo slova, brojeve i sljedeće znakove: @, +, ., -, _",
"usernameValidChars": "Korisničko ime smije sadržavati samo slova, brojeve i sljedeće znakove: @, +, ., -, _",
"@usernameValidChars": {
"description": "Error message when the user tries to register a username with forbidden characters"
},
@@ -275,7 +275,7 @@
"@addMeal": {},
"nutritionalPlan": "Plan prehrane",
"@nutritionalPlan": {},
"useDefaultServer": "Koristi zadani poslužitelj",
"useDefaultServer": "Koristi standardni server",
"@useDefaultServer": {
"description": "Toggle button allowing users to switch between the default and a custom wger server"
},
@@ -461,7 +461,7 @@
"@weightUnit": {},
"appUpdateTitle": "Potrebna je nova verzija",
"@appUpdateTitle": {},
"appUpdateContent": "Ova verzija aplikacije nije kompatibilna s poslužiteljem. Aktualiziraj svoju aplikaciju.",
"appUpdateContent": "Ova verzija aplikacije nije kompatibilna sa serverom. Aktualiziraj svoju aplikaciju.",
"@appUpdateContent": {},
"set": "Serija",
"@set": {
@@ -519,7 +519,7 @@
"@close": {
"description": "Translation for close"
},
"enterMinCharacters": "Upiši barem {min} znakova",
"enterMinCharacters": "Upiši barem {min} znaka",
"@enterMinCharacters": {
"description": "Error message when the user hasn't entered the minimum amount characters in a form",
"type": "text",
@@ -608,7 +608,7 @@
"@verifiedEmail": {},
"unVerifiedEmail": "Nepotvrđena e-mail adresa",
"@unVerifiedEmail": {},
"verifiedEmailInfo": "E-mail poruka za potvrdu je poslana na {email}",
"verifiedEmailInfo": "E-mail za ovjeru je poslan na {email}",
"@verifiedEmailInfo": {
"placeholders": {
"email": {
@@ -634,7 +634,7 @@
"@cardio": {
"description": "Generated entry for translation for server strings"
},
"quads": "Ekstenzije nogu",
"quads": "Kvadriceps",
"@quads": {
"description": "Generated entry for translation for server strings"
},
@@ -658,7 +658,7 @@
"@until_failure": {
"description": "Generated entry for translation for server strings"
},
"none__bodyweight_exercise_": "ništa (vježba za tjelesnu težinu)",
"none__bodyweight_exercise_": "bez (vježba za tjelesnu težinu)",
"@none__bodyweight_exercise_": {
"description": "Generated entry for translation for server strings"
},
@@ -710,7 +710,7 @@
"@kg": {
"description": "Generated entry for translation for server strings"
},
"lb": "funta",
"lb": "lb",
"@lb": {
"description": "Generated entry for translation for server strings"
},
@@ -718,7 +718,7 @@
"@searchNamesInEnglish": {},
"language": "Jezik",
"@language": {},
"aboutPageTitle": "Wger informacije",
"aboutPageTitle": "O nama i podrška",
"@aboutPageTitle": {},
"abs": "Trbuh",
"@abs": {
@@ -788,7 +788,7 @@
},
"aboutDonateTitle": "Doniraj",
"@aboutDonateTitle": {},
"aboutDonateText": "Pomogni projektu: kupi nam kavu, plati troškove poslužitelja i potiči nas u našem radu",
"aboutDonateText": "Iako je projekt besplatan i uvijek će to ostati, održavanje servera nije! Razvoj također zahtijeva značajno vrijeme i trud volontera. Tvoj doprinos izravno podupire te troškove i pomaže u održavanju pouzdanosti usluge.",
"@aboutDonateText": {},
"settingsTitle": "Postavke",
"@settingsTitle": {},
@@ -866,7 +866,7 @@
"@goalMacro": {
"description": "The goal for macronutrients"
},
"selectMealToLog": "Odaberi obrok za zapis u dnevnik",
"selectMealToLog": "Odaberi obrok za zapisivanje u dnevnik",
"@selectMealToLog": {},
"ingredientLogged": "Sastojak je upisan u dnevnik",
"@ingredientLogged": {},
@@ -880,15 +880,15 @@
"@goalTypeMeals": {
"description": "added for localization of Class GoalType's filed meals"
},
"goalTypeBasic": "Osnovni",
"goalTypeBasic": "Osnovno",
"@goalTypeBasic": {
"description": "added for localization of Class GoalType's filed basic"
},
"goalTypeAdvanced": "Napredni",
"goalTypeAdvanced": "Napredno",
"@goalTypeAdvanced": {
"description": "added for localization of Class GoalType's filed advanced"
},
"indicatorRaw": "sirovo",
"indicatorRaw": "neobrađeno",
"@indicatorRaw": {
"description": "added for localization of Class Indicator's field text"
},
@@ -914,7 +914,7 @@
}
}
},
"chartDuringPlanTitle": "{chartName} tijekom prehrambenog plana {planName}",
"chartDuringPlanTitle": "{chartName} tijekom plana prehrane {planName}",
"@chartDuringPlanTitle": {
"description": "chart of 'chartName' (e.g. 'weight', 'body fat' etc.) logged during plan",
"type": "text",
@@ -951,24 +951,244 @@
"@useUsernameAndPassword": {},
"apiToken": "API Token",
"@apiToken": {},
"invalidApiToken": "Molimo provjerite API Token",
"invalidApiToken": "Upiši valjani API ključ",
"@invalidApiToken": {
"description": "Error message when the user enters an invalid API key"
},
"apiTokenValidChars": "API Token može sadržavati a-f, brojeve od 0-9 i mora biti točno 40 znakova dugačak.",
"apiTokenValidChars": "API ključ može sadržati slova a-f, brojke od 0-9 i mora imati točno 40 znakova",
"@apiTokenValidChars": {
"description": "Error message when the user tries to input a API key with forbidden characters"
},
"routines": "Rutina",
"routines": "Rutine",
"@routines": {},
"newRoutine": "Nova rutina",
"@newRoutine": {},
"noRoutines": "Vi nemate rutine",
"noRoutines": "Ti nemaš rutine",
"@noRoutines": {},
"restTime": "Period odmora",
"restTime": "Vrijeme odmora",
"@restTime": {},
"sets": "Vježba ima setova",
"sets": "Serije",
"@sets": {
"description": "The number of sets to be done for one exercise"
}
},
"min": "Min.",
"@min": {},
"max": "Maks.",
"@max": {},
"dayTypeAfap": "Što brže moguće",
"@dayTypeAfap": {},
"slotEntryTypeNormal": "Normalno",
"@slotEntryTypeNormal": {},
"slotEntryTypePartial": "Djelomično",
"@slotEntryTypePartial": {},
"slotEntryTypeForced": "Prisiljeno",
"@slotEntryTypeForced": {},
"aboutTranslationListTitle": "Prevedi aplikaciju",
"@aboutTranslationListTitle": {},
"aboutSourceListTitle": "Prikaži izvorni kod",
"@aboutSourceListTitle": {},
"aboutJoinCommunityTitle": "Pridruži se zajednici",
"@aboutJoinCommunityTitle": {},
"aboutDiscordTitle": "Discord",
"@aboutDiscordTitle": {},
"others": "Drugi",
"@others": {},
"resultingRoutine": "Rezultirajuća rutina",
"@resultingRoutine": {},
"restDay": "Dan odmora",
"@restDay": {},
"isRestDay": "Je dan odmora",
"@isRestDay": {},
"progressionRules": "Ova vježba ima pravila napredovanja i ne može se uređivati u mobilnoj aplikaciji. Za uređivanje ove vježbe koristi web aplikaciju.",
"@progressionRules": {},
"needsLogsToAdvance": "Treba dnevnike za nastavljanje",
"@needsLogsToAdvance": {},
"slotEntryTypeTut": "Vrijeme pod napetošću",
"@slotEntryTypeTut": {},
"slotEntryTypeIso": "Izometrijsko držanje",
"@slotEntryTypeIso": {},
"slotEntryTypeJump": "Skok",
"@slotEntryTypeJump": {},
"dayTypeCustom": "Prilagođeno",
"@dayTypeCustom": {},
"dayTypeEnom": "Svake minute u minuti",
"@dayTypeEnom": {},
"startDate": "Datum početka",
"@startDate": {
"description": "The start date of a nutritional plan or routine"
},
"dayTypeRft": "Runde za vrijeme",
"@dayTypeRft": {},
"dayTypeAmrap": "Što više rundi",
"@dayTypeAmrap": {},
"dayTypeHiit": "Trening visokog intenziteta u intervalima",
"@dayTypeHiit": {},
"dayTypeTabata": "Tabata",
"@dayTypeTabata": {},
"simpleMode": "Jednostavni modus",
"@simpleMode": {},
"dayTypeEdt": "Trening s postupnim povećanjem ponavljanja/serija",
"@dayTypeEdt": {},
"slotEntryTypeDropset": "Drop set (serije sa smanjivanjem težine)",
"@slotEntryTypeDropset": {},
"slotEntryTypeMyo": "Myo (intenzivnije aktiviranje mišićnih vlakana)",
"@slotEntryTypeMyo": {},
"yourCurrentNutritionPlanHasNoMealsDefinedYet": "Tvoj trenutačni plan prehrane nema definirane obroke",
"@yourCurrentNutritionPlanHasNoMealsDefinedYet": {
"description": "Message shown when a nutrition plan doesn't have any meals"
},
"toAddMealsToThePlanGoToNutritionalPlanDetails": "Za dodavanje obroka u plan, idi na detalje plana prehrane",
"@toAddMealsToThePlanGoToNutritionalPlanDetails": {
"description": "Message shown to guide users to the nutritional plan details page to add meals"
},
"resistance_band": "Elastična vrpca",
"@resistance_band": {
"description": "Generated entry for translation for server strings"
},
"aboutWhySupportTitle": "Otvoreni kod i besplatno ❤️",
"@aboutWhySupportTitle": {},
"addSuperset": "Dodaj super-seriju",
"@addSuperset": {},
"setHasProgression": "Serija ima napredovanje",
"@setHasProgression": {},
"setHasProgressionWarning": "Imaj na umu da trenutačno nije moguće urediti sve postavke za serije na mobilnoj aplikaciji ili konfigurirati automatsko napredovanje. Za sada koristi web aplikaciju.",
"@setHasProgressionWarning": {},
"fitInWeek": "Prilagodi u tjedan",
"@fitInWeek": {},
"fitInWeekHelp": "Ako je aktivirano, dani će se ponavljati u tjednom ciklusu, inače će dani slijediti uzastopno bez obzira na početak novog tjedna.",
"@fitInWeekHelp": {},
"setHasNoExercises": "Ova serija još nema vježbe!",
"@setHasNoExercises": {},
"exerciseNr": "Vježba {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": {
"type": "String"
}
}
},
"supersetNr": "Super-serija {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"
}
}
},
"isRestDayHelp": "Imaj na umu da će se sve serije i vježbe ukloniti kada označiš dan kao dan odmora.",
"@isRestDayHelp": {},
"needsLogsToAdvanceHelp": "Odaberi želiš li da se rutina nastavi na sljedeći zakazani dan, samo ako si za taj dan zapisao/la trening",
"@needsLogsToAdvanceHelp": {},
"routineDays": "Dani u rutini",
"@routineDays": {},
"errorInfoDescription": "Žao nam je, dogodila se greška. Možeš nam pomoći to popraviti prijavom problema na GitHub-u.",
"@errorInfoDescription": {},
"errorInfoDescription2": "Možeš nastaviti koristiti aplikaciju, ali neke funkcije možda neće raditi.",
"@errorInfoDescription2": {},
"errorViewDetails": "Tehnički detalji",
"@errorViewDetails": {},
"applicationLogs": "Dnevnici aplikacije",
"@applicationLogs": {},
"errorCouldNotConnectToServer": "Neuspjelo povezivanje sa serverom",
"@errorCouldNotConnectToServer": {},
"errorCouldNotConnectToServerDetails": "Aplikacija se nije mogla povezati sa serverom. Provjeri internetsku vezu ili URL servera i pokušaj ponovo. Ako problem ne nestane, obrati se administratoru servera.",
"@errorCouldNotConnectToServerDetails": {},
"copyToClipboard": "Kopiraj u međuspremnik",
"@copyToClipboard": {},
"endDate": "Datum kraja",
"@endDate": {
"description": "The End date of a nutritional plan or routine"
},
"openEnded": "Bez datuma kraja",
"@openEnded": {
"description": "When a nutrition plan has no pre-defined end date"
},
"overview": "Pregled",
"@overview": {},
"aboutContributeTitle": "Doprinesi",
"@aboutContributeTitle": {},
"aboutContributeText": "Sve vrste doprinosa su dobrodošle. Bilo da si programer, prevoditelj ili jednostavno strastveni ljubitelj fitnessa, svaka podrška je dobrodošla!",
"@aboutContributeText": {},
"aboutBugsListTitle": "Prijavi problem ili predloži funkciju",
"@aboutBugsListTitle": {},
"identicalExercisePleaseDiscard": "Ako primijetiš vježbu koja je identična onoj koju dodaješ, odbaci svoju vježbu i umjesto toga uredi tu vježbu.",
"@identicalExercisePleaseDiscard": {},
"checkInformationBeforeSubmitting": "Provjeri točnost tvojih unesenih podataka prije slanja vježbe",
"@checkInformationBeforeSubmitting": {},
"imageDetailsTitle": "Detalji slike",
"@imageDetailsTitle": {
"description": "Title for image details form"
},
"imageDetailsLicenseTitle": "Naslov",
"@imageDetailsLicenseTitle": {
"description": "Label for image title field"
},
"imageDetailsLicenseTitleHint": "Upiši naslov slike",
"@imageDetailsLicenseTitleHint": {
"description": "Hint text for image title field"
},
"imageDetailsSourceLink": "Poveznica na izvornu web-stranicu",
"@imageDetailsSourceLink": {
"description": "Label for source link field"
},
"author": "Autori",
"@author": {},
"authorHint": "Upiši ime autora",
"@authorHint": {
"description": "Hint text for author field"
},
"imageDetailsAuthorLink": "Poveznica na web-stranicu ili profil autora",
"@imageDetailsAuthorLink": {
"description": "Label for author link field"
},
"imageDetailsDerivativeSource": "Poveznica na izvorni izvor, ako je ovo izvedeno djelo",
"@imageDetailsDerivativeSource": {
"description": "Label for derivative source field"
},
"imageDetailsDerivativeHelp": "Izvedeno djelo se temelji na prethodnom djelu, ali sadrži dovoljno novog, kreativnog sadržaja da bi mu se dalo pravo na vlastita autorska prava.",
"@imageDetailsDerivativeHelp": {
"description": "Helper text explaining derivative works"
},
"imageDetailsImageType": "Vrsta slike",
"@imageDetailsImageType": {
"description": "Label for image type selector"
},
"imageDetailsLicenseNotice": "Slanjem ove slike pristaješ na njezino objavljivanje pod licencom CC-BY-SA-4. Slika mora biti tvoje vlastito djelo ili ju je autor morao objaviti pod s njom kompatibilnom licencom.",
"@imageDetailsLicenseNotice": {},
"imageDetailsLicenseNoticeLinkToLicense": "Pogledaj tekst licence.",
"@imageDetailsLicenseNoticeLinkToLicense": {},
"imageFormatNotSupported": "{imageFormat} nije podržani format",
"@imageFormatNotSupported": {
"description": "Label shown on the error container when image format is not supported",
"type": "text",
"placeholders": {
"imageFormat": {
"type": "String"
}
}
},
"imageFormatNotSupportedDetail": "{imageFormat} slike još nisu podržane.",
"@imageFormatNotSupportedDetail": {
"description": "Label shown on the image preview container when image format is not supported",
"type": "text",
"placeholders": {
"imageFormat": {
"type": "String"
}
}
},
"add": "dodaj",
"@add": {
"description": "Add button text"
},
"enterTextInLanguage": "Upiši tekst u ispravnom jeziku!",
"@enterTextInLanguage": {},
"simpleModeHelp": "Sakrij neke naprednije postavke prilikom uređivanja vježbi",
"@simpleModeHelp": {},
"endWorkout": "Završi trening",
"@endWorkout": {}
}

View File

@@ -1076,5 +1076,29 @@
"aboutDiscordTitle": "Discord",
"@aboutDiscordTitle": {},
"fitInWeek": "Settimana Fit in",
"@fitInWeek": {}
"@fitInWeek": {},
"creationDate": "Data di inizio",
"@creationDate": {
"description": "The Start date of a nutritional plan"
},
"openEnded": "Senza fine",
"@openEnded": {
"description": "When a nutrition plan has no pre-defined end date"
},
"overview": "Panoramica",
"@overview": {},
"identicalExercisePleaseDiscard": "Se trovate un esercizio identico a quello che state cercando di aggiungere, per favore scartate la vostra bozza e se necessario modificate l'esercizio esistente.",
"@identicalExercisePleaseDiscard": {},
"checkInformationBeforeSubmitting": "Verificate che le informazioni siano corrette prima di aggiungere l'esercizio",
"@checkInformationBeforeSubmitting": {},
"enterTextInLanguage": "Aggiungete il testo usando la lingua giusta!",
"@enterTextInLanguage": {},
"applicationLogs": "Registri dell'applicazione",
"@applicationLogs": {},
"dayTypeCustom": "Personalizzato",
"@dayTypeCustom": {},
"dayTypeAfap": "Più velocemente possibile",
"@dayTypeAfap": {},
"dayTypeHiit": "Allenamento a intervalli ad alta intensità",
"@dayTypeHiit": {}
}

View File

@@ -473,6 +473,26 @@
"@chooseFromLibrary": {},
"gallery": "Gallery",
"@gallery": {},
"imageFormatNotSupported": "{imageFormat}はサポートされていません",
"@imageFormatNotSupported": {
"description": "Label shown on the error container when image format is not supported",
"type": "text",
"placeholders": {
"imageFormat": {
"type": "String"
}
}
},
"imageFormatNotSupportedDetail": "{imageFormat}形式の画像はまだサポートされていません。",
"@imageFormatNotSupportedDetail": {
"description": "Label shown on the image preview container when image format is not supported",
"type": "text",
"placeholders": {
"imageFormat": {
"type": "String"
}
}
},
"addImage": "Add image",
"@addImage": {},
"dataCopied": "Data copied to new entry",

View File

@@ -666,13 +666,13 @@
"@add_exercise_image_license": {},
"selectEntry": "Por favor selecione uma entrada",
"@selectEntry": {},
"cacheWarning": "Devido ao caching, pode levar algum tempo até que as alterações sejam visíveis em todo o aplicativo.",
"cacheWarning": "Devido ao \"caching\", pode levar algum tempo até que as alterações sejam visíveis em todo o aplicativo.",
"@cacheWarning": {},
"success": "Sucesso",
"@success": {
"description": "Message when an action completed successfully, usually used as a heading"
},
"contributeExerciseWarning": "Você só pode contribuir com exercícios se sua conta tiver mais de {days} dias e tiver verificado seu e-mail",
"contributeExerciseWarning": "Só podes contribuir com exercícios se a tua conta tiver mais de {days} dias e tiveres verificado o teu e-mail",
"@contributeExerciseWarning": {
"description": "Number of days before which a person can add exercise",
"placeholders": {
@@ -722,13 +722,13 @@
},
"settingsCacheTitle": "Cache",
"@settingsCacheTitle": {},
"settingsExerciseCacheDescription": "Cache do exercício",
"settingsExerciseCacheDescription": "Arquivo de exercícios",
"@settingsExerciseCacheDescription": {},
"useMetric": "Use unidades métricas para o peso corpora",
"@useMetric": {},
"settingsTitle": "Configurações",
"@settingsTitle": {},
"settingsCacheDeletedSnackbar": "Cache limpo com sucesso",
"settingsCacheDeletedSnackbar": "Cache limpa com sucesso",
"@settingsCacheDeletedSnackbar": {},
"log": "Log",
"@log": {
@@ -861,7 +861,7 @@
"@goalTypeAdvanced": {
"description": "added for localization of Class GoalType's filed advanced"
},
"indicatorRaw": "Crua",
"indicatorRaw": "Crú",
"@indicatorRaw": {
"description": "added for localization of Class Indicator's field text"
},
@@ -877,7 +877,7 @@
"@themeMode": {},
"darkMode": "Modo sempre escuro",
"@darkMode": {},
"settingsIngredientCacheDescription": "Princípio de cache",
"settingsIngredientCacheDescription": "Arquivo de ingredientes",
"@settingsIngredientCacheDescription": {},
"routines": "Rotinas",
"@routines": {},
@@ -981,7 +981,7 @@
"@setHasProgression": {},
"simpleMode": "Modo simples",
"@simpleMode": {},
"progressionRules": "Este exercíco tem regras de progressão e não pode ser editado na aplicação móvel. Por favor, usa a aplicação web para editar este exercício.",
"progressionRules": "Este exercício tem regras de progressão e não pode ser editado na aplicação móvel. Por favor, usa a aplicação web para editar este exercício.",
"@progressionRules": {},
"selectAvailablePlates": "Seleciona anilhas disponíveis",
"@selectAvailablePlates": {},
@@ -1010,5 +1010,27 @@
"setHasProgressionWarning": "Por favor, nota que, de momento, não é possível editar todos os valores para uma série na aplicação móvel ou configurar a progressão automática. Por agora, por favor, usa a aplicação web.",
"@setHasProgressionWarning": {},
"startDate": "Data de início",
"@startDate": {}
"@startDate": {},
"endDate": "Data de término",
"@endDate": {
"description": "The End date of a nutritional plan"
},
"applicationLogs": "Registos da aplicação",
"@applicationLogs": {},
"creationDate": "Data de início",
"@creationDate": {
"description": "The Start date of a nutritional plan"
},
"openEnded": "Sem fim definido",
"@openEnded": {
"description": "When a nutrition plan has no pre-defined end date"
},
"enterTextInLanguage": "Por favor, introduz o texto la linguagem correta!",
"@enterTextInLanguage": {},
"checkInformationBeforeSubmitting": "Por favor, verifica que a informação introduzida está correta antes de submeter o exercício",
"@checkInformationBeforeSubmitting": {},
"identicalExercisePleaseDiscard": "Se encontrares um exercício igual ao que estás a introduzir, por favor descarta o teu rascunho e edita antes esse exercício.",
"@identicalExercisePleaseDiscard": {},
"overview": "Panorama",
"@overview": {}
}

View File

@@ -1068,5 +1068,11 @@
"lightMode": "Sempre modo claro",
"@lightMode": {},
"systemMode": "Configurações do sistema",
"@systemMode": {}
"@systemMode": {},
"endDate": "Data final",
"@endDate": {
"description": "The End date of a nutritional plan"
},
"startDate": "Data inicial",
"@startDate": {}
}

File diff suppressed because it is too large Load Diff

View File

@@ -1 +1,128 @@
{}
{
"userProfile": "โปรไฟล์ของคุณ",
"@userProfile": {},
"login": "เข้าสู่ระบบ",
"@login": {
"description": "Text for login button"
},
"logout": "ออกจากระบบ",
"@logout": {
"description": "Text for logout button"
},
"register": "ลงทะเบียน",
"@register": {
"description": "Text for registration button"
},
"useDefaultServer": "ใช้เซิร์ฟเวอร์เริ่มต้น",
"@useDefaultServer": {
"description": "Toggle button allowing users to switch between the default and a custom wger server"
},
"useCustomServer": "ใช้เซิร์ฟเวอร์ที่กำหนดเอง",
"@useCustomServer": {
"description": "Toggle button allowing users to switch between the default and a custom wger server"
},
"invalidUrl": "กรุณาป้อน URL ที่ถูกต้อง",
"@invalidUrl": {
"description": "Error message when the user enters an invalid URL, e.g. in the login form"
},
"usernameValidChars": "ชื่อผู้ใช้สามารถประกอบด้วยตัวอักษร ตัวเลข และอักขระ @, +, ., - และ _ เท่านั้น",
"@usernameValidChars": {
"description": "Error message when the user tries to register a username with forbidden characters"
},
"passwordsDontMatch": "รหัสผ่านไม่ตรงกัน",
"@passwordsDontMatch": {
"description": "Error message when the user enters two different passwords during registration"
},
"passwordTooShort": "รหัสผ่านสั้นเกินไป",
"@passwordTooShort": {
"description": "Error message when the user a password that is too short"
},
"selectAvailablePlates": "เลือกแผ่นน้ำหนักที่มี",
"@selectAvailablePlates": {},
"barWeight": "น้ำหนัก Bar",
"@barWeight": {},
"password": "รหัสผ่าน",
"@password": {},
"confirmPassword": "ยืนยันรหัสผ่าน",
"@confirmPassword": {},
"invalidEmail": "กรุณากรอกที่อยู่อีเมลที่ถูกต้อง",
"@invalidEmail": {
"description": "Error message when the user enters an invalid email"
},
"email": "ที่อยู่อีเมล",
"@email": {},
"username": "ชื่อผู้ใช้",
"@username": {},
"invalidUsername": "กรุณากรอกชื่อผู้ใช้ที่ถูกต้อง",
"@invalidUsername": {
"description": "Error message when the user enters an invalid username"
},
"useApiToken": "ใช้โทเค็น API",
"@useApiToken": {},
"useUsernameAndPassword": "ใช้ชื่อผู้ใช้และรหัสผ่าน",
"@useUsernameAndPassword": {},
"apiToken": "โทเค็น API",
"@apiToken": {},
"invalidApiToken": "กรุณาป้อนรหัส API ที่ถูกต้อง",
"@invalidApiToken": {
"description": "Error message when the user enters an invalid API key"
},
"apiTokenValidChars": "คีย์ API จะต้องประกอบด้วยตัวอักษร a-f, ตัวเลข 0-9 และมีความยาว 40 อักขระเท่านั้น",
"@apiTokenValidChars": {
"description": "Error message when the user tries to input a API key with forbidden characters"
},
"customServerHint": "กรอกที่อยู่เซิร์ฟเวอร์ของคุณ มิฉะนั้นจะใช้ค่าเริ่มต้น",
"@customServerHint": {
"description": "Hint text for the form where the users can enter their own wger instance"
},
"reset": "รีเซ็ต",
"@reset": {
"description": "Button text allowing the user to reset the entered values to the default"
},
"registerInstead": "ยังไม่มีบัญชีใช่ไหม? ลงทะเบียนเลย",
"@registerInstead": {},
"loginInstead": "มีบัญชีอยู่แล้ว? เข้าสู่ระบบ",
"@loginInstead": {},
"labelBottomNavWorkout": "การออกกำลังกาย",
"@labelBottomNavWorkout": {
"description": "Label used in bottom navigation, use a short word"
},
"labelBottomNavNutrition": "โภชนาการ",
"@labelBottomNavNutrition": {
"description": "Label used in bottom navigation, use a short word"
},
"labelWorkoutLogs": "ข้อมูลการออกกำลังกาย",
"@labelWorkoutLogs": {
"description": "(Workout) logs"
},
"labelWorkoutPlan": "แผนการออกกำลังกาย",
"@labelWorkoutPlan": {
"description": "Title for screen workout plan"
},
"labelDashboard": "แดชบอร์ด",
"@labelDashboard": {
"description": "Title for screen dashboard"
},
"success": "สำเร็จ",
"@success": {
"description": "Message when an action completed successfully, usually used as a heading"
},
"successfullyDeleted": "ลบเรียบร้อย",
"@successfullyDeleted": {
"description": "Message when an item was successfully deleted"
},
"successfullySaved": "บันทึกสำเร็จ",
"@successfullySaved": {
"description": "Message when an item was successfully saved"
},
"exerciseList": "รายการการออกกำลังกาย",
"@exerciseList": {},
"exercise": "ออกกำลังกาย",
"@exercise": {
"description": "An exercise for a workout"
},
"exercises": "ออกกำลังกาย",
"@exercises": {
"description": "Multiple exercises for a workout"
}
}

View File

@@ -479,6 +479,26 @@
"@chooseFromLibrary": {},
"gallery": "Галерея",
"@gallery": {},
"imageFormatNotSupported": "{imageFormat} не підтримується",
"@imageFormatNotSupported": {
"description": "Label shown on the error container when image format is not supported",
"type": "text",
"placeholders": {
"imageFormat": {
"type": "String"
}
}
},
"imageFormatNotSupportedDetail": "Зображення {imageFormat} поки що не підтримуються.",
"@imageFormatNotSupportedDetail": {
"description": "Label shown on the image preview container when image format is not supported",
"type": "text",
"placeholders": {
"imageFormat": {
"type": "String"
}
}
},
"addImage": "Додати зображення",
"@addImage": {},
"dataCopied": "Дані скопійовано до нового запису",
@@ -1014,5 +1034,133 @@
"startDate": "Дата початку",
"@startDate": {},
"applicationLogs": "Журнали програм",
"@applicationLogs": {}
"@applicationLogs": {},
"creationDate": "Дата початку",
"@creationDate": {
"description": "The Start date of a nutritional plan"
},
"openEnded": "Відкритий",
"@openEnded": {
"description": "When a nutrition plan has no pre-defined end date"
},
"overview": "Огляд",
"@overview": {},
"identicalExercisePleaseDiscard": "Якщо ви помітили вправу, ідентичну тій, яку ви додаєте, будь ласка, відкиньте свій чернетку та відредагуйте цю вправу.",
"@identicalExercisePleaseDiscard": {},
"checkInformationBeforeSubmitting": "Будь ласка, перевірте правильність введеної вами інформації, перш ніж надсилати вправу",
"@checkInformationBeforeSubmitting": {},
"enterTextInLanguage": "Будь ласка, введіть текст правильною мовою!",
"@enterTextInLanguage": {},
"imageDetailsTitle": "Деталі зображення",
"@imageDetailsTitle": {
"description": "Title for image details form"
},
"imageDetailsLicenseTitle": "Назва",
"@imageDetailsLicenseTitle": {
"description": "Label for image title field"
},
"imageDetailsLicenseTitleHint": "Введіть назву зображення",
"@imageDetailsLicenseTitleHint": {
"description": "Hint text for image title field"
},
"imageDetailsSourceLink": "Посилання на веб-сайт джерела",
"@imageDetailsSourceLink": {
"description": "Label for source link field"
},
"imageDetailsAuthor": "Автор(и)",
"@imageDetailsAuthor": {
"description": "Label for author field"
},
"imageDetailsAuthorHint": "Введіть ім'я автора",
"@imageDetailsAuthorHint": {
"description": "Hint text for author field"
},
"imageDetailsAuthorLink": "Посилання на веб-сайт або профіль автора",
"@imageDetailsAuthorLink": {
"description": "Label for author link field"
},
"imageDetailsDerivativeSource": "Посилання на оригінальне джерело, якщо це похідний твір",
"@imageDetailsDerivativeSource": {
"description": "Label for derivative source field"
},
"imageDetailsDerivativeHelp": "Похідний твір базується на попередньому творі, але містить достатньо нового, творчого контенту, щоб мати право на власне авторське право.",
"@imageDetailsDerivativeHelp": {
"description": "Helper text explaining derivative works"
},
"imageDetailsImageType": "Тип зображення",
"@imageDetailsImageType": {
"description": "Label for image type selector"
},
"imageDetailsLicenseNoticePrefix": "Надсилаючи це зображення, ви погоджуєтеся на його публікацію відповідно до ",
"@imageDetailsLicenseNoticePrefix": {
"description": "First part of license notice text"
},
"imageDetailsLicenseNoticeSuffix": " Зображення має бути або вашою власною роботою, або автор має опублікувати його за ліцензією, сумісною з CC BY-SA 4.0.",
"@imageDetailsLicenseNoticeSuffix": {
"description": "Second part of license notice text"
},
"add": "додати",
"@add": {
"description": "Add button text"
},
"imageDetailsLicenseNotice": "Надсилаючи це зображення, ви погоджуєтеся на його розповсюдження за ліцензією CC-BY-SA-4. Зображення має бути або вашою власною роботою, або автор має опублікувати його за ліцензією, сумісною з нею.",
"@imageDetailsLicenseNotice": {},
"imageDetailsLicenseNoticeLinkToLicense": "Див. текст ліцензії.",
"@imageDetailsLicenseNoticeLinkToLicense": {},
"author": "Автор(и)",
"@author": {},
"authorHint": "Введіть ім'я автора",
"@authorHint": {
"description": "Hint text for author field"
},
"galleryImageTypeNotSupported": "Зображення типу {imageType} наразі не підтримуються на цій платформі.",
"@galleryImageTypeNotSupported": {
"placeholders": {
"imageType": {
"type": "String"
}
}
},
"galleryImageTypeNotSupportedDetail": "Це зображення у форматі {imageType}, який наразі не підтримується на цій платформі.",
"@galleryImageTypeNotSupportedDetail": {
"placeholders": {
"imageType": {
"type": "String"
}
}
},
"dayTypeCustom": "Користувацька",
"@dayTypeCustom": {},
"dayTypeEnom": "Кожну хвилину за хвилиною",
"@dayTypeEnom": {},
"dayTypeAmrap": "Якомога більше раундів",
"@dayTypeAmrap": {},
"dayTypeHiit": "Високоінтенсивне інтервальне тренування",
"@dayTypeHiit": {},
"dayTypeTabata": "Табата",
"@dayTypeTabata": {},
"dayTypeEdt": "Збільшення щільності навчання",
"@dayTypeEdt": {},
"dayTypeRft": "Раунди на час",
"@dayTypeRft": {},
"dayTypeAfap": "Якомога швидше",
"@dayTypeAfap": {},
"slotEntryTypeNormal": "Звичайний",
"@slotEntryTypeNormal": {},
"slotEntryTypeDropset": "Дропсет",
"@slotEntryTypeDropset": {},
"slotEntryTypeMyo": "Міо",
"@slotEntryTypeMyo": {},
"slotEntryTypePartial": "Часткове",
"@slotEntryTypePartial": {},
"slotEntryTypeForced": "Примусово",
"@slotEntryTypeForced": {},
"slotEntryTypeTut": "Час під Напруги",
"@slotEntryTypeTut": {},
"slotEntryTypeIso": "Ізометричне утримання",
"@slotEntryTypeIso": {},
"slotEntryTypeJump": "Стрибок",
"@slotEntryTypeJump": {},
"endWorkout": "Закінчити тренування",
"@endWorkout": {}
}

View File

@@ -146,8 +146,8 @@ class MainApp extends StatelessWidget {
future: auth.tryAutoLogin(),
builder: (ctx, authResultSnapshot) =>
authResultSnapshot.connectionState == ConnectionState.waiting
? const SplashScreen()
: const AuthScreen(),
? const SplashScreen()
: const AuthScreen(),
);
}
}

View File

@@ -41,10 +41,10 @@ class WeightEntry {
}
WeightEntry copyWith({int? id, int? weight, DateTime? date}) => WeightEntry(
id: id,
weight: weight ?? this.weight,
date: date ?? this.date,
);
id: id,
weight: weight ?? this.weight,
date: date ?? this.date,
);
// Boilerplate
factory WeightEntry.fromJson(Map<String, dynamic> json) => _$WeightEntryFromJson(json);

View File

@@ -7,10 +7,7 @@ part of 'weight_entry.dart';
// **************************************************************************
WeightEntry _$WeightEntryFromJson(Map<String, dynamic> json) {
$checkKeys(
json,
requiredKeys: const ['id', 'weight', 'date'],
);
$checkKeys(json, requiredKeys: const ['id', 'weight', 'date']);
return WeightEntry(
id: (json['id'] as num?)?.toInt(),
weight: stringToNum(json['weight'] as String?),
@@ -19,7 +16,7 @@ WeightEntry _$WeightEntryFromJson(Map<String, dynamic> json) {
}
Map<String, dynamic> _$WeightEntryToJson(WeightEntry instance) => <String, dynamic>{
'id': instance.id,
'weight': numToString(instance.weight),
'date': instance.date.toIso8601String(),
};
'id': instance.id,
'weight': numToString(instance.weight),
'date': instance.date.toIso8601String(),
};

View File

@@ -7,10 +7,7 @@ part of 'alias.dart';
// **************************************************************************
Alias _$AliasFromJson(Map<String, dynamic> json) {
$checkKeys(
json,
requiredKeys: const ['id', 'alias'],
);
$checkKeys(json, requiredKeys: const ['id', 'alias']);
return Alias(
id: (json['id'] as num?)?.toInt(),
translationId: (json['translation'] as num?)?.toInt(),
@@ -19,7 +16,7 @@ Alias _$AliasFromJson(Map<String, dynamic> json) {
}
Map<String, dynamic> _$AliasToJson(Alias instance) => <String, dynamic>{
'id': instance.id,
'translation': instance.translationId,
'alias': instance.alias,
};
'id': instance.id,
'translation': instance.translationId,
'alias': instance.alias,
};

View File

@@ -7,17 +7,11 @@ part of 'category.dart';
// **************************************************************************
ExerciseCategory _$ExerciseCategoryFromJson(Map<String, dynamic> json) {
$checkKeys(
json,
requiredKeys: const ['id', 'name'],
);
return ExerciseCategory(
id: (json['id'] as num).toInt(),
name: json['name'] as String,
);
$checkKeys(json, requiredKeys: const ['id', 'name']);
return ExerciseCategory(id: (json['id'] as num).toInt(), name: json['name'] as String);
}
Map<String, dynamic> _$ExerciseCategoryToJson(ExerciseCategory instance) => <String, dynamic>{
'id': instance.id,
'name': instance.name,
};
'id': instance.id,
'name': instance.name,
};

View File

@@ -7,10 +7,7 @@ part of 'comment.dart';
// **************************************************************************
Comment _$CommentFromJson(Map<String, dynamic> json) {
$checkKeys(
json,
requiredKeys: const ['id', 'comment'],
);
$checkKeys(json, requiredKeys: const ['id', 'comment']);
return Comment(
id: (json['id'] as num).toInt(),
translationId: (json['translation'] as num).toInt(),
@@ -19,7 +16,7 @@ Comment _$CommentFromJson(Map<String, dynamic> json) {
}
Map<String, dynamic> _$CommentToJson(Comment instance) => <String, dynamic>{
'id': instance.id,
'translation': instance.translationId,
'comment': instance.comment,
};
'id': instance.id,
'translation': instance.translationId,
'comment': instance.comment,
};

View File

@@ -7,10 +7,7 @@ part of 'equipment.dart';
// **************************************************************************
Equipment _$EquipmentFromJson(Map<String, dynamic> json) {
$checkKeys(
json,
requiredKeys: const ['id', 'name'],
);
$checkKeys(json, requiredKeys: const ['id', 'name']);
return Equipment(
id: (json['id'] as num).toInt(),
name: json['name'] as String,
@@ -18,6 +15,6 @@ Equipment _$EquipmentFromJson(Map<String, dynamic> json) {
}
Map<String, dynamic> _$EquipmentToJson(Equipment instance) => <String, dynamic>{
'id': instance.id,
'name': instance.name,
};
'id': instance.id,
'name': instance.name,
};

View File

@@ -144,11 +144,13 @@ class Exercise extends Equatable {
this.authorsGlobal = authorsGlobal ?? [];
}
bool get showPlateCalculator => equipment.map((e) => e.id).contains(ID_EQUIPMENT_BARBELL);
Exercise.fromApiDataString(String baseData, List<Language> languages)
: this.fromApiData(ExerciseApiData.fromString(baseData), languages);
: this.fromApiData(ExerciseApiData.fromString(baseData), languages);
Exercise.fromApiDataJson(Map<String, dynamic> baseData, List<Language> languages)
: this.fromApiData(ExerciseApiData.fromJson(baseData), languages);
: this.fromApiData(ExerciseApiData.fromJson(baseData), languages);
Exercise.fromApiData(ExerciseApiData exerciseData, List<Language> languages) {
id = exerciseData.id;
@@ -228,13 +230,13 @@ class Exercise extends Equatable {
@override
List<Object?> get props => [
id,
uuid,
created,
lastUpdate,
category,
equipment,
muscles,
musclesSecondary,
];
id,
uuid,
created,
lastUpdate,
category,
equipment,
muscles,
musclesSecondary,
];
}

View File

@@ -19,43 +19,46 @@ Exercise _$ExerciseFromJson(Map<String, dynamic> json) {
'category',
'muscles',
'muscles_secondary',
'equipment'
'equipment',
],
);
return Exercise(
id: (json['id'] as num?)?.toInt(),
uuid: json['uuid'] as String?,
created: json['created'] == null ? null : DateTime.parse(json['created'] as String),
lastUpdate: json['last_update'] == null ? null : DateTime.parse(json['last_update'] as String),
lastUpdateGlobal: json['last_update_global'] == null
? null
: DateTime.parse(json['last_update_global'] as String),
variationId: (json['variations'] as num?)?.toInt(),
translations: (json['translations'] as List<dynamic>?)
?.map((e) => Translation.fromJson(e as Map<String, dynamic>))
.toList(),
category: json['categories'] == null
? null
: ExerciseCategory.fromJson(json['categories'] as Map<String, dynamic>),
)
id: (json['id'] as num?)?.toInt(),
uuid: json['uuid'] as String?,
created: json['created'] == null ? null : DateTime.parse(json['created'] as String),
lastUpdate: json['last_update'] == null
? null
: DateTime.parse(json['last_update'] as String),
lastUpdateGlobal: json['last_update_global'] == null
? null
: DateTime.parse(json['last_update_global'] as String),
variationId: (json['variations'] as num?)?.toInt(),
translations: (json['translations'] as List<dynamic>?)
?.map((e) => Translation.fromJson(e as Map<String, dynamic>))
.toList(),
category: json['categories'] == null
? null
: ExerciseCategory.fromJson(json['categories'] as Map<String, dynamic>),
)
..categoryId = (json['category'] as num).toInt()
..musclesIds = (json['muscles'] as List<dynamic>).map((e) => (e as num).toInt()).toList()
..musclesSecondaryIds =
(json['muscles_secondary'] as List<dynamic>).map((e) => (e as num).toInt()).toList()
..musclesSecondaryIds = (json['muscles_secondary'] as List<dynamic>)
.map((e) => (e as num).toInt())
.toList()
..equipmentIds = (json['equipment'] as List<dynamic>).map((e) => (e as num).toInt()).toList();
}
Map<String, dynamic> _$ExerciseToJson(Exercise instance) => <String, dynamic>{
'id': instance.id,
'uuid': instance.uuid,
'variations': instance.variationId,
'created': instance.created?.toIso8601String(),
'last_update': instance.lastUpdate?.toIso8601String(),
'last_update_global': instance.lastUpdateGlobal?.toIso8601String(),
'category': instance.categoryId,
'categories': instance.category?.toJson(),
'muscles': instance.musclesIds,
'muscles_secondary': instance.musclesSecondaryIds,
'musclesSecondary': instance.musclesSecondary.map((e) => e.toJson()).toList(),
'equipment': instance.equipmentIds,
};
'id': instance.id,
'uuid': instance.uuid,
'variations': instance.variationId,
'created': instance.created?.toIso8601String(),
'last_update': instance.lastUpdate?.toIso8601String(),
'last_update_global': instance.lastUpdateGlobal?.toIso8601String(),
'category': instance.categoryId,
'categories': instance.category?.toJson(),
'muscles': instance.musclesIds,
'muscles_secondary': instance.musclesSecondaryIds,
'musclesSecondary': instance.musclesSecondary.map((e) => e.toJson()).toList(),
'equipment': instance.equipmentIds,
};

File diff suppressed because it is too large Load Diff

View File

@@ -7,54 +7,54 @@ part of 'exercise_api.dart';
// **************************************************************************
_ExerciseBaseData _$ExerciseBaseDataFromJson(Map<String, dynamic> json) => _ExerciseBaseData(
id: (json['id'] as num).toInt(),
uuid: json['uuid'] as String,
variationId: (json['variations'] as num?)?.toInt() ?? null,
created: DateTime.parse(json['created'] as String),
lastUpdate: DateTime.parse(json['last_update'] as String),
lastUpdateGlobal: DateTime.parse(json['last_update_global'] as String),
category: ExerciseCategory.fromJson(json['category'] as Map<String, dynamic>),
muscles: (json['muscles'] as List<dynamic>)
.map((e) => Muscle.fromJson(e as Map<String, dynamic>))
.toList(),
musclesSecondary: (json['muscles_secondary'] as List<dynamic>)
.map((e) => Muscle.fromJson(e as Map<String, dynamic>))
.toList(),
equipment: (json['equipment'] as List<dynamic>)
.map((e) => Equipment.fromJson(e as Map<String, dynamic>))
.toList(),
translations: (json['translations'] as List<dynamic>?)
?.map((e) => Translation.fromJson(e as Map<String, dynamic>))
.toList() ??
[],
images: (json['images'] as List<dynamic>)
.map((e) => ExerciseImage.fromJson(e as Map<String, dynamic>))
.toList(),
videos: (json['videos'] as List<dynamic>)
.map((e) => Video.fromJson(e as Map<String, dynamic>))
.toList(),
authors: (json['author_history'] as List<dynamic>).map((e) => e as String).toList(),
authorsGlobal:
(json['total_authors_history'] as List<dynamic>).map((e) => e as String).toList(),
);
id: (json['id'] as num).toInt(),
uuid: json['uuid'] as String,
variationId: (json['variations'] as num?)?.toInt() ?? null,
created: DateTime.parse(json['created'] as String),
lastUpdate: DateTime.parse(json['last_update'] as String),
lastUpdateGlobal: DateTime.parse(json['last_update_global'] as String),
category: ExerciseCategory.fromJson(json['category'] as Map<String, dynamic>),
muscles: (json['muscles'] as List<dynamic>)
.map((e) => Muscle.fromJson(e as Map<String, dynamic>))
.toList(),
musclesSecondary: (json['muscles_secondary'] as List<dynamic>)
.map((e) => Muscle.fromJson(e as Map<String, dynamic>))
.toList(),
equipment: (json['equipment'] as List<dynamic>)
.map((e) => Equipment.fromJson(e as Map<String, dynamic>))
.toList(),
translations:
(json['translations'] as List<dynamic>?)
?.map((e) => Translation.fromJson(e as Map<String, dynamic>))
.toList() ??
[],
images: (json['images'] as List<dynamic>)
.map((e) => ExerciseImage.fromJson(e as Map<String, dynamic>))
.toList(),
videos: (json['videos'] as List<dynamic>)
.map((e) => Video.fromJson(e as Map<String, dynamic>))
.toList(),
authors: (json['author_history'] as List<dynamic>).map((e) => e as String).toList(),
authorsGlobal: (json['total_authors_history'] as List<dynamic>).map((e) => e as String).toList(),
);
Map<String, dynamic> _$ExerciseBaseDataToJson(_ExerciseBaseData instance) => <String, dynamic>{
'id': instance.id,
'uuid': instance.uuid,
'variations': instance.variationId,
'created': instance.created.toIso8601String(),
'last_update': instance.lastUpdate.toIso8601String(),
'last_update_global': instance.lastUpdateGlobal.toIso8601String(),
'category': instance.category,
'muscles': instance.muscles,
'muscles_secondary': instance.musclesSecondary,
'equipment': instance.equipment,
'translations': instance.translations,
'images': instance.images,
'videos': instance.videos,
'author_history': instance.authors,
'total_authors_history': instance.authorsGlobal,
};
'id': instance.id,
'uuid': instance.uuid,
'variations': instance.variationId,
'created': instance.created.toIso8601String(),
'last_update': instance.lastUpdate.toIso8601String(),
'last_update_global': instance.lastUpdateGlobal.toIso8601String(),
'category': instance.category,
'muscles': instance.muscles,
'muscles_secondary': instance.musclesSecondary,
'equipment': instance.equipment,
'translations': instance.translations,
'images': instance.images,
'videos': instance.videos,
'author_history': instance.authors,
'total_authors_history': instance.authorsGlobal,
};
_ExerciseSearchDetails _$ExerciseSearchDetailsFromJson(Map<String, dynamic> json) =>
_ExerciseSearchDetails(
@@ -83,17 +83,14 @@ _ExerciseSearchEntry _$ExerciseSearchEntryFromJson(Map<String, dynamic> json) =>
);
Map<String, dynamic> _$ExerciseSearchEntryToJson(_ExerciseSearchEntry instance) =>
<String, dynamic>{
'value': instance.value,
'data': instance.data,
};
<String, dynamic>{'value': instance.value, 'data': instance.data};
_ExerciseApiSearch _$ExerciseApiSearchFromJson(Map<String, dynamic> json) => _ExerciseApiSearch(
suggestions: (json['suggestions'] as List<dynamic>)
.map((e) => ExerciseSearchEntry.fromJson(e as Map<String, dynamic>))
.toList(),
);
suggestions: (json['suggestions'] as List<dynamic>)
.map((e) => ExerciseSearchEntry.fromJson(e as Map<String, dynamic>))
.toList(),
);
Map<String, dynamic> _$ExerciseApiSearchToJson(_ExerciseApiSearch instance) => <String, dynamic>{
'suggestions': instance.suggestions,
};
'suggestions': instance.suggestions,
};

View File

@@ -660,6 +660,8 @@ abstract mixin class $ExerciseTranslationSubmissionApiCopyWith<$Res> {
});
}
/// @nodoc
class _$ExerciseTranslationSubmissionApiCopyWithImpl<$Res>
@@ -941,6 +943,8 @@ abstract mixin class _$ExerciseTranslationSubmissionApiCopyWith<$Res>
});
}
/// @nodoc
class __$ExerciseTranslationSubmissionApiCopyWithImpl<$Res>
@@ -1066,6 +1070,8 @@ abstract mixin class $ExerciseSubmissionApiCopyWith<$Res> {
});
}
/// @nodoc
class _$ExerciseSubmissionApiCopyWithImpl<$Res>
@@ -1385,6 +1391,8 @@ abstract mixin class _$ExerciseSubmissionApiCopyWith<$Res>
});
}
/// @nodoc
class __$ExerciseSubmissionApiCopyWithImpl<$Res>

View File

@@ -0,0 +1,67 @@
/*
* This file is part of wger Workout Manager <https://github.com/wger-project>.
* 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.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import 'dart:io';
import 'package:flutter/material.dart';
enum ImageType {
photo(id: 1, label: 'Photo', icon: Icons.photo_camera),
threeD(id: 2, label: '3D', icon: Icons.view_in_ar),
line(id: 3, label: 'Line', icon: Icons.show_chart),
lowPoly(id: 4, label: 'Low-Poly', icon: Icons.filter_vintage),
other(id: 5, label: 'Other', icon: Icons.more_horiz);
const ImageType({required this.id, required this.label, required this.icon});
final int id;
final String label;
final IconData icon;
}
class ExerciseSubmissionImage {
final File imageFile;
String? title;
String? author;
String? authorUrl;
String? sourceUrl;
String? derivativeSourceUrl;
ImageType type = ImageType.photo;
ExerciseSubmissionImage({
this.title,
this.author,
this.authorUrl,
this.sourceUrl,
this.derivativeSourceUrl,
this.type = ImageType.photo,
required this.imageFile,
});
Map<String, String> toJson() {
return {
'license_title': title ?? '',
'license_author': author ?? '',
'license_author_url': authorUrl ?? '',
'license_object_url': sourceUrl ?? '',
'license_derivative_source_url': derivativeSourceUrl ?? '',
'style': type.id.toString(),
};
}
}

View File

@@ -7,10 +7,7 @@ part of 'image.dart';
// **************************************************************************
ExerciseImage _$ExerciseImageFromJson(Map<String, dynamic> json) {
$checkKeys(
json,
requiredKeys: const ['id', 'uuid', 'exercise', 'image'],
);
$checkKeys(json, requiredKeys: const ['id', 'uuid', 'exercise', 'image']);
return ExerciseImage(
id: (json['id'] as num).toInt(),
uuid: json['uuid'] as String,
@@ -21,9 +18,9 @@ ExerciseImage _$ExerciseImageFromJson(Map<String, dynamic> json) {
}
Map<String, dynamic> _$ExerciseImageToJson(ExerciseImage instance) => <String, dynamic>{
'id': instance.id,
'uuid': instance.uuid,
'exercise': instance.exerciseId,
'image': instance.url,
'is_main': instance.isMain,
};
'id': instance.id,
'uuid': instance.uuid,
'exercise': instance.exerciseId,
'image': instance.url,
'is_main': instance.isMain,
};

View File

@@ -7,10 +7,7 @@ part of 'language.dart';
// **************************************************************************
Language _$LanguageFromJson(Map<String, dynamic> json) {
$checkKeys(
json,
requiredKeys: const ['id', 'short_name', 'full_name'],
);
$checkKeys(json, requiredKeys: const ['id', 'short_name', 'full_name']);
return Language(
id: (json['id'] as num).toInt(),
shortName: json['short_name'] as String,
@@ -19,7 +16,7 @@ Language _$LanguageFromJson(Map<String, dynamic> json) {
}
Map<String, dynamic> _$LanguageToJson(Language instance) => <String, dynamic>{
'id': instance.id,
'short_name': instance.shortName,
'full_name': instance.fullName,
};
'id': instance.id,
'short_name': instance.shortName,
'full_name': instance.fullName,
};

View File

@@ -7,10 +7,7 @@ part of 'muscle.dart';
// **************************************************************************
Muscle _$MuscleFromJson(Map<String, dynamic> json) {
$checkKeys(
json,
requiredKeys: const ['id', 'name', 'name_en', 'is_front'],
);
$checkKeys(json, requiredKeys: const ['id', 'name', 'name_en', 'is_front']);
return Muscle(
id: (json['id'] as num).toInt(),
name: json['name'] as String,
@@ -20,8 +17,8 @@ Muscle _$MuscleFromJson(Map<String, dynamic> json) {
}
Map<String, dynamic> _$MuscleToJson(Muscle instance) => <String, dynamic>{
'id': instance.id,
'name': instance.name,
'name_en': instance.nameEn,
'is_front': instance.isFront,
};
'id': instance.id,
'name': instance.name,
'name_en': instance.nameEn,
'is_front': instance.isFront,
};

View File

@@ -92,12 +92,12 @@ class Translation extends Equatable {
@override
List<Object?> get props => [
id,
exerciseId,
uuid,
languageId,
created,
name,
description,
];
id,
exerciseId,
uuid,
languageId,
created,
name,
description,
];
}

View File

@@ -12,13 +12,13 @@ Translation _$TranslationFromJson(Map<String, dynamic> json) {
requiredKeys: const ['id', 'uuid', 'language', 'created', 'exercise', 'name', 'description'],
);
return Translation(
id: (json['id'] as num?)?.toInt(),
uuid: json['uuid'] as String?,
created: json['created'] == null ? null : DateTime.parse(json['created'] as String),
name: json['name'] as String,
description: json['description'] as String,
exerciseId: (json['exercise'] as num?)?.toInt(),
)
id: (json['id'] as num?)?.toInt(),
uuid: json['uuid'] as String?,
created: json['created'] == null ? null : DateTime.parse(json['created'] as String),
name: json['name'] as String,
description: json['description'] as String,
exerciseId: (json['exercise'] as num?)?.toInt(),
)
..languageId = (json['language'] as num).toInt()
..notes = (json['notes'] as List<dynamic>)
.map((e) => Comment.fromJson(e as Map<String, dynamic>))
@@ -29,11 +29,11 @@ Translation _$TranslationFromJson(Map<String, dynamic> json) {
}
Map<String, dynamic> _$TranslationToJson(Translation instance) => <String, dynamic>{
'id': instance.id,
'uuid': instance.uuid,
'language': instance.languageId,
'created': instance.created?.toIso8601String(),
'exercise': instance.exerciseId,
'name': instance.name,
'description': instance.description,
};
'id': instance.id,
'uuid': instance.uuid,
'language': instance.languageId,
'created': instance.created?.toIso8601String(),
'exercise': instance.exerciseId,
'name': instance.name,
'description': instance.description,
};

View File

@@ -7,15 +7,10 @@ part of 'variation.dart';
// **************************************************************************
Variation _$VariationFromJson(Map<String, dynamic> json) {
$checkKeys(
json,
requiredKeys: const ['id'],
);
return Variation(
id: (json['id'] as num).toInt(),
);
$checkKeys(json, requiredKeys: const ['id']);
return Variation(id: (json['id'] as num).toInt());
}
Map<String, dynamic> _$VariationToJson(Variation instance) => <String, dynamic>{
'id': instance.id,
};
'id': instance.id,
};

View File

@@ -21,7 +21,7 @@ Video _$VideoFromJson(Map<String, dynamic> json) {
'codec',
'codec_long',
'license',
'license_author'
'license_author',
],
);
return Video(
@@ -41,16 +41,16 @@ Video _$VideoFromJson(Map<String, dynamic> json) {
}
Map<String, dynamic> _$VideoToJson(Video instance) => <String, dynamic>{
'id': instance.id,
'uuid': instance.uuid,
'video': instance.url,
'exercise': instance.exerciseId,
'size': instance.size,
'duration': numToString(instance.duration),
'width': instance.width,
'height': instance.height,
'codec': instance.codec,
'codec_long': instance.codecLong,
'license': instance.license,
'license_author': instance.licenseAuthor,
};
'id': instance.id,
'uuid': instance.uuid,
'video': instance.url,
'exercise': instance.exerciseId,
'size': instance.size,
'duration': numToString(instance.duration),
'width': instance.width,
'height': instance.height,
'codec': instance.codec,
'codec_long': instance.codecLong,
'license': instance.license,
'license_author': instance.licenseAuthor,
};

View File

@@ -7,10 +7,7 @@ part of 'image.dart';
// **************************************************************************
Image _$ImageFromJson(Map<String, dynamic> json) {
$checkKeys(
json,
requiredKeys: const ['id', 'date', 'image'],
);
$checkKeys(json, requiredKeys: const ['id', 'date', 'image']);
return Image(
id: (json['id'] as num?)?.toInt(),
date: DateTime.parse(json['date'] as String),
@@ -20,8 +17,8 @@ Image _$ImageFromJson(Map<String, dynamic> json) {
}
Map<String, dynamic> _$ImageToJson(Image instance) => <String, dynamic>{
'id': instance.id,
'date': dateToYYYYMMDD(instance.date),
'image': instance.url,
'description': instance.description,
};
'id': instance.id,
'date': dateToYYYYMMDD(instance.date),
'image': instance.url,
'description': instance.description,
};

View File

@@ -7,15 +7,13 @@ part of 'measurement_category.dart';
// **************************************************************************
MeasurementCategory _$MeasurementCategoryFromJson(Map<String, dynamic> json) {
$checkKeys(
json,
requiredKeys: const ['id', 'name', 'unit'],
);
$checkKeys(json, requiredKeys: const ['id', 'name', 'unit']);
return MeasurementCategory(
id: (json['id'] as num?)?.toInt(),
name: json['name'] as String,
unit: json['unit'] as String,
entries: (json['entries'] as List<dynamic>?)
entries:
(json['entries'] as List<dynamic>?)
?.map((e) => MeasurementEntry.fromJson(e as Map<String, dynamic>))
.toList() ??
[],
@@ -23,8 +21,8 @@ MeasurementCategory _$MeasurementCategoryFromJson(Map<String, dynamic> json) {
}
Map<String, dynamic> _$MeasurementCategoryToJson(MeasurementCategory instance) => <String, dynamic>{
'id': instance.id,
'name': instance.name,
'unit': instance.unit,
'entries': MeasurementCategory._nullValue(instance.entries),
};
'id': instance.id,
'name': instance.name,
'unit': instance.unit,
'entries': MeasurementCategory._nullValue(instance.entries),
};

View File

@@ -21,9 +21,9 @@ MeasurementEntry _$MeasurementEntryFromJson(Map<String, dynamic> json) {
}
Map<String, dynamic> _$MeasurementEntryToJson(MeasurementEntry instance) => <String, dynamic>{
'id': instance.id,
'category': instance.category,
'date': dateToYYYYMMDD(instance.date),
'value': instance.value,
'notes': instance.notes,
};
'id': instance.id,
'category': instance.category,
'date': dateToYYYYMMDD(instance.date),
'value': instance.value,
'notes': instance.notes,
};

View File

@@ -25,7 +25,7 @@ Ingredient _$IngredientFromJson(Map<String, dynamic> json) {
'fat',
'fat_saturated',
'fiber',
'sodium'
'sodium',
],
);
return Ingredient(
@@ -55,22 +55,22 @@ Ingredient _$IngredientFromJson(Map<String, dynamic> json) {
}
Map<String, dynamic> _$IngredientToJson(Ingredient instance) => <String, dynamic>{
'id': instance.id,
'remote_id': instance.remoteId,
'source_name': instance.sourceName,
'source_url': instance.sourceUrl,
'license_object_url': instance.licenseObjectURl,
'code': instance.code,
'name': instance.name,
'created': instance.created.toIso8601String(),
'energy': instance.energy,
'carbohydrates': numToString(instance.carbohydrates),
'carbohydrates_sugar': numToString(instance.carbohydratesSugar),
'protein': numToString(instance.protein),
'fat': numToString(instance.fat),
'fat_saturated': numToString(instance.fatSaturated),
'fiber': numToString(instance.fiber),
'sodium': numToString(instance.sodium),
'image': instance.image,
'thumbnails': instance.thumbnails,
};
'id': instance.id,
'remote_id': instance.remoteId,
'source_name': instance.sourceName,
'source_url': instance.sourceUrl,
'license_object_url': instance.licenseObjectURl,
'code': instance.code,
'name': instance.name,
'created': instance.created.toIso8601String(),
'energy': instance.energy,
'carbohydrates': numToString(instance.carbohydrates),
'carbohydrates_sugar': numToString(instance.carbohydratesSugar),
'protein': numToString(instance.protein),
'fat': numToString(instance.fat),
'fat_saturated': numToString(instance.fatSaturated),
'fiber': numToString(instance.fiber),
'sodium': numToString(instance.sodium),
'image': instance.image,
'thumbnails': instance.thumbnails,
};

View File

@@ -20,7 +20,7 @@ IngredientImage _$IngredientImageFromJson(Map<String, dynamic> json) {
'license_author_url',
'license_title',
'license_object_url',
'license_derivative_source_url'
'license_derivative_source_url',
],
);
return IngredientImage(
@@ -39,15 +39,15 @@ IngredientImage _$IngredientImageFromJson(Map<String, dynamic> json) {
}
Map<String, dynamic> _$IngredientImageToJson(IngredientImage instance) => <String, dynamic>{
'id': instance.id,
'uuid': instance.uuid,
'ingredient_id': instance.ingredientId,
'image': instance.url,
'size': instance.size,
'license': instance.licenseId,
'license_author': instance.author,
'license_author_url': instance.authorUrl,
'license_title': instance.title,
'license_object_url': instance.objectUrl,
'license_derivative_source_url': instance.derivativeSourceUrl,
};
'id': instance.id,
'uuid': instance.uuid,
'ingredient_id': instance.ingredientId,
'image': instance.url,
'size': instance.size,
'license': instance.licenseId,
'license_author': instance.author,
'license_author_url': instance.authorUrl,
'license_title': instance.title,
'license_object_url': instance.objectUrl,
'license_derivative_source_url': instance.derivativeSourceUrl,
};

View File

@@ -15,7 +15,7 @@ IngredientImageThumbnails _$IngredientImageThumbnailsFromJson(Map<String, dynami
'medium',
'medium_cropped',
'large',
'large_cropped'
'large_cropped',
],
);
return IngredientImageThumbnails(

View File

@@ -7,10 +7,7 @@ part of 'ingredient_weight_unit.dart';
// **************************************************************************
IngredientWeightUnit _$IngredientWeightUnitFromJson(Map<String, dynamic> json) {
$checkKeys(
json,
requiredKeys: const ['id', 'weight_unit', 'ingredient', 'grams', 'amount'],
);
$checkKeys(json, requiredKeys: const ['id', 'weight_unit', 'ingredient', 'grams', 'amount']);
return IngredientWeightUnit(
id: (json['id'] as num).toInt(),
weightUnit: WeightUnit.fromJson(json['weight_unit'] as Map<String, dynamic>),

View File

@@ -84,8 +84,9 @@ class Log {
NutritionalValues get nutritionalValues {
// This is already done on the server. It might be better to read it from there.
final weight =
weightUnitObj == null ? amount : amount * weightUnitObj!.amount * weightUnitObj!.grams;
final weight = weightUnitObj == null
? amount
: amount * weightUnitObj!.amount * weightUnitObj!.grams;
return ingredient.nutritionalValues / (100 / weight);
}

View File

@@ -9,7 +9,14 @@ part of 'log.dart';
Log _$LogFromJson(Map<String, dynamic> json) {
$checkKeys(
json,
requiredKeys: const ['id', 'plan', 'datetime', 'ingredient', 'weight_unit', 'amount'],
requiredKeys: const [
'id',
'plan',
'datetime',
'ingredient',
'weight_unit',
'amount',
],
);
return Log(
id: (json['id'] as num?)?.toInt(),
@@ -24,12 +31,12 @@ Log _$LogFromJson(Map<String, dynamic> json) {
}
Map<String, dynamic> _$LogToJson(Log instance) => <String, dynamic>{
'id': instance.id,
'meal': instance.mealId,
'plan': instance.planId,
'datetime': dateToUtcIso8601(instance.datetime),
'comment': instance.comment,
'ingredient': instance.ingredientId,
'weight_unit': instance.weightUnitId,
'amount': instance.amount,
};
'id': instance.id,
'meal': instance.mealId,
'plan': instance.planId,
'datetime': dateToUtcIso8601(instance.datetime),
'comment': instance.comment,
'ingredient': instance.ingredientId,
'weight_unit': instance.weightUnitId,
'amount': instance.amount,
};

View File

@@ -7,14 +7,14 @@ part of 'meal.dart';
// **************************************************************************
Meal _$MealFromJson(Map<String, dynamic> json) => Meal(
id: (json['id'] as num?)?.toInt(),
time: stringToTimeNull(json['time'] as String?),
name: json['name'] as String?,
)..planId = (json['plan'] as num).toInt();
id: (json['id'] as num?)?.toInt(),
time: stringToTimeNull(json['time'] as String?),
name: json['name'] as String?,
)..planId = (json['plan'] as num).toInt();
Map<String, dynamic> _$MealToJson(Meal instance) => <String, dynamic>{
'id': instance.id,
'plan': instance.planId,
'time': timeToString(instance.time),
'name': instance.name,
};
'id': instance.id,
'plan': instance.planId,
'time': timeToString(instance.time),
'name': instance.name,
};

View File

@@ -7,10 +7,7 @@ part of 'meal_item.dart';
// **************************************************************************
MealItem _$MealItemFromJson(Map<String, dynamic> json) {
$checkKeys(
json,
requiredKeys: const ['id', 'amount'],
);
$checkKeys(json, requiredKeys: const ['id', 'amount']);
return MealItem(
id: (json['id'] as num?)?.toInt(),
mealId: (json['meal'] as num?)?.toInt(),
@@ -21,9 +18,9 @@ MealItem _$MealItemFromJson(Map<String, dynamic> json) {
}
Map<String, dynamic> _$MealItemToJson(MealItem instance) => <String, dynamic>{
'id': instance.id,
'meal': instance.mealId,
'ingredient': instance.ingredientId,
'weight_unit': instance.weightUnitId,
'amount': numToString(instance.amount),
};
'id': instance.id,
'meal': instance.mealId,
'ingredient': instance.ingredientId,
'weight_unit': instance.weightUnitId,
'amount': numToString(instance.amount),
};

View File

@@ -57,7 +57,8 @@ class NutritionalGoals {
(energy! - protein! * ENERGY_PROTEIN - fat! * ENERGY_FAT) / ENERGY_CARBOHYDRATES;
assert(carbohydrates! > 0);
} else if (fat == null && protein != null && carbohydrates != null) {
fat = (energy! - protein! * ENERGY_PROTEIN - carbohydrates! * ENERGY_CARBOHYDRATES) /
fat =
(energy! - protein! * ENERGY_PROTEIN - carbohydrates! * ENERGY_CARBOHYDRATES) /
ENERGY_FAT;
assert(fat! > 0);
}
@@ -141,15 +142,15 @@ class NutritionalGoals {
@override
//ignore: avoid_equals_and_hash_code_on_mutable_classes
int get hashCode => Object.hash(
energy,
protein,
carbohydrates,
carbohydratesSugar,
fat,
fatSaturated,
fiber,
sodium,
);
energy,
protein,
carbohydrates,
carbohydratesSugar,
fat,
fatSaturated,
fiber,
sodium,
);
@override
// ignore: avoid_equals_and_hash_code_on_mutable_classes

View File

@@ -20,14 +20,15 @@ NutritionalPlan _$NutritionalPlanFromJson(Map<String, dynamic> json) {
'goal_protein',
'goal_carbohydrates',
'goal_fat',
'goal_fiber'
'goal_fiber',
],
);
return NutritionalPlan(
id: (json['id'] as num?)?.toInt(),
description: json['description'] as String,
creationDate:
json['creation_date'] == null ? null : DateTime.parse(json['creation_date'] as String),
creationDate: json['creation_date'] == null
? null
: DateTime.parse(json['creation_date'] as String),
startDate: DateTime.parse(json['start'] as String),
endDate: json['end'] == null ? null : DateTime.parse(json['end'] as String),
onlyLogging: json['only_logging'] as bool? ?? false,
@@ -40,15 +41,15 @@ NutritionalPlan _$NutritionalPlanFromJson(Map<String, dynamic> json) {
}
Map<String, dynamic> _$NutritionalPlanToJson(NutritionalPlan instance) => <String, dynamic>{
'id': instance.id,
'description': instance.description,
'creation_date': dateToUtcIso8601(instance.creationDate),
'start': dateToYYYYMMDD(instance.startDate),
'end': dateToYYYYMMDD(instance.endDate),
'only_logging': instance.onlyLogging,
'goal_energy': instance.goalEnergy,
'goal_protein': instance.goalProtein,
'goal_carbohydrates': instance.goalCarbohydrates,
'goal_fat': instance.goalFat,
'goal_fiber': instance.goalFiber,
};
'id': instance.id,
'description': instance.description,
'creation_date': dateToUtcIso8601(instance.creationDate),
'start': dateToYYYYMMDD(instance.startDate),
'end': dateToYYYYMMDD(instance.endDate),
'only_logging': instance.onlyLogging,
'goal_energy': instance.goalEnergy,
'goal_protein': instance.goalProtein,
'goal_carbohydrates': instance.goalCarbohydrates,
'goal_fat': instance.goalFat,
'goal_fiber': instance.goalFiber,
};

View File

@@ -132,13 +132,13 @@ class NutritionalValues {
@override
//ignore: avoid_equals_and_hash_code_on_mutable_classes
int get hashCode => Object.hash(
energy,
protein,
carbohydrates,
carbohydratesSugar,
fat,
fatSaturated,
fiber,
sodium,
);
energy,
protein,
carbohydrates,
carbohydratesSugar,
fat,
fatSaturated,
fiber,
sodium,
);
}

View File

@@ -7,10 +7,7 @@ part of 'weight_unit.dart';
// **************************************************************************
WeightUnit _$WeightUnitFromJson(Map<String, dynamic> json) {
$checkKeys(
json,
requiredKeys: const ['id', 'name'],
);
$checkKeys(json, requiredKeys: const ['id', 'name']);
return WeightUnit(
id: (json['id'] as num).toInt(),
name: json['name'] as String,
@@ -18,6 +15,6 @@ WeightUnit _$WeightUnitFromJson(Map<String, dynamic> json) {
}
Map<String, dynamic> _$WeightUnitToJson(WeightUnit instance) => <String, dynamic>{
'id': instance.id,
'name': instance.name,
};
'id': instance.id,
'name': instance.name,
};

View File

@@ -9,7 +9,13 @@ part of 'profile.dart';
Profile _$ProfileFromJson(Map<String, dynamic> json) {
$checkKeys(
json,
requiredKeys: const ['username', 'email_verified', 'is_trustworthy', 'weight_unit', 'email'],
requiredKeys: const [
'username',
'email_verified',
'is_trustworthy',
'weight_unit',
'email',
],
);
return Profile(
username: json['username'] as String,
@@ -21,9 +27,9 @@ Profile _$ProfileFromJson(Map<String, dynamic> json) {
}
Map<String, dynamic> _$ProfileToJson(Profile instance) => <String, dynamic>{
'username': instance.username,
'email_verified': instance.emailVerified,
'is_trustworthy': instance.isTrustworthy,
'weight_unit': instance.weightUnitStr,
'email': instance.email,
};
'username': instance.username,
'email_verified': instance.emailVerified,
'is_trustworthy': instance.isTrustworthy,
'weight_unit': instance.weightUnitStr,
'email': instance.email,
};

View File

@@ -17,7 +17,7 @@ BaseConfig _$BaseConfigFromJson(Map<String, dynamic> json) {
'operation',
'step',
'repeat',
'requirements'
'requirements',
],
);
return BaseConfig(
@@ -33,11 +33,11 @@ BaseConfig _$BaseConfigFromJson(Map<String, dynamic> json) {
}
Map<String, dynamic> _$BaseConfigToJson(BaseConfig instance) => <String, dynamic>{
'slot_entry': instance.slotEntryId,
'iteration': instance.iteration,
'value': instance.value,
'operation': instance.operation,
'step': instance.step,
'repeat': instance.repeat,
'requirements': instance.requirements,
};
'slot_entry': instance.slotEntryId,
'iteration': instance.iteration,
'value': instance.value,
'operation': instance.operation,
'step': instance.step,
'repeat': instance.repeat,
'requirements': instance.requirements,
};

View File

@@ -17,10 +17,36 @@
*/
import 'package:json_annotation/json_annotation.dart';
import 'package:wger/l10n/generated/app_localizations.dart';
import 'package:wger/models/workouts/slot.dart';
part 'day.g.dart';
enum DayType { custom, enom, amrap, hiit, tabata, edt, rft, afap }
extension DayTypeExtension on DayType {
String i18Label(AppLocalizations i18n) {
switch (this) {
case DayType.custom:
return i18n.dayTypeCustom;
case DayType.enom:
return i18n.dayTypeEnom;
case DayType.amrap:
return i18n.dayTypeAmrap;
case DayType.hiit:
return i18n.dayTypeHiit;
case DayType.tabata:
return i18n.dayTypeTabata;
case DayType.edt:
return i18n.dayTypeEdt;
case DayType.rft:
return i18n.dayTypeRft;
case DayType.afap:
return i18n.dayTypeAfap;
}
}
}
@JsonSerializable()
class Day {
static const MIN_LENGTH_NAME = 3;
@@ -39,48 +65,67 @@ class Day {
@JsonKey(required: true)
late String description;
@JsonKey(required: true)
late DayType type;
@JsonKey(required: true, name: 'is_rest')
late bool isRest;
@JsonKey(required: true, name: 'need_logs_to_advance')
late bool needLogsToAdvance;
@JsonKey(required: true)
late String type;
@JsonKey(required: true)
late num order;
@JsonKey(required: true)
late Object? config;
@JsonKey(required: false, defaultValue: [], includeFromJson: true, includeToJson: false)
@JsonKey(required: false, includeFromJson: true, includeToJson: false)
List<Slot> slots = [];
Day({
this.id,
required this.routineId,
required this.name,
required this.description,
this.description = '',
this.isRest = false,
this.needLogsToAdvance = false,
this.type = 'custom',
this.order = 0,
this.config = null,
this.type = DayType.custom,
this.order = 1,
this.config,
this.slots = const [],
});
Day.empty() {
name = 'new day';
description = '';
type = 'custom';
isRest = false;
needLogsToAdvance = false;
order = 0;
config = {};
slots = [];
Day copyWith({
int? id,
int? routineId,
String? name,
String? description,
DayType? type,
bool? isRest,
bool? needLogsToAdvance,
num? order,
Object? config,
List<Slot>? slots,
}) {
return Day(
id: id ?? this.id,
routineId: routineId ?? this.routineId,
name: name ?? this.name,
description: description ?? this.description,
type: type ?? this.type,
isRest: isRest ?? this.isRest,
needLogsToAdvance: needLogsToAdvance ?? this.needLogsToAdvance,
order: order ?? this.order,
config: config ?? this.config,
slots: slots ?? this.slots,
);
}
bool get isSpecialType => type != DayType.custom;
String get nameWithType => isSpecialType ? '${type.name.toUpperCase()} - $name' : name;
// Boilerplate
factory Day.fromJson(Map<String, dynamic> json) => _$DayFromJson(json);

View File

@@ -14,37 +14,49 @@ Day _$DayFromJson(Map<String, dynamic> json) {
'routine',
'name',
'description',
'type',
'is_rest',
'need_logs_to_advance',
'type',
'order',
'config'
'config',
],
);
return Day(
id: (json['id'] as num?)?.toInt(),
routineId: (json['routine'] as num).toInt(),
name: json['name'] as String,
description: json['description'] as String,
description: json['description'] as String? ?? '',
isRest: json['is_rest'] as bool? ?? false,
needLogsToAdvance: json['need_logs_to_advance'] as bool? ?? false,
type: json['type'] as String? ?? 'custom',
order: json['order'] as num? ?? 0,
config: json['config'] ?? null,
slots: (json['slots'] as List<dynamic>?)
type: $enumDecodeNullable(_$DayTypeEnumMap, json['type']) ?? DayType.custom,
order: json['order'] as num? ?? 1,
config: json['config'],
slots:
(json['slots'] as List<dynamic>?)
?.map((e) => Slot.fromJson(e as Map<String, dynamic>))
.toList() ??
[],
const [],
);
}
Map<String, dynamic> _$DayToJson(Day instance) => <String, dynamic>{
'routine': instance.routineId,
'name': instance.name,
'description': instance.description,
'is_rest': instance.isRest,
'need_logs_to_advance': instance.needLogsToAdvance,
'type': instance.type,
'order': instance.order,
'config': instance.config,
};
'routine': instance.routineId,
'name': instance.name,
'description': instance.description,
'type': _$DayTypeEnumMap[instance.type]!,
'is_rest': instance.isRest,
'need_logs_to_advance': instance.needLogsToAdvance,
'order': instance.order,
'config': instance.config,
};
const _$DayTypeEnumMap = {
DayType.custom: 'custom',
DayType.enom: 'enom',
DayType.amrap: 'amrap',
DayType.hiit: 'hiit',
DayType.tabata: 'tabata',
DayType.edt: 'edt',
DayType.rft: 'rft',
DayType.afap: 'afap',
};

View File

@@ -7,16 +7,14 @@ part of 'day_data.dart';
// **************************************************************************
DayData _$DayDataFromJson(Map<String, dynamic> json) {
$checkKeys(
json,
requiredKeys: const ['iteration', 'date', 'label'],
);
$checkKeys(json, requiredKeys: const ['iteration', 'date', 'label']);
return DayData(
iteration: (json['iteration'] as num).toInt(),
date: DateTime.parse(json['date'] as String),
label: json['label'] as String? ?? '',
day: json['day'] == null ? null : Day.fromJson(json['day'] as Map<String, dynamic>),
slots: (json['slots'] as List<dynamic>?)
slots:
(json['slots'] as List<dynamic>?)
?.map((e) => SlotData.fromJson(e as Map<String, dynamic>))
.toList() ??
const [],
@@ -24,9 +22,9 @@ DayData _$DayDataFromJson(Map<String, dynamic> json) {
}
Map<String, dynamic> _$DayDataToJson(DayData instance) => <String, dynamic>{
'iteration': instance.iteration,
'date': instance.date.toIso8601String(),
'label': instance.label,
'day': instance.day,
'slots': instance.slots,
};
'iteration': instance.iteration,
'date': instance.date.toIso8601String(),
'label': instance.label,
'day': instance.day,
'slots': instance.slots,
};

View File

@@ -142,8 +142,13 @@ class Log {
/// Returns the text representation for a single setting, used in the gym mode
String get singleLogRepTextNoNl {
return repText(repetitions, repetitionsUnitObj, weight, weightUnitObj, rir)
.replaceAll('\n', '');
return repText(
repetitions,
repetitionsUnitObj,
weight,
weightUnitObj,
rir,
).replaceAll('\n', '');
}
/// Override the equals operator

View File

@@ -22,7 +22,7 @@ Log _$LogFromJson(Map<String, dynamic> json) {
'weight',
'weight_target',
'weight_unit',
'date'
'date',
],
);
return Log(
@@ -44,19 +44,19 @@ Log _$LogFromJson(Map<String, dynamic> json) {
}
Map<String, dynamic> _$LogToJson(Log instance) => <String, dynamic>{
'id': instance.id,
'exercise': instance.exerciseId,
'routine': instance.routineId,
'session': instance.sessionId,
'iteration': instance.iteration,
'slot_entry': instance.slotEntryId,
'rir': instance.rir,
'rir_target': instance.rirTarget,
'repetitions': instance.repetitions,
'repetitions_target': instance.repetitionsTarget,
'repetitions_unit': instance.repetitionsUnitId,
'weight': numToString(instance.weight),
'weight_target': numToString(instance.weightTarget),
'weight_unit': instance.weightUnitId,
'date': dateToUtcIso8601(instance.date),
};
'id': instance.id,
'exercise': instance.exerciseId,
'routine': instance.routineId,
'session': instance.sessionId,
'iteration': instance.iteration,
'slot_entry': instance.slotEntryId,
'rir': instance.rir,
'rir_target': instance.rirTarget,
'repetitions': instance.repetitions,
'repetitions_target': instance.repetitionsTarget,
'repetitions_unit': instance.repetitionsUnitId,
'weight': numToString(instance.weight),
'weight_target': numToString(instance.weightTarget),
'weight_unit': instance.weightUnitId,
'date': dateToUtcIso8601(instance.date),
};

View File

@@ -7,10 +7,7 @@ part of 'repetition_unit.dart';
// **************************************************************************
RepetitionUnit _$RepetitionUnitFromJson(Map<String, dynamic> json) {
$checkKeys(
json,
requiredKeys: const ['id', 'name'],
);
$checkKeys(json, requiredKeys: const ['id', 'name']);
return RepetitionUnit(
id: (json['id'] as num).toInt(),
name: json['name'] as String,
@@ -18,6 +15,6 @@ RepetitionUnit _$RepetitionUnitFromJson(Map<String, dynamic> json) {
}
Map<String, dynamic> _$RepetitionUnitToJson(RepetitionUnit instance) => <String, dynamic>{
'id': instance.id,
'name': instance.name,
};
'id': instance.id,
'name': instance.name,
};

View File

@@ -19,11 +19,13 @@ Routine _$RoutineFromJson(Map<String, dynamic> json) {
end: json['end'] == null ? null : DateTime.parse(json['end'] as String),
fitInWeek: json['fit_in_week'] as bool? ?? false,
description: json['description'] as String?,
days: (json['days'] as List<dynamic>?)
days:
(json['days'] as List<dynamic>?)
?.map((e) => Day.fromJson(e as Map<String, dynamic>))
.toList() ??
const [],
sessions: (json['sessions'] as List<dynamic>?)
sessions:
(json['sessions'] as List<dynamic>?)
?.map((e) => WorkoutSessionApi.fromJson(e as Map<String, dynamic>))
.toList() ??
[],
@@ -31,10 +33,10 @@ Routine _$RoutineFromJson(Map<String, dynamic> json) {
}
Map<String, dynamic> _$RoutineToJson(Routine instance) => <String, dynamic>{
'created': dateToUtcIso8601(instance.created),
'name': instance.name,
'description': instance.description,
'fit_in_week': instance.fitInWeek,
'start': dateToYYYYMMDD(instance.start),
'end': dateToYYYYMMDD(instance.end),
};
'created': dateToUtcIso8601(instance.created),
'name': instance.name,
'description': instance.description,
'fit_in_week': instance.fitInWeek,
'start': dateToYYYYMMDD(instance.start),
'end': dateToYYYYMMDD(instance.end),
};

View File

@@ -19,7 +19,8 @@ WorkoutSession _$WorkoutSessionFromJson(Map<String, dynamic> json) {
notes: json['notes'] as String? ?? '',
timeStart: stringToTimeNull(json['time_start'] as String?),
timeEnd: stringToTimeNull(json['time_end'] as String?),
logs: (json['logs'] as List<dynamic>?)
logs:
(json['logs'] as List<dynamic>?)
?.map((e) => Log.fromJson(e as Map<String, dynamic>))
.toList() ??
[],
@@ -28,12 +29,12 @@ WorkoutSession _$WorkoutSessionFromJson(Map<String, dynamic> json) {
}
Map<String, dynamic> _$WorkoutSessionToJson(WorkoutSession instance) => <String, dynamic>{
'id': instance.id,
'routine': instance.routineId,
'day': instance.dayId,
'date': dateToYYYYMMDD(instance.date),
'impression': numToString(instance.impression),
'notes': instance.notes,
'time_start': timeToString(instance.timeStart),
'time_end': timeToString(instance.timeEnd),
};
'id': instance.id,
'routine': instance.routineId,
'day': instance.dayId,
'date': dateToYYYYMMDD(instance.date),
'impression': numToString(instance.impression),
'notes': instance.notes,
'time_start': timeToString(instance.timeStart),
'time_end': timeToString(instance.timeEnd),
};

View File

@@ -7,13 +7,11 @@ part of 'session_api.dart';
// **************************************************************************
WorkoutSessionApi _$WorkoutSessionApiFromJson(Map<String, dynamic> json) {
$checkKeys(
json,
requiredKeys: const ['session'],
);
$checkKeys(json, requiredKeys: const ['session']);
return WorkoutSessionApi(
session: WorkoutSession.fromJson(json['session'] as Map<String, dynamic>),
logs: (json['logs'] as List<dynamic>?)
logs:
(json['logs'] as List<dynamic>?)
?.map((e) => Log.fromJson(e as Map<String, dynamic>))
.toList() ??
[],
@@ -21,5 +19,5 @@ WorkoutSessionApi _$WorkoutSessionApiFromJson(Map<String, dynamic> json) {
}
Map<String, dynamic> _$WorkoutSessionApiToJson(WorkoutSessionApi instance) => <String, dynamic>{
'session': instance.session,
};
'session': instance.session,
};

View File

@@ -21,6 +21,7 @@ import 'package:wger/helpers/consts.dart';
import 'package:wger/helpers/json.dart';
import 'package:wger/models/exercises/exercise.dart';
import 'package:wger/models/workouts/repetition_unit.dart';
import 'package:wger/models/workouts/slot_entry.dart';
import 'package:wger/models/workouts/weight_unit.dart';
part 'set_config_data.g.dart';
@@ -37,11 +38,13 @@ class SetConfigData {
late int slotEntryId;
@JsonKey(required: true)
late String type;
late SlotEntryType type;
@JsonKey(required: true, name: 'text_repr')
late String textRepr;
String get textReprWithType => '$textRepr${type.typeLabel}';
@JsonKey(required: true, name: 'sets')
late num? nrOfSets;
@@ -99,17 +102,17 @@ class SetConfigData {
SetConfigData({
required this.exerciseId,
required this.slotEntryId,
this.type = 'normal',
this.type = SlotEntryType.normal,
required this.nrOfSets,
this.maxNrOfSets,
required this.weight,
this.maxWeight,
this.weightUnitId = WEIGHT_UNIT_KG,
this.weightRounding = null,
this.weightRounding,
required this.repetitions,
this.maxRepetitions,
this.repetitionsUnitId = REP_UNIT_REPETITIONS_ID,
this.repetitionsRounding = null,
this.repetitionsRounding,
required this.rir,
this.maxRir,
required this.rpe,

View File

@@ -29,27 +29,25 @@ SetConfigData _$SetConfigDataFromJson(Map<String, dynamic> json) {
'rpe',
'rest',
'max_rest',
'comment'
'comment',
],
);
return SetConfigData(
exerciseId: (json['exercise'] as num).toInt(),
slotEntryId: (json['slot_entry_id'] as num).toInt(),
type: json['type'] as String? ?? 'normal',
type: $enumDecodeNullable(_$SlotEntryTypeEnumMap, json['type']) ?? SlotEntryType.normal,
nrOfSets: json['sets'] as num?,
maxNrOfSets: json['max_sets'] as num?,
weight: stringToNumNull(json['weight'] as String?),
maxWeight: stringToNumNull(json['max_weight'] as String?),
weightUnitId: (json['weight_unit'] as num?)?.toInt() ?? WEIGHT_UNIT_KG,
weightRounding: json['weight_rounding'] == null
? null
: stringToNumNull(json['weight_rounding'] as String?),
weightRounding: stringToNumNull(json['weight_rounding'] as String?),
repetitions: stringToNumNull(json['repetitions'] as String?),
maxRepetitions: stringToNumNull(json['max_repetitions'] as String?),
repetitionsUnitId: (json['repetitions_unit'] as num?)?.toInt() ?? REP_UNIT_REPETITIONS_ID,
repetitionsRounding: json['repetitions_rounding'] == null
? null
: stringToNumNull(json['repetitions_rounding'] as String?),
repetitionsRounding: stringToNumNull(
json['repetitions_rounding'] as String?,
),
rir: stringToNumNull(json['rir'] as String?),
maxRir: stringToNumNull(json['max_rir'] as String?),
rpe: stringToNumNull(json['rpe'] as String?),
@@ -61,24 +59,35 @@ SetConfigData _$SetConfigDataFromJson(Map<String, dynamic> json) {
}
Map<String, dynamic> _$SetConfigDataToJson(SetConfigData instance) => <String, dynamic>{
'exercise': instance.exerciseId,
'slot_entry_id': instance.slotEntryId,
'type': instance.type,
'text_repr': instance.textRepr,
'sets': instance.nrOfSets,
'max_sets': instance.maxNrOfSets,
'weight': instance.weight,
'max_weight': instance.maxWeight,
'weight_unit': instance.weightUnitId,
'weight_rounding': instance.weightRounding,
'repetitions': instance.repetitions,
'max_repetitions': instance.maxRepetitions,
'repetitions_unit': instance.repetitionsUnitId,
'repetitions_rounding': instance.repetitionsRounding,
'rir': instance.rir,
'max_rir': instance.maxRir,
'rpe': instance.rpe,
'rest': instance.restTime,
'max_rest': instance.maxRestTime,
'comment': instance.comment,
};
'exercise': instance.exerciseId,
'slot_entry_id': instance.slotEntryId,
'type': _$SlotEntryTypeEnumMap[instance.type]!,
'text_repr': instance.textRepr,
'sets': instance.nrOfSets,
'max_sets': instance.maxNrOfSets,
'weight': instance.weight,
'max_weight': instance.maxWeight,
'weight_unit': instance.weightUnitId,
'weight_rounding': instance.weightRounding,
'repetitions': instance.repetitions,
'max_repetitions': instance.maxRepetitions,
'repetitions_unit': instance.repetitionsUnitId,
'repetitions_rounding': instance.repetitionsRounding,
'rir': instance.rir,
'max_rir': instance.maxRir,
'rpe': instance.rpe,
'rest': instance.restTime,
'max_rest': instance.maxRestTime,
'comment': instance.comment,
};
const _$SlotEntryTypeEnumMap = {
SlotEntryType.normal: 'normal',
SlotEntryType.dropset: 'dropset',
SlotEntryType.myo: 'myo',
SlotEntryType.partial: 'partial',
SlotEntryType.forced: 'forced',
SlotEntryType.tut: 'tut',
SlotEntryType.iso: 'iso',
SlotEntryType.jump: 'jump',
};

View File

@@ -7,25 +7,24 @@ part of 'slot.dart';
// **************************************************************************
Slot _$SlotFromJson(Map<String, dynamic> json) {
$checkKeys(
json,
requiredKeys: const ['id', 'order', 'comment', 'config'],
);
$checkKeys(json, requiredKeys: const ['id', 'order', 'comment', 'config']);
return Slot(
id: (json['id'] as num?)?.toInt(),
day: (json['day'] as num).toInt(),
comment: json['comment'] as String? ?? '',
order: (json['order'] as num).toInt(),
config: json['config'],
)..entries = (json['entries'] as List<dynamic>?)
?.map((e) => SlotEntry.fromJson(e as Map<String, dynamic>))
.toList() ??
[];
id: (json['id'] as num?)?.toInt(),
day: (json['day'] as num).toInt(),
comment: json['comment'] as String? ?? '',
order: (json['order'] as num).toInt(),
config: json['config'],
)
..entries =
(json['entries'] as List<dynamic>?)
?.map((e) => SlotEntry.fromJson(e as Map<String, dynamic>))
.toList() ??
[];
}
Map<String, dynamic> _$SlotToJson(Slot instance) => <String, dynamic>{
'day': instance.day,
'order': instance.order,
'comment': instance.comment,
'config': instance.config,
};
'day': instance.day,
'order': instance.order,
'comment': instance.comment,
'config': instance.config,
};

View File

@@ -16,7 +16,8 @@ SlotData _$SlotDataFromJson(Map<String, dynamic> json) {
isSuperset: json['is_superset'] as bool,
exerciseIds:
(json['exercises'] as List<dynamic>?)?.map((e) => (e as num).toInt()).toList() ?? const [],
setConfigs: (json['sets'] as List<dynamic>?)
setConfigs:
(json['sets'] as List<dynamic>?)
?.map((e) => SetConfigData.fromJson(e as Map<String, dynamic>))
.toList() ??
const [],
@@ -24,8 +25,8 @@ SlotData _$SlotDataFromJson(Map<String, dynamic> json) {
}
Map<String, dynamic> _$SlotDataToJson(SlotData instance) => <String, dynamic>{
'comment': instance.comment,
'is_superset': instance.isSuperset,
'exercises': instance.exerciseIds,
'sets': instance.setConfigs,
};
'comment': instance.comment,
'is_superset': instance.isSuperset,
'exercises': instance.exerciseIds,
'sets': instance.setConfigs,
};

View File

@@ -19,6 +19,7 @@
import 'package:json_annotation/json_annotation.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/exercises/exercise.dart';
import 'package:wger/models/workouts/base_config.dart';
import 'package:wger/models/workouts/repetition_unit.dart';
@@ -26,6 +27,33 @@ import 'package:wger/models/workouts/weight_unit.dart';
part 'slot_entry.g.dart';
enum SlotEntryType { normal, dropset, myo, partial, forced, tut, iso, jump }
extension SlotEntryTypeExtension on SlotEntryType {
String i18Label(AppLocalizations i18n) {
switch (this) {
case SlotEntryType.normal:
return i18n.slotEntryTypeNormal;
case SlotEntryType.dropset:
return i18n.slotEntryTypeDropset;
case SlotEntryType.myo:
return i18n.slotEntryTypeMyo;
case SlotEntryType.partial:
return i18n.slotEntryTypePartial;
case SlotEntryType.forced:
return i18n.slotEntryTypeForced;
case SlotEntryType.tut:
return i18n.slotEntryTypeTut;
case SlotEntryType.iso:
return i18n.slotEntryTypeIso;
case SlotEntryType.jump:
return i18n.slotEntryTypeJump;
}
}
String get typeLabel => this != SlotEntryType.normal ? ' (${name.toUpperCase()})' : '';
}
enum ConfigType {
weight,
maxWeight,
@@ -59,7 +87,7 @@ class SlotEntry {
late String comment;
@JsonKey(required: true)
late String type;
late SlotEntryType type;
@JsonKey(includeFromJson: false, includeToJson: false)
late Exercise exerciseObj;
@@ -121,14 +149,14 @@ class SlotEntry {
SlotEntry({
this.id,
required this.slotId,
required this.order,
required this.type,
this.order = 1,
this.type = SlotEntryType.normal,
required this.exerciseId,
required this.repetitionUnitId,
required this.repetitionRounding,
required this.weightUnitId,
required this.weightRounding,
required this.comment,
this.comment = '',
this.weightConfigs = const [],
this.maxWeightConfigs = const [],
this.nrOfSetsConfigs = const [],
@@ -160,27 +188,25 @@ class SlotEntry {
required this.slotId,
String? comment,
int? order,
String? type,
SlotEntryType? type,
required Exercise exercise,
int? weightUnitId,
num? weightRounding,
this.weightRounding,
int? repetitionUnitId,
num? repetitionRounding,
this.repetitionRounding,
}) {
this.order = order ?? 1;
this.comment = comment ?? '';
config = null;
this.type = type ?? 'normal';
this.type = type ?? SlotEntryType.normal;
exerciseObj = exercise;
exerciseId = exercise.id!;
this.weightUnitId = weightUnitId ?? WEIGHT_UNIT_KG;
this.weightRounding = weightRounding;
this.repetitionUnitId = repetitionUnitId ?? REP_UNIT_REPETITIONS_ID;
this.repetitionRounding = repetitionRounding;
}
get rir {
String get rir {
return 'DELETE ME! RIR';
}

View File

@@ -20,57 +20,67 @@ SlotEntry _$SlotEntryFromJson(Map<String, dynamic> json) {
'repetition_rounding',
'weight_unit',
'weight_rounding',
'config'
'config',
],
);
return SlotEntry(
id: (json['id'] as num?)?.toInt(),
slotId: (json['slot'] as num).toInt(),
order: (json['order'] as num).toInt(),
type: json['type'] as String,
order: (json['order'] as num?)?.toInt() ?? 1,
type: $enumDecodeNullable(_$SlotEntryTypeEnumMap, json['type']) ?? SlotEntryType.normal,
exerciseId: (json['exercise'] as num).toInt(),
repetitionUnitId: (json['repetition_unit'] as num?)?.toInt(),
repetitionRounding: stringToNumNull(json['repetition_rounding'] as String?),
weightUnitId: (json['weight_unit'] as num?)?.toInt(),
weightRounding: stringToNumNull(json['weight_rounding'] as String?),
comment: json['comment'] as String,
weightConfigs: (json['weight_configs'] as List<dynamic>?)
comment: json['comment'] as String? ?? '',
weightConfigs:
(json['weight_configs'] as List<dynamic>?)
?.map((e) => BaseConfig.fromJson(e as Map<String, dynamic>))
.toList() ??
[],
maxWeightConfigs: (json['max_weight_configs'] as List<dynamic>?)
maxWeightConfigs:
(json['max_weight_configs'] as List<dynamic>?)
?.map((e) => BaseConfig.fromJson(e as Map<String, dynamic>))
.toList() ??
[],
nrOfSetsConfigs: (json['set_nr_configs'] as List<dynamic>?)
nrOfSetsConfigs:
(json['set_nr_configs'] as List<dynamic>?)
?.map((e) => BaseConfig.fromJson(e as Map<String, dynamic>))
.toList() ??
[],
maxNrOfSetsConfigs: (json['max_set_nr_configs'] as List<dynamic>?)
maxNrOfSetsConfigs:
(json['max_set_nr_configs'] as List<dynamic>?)
?.map((e) => BaseConfig.fromJson(e as Map<String, dynamic>))
.toList() ??
[],
rirConfigs: (json['rir_configs'] as List<dynamic>?)
rirConfigs:
(json['rir_configs'] as List<dynamic>?)
?.map((e) => BaseConfig.fromJson(e as Map<String, dynamic>))
.toList() ??
[],
maxRirConfigs: (json['max_rir_configs'] as List<dynamic>?)
maxRirConfigs:
(json['max_rir_configs'] as List<dynamic>?)
?.map((e) => BaseConfig.fromJson(e as Map<String, dynamic>))
.toList() ??
[],
restTimeConfigs: (json['rest_configs'] as List<dynamic>?)
restTimeConfigs:
(json['rest_configs'] as List<dynamic>?)
?.map((e) => BaseConfig.fromJson(e as Map<String, dynamic>))
.toList() ??
[],
maxRestTimeConfigs: (json['max_rest_configs'] as List<dynamic>?)
maxRestTimeConfigs:
(json['max_rest_configs'] as List<dynamic>?)
?.map((e) => BaseConfig.fromJson(e as Map<String, dynamic>))
.toList() ??
[],
repetitionsConfigs: (json['repetitions_configs'] as List<dynamic>?)
repetitionsConfigs:
(json['repetitions_configs'] as List<dynamic>?)
?.map((e) => BaseConfig.fromJson(e as Map<String, dynamic>))
.toList() ??
[],
maxRepetitionsConfigs: (json['max_repetitions_configs'] as List<dynamic>?)
maxRepetitionsConfigs:
(json['max_repetitions_configs'] as List<dynamic>?)
?.map((e) => BaseConfig.fromJson(e as Map<String, dynamic>))
.toList() ??
[],
@@ -78,14 +88,25 @@ SlotEntry _$SlotEntryFromJson(Map<String, dynamic> json) {
}
Map<String, dynamic> _$SlotEntryToJson(SlotEntry instance) => <String, dynamic>{
'slot': instance.slotId,
'order': instance.order,
'comment': instance.comment,
'type': instance.type,
'exercise': instance.exerciseId,
'repetition_unit': instance.repetitionUnitId,
'repetition_rounding': instance.repetitionRounding,
'weight_unit': instance.weightUnitId,
'weight_rounding': instance.weightRounding,
'config': instance.config,
};
'slot': instance.slotId,
'order': instance.order,
'comment': instance.comment,
'type': _$SlotEntryTypeEnumMap[instance.type]!,
'exercise': instance.exerciseId,
'repetition_unit': instance.repetitionUnitId,
'repetition_rounding': instance.repetitionRounding,
'weight_unit': instance.weightUnitId,
'weight_rounding': instance.weightRounding,
'config': instance.config,
};
const _$SlotEntryTypeEnumMap = {
SlotEntryType.normal: 'normal',
SlotEntryType.dropset: 'dropset',
SlotEntryType.myo: 'myo',
SlotEntryType.partial: 'partial',
SlotEntryType.forced: 'forced',
SlotEntryType.tut: 'tut',
SlotEntryType.iso: 'iso',
SlotEntryType.jump: 'jump',
};

View File

@@ -7,17 +7,11 @@ part of 'weight_unit.dart';
// **************************************************************************
WeightUnit _$WeightUnitFromJson(Map<String, dynamic> json) {
$checkKeys(
json,
requiredKeys: const ['id', 'name'],
);
return WeightUnit(
id: (json['id'] as num).toInt(),
name: json['name'] as String,
);
$checkKeys(json, requiredKeys: const ['id', 'name']);
return WeightUnit(id: (json['id'] as num).toInt(), name: json['name'] as String);
}
Map<String, dynamic> _$WeightUnitToJson(WeightUnit instance) => <String, dynamic>{
'id': instance.id,
'name': instance.name,
};
'id': instance.id,
'name': instance.name,
};

View File

@@ -1,13 +1,11 @@
import 'dart:convert';
import 'dart:io';
import 'package:flutter/foundation.dart';
import 'package:http/http.dart' as http;
import 'package:logging/logging.dart';
import 'package:wger/helpers/consts.dart';
import 'package:wger/models/exercises/category.dart';
import 'package:wger/models/exercises/equipment.dart';
import 'package:wger/models/exercises/exercise.dart';
import 'package:wger/models/exercises/exercise_submission.dart';
import 'package:wger/models/exercises/exercise_submission_images.dart';
import 'package:wger/models/exercises/language.dart';
import 'package:wger/models/exercises/muscle.dart';
import 'package:wger/models/exercises/variation.dart';
@@ -20,12 +18,12 @@ class AddExerciseProvider with ChangeNotifier {
AddExerciseProvider(this.baseProvider);
List<File> get exerciseImages => [..._exerciseImages];
List<File> _exerciseImages = [];
// Images and their metadata (license info, style)
final List<ExerciseSubmissionImage> _exerciseImages = [];
// Map storing image metadata (license info, style), keyed by file path
final Map<String, Map<String, String>> _imageDetails = {};
List<ExerciseSubmissionImage> get exerciseImages => [..._exerciseImages];
String author = '';
String? exerciseNameEn;
String? exerciseNameTrans;
String? descriptionEn;
@@ -37,7 +35,6 @@ class AddExerciseProvider with ChangeNotifier {
List<String> alternateNamesEn = [];
List<String> alternateNamesTrans = [];
ExerciseCategory? category;
List<Exercise> _variations = [];
List<Equipment> _equipment = [];
List<Muscle> _primaryMuscles = [];
List<Muscle> _secondaryMuscles = [];
@@ -47,8 +44,7 @@ class AddExerciseProvider with ChangeNotifier {
static const _checkLanguageUrlPath = 'check-language';
void clear() {
_exerciseImages = [];
_imageDetails.clear();
_exerciseImages.clear();
languageTranslation = null;
category = null;
exerciseNameEn = null;
@@ -57,7 +53,6 @@ class AddExerciseProvider with ChangeNotifier {
descriptionTrans = null;
alternateNamesEn = [];
alternateNamesTrans = [];
_variations = [];
_equipment = [];
_primaryMuscles = [];
_secondaryMuscles = [];
@@ -142,56 +137,14 @@ class AddExerciseProvider with ChangeNotifier {
}
/// Add images with optional license metadata
///
/// [images] - List of image files to add
/// [title] - License title
/// [author] - Author name
/// [authorUrl] - Author's URL
/// [sourceUrl] - Source/object URL
/// [derivativeSourceUrl] - Derivative source URL
/// [style] - Image style: 1=PHOTO, 2=3D, 3=LINE, 4=LOW-POLY, 5=OTHER
void addExerciseImages(
List<File> images, {
String? title,
String? author,
String? authorUrl,
String? sourceUrl,
String? derivativeSourceUrl,
String style = '1',
}) {
void addExerciseImages(List<ExerciseSubmissionImage> images) {
_exerciseImages.addAll(images);
// Store metadata for each image
for (final image in images) {
final details = <String, String>{'style': style};
// Only add non-empty fields
if (title != null && title.isNotEmpty) {
details['license_title'] = title;
}
if (author != null && author.isNotEmpty) {
details['license_author'] = author;
}
if (authorUrl != null && authorUrl.isNotEmpty) {
details['license_author_url'] = authorUrl;
}
if (sourceUrl != null && sourceUrl.isNotEmpty) {
details['license_object_url'] = sourceUrl;
}
if (derivativeSourceUrl != null && derivativeSourceUrl.isNotEmpty) {
details['license_derivative_source_url'] = derivativeSourceUrl;
}
_imageDetails[image.path] = details;
}
notifyListeners();
}
void removeExercise(String path) {
final file = _exerciseImages.where((element) => element.path == path).first;
void removeImage(String path) {
final file = _exerciseImages.where((element) => element.imageFile.path == path).first;
_exerciseImages.remove(file);
_imageDetails.remove(path);
notifyListeners();
}
@@ -199,16 +152,14 @@ class AddExerciseProvider with ChangeNotifier {
///
/// Returns the ID of the created exercise
/// Throws exception if submission fails
Future<int> addExercise() async {
Future<int> postExerciseToServer() async {
try {
// 1. Create the exercise
final exerciseId = await addExerciseSubmission();
// 2. Upload images if any exist
if (_exerciseImages.isNotEmpty) {
await addImages(exerciseId);
}
// 3. Clear all data after successful upload
@@ -216,7 +167,6 @@ class AddExerciseProvider with ChangeNotifier {
return exerciseId;
} catch (e) {
// Don't clear on error so user can retry
rethrow;
}
@@ -233,25 +183,19 @@ class AddExerciseProvider with ChangeNotifier {
}
/// Upload exercise images with license metadata
///
/// For each image:
/// - Sends multipart request with image file
/// - Includes license fields from _imageDetails map
Future<void> addImages(int exerciseId) async {
for (final image in _exerciseImages) {
final request = http.MultipartRequest('POST', baseProvider.makeUrl(_imagesUrlPath));
request.headers.addAll(baseProvider.getDefaultHeaders(includeAuth: true));
request.files.add(await http.MultipartFile.fromPath('image', image.path));
request.files.add(await http.MultipartFile.fromPath('image', image.imageFile.path));
request.fields['exercise'] = exerciseId.toString();
request.fields['license'] = '1';
request.fields['license'] = CC_BY_SA_4_ID.toString();
request.fields['is_main'] = 'false';
final details = _imageDetails[image.path];
if (details != null && details.isNotEmpty) {
final details = image.toJson();
if (details.isNotEmpty) {
request.fields.addAll(details);
} else {
request.fields['style'] = '1';
}
try {
@@ -280,4 +224,4 @@ class AddExerciseProvider with ChangeNotifier {
return false;
}
}
}

View File

@@ -251,7 +251,7 @@ class AuthProvider with ChangeNotifier {
headers: {
HttpHeaders.contentTypeHeader: 'application/json; charset=UTF-8',
HttpHeaders.userAgentHeader: getAppNameHeader(),
HttpHeaders.authorizationHeader: 'Token $token'
HttpHeaders.authorizationHeader: 'Token $token',
},
);
if (response.statusCode != 200) {
@@ -294,7 +294,8 @@ class AuthProvider with ChangeNotifier {
String getAppNameHeader() {
String out = '';
if (applicationVersion != null) {
out = '/${applicationVersion!.version} '
out =
'/${applicationVersion!.version} '
'(${applicationVersion!.packageName}; '
'build: ${applicationVersion!.buildNumber})'
' - https://github.com/wger-project';

View File

@@ -68,10 +68,12 @@ class BodyWeightProvider with ChangeNotifier {
_logger.info('Fetching all body weight entries');
// Process the response
final data = await baseProvider.fetchPaginated(baseProvider.makeUrl(
BODY_WEIGHT_URL,
query: {'ordering': '-date', 'limit': API_MAX_PAGE_SIZE},
));
final data = await baseProvider.fetchPaginated(
baseProvider.makeUrl(
BODY_WEIGHT_URL,
query: {'ordering': '-date', 'limit': API_MAX_PAGE_SIZE},
),
);
_entries = [];
for (final entry in data) {
_entries.add(WeightEntry.fromJson(entry));

View File

@@ -42,7 +42,7 @@ class ExercisesProvider with ChangeNotifier {
ExerciseDatabase database;
ExercisesProvider(this.baseProvider, {ExerciseDatabase? database})
: database = database ?? locator<ExerciseDatabase>();
: database = database ?? locator<ExerciseDatabase>();
static const EXERCISE_CACHE_DAYS = 7;
static const CACHE_VERSION = 4;
@@ -118,17 +118,13 @@ class ExercisesProvider with ChangeNotifier {
exerciseCategories: FilterCategory(
title: 'Category',
items: Map.fromEntries(
_categories.map(
(category) => MapEntry<ExerciseCategory, bool>(category, false),
),
_categories.map((category) => MapEntry<ExerciseCategory, bool>(category, false)),
),
),
equipment: FilterCategory(
title: 'Equipment',
items: Map.fromEntries(
_equipment.map(
(singleEquipment) => MapEntry<Equipment, bool>(singleEquipment, false),
),
_equipment.map((singleEquipment) => MapEntry<Equipment, bool>(singleEquipment, false)),
),
),
),
@@ -191,10 +187,7 @@ class ExercisesProvider with ChangeNotifier {
/// returned exercises. Since this is typically called by one exercise, we are
/// not interested in seeing that same exercise returned in the list of variations.
/// If this parameter is not passed, all exercises are returned.
List<Exercise> findExercisesByVariationId(
int? variationId, {
int? exerciseIdToExclude,
}) {
List<Exercise> findExercisesByVariationId(int? variationId, {int? exerciseIdToExclude}) {
if (variationId == null) {
return [];
}
@@ -317,18 +310,16 @@ class ExercisesProvider with ChangeNotifier {
/// -> yes: Do we need to re-fetch?
/// -> no: just return what we have in the DB
/// -> yes: fetch data and update if necessary
Future<Exercise> handleUpdateExerciseFromApi(
ExerciseDatabase database,
int exerciseId,
) async {
Future<Exercise> handleUpdateExerciseFromApi(ExerciseDatabase database, int exerciseId) async {
Exercise exercise;
// NOTE: this should not be necessary anymore. We had a bug that would
// create duplicate entries in the database and should be fixed now.
// However, we keep it here for now to be on the safe side.
// In the future this can be replaced by a .getSingleOrNull()
final exerciseResult =
await (database.select(database.exercises)..where((e) => e.id.equals(exerciseId))).get();
final exerciseResult = await (database.select(
database.exercises,
)..where((e) => e.id.equals(exerciseId))).get();
ExerciseTable? exerciseDb;
if (exerciseResult.isNotEmpty) {
@@ -383,7 +374,9 @@ class ExercisesProvider with ChangeNotifier {
exercise = Exercise.fromApiDataJson(exerciseData, _languages);
if (exerciseDb == null) {
await database.into(database.exercises).insert(
await database
.into(database.exercises)
.insert(
ExercisesCompanion.insert(
id: exercise.id!,
data: jsonEncode(exerciseData),
@@ -426,6 +419,7 @@ class ExercisesProvider with ChangeNotifier {
}
Future<void> clearAllCachesAndPrefs() async {
clear();
await database.deleteEverything();
await initCacheTimesLocalPrefs(forceInit: true);
}
@@ -480,13 +474,15 @@ class ExercisesProvider with ChangeNotifier {
// Insert new entries and update ones that have been edited
Future.forEach(data, (exerciseData) async {
final exercise = await (database.select(database.exercises)
..where((e) => e.id.equals(exerciseData['id'])))
.getSingleOrNull();
final exercise = await (database.select(
database.exercises,
)..where((e) => e.id.equals(exerciseData['id']))).getSingleOrNull();
// New exercise, insert
if (exercise == null) {
database.into(database.exercises).insert(
database
.into(database.exercises)
.insert(
ExercisesCompanion.insert(
id: exerciseData['id'],
data: jsonEncode(exerciseData),
@@ -537,15 +533,10 @@ class ExercisesProvider with ChangeNotifier {
await fetchAndSetMusclesFromApi();
await database.delete(database.muscles).go();
await Future.forEach(_muscles, (e) async {
await database.into(database.muscles).insert(
MusclesCompanion.insert(id: e.id, data: e),
);
await database.into(database.muscles).insert(MusclesCompanion.insert(id: e.id, data: e));
});
validTill = DateTime.now().add(const Duration(days: EXERCISE_CACHE_DAYS));
await prefs.setString(
PREFS_LAST_UPDATED_MUSCLES,
validTill.toIso8601String(),
);
await prefs.setString(PREFS_LAST_UPDATED_MUSCLES, validTill.toIso8601String());
_logger.fine('Saved ${_muscles.length} muscles to cache (valid till $validTill)');
}
@@ -571,15 +562,12 @@ class ExercisesProvider with ChangeNotifier {
await fetchAndSetCategoriesFromApi();
await database.delete(database.categories).go();
await Future.forEach(_categories, (e) async {
await database.into(database.categories).insert(
CategoriesCompanion.insert(id: e.id, data: e),
);
await database
.into(database.categories)
.insert(CategoriesCompanion.insert(id: e.id, data: e));
});
validTill = DateTime.now().add(const Duration(days: EXERCISE_CACHE_DAYS));
await prefs.setString(
PREFS_LAST_UPDATED_CATEGORIES,
validTill.toIso8601String(),
);
await prefs.setString(PREFS_LAST_UPDATED_CATEGORIES, validTill.toIso8601String());
_logger.fine('Saved ${_categories.length} categories to cache (valid till $validTill)');
}
@@ -605,16 +593,11 @@ class ExercisesProvider with ChangeNotifier {
await fetchAndSetLanguagesFromApi();
await database.delete(database.languages).go();
await Future.forEach(_languages, (e) async {
await database.into(database.languages).insert(
LanguagesCompanion.insert(id: e.id, data: e),
);
await database.into(database.languages).insert(LanguagesCompanion.insert(id: e.id, data: e));
});
validTill = DateTime.now().add(const Duration(days: EXERCISE_CACHE_DAYS));
await prefs.setString(
PREFS_LAST_UPDATED_LANGUAGES,
validTill.toIso8601String(),
);
await prefs.setString(PREFS_LAST_UPDATED_LANGUAGES, validTill.toIso8601String());
_logger.info('Saved ${languages.length} languages to cache (valid till $validTill)');
}
@@ -640,15 +623,12 @@ class ExercisesProvider with ChangeNotifier {
await fetchAndSetEquipmentsFromApi();
await database.delete(database.equipments).go();
await Future.forEach(_equipment, (e) async {
await database.into(database.equipments).insert(
EquipmentsCompanion.insert(id: e.id, data: e),
);
await database
.into(database.equipments)
.insert(EquipmentsCompanion.insert(id: e.id, data: e));
});
validTill = DateTime.now().add(const Duration(days: EXERCISE_CACHE_DAYS));
await prefs.setString(
PREFS_LAST_UPDATED_EQUIPMENT,
validTill.toIso8601String(),
);
await prefs.setString(PREFS_LAST_UPDATED_EQUIPMENT, validTill.toIso8601String());
_logger.fine('Saved ${_equipment.length} equipment entries to cache (valid till $validTill)');
}
@@ -703,17 +683,9 @@ class FilterCategory<T> {
List<T> get selected => [...items.keys].where((key) => items[key]!).toList();
FilterCategory({
required this.title,
required this.items,
this.isExpanded = false,
});
FilterCategory({required this.title, required this.items, this.isExpanded = false});
FilterCategory<T> copyWith({
bool? isExpanded,
Map<T, bool>? items,
String? title,
}) {
FilterCategory<T> copyWith({bool? isExpanded, Map<T, bool>? items, String? title}) {
return FilterCategory(
isExpanded: isExpanded ?? this.isExpanded,
items: items ?? this.items,

Some files were not shown because too many files have changed in this diff Show More