Skip to content
Merged
Show file tree
Hide file tree
Changes from 43 commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
cd64269
Create intl_it.arb
contusionglory May 25, 2025
914dca9
chore: increase off timeout duration
simonoppowa May 29, 2025
40eb482
chore: add contributors section to readme
simonoppowa May 29, 2025
75ed0f0
v1.0.1+42
simonoppowa May 29, 2025
34684e9
Updated GettingStarted docs.
Drexel2k Jul 7, 2025
3e9c9bb
chore: enforce dart formatting in CI (#219)
TomAFrench Aug 11, 2025
e70d250
fix: edit base quantity reset keyboard bug
LGKentang Aug 20, 2025
ce35ec2
chore: enforce consistency of translations in CI (#268)
TomAFrench Aug 27, 2025
5d365fe
added Ukrainian translation
Ihor-Khomenko Sep 23, 2025
ae1b1be
Increased limit of recently added foods.
May 14, 2025
efce918
Increased limit of recently added activities.
May 14, 2025
f06f00c
Added Czech translation.
May 16, 2025
aab6295
chore: active cz translations
simonoppowa Jan 18, 2026
64ecd09
ci: exclude failing run ci step
simonoppowa Jan 18, 2026
6b4c8c6
Merge pull request #203 from Kopromaster/main
simonoppowa Jan 18, 2026
09504e0
Fix negative weight
Elxas866 Oct 12, 2025
cd5fa6f
Fix negative height
Elxas866 Oct 12, 2025
127c4ab
Merge pull request #285 from Elxas866/216-217-no-negative-values
simonoppowa Jan 18, 2026
a8f78bb
Add l10n for metric label in German
Elxas866 Oct 12, 2025
d3dbc7e
remove generated linux folder
Elxas866 Oct 12, 2025
9396db0
chore: change de metric label
simonoppowa Jan 18, 2026
e6d35e1
Merge pull request #283 from Elxas866/282-l10n-units-fix
simonoppowa Jan 18, 2026
262ad03
chore: add uk translations
simonoppowa Jan 22, 2026
52a56c2
Merge pull request #278 from Ihor-Khomenko/Ukrainian-language
simonoppowa Jan 22, 2026
ecf6e89
Merge remote-tracking branch 'origin/develop' into pr/271
simonoppowa Jan 22, 2026
9f5a52e
Merge pull request #271 from LGKentang/fix/edit-base-quantity-keyboar…
simonoppowa Jan 22, 2026
c43104c
Merge remote-tracking branch 'origin/develop' into pr/254
simonoppowa Jan 22, 2026
3654db1
Merge pull request #254 from Drexel2k/main
simonoppowa Jan 22, 2026
2739737
chore: add it translations
simonoppowa Jan 22, 2026
451dcf3
Merge pull request #228 from contusionglory/main
simonoppowa Jan 22, 2026
61e8f7e
Fix single NULL value leading to empty results
Elxas866 Mar 1, 2026
ba43467
implement "x kcal too much" when exceeding calorie goal.
Elxas866 Mar 3, 2026
d7072db
fix(onboarding): move keyboard focus from height to weight
LarytheLord Mar 3, 2026
9c646a2
Merge pull request #307 from Elxas866/306-fix-query-crash
simonoppowa Apr 12, 2026
f18e604
Merge pull request #310 from Elxas866/309-feature-show-exceeded-kcals
simonoppowa Apr 12, 2026
9941a40
Merge pull request #311 from LarytheLord/fix/onboarding-next-key-243
simonoppowa Apr 12, 2026
2a7a6b8
chore: add intl texts
simonoppowa Apr 12, 2026
61a3787
fix(onboarding): fix weight input focus exception
simonoppowa Apr 12, 2026
26203eb
1.1.0+43
simonoppowa Apr 12, 2026
1b856fb
Merge pull request #322 from simonoppowa/fix-focus-node-onboarding
simonoppowa Apr 12, 2026
3a92d37
Fix variable shadowing in updateTrackedDay settings_bloc.dart
Copilot Apr 12, 2026
714e905
Fix getRecentlyAddedUserActivity sorting discarded on temp list
Copilot Apr 12, 2026
5d221fc
Move intl_translation to dev_dependencies
Copilot Apr 12, 2026
e057947
Update .metadata
simonoppowa Apr 12, 2026
96ddf4f
docs: fix typos
simonoppowa Apr 12, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 11 additions & 16 deletions .github/workflows/default_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v3

- uses: actions/setup-java@v2
with:
distribution: 'zulu'
Expand All @@ -30,6 +31,9 @@ jobs:
flutter-version: '3.27.1'
channel: 'stable'
cache: true

- name: Setup Just
uses: taiki-e/install-action@just

- name: Cache Flutter packages
uses: actions/cache@v4
Expand All @@ -39,19 +43,10 @@ jobs:
restore-keys: |
${{ runner.os }}-pub-cache-

- name: Install Pub Dependencies
run: flutter pub get

- name: Build with secrets
run: flutter pub run build_runner build --delete-conflicting-outputs
env:
FDC_API_KEY: ${{ secrets.FDC_API_KEY }}
SENTRY_DNS: ${{ secrets.SENTRY_DNS }}
SUPABASE_PROJECT_ANON_KEY: ${{ secrets.SUPABASE_PROJECT_ANON_KEY }}
SUPABASE_PROJECT_URL: ${{ secrets.SUPABASE_PROJECT_URL }}

- name: Analyze Code
run: flutter analyze

- name: Run Tests
run: flutter test
# - name: Run CI
# run: just ci
# env:
# FDC_API_KEY: ${{ secrets.FDC_API_KEY }}
# SENTRY_DNS: ${{ secrets.SENTRY_DNS }}
# SUPABASE_PROJECT_ANON_KEY: ${{ secrets.SUPABASE_PROJECT_ANON_KEY }}
# SUPABASE_PROJECT_URL: ${{ secrets.SUPABASE_PROJECT_URL }}
19 changes: 8 additions & 11 deletions .metadata
Original file line number Diff line number Diff line change
@@ -1,26 +1,23 @@
# This file tracks properties of this Flutter project.
# Used by Flutter tool to assess capabilities and perform upgrades etc.
#
# This file should be version controlled.
# This file should be version controlled and should not be manually edited.

version:
revision: e3c29ec00c9c825c891d75054c63fcc46454dca1
channel: stable
revision: "35c388afb57ef061d06a39b537336c87e0e3d1b1"
channel: "[user-branch]"
Comment thread
simonoppowa marked this conversation as resolved.
Outdated

project_type: app

# Tracks metadata for the flutter migrate command
migration:
platforms:
- platform: root
create_revision: e3c29ec00c9c825c891d75054c63fcc46454dca1
base_revision: e3c29ec00c9c825c891d75054c63fcc46454dca1
- platform: android
create_revision: e3c29ec00c9c825c891d75054c63fcc46454dca1
base_revision: e3c29ec00c9c825c891d75054c63fcc46454dca1
- platform: ios
create_revision: e3c29ec00c9c825c891d75054c63fcc46454dca1
base_revision: e3c29ec00c9c825c891d75054c63fcc46454dca1
create_revision: 35c388afb57ef061d06a39b537336c87e0e3d1b1
base_revision: 35c388afb57ef061d06a39b537336c87e0e3d1b1
- platform: web
create_revision: 35c388afb57ef061d06a39b537336c87e0e3d1b1
base_revision: 35c388afb57ef061d06a39b537336c87e0e3d1b1

# User provided section

Expand Down
65 changes: 35 additions & 30 deletions GettingStarted.md
Original file line number Diff line number Diff line change
@@ -1,46 +1,51 @@
# Getting Started
# Getting started
## Android development with Windows 11
This IDE setup ist tested on Windows 11.
Comment thread
simonoppowa marked this conversation as resolved.
Outdated

For setup first you need the following things:
- Flutter Version 3.27.1
- Android SDK and Android Emulator
- Flutter
- IDE like Android Studio or VS Code with Flutter Plugin installed.

## Steps to run App
1.⁠ ⁠Clone the repository with Git
Use paths for SDKs without spaces and sepcial characers.
Comment thread
simonoppowa marked this conversation as resolved.
Outdated

```git clone https://github.com/simonoppowa/OpenNutriTracker.git```
### Setup Android SDK and Emulator
1. Download Android Studio from https://developer.android.com/studio and install. Keep "Android Virtual Device" checked. Start Android Studio after installation.

2.⁠ ⁠Get Dependencies
2. Install the Android SDK when asked.

```flutter pub get```
3. After finishing the SDK installation you should the "Welcome to Android Studio" Screen. Click on "More Actions" -> "SDK Manager", switch to "SDK Tools" tab and check "Android SDK Command-line Tools (latest)", click "OK" and install the tools.

3.⁠ ⁠Run Build Runner to generate Files
4. Check under "More Actions" -> "Virtual Device Manager" if a virtual phone was set up, if not create one, e.g. a Medium Phone with Default Settings.

```flutter pub run build_runner build```
5. Close Android Studio.

### Setup Flutter SDK
1. Download Flutter 3.27.1 from https://docs.flutter.dev/install/archive and extract.

2. Add the bin folder in the folder where you extracted Flutter to the Path variable in "Advanced System Settings" -> "Environement Variables..." -> "System variables" -> "Path"
Comment thread
simonoppowa marked this conversation as resolved.
Outdated

### Setup the Workspace in Visual Studio Code (VSC)
1. Create a new folder, open the folder in VSC.

4.⁠ ⁠Run App
2. Configure the Android SDK path for Flutter:

```flutter run lib/main.dart```
```flutter config --android-sdk "e:\path\to\androidSDK"```

## Running the Application
3.⁠ ⁠Clone the repository with git in a VSC terminal (make sure the active folder in the terminal is your created folder from step 1):

The application can be run on multiple platforms. Here are the commands for each:
```git clone https://github.com/simonoppowa/OpenNutriTracker.git .```

### Web (Chrome)
```bash
flutter run -d chrome
```
4.⁠ ⁠Get Dependencies.

```flutter pub get```

5.⁠ ⁠Run Build Runner to generate Files.

```flutter pub run build_runner build```

### iOS
```bash
open -a Simulator
flutter run
```
At the best revert all the visible generated files now, only env.g.dart is needed, it is not checked in because it is in .gitignore.

### macOS
```bash
flutter run -d macos
```
6.⁠ ⁠Restart VSC, VSC detects now that this is a flutter project. On the Bottom Right "No Device" ist displayed, click on it, then select "Start Medium Phone" on the command Palette on the top. Wait for the phone to boot up.

### Android
```bash
flutter run -d android
```
7. Press F5 to start a debug session (may taka a while on the first time). Keep the virtual phone running all the time, just start and stop Debugging.
Comment thread
simonoppowa marked this conversation as resolved.
Outdated
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,13 @@ See [Data Protection](https://www.iubenda.com/privacy-policy/53501884)
## Contribution
Contributions to OpenNutriTracker are welcome! If you find any issues or have suggestions for new features, please open an issue or submit a pull request. Make sure to follow the project's code style and guidelines.

## Getting Started
See the [Getting Started](GettingStarted.md) file for more information.
Thanks to all the contributors:
<a href="https://github.com/simonoppowa/OpenNutriTracker/graphs/contributors">
<img src="https://contrib.rocks/image?repo=simonoppowa/OpenNutriTracker" />
</a>

### Getting Started With Development
See the [Getting Started](GettingStarted.md) file for more information.

## Disclaimer
OpenNutriTracker is not a medical application. All data provided is not validated and should be used with caution. Please maintain a healthy lifestyle and consult a professional if you have any problems. Use during illness, pregnancy or lactation is not recommended.
Expand All @@ -78,4 +82,4 @@ For questions, suggestions, or collaborations, feel free to contact the project
Simon Oppowa

- GitHub: [@simonoppowa](https://github.com/simonoppowa)
- Email: [opennutritracker-dev@pm.me](mailto:opennutritracker-dev@pm.me)
- Email: [opennutritracker-dev@pm.me](mailto:opennutritracker-dev@pm.me)
6 changes: 6 additions & 0 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@
# packages, and plugins designed to encourage good coding practices.
include: package:flutter_lints/flutter.yaml

analyzer:
# generated files throw `unnecessary_string_escapes` lint so we ignore warnings.
# TODO: inject `ignore_for_file` as described below.
exclude:
- lib/generated/intl/*.dart

linter:
# The lint rules applied to this project can be customized in the
# section below to disable rules from the `package:flutter_lints/flutter.yaml`
Expand Down
29 changes: 29 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
intl_output_dir := "./lib/generated/intl/"

# Install dependencies
install:
flutter pub get

# Build OpenNutriTracker
build:
flutter pub run build_runner build --delete-conflicting-outputs

# Format dart code
format *OPTIONS:
dart format {{OPTIONS}} ./lib ./test

# Regenerate intl files
run_intl: && format
dart run intl_translation:generate_from_arb --output-dir {{intl_output_dir}} lib/**/*.dart ./lib/l10n/*.arb

# Check if intl files are correctly generated
check_intl: run_intl
git diff --exit-code {{intl_output_dir}}

# Run tests
test:
flutter test

# Run CI checks
ci: install (format "--set-exit-if-changed") check_intl build && test
flutter analyze
9 changes: 6 additions & 3 deletions lib/core/data/data_source/config_data_source.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,19 @@ class ConfigDataSource {

Future<void> setConfigDisclaimer(bool hasAcceptedDisclaimer) async {
_log.fine(
'Updating config hasAcceptedDisclaimer to $hasAcceptedDisclaimer');
'Updating config hasAcceptedDisclaimer to $hasAcceptedDisclaimer',
);
final config = _configBox.get(_configKey);
config?.hasAcceptedDisclaimer = hasAcceptedDisclaimer;
config?.save();
}

Future<void> setConfigAcceptedAnonymousData(
bool hasAcceptedAnonymousData) async {
bool hasAcceptedAnonymousData,
) async {
_log.fine(
'Updating config hasAcceptedAnonymousData to $hasAcceptedAnonymousData');
'Updating config hasAcceptedAnonymousData to $hasAcceptedAnonymousData',
);
final config = _configBox.get(_configKey);
config?.hasAcceptedSendAnonymousData = hasAcceptedAnonymousData;
config?.save();
Expand Down
46 changes: 28 additions & 18 deletions lib/core/data/data_source/intake_data_source.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,24 @@ class IntakeDataSource {

Future<void> deleteIntakeFromId(String intakeId) async {
log.fine('Deleting intake item from db');
_intakeBox.values
.where((dbo) => dbo.id == intakeId)
.toList()
.forEach((element) {
_intakeBox.values.where((dbo) => dbo.id == intakeId).toList().forEach((
element,
) {
element.delete();
});
}

Future<IntakeDBO?> updateIntake(String intakeId, Map<String, dynamic> fields) async {
log.fine('Updating intake $intakeId with fields ${fields.toString()} in db');
Future<IntakeDBO?> updateIntake(
String intakeId,
Map<String, dynamic> fields,
) async {
log.fine(
'Updating intake $intakeId with fields ${fields.toString()} in db',
);
var intakeObject = _intakeBox.values.indexed
.where((indexedDbo) => indexedDbo.$2.id == intakeId).firstOrNull;
if(intakeObject == null) {
.where((indexedDbo) => indexedDbo.$2.id == intakeId)
.firstOrNull;
if (intakeObject == null) {
log.fine('Cannot update intake $intakeId as it is non existent');
return null;
}
Expand All @@ -46,7 +51,7 @@ class IntakeDataSource {

Future<IntakeDBO?> getIntakeById(String intakeId) async {
return _intakeBox.values.firstWhereOrNull(
(intake) => intake.id == intakeId
(intake) => intake.id == intakeId,
);
}

Expand All @@ -55,25 +60,30 @@ class IntakeDataSource {
}

Future<List<IntakeDBO>> getAllIntakesByDate(
IntakeTypeDBO intakeType, DateTime dateTime) async {
IntakeTypeDBO intakeType,
DateTime dateTime,
) async {
return _intakeBox.values
.where((intake) =>
DateUtils.isSameDay(dateTime, intake.dateTime) &&
intake.type == intakeType)
.where(
(intake) =>
DateUtils.isSameDay(dateTime, intake.dateTime) &&
intake.type == intakeType,
)
.toList();
}

Future<List<IntakeDBO>> getRecentlyAddedIntake({int number = 100}) async {
Future<List<IntakeDBO>> getRecentlyAddedIntake({int number = 100000}) async {
final intakeList = _intakeBox.values.toList();

// sort list by date (newest first) and filter unique intake
intakeList
.sort((a, b) => (-1) * a.dateTime.compareTo(b.dateTime));
intakeList.sort((a, b) => (-1) * a.dateTime.compareTo(b.dateTime));

final filterCodes = <String>{};
final uniqueIntake = intakeList
.where((intake) =>
filterCodes.add(intake.meal.code ?? intake.meal.name ?? ""))
.where(
(intake) =>
filterCodes.add(intake.meal.code ?? intake.meal.name ?? ""),
)
.toList();

return uniqueIntake.take(number).toList();
Expand Down
Loading