├── linux ├── .gitignore ├── main.cc ├── my_application.h ├── flutter │ └── CMakeLists.txt └── my_application.cc ├── ios ├── Flutter │ ├── Debug.xcconfig │ ├── Release.xcconfig │ └── AppFrameworkInfo.plist ├── Runner │ ├── Runner-Bridging-Header.h │ ├── Assets.xcassets │ │ ├── LaunchImage.imageset │ │ │ ├── LaunchImage.png │ │ │ ├── LaunchImage@2x.png │ │ │ ├── LaunchImage@3x.png │ │ │ ├── README.md │ │ │ └── Contents.json │ │ └── AppIcon.appiconset │ │ │ ├── Icon-App-20x20@1x.png │ │ │ ├── Icon-App-20x20@2x.png │ │ │ ├── Icon-App-20x20@3x.png │ │ │ ├── Icon-App-29x29@1x.png │ │ │ ├── Icon-App-29x29@2x.png │ │ │ ├── Icon-App-29x29@3x.png │ │ │ ├── Icon-App-40x40@1x.png │ │ │ ├── Icon-App-40x40@2x.png │ │ │ ├── Icon-App-40x40@3x.png │ │ │ ├── Icon-App-60x60@2x.png │ │ │ ├── Icon-App-60x60@3x.png │ │ │ ├── Icon-App-76x76@1x.png │ │ │ ├── Icon-App-76x76@2x.png │ │ │ ├── Icon-App-1024x1024@1x.png │ │ │ ├── Icon-App-83.5x83.5@2x.png │ │ │ └── Contents.json │ ├── AppDelegate.swift │ ├── Base.lproj │ │ ├── Main.storyboard │ │ └── LaunchScreen.storyboard │ └── Info.plist ├── Runner.xcodeproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ ├── WorkspaceSettings.xcsettings │ │ │ └── IDEWorkspaceChecks.plist │ └── xcshareddata │ │ └── xcschemes │ │ └── Runner.xcscheme ├── Runner.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ ├── WorkspaceSettings.xcsettings │ │ └── IDEWorkspaceChecks.plist └── .gitignore ├── web ├── favicon.png ├── icons │ ├── Icon-192.png │ ├── Icon-512.png │ ├── Icon-maskable-192.png │ └── Icon-maskable-512.png ├── manifest.json └── index.html ├── macos ├── Flutter │ ├── Flutter-Debug.xcconfig │ └── Flutter-Release.xcconfig ├── Runner │ ├── Configs │ │ ├── Debug.xcconfig │ │ ├── Release.xcconfig │ │ ├── Warnings.xcconfig │ │ └── AppInfo.xcconfig │ ├── Assets.xcassets │ │ └── AppIcon.appiconset │ │ │ ├── app_icon_128.png │ │ │ ├── app_icon_16.png │ │ │ ├── app_icon_256.png │ │ │ ├── app_icon_32.png │ │ │ ├── app_icon_512.png │ │ │ ├── app_icon_64.png │ │ │ ├── app_icon_1024.png │ │ │ └── Contents.json │ ├── AppDelegate.swift │ ├── Release.entitlements │ ├── DebugProfile.entitlements │ ├── MainFlutterWindow.swift │ └── Info.plist ├── .gitignore ├── Runner.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist └── Runner.xcodeproj │ ├── project.xcworkspace │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist │ └── xcshareddata │ └── xcschemes │ └── Runner.xcscheme ├── screenshots ├── title.png ├── Screens.png └── dynamic_theme.gif ├── android ├── gradle.properties ├── app │ ├── src │ │ ├── main │ │ │ ├── res │ │ │ │ ├── mipmap-hdpi │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ ├── ic_launcher_background.png │ │ │ │ │ ├── ic_launcher_foreground.png │ │ │ │ │ └── ic_launcher_monochrome.png │ │ │ │ ├── mipmap-mdpi │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ ├── ic_launcher_background.png │ │ │ │ │ ├── ic_launcher_foreground.png │ │ │ │ │ └── ic_launcher_monochrome.png │ │ │ │ ├── mipmap-xhdpi │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ ├── ic_launcher_background.png │ │ │ │ │ ├── ic_launcher_foreground.png │ │ │ │ │ └── ic_launcher_monochrome.png │ │ │ │ ├── mipmap-xxhdpi │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ ├── ic_launcher_background.png │ │ │ │ │ ├── ic_launcher_foreground.png │ │ │ │ │ └── ic_launcher_monochrome.png │ │ │ │ ├── mipmap-xxxhdpi │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ ├── ic_launcher_background.png │ │ │ │ │ ├── ic_launcher_foreground.png │ │ │ │ │ └── ic_launcher_monochrome.png │ │ │ │ ├── mipmap-anydpi-v26 │ │ │ │ │ └── ic_launcher.xml │ │ │ │ ├── drawable │ │ │ │ │ └── launch_background.xml │ │ │ │ ├── drawable-v21 │ │ │ │ │ └── launch_background.xml │ │ │ │ ├── values │ │ │ │ │ └── styles.xml │ │ │ │ └── values-night │ │ │ │ │ └── styles.xml │ │ │ ├── kotlin │ │ │ │ └── com │ │ │ │ │ └── example │ │ │ │ │ └── odyssey_2 │ │ │ │ │ └── MainActivity.kt │ │ │ └── AndroidManifest.xml │ │ ├── debug │ │ │ └── AndroidManifest.xml │ │ └── profile │ │ │ └── AndroidManifest.xml │ └── build.gradle ├── gradle │ └── wrapper │ │ └── gradle-wrapper.properties ├── .gitignore ├── settings.gradle └── build.gradle ├── windows ├── runner │ ├── resources │ │ └── app_icon.ico │ ├── resource.h │ ├── utils.h │ ├── runner.exe.manifest │ ├── flutter_window.h │ ├── main.cpp │ ├── CMakeLists.txt │ ├── utils.cpp │ ├── flutter_window.cpp │ ├── Runner.rc │ └── win32_window.h ├── .gitignore ├── flutter │ └── CMakeLists.txt └── CMakeLists.txt ├── l10n.yaml ├── lib ├── src │ ├── localization │ │ ├── app_en.arb │ │ └── string_hardcoded.dart │ ├── routing │ │ ├── app_routes.dart │ │ ├── not_found_screen.dart │ │ └── app_router.dart │ ├── constants │ │ ├── breakpoints.dart │ │ └── app_sizes.dart │ ├── features │ │ ├── mood_records │ │ │ ├── domain │ │ │ │ ├── add_mood_record │ │ │ │ │ └── mood_option.dart │ │ │ │ └── mood_log │ │ │ │ │ ├── mood_record.dart │ │ │ │ │ └── mood_record.g.dart │ │ │ ├── data │ │ │ │ ├── add_mood_record │ │ │ │ │ └── mood_configurations.dart │ │ │ │ └── mood_log │ │ │ │ │ └── mood_record_repository.dart │ │ │ └── presentation │ │ │ │ ├── mood_log │ │ │ │ ├── mood_log_screen_controller.dart │ │ │ │ ├── mood_record_group.dart │ │ │ │ ├── mood_record_card_options.dart │ │ │ │ └── mood_log_screen.dart │ │ │ │ └── add_mood_record │ │ │ │ ├── mood_option.dart │ │ │ │ └── add_mood_record_form_controller.dart │ │ ├── activities │ │ │ ├── model │ │ │ │ ├── activity.dart │ │ │ │ └── activity.g.dart │ │ │ ├── data │ │ │ │ ├── activity_repository.dart │ │ │ │ └── activity_categories.dart │ │ │ └── presentation │ │ │ │ ├── activity_group.dart │ │ │ │ ├── activity_chips.dart │ │ │ │ └── activity_selector_screen.dart │ │ └── analytics │ │ │ └── presentation │ │ │ ├── analytics_screen.dart │ │ │ ├── chart_frame_controller.dart │ │ │ ├── chart_frame_card.dart │ │ │ └── mood_count_bar_chart.dart │ ├── utils │ │ └── widgets │ │ │ ├── scafforld_with_botto_navigation_bar_item.dart │ │ │ ├── responsive_centered.dart │ │ │ └── scafforld_with_botto_navigation_bar.dart │ └── app.dart └── main.dart ├── test └── src │ └── features │ └── mood_entries │ └── presentation │ └── add_mood_record_form_controller_test.dart ├── assets └── mood_icons │ ├── neutral.svg │ ├── nervous.svg │ ├── confused.svg │ ├── angry.svg │ ├── sad.svg │ ├── bandaged.svg │ ├── dizzy.svg │ ├── crying.svg │ ├── calm.svg │ ├── tongue.svg │ ├── frown.svg │ ├── glasses.svg │ ├── fever.svg │ ├── sweating.svg │ ├── woozy.svg │ ├── nauseous.svg │ ├── loudly_crying.svg │ ├── smile.svg │ ├── sleepy.svg │ ├── expectorate.svg │ ├── vomitting.svg │ ├── happy.svg │ └── coughing.svg ├── README.md ├── pubspec.yaml ├── analysis_options.yaml └── .gitignore /linux/.gitignore: -------------------------------------------------------------------------------- 1 | flutter/ephemeral 2 | -------------------------------------------------------------------------------- /ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /ios/Runner/Runner-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import "GeneratedPluginRegistrant.h" 2 | -------------------------------------------------------------------------------- /web/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jccb15/happio/HEAD/web/favicon.png -------------------------------------------------------------------------------- /macos/Flutter/Flutter-Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "ephemeral/Flutter-Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /macos/Flutter/Flutter-Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "ephemeral/Flutter-Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /screenshots/title.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jccb15/happio/HEAD/screenshots/title.png -------------------------------------------------------------------------------- /web/icons/Icon-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jccb15/happio/HEAD/web/icons/Icon-192.png -------------------------------------------------------------------------------- /web/icons/Icon-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jccb15/happio/HEAD/web/icons/Icon-512.png -------------------------------------------------------------------------------- /screenshots/Screens.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jccb15/happio/HEAD/screenshots/Screens.png -------------------------------------------------------------------------------- /screenshots/dynamic_theme.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jccb15/happio/HEAD/screenshots/dynamic_theme.gif -------------------------------------------------------------------------------- /web/icons/Icon-maskable-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jccb15/happio/HEAD/web/icons/Icon-maskable-192.png -------------------------------------------------------------------------------- /web/icons/Icon-maskable-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jccb15/happio/HEAD/web/icons/Icon-maskable-512.png -------------------------------------------------------------------------------- /android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | android.useAndroidX=true 3 | android.enableJetifier=true 4 | -------------------------------------------------------------------------------- /macos/Runner/Configs/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "../../Flutter/Flutter-Debug.xcconfig" 2 | #include "Warnings.xcconfig" 3 | -------------------------------------------------------------------------------- /windows/runner/resources/app_icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jccb15/happio/HEAD/windows/runner/resources/app_icon.ico -------------------------------------------------------------------------------- /macos/Runner/Configs/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "../../Flutter/Flutter-Release.xcconfig" 2 | #include "Warnings.xcconfig" 3 | -------------------------------------------------------------------------------- /l10n.yaml: -------------------------------------------------------------------------------- 1 | arb-dir: lib/src/localization 2 | template-arb-file: app_en.arb 3 | output-localization-file: app_localizations.dart 4 | -------------------------------------------------------------------------------- /macos/.gitignore: -------------------------------------------------------------------------------- 1 | # Flutter-related 2 | **/Flutter/ephemeral/ 3 | **/Pods/ 4 | 5 | # Xcode-related 6 | **/dgph 7 | **/xcuserdata/ 8 | -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jccb15/happio/HEAD/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jccb15/happio/HEAD/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jccb15/happio/HEAD/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jccb15/happio/HEAD/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /lib/src/localization/app_en.arb: -------------------------------------------------------------------------------- 1 | { 2 | "appTitle": "odyssey_2", 3 | "@appTitle": { 4 | "description": "The title of the application" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jccb15/happio/HEAD/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /lib/src/routing/app_routes.dart: -------------------------------------------------------------------------------- 1 | enum AppRoute { 2 | moodRecords, 3 | analytics, 4 | calendar, 5 | settings, 6 | addRecord, 7 | selectActivities, 8 | } 9 | -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher_background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jccb15/happio/HEAD/android/app/src/main/res/mipmap-hdpi/ic_launcher_background.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jccb15/happio/HEAD/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher_monochrome.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jccb15/happio/HEAD/android/app/src/main/res/mipmap-hdpi/ic_launcher_monochrome.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher_background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jccb15/happio/HEAD/android/app/src/main/res/mipmap-mdpi/ic_launcher_background.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jccb15/happio/HEAD/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher_monochrome.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jccb15/happio/HEAD/android/app/src/main/res/mipmap-mdpi/ic_launcher_monochrome.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher_background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jccb15/happio/HEAD/android/app/src/main/res/mipmap-xhdpi/ic_launcher_background.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jccb15/happio/HEAD/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher_monochrome.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jccb15/happio/HEAD/android/app/src/main/res/mipmap-xhdpi/ic_launcher_monochrome.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jccb15/happio/HEAD/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jccb15/happio/HEAD/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jccb15/happio/HEAD/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jccb15/happio/HEAD/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jccb15/happio/HEAD/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jccb15/happio/HEAD/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jccb15/happio/HEAD/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher_background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jccb15/happio/HEAD/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_background.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jccb15/happio/HEAD/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher_monochrome.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jccb15/happio/HEAD/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_monochrome.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jccb15/happio/HEAD/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_background.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jccb15/happio/HEAD/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_monochrome.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jccb15/happio/HEAD/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_monochrome.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jccb15/happio/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jccb15/happio/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jccb15/happio/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jccb15/happio/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jccb15/happio/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jccb15/happio/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jccb15/happio/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jccb15/happio/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jccb15/happio/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jccb15/happio/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jccb15/happio/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jccb15/happio/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jccb15/happio/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jccb15/happio/HEAD/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jccb15/happio/HEAD/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jccb15/happio/HEAD/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png -------------------------------------------------------------------------------- /lib/src/constants/breakpoints.dart: -------------------------------------------------------------------------------- 1 | /// Layout breakpoints used in the app. 2 | class Breakpoint { 3 | static const double desktop = 900; 4 | static const double tablet = 600; 5 | } 6 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jccb15/happio/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jccb15/happio/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /android/app/src/main/kotlin/com/example/odyssey_2/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.example.odyssey 2 | 3 | import io.flutter.embedding.android.FlutterActivity 4 | 5 | class MainActivity: FlutterActivity() { 6 | } 7 | -------------------------------------------------------------------------------- /test/src/features/mood_entries/presentation/add_mood_record_form_controller_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_test/flutter_test.dart'; 2 | 3 | void main() { 4 | test("note updated succes", () {}); 5 | } 6 | -------------------------------------------------------------------------------- /linux/main.cc: -------------------------------------------------------------------------------- 1 | #include "my_application.h" 2 | 3 | int main(int argc, char** argv) { 4 | g_autoptr(MyApplication) app = my_application_new(); 5 | return g_application_run(G_APPLICATION(app), argc, argv); 6 | } 7 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /macos/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | zipStoreBase=GRADLE_USER_HOME 4 | zipStorePath=wrapper/dists 5 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip 6 | -------------------------------------------------------------------------------- /lib/src/localization/string_hardcoded.dart: -------------------------------------------------------------------------------- 1 | /// A simple placeholder that can be used to search all the hardcoded strings 2 | /// in the code (useful to identify strings that need to be localized). 3 | extension StringHardcoded on String { 4 | String get hardcoded => this; 5 | } 6 | -------------------------------------------------------------------------------- /macos/Runner/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import Cocoa 2 | import FlutterMacOS 3 | 4 | @NSApplicationMain 5 | class AppDelegate: FlutterAppDelegate { 6 | override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { 7 | return true 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /macos/Runner/Release.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.app-sandbox 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /android/.gitignore: -------------------------------------------------------------------------------- 1 | gradle-wrapper.jar 2 | /.gradle 3 | /captures/ 4 | /gradlew 5 | /gradlew.bat 6 | /local.properties 7 | GeneratedPluginRegistrant.java 8 | 9 | # Remember to never publicly share your keystore. 10 | # See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app 11 | key.properties 12 | **/*.keystore 13 | **/*.jks 14 | -------------------------------------------------------------------------------- /windows/.gitignore: -------------------------------------------------------------------------------- 1 | flutter/ephemeral/ 2 | 3 | # Visual Studio user-specific files. 4 | *.suo 5 | *.user 6 | *.userosscache 7 | *.sln.docstates 8 | 9 | # Visual Studio build-related files. 10 | x64/ 11 | x86/ 12 | 13 | # Visual Studio cache files 14 | # files ending in .cache can be ignored 15 | *.[Cc]ache 16 | # but keep track of directories ending in .cache 17 | !*.[Cc]ache/ 18 | -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md: -------------------------------------------------------------------------------- 1 | # Launch Screen Assets 2 | 3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory. 4 | 5 | You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. -------------------------------------------------------------------------------- /lib/src/features/mood_records/domain/add_mood_record/mood_option.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class MoodConfiguration { 4 | String label; 5 | String iconPath; 6 | Color color; 7 | int score; 8 | 9 | MoodConfiguration({ 10 | required this.label, 11 | required this.iconPath, 12 | required this.color, 13 | required this.score, 14 | }); 15 | } 16 | -------------------------------------------------------------------------------- /macos/Runner/DebugProfile.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.app-sandbox 6 | 7 | com.apple.security.cs.allow-jit 8 | 9 | com.apple.security.network.server 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /android/app/src/profile/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import Flutter 3 | 4 | @UIApplicationMain 5 | @objc class AppDelegate: FlutterAppDelegate { 6 | override func application( 7 | _ application: UIApplication, 8 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? 9 | ) -> Bool { 10 | GeneratedPluginRegistrant.register(with: self) 11 | return super.application(application, didFinishLaunchingWithOptions: launchOptions) 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /linux/my_application.h: -------------------------------------------------------------------------------- 1 | #ifndef FLUTTER_MY_APPLICATION_H_ 2 | #define FLUTTER_MY_APPLICATION_H_ 3 | 4 | #include 5 | 6 | G_DECLARE_FINAL_TYPE(MyApplication, my_application, MY, APPLICATION, 7 | GtkApplication) 8 | 9 | /** 10 | * my_application_new: 11 | * 12 | * Creates a new Flutter-based application. 13 | * 14 | * Returns: a new #MyApplication. 15 | */ 16 | MyApplication* my_application_new(); 17 | 18 | #endif // FLUTTER_MY_APPLICATION_H_ 19 | -------------------------------------------------------------------------------- /macos/Runner/MainFlutterWindow.swift: -------------------------------------------------------------------------------- 1 | import Cocoa 2 | import FlutterMacOS 3 | 4 | class MainFlutterWindow: NSWindow { 5 | override func awakeFromNib() { 6 | let flutterViewController = FlutterViewController.init() 7 | let windowFrame = self.frame 8 | self.contentViewController = flutterViewController 9 | self.setFrame(windowFrame, display: true) 10 | 11 | RegisterGeneratedPlugins(registry: flutterViewController) 12 | 13 | super.awakeFromNib() 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /windows/runner/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Visual C++ generated include file. 3 | // Used by Runner.rc 4 | // 5 | #define IDI_APP_ICON 101 6 | 7 | // Next default values for new objects 8 | // 9 | #ifdef APSTUDIO_INVOKED 10 | #ifndef APSTUDIO_READONLY_SYMBOLS 11 | #define _APS_NEXT_RESOURCE_VALUE 102 12 | #define _APS_NEXT_COMMAND_VALUE 40001 13 | #define _APS_NEXT_CONTROL_VALUE 1001 14 | #define _APS_NEXT_SYMED_VALUE 101 15 | #endif 16 | #endif 17 | -------------------------------------------------------------------------------- /android/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | 3 | def localPropertiesFile = new File(rootProject.projectDir, "local.properties") 4 | def properties = new Properties() 5 | 6 | assert localPropertiesFile.exists() 7 | localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } 8 | 9 | def flutterSdkPath = properties.getProperty("flutter.sdk") 10 | assert flutterSdkPath != null, "flutter.sdk not set in local.properties" 11 | apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle" 12 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-v21/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "LaunchImage.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "LaunchImage@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "LaunchImage@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /macos/Runner/Configs/Warnings.xcconfig: -------------------------------------------------------------------------------- 1 | WARNING_CFLAGS = -Wall -Wconditional-uninitialized -Wnullable-to-nonnull-conversion -Wmissing-method-return-type -Woverlength-strings 2 | GCC_WARN_UNDECLARED_SELECTOR = YES 3 | CLANG_UNDEFINED_BEHAVIOR_SANITIZER_NULLABILITY = YES 4 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE 5 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES 6 | CLANG_WARN_PRAGMA_PACK = YES 7 | CLANG_WARN_STRICT_PROTOTYPES = YES 8 | CLANG_WARN_COMMA = YES 9 | GCC_WARN_STRICT_SELECTOR_MATCH = YES 10 | CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = YES 11 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES 12 | GCC_WARN_SHADOW = YES 13 | CLANG_WARN_UNREACHABLE_CODE = YES 14 | -------------------------------------------------------------------------------- /lib/src/utils/widgets/scafforld_with_botto_navigation_bar_item.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:odyssey/src/routing/app_routes.dart'; 3 | 4 | class ScaffoldWithBottomNavigationBarItem extends NavigationDestination { 5 | const ScaffoldWithBottomNavigationBarItem( 6 | {super.key, required this.route, required Widget icon, required Widget selectedIcon, required String label}) 7 | : super( 8 | icon: icon, 9 | selectedIcon: selectedIcon, 10 | label: label, 11 | ); 12 | final AppRoute route; 13 | 14 | // String get location => 15 | // GoRouter.of(context).namedLocation(initialRouteName.name); 16 | } 17 | -------------------------------------------------------------------------------- /macos/Runner/Configs/AppInfo.xcconfig: -------------------------------------------------------------------------------- 1 | // Application-level settings for the Runner target. 2 | // 3 | // This may be replaced with something auto-generated from metadata (e.g., pubspec.yaml) in the 4 | // future. If not, the values below would default to using the project name when this becomes a 5 | // 'flutter create' template. 6 | 7 | // The application's name. By default this is also the title of the Flutter window. 8 | PRODUCT_NAME = odyssey_2 9 | 10 | // The application's bundle identifier 11 | PRODUCT_BUNDLE_IDENTIFIER = com.example.odyssey2 12 | 13 | // The copyright displayed in application information 14 | PRODUCT_COPYRIGHT = Copyright © 2023 com.example. All rights reserved. 15 | -------------------------------------------------------------------------------- /lib/src/routing/not_found_screen.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:go_router/go_router.dart'; 3 | import 'app_routes.dart'; 4 | 5 | class NotFoundScreen extends StatelessWidget { 6 | const NotFoundScreen({Key? key}) : super(key: key); 7 | 8 | @override 9 | Widget build(BuildContext context) { 10 | return Scaffold( 11 | appBar: AppBar(), 12 | body: Center( 13 | child: Column( 14 | children: [ 15 | const Text("Not Found"), 16 | ElevatedButton(onPressed: () => context.goNamed(AppRoute.moodRecords.name), child: const Text("Go Home")) 17 | ], 18 | ), 19 | ), 20 | ); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /ios/.gitignore: -------------------------------------------------------------------------------- 1 | **/dgph 2 | *.mode1v3 3 | *.mode2v3 4 | *.moved-aside 5 | *.pbxuser 6 | *.perspectivev3 7 | **/*sync/ 8 | .sconsign.dblite 9 | .tags* 10 | **/.vagrant/ 11 | **/DerivedData/ 12 | Icon? 13 | **/Pods/ 14 | **/.symlinks/ 15 | profile 16 | xcuserdata 17 | **/.generated/ 18 | Flutter/App.framework 19 | Flutter/Flutter.framework 20 | Flutter/Flutter.podspec 21 | Flutter/Generated.xcconfig 22 | Flutter/ephemeral/ 23 | Flutter/app.flx 24 | Flutter/app.zip 25 | Flutter/flutter_assets/ 26 | Flutter/flutter_export_environment.sh 27 | ServiceDefinitions.json 28 | Runner/GeneratedPluginRegistrant.* 29 | 30 | # Exceptions to above rules. 31 | !default.mode1v3 32 | !default.mode2v3 33 | !default.pbxuser 34 | !default.perspectivev3 35 | -------------------------------------------------------------------------------- /lib/src/features/activities/model/activity.dart: -------------------------------------------------------------------------------- 1 | import 'package:freezed_annotation/freezed_annotation.dart'; 2 | import 'package:hive/hive.dart'; 3 | 4 | part "activity.g.dart"; 5 | part "activity.freezed.dart"; 6 | 7 | @freezed 8 | abstract class Activity with _$Activity { 9 | @HiveType(typeId: 1) 10 | const factory Activity({ 11 | @HiveField(0) required String activityName, 12 | @HiveField(1) required int iconCode, 13 | }) = _Activity; 14 | 15 | // final String activityName; 16 | // final int iconCode; 17 | } 18 | 19 | class ActivityCategory { 20 | ActivityCategory({required this.categoryName, required this.activityList}); 21 | 22 | final String categoryName; 23 | final List activityList; 24 | } 25 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext.kotlin_version = '1.7.10' 3 | repositories { 4 | google() 5 | mavenCentral() 6 | } 7 | 8 | dependencies { 9 | classpath 'com.android.tools.build:gradle:4.1.0' 10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 11 | } 12 | } 13 | 14 | allprojects { 15 | repositories { 16 | google() 17 | mavenCentral() 18 | } 19 | } 20 | 21 | rootProject.buildDir = '../build' 22 | subprojects { 23 | project.buildDir = "${rootProject.buildDir}/${project.name}" 24 | } 25 | subprojects { 26 | project.evaluationDependsOn(':app') 27 | } 28 | 29 | tasks.register("clean", Delete) { 30 | delete rootProject.buildDir 31 | } 32 | -------------------------------------------------------------------------------- /windows/runner/utils.h: -------------------------------------------------------------------------------- 1 | #ifndef RUNNER_UTILS_H_ 2 | #define RUNNER_UTILS_H_ 3 | 4 | #include 5 | #include 6 | 7 | // Creates a console for the process, and redirects stdout and stderr to 8 | // it for both the runner and the Flutter library. 9 | void CreateAndAttachConsole(); 10 | 11 | // Takes a null-terminated wchar_t* encoded in UTF-16 and returns a std::string 12 | // encoded in UTF-8. Returns an empty std::string on failure. 13 | std::string Utf8FromUtf16(const wchar_t* utf16_string); 14 | 15 | // Gets the command line arguments passed in as a std::vector, 16 | // encoded in UTF-8. Returns an empty std::vector on failure. 17 | std::vector GetCommandLineArguments(); 18 | 19 | #endif // RUNNER_UTILS_H_ 20 | -------------------------------------------------------------------------------- /ios/Flutter/AppFrameworkInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | App 9 | CFBundleIdentifier 10 | io.flutter.flutter.app 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | App 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1.0 23 | MinimumOSVersion 24 | 11.0 25 | 26 | 27 | -------------------------------------------------------------------------------- /lib/src/features/activities/data/activity_repository.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_riverpod/flutter_riverpod.dart'; 2 | import 'package:hive/hive.dart'; 3 | import 'package:odyssey/src/features/activities/data/activity_categories.dart'; 4 | import 'package:odyssey/src/features/activities/model/activity.dart'; 5 | 6 | class ActivityRepository { 7 | ActivityRepository(this._activityCategoriesbox); 8 | final Box _activityCategoriesbox; 9 | 10 | Box get box => _activityCategoriesbox; 11 | 12 | List getCategories() { 13 | return kActivityCategories; 14 | } 15 | } 16 | 17 | final activityRepositoryProvider = FutureProvider( 18 | (ref) async { 19 | final box = await Hive.openBox("activity_categories"); 20 | 21 | ref.onDispose(() => box.close()); 22 | 23 | return ActivityRepository(box); 24 | }, 25 | ); 26 | -------------------------------------------------------------------------------- /assets/mood_icons/neutral.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /lib/src/features/mood_records/domain/mood_log/mood_record.dart: -------------------------------------------------------------------------------- 1 | import 'package:freezed_annotation/freezed_annotation.dart'; 2 | import 'package:hive/hive.dart'; 3 | import 'package:odyssey/src/features/activities/model/activity.dart'; 4 | 5 | part "mood_record.g.dart"; 6 | part "mood_record.freezed.dart"; 7 | 8 | @freezed 9 | abstract class MoodRecord with _$MoodRecord { 10 | @HiveType(typeId: 0) 11 | const factory MoodRecord({ 12 | // @HiveField(0) required int? id, 13 | @HiveField(0) required String label, 14 | @HiveField(1) required int score, 15 | @HiveField(2) required String iconPath, 16 | @HiveField(3) required int color, 17 | @HiveField(4) required DateTime date, 18 | @HiveField(5) String? note, 19 | @HiveField(6) @Default([]) List activities, 20 | }) = _MoodRecord; 21 | 22 | // factory MoodRecord.fromJson(Map json) => _$MoodRecordFromJson(json); 23 | } 24 | -------------------------------------------------------------------------------- /lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_riverpod/flutter_riverpod.dart'; 3 | import 'package:hive_flutter/hive_flutter.dart'; 4 | import 'package:odyssey/src/features/activities/model/activity.dart'; 5 | import 'package:odyssey/src/features/mood_records/data/mood_log/mood_record_repository.dart'; 6 | import 'package:odyssey/src/features/mood_records/domain/mood_log/mood_record.dart'; 7 | 8 | import 'src/app.dart'; 9 | 10 | void main() async { 11 | WidgetsFlutterBinding.ensureInitialized(); 12 | 13 | await Hive.initFlutter(); 14 | Hive.registerAdapter(MoodRecordAdapter()); 15 | Hive.registerAdapter(ActivityAdapter()); 16 | 17 | final moodRecordsRepository = await MoodRecordRepository.createRepository(); 18 | 19 | runApp( 20 | ProviderScope( 21 | overrides: [moodRecordRepositoryProvider.overrideWithValue(moodRecordsRepository)], 22 | child: const MyApp(), 23 | ), 24 | ); 25 | } 26 | -------------------------------------------------------------------------------- /lib/src/features/mood_records/data/add_mood_record/mood_configurations.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:odyssey/gen/assets.gen.dart'; 3 | import 'package:odyssey/src/features/mood_records/domain/add_mood_record/mood_option.dart'; 4 | 5 | //TODO: provide these list with a provider, grouped by score to allow different mood options 6 | final List kMoodConfigurations = [ 7 | MoodConfiguration(iconPath: Assets.moodIcons.happy, color: Colors.green, label: "Great", score: 5), 8 | MoodConfiguration(iconPath: Assets.moodIcons.smile, color: Colors.cyan, label: "Positive", score: 4), 9 | MoodConfiguration(iconPath: Assets.moodIcons.neutral, color: Colors.blue, label: "Alright", score: 3), 10 | MoodConfiguration(iconPath: Assets.moodIcons.confused, color: Colors.orange, label: "Bad", score: 2), 11 | MoodConfiguration(iconPath: Assets.moodIcons.crying, color: Colors.red, label: "Awful", score: 1), 12 | ]; 13 | -------------------------------------------------------------------------------- /windows/runner/runner.exe.manifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PerMonitorV2 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /web/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "odyssey_2", 3 | "short_name": "odyssey_2", 4 | "start_url": ".", 5 | "display": "standalone", 6 | "background_color": "#0175C2", 7 | "theme_color": "#0175C2", 8 | "description": "A new Flutter project.", 9 | "orientation": "portrait-primary", 10 | "prefer_related_applications": false, 11 | "icons": [ 12 | { 13 | "src": "icons/Icon-192.png", 14 | "sizes": "192x192", 15 | "type": "image/png" 16 | }, 17 | { 18 | "src": "icons/Icon-512.png", 19 | "sizes": "512x512", 20 | "type": "image/png" 21 | }, 22 | { 23 | "src": "icons/Icon-maskable-192.png", 24 | "sizes": "192x192", 25 | "type": "image/png", 26 | "purpose": "maskable" 27 | }, 28 | { 29 | "src": "icons/Icon-maskable-512.png", 30 | "sizes": "512x512", 31 | "type": "image/png", 32 | "purpose": "maskable" 33 | } 34 | ] 35 | } 36 | -------------------------------------------------------------------------------- /windows/runner/flutter_window.h: -------------------------------------------------------------------------------- 1 | #ifndef RUNNER_FLUTTER_WINDOW_H_ 2 | #define RUNNER_FLUTTER_WINDOW_H_ 3 | 4 | #include 5 | #include 6 | 7 | #include 8 | 9 | #include "win32_window.h" 10 | 11 | // A window that does nothing but host a Flutter view. 12 | class FlutterWindow : public Win32Window { 13 | public: 14 | // Creates a new FlutterWindow hosting a Flutter view running |project|. 15 | explicit FlutterWindow(const flutter::DartProject& project); 16 | virtual ~FlutterWindow(); 17 | 18 | protected: 19 | // Win32Window: 20 | bool OnCreate() override; 21 | void OnDestroy() override; 22 | LRESULT MessageHandler(HWND window, UINT const message, WPARAM const wparam, 23 | LPARAM const lparam) noexcept override; 24 | 25 | private: 26 | // The project to run. 27 | flutter::DartProject project_; 28 | 29 | // The Flutter instance hosted by this window. 30 | std::unique_ptr flutter_controller_; 31 | }; 32 | 33 | #endif // RUNNER_FLUTTER_WINDOW_H_ 34 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | # Happio - Mood Tracker 3 | 4 | 5 | 6 | A simple **Mood Tracker** application designed to monitor and analyze your daily mood fluctuations with a few taps. 7 | 8 | Built with the Flutter Framework utilizing [Hive](https://github.com/hivedb/hive/tree/master/hive) for persistent storage, [Riverpod](https://riverpod.dev) for state management and [GoRouter](https://pub.dev/packages/go_router) for routing. 9 | 10 | 11 | ## Features 12 | 13 | - Log your daily mood 14 | - Multiple mood entries in a day 15 | - Track activities that influence your mood 16 | - Graph your mood for better insights 17 | - Material You dynamic theming 18 | ## Screenshots 19 | 20 | 21 | 22 | ##### Dynamic Theming 23 | 24 | 25 | 26 | ## Roadmap 27 | 28 | - Customizable moods and activities 29 | - Calendar view 30 | - Activity counter 31 | - Streaks 32 | - Image attachment 33 | - Daily quotes 34 | 35 | ## Author 36 | [José Castelo](https://github.com/jccb15) 37 | -------------------------------------------------------------------------------- /android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /android/app/src/main/res/values-night/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /lib/src/features/analytics/presentation/analytics_screen.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:odyssey/src/features/analytics/presentation/chart_frame_card.dart'; 3 | import 'package:odyssey/src/utils/widgets/responsive_centered.dart'; 4 | 5 | class AnalyticsScreen extends StatelessWidget { 6 | const AnalyticsScreen({super.key}); 7 | 8 | @override 9 | Widget build(BuildContext context) { 10 | return Scaffold( 11 | appBar: AppBar( 12 | title: const Text("Insights"), 13 | ), 14 | body: ResponsiveCenter( 15 | child: Column( 16 | children: [ 17 | Expanded( 18 | child: ListView( 19 | padding: const EdgeInsets.fromLTRB(12, 12, 12, kFloatingActionButtonMargin * 2 + 48), 20 | children: const [ 21 | ChartFrame(chartType: ChartType.moodCount, title: "Mood Count"), 22 | ChartFrame(chartType: ChartType.moodVariation, title: "Mood Fluctuation"), 23 | ], 24 | ), 25 | ) 26 | ], 27 | ), 28 | ), 29 | ); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: odyssey 2 | description: A simple mood tracker application. 3 | 4 | # Prevent accidental publishing to pub.dev. 5 | publish_to: 'none' 6 | 7 | version: 1.0.0+1 8 | 9 | environment: 10 | sdk: '>=3.0.0 <4.0.0' 11 | 12 | dependencies: 13 | 14 | collection: ^1.17.0 15 | dynamic_color: ^1.6.3 16 | fl_chart: ^0.62.0 17 | flutter: 18 | sdk: flutter 19 | 20 | flutter_localizations: 21 | sdk: flutter 22 | flutter_riverpod: ^2.3.5 23 | flutter_svg: ^2.0.5 24 | freezed_annotation: ^2.2.0 25 | go_router: ^7.1.1 26 | hive: ^2.2.3 27 | hive_flutter: ^1.1.0 28 | intl: ^0.18.0 29 | timeline_tile: ^2.0.0 30 | 31 | 32 | 33 | dev_dependencies: 34 | flutter_test: 35 | sdk: flutter 36 | freezed: ^2.3.2 37 | build_runner: ^2.3.3 38 | hive_generator: ^2.0.0 39 | flutter_lints: ^2.0.0 40 | json_serializable: ^6.6.1 41 | flutter_gen_runner: ^5.3.0 42 | 43 | flutter: 44 | uses-material-design: true 45 | 46 | # Enable generation of localized Strings from arb files. 47 | generate: true 48 | 49 | assets: 50 | # Add assets from the images directory to the application. 51 | - assets/mood_icons/ 52 | -------------------------------------------------------------------------------- /assets/mood_icons/nervous.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /macos/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | $(FLUTTER_BUILD_NAME) 21 | CFBundleVersion 22 | $(FLUTTER_BUILD_NUMBER) 23 | LSMinimumSystemVersion 24 | $(MACOSX_DEPLOYMENT_TARGET) 25 | NSHumanReadableCopyright 26 | $(PRODUCT_COPYRIGHT) 27 | NSMainNibFile 28 | MainMenu 29 | NSPrincipalClass 30 | NSApplication 31 | 32 | 33 | -------------------------------------------------------------------------------- /lib/src/features/activities/presentation/activity_group.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:odyssey/src/features/activities/model/activity.dart'; 3 | import 'package:odyssey/src/features/activities/presentation/activity_chips.dart'; 4 | 5 | class ActivityGroup extends StatelessWidget { 6 | const ActivityGroup({super.key, required this.activityCategory, required this.selectedActivities, required this.onSelectedActivity}); 7 | 8 | final ActivityCategory activityCategory; 9 | final List selectedActivities; 10 | final Function(Activity) onSelectedActivity; 11 | 12 | @override 13 | Widget build(BuildContext context) { 14 | return Card( 15 | clipBehavior: Clip.antiAlias, 16 | child: ExpansionTile( 17 | childrenPadding: const EdgeInsets.all(12), 18 | initiallyExpanded: true, 19 | title: Text(activityCategory.categoryName), 20 | shape: const RoundedRectangleBorder(), 21 | children: [ 22 | ActivityChips( 23 | activityCategory.activityList, 24 | onActivitySelected: onSelectedActivity, 25 | selectedActivities: selectedActivities, 26 | ), 27 | ], 28 | ), 29 | ); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /assets/mood_icons/confused.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /lib/src/features/activities/model/activity.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'activity.dart'; 4 | 5 | // ************************************************************************** 6 | // TypeAdapterGenerator 7 | // ************************************************************************** 8 | 9 | class ActivityAdapter extends TypeAdapter<_$_Activity> { 10 | @override 11 | final int typeId = 1; 12 | 13 | @override 14 | _$_Activity read(BinaryReader reader) { 15 | final numOfFields = reader.readByte(); 16 | final fields = { 17 | for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(), 18 | }; 19 | return _$_Activity( 20 | activityName: fields[0] as String, 21 | iconCode: fields[1] as int, 22 | ); 23 | } 24 | 25 | @override 26 | void write(BinaryWriter writer, _$_Activity obj) { 27 | writer 28 | ..writeByte(2) 29 | ..writeByte(0) 30 | ..write(obj.activityName) 31 | ..writeByte(1) 32 | ..write(obj.iconCode); 33 | } 34 | 35 | @override 36 | int get hashCode => typeId.hashCode; 37 | 38 | @override 39 | bool operator ==(Object other) => 40 | identical(this, other) || other is ActivityAdapter && runtimeType == other.runtimeType && typeId == other.typeId; 41 | } 42 | -------------------------------------------------------------------------------- /lib/src/utils/widgets/responsive_centered.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:odyssey/src/constants/breakpoints.dart'; 3 | 4 | /// Reusable widget for showing a child with a maximum content width constraint. 5 | /// If available width is larger than the maximum width, the child will be 6 | /// centered. 7 | /// If available width is smaller than the maximum width, the child use all the 8 | /// available width. 9 | class ResponsiveCenter extends StatelessWidget { 10 | const ResponsiveCenter({ 11 | super.key, 12 | this.maxContentWidth = Breakpoint.desktop, 13 | this.padding = EdgeInsets.zero, 14 | required this.child, 15 | }); 16 | final double maxContentWidth; 17 | final EdgeInsetsGeometry padding; 18 | final Widget child; 19 | 20 | @override 21 | Widget build(BuildContext context) { 22 | // Use Center as it has *unconstrained* width (loose constraints) 23 | return Center( 24 | // together with SizedBox to specify the max width (tight constraints) 25 | // See this thread for more info: 26 | // https://twitter.com/biz84/status/1445400059894542337 27 | child: SizedBox( 28 | width: maxContentWidth, 29 | child: Padding( 30 | padding: padding, 31 | child: child, 32 | ), 33 | ), 34 | ); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /lib/src/constants/app_sizes.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | /// Constant sizes to be used in the app (paddings, gaps, rounded corners etc.) 4 | class Sizes { 5 | static const p4 = 4.0; 6 | static const p8 = 8.0; 7 | static const p12 = 12.0; 8 | static const p16 = 16.0; 9 | static const p20 = 20.0; 10 | static const p24 = 24.0; 11 | static const p32 = 32.0; 12 | static const p48 = 48.0; 13 | static const p64 = 64.0; 14 | } 15 | 16 | /// Constant gap widths 17 | const gapW4 = SizedBox(width: Sizes.p4); 18 | const gapW8 = SizedBox(width: Sizes.p8); 19 | const gapW12 = SizedBox(width: Sizes.p12); 20 | const gapW16 = SizedBox(width: Sizes.p16); 21 | const gapW20 = SizedBox(width: Sizes.p20); 22 | const gapW24 = SizedBox(width: Sizes.p24); 23 | const gapW32 = SizedBox(width: Sizes.p32); 24 | const gapW48 = SizedBox(width: Sizes.p48); 25 | const gapW64 = SizedBox(width: Sizes.p64); 26 | 27 | /// Constant gap heights 28 | const gapH4 = SizedBox(height: Sizes.p4); 29 | const gapH8 = SizedBox(height: Sizes.p8); 30 | const gapH12 = SizedBox(height: Sizes.p12); 31 | const gapH16 = SizedBox(height: Sizes.p16); 32 | const gapH20 = SizedBox(height: Sizes.p20); 33 | const gapH24 = SizedBox(height: Sizes.p24); 34 | const gapH32 = SizedBox(height: Sizes.p32); 35 | const gapH48 = SizedBox(height: Sizes.p48); 36 | const gapH64 = SizedBox(height: Sizes.p64); 37 | -------------------------------------------------------------------------------- /lib/src/features/mood_records/presentation/mood_log/mood_log_screen_controller.dart: -------------------------------------------------------------------------------- 1 | // import 'dart:async'; 2 | import 'dart:collection'; 3 | 4 | import 'package:collection/collection.dart'; 5 | 6 | import 'package:flutter_riverpod/flutter_riverpod.dart'; 7 | import 'package:intl/intl.dart'; 8 | import 'package:odyssey/src/features/mood_records/data/mood_log/mood_record_repository.dart'; 9 | import 'package:odyssey/src/features/mood_records/domain/mood_log/mood_record.dart'; 10 | 11 | class MoodRecordsScreenController extends Notifier { 12 | late final MoodRecordRepository _repository; 13 | 14 | @override 15 | MoodRecordRepository build() { 16 | _repository = ref.watch(moodRecordRepositoryProvider); 17 | return _repository; 18 | } 19 | 20 | MoodRecordRepository get repository => _repository; 21 | 22 | SplayTreeMap>> groupMoodRecordsByDay(Map boxMap) { 23 | // final records = _repository.box.toMap().entries; 24 | final groups = groupBy(boxMap.entries, (record) => DateFormat("yyyy-MM-dd").format(record.value.date)); 25 | return SplayTreeMap.from( 26 | groups, 27 | (key1, key2) => key2.compareTo(key1), 28 | ); 29 | } 30 | } 31 | 32 | final moodRecordScreenControllerProvider = 33 | NotifierProvider(MoodRecordsScreenController.new); 34 | -------------------------------------------------------------------------------- /windows/runner/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include "flutter_window.h" 6 | #include "utils.h" 7 | 8 | int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev, 9 | _In_ wchar_t *command_line, _In_ int show_command) { 10 | // Attach to console when present (e.g., 'flutter run') or create a 11 | // new console when running with a debugger. 12 | if (!::AttachConsole(ATTACH_PARENT_PROCESS) && ::IsDebuggerPresent()) { 13 | CreateAndAttachConsole(); 14 | } 15 | 16 | // Initialize COM, so that it is available for use in the library and/or 17 | // plugins. 18 | ::CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED); 19 | 20 | flutter::DartProject project(L"data"); 21 | 22 | std::vector command_line_arguments = 23 | GetCommandLineArguments(); 24 | 25 | project.set_dart_entrypoint_arguments(std::move(command_line_arguments)); 26 | 27 | FlutterWindow window(project); 28 | Win32Window::Point origin(10, 10); 29 | Win32Window::Size size(1280, 720); 30 | if (!window.Create(L"odyssey_2", origin, size)) { 31 | return EXIT_FAILURE; 32 | } 33 | window.SetQuitOnClose(true); 34 | 35 | ::MSG msg; 36 | while (::GetMessage(&msg, nullptr, 0, 0)) { 37 | ::TranslateMessage(&msg); 38 | ::DispatchMessage(&msg); 39 | } 40 | 41 | ::CoUninitialize(); 42 | return EXIT_SUCCESS; 43 | } 44 | -------------------------------------------------------------------------------- /lib/src/features/mood_records/presentation/mood_log/mood_record_group.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:intl/intl.dart'; 3 | import 'package:odyssey/src/features/mood_records/domain/mood_log/mood_record.dart'; 4 | import 'package:odyssey/src/features/mood_records/presentation/mood_log/mood_record_card.dart'; 5 | 6 | class MoodRecordGroup extends StatelessWidget { 7 | const MoodRecordGroup({super.key, required this.groupDate, required this.moodList}); 8 | final DateTime groupDate; 9 | final List> moodList; 10 | 11 | @override 12 | Widget build(BuildContext context) { 13 | return Card( 14 | child: Column( 15 | crossAxisAlignment: CrossAxisAlignment.start, 16 | children: [ 17 | if (moodList.length > 1) 18 | Container( 19 | margin: const EdgeInsets.only(top: 15, left: 15), 20 | child: Text( 21 | DateFormat('EEEE, MMMM d').format(groupDate), 22 | style: Theme.of(context).textTheme.titleMedium, 23 | ), 24 | ), 25 | ...moodList.map( 26 | (record) => MoodRecordCard( 27 | recordEntry: record, 28 | isFirst: record == moodList.first, 29 | isLast: record == moodList.last, 30 | showDate: moodList.length == 1, 31 | ), 32 | ) 33 | ], 34 | ), 35 | ); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /assets/mood_icons/angry.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /assets/mood_icons/sad.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /analysis_options.yaml: -------------------------------------------------------------------------------- 1 | # This file configures the analyzer, which statically analyzes Dart code to 2 | # check for errors, warnings, and lints. 3 | # 4 | # The issues identified by the analyzer are surfaced in the UI of Dart-enabled 5 | # IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be 6 | # invoked from the command line by running `flutter analyze`. 7 | 8 | # The following line activates a set of recommended lints for Flutter apps, 9 | # packages, and plugins designed to encourage good coding practices. 10 | include: package:flutter_lints/flutter.yaml 11 | 12 | linter: 13 | # The lint rules applied to this project can be customized in the 14 | # section below to disable rules from the `package:flutter_lints/flutter.yaml` 15 | # included above or to enable additional rules. A list of all available lints 16 | # and their documentation is published at 17 | # https://dart-lang.github.io/linter/lints/index.html. 18 | # 19 | # Instead of disabling a lint rule for the entire project in the 20 | # section below, it can also be suppressed for a single line of code 21 | # or a specific dart file by using the `// ignore: name_of_lint` and 22 | # `// ignore_for_file: name_of_lint` syntax on the line or in the file 23 | # producing the lint. 24 | rules: 25 | # avoid_print: false # Uncomment to disable the `avoid_print` rule 26 | # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule 27 | 28 | # Additional information about this file can be found at 29 | # https://dart.dev/guides/language/analysis-options 30 | -------------------------------------------------------------------------------- /assets/mood_icons/bandaged.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "16x16", 5 | "idiom" : "mac", 6 | "filename" : "app_icon_16.png", 7 | "scale" : "1x" 8 | }, 9 | { 10 | "size" : "16x16", 11 | "idiom" : "mac", 12 | "filename" : "app_icon_32.png", 13 | "scale" : "2x" 14 | }, 15 | { 16 | "size" : "32x32", 17 | "idiom" : "mac", 18 | "filename" : "app_icon_32.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "32x32", 23 | "idiom" : "mac", 24 | "filename" : "app_icon_64.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "128x128", 29 | "idiom" : "mac", 30 | "filename" : "app_icon_128.png", 31 | "scale" : "1x" 32 | }, 33 | { 34 | "size" : "128x128", 35 | "idiom" : "mac", 36 | "filename" : "app_icon_256.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "256x256", 41 | "idiom" : "mac", 42 | "filename" : "app_icon_256.png", 43 | "scale" : "1x" 44 | }, 45 | { 46 | "size" : "256x256", 47 | "idiom" : "mac", 48 | "filename" : "app_icon_512.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "512x512", 53 | "idiom" : "mac", 54 | "filename" : "app_icon_512.png", 55 | "scale" : "1x" 56 | }, 57 | { 58 | "size" : "512x512", 59 | "idiom" : "mac", 60 | "filename" : "app_icon_1024.png", 61 | "scale" : "2x" 62 | } 63 | ], 64 | "info" : { 65 | "version" : 1, 66 | "author" : "xcode" 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /ios/Runner/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /lib/src/features/mood_records/presentation/add_mood_record/mood_option.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_svg/flutter_svg.dart'; 3 | import 'package:odyssey/src/constants/app_sizes.dart'; 4 | import 'package:odyssey/src/features/mood_records/domain/add_mood_record/mood_option.dart'; 5 | 6 | class MoodOption extends StatelessWidget { 7 | const MoodOption({ 8 | super.key, 9 | required this.moodConfiguration, 10 | required this.isSelected, 11 | // required this.onTap, 12 | }); 13 | 14 | final MoodConfiguration moodConfiguration; 15 | final bool isSelected; 16 | // final Function onTap; 17 | 18 | @override 19 | Widget build(BuildContext context) { 20 | return SizedBox( 21 | width: 80, 22 | child: Card( 23 | elevation: isSelected ? 4 : 0, 24 | color: isSelected ? moodConfiguration.color : Theme.of(context).colorScheme.surfaceVariant, 25 | child: Padding( 26 | padding: const EdgeInsets.all(4), 27 | child: Column( 28 | children: [ 29 | SvgPicture.asset( 30 | moodConfiguration.iconPath, 31 | color: isSelected ? Theme.of(context).colorScheme.surface : moodConfiguration.color, 32 | height: Sizes.p64, 33 | width: Sizes.p64, 34 | ), 35 | gapH4, 36 | Text( 37 | moodConfiguration.label, 38 | style: TextStyle( 39 | color: isSelected ? Theme.of(context).colorScheme.surface : moodConfiguration.color, 40 | ), 41 | ) 42 | ], 43 | ), 44 | ), 45 | ), 46 | ); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /assets/mood_icons/dizzy.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /assets/mood_icons/crying.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 7 | 15 | 19 | 23 | 24 | 25 | 26 | 27 | 28 | 30 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /lib/src/features/mood_records/domain/mood_log/mood_record.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'mood_record.dart'; 4 | 5 | // ************************************************************************** 6 | // TypeAdapterGenerator 7 | // ************************************************************************** 8 | 9 | class MoodRecordAdapter extends TypeAdapter<_$_MoodRecord> { 10 | @override 11 | final int typeId = 0; 12 | 13 | @override 14 | _$_MoodRecord read(BinaryReader reader) { 15 | final numOfFields = reader.readByte(); 16 | final fields = { 17 | for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(), 18 | }; 19 | return _$_MoodRecord( 20 | label: fields[0] as String, 21 | score: fields[1] as int, 22 | iconPath: fields[2] as String, 23 | color: fields[3] as int, 24 | date: fields[4] as DateTime, 25 | note: fields[5] as String?, 26 | activities: (fields[6] as List).cast(), 27 | ); 28 | } 29 | 30 | @override 31 | void write(BinaryWriter writer, _$_MoodRecord obj) { 32 | writer 33 | ..writeByte(7) 34 | ..writeByte(0) 35 | ..write(obj.label) 36 | ..writeByte(1) 37 | ..write(obj.score) 38 | ..writeByte(2) 39 | ..write(obj.iconPath) 40 | ..writeByte(3) 41 | ..write(obj.color) 42 | ..writeByte(4) 43 | ..write(obj.date) 44 | ..writeByte(5) 45 | ..write(obj.note) 46 | ..writeByte(6) 47 | ..write(obj.activities); 48 | } 49 | 50 | @override 51 | int get hashCode => typeId.hashCode; 52 | 53 | @override 54 | bool operator ==(Object other) => 55 | identical(this, other) || 56 | other is MoodRecordAdapter && 57 | runtimeType == other.runtimeType && 58 | typeId == other.typeId; 59 | } 60 | -------------------------------------------------------------------------------- /lib/src/features/mood_records/data/mood_log/mood_record_repository.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_riverpod/flutter_riverpod.dart'; 2 | import 'package:hive/hive.dart'; 3 | import 'package:odyssey/src/features/mood_records/domain/mood_log/mood_record.dart'; 4 | 5 | class MoodRecordRepository { 6 | MoodRecordRepository(this._moodRecordBox); 7 | final Box _moodRecordBox; 8 | 9 | Box get box => _moodRecordBox; 10 | 11 | static Future createRepository() async { 12 | final box = await Hive.openBox("mood_records"); 13 | // ref.onDispose(() => box.close()); 14 | return MoodRecordRepository(box); 15 | } 16 | 17 | Future createMoodRecord(MoodRecord record) { 18 | return _moodRecordBox.add(record); 19 | } 20 | 21 | Map fetchMoodRecords() { 22 | return _moodRecordBox.toMap(); 23 | } 24 | 25 | Future updateMoodRecord(int key, MoodRecord record) { 26 | return _moodRecordBox.put(key, record); 27 | } 28 | 29 | Future deleteMoodRecord(int key) { 30 | return _moodRecordBox.delete(key); 31 | } 32 | 33 | Map fetchMoodRecordsByDate({required DateTime before, required DateTime after}) { 34 | final map = _moodRecordBox.toMap(); 35 | map.removeWhere((key, value) => (value.date.compareTo(before) >= 0 || value.date.compareTo(after) <= 0)); 36 | return map; 37 | } 38 | } 39 | 40 | final moodRecordRepositoryProvider = Provider((ref) { 41 | // to acces this provider synchronously, this provider is overriden at the ProviderScope 42 | throw UnimplementedError(); 43 | }); 44 | 45 | final moodRecordsProvider = Provider>((ref) { 46 | final moodRecordRepository = ref.watch(moodRecordRepositoryProvider); 47 | return moodRecordRepository.fetchMoodRecords(); 48 | }); 49 | -------------------------------------------------------------------------------- /lib/src/utils/widgets/scafforld_with_botto_navigation_bar.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:go_router/go_router.dart'; 3 | import 'package:odyssey/src/utils/widgets/scafforld_with_botto_navigation_bar_item.dart'; 4 | 5 | class ScaffoldWithBottomNavigationBar extends StatefulWidget { 6 | const ScaffoldWithBottomNavigationBar({Key? key, required this.child, required this.destinations}) : super(key: key); 7 | final Widget child; 8 | final List destinations; 9 | 10 | @override 11 | State createState() => _ScaffoldWithBottomNavigationBarState(); 12 | } 13 | 14 | class _ScaffoldWithBottomNavigationBarState extends State { 15 | int get _currentIndex => _locationToTabIndex(GoRouter.of(context).location); 16 | 17 | int _locationToTabIndex(String location) { 18 | final index = widget.destinations.indexWhere((t) => location.startsWith(GoRouter.of(context).namedLocation(t.route.name))); 19 | // if index not found (-1), return 0 20 | return index < 0 ? 0 : index; 21 | } 22 | 23 | void _onItemTapped(BuildContext context, int destinationIndex) { 24 | if (destinationIndex != _currentIndex) { 25 | // go to the initial location of the selected tab (by index) 26 | context.goNamed(widget.destinations[destinationIndex].route.name); 27 | } 28 | } 29 | 30 | @override 31 | Widget build(BuildContext context) { 32 | return Scaffold( 33 | body: widget.child, 34 | bottomNavigationBar: NavigationBar( 35 | selectedIndex: _currentIndex, 36 | destinations: widget.destinations, 37 | onDestinationSelected: (index) => _onItemTapped(context, index), 38 | labelBehavior: NavigationDestinationLabelBehavior.alwaysHide, 39 | height: 60, 40 | ), 41 | ); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /lib/src/app.dart: -------------------------------------------------------------------------------- 1 | import 'package:dynamic_color/dynamic_color.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:flutter_riverpod/flutter_riverpod.dart'; 4 | import 'package:odyssey/src/routing/app_router.dart'; 5 | 6 | // import 'package:flutter_gen/gen_l10n/app_localizations.dart'; 7 | // import 'package:flutter_localizations/flutter_localizations.dart'; 8 | /// The Widget that configures your application. 9 | class MyApp extends ConsumerWidget { 10 | const MyApp({super.key}); 11 | 12 | static final _defaultLightColorScheme = ColorScheme.fromSwatch(primarySwatch: Colors.blue); 13 | static final _defaultDarkColorScheme = ColorScheme.fromSwatch(primarySwatch: Colors.blue, brightness: Brightness.dark); 14 | 15 | @override 16 | Widget build(BuildContext context, WidgetRef ref) { 17 | final goRouter = ref.watch(goRouterProvider); 18 | 19 | return DynamicColorBuilder( 20 | builder: (lightColorScheme, darkColorScheme) { 21 | return MaterialApp.router( 22 | debugShowCheckedModeBanner: false, 23 | routerConfig: goRouter, 24 | theme: ThemeData( 25 | useMaterial3: true, 26 | colorScheme: lightColorScheme ?? _defaultLightColorScheme, 27 | elevatedButtonTheme: ElevatedButtonThemeData( 28 | style: ElevatedButton.styleFrom( 29 | backgroundColor: lightColorScheme?.primaryContainer, 30 | ), 31 | ), 32 | ), 33 | darkTheme: ThemeData( 34 | useMaterial3: true, 35 | colorScheme: darkColorScheme ?? _defaultDarkColorScheme, 36 | elevatedButtonTheme: ElevatedButtonThemeData( 37 | style: ElevatedButton.styleFrom( 38 | backgroundColor: darkColorScheme?.primaryContainer, 39 | ), 40 | ), 41 | ), 42 | ); 43 | }, 44 | ); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /ios/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleDisplayName 8 | Odyssey 2 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | odyssey_2 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | $(FLUTTER_BUILD_NAME) 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | $(FLUTTER_BUILD_NUMBER) 25 | LSRequiresIPhoneOS 26 | 27 | UILaunchStoryboardName 28 | LaunchScreen 29 | UIMainStoryboardFile 30 | Main 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UISupportedInterfaceOrientations~ipad 38 | 39 | UIInterfaceOrientationPortrait 40 | UIInterfaceOrientationPortraitUpsideDown 41 | UIInterfaceOrientationLandscapeLeft 42 | UIInterfaceOrientationLandscapeRight 43 | 44 | UIViewControllerBasedStatusBarAppearance 45 | 46 | CADisableMinimumFrameDurationOnPhone 47 | 48 | UIApplicationSupportsIndirectInputEvents 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /lib/src/features/activities/presentation/activity_chips.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:odyssey/src/features/activities/model/activity.dart'; 3 | 4 | class ActivityChips extends StatelessWidget { 5 | const ActivityChips(this.activities, 6 | {super.key, this.selectedActivities, this.onActivitySelected, this.alignment = WrapAlignment.center}); 7 | 8 | final List activities; 9 | final List? selectedActivities; 10 | final Function(Activity)? onActivitySelected; 11 | final WrapAlignment alignment; 12 | 13 | @override 14 | Widget build(BuildContext context) { 15 | return Wrap( 16 | spacing: 5, 17 | runAlignment: alignment, 18 | alignment: alignment, 19 | children: activities.map( 20 | (currentActivity) { 21 | final isSelected = selectedActivities == null ? true : selectedActivities!.contains(currentActivity); 22 | return FilterChip( 23 | avatar: Icon( 24 | IconData(currentActivity.iconCode, fontFamily: 'MaterialIcons'), 25 | color: isSelected ? Theme.of(context).colorScheme.onSecondaryContainer : Theme.of(context).colorScheme.onSurface, 26 | ), 27 | shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(20)), 28 | label: Text(currentActivity.activityName), 29 | labelStyle: TextStyle(color: Theme.of(context).colorScheme.onSecondaryContainer), 30 | showCheckmark: false, 31 | selected: isSelected, 32 | selectedColor: Theme.of(context).colorScheme.secondaryContainer, 33 | visualDensity: VisualDensity.compact, 34 | onSelected: (value) { 35 | if (selectedActivities != null) { 36 | onActivitySelected!(currentActivity); 37 | } 38 | }, 39 | ); 40 | }, 41 | ).toList(), 42 | ); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /assets/mood_icons/calm.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /assets/mood_icons/tongue.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /windows/runner/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.14) 2 | project(runner LANGUAGES CXX) 3 | 4 | # Define the application target. To change its name, change BINARY_NAME in the 5 | # top-level CMakeLists.txt, not the value here, or `flutter run` will no longer 6 | # work. 7 | # 8 | # Any new source files that you add to the application should be added here. 9 | add_executable(${BINARY_NAME} WIN32 10 | "flutter_window.cpp" 11 | "main.cpp" 12 | "utils.cpp" 13 | "win32_window.cpp" 14 | "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" 15 | "Runner.rc" 16 | "runner.exe.manifest" 17 | ) 18 | 19 | # Apply the standard set of build settings. This can be removed for applications 20 | # that need different build settings. 21 | apply_standard_settings(${BINARY_NAME}) 22 | 23 | # Add preprocessor definitions for the build version. 24 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION=\"${FLUTTER_VERSION}\"") 25 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MAJOR=${FLUTTER_VERSION_MAJOR}") 26 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MINOR=${FLUTTER_VERSION_MINOR}") 27 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_PATCH=${FLUTTER_VERSION_PATCH}") 28 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_BUILD=${FLUTTER_VERSION_BUILD}") 29 | 30 | # Disable Windows macros that collide with C++ standard library functions. 31 | target_compile_definitions(${BINARY_NAME} PRIVATE "NOMINMAX") 32 | 33 | # Add dependency libraries and include directories. Add any application-specific 34 | # dependencies here. 35 | target_link_libraries(${BINARY_NAME} PRIVATE flutter flutter_wrapper_app) 36 | target_link_libraries(${BINARY_NAME} PRIVATE "dwmapi.lib") 37 | target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}") 38 | 39 | # Run the Flutter tool portions of the build. This must not be removed. 40 | add_dependencies(${BINARY_NAME} flutter_assemble) 41 | -------------------------------------------------------------------------------- /windows/runner/utils.cpp: -------------------------------------------------------------------------------- 1 | #include "utils.h" 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #include 9 | 10 | void CreateAndAttachConsole() { 11 | if (::AllocConsole()) { 12 | FILE *unused; 13 | if (freopen_s(&unused, "CONOUT$", "w", stdout)) { 14 | _dup2(_fileno(stdout), 1); 15 | } 16 | if (freopen_s(&unused, "CONOUT$", "w", stderr)) { 17 | _dup2(_fileno(stdout), 2); 18 | } 19 | std::ios::sync_with_stdio(); 20 | FlutterDesktopResyncOutputStreams(); 21 | } 22 | } 23 | 24 | std::vector GetCommandLineArguments() { 25 | // Convert the UTF-16 command line arguments to UTF-8 for the Engine to use. 26 | int argc; 27 | wchar_t** argv = ::CommandLineToArgvW(::GetCommandLineW(), &argc); 28 | if (argv == nullptr) { 29 | return std::vector(); 30 | } 31 | 32 | std::vector command_line_arguments; 33 | 34 | // Skip the first argument as it's the binary name. 35 | for (int i = 1; i < argc; i++) { 36 | command_line_arguments.push_back(Utf8FromUtf16(argv[i])); 37 | } 38 | 39 | ::LocalFree(argv); 40 | 41 | return command_line_arguments; 42 | } 43 | 44 | std::string Utf8FromUtf16(const wchar_t* utf16_string) { 45 | if (utf16_string == nullptr) { 46 | return std::string(); 47 | } 48 | int target_length = ::WideCharToMultiByte( 49 | CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, 50 | -1, nullptr, 0, nullptr, nullptr); 51 | std::string utf8_string; 52 | if (target_length == 0 || target_length > utf8_string.max_size()) { 53 | return utf8_string; 54 | } 55 | utf8_string.resize(target_length); 56 | int converted_length = ::WideCharToMultiByte( 57 | CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, 58 | -1, utf8_string.data(), 59 | target_length, nullptr, nullptr); 60 | if (converted_length == 0) { 61 | return std::string(); 62 | } 63 | return utf8_string; 64 | } 65 | -------------------------------------------------------------------------------- /assets/mood_icons/frown.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /assets/mood_icons/glasses.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /assets/mood_icons/fever.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /web/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | odyssey_2 33 | 34 | 35 | 39 | 40 | 41 | 42 | 43 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /windows/runner/flutter_window.cpp: -------------------------------------------------------------------------------- 1 | #include "flutter_window.h" 2 | 3 | #include 4 | 5 | #include "flutter/generated_plugin_registrant.h" 6 | 7 | FlutterWindow::FlutterWindow(const flutter::DartProject& project) 8 | : project_(project) {} 9 | 10 | FlutterWindow::~FlutterWindow() {} 11 | 12 | bool FlutterWindow::OnCreate() { 13 | if (!Win32Window::OnCreate()) { 14 | return false; 15 | } 16 | 17 | RECT frame = GetClientArea(); 18 | 19 | // The size here must match the window dimensions to avoid unnecessary surface 20 | // creation / destruction in the startup path. 21 | flutter_controller_ = std::make_unique( 22 | frame.right - frame.left, frame.bottom - frame.top, project_); 23 | // Ensure that basic setup of the controller was successful. 24 | if (!flutter_controller_->engine() || !flutter_controller_->view()) { 25 | return false; 26 | } 27 | RegisterPlugins(flutter_controller_->engine()); 28 | SetChildContent(flutter_controller_->view()->GetNativeWindow()); 29 | 30 | flutter_controller_->engine()->SetNextFrameCallback([&]() { 31 | this->Show(); 32 | }); 33 | 34 | return true; 35 | } 36 | 37 | void FlutterWindow::OnDestroy() { 38 | if (flutter_controller_) { 39 | flutter_controller_ = nullptr; 40 | } 41 | 42 | Win32Window::OnDestroy(); 43 | } 44 | 45 | LRESULT 46 | FlutterWindow::MessageHandler(HWND hwnd, UINT const message, 47 | WPARAM const wparam, 48 | LPARAM const lparam) noexcept { 49 | // Give Flutter, including plugins, an opportunity to handle window messages. 50 | if (flutter_controller_) { 51 | std::optional result = 52 | flutter_controller_->HandleTopLevelWindowProc(hwnd, message, wparam, 53 | lparam); 54 | if (result) { 55 | return *result; 56 | } 57 | } 58 | 59 | switch (message) { 60 | case WM_FONTCHANGE: 61 | flutter_controller_->engine()->ReloadSystemFonts(); 62 | break; 63 | } 64 | 65 | return Win32Window::MessageHandler(hwnd, message, wparam, lparam); 66 | } 67 | -------------------------------------------------------------------------------- /assets/mood_icons/sweating.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /assets/mood_icons/woozy.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /assets/mood_icons/nauseous.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /android/app/build.gradle: -------------------------------------------------------------------------------- 1 | def localProperties = new Properties() 2 | def localPropertiesFile = rootProject.file('local.properties') 3 | if (localPropertiesFile.exists()) { 4 | localPropertiesFile.withReader('UTF-8') { reader -> 5 | localProperties.load(reader) 6 | } 7 | } 8 | 9 | def flutterRoot = localProperties.getProperty('flutter.sdk') 10 | if (flutterRoot == null) { 11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") 12 | } 13 | 14 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode') 15 | if (flutterVersionCode == null) { 16 | flutterVersionCode = '1' 17 | } 18 | 19 | def flutterVersionName = localProperties.getProperty('flutter.versionName') 20 | if (flutterVersionName == null) { 21 | flutterVersionName = '1.0' 22 | } 23 | 24 | apply plugin: 'com.android.application' 25 | apply plugin: 'kotlin-android' 26 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" 27 | 28 | android { 29 | compileSdkVersion flutter.compileSdkVersion 30 | ndkVersion flutter.ndkVersion 31 | 32 | compileOptions { 33 | sourceCompatibility JavaVersion.VERSION_1_8 34 | targetCompatibility JavaVersion.VERSION_1_8 35 | } 36 | 37 | kotlinOptions { 38 | jvmTarget = '1.8' 39 | } 40 | 41 | sourceSets { 42 | main.java.srcDirs += 'src/main/kotlin' 43 | } 44 | 45 | defaultConfig { 46 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 47 | applicationId "com.example.odyssey" 48 | // You can update the following values to match your application needs. 49 | // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration. 50 | minSdkVersion flutter.minSdkVersion 51 | targetSdkVersion flutter.targetSdkVersion 52 | versionCode flutterVersionCode.toInteger() 53 | versionName flutterVersionName 54 | } 55 | 56 | buildTypes { 57 | release { 58 | // TODO: Add your own signing config for the release build. 59 | // Signing with the debug keys for now, so `flutter run --release` works. 60 | signingConfig signingConfigs.debug 61 | } 62 | } 63 | } 64 | 65 | flutter { 66 | source '../..' 67 | } 68 | 69 | dependencies { 70 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 71 | } 72 | -------------------------------------------------------------------------------- /ios/Runner/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /assets/mood_icons/loudly_crying.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /lib/src/features/analytics/presentation/chart_frame_controller.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_riverpod/flutter_riverpod.dart'; 2 | import 'package:odyssey/src/features/analytics/presentation/chart_frame_card.dart'; 3 | import 'package:odyssey/src/features/mood_records/data/mood_log/mood_record_repository.dart'; 4 | import 'package:odyssey/src/features/mood_records/domain/mood_log/mood_record.dart'; 5 | 6 | class ChartFrameController extends AutoDisposeFamilyNotifier, ChartFilter> { 7 | late MoodRecordRepository moodRecordsRepository; 8 | 9 | @override 10 | List build(arg) { 11 | moodRecordsRepository = ref.read(moodRecordRepositoryProvider); 12 | return getFilteredRecords(arg); 13 | } 14 | 15 | // @override 16 | List get records => state; 17 | 18 | List getLastSevenDaysRecords() { 19 | final now = DateTime.now(); 20 | final records = moodRecordsRepository.fetchMoodRecordsByDate( 21 | before: now, 22 | after: DateTime(now.year, now.month, now.day).subtract( 23 | const Duration(days: 7), 24 | ), 25 | ); 26 | return records.values.toList(); 27 | } 28 | 29 | List getThisMonthRecords() { 30 | final now = DateTime.now(); 31 | final records = moodRecordsRepository.fetchMoodRecordsByDate( 32 | before: now, 33 | after: DateTime(now.year, now.month), 34 | ); 35 | 36 | return records.values.toList(); 37 | } 38 | 39 | List getThisYearRecords() { 40 | final now = DateTime.now(); 41 | final records = moodRecordsRepository.fetchMoodRecordsByDate( 42 | before: now, 43 | after: DateTime(now.year), 44 | ); 45 | return records.values.toList(); 46 | } 47 | 48 | List getAllRecords() { 49 | final records = moodRecordsRepository.fetchMoodRecords(); 50 | return records.values.toList(); 51 | } 52 | 53 | List getFilteredRecords(ChartFilter filter) { 54 | final list = switch (filter) { 55 | ChartFilter.sevenDays => getLastSevenDaysRecords(), 56 | ChartFilter.month => getThisMonthRecords(), 57 | ChartFilter.year => getThisYearRecords(), 58 | ChartFilter.all => getAllRecords(), 59 | }; 60 | return sortRecords(list); 61 | } 62 | 63 | List sortRecords(List records) { 64 | records = List.of(records); 65 | records.sort( 66 | (a, b) => a.date.compareTo(b.date), 67 | ); 68 | return records; 69 | } 70 | } 71 | 72 | final chartFrameControllerProvider = 73 | NotifierProvider.family.autoDispose, ChartFilter>(ChartFrameController.new); 74 | -------------------------------------------------------------------------------- /lib/src/features/mood_records/presentation/mood_log/mood_record_card_options.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_riverpod/flutter_riverpod.dart'; 3 | import 'package:odyssey/src/features/mood_records/data/mood_log/mood_record_repository.dart'; 4 | import 'package:odyssey/src/features/mood_records/domain/mood_log/mood_record.dart'; 5 | import 'package:odyssey/src/features/mood_records/presentation/mood_log/mood_log_screen.dart'; 6 | import 'package:odyssey/src/localization/string_hardcoded.dart'; 7 | 8 | enum MoodRecordCardMenuOption { delete, edit, addNote, addPhoto } 9 | 10 | class MoodRecordCardOptions extends StatelessWidget { 11 | const MoodRecordCardOptions({ 12 | super.key, 13 | required this.id, 14 | required this.recordEntry, 15 | required this.record, 16 | }); 17 | 18 | final dynamic id; 19 | final MapEntry recordEntry; 20 | final MoodRecord record; 21 | 22 | @override 23 | Widget build(BuildContext context) { 24 | return Consumer( 25 | builder: (context, ref, child) => PopupMenuButton( 26 | onSelected: (value) { 27 | switch (value) { 28 | case MoodRecordCardMenuOption.delete: 29 | () { 30 | final repository = ref.read(moodRecordRepositoryProvider); 31 | repository.deleteMoodRecord(id); 32 | }(); 33 | break; 34 | case MoodRecordCardMenuOption.edit: 35 | MoodRecordsScreen.showAddMoodRecordForm(context, recordEntry); 36 | break; 37 | default: 38 | } 39 | }, 40 | itemBuilder: (context) { 41 | return [ 42 | PopupMenuItem( 43 | value: MoodRecordCardMenuOption.edit, 44 | child: Text("Edit".hardcoded), 45 | ), 46 | // PopupMenuItem( 47 | // value: MoodRecordCardMenuOption.addNote, 48 | // child: Text(record.note == null ? "Add Note".hardcoded : "Edit Note".hardcoded), 49 | // ), 50 | // PopupMenuItem( 51 | // value: MoodRecordCardMenuOption.addPhoto, 52 | // child: Text("Add Photo".hardcoded), 53 | // ), 54 | PopupMenuItem( 55 | value: MoodRecordCardMenuOption.delete, 56 | child: Text( 57 | "Delete".hardcoded, 58 | style: const TextStyle(color: Colors.red), 59 | ), 60 | ), 61 | ]; 62 | }, 63 | ), 64 | ); 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /assets/mood_icons/smile.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /lib/src/features/activities/data/activity_categories.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:odyssey/src/features/activities/model/activity.dart'; 3 | 4 | final kActivityCategories = [ 5 | ActivityCategory( 6 | categoryName: "Social", 7 | activityList: [ 8 | Activity(activityName: "family", iconCode: Icons.diversity_3.codePoint), 9 | Activity(activityName: "friends", iconCode: Icons.groups.codePoint), 10 | Activity(activityName: "date", iconCode: Icons.favorite.codePoint), 11 | Activity(activityName: "party", iconCode: Icons.nightlife.codePoint), 12 | ], 13 | ), 14 | ActivityCategory( 15 | categoryName: "Hobbies", 16 | activityList: [ 17 | Activity(activityName: "movies & tv", iconCode: Icons.live_tv.codePoint), 18 | Activity(activityName: "reading", iconCode: Icons.book.codePoint), 19 | Activity(activityName: "gaming", iconCode: Icons.gamepad_outlined.codePoint), 20 | Activity(activityName: "relax", iconCode: Icons.weekend.codePoint), 21 | ], 22 | ), 23 | ActivityCategory( 24 | categoryName: "Sleep", 25 | activityList: [ 26 | Activity(activityName: "sleep early", iconCode: Icons.alarm_on.codePoint), 27 | Activity(activityName: "good sleep", iconCode: Icons.bedtime.codePoint), 28 | Activity(activityName: "medium sleep", iconCode: Icons.bedtime_outlined.codePoint), 29 | Activity(activityName: "bad sleep", iconCode: Icons.bedtime_off_outlined.codePoint), 30 | ], 31 | ), 32 | ActivityCategory( 33 | categoryName: "Health", 34 | activityList: [ 35 | Activity(activityName: "excercise", iconCode: Icons.fitness_center.codePoint), 36 | Activity(activityName: "drink water", iconCode: Icons.local_drink.codePoint), 37 | Activity(activityName: "walk", iconCode: Icons.directions_walk.codePoint), 38 | ], 39 | ), 40 | ActivityCategory( 41 | categoryName: "Better Me", 42 | activityList: [ 43 | Activity(activityName: "meditation", iconCode: Icons.self_improvement_outlined.codePoint), 44 | Activity(activityName: "kindness", iconCode: Icons.volunteer_activism.codePoint), 45 | Activity(activityName: "listen", iconCode: Icons.hearing.codePoint), 46 | Activity(activityName: "donate", iconCode: Icons.toll.codePoint), 47 | Activity(activityName: "give gift", iconCode: Icons.redeem.codePoint), 48 | ], 49 | ), 50 | ActivityCategory( 51 | categoryName: "Chores", 52 | activityList: [ 53 | Activity(activityName: "shopping", iconCode: Icons.shopping_bag_outlined.codePoint), 54 | Activity(activityName: "cleaning", iconCode: Icons.cleaning_services.codePoint), 55 | Activity(activityName: "cooking", iconCode: Icons.restaurant_menu.codePoint), 56 | Activity(activityName: "laundry", iconCode: Icons.local_laundry_service_outlined.codePoint), 57 | ], 58 | ), 59 | ]; 60 | -------------------------------------------------------------------------------- /assets/mood_icons/sleepy.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /linux/flutter/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # This file controls Flutter-level build steps. It should not be edited. 2 | cmake_minimum_required(VERSION 3.10) 3 | 4 | set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral") 5 | 6 | # Configuration provided via flutter tool. 7 | include(${EPHEMERAL_DIR}/generated_config.cmake) 8 | 9 | # TODO: Move the rest of this into files in ephemeral. See 10 | # https://github.com/flutter/flutter/issues/57146. 11 | 12 | # Serves the same purpose as list(TRANSFORM ... PREPEND ...), 13 | # which isn't available in 3.10. 14 | function(list_prepend LIST_NAME PREFIX) 15 | set(NEW_LIST "") 16 | foreach(element ${${LIST_NAME}}) 17 | list(APPEND NEW_LIST "${PREFIX}${element}") 18 | endforeach(element) 19 | set(${LIST_NAME} "${NEW_LIST}" PARENT_SCOPE) 20 | endfunction() 21 | 22 | # === Flutter Library === 23 | # System-level dependencies. 24 | find_package(PkgConfig REQUIRED) 25 | pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0) 26 | pkg_check_modules(GLIB REQUIRED IMPORTED_TARGET glib-2.0) 27 | pkg_check_modules(GIO REQUIRED IMPORTED_TARGET gio-2.0) 28 | 29 | set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/libflutter_linux_gtk.so") 30 | 31 | # Published to parent scope for install step. 32 | set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE) 33 | set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE) 34 | set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE) 35 | set(AOT_LIBRARY "${PROJECT_DIR}/build/lib/libapp.so" PARENT_SCOPE) 36 | 37 | list(APPEND FLUTTER_LIBRARY_HEADERS 38 | "fl_basic_message_channel.h" 39 | "fl_binary_codec.h" 40 | "fl_binary_messenger.h" 41 | "fl_dart_project.h" 42 | "fl_engine.h" 43 | "fl_json_message_codec.h" 44 | "fl_json_method_codec.h" 45 | "fl_message_codec.h" 46 | "fl_method_call.h" 47 | "fl_method_channel.h" 48 | "fl_method_codec.h" 49 | "fl_method_response.h" 50 | "fl_plugin_registrar.h" 51 | "fl_plugin_registry.h" 52 | "fl_standard_message_codec.h" 53 | "fl_standard_method_codec.h" 54 | "fl_string_codec.h" 55 | "fl_value.h" 56 | "fl_view.h" 57 | "flutter_linux.h" 58 | ) 59 | list_prepend(FLUTTER_LIBRARY_HEADERS "${EPHEMERAL_DIR}/flutter_linux/") 60 | add_library(flutter INTERFACE) 61 | target_include_directories(flutter INTERFACE 62 | "${EPHEMERAL_DIR}" 63 | ) 64 | target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}") 65 | target_link_libraries(flutter INTERFACE 66 | PkgConfig::GTK 67 | PkgConfig::GLIB 68 | PkgConfig::GIO 69 | ) 70 | add_dependencies(flutter flutter_assemble) 71 | 72 | # === Flutter tool backend === 73 | # _phony_ is a non-existent file to force this command to run every time, 74 | # since currently there's no way to get a full input/output list from the 75 | # flutter tool. 76 | add_custom_command( 77 | OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS} 78 | ${CMAKE_CURRENT_BINARY_DIR}/_phony_ 79 | COMMAND ${CMAKE_COMMAND} -E env 80 | ${FLUTTER_TOOL_ENVIRONMENT} 81 | "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.sh" 82 | ${FLUTTER_TARGET_PLATFORM} ${CMAKE_BUILD_TYPE} 83 | VERBATIM 84 | ) 85 | add_custom_target(flutter_assemble DEPENDS 86 | "${FLUTTER_LIBRARY}" 87 | ${FLUTTER_LIBRARY_HEADERS} 88 | ) 89 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "20x20", 5 | "idiom" : "iphone", 6 | "filename" : "Icon-App-20x20@2x.png", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "size" : "20x20", 11 | "idiom" : "iphone", 12 | "filename" : "Icon-App-20x20@3x.png", 13 | "scale" : "3x" 14 | }, 15 | { 16 | "size" : "29x29", 17 | "idiom" : "iphone", 18 | "filename" : "Icon-App-29x29@1x.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "29x29", 23 | "idiom" : "iphone", 24 | "filename" : "Icon-App-29x29@2x.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "29x29", 29 | "idiom" : "iphone", 30 | "filename" : "Icon-App-29x29@3x.png", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "size" : "40x40", 35 | "idiom" : "iphone", 36 | "filename" : "Icon-App-40x40@2x.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "40x40", 41 | "idiom" : "iphone", 42 | "filename" : "Icon-App-40x40@3x.png", 43 | "scale" : "3x" 44 | }, 45 | { 46 | "size" : "60x60", 47 | "idiom" : "iphone", 48 | "filename" : "Icon-App-60x60@2x.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "60x60", 53 | "idiom" : "iphone", 54 | "filename" : "Icon-App-60x60@3x.png", 55 | "scale" : "3x" 56 | }, 57 | { 58 | "size" : "20x20", 59 | "idiom" : "ipad", 60 | "filename" : "Icon-App-20x20@1x.png", 61 | "scale" : "1x" 62 | }, 63 | { 64 | "size" : "20x20", 65 | "idiom" : "ipad", 66 | "filename" : "Icon-App-20x20@2x.png", 67 | "scale" : "2x" 68 | }, 69 | { 70 | "size" : "29x29", 71 | "idiom" : "ipad", 72 | "filename" : "Icon-App-29x29@1x.png", 73 | "scale" : "1x" 74 | }, 75 | { 76 | "size" : "29x29", 77 | "idiom" : "ipad", 78 | "filename" : "Icon-App-29x29@2x.png", 79 | "scale" : "2x" 80 | }, 81 | { 82 | "size" : "40x40", 83 | "idiom" : "ipad", 84 | "filename" : "Icon-App-40x40@1x.png", 85 | "scale" : "1x" 86 | }, 87 | { 88 | "size" : "40x40", 89 | "idiom" : "ipad", 90 | "filename" : "Icon-App-40x40@2x.png", 91 | "scale" : "2x" 92 | }, 93 | { 94 | "size" : "76x76", 95 | "idiom" : "ipad", 96 | "filename" : "Icon-App-76x76@1x.png", 97 | "scale" : "1x" 98 | }, 99 | { 100 | "size" : "76x76", 101 | "idiom" : "ipad", 102 | "filename" : "Icon-App-76x76@2x.png", 103 | "scale" : "2x" 104 | }, 105 | { 106 | "size" : "83.5x83.5", 107 | "idiom" : "ipad", 108 | "filename" : "Icon-App-83.5x83.5@2x.png", 109 | "scale" : "2x" 110 | }, 111 | { 112 | "size" : "1024x1024", 113 | "idiom" : "ios-marketing", 114 | "filename" : "Icon-App-1024x1024@1x.png", 115 | "scale" : "1x" 116 | } 117 | ], 118 | "info" : { 119 | "version" : 1, 120 | "author" : "xcode" 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /assets/mood_icons/expectorate.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /lib/src/features/mood_records/presentation/mood_log/mood_log_screen.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_riverpod/flutter_riverpod.dart'; 3 | import 'package:hive_flutter/hive_flutter.dart'; 4 | import 'package:odyssey/src/features/mood_records/domain/mood_log/mood_record.dart'; 5 | import 'package:odyssey/src/features/mood_records/presentation/add_mood_record/add_mood_record_form.dart'; 6 | import 'package:odyssey/src/features/mood_records/presentation/mood_log/mood_record_group.dart'; 7 | import 'package:odyssey/src/features/mood_records/presentation/mood_log/mood_log_screen_controller.dart'; 8 | import 'package:odyssey/src/utils/widgets/responsive_centered.dart'; 9 | 10 | class MoodRecordsScreen extends ConsumerWidget { 11 | const MoodRecordsScreen({super.key}); 12 | 13 | static void showAddMoodRecordForm(context, MapEntry? recordToEdit) { 14 | showModalBottomSheet( 15 | useSafeArea: true, 16 | isScrollControlled: true, 17 | useRootNavigator: true, 18 | context: context, 19 | builder: (context) => AddMoodRecordForm(recordToEdit: recordToEdit), 20 | ); 21 | } 22 | 23 | @override 24 | Widget build(BuildContext context, WidgetRef ref) { 25 | final controller = ref.watch(moodRecordScreenControllerProvider.notifier); 26 | return Scaffold( 27 | appBar: AppBar( 28 | title: const Text("Mood Log"), 29 | ), 30 | body: ResponsiveCenter( 31 | child: Column( 32 | children: [ 33 | Expanded( 34 | child: ValueListenableBuilder( 35 | valueListenable: controller.repository.box.listenable(), 36 | builder: (context, box, child) { 37 | if (controller.repository.box.isEmpty) { 38 | return Center( 39 | child: Column( 40 | mainAxisSize: MainAxisSize.min, 41 | children: [ 42 | Text( 43 | "Start tracking your mood!", 44 | // style: Theme.of(context).textTheme.titleLarge, 45 | ), 46 | Text("Press the '+' button", style: Theme.of(context).textTheme.titleLarge), 47 | ], 48 | ), 49 | ); 50 | } else { 51 | final groupedRecords = controller.groupMoodRecordsByDay(box.toMap()); 52 | 53 | return ListView.builder( 54 | padding: const EdgeInsets.fromLTRB(12, 12, 12, kFloatingActionButtonMargin * 2 + 48), 55 | itemCount: groupedRecords.length, 56 | itemBuilder: (context, index) { 57 | final currentGroup = groupedRecords.entries.elementAt(index); 58 | return MoodRecordGroup(groupDate: DateTime.parse(currentGroup.key), moodList: currentGroup.value); 59 | }, 60 | ); 61 | } 62 | }, 63 | ), 64 | ) 65 | ], 66 | ), 67 | ), 68 | floatingActionButton: FloatingActionButton( 69 | onPressed: () => showAddMoodRecordForm(context, null), //context.pushNamed(AppRoute.addRecord.name), 70 | child: const Icon(Icons.add_outlined), 71 | ), 72 | ); 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Do not remove or rename entries in this file, only add new ones 2 | # See https://github.com/flutter/flutter/issues/128635 for more context. 3 | 4 | # Miscellaneous 5 | *.class 6 | *.lock 7 | *.log 8 | *.pyc 9 | *.swp 10 | .DS_Store 11 | .atom/ 12 | .buildlog/ 13 | .history 14 | .svn/ 15 | 16 | # IntelliJ related 17 | *.iml 18 | *.ipr 19 | *.iws 20 | .idea/ 21 | 22 | # Visual Studio Code related 23 | .classpath 24 | .project 25 | .settings/ 26 | .vscode/* 27 | 28 | # Flutter repo-specific 29 | /bin/cache/ 30 | /bin/internal/bootstrap.bat 31 | /bin/internal/bootstrap.sh 32 | /bin/mingit/ 33 | /dev/benchmarks/mega_gallery/ 34 | /dev/bots/.recipe_deps 35 | /dev/bots/android_tools/ 36 | /dev/devicelab/ABresults*.json 37 | /dev/docs/doc/ 38 | /dev/docs/api_docs.zip 39 | /dev/docs/flutter.docs.zip 40 | /dev/docs/lib/ 41 | /dev/docs/pubspec.yaml 42 | /dev/integration_tests/**/xcuserdata 43 | /dev/integration_tests/**/Pods 44 | /packages/flutter/coverage/ 45 | version 46 | analysis_benchmark.json 47 | 48 | # packages file containing multi-root paths 49 | .packages.generated 50 | 51 | # Flutter/Dart/Pub related 52 | **/doc/api/ 53 | .dart_tool/ 54 | .flutter-plugins 55 | .flutter-plugins-dependencies 56 | **/generated_plugin_registrant.dart 57 | .packages 58 | .pub-preload-cache/ 59 | .pub-cache/ 60 | .pub/ 61 | build/ 62 | flutter_*.png 63 | linked_*.ds 64 | unlinked.ds 65 | unlinked_spec.ds 66 | 67 | # Android related 68 | **/android/**/gradle-wrapper.jar 69 | .gradle/ 70 | **/android/captures/ 71 | **/android/gradlew 72 | **/android/gradlew.bat 73 | **/android/local.properties 74 | **/android/**/GeneratedPluginRegistrant.java 75 | **/android/key.properties 76 | *.jks 77 | 78 | # iOS/XCode related 79 | **/ios/**/*.mode1v3 80 | **/ios/**/*.mode2v3 81 | **/ios/**/*.moved-aside 82 | **/ios/**/*.pbxuser 83 | **/ios/**/*.perspectivev3 84 | **/ios/**/*sync/ 85 | **/ios/**/.sconsign.dblite 86 | **/ios/**/.tags* 87 | **/ios/**/.vagrant/ 88 | **/ios/**/DerivedData/ 89 | **/ios/**/Icon? 90 | **/ios/**/Pods/ 91 | **/ios/**/.symlinks/ 92 | **/ios/**/profile 93 | **/ios/**/xcuserdata 94 | **/ios/.generated/ 95 | **/ios/Flutter/.last_build_id 96 | **/ios/Flutter/App.framework 97 | **/ios/Flutter/Flutter.framework 98 | **/ios/Flutter/Flutter.podspec 99 | **/ios/Flutter/Generated.xcconfig 100 | **/ios/Flutter/ephemeral 101 | **/ios/Flutter/app.flx 102 | **/ios/Flutter/app.zip 103 | **/ios/Flutter/flutter_assets/ 104 | **/ios/Flutter/flutter_export_environment.sh 105 | **/ios/ServiceDefinitions.json 106 | **/ios/Runner/GeneratedPluginRegistrant.* 107 | 108 | # macOS 109 | **/Flutter/ephemeral/ 110 | **/Pods/ 111 | **/macos/Flutter/GeneratedPluginRegistrant.swift 112 | **/macos/Flutter/ephemeral 113 | **/xcuserdata/ 114 | 115 | # Windows 116 | **/windows/flutter/generated_plugin_registrant.cc 117 | **/windows/flutter/generated_plugin_registrant.h 118 | **/windows/flutter/generated_plugins.cmake 119 | 120 | # Linux 121 | **/linux/flutter/generated_plugin_registrant.cc 122 | **/linux/flutter/generated_plugin_registrant.h 123 | **/linux/flutter/generated_plugins.cmake 124 | 125 | # Coverage 126 | coverage/ 127 | 128 | # Symbols 129 | app.*.symbols 130 | 131 | # Exceptions to above rules. 132 | !**/ios/**/default.mode1v3 133 | !**/ios/**/default.mode2v3 134 | !**/ios/**/default.pbxuser 135 | !**/ios/**/default.perspectivev3 136 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages 137 | !/dev/ci/**/Gemfile.lock 138 | !.vscode/settings.json -------------------------------------------------------------------------------- /assets/mood_icons/vomitting.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 37 | 38 | 39 | 40 | 41 | 42 | 52 | 54 | 60 | 61 | 62 | 63 | 69 | 71 | 77 | 78 | 79 | 80 | 82 | 83 | 86 | 87 | 88 | -------------------------------------------------------------------------------- /assets/mood_icons/happy.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 37 | 38 | 39 | 40 | 41 | 42 | 52 | 54 | 60 | 61 | 62 | 63 | 69 | 71 | 77 | 78 | 79 | 80 | 82 | 83 | 86 | 87 | 88 | -------------------------------------------------------------------------------- /lib/src/features/activities/presentation/activity_selector_screen.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_riverpod/flutter_riverpod.dart'; 3 | import 'package:go_router/go_router.dart'; 4 | import 'package:odyssey/src/constants/app_sizes.dart'; 5 | import 'package:odyssey/src/features/activities/data/activity_repository.dart'; 6 | import 'package:odyssey/src/features/activities/model/activity.dart'; 7 | import 'package:odyssey/src/features/activities/presentation/activity_group.dart'; 8 | import 'package:odyssey/src/utils/widgets/responsive_centered.dart'; 9 | 10 | class ActivitySelectorScreen extends ConsumerStatefulWidget { 11 | const ActivitySelectorScreen({super.key, required this.recordActivities, required this.updateActivitiesCallback}); 12 | // final MoodRecord = 13 | final Function updateActivitiesCallback; 14 | final List recordActivities; 15 | 16 | @override 17 | ConsumerState createState() => _ActivitySelectorScreenState(); 18 | } 19 | 20 | class _ActivitySelectorScreenState extends ConsumerState { 21 | late List _selectedActivities; 22 | 23 | void _addOrRemoveActivity(Activity activity) { 24 | setState( 25 | () { 26 | if (_selectedActivities.contains(activity)) { 27 | _selectedActivities.remove(activity); 28 | } else { 29 | _selectedActivities.add(activity); 30 | } 31 | }, 32 | ); 33 | } 34 | 35 | @override 36 | void initState() { 37 | super.initState(); 38 | _selectedActivities = List.of(widget.recordActivities); 39 | } 40 | 41 | @override 42 | Widget build(BuildContext context) { 43 | final activityCategoriesValue = ref.watch(activityRepositoryProvider); 44 | return activityCategoriesValue.when( 45 | data: (repository) { 46 | final categories = repository.getCategories(); 47 | 48 | return Scaffold( 49 | appBar: AppBar( 50 | leading: IconButton( 51 | onPressed: () { 52 | context.pop(); 53 | }, 54 | icon: const Icon(Icons.close), 55 | ), 56 | actions: [ 57 | ElevatedButton.icon( 58 | onPressed: () { 59 | widget.updateActivitiesCallback(_selectedActivities); 60 | context.pop(); 61 | }, 62 | icon: const Icon(Icons.save_alt), 63 | label: const Text("Add"), 64 | ), 65 | gapW12 66 | ], 67 | ), 68 | body: SingleChildScrollView( 69 | child: ResponsiveCenter( 70 | padding: const EdgeInsets.all(Sizes.p16), 71 | child: Column( 72 | children: [ 73 | Text( 74 | "What have you been up to?", 75 | style: Theme.of(context).textTheme.headlineMedium, 76 | ), 77 | gapH12, 78 | for (var category in categories) 79 | ActivityGroup( 80 | activityCategory: category, 81 | selectedActivities: _selectedActivities, 82 | onSelectedActivity: _addOrRemoveActivity, 83 | ), 84 | ], 85 | ), 86 | ), 87 | ), 88 | ); 89 | }, 90 | loading: () => const Center( 91 | child: CircularProgressIndicator(), 92 | ), 93 | error: (error, stackTrace) { 94 | return Text("Error: ${error.toString()}"); 95 | }, 96 | ); 97 | } 98 | } 99 | -------------------------------------------------------------------------------- /windows/runner/Runner.rc: -------------------------------------------------------------------------------- 1 | // Microsoft Visual C++ generated resource script. 2 | // 3 | #pragma code_page(65001) 4 | #include "resource.h" 5 | 6 | #define APSTUDIO_READONLY_SYMBOLS 7 | ///////////////////////////////////////////////////////////////////////////// 8 | // 9 | // Generated from the TEXTINCLUDE 2 resource. 10 | // 11 | #include "winres.h" 12 | 13 | ///////////////////////////////////////////////////////////////////////////// 14 | #undef APSTUDIO_READONLY_SYMBOLS 15 | 16 | ///////////////////////////////////////////////////////////////////////////// 17 | // English (United States) resources 18 | 19 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) 20 | LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US 21 | 22 | #ifdef APSTUDIO_INVOKED 23 | ///////////////////////////////////////////////////////////////////////////// 24 | // 25 | // TEXTINCLUDE 26 | // 27 | 28 | 1 TEXTINCLUDE 29 | BEGIN 30 | "resource.h\0" 31 | END 32 | 33 | 2 TEXTINCLUDE 34 | BEGIN 35 | "#include ""winres.h""\r\n" 36 | "\0" 37 | END 38 | 39 | 3 TEXTINCLUDE 40 | BEGIN 41 | "\r\n" 42 | "\0" 43 | END 44 | 45 | #endif // APSTUDIO_INVOKED 46 | 47 | 48 | ///////////////////////////////////////////////////////////////////////////// 49 | // 50 | // Icon 51 | // 52 | 53 | // Icon with lowest ID value placed first to ensure application icon 54 | // remains consistent on all systems. 55 | IDI_APP_ICON ICON "resources\\app_icon.ico" 56 | 57 | 58 | ///////////////////////////////////////////////////////////////////////////// 59 | // 60 | // Version 61 | // 62 | 63 | #if defined(FLUTTER_VERSION_MAJOR) && defined(FLUTTER_VERSION_MINOR) && defined(FLUTTER_VERSION_PATCH) && defined(FLUTTER_VERSION_BUILD) 64 | #define VERSION_AS_NUMBER FLUTTER_VERSION_MAJOR,FLUTTER_VERSION_MINOR,FLUTTER_VERSION_PATCH,FLUTTER_VERSION_BUILD 65 | #else 66 | #define VERSION_AS_NUMBER 1,0,0,0 67 | #endif 68 | 69 | #if defined(FLUTTER_VERSION) 70 | #define VERSION_AS_STRING FLUTTER_VERSION 71 | #else 72 | #define VERSION_AS_STRING "1.0.0" 73 | #endif 74 | 75 | VS_VERSION_INFO VERSIONINFO 76 | FILEVERSION VERSION_AS_NUMBER 77 | PRODUCTVERSION VERSION_AS_NUMBER 78 | FILEFLAGSMASK VS_FFI_FILEFLAGSMASK 79 | #ifdef _DEBUG 80 | FILEFLAGS VS_FF_DEBUG 81 | #else 82 | FILEFLAGS 0x0L 83 | #endif 84 | FILEOS VOS__WINDOWS32 85 | FILETYPE VFT_APP 86 | FILESUBTYPE 0x0L 87 | BEGIN 88 | BLOCK "StringFileInfo" 89 | BEGIN 90 | BLOCK "040904e4" 91 | BEGIN 92 | VALUE "CompanyName", "com.example" "\0" 93 | VALUE "FileDescription", "odyssey_2" "\0" 94 | VALUE "FileVersion", VERSION_AS_STRING "\0" 95 | VALUE "InternalName", "odyssey_2" "\0" 96 | VALUE "LegalCopyright", "Copyright (C) 2023 com.example. All rights reserved." "\0" 97 | VALUE "OriginalFilename", "odyssey_2.exe" "\0" 98 | VALUE "ProductName", "odyssey_2" "\0" 99 | VALUE "ProductVersion", VERSION_AS_STRING "\0" 100 | END 101 | END 102 | BLOCK "VarFileInfo" 103 | BEGIN 104 | VALUE "Translation", 0x409, 1252 105 | END 106 | END 107 | 108 | #endif // English (United States) resources 109 | ///////////////////////////////////////////////////////////////////////////// 110 | 111 | 112 | 113 | #ifndef APSTUDIO_INVOKED 114 | ///////////////////////////////////////////////////////////////////////////// 115 | // 116 | // Generated from the TEXTINCLUDE 3 resource. 117 | // 118 | 119 | 120 | ///////////////////////////////////////////////////////////////////////////// 121 | #endif // not APSTUDIO_INVOKED 122 | -------------------------------------------------------------------------------- /assets/mood_icons/coughing.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /lib/src/features/analytics/presentation/chart_frame_card.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_riverpod/flutter_riverpod.dart'; 3 | import 'package:hive_flutter/hive_flutter.dart'; 4 | import 'package:odyssey/src/features/analytics/presentation/chart_frame_controller.dart'; 5 | import 'package:odyssey/src/features/analytics/presentation/mood_count_bar_chart.dart'; 6 | import 'package:odyssey/src/features/analytics/presentation/mood_variation_line_chart.dart'; 7 | import 'package:odyssey/src/features/mood_records/domain/mood_log/mood_record.dart'; 8 | 9 | enum ChartType { moodCount, moodVariation } 10 | 11 | enum ChartFilter { 12 | sevenDays, 13 | month, 14 | all, 15 | year, 16 | } 17 | 18 | class ChartFrame extends ConsumerStatefulWidget { 19 | const ChartFrame({ 20 | Key? key, 21 | required this.chartType, 22 | required this.title, 23 | }) : super(key: key); 24 | 25 | final ChartType chartType; 26 | final String title; 27 | 28 | @override 29 | ConsumerState createState() => _ChartFrameState(); 30 | } 31 | 32 | class _ChartFrameState extends ConsumerState { 33 | ChartFilter _dropdownValue = ChartFilter.sevenDays; 34 | // List _moodRecords = []; 35 | 36 | @override 37 | Widget build(BuildContext context) { 38 | final controller = ref.watch(chartFrameControllerProvider(_dropdownValue).notifier); 39 | 40 | return Card( 41 | child: Padding( 42 | padding: const EdgeInsets.all(15.0), 43 | child: Column( 44 | children: [ 45 | Row( 46 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 47 | children: [ 48 | Text( 49 | widget.title, 50 | style: Theme.of(context).textTheme.titleLarge, 51 | ), 52 | const Spacer(), 53 | DropdownButton( 54 | value: _dropdownValue, 55 | items: const [ 56 | DropdownMenuItem( 57 | value: ChartFilter.sevenDays, 58 | child: (Text("Week")), 59 | ), 60 | DropdownMenuItem( 61 | value: ChartFilter.month, 62 | child: (Text("Month")), 63 | ), 64 | DropdownMenuItem( 65 | value: ChartFilter.year, 66 | child: (Text("Year")), 67 | ), 68 | DropdownMenuItem( 69 | value: ChartFilter.all, 70 | child: (Text("All")), 71 | ), 72 | ], 73 | onChanged: (filter) { 74 | setState(() { 75 | _dropdownValue = filter!; 76 | }); 77 | }), 78 | const SizedBox( 79 | width: 8, 80 | ), 81 | // IconButton(onPressed: () {}, icon: const Icon(Icons.share)) 82 | ], 83 | ), 84 | const SizedBox( 85 | height: 20, 86 | ), 87 | ValueListenableBuilder( 88 | valueListenable: controller.moodRecordsRepository.box.listenable(), 89 | builder: (context, box, _) { 90 | return buildChart(widget.chartType, controller.records); 91 | }, 92 | ), 93 | ], 94 | ), 95 | ), 96 | ); 97 | } 98 | 99 | Widget buildChart(ChartType type, List moodRecords) { 100 | return switch (type) { 101 | ChartType.moodCount => MoodCountBarChart(moodRecords: moodRecords), 102 | ChartType.moodVariation => MoodVariationLineChart(moodRecords: moodRecords), 103 | }; 104 | } 105 | } 106 | -------------------------------------------------------------------------------- /lib/src/features/mood_records/presentation/add_mood_record/add_mood_record_form_controller.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_riverpod/flutter_riverpod.dart'; 3 | import 'package:go_router/go_router.dart'; 4 | import 'package:odyssey/gen/assets.gen.dart'; 5 | import 'package:odyssey/src/features/activities/model/activity.dart'; 6 | import 'package:odyssey/src/features/mood_records/domain/add_mood_record/mood_option.dart'; 7 | import 'package:odyssey/src/features/mood_records/data/mood_log/mood_record_repository.dart'; 8 | import 'package:odyssey/src/features/mood_records/domain/mood_log/mood_record.dart'; 9 | import 'package:odyssey/src/routing/app_routes.dart'; 10 | 11 | class AddMoodRecordFormControllerNotifier extends AutoDisposeFamilyNotifier?> { 12 | // AddMoodRecordFormControllerNotifier({this.toEdit}); 13 | 14 | late final MapEntry? toEdit; 15 | 16 | @override 17 | build(MapEntry? arg) { 18 | // MoodConfiguration(iconPath: Assets.moodIcons.neutral, color: Colors.blue, label: "Alright", score: 3), 19 | if (arg == null) { 20 | return MoodRecord( 21 | label: "Alright", 22 | score: 3, 23 | iconPath: Assets.moodIcons.neutral, 24 | color: Colors.blue.value, 25 | date: DateTime.now(), 26 | ); 27 | } else { 28 | toEdit = arg; 29 | return arg.value; 30 | } 31 | } 32 | 33 | void saveOrUpdate(dynamic key, MoodRecord value) { 34 | final moodRecordRepository = ref.read(moodRecordRepositoryProvider); 35 | if (key == null) { 36 | moodRecordRepository.createMoodRecord(value); 37 | } else { 38 | moodRecordRepository.updateMoodRecord(key, value); 39 | } 40 | } 41 | 42 | void updateTime(BuildContext context) async { 43 | final selectedTime = await showTimePicker( 44 | context: context, 45 | initialTime: TimeOfDay( 46 | hour: state.date.hour, 47 | minute: state.date.minute, 48 | ), 49 | ); 50 | 51 | if (selectedTime != null) { 52 | state = state.copyWith( 53 | date: state.date.copyWith( 54 | hour: selectedTime.hour, 55 | minute: selectedTime.minute, 56 | ), 57 | ); 58 | } 59 | } 60 | 61 | void updateDate(BuildContext context) async { 62 | final selectedDate = await showDatePicker( 63 | context: context, 64 | initialDate: state.date, 65 | firstDate: DateTime.fromMillisecondsSinceEpoch(1), 66 | lastDate: DateTime.now(), 67 | ); 68 | 69 | if (selectedDate != null) { 70 | state = state.copyWith( 71 | date: state.date.copyWith( 72 | day: selectedDate.day, 73 | month: selectedDate.month, 74 | year: selectedDate.year, 75 | ), 76 | ); 77 | } 78 | } 79 | 80 | void updateMoodConfiguration(MoodConfiguration configuration) { 81 | state = state.copyWith( 82 | label: configuration.label, 83 | color: configuration.color.value, 84 | iconPath: configuration.iconPath, 85 | score: configuration.score, 86 | ); 87 | } 88 | 89 | void updateNote(String note) { 90 | if (note.isEmpty && state.note != note) { 91 | state = state.copyWith(note: null); 92 | } 93 | state = state.copyWith(note: note); 94 | } 95 | 96 | void openActivitySelector(BuildContext context) { 97 | context.pushNamed( 98 | AppRoute.selectActivities.name, 99 | extra: (state.activities, updateActivities), 100 | ); 101 | } 102 | 103 | void updateActivities(List activities) { 104 | state = state.copyWith(activities: activities); 105 | } 106 | } 107 | 108 | final addMoodRecordFormControllerNotifierProvider = NotifierProvider.autoDispose 109 | .family?>(AddMoodRecordFormControllerNotifier.new); 110 | -------------------------------------------------------------------------------- /windows/runner/win32_window.h: -------------------------------------------------------------------------------- 1 | #ifndef RUNNER_WIN32_WINDOW_H_ 2 | #define RUNNER_WIN32_WINDOW_H_ 3 | 4 | #include 5 | 6 | #include 7 | #include 8 | #include 9 | 10 | // A class abstraction for a high DPI-aware Win32 Window. Intended to be 11 | // inherited from by classes that wish to specialize with custom 12 | // rendering and input handling 13 | class Win32Window { 14 | public: 15 | struct Point { 16 | unsigned int x; 17 | unsigned int y; 18 | Point(unsigned int x, unsigned int y) : x(x), y(y) {} 19 | }; 20 | 21 | struct Size { 22 | unsigned int width; 23 | unsigned int height; 24 | Size(unsigned int width, unsigned int height) 25 | : width(width), height(height) {} 26 | }; 27 | 28 | Win32Window(); 29 | virtual ~Win32Window(); 30 | 31 | // Creates a win32 window with |title| that is positioned and sized using 32 | // |origin| and |size|. New windows are created on the default monitor. Window 33 | // sizes are specified to the OS in physical pixels, hence to ensure a 34 | // consistent size this function will scale the inputted width and height as 35 | // as appropriate for the default monitor. The window is invisible until 36 | // |Show| is called. Returns true if the window was created successfully. 37 | bool Create(const std::wstring& title, const Point& origin, const Size& size); 38 | 39 | // Show the current window. Returns true if the window was successfully shown. 40 | bool Show(); 41 | 42 | // Release OS resources associated with window. 43 | void Destroy(); 44 | 45 | // Inserts |content| into the window tree. 46 | void SetChildContent(HWND content); 47 | 48 | // Returns the backing Window handle to enable clients to set icon and other 49 | // window properties. Returns nullptr if the window has been destroyed. 50 | HWND GetHandle(); 51 | 52 | // If true, closing this window will quit the application. 53 | void SetQuitOnClose(bool quit_on_close); 54 | 55 | // Return a RECT representing the bounds of the current client area. 56 | RECT GetClientArea(); 57 | 58 | protected: 59 | // Processes and route salient window messages for mouse handling, 60 | // size change and DPI. Delegates handling of these to member overloads that 61 | // inheriting classes can handle. 62 | virtual LRESULT MessageHandler(HWND window, 63 | UINT const message, 64 | WPARAM const wparam, 65 | LPARAM const lparam) noexcept; 66 | 67 | // Called when CreateAndShow is called, allowing subclass window-related 68 | // setup. Subclasses should return false if setup fails. 69 | virtual bool OnCreate(); 70 | 71 | // Called when Destroy is called. 72 | virtual void OnDestroy(); 73 | 74 | private: 75 | friend class WindowClassRegistrar; 76 | 77 | // OS callback called by message pump. Handles the WM_NCCREATE message which 78 | // is passed when the non-client area is being created and enables automatic 79 | // non-client DPI scaling so that the non-client area automatically 80 | // responsponds to changes in DPI. All other messages are handled by 81 | // MessageHandler. 82 | static LRESULT CALLBACK WndProc(HWND const window, 83 | UINT const message, 84 | WPARAM const wparam, 85 | LPARAM const lparam) noexcept; 86 | 87 | // Retrieves a class instance pointer for |window| 88 | static Win32Window* GetThisFromHandle(HWND const window) noexcept; 89 | 90 | // Update the window frame's theme to match the system theme. 91 | static void UpdateTheme(HWND const window); 92 | 93 | bool quit_on_close_ = false; 94 | 95 | // window handle for top level window. 96 | HWND window_handle_ = nullptr; 97 | 98 | // window handle for hosted content. 99 | HWND child_content_ = nullptr; 100 | }; 101 | 102 | #endif // RUNNER_WIN32_WINDOW_H_ 103 | -------------------------------------------------------------------------------- /windows/flutter/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # This file controls Flutter-level build steps. It should not be edited. 2 | cmake_minimum_required(VERSION 3.14) 3 | 4 | set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral") 5 | 6 | # Configuration provided via flutter tool. 7 | include(${EPHEMERAL_DIR}/generated_config.cmake) 8 | 9 | # TODO: Move the rest of this into files in ephemeral. See 10 | # https://github.com/flutter/flutter/issues/57146. 11 | set(WRAPPER_ROOT "${EPHEMERAL_DIR}/cpp_client_wrapper") 12 | 13 | # === Flutter Library === 14 | set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/flutter_windows.dll") 15 | 16 | # Published to parent scope for install step. 17 | set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE) 18 | set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE) 19 | set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE) 20 | set(AOT_LIBRARY "${PROJECT_DIR}/build/windows/app.so" PARENT_SCOPE) 21 | 22 | list(APPEND FLUTTER_LIBRARY_HEADERS 23 | "flutter_export.h" 24 | "flutter_windows.h" 25 | "flutter_messenger.h" 26 | "flutter_plugin_registrar.h" 27 | "flutter_texture_registrar.h" 28 | ) 29 | list(TRANSFORM FLUTTER_LIBRARY_HEADERS PREPEND "${EPHEMERAL_DIR}/") 30 | add_library(flutter INTERFACE) 31 | target_include_directories(flutter INTERFACE 32 | "${EPHEMERAL_DIR}" 33 | ) 34 | target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}.lib") 35 | add_dependencies(flutter flutter_assemble) 36 | 37 | # === Wrapper === 38 | list(APPEND CPP_WRAPPER_SOURCES_CORE 39 | "core_implementations.cc" 40 | "standard_codec.cc" 41 | ) 42 | list(TRANSFORM CPP_WRAPPER_SOURCES_CORE PREPEND "${WRAPPER_ROOT}/") 43 | list(APPEND CPP_WRAPPER_SOURCES_PLUGIN 44 | "plugin_registrar.cc" 45 | ) 46 | list(TRANSFORM CPP_WRAPPER_SOURCES_PLUGIN PREPEND "${WRAPPER_ROOT}/") 47 | list(APPEND CPP_WRAPPER_SOURCES_APP 48 | "flutter_engine.cc" 49 | "flutter_view_controller.cc" 50 | ) 51 | list(TRANSFORM CPP_WRAPPER_SOURCES_APP PREPEND "${WRAPPER_ROOT}/") 52 | 53 | # Wrapper sources needed for a plugin. 54 | add_library(flutter_wrapper_plugin STATIC 55 | ${CPP_WRAPPER_SOURCES_CORE} 56 | ${CPP_WRAPPER_SOURCES_PLUGIN} 57 | ) 58 | apply_standard_settings(flutter_wrapper_plugin) 59 | set_target_properties(flutter_wrapper_plugin PROPERTIES 60 | POSITION_INDEPENDENT_CODE ON) 61 | set_target_properties(flutter_wrapper_plugin PROPERTIES 62 | CXX_VISIBILITY_PRESET hidden) 63 | target_link_libraries(flutter_wrapper_plugin PUBLIC flutter) 64 | target_include_directories(flutter_wrapper_plugin PUBLIC 65 | "${WRAPPER_ROOT}/include" 66 | ) 67 | add_dependencies(flutter_wrapper_plugin flutter_assemble) 68 | 69 | # Wrapper sources needed for the runner. 70 | add_library(flutter_wrapper_app STATIC 71 | ${CPP_WRAPPER_SOURCES_CORE} 72 | ${CPP_WRAPPER_SOURCES_APP} 73 | ) 74 | apply_standard_settings(flutter_wrapper_app) 75 | target_link_libraries(flutter_wrapper_app PUBLIC flutter) 76 | target_include_directories(flutter_wrapper_app PUBLIC 77 | "${WRAPPER_ROOT}/include" 78 | ) 79 | add_dependencies(flutter_wrapper_app flutter_assemble) 80 | 81 | # === Flutter tool backend === 82 | # _phony_ is a non-existent file to force this command to run every time, 83 | # since currently there's no way to get a full input/output list from the 84 | # flutter tool. 85 | set(PHONY_OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/_phony_") 86 | set_source_files_properties("${PHONY_OUTPUT}" PROPERTIES SYMBOLIC TRUE) 87 | add_custom_command( 88 | OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS} 89 | ${CPP_WRAPPER_SOURCES_CORE} ${CPP_WRAPPER_SOURCES_PLUGIN} 90 | ${CPP_WRAPPER_SOURCES_APP} 91 | ${PHONY_OUTPUT} 92 | COMMAND ${CMAKE_COMMAND} -E env 93 | ${FLUTTER_TOOL_ENVIRONMENT} 94 | "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.bat" 95 | windows-x64 $ 96 | VERBATIM 97 | ) 98 | add_custom_target(flutter_assemble DEPENDS 99 | "${FLUTTER_LIBRARY}" 100 | ${FLUTTER_LIBRARY_HEADERS} 101 | ${CPP_WRAPPER_SOURCES_CORE} 102 | ${CPP_WRAPPER_SOURCES_PLUGIN} 103 | ${CPP_WRAPPER_SOURCES_APP} 104 | ) 105 | -------------------------------------------------------------------------------- /linux/my_application.cc: -------------------------------------------------------------------------------- 1 | #include "my_application.h" 2 | 3 | #include 4 | #ifdef GDK_WINDOWING_X11 5 | #include 6 | #endif 7 | 8 | #include "flutter/generated_plugin_registrant.h" 9 | 10 | struct _MyApplication { 11 | GtkApplication parent_instance; 12 | char** dart_entrypoint_arguments; 13 | }; 14 | 15 | G_DEFINE_TYPE(MyApplication, my_application, GTK_TYPE_APPLICATION) 16 | 17 | // Implements GApplication::activate. 18 | static void my_application_activate(GApplication* application) { 19 | MyApplication* self = MY_APPLICATION(application); 20 | GtkWindow* window = 21 | GTK_WINDOW(gtk_application_window_new(GTK_APPLICATION(application))); 22 | 23 | // Use a header bar when running in GNOME as this is the common style used 24 | // by applications and is the setup most users will be using (e.g. Ubuntu 25 | // desktop). 26 | // If running on X and not using GNOME then just use a traditional title bar 27 | // in case the window manager does more exotic layout, e.g. tiling. 28 | // If running on Wayland assume the header bar will work (may need changing 29 | // if future cases occur). 30 | gboolean use_header_bar = TRUE; 31 | #ifdef GDK_WINDOWING_X11 32 | GdkScreen* screen = gtk_window_get_screen(window); 33 | if (GDK_IS_X11_SCREEN(screen)) { 34 | const gchar* wm_name = gdk_x11_screen_get_window_manager_name(screen); 35 | if (g_strcmp0(wm_name, "GNOME Shell") != 0) { 36 | use_header_bar = FALSE; 37 | } 38 | } 39 | #endif 40 | if (use_header_bar) { 41 | GtkHeaderBar* header_bar = GTK_HEADER_BAR(gtk_header_bar_new()); 42 | gtk_widget_show(GTK_WIDGET(header_bar)); 43 | gtk_header_bar_set_title(header_bar, "odyssey_2"); 44 | gtk_header_bar_set_show_close_button(header_bar, TRUE); 45 | gtk_window_set_titlebar(window, GTK_WIDGET(header_bar)); 46 | } else { 47 | gtk_window_set_title(window, "odyssey_2"); 48 | } 49 | 50 | gtk_window_set_default_size(window, 1280, 720); 51 | gtk_widget_show(GTK_WIDGET(window)); 52 | 53 | g_autoptr(FlDartProject) project = fl_dart_project_new(); 54 | fl_dart_project_set_dart_entrypoint_arguments(project, self->dart_entrypoint_arguments); 55 | 56 | FlView* view = fl_view_new(project); 57 | gtk_widget_show(GTK_WIDGET(view)); 58 | gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(view)); 59 | 60 | fl_register_plugins(FL_PLUGIN_REGISTRY(view)); 61 | 62 | gtk_widget_grab_focus(GTK_WIDGET(view)); 63 | } 64 | 65 | // Implements GApplication::local_command_line. 66 | static gboolean my_application_local_command_line(GApplication* application, gchar*** arguments, int* exit_status) { 67 | MyApplication* self = MY_APPLICATION(application); 68 | // Strip out the first argument as it is the binary name. 69 | self->dart_entrypoint_arguments = g_strdupv(*arguments + 1); 70 | 71 | g_autoptr(GError) error = nullptr; 72 | if (!g_application_register(application, nullptr, &error)) { 73 | g_warning("Failed to register: %s", error->message); 74 | *exit_status = 1; 75 | return TRUE; 76 | } 77 | 78 | g_application_activate(application); 79 | *exit_status = 0; 80 | 81 | return TRUE; 82 | } 83 | 84 | // Implements GObject::dispose. 85 | static void my_application_dispose(GObject* object) { 86 | MyApplication* self = MY_APPLICATION(object); 87 | g_clear_pointer(&self->dart_entrypoint_arguments, g_strfreev); 88 | G_OBJECT_CLASS(my_application_parent_class)->dispose(object); 89 | } 90 | 91 | static void my_application_class_init(MyApplicationClass* klass) { 92 | G_APPLICATION_CLASS(klass)->activate = my_application_activate; 93 | G_APPLICATION_CLASS(klass)->local_command_line = my_application_local_command_line; 94 | G_OBJECT_CLASS(klass)->dispose = my_application_dispose; 95 | } 96 | 97 | static void my_application_init(MyApplication* self) {} 98 | 99 | MyApplication* my_application_new() { 100 | return MY_APPLICATION(g_object_new(my_application_get_type(), 101 | "application-id", APPLICATION_ID, 102 | "flags", G_APPLICATION_NON_UNIQUE, 103 | nullptr)); 104 | } 105 | -------------------------------------------------------------------------------- /windows/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Project-level configuration. 2 | cmake_minimum_required(VERSION 3.14) 3 | project(odyssey_2 LANGUAGES CXX) 4 | 5 | # The name of the executable created for the application. Change this to change 6 | # the on-disk name of your application. 7 | set(BINARY_NAME "odyssey_2") 8 | 9 | # Explicitly opt in to modern CMake behaviors to avoid warnings with recent 10 | # versions of CMake. 11 | cmake_policy(SET CMP0063 NEW) 12 | 13 | # Define build configuration option. 14 | get_property(IS_MULTICONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) 15 | if(IS_MULTICONFIG) 16 | set(CMAKE_CONFIGURATION_TYPES "Debug;Profile;Release" 17 | CACHE STRING "" FORCE) 18 | else() 19 | if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) 20 | set(CMAKE_BUILD_TYPE "Debug" CACHE 21 | STRING "Flutter build mode" FORCE) 22 | set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS 23 | "Debug" "Profile" "Release") 24 | endif() 25 | endif() 26 | # Define settings for the Profile build mode. 27 | set(CMAKE_EXE_LINKER_FLAGS_PROFILE "${CMAKE_EXE_LINKER_FLAGS_RELEASE}") 28 | set(CMAKE_SHARED_LINKER_FLAGS_PROFILE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE}") 29 | set(CMAKE_C_FLAGS_PROFILE "${CMAKE_C_FLAGS_RELEASE}") 30 | set(CMAKE_CXX_FLAGS_PROFILE "${CMAKE_CXX_FLAGS_RELEASE}") 31 | 32 | # Use Unicode for all projects. 33 | add_definitions(-DUNICODE -D_UNICODE) 34 | 35 | # Compilation settings that should be applied to most targets. 36 | # 37 | # Be cautious about adding new options here, as plugins use this function by 38 | # default. In most cases, you should add new options to specific targets instead 39 | # of modifying this function. 40 | function(APPLY_STANDARD_SETTINGS TARGET) 41 | target_compile_features(${TARGET} PUBLIC cxx_std_17) 42 | target_compile_options(${TARGET} PRIVATE /W4 /WX /wd"4100") 43 | target_compile_options(${TARGET} PRIVATE /EHsc) 44 | target_compile_definitions(${TARGET} PRIVATE "_HAS_EXCEPTIONS=0") 45 | target_compile_definitions(${TARGET} PRIVATE "$<$:_DEBUG>") 46 | endfunction() 47 | 48 | # Flutter library and tool build rules. 49 | set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter") 50 | add_subdirectory(${FLUTTER_MANAGED_DIR}) 51 | 52 | # Application build; see runner/CMakeLists.txt. 53 | add_subdirectory("runner") 54 | 55 | # Generated plugin build rules, which manage building the plugins and adding 56 | # them to the application. 57 | include(flutter/generated_plugins.cmake) 58 | 59 | 60 | # === Installation === 61 | # Support files are copied into place next to the executable, so that it can 62 | # run in place. This is done instead of making a separate bundle (as on Linux) 63 | # so that building and running from within Visual Studio will work. 64 | set(BUILD_BUNDLE_DIR "$") 65 | # Make the "install" step default, as it's required to run. 66 | set(CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD 1) 67 | if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) 68 | set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE) 69 | endif() 70 | 71 | set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data") 72 | set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}") 73 | 74 | install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}" 75 | COMPONENT Runtime) 76 | 77 | install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" 78 | COMPONENT Runtime) 79 | 80 | install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" 81 | COMPONENT Runtime) 82 | 83 | if(PLUGIN_BUNDLED_LIBRARIES) 84 | install(FILES "${PLUGIN_BUNDLED_LIBRARIES}" 85 | DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" 86 | COMPONENT Runtime) 87 | endif() 88 | 89 | # Fully re-copy the assets directory on each build to avoid having stale files 90 | # from a previous install. 91 | set(FLUTTER_ASSET_DIR_NAME "flutter_assets") 92 | install(CODE " 93 | file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\") 94 | " COMPONENT Runtime) 95 | install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}" 96 | DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) 97 | 98 | # Install the AOT library on non-Debug builds only. 99 | install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" 100 | CONFIGURATIONS Profile;Release 101 | COMPONENT Runtime) 102 | -------------------------------------------------------------------------------- /lib/src/routing/app_router.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_riverpod/flutter_riverpod.dart'; 3 | import 'package:go_router/go_router.dart'; 4 | import 'package:odyssey/src/features/activities/model/activity.dart'; 5 | import 'package:odyssey/src/features/activities/presentation/activity_selector_screen.dart'; 6 | import 'package:odyssey/src/features/analytics/presentation/analytics_screen.dart'; 7 | import 'package:odyssey/src/features/mood_records/presentation/mood_log/mood_log_screen.dart'; 8 | import 'package:odyssey/src/routing/not_found_screen.dart'; 9 | import 'package:odyssey/src/utils/widgets/scafforld_with_botto_navigation_bar.dart'; 10 | import 'package:odyssey/src/utils/widgets/scafforld_with_botto_navigation_bar_item.dart'; 11 | // import 'package:odyssey/src/features/calendar/application/calendar_screen.dart'; 12 | // import 'package:odyssey/src/features/settings/application/settings_screen.dart'; 13 | 14 | import 'app_routes.dart'; 15 | 16 | final _rootNavigatorKey = GlobalKey(); 17 | final _shellNavigatorKey = GlobalKey(); 18 | 19 | final goRouterProvider = Provider((ref) { 20 | return GoRouter( 21 | initialLocation: "/records", 22 | navigatorKey: _rootNavigatorKey, 23 | routes: [ 24 | // GoRoute( 25 | // path: "/", 26 | // builder: (context, state) => const NotFoundScreen(), 27 | // ), 28 | ShellRoute( 29 | navigatorKey: _shellNavigatorKey, 30 | builder: (context, state, child) => ScaffoldWithBottomNavigationBar( 31 | destinations: _destinations, 32 | child: child, 33 | ), 34 | routes: [ 35 | GoRoute( 36 | path: "/records", 37 | name: AppRoute.moodRecords.name, 38 | pageBuilder: (context, state) => const NoTransitionPage(child: MoodRecordsScreen()), 39 | parentNavigatorKey: _shellNavigatorKey, 40 | ), 41 | GoRoute( 42 | path: "/analytics", 43 | name: AppRoute.analytics.name, 44 | pageBuilder: (context, state) => const NoTransitionPage(child: AnalyticsScreen()), 45 | parentNavigatorKey: _shellNavigatorKey, 46 | ), 47 | // GoRoute( 48 | // path: "/calendar", 49 | // name: AppRoute.calendar.name, 50 | // pageBuilder: (context, state) => const NoTransitionPage(child: CalendarScreen()), 51 | // parentNavigatorKey: _shellNavigatorKey, 52 | // ), 53 | // GoRoute( 54 | // path: "/settings", 55 | // name: AppRoute.settings.name, 56 | // pageBuilder: (context, state) => const NoTransitionPage(child: SettingsScreen()), 57 | // parentNavigatorKey: _shellNavigatorKey, 58 | // ), 59 | ], 60 | ), 61 | GoRoute( 62 | path: "/selectActivities", 63 | name: AppRoute.selectActivities.name, 64 | builder: (context, state) { 65 | final (activities, updateActivities) = state.extra as (List, Function); 66 | return ActivitySelectorScreen( 67 | recordActivities: activities, 68 | updateActivitiesCallback: updateActivities, 69 | ); 70 | }, 71 | parentNavigatorKey: _rootNavigatorKey, 72 | ), 73 | ], 74 | errorBuilder: (context, state) => const NotFoundScreen(), 75 | ); 76 | }); 77 | 78 | const _destinations = [ 79 | ScaffoldWithBottomNavigationBarItem( 80 | route: AppRoute.moodRecords, 81 | icon: Icon(Icons.view_agenda_outlined), 82 | selectedIcon: Icon(Icons.view_agenda), 83 | label: "Log", 84 | ), 85 | ScaffoldWithBottomNavigationBarItem( 86 | route: AppRoute.analytics, 87 | icon: Icon(Icons.auto_graph_outlined), 88 | selectedIcon: Icon(Icons.auto_graph), 89 | label: "Insights", 90 | ), 91 | 92 | // ScaffoldWithBottomNavigationBarItem( 93 | // route: AppRoute.calendar, 94 | // icon: Icon(Icons.calendar_month_outlined), 95 | // selectedIcon: Icon(Icons.calendar_month), 96 | // label: "Calendar", 97 | // ), 98 | // ScaffoldWithBottomNavigationBarItem( 99 | // route: AppRoute.settings, 100 | // icon: Icon(Icons.settings_outlined), 101 | // selectedIcon: Icon(Icons.settings), 102 | // label: "Settings", 103 | // ), 104 | ]; 105 | -------------------------------------------------------------------------------- /lib/src/features/analytics/presentation/mood_count_bar_chart.dart: -------------------------------------------------------------------------------- 1 | import 'package:collection/collection.dart'; 2 | import 'package:fl_chart/fl_chart.dart'; 3 | import 'package:flutter/material.dart'; 4 | import 'package:flutter_svg/svg.dart'; 5 | import 'package:odyssey/gen/assets.gen.dart'; 6 | import 'package:odyssey/src/features/mood_records/domain/mood_log/mood_record.dart'; 7 | 8 | class MoodCountBarChart extends StatelessWidget { 9 | const MoodCountBarChart({ 10 | super.key, 11 | required this.moodRecords, 12 | }); 13 | 14 | final List moodRecords; 15 | 16 | @override 17 | Widget build(BuildContext context) { 18 | return SizedBox( 19 | // padding: EdgeInsets.fromLTRB(10, 10, 10, 10), 20 | height: 180, 21 | child: moodRecords.isEmpty 22 | ? const Center( 23 | child: Text("Not enough data..."), 24 | ) 25 | : BarChart( 26 | BarChartData( 27 | barGroups: _getBarChartGroups(moodRecords), 28 | titlesData: FlTitlesData( 29 | rightTitles: AxisTitles( 30 | sideTitles: SideTitles( 31 | showTitles: true, 32 | getTitlesWidget: (value, meta) => Container(), 33 | ), 34 | ), 35 | topTitles: AxisTitles( 36 | sideTitles: SideTitles( 37 | showTitles: false, 38 | getTitlesWidget: (value, meta) => Container(), 39 | ), 40 | ), 41 | bottomTitles: AxisTitles( 42 | sideTitles: SideTitles( 43 | showTitles: true, 44 | getTitlesWidget: titleWidgets, 45 | reservedSize: 40, 46 | ), 47 | ), 48 | leftTitles: AxisTitles( 49 | sideTitles: SideTitles( 50 | showTitles: true, 51 | interval: 1, 52 | ), 53 | ), 54 | ), 55 | borderData: FlBorderData(show: false), 56 | gridData: FlGridData( 57 | drawVerticalLine: false, 58 | horizontalInterval: 1, 59 | ), 60 | ), 61 | ), 62 | ); 63 | } 64 | 65 | List _getBarChartGroups(List records) { 66 | var groups = groupBy( 67 | records, 68 | (e) { 69 | return e.score; 70 | }, 71 | ); 72 | 73 | var list = List.generate( 74 | 5, 75 | (index) { 76 | return BarChartGroupData( 77 | x: index + 1, 78 | barRods: [ 79 | BarChartRodData( 80 | toY: groups[index + 1] != null ? groups[index + 1]!.length.toDouble() : 0.0, 81 | color: _getColorByMoodScore(index + 1), 82 | width: 20) 83 | ], 84 | ); 85 | }, 86 | ); 87 | return list; 88 | } 89 | 90 | Color? _getColorByMoodScore(int score) { 91 | Color? color; 92 | switch (score) { 93 | case 1: 94 | color = Colors.red; 95 | break; 96 | case 2: 97 | color = Colors.orange; 98 | break; 99 | case 3: 100 | color = Colors.blue; 101 | break; 102 | case 4: 103 | color = Colors.cyan; 104 | break; 105 | case 5: 106 | color = Colors.green; 107 | break; 108 | default: 109 | color = null; 110 | } 111 | return color; 112 | } 113 | 114 | Widget titleWidgets(double score, TitleMeta meta) { 115 | String icon; 116 | Color color; 117 | switch (score.toInt()) { 118 | case 1: 119 | icon = Assets.moodIcons.crying; 120 | color = Colors.red; 121 | break; 122 | case 2: 123 | icon = Assets.moodIcons.confused; 124 | color = Colors.orange; 125 | break; 126 | case 3: 127 | icon = Assets.moodIcons.neutral; 128 | color = Colors.blue; 129 | break; 130 | case 4: 131 | icon = Assets.moodIcons.smile; 132 | color = Colors.cyan; 133 | break; 134 | case 5: 135 | icon = Assets.moodIcons.happy; 136 | color = Colors.green; 137 | break; 138 | default: 139 | throw StateError('Invalid'); 140 | } 141 | return Container( 142 | margin: const EdgeInsets.only(top: 8), 143 | child: SvgPicture.asset( 144 | icon, 145 | color: color, 146 | height: 32, 147 | width: 32, 148 | ), 149 | ); 150 | } 151 | } 152 | --------------------------------------------------------------------------------