├── .firebaserc ├── .fvmrc ├── .gitignore ├── .idea ├── libraries │ ├── Dart_SDK.xml │ └── KotlinJavaRuntime.xml ├── modules.xml ├── runConfigurations │ └── main_dart.xml └── workspace.xml ├── .metadata ├── .vscode └── launch.json ├── README.md ├── analysis_options.yaml ├── android ├── .gitignore ├── app │ ├── build.gradle │ ├── google-services.json │ └── src │ │ ├── debug │ │ └── AndroidManifest.xml │ │ ├── main │ │ ├── AndroidManifest.xml │ │ ├── kotlin │ │ │ ├── com │ │ │ │ └── gem │ │ │ │ │ └── diary_flutter │ │ │ │ │ └── MainActivity.kt │ │ │ └── gem │ │ │ │ └── musediary │ │ │ │ └── app │ │ │ │ └── MainActivity.kt │ │ └── res │ │ │ ├── drawable-hdpi │ │ │ ├── android12splash.png │ │ │ └── ic_launcher_foreground.png │ │ │ ├── drawable-mdpi │ │ │ ├── android12splash.png │ │ │ └── ic_launcher_foreground.png │ │ │ ├── drawable-night-hdpi │ │ │ └── android12splash.png │ │ │ ├── drawable-night-mdpi │ │ │ └── android12splash.png │ │ │ ├── drawable-night-v21 │ │ │ ├── background.png │ │ │ └── launch_background.xml │ │ │ ├── drawable-night-xhdpi │ │ │ └── android12splash.png │ │ │ ├── drawable-night-xxhdpi │ │ │ └── android12splash.png │ │ │ ├── drawable-night-xxxhdpi │ │ │ └── android12splash.png │ │ │ ├── drawable-night │ │ │ ├── background.png │ │ │ └── launch_background.xml │ │ │ ├── drawable-v21 │ │ │ ├── background.png │ │ │ └── launch_background.xml │ │ │ ├── drawable-xhdpi │ │ │ ├── android12splash.png │ │ │ └── ic_launcher_foreground.png │ │ │ ├── drawable-xxhdpi │ │ │ ├── android12splash.png │ │ │ └── ic_launcher_foreground.png │ │ │ ├── drawable-xxxhdpi │ │ │ ├── android12splash.png │ │ │ └── ic_launcher_foreground.png │ │ │ ├── drawable │ │ │ ├── background.png │ │ │ └── launch_background.xml │ │ │ ├── mipmap-anydpi-v26 │ │ │ └── launcher_icon.xml │ │ │ ├── mipmap-hdpi │ │ │ ├── ic_launcher.png │ │ │ └── launcher_icon.png │ │ │ ├── mipmap-mdpi │ │ │ ├── ic_launcher.png │ │ │ └── launcher_icon.png │ │ │ ├── mipmap-xhdpi │ │ │ ├── ic_launcher.png │ │ │ └── launcher_icon.png │ │ │ ├── mipmap-xxhdpi │ │ │ ├── ic_launcher.png │ │ │ └── launcher_icon.png │ │ │ ├── mipmap-xxxhdpi │ │ │ ├── ic_launcher.png │ │ │ └── launcher_icon.png │ │ │ ├── values-night-v31 │ │ │ └── styles.xml │ │ │ ├── values-night │ │ │ └── styles.xml │ │ │ ├── values-v31 │ │ │ └── styles.xml │ │ │ └── values │ │ │ ├── colors.xml │ │ │ └── styles.xml │ │ └── profile │ │ └── AndroidManifest.xml ├── build.gradle ├── diary_flutter_android.iml ├── gradle.properties ├── gradle │ └── wrapper │ │ └── gradle-wrapper.properties └── settings.gradle ├── assets ├── .DS_Store ├── fonts │ ├── Adamina-Regular.ttf │ ├── texgyreheros-bold.otf │ ├── texgyreheros-bolditalic.otf │ ├── texgyreheros-italic.otf │ ├── texgyreheros-regular.otf │ ├── texgyreheroscn-bold.otf │ ├── texgyreheroscn-bolditalic.otf │ ├── texgyreheroscn-italic.otf │ └── texgyreheroscn-regular.otf ├── icons │ ├── blankicon.png │ └── icon_1024.png ├── images │ ├── back_button.png │ ├── checked.png │ ├── icon_action_right.png │ ├── icon_google.png │ ├── icon_my_info.png │ ├── icon_my_info_detail.png │ ├── icon_profile.png │ ├── left_arrow.png │ ├── lock.png │ ├── music.png │ ├── newjeans.png │ └── unchecked.png └── lotties │ └── typing_indicator.json ├── diary_flutter.iml ├── firebase.json ├── firepit-log.txt ├── flutter_gen.yaml ├── flutter_launcher_icons.yaml ├── flutter_native_splash.yaml ├── ios ├── .DS_Store ├── .gitignore ├── Flutter │ ├── AppFrameworkInfo.plist │ ├── Debug.xcconfig │ └── Release.xcconfig ├── Podfile ├── Podfile.lock ├── Runner.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ ├── IDEWorkspaceChecks.plist │ │ │ └── WorkspaceSettings.xcsettings │ └── xcshareddata │ │ └── xcschemes │ │ └── Runner.xcscheme ├── Runner.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ ├── IDEWorkspaceChecks.plist │ │ └── WorkspaceSettings.xcsettings ├── Runner │ ├── AppDelegate.swift │ ├── Assets.xcassets │ │ ├── AppIcon.appiconset │ │ │ ├── Contents.json │ │ │ ├── Icon-App-1024x1024@1x.png │ │ │ ├── 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-50x50@1x.png │ │ │ ├── Icon-App-50x50@2x.png │ │ │ ├── Icon-App-57x57@1x.png │ │ │ ├── Icon-App-57x57@2x.png │ │ │ ├── Icon-App-60x60@2x.png │ │ │ ├── Icon-App-60x60@3x.png │ │ │ ├── Icon-App-72x72@1x.png │ │ │ ├── Icon-App-72x72@2x.png │ │ │ ├── Icon-App-76x76@1x.png │ │ │ ├── Icon-App-76x76@2x.png │ │ │ └── Icon-App-83.5x83.5@2x.png │ │ ├── LaunchBackground.imageset │ │ │ ├── Contents.json │ │ │ ├── background.png │ │ │ └── darkbackground.png │ │ └── LaunchImage.imageset │ │ │ ├── Contents.json │ │ │ ├── LaunchImage.png │ │ │ ├── LaunchImage@2x.png │ │ │ ├── LaunchImage@3x.png │ │ │ └── README.md │ ├── Base.lproj │ │ ├── LaunchScreen.storyboard │ │ └── Main.storyboard │ ├── GoogleService-Info.plist │ ├── Info.plist │ └── Runner-Bridging-Header.h └── RunnerTests │ └── RunnerTests.swift ├── lib ├── .DS_Store ├── app.dart ├── common │ ├── enums.dart │ ├── enums.g.dart │ └── extension │ │ └── date_time_extension.dart ├── data │ ├── http │ │ ├── youtube_search_response.dart │ │ └── youtube_search_response.g.dart │ ├── model │ │ ├── chat.dart │ │ ├── chat.g.dart │ │ ├── chat_metadata.dart │ │ ├── chat_metadata.g.dart │ │ ├── diary.dart │ │ ├── diary.g.dart │ │ ├── diary │ │ │ ├── chats_output.dart │ │ │ ├── chats_output.g.dart │ │ │ ├── chats_result.dart │ │ │ ├── chats_result.g.dart │ │ │ ├── evaluated_prompt_content.dart │ │ │ ├── evaluated_prompt_content.g.dart │ │ │ ├── generated_feedback_content.dart │ │ │ └── generated_feedback_content.g.dart │ │ ├── feedback_evaluate_result.dart │ │ ├── feedback_evaluate_result.g.dart │ │ ├── history.dart │ │ ├── history.g.dart │ │ ├── journal.dart │ │ ├── journal.g.dart │ │ ├── music.dart │ │ ├── music.g.dart │ │ ├── song.dart │ │ ├── song.g.dart │ │ ├── user.dart │ │ ├── user_put_agreement_body.dart │ │ ├── user_put_agreement_body.g.dart │ │ ├── user_put_agreement_response.dart │ │ ├── user_put_agreement_response.g.dart │ │ ├── user_response.dart │ │ └── user_response.g.dart │ ├── provider │ │ ├── chats_repository_provider.dart │ │ ├── chats_repository_provider.g.dart │ │ ├── diary_repository_provider.dart │ │ ├── diary_repository_provider.g.dart │ │ ├── dio_provider.dart │ │ ├── dio_provider.g.dart │ │ ├── gemini_repository_provider.dart │ │ ├── gemini_repository_provider.g.dart │ │ ├── google_auth_repository_provider.dart │ │ ├── google_auth_repository_provider.g.dart │ │ ├── persistance_storage_provider.dart │ │ ├── persistance_storage_provider.g.dart │ │ ├── users_repository_provider.dart │ │ └── users_repository_provider.g.dart │ ├── repository │ │ ├── chats_repository.dart │ │ ├── chats_repository.g.dart │ │ ├── diary_repository.dart │ │ ├── diary_repository.g.dart │ │ ├── gemeni_repository.dart │ │ ├── google_auth_repository.dart │ │ ├── llm_repository.dart │ │ ├── users_repository.dart │ │ └── users_repository.g.dart │ └── storage │ │ ├── persistance_storage.dart │ │ └── shared_preference_persistance_storage.dart ├── domain │ └── provider │ │ ├── archived_diaries.dart │ │ ├── archived_diaries.g.dart │ │ ├── auth │ │ ├── auth.dart │ │ ├── auth.g.dart │ │ ├── get_my_id_token.dart │ │ ├── get_my_id_token.g.dart │ │ ├── get_my_name.dart │ │ └── get_my_name.g.dart │ │ ├── chats │ │ ├── chats_feedback_notifier.dart │ │ ├── chats_feedback_notifier.g.dart │ │ ├── chats_prompt_notifier.dart │ │ ├── chats_prompt_notifier.g.dart │ │ ├── count_chats.dart │ │ ├── count_chats.g.dart │ │ ├── get_chat.dart │ │ ├── get_chat.g.dart │ │ ├── stored_chats.dart │ │ ├── stored_chats.g.dart │ │ ├── stored_feedback_target_chats.dart │ │ └── stored_feedback_target_chats.g.dart │ │ ├── common │ │ ├── focused_date.dart │ │ └── focused_date.g.dart │ │ ├── diary │ │ ├── diary_use_cases.dart │ │ └── diary_use_cases.g.dart │ │ ├── evaluate_feedback.dart │ │ ├── evaluate_feedback.g.dart │ │ ├── generate_feedback.dart │ │ ├── generate_feedback.g.dart │ │ ├── journal │ │ ├── journal_use_cases.dart │ │ ├── journal_use_cases.g.dart │ │ ├── my_journal_store.dart │ │ ├── my_journal_store.g.dart │ │ ├── stored_journal.dart │ │ └── stored_journal.g.dart │ │ ├── onboarding │ │ ├── agreement_notifier.dart │ │ ├── agreement_notifier.g.dart │ │ ├── onbording_notifier.dart │ │ └── onbording_notifier.g.dart │ │ ├── temporary_diary.dart │ │ ├── temporary_diary.g.dart │ │ ├── temporary_mood.dart │ │ ├── temporary_mood.g.dart │ │ └── user │ │ ├── agreed_user.dart │ │ ├── agreed_user.g.dart │ │ ├── user_me_notifier.dart │ │ └── user_me_notifier.g.dart ├── env │ └── env.dart ├── firebase_options.dart ├── gen │ ├── assets.gen.dart │ ├── fonts.gen.dart │ └── gen_assets.dart ├── main.dart ├── material_theme_data.dart └── presentation │ ├── calendar │ ├── calendar_change_notifier.dart │ ├── calendar_day.dart │ ├── calendar_days.dart │ ├── calendar_diary.dart │ ├── calendar_diary_navigation_bar.dart │ ├── calendar_header.dart │ ├── calendar_inherited_notifier.dart │ ├── calendar_journal_card.dart │ ├── calendar_journal_music_chip.dart │ ├── calendar_music_day.dart │ ├── calendar_screen.dart │ ├── calendar_scroll_view.dart │ ├── calendar_weekend.dart │ ├── music_calendar.dart │ └── weekday_row_builder.dart │ ├── common │ ├── bottom_fulfilled_button.dart │ ├── custom_transitions.dart │ ├── hero_list_back_button.dart │ ├── home_under_construction_tab.dart │ ├── hook │ │ ├── use_sync_animation_value.dart │ │ ├── use_sync_scorll_value.dart │ │ └── use_top_of_stack_callback.dart │ ├── horizontal_swipe_detector.dart │ ├── input_field.dart │ ├── popup │ │ ├── confirm_popup.dart │ │ └── popup_button_param.dart │ ├── provider │ │ ├── primitive_notifiers.dart │ │ └── primitive_notifiers.g.dart │ ├── router.dart │ ├── router.g.dart │ └── text_theme_getter_mixin.dart │ ├── diary │ ├── archived_diary_item.dart │ ├── archived_diary_item_content.dart │ ├── archived_diary_item_header.dart │ ├── archived_diary_item_playlist.dart │ └── home_diary_tab.dart │ ├── journal │ ├── assistant_chat_item.dart │ ├── confirm_dialog.dart │ ├── date_header_display.dart │ ├── hook │ │ └── use_feedback_type.dart │ ├── icon_text_button.dart │ ├── journal_appbar.dart │ ├── journal_chat_body.dart │ ├── journal_chat_list.dart │ ├── journal_completion_screen.dart │ ├── journal_feedback_widget.dart │ ├── journal_music_card.dart │ ├── journal_post_body.dart │ ├── journal_screen.dart │ ├── journal_text_field.dart │ ├── provider │ │ ├── feedback_active.dart │ │ ├── feedback_active.g.dart │ │ ├── journal_service.dart │ │ ├── journal_service.g.dart │ │ ├── post_text_input.dart │ │ └── post_text_input.g.dart │ └── user_chat_item.dart │ ├── main │ ├── home_generative_text_seperator.dart │ ├── home_main_generative_text.dart │ ├── home_main_loading.dart │ ├── main_appbar.dart │ ├── main_bottom_sliver.dart │ ├── main_carousel_sliver.dart │ ├── main_header_button.dart │ ├── main_header_sliver.dart │ ├── main_horizontal_carousel.dart │ └── main_screen.dart │ ├── my_info │ ├── my_info_option.dart │ ├── my_info_option_detail.dart │ ├── my_info_option_title.dart │ ├── my_info_screen.dart │ └── my_info_screen_header.dart │ ├── onbording │ ├── bottom_sheet │ │ ├── agreement_check_box.dart │ │ └── agreement_modal_bottom_sheet.dart │ ├── google_login_button.dart │ ├── onboarding_animated_text.dart │ ├── onboarding_contents.dart │ ├── onbording_dot_indicator.dart │ ├── onbording_screen.dart │ └── onbording_title.dart │ ├── settings │ ├── setting_app_bar.dart │ ├── setting_gender.dart │ ├── setting_gender_item.dart │ ├── setting_name_text_field.dart │ └── setting_screen.dart │ ├── splash_screen.dart │ ├── style │ ├── enums.dart │ ├── gem_colors.dart │ ├── gem_text_style.dart │ ├── gem_theme.dart │ ├── gem_theme_extension.dart │ ├── gem_theme_inherited.dart │ ├── gem_theme_notifier_provider.dart │ ├── gem_theme_notifier_provider.g.dart │ └── index.dart │ ├── utils │ └── hooks │ │ ├── use_init_max_scroll_extent.dart │ │ ├── use_is_text_editing_controller_empty.dart │ │ └── use_scroll_animate_to_bottom.dart │ ├── welcome │ └── welcome_screen.dart │ └── write │ ├── diary_editor.dart │ ├── home_write_tab.dart │ ├── mood_items.dart │ └── music_items.dart ├── linux ├── .gitignore ├── CMakeLists.txt ├── flutter │ ├── CMakeLists.txt │ ├── generated_plugin_registrant.cc │ ├── generated_plugin_registrant.h │ └── generated_plugins.cmake ├── main.cc ├── my_application.cc └── my_application.h ├── macos ├── .gitignore ├── Flutter │ ├── Flutter-Debug.xcconfig │ ├── Flutter-Release.xcconfig │ └── GeneratedPluginRegistrant.swift ├── Podfile ├── Runner.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ └── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ └── xcshareddata │ │ └── xcschemes │ │ └── Runner.xcscheme ├── Runner.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist ├── Runner │ ├── AppDelegate.swift │ ├── Assets.xcassets │ │ └── AppIcon.appiconset │ │ │ ├── Contents.json │ │ │ ├── app_icon_1024.png │ │ │ ├── app_icon_128.png │ │ │ ├── app_icon_16.png │ │ │ ├── app_icon_256.png │ │ │ ├── app_icon_32.png │ │ │ ├── app_icon_512.png │ │ │ └── app_icon_64.png │ ├── Base.lproj │ │ └── MainMenu.xib │ ├── Configs │ │ ├── AppInfo.xcconfig │ │ ├── Debug.xcconfig │ │ ├── Release.xcconfig │ │ └── Warnings.xcconfig │ ├── DebugProfile.entitlements │ ├── Info.plist │ ├── MainFlutterWindow.swift │ └── Release.entitlements └── RunnerTests │ └── RunnerTests.swift ├── package_rename_config.yaml ├── pubspec.yaml ├── test └── widget_test.dart ├── web ├── favicon.png ├── icons │ ├── Icon-192.png │ ├── Icon-512.png │ ├── Icon-maskable-192.png │ └── Icon-maskable-512.png ├── index.html └── manifest.json └── windows ├── .gitignore ├── CMakeLists.txt ├── flutter ├── CMakeLists.txt ├── generated_plugin_registrant.cc ├── generated_plugin_registrant.h └── generated_plugins.cmake └── runner ├── CMakeLists.txt ├── Runner.rc ├── flutter_window.cpp ├── flutter_window.h ├── main.cpp ├── resource.h ├── resources └── app_icon.ico ├── runner.exe.manifest ├── utils.cpp ├── utils.h ├── win32_window.cpp └── win32_window.h /.firebaserc: -------------------------------------------------------------------------------- 1 | { 2 | "projects": { 3 | "default": "gems-gemini-api-competition" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /.fvmrc: -------------------------------------------------------------------------------- 1 | { 2 | "flutter": "3.22.2" 3 | } -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See https://www.dartlang.org/guides/libraries/private-files 2 | 3 | # Files and directories created by pub 4 | .dart_tool/ 5 | .packages 6 | build/ 7 | # If you're building an application, you may want to check-in your pubspec.lock 8 | pubspec.lock 9 | 10 | # Directory created by dartdoc 11 | # If you don't generate documentation locally you can remove this line. 12 | doc/api/ 13 | 14 | # dotenv environment variables file 15 | .env* 16 | 17 | # Avoid committing generated Javascript files: 18 | *.dart.js 19 | *.info.json # Produced by the --dump-info flag. 20 | *.js # When generated by dart2js. Don't specify *.js if your 21 | # project includes source files written in JavaScript. 22 | *.js_ 23 | *.js.deps 24 | *.js.map 25 | 26 | .flutter-plugins 27 | .flutter-plugins-dependencies 28 | 29 | # FVM Version Cache 30 | .fvm/ -------------------------------------------------------------------------------- /.idea/libraries/Dart_SDK.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /.idea/libraries/KotlinJavaRuntime.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /.idea/runConfigurations/main_dart.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // IntelliSense를 사용하여 가능한 특성에 대해 알아보세요. 3 | // 기존 특성에 대한 설명을 보려면 가리킵니다. 4 | // 자세한 내용을 보려면 https://go.microsoft.com/fwlink/?linkid=830387을(를) 방문하세요. 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "name": "diary_flutter", 9 | "request": "launch", 10 | "type": "dart" 11 | }, 12 | { 13 | "name": "diary_flutter (profile mode)", 14 | "request": "launch", 15 | "type": "dart", 16 | "flutterMode": "profile" 17 | }, 18 | { 19 | "name": "diary_flutter (release mode)", 20 | "request": "launch", 21 | "type": "dart", 22 | "flutterMode": "release" 23 | } 24 | ] 25 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # diary_flutter 2 | flutter project for google gemini competition by GemStar 3 | 4 | ## Getting Started 5 | 1. Copy the .env file with the GEMENI_API_KEY to the root of your project 6 | 2. Run 7 | ```bash 8 | fvm install 3.22.2 9 | fvm use 3.22.2 10 | fvm flutter pub get 11 | fvm dart run build_runner build 12 | fluttergen -c flutter_gen.yaml 13 | ``` 14 | 3. Deploy(YouTube thumbnail CORS issue forces HTML rendering) 15 | ```bash 16 | fvm flutter build web --web-renderer html 17 | firebase deploy 18 | ``` 19 | -------------------------------------------------------------------------------- /android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /android/app/src/main/kotlin/com/gem/diary_flutter/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.gem.diary_flutter 2 | 3 | import io.flutter.embedding.android.FlutterActivity 4 | 5 | class MainActivity: FlutterActivity() 6 | -------------------------------------------------------------------------------- /android/app/src/main/kotlin/gem/musediary/app/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package gem.musediary.app 2 | 3 | import io.flutter.embedding.android.FlutterActivity 4 | 5 | class MainActivity: FlutterActivity() 6 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-hdpi/android12splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geminiApiDevKorea/diary_flutter/0efc31f81fa2a49e9599b6e6bcb7df6c3b64e334/android/app/src/main/res/drawable-hdpi/android12splash.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-hdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geminiApiDevKorea/diary_flutter/0efc31f81fa2a49e9599b6e6bcb7df6c3b64e334/android/app/src/main/res/drawable-hdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-mdpi/android12splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geminiApiDevKorea/diary_flutter/0efc31f81fa2a49e9599b6e6bcb7df6c3b64e334/android/app/src/main/res/drawable-mdpi/android12splash.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-mdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geminiApiDevKorea/diary_flutter/0efc31f81fa2a49e9599b6e6bcb7df6c3b64e334/android/app/src/main/res/drawable-mdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-night-hdpi/android12splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geminiApiDevKorea/diary_flutter/0efc31f81fa2a49e9599b6e6bcb7df6c3b64e334/android/app/src/main/res/drawable-night-hdpi/android12splash.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-night-mdpi/android12splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geminiApiDevKorea/diary_flutter/0efc31f81fa2a49e9599b6e6bcb7df6c3b64e334/android/app/src/main/res/drawable-night-mdpi/android12splash.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-night-v21/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geminiApiDevKorea/diary_flutter/0efc31f81fa2a49e9599b6e6bcb7df6c3b64e334/android/app/src/main/res/drawable-night-v21/background.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-night-v21/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-night-xhdpi/android12splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geminiApiDevKorea/diary_flutter/0efc31f81fa2a49e9599b6e6bcb7df6c3b64e334/android/app/src/main/res/drawable-night-xhdpi/android12splash.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-night-xxhdpi/android12splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geminiApiDevKorea/diary_flutter/0efc31f81fa2a49e9599b6e6bcb7df6c3b64e334/android/app/src/main/res/drawable-night-xxhdpi/android12splash.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-night-xxxhdpi/android12splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geminiApiDevKorea/diary_flutter/0efc31f81fa2a49e9599b6e6bcb7df6c3b64e334/android/app/src/main/res/drawable-night-xxxhdpi/android12splash.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-night/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geminiApiDevKorea/diary_flutter/0efc31f81fa2a49e9599b6e6bcb7df6c3b64e334/android/app/src/main/res/drawable-night/background.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-night/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-v21/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geminiApiDevKorea/diary_flutter/0efc31f81fa2a49e9599b6e6bcb7df6c3b64e334/android/app/src/main/res/drawable-v21/background.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-v21/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-xhdpi/android12splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geminiApiDevKorea/diary_flutter/0efc31f81fa2a49e9599b6e6bcb7df6c3b64e334/android/app/src/main/res/drawable-xhdpi/android12splash.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-xhdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geminiApiDevKorea/diary_flutter/0efc31f81fa2a49e9599b6e6bcb7df6c3b64e334/android/app/src/main/res/drawable-xhdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-xxhdpi/android12splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geminiApiDevKorea/diary_flutter/0efc31f81fa2a49e9599b6e6bcb7df6c3b64e334/android/app/src/main/res/drawable-xxhdpi/android12splash.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-xxhdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geminiApiDevKorea/diary_flutter/0efc31f81fa2a49e9599b6e6bcb7df6c3b64e334/android/app/src/main/res/drawable-xxhdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-xxxhdpi/android12splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geminiApiDevKorea/diary_flutter/0efc31f81fa2a49e9599b6e6bcb7df6c3b64e334/android/app/src/main/res/drawable-xxxhdpi/android12splash.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-xxxhdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geminiApiDevKorea/diary_flutter/0efc31f81fa2a49e9599b6e6bcb7df6c3b64e334/android/app/src/main/res/drawable-xxxhdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geminiApiDevKorea/diary_flutter/0efc31f81fa2a49e9599b6e6bcb7df6c3b64e334/android/app/src/main/res/drawable/background.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-anydpi-v26/launcher_icon.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geminiApiDevKorea/diary_flutter/0efc31f81fa2a49e9599b6e6bcb7df6c3b64e334/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/launcher_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geminiApiDevKorea/diary_flutter/0efc31f81fa2a49e9599b6e6bcb7df6c3b64e334/android/app/src/main/res/mipmap-hdpi/launcher_icon.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geminiApiDevKorea/diary_flutter/0efc31f81fa2a49e9599b6e6bcb7df6c3b64e334/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/launcher_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geminiApiDevKorea/diary_flutter/0efc31f81fa2a49e9599b6e6bcb7df6c3b64e334/android/app/src/main/res/mipmap-mdpi/launcher_icon.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geminiApiDevKorea/diary_flutter/0efc31f81fa2a49e9599b6e6bcb7df6c3b64e334/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/launcher_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geminiApiDevKorea/diary_flutter/0efc31f81fa2a49e9599b6e6bcb7df6c3b64e334/android/app/src/main/res/mipmap-xhdpi/launcher_icon.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geminiApiDevKorea/diary_flutter/0efc31f81fa2a49e9599b6e6bcb7df6c3b64e334/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/launcher_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geminiApiDevKorea/diary_flutter/0efc31f81fa2a49e9599b6e6bcb7df6c3b64e334/android/app/src/main/res/mipmap-xxhdpi/launcher_icon.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geminiApiDevKorea/diary_flutter/0efc31f81fa2a49e9599b6e6bcb7df6c3b64e334/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/launcher_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geminiApiDevKorea/diary_flutter/0efc31f81fa2a49e9599b6e6bcb7df6c3b64e334/android/app/src/main/res/mipmap-xxxhdpi/launcher_icon.png -------------------------------------------------------------------------------- /android/app/src/main/res/values-night-v31/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 13 | 19 | 22 | 23 | -------------------------------------------------------------------------------- /android/app/src/main/res/values-night/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 13 | 19 | 22 | 23 | -------------------------------------------------------------------------------- /android/app/src/main/res/values-v31/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 13 | 19 | 22 | 23 | -------------------------------------------------------------------------------- /android/app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #000000 4 | -------------------------------------------------------------------------------- /android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 13 | 19 | 22 | 23 | -------------------------------------------------------------------------------- /android/app/src/profile/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | allprojects { 2 | repositories { 3 | google() 4 | mavenCentral() 5 | } 6 | } 7 | 8 | rootProject.buildDir = "../build" 9 | subprojects { 10 | project.buildDir = "${rootProject.buildDir}/${project.name}" 11 | } 12 | subprojects { 13 | project.evaluationDependsOn(":app") 14 | } 15 | 16 | tasks.register("clean", Delete) { 17 | delete rootProject.buildDir 18 | } 19 | -------------------------------------------------------------------------------- /android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx4G -XX:+HeapDumpOnOutOfMemoryError 2 | android.useAndroidX=true 3 | android.enableJetifier=true 4 | -------------------------------------------------------------------------------- /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.6.3-all.zip 6 | -------------------------------------------------------------------------------- /android/settings.gradle: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | def flutterSdkPath = { 3 | def properties = new Properties() 4 | file("local.properties").withInputStream { properties.load(it) } 5 | def flutterSdkPath = properties.getProperty("flutter.sdk") 6 | assert flutterSdkPath != null, "flutter.sdk not set in local.properties" 7 | return flutterSdkPath 8 | }() 9 | 10 | includeBuild("$flutterSdkPath/packages/flutter_tools/gradle") 11 | 12 | repositories { 13 | google() 14 | mavenCentral() 15 | gradlePluginPortal() 16 | } 17 | } 18 | 19 | plugins { 20 | id "dev.flutter.flutter-plugin-loader" version "1.0.0" 21 | id "com.android.application" version "7.3.0" apply false 22 | // START: FlutterFire Configuration 23 | id "com.google.gms.google-services" version "4.3.15" apply false 24 | // END: FlutterFire Configuration 25 | id "org.jetbrains.kotlin.android" version "1.7.10" apply false 26 | } 27 | 28 | include ":app" 29 | -------------------------------------------------------------------------------- /assets/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geminiApiDevKorea/diary_flutter/0efc31f81fa2a49e9599b6e6bcb7df6c3b64e334/assets/.DS_Store -------------------------------------------------------------------------------- /assets/fonts/Adamina-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geminiApiDevKorea/diary_flutter/0efc31f81fa2a49e9599b6e6bcb7df6c3b64e334/assets/fonts/Adamina-Regular.ttf -------------------------------------------------------------------------------- /assets/fonts/texgyreheros-bold.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geminiApiDevKorea/diary_flutter/0efc31f81fa2a49e9599b6e6bcb7df6c3b64e334/assets/fonts/texgyreheros-bold.otf -------------------------------------------------------------------------------- /assets/fonts/texgyreheros-bolditalic.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geminiApiDevKorea/diary_flutter/0efc31f81fa2a49e9599b6e6bcb7df6c3b64e334/assets/fonts/texgyreheros-bolditalic.otf -------------------------------------------------------------------------------- /assets/fonts/texgyreheros-italic.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geminiApiDevKorea/diary_flutter/0efc31f81fa2a49e9599b6e6bcb7df6c3b64e334/assets/fonts/texgyreheros-italic.otf -------------------------------------------------------------------------------- /assets/fonts/texgyreheros-regular.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geminiApiDevKorea/diary_flutter/0efc31f81fa2a49e9599b6e6bcb7df6c3b64e334/assets/fonts/texgyreheros-regular.otf -------------------------------------------------------------------------------- /assets/fonts/texgyreheroscn-bold.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geminiApiDevKorea/diary_flutter/0efc31f81fa2a49e9599b6e6bcb7df6c3b64e334/assets/fonts/texgyreheroscn-bold.otf -------------------------------------------------------------------------------- /assets/fonts/texgyreheroscn-bolditalic.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geminiApiDevKorea/diary_flutter/0efc31f81fa2a49e9599b6e6bcb7df6c3b64e334/assets/fonts/texgyreheroscn-bolditalic.otf -------------------------------------------------------------------------------- /assets/fonts/texgyreheroscn-italic.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geminiApiDevKorea/diary_flutter/0efc31f81fa2a49e9599b6e6bcb7df6c3b64e334/assets/fonts/texgyreheroscn-italic.otf -------------------------------------------------------------------------------- /assets/fonts/texgyreheroscn-regular.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geminiApiDevKorea/diary_flutter/0efc31f81fa2a49e9599b6e6bcb7df6c3b64e334/assets/fonts/texgyreheroscn-regular.otf -------------------------------------------------------------------------------- /assets/icons/blankicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geminiApiDevKorea/diary_flutter/0efc31f81fa2a49e9599b6e6bcb7df6c3b64e334/assets/icons/blankicon.png -------------------------------------------------------------------------------- /assets/icons/icon_1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geminiApiDevKorea/diary_flutter/0efc31f81fa2a49e9599b6e6bcb7df6c3b64e334/assets/icons/icon_1024.png -------------------------------------------------------------------------------- /assets/images/back_button.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geminiApiDevKorea/diary_flutter/0efc31f81fa2a49e9599b6e6bcb7df6c3b64e334/assets/images/back_button.png -------------------------------------------------------------------------------- /assets/images/checked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geminiApiDevKorea/diary_flutter/0efc31f81fa2a49e9599b6e6bcb7df6c3b64e334/assets/images/checked.png -------------------------------------------------------------------------------- /assets/images/icon_action_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geminiApiDevKorea/diary_flutter/0efc31f81fa2a49e9599b6e6bcb7df6c3b64e334/assets/images/icon_action_right.png -------------------------------------------------------------------------------- /assets/images/icon_google.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geminiApiDevKorea/diary_flutter/0efc31f81fa2a49e9599b6e6bcb7df6c3b64e334/assets/images/icon_google.png -------------------------------------------------------------------------------- /assets/images/icon_my_info.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geminiApiDevKorea/diary_flutter/0efc31f81fa2a49e9599b6e6bcb7df6c3b64e334/assets/images/icon_my_info.png -------------------------------------------------------------------------------- /assets/images/icon_my_info_detail.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geminiApiDevKorea/diary_flutter/0efc31f81fa2a49e9599b6e6bcb7df6c3b64e334/assets/images/icon_my_info_detail.png -------------------------------------------------------------------------------- /assets/images/icon_profile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geminiApiDevKorea/diary_flutter/0efc31f81fa2a49e9599b6e6bcb7df6c3b64e334/assets/images/icon_profile.png -------------------------------------------------------------------------------- /assets/images/left_arrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geminiApiDevKorea/diary_flutter/0efc31f81fa2a49e9599b6e6bcb7df6c3b64e334/assets/images/left_arrow.png -------------------------------------------------------------------------------- /assets/images/lock.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geminiApiDevKorea/diary_flutter/0efc31f81fa2a49e9599b6e6bcb7df6c3b64e334/assets/images/lock.png -------------------------------------------------------------------------------- /assets/images/music.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geminiApiDevKorea/diary_flutter/0efc31f81fa2a49e9599b6e6bcb7df6c3b64e334/assets/images/music.png -------------------------------------------------------------------------------- /assets/images/newjeans.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geminiApiDevKorea/diary_flutter/0efc31f81fa2a49e9599b6e6bcb7df6c3b64e334/assets/images/newjeans.png -------------------------------------------------------------------------------- /assets/images/unchecked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geminiApiDevKorea/diary_flutter/0efc31f81fa2a49e9599b6e6bcb7df6c3b64e334/assets/images/unchecked.png -------------------------------------------------------------------------------- /diary_flutter.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /firebase.json: -------------------------------------------------------------------------------- 1 | {"flutter":{"platforms":{"android":{"default":{"projectId":"gems-gemini-api-competition","appId":"1:246956142166:android:99d2e681909afffd90d5f7","fileOutput":"android/app/google-services.json"}},"ios":{"default":{"projectId":"gems-gemini-api-competition","appId":"1:246956142166:ios:ae7009aa489d9a1b90d5f7","uploadDebugSymbols":false,"fileOutput":"ios/Runner/GoogleService-Info.plist"}},"dart":{"lib/firebase_options.dart":{"projectId":"gems-gemini-api-competition","configurations":{"android":"1:246956142166:android:99d2e681909afffd90d5f7","ios":"1:246956142166:ios:ae7009aa489d9a1b90d5f7","web":"1:246956142166:web:8393665eb9b23a4090d5f7"}}}}}} -------------------------------------------------------------------------------- /flutter_gen.yaml: -------------------------------------------------------------------------------- 1 | # https://pub.dev/packages/flutter_gen 2 | # fluttergen -c flutter_gen.yaml 3 | 4 | flutter_gen: 5 | output: lib/gen/ 6 | line_length: 80 7 | 8 | # Optional 9 | integrations: 10 | flutter_svg: true 11 | flare_flutter: true 12 | rive: true 13 | lottie: true 14 | 15 | # The following section is specific to Flutter packages. 16 | flutter: 17 | uses-material-design: true 18 | assets: 19 | - assets/fonts/ 20 | - assets/images/ 21 | - assets/lotties/ 22 | - assets/icons/ 23 | 24 | fonts: 25 | - family: Adamina 26 | fonts: 27 | - asset: assets/fonts/Adamina-Regular.ttf 28 | weight: 400 29 | - family: Texgyreheros 30 | fonts: 31 | - asset: assets/fonts/texgyreheros-regular.otf 32 | weight: 400 33 | - asset: assets/fonts/texgyreheros-bold.otf 34 | weight: 700 35 | - asset: assets/fonts/texgyreheros-italic.otf 36 | style: italic 37 | - asset: assets/fonts/texgyreheros-bolditalic.otf 38 | weight: 700 39 | style: italic 40 | - family: Texgyreheroscn 41 | fonts: 42 | - asset: assets/fonts/texgyreheroscn-regular.otf 43 | weight: 400 44 | - asset: assets/fonts/texgyreheroscn-bold.otf 45 | weight: 700 46 | - asset: assets/fonts/texgyreheroscn-italic.otf 47 | style: italic 48 | - asset: assets/fonts/texgyreheroscn-bolditalic.otf 49 | weight: 700 50 | style: italic 51 | -------------------------------------------------------------------------------- /flutter_launcher_icons.yaml: -------------------------------------------------------------------------------- 1 | # flutter pub run flutter_launcher_icons 2 | flutter_launcher_icons: 3 | android: 'launcher_icon' 4 | ios: true 5 | image_path: 'assets/icons/icon_1024.png' 6 | min_sdk_android: 21 7 | adaptive_icon_background: '#000000' # 또는 원하는 배경색 8 | adaptive_icon_foreground: 'assets/icons/icon_1024.png' # 메인 이미지와 동일한 파일 사용 9 | -------------------------------------------------------------------------------- /ios/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geminiApiDevKorea/diary_flutter/0efc31f81fa2a49e9599b6e6bcb7df6c3b64e334/ios/.DS_Store -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | 12.0 25 | 26 | 27 | -------------------------------------------------------------------------------- /ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /ios/Podfile: -------------------------------------------------------------------------------- 1 | # Uncomment this line to define a global platform for your project 2 | platform :ios, '13.0' 3 | 4 | # CocoaPods analytics sends network stats synchronously affecting flutter build latency. 5 | ENV['COCOAPODS_DISABLE_STATS'] = 'true' 6 | 7 | project 'Runner', { 8 | 'Debug' => :debug, 9 | 'Profile' => :release, 10 | 'Release' => :release, 11 | } 12 | 13 | def flutter_root 14 | generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) 15 | unless File.exist?(generated_xcode_build_settings_path) 16 | raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" 17 | end 18 | 19 | File.foreach(generated_xcode_build_settings_path) do |line| 20 | matches = line.match(/FLUTTER_ROOT\=(.*)/) 21 | return matches[1].strip if matches 22 | end 23 | raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" 24 | end 25 | 26 | require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) 27 | 28 | flutter_ios_podfile_setup 29 | 30 | target 'Runner' do 31 | use_frameworks! 32 | use_modular_headers! 33 | 34 | flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) 35 | target 'RunnerTests' do 36 | inherit! :search_paths 37 | end 38 | end 39 | 40 | post_install do |installer| 41 | installer.pods_project.targets.each do |target| 42 | flutter_additional_ios_build_settings(target) 43 | end 44 | end 45 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.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.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import Flutter 2 | import UIKit 3 | 4 | @main 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 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geminiApiDevKorea/diary_flutter/0efc31f81fa2a49e9599b6e6bcb7df6c3b64e334/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geminiApiDevKorea/diary_flutter/0efc31f81fa2a49e9599b6e6bcb7df6c3b64e334/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/geminiApiDevKorea/diary_flutter/0efc31f81fa2a49e9599b6e6bcb7df6c3b64e334/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/geminiApiDevKorea/diary_flutter/0efc31f81fa2a49e9599b6e6bcb7df6c3b64e334/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/geminiApiDevKorea/diary_flutter/0efc31f81fa2a49e9599b6e6bcb7df6c3b64e334/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/geminiApiDevKorea/diary_flutter/0efc31f81fa2a49e9599b6e6bcb7df6c3b64e334/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/geminiApiDevKorea/diary_flutter/0efc31f81fa2a49e9599b6e6bcb7df6c3b64e334/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/geminiApiDevKorea/diary_flutter/0efc31f81fa2a49e9599b6e6bcb7df6c3b64e334/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/geminiApiDevKorea/diary_flutter/0efc31f81fa2a49e9599b6e6bcb7df6c3b64e334/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/geminiApiDevKorea/diary_flutter/0efc31f81fa2a49e9599b6e6bcb7df6c3b64e334/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-50x50@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geminiApiDevKorea/diary_flutter/0efc31f81fa2a49e9599b6e6bcb7df6c3b64e334/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-50x50@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-50x50@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geminiApiDevKorea/diary_flutter/0efc31f81fa2a49e9599b6e6bcb7df6c3b64e334/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-50x50@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-57x57@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geminiApiDevKorea/diary_flutter/0efc31f81fa2a49e9599b6e6bcb7df6c3b64e334/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-57x57@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-57x57@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geminiApiDevKorea/diary_flutter/0efc31f81fa2a49e9599b6e6bcb7df6c3b64e334/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-57x57@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geminiApiDevKorea/diary_flutter/0efc31f81fa2a49e9599b6e6bcb7df6c3b64e334/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/geminiApiDevKorea/diary_flutter/0efc31f81fa2a49e9599b6e6bcb7df6c3b64e334/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-72x72@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geminiApiDevKorea/diary_flutter/0efc31f81fa2a49e9599b6e6bcb7df6c3b64e334/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-72x72@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-72x72@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geminiApiDevKorea/diary_flutter/0efc31f81fa2a49e9599b6e6bcb7df6c3b64e334/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-72x72@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geminiApiDevKorea/diary_flutter/0efc31f81fa2a49e9599b6e6bcb7df6c3b64e334/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/geminiApiDevKorea/diary_flutter/0efc31f81fa2a49e9599b6e6bcb7df6c3b64e334/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geminiApiDevKorea/diary_flutter/0efc31f81fa2a49e9599b6e6bcb7df6c3b64e334/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchBackground.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "background.png", 5 | "idiom" : "universal" 6 | }, 7 | { 8 | "appearances" : [ 9 | { 10 | "appearance" : "luminosity", 11 | "value" : "dark" 12 | } 13 | ], 14 | "filename" : "darkbackground.png", 15 | "idiom" : "universal" 16 | } 17 | ], 18 | "info" : { 19 | "author" : "xcode", 20 | "version" : 1 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchBackground.imageset/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geminiApiDevKorea/diary_flutter/0efc31f81fa2a49e9599b6e6bcb7df6c3b64e334/ios/Runner/Assets.xcassets/LaunchBackground.imageset/background.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchBackground.imageset/darkbackground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geminiApiDevKorea/diary_flutter/0efc31f81fa2a49e9599b6e6bcb7df6c3b64e334/ios/Runner/Assets.xcassets/LaunchBackground.imageset/darkbackground.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "LaunchImage.png", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "filename" : "LaunchImage@2x.png", 10 | "idiom" : "universal", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "filename" : "LaunchImage@3x.png", 15 | "idiom" : "universal", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "author" : "xcode", 21 | "version" : 1 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geminiApiDevKorea/diary_flutter/0efc31f81fa2a49e9599b6e6bcb7df6c3b64e334/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geminiApiDevKorea/diary_flutter/0efc31f81fa2a49e9599b6e6bcb7df6c3b64e334/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geminiApiDevKorea/diary_flutter/0efc31f81fa2a49e9599b6e6bcb7df6c3b64e334/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /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. -------------------------------------------------------------------------------- /ios/Runner/GoogleService-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CLIENT_ID 6 | 246956142166-8468cf2ii49up0id6dcovujvblbrbp2r.apps.googleusercontent.com 7 | REVERSED_CLIENT_ID 8 | com.googleusercontent.apps.246956142166-8468cf2ii49up0id6dcovujvblbrbp2r 9 | API_KEY 10 | AIzaSyDJ_cKF1OtBSQTfRBqSeS9e2kmjGftD2ts 11 | GCM_SENDER_ID 12 | 246956142166 13 | PLIST_VERSION 14 | 1 15 | BUNDLE_ID 16 | com.gem.diaryFlutter 17 | PROJECT_ID 18 | gems-gemini-api-competition 19 | STORAGE_BUCKET 20 | gems-gemini-api-competition.appspot.com 21 | IS_ADS_ENABLED 22 | 23 | IS_ANALYTICS_ENABLED 24 | 25 | IS_APPINVITE_ENABLED 26 | 27 | IS_GCM_ENABLED 28 | 29 | IS_SIGNIN_ENABLED 30 | 31 | GOOGLE_APP_ID 32 | 1:246956142166:ios:ae7009aa489d9a1b90d5f7 33 | 34 | -------------------------------------------------------------------------------- /ios/Runner/Runner-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import "GeneratedPluginRegistrant.h" 2 | -------------------------------------------------------------------------------- /ios/RunnerTests/RunnerTests.swift: -------------------------------------------------------------------------------- 1 | import Flutter 2 | import UIKit 3 | import XCTest 4 | 5 | class RunnerTests: XCTestCase { 6 | 7 | func testExample() { 8 | // If you add code to the Runner application, consider adding tests here. 9 | // See https://developer.apple.com/documentation/xctest for more information about using XCTest. 10 | } 11 | 12 | } 13 | -------------------------------------------------------------------------------- /lib/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geminiApiDevKorea/diary_flutter/0efc31f81fa2a49e9599b6e6bcb7df6c3b64e334/lib/.DS_Store -------------------------------------------------------------------------------- /lib/app.dart: -------------------------------------------------------------------------------- 1 | import 'package:diary_flutter/presentation/common/router.dart'; 2 | import 'package:diary_flutter/presentation/style/gem_theme_inherited.dart'; 3 | import 'package:diary_flutter/presentation/style/gem_theme_notifier_provider.dart'; 4 | import 'package:flutter/material.dart'; 5 | import 'package:diary_flutter/material_theme_data.dart'; 6 | import 'package:flutter_riverpod/flutter_riverpod.dart'; 7 | 8 | class App extends ConsumerWidget with MaterialThemeDataMixin { 9 | const App({super.key}); 10 | 11 | @override 12 | Widget build(BuildContext context, WidgetRef ref) { 13 | final gemTheme = ref.watch(gemThemeNotifierProvider); 14 | 15 | return GemThemeInherited( 16 | theme: gemTheme, 17 | child: MaterialApp.router( 18 | title: 'vinyl diary', 19 | debugShowCheckedModeBanner: false, 20 | theme: themeData, 21 | routerConfig: ref.watch(routerProvider), 22 | ), 23 | ); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /lib/common/enums.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'enums.dart'; 4 | 5 | // ************************************************************************** 6 | // JsonSerializableGenerator 7 | // ************************************************************************** 8 | 9 | const _$FeedbackTypeEnumMap = { 10 | FeedbackType.chat: 'chat', 11 | FeedbackType.post: 'post', 12 | }; 13 | 14 | const _$GenderEnumMap = { 15 | Gender.female: 'FEMALE', 16 | Gender.male: 'MALE', 17 | Gender.others: 'OTHERS', 18 | }; 19 | -------------------------------------------------------------------------------- /lib/common/extension/date_time_extension.dart: -------------------------------------------------------------------------------- 1 | import 'package:intl/intl.dart'; 2 | 3 | extension DateTimeExtension on DateTime { 4 | static const _months = [ 5 | 'January', 6 | 'February', 7 | 'March', 8 | 'April', 9 | 'May', 10 | 'June', 11 | 'July', 12 | 'August', 13 | 'September', 14 | 'October', 15 | 'November', 16 | 'December' 17 | ]; 18 | 19 | static String _getOrdinal(int day) { 20 | if (day >= 11 && day <= 13) { 21 | return '${day}th'; 22 | } 23 | switch (day % 10) { 24 | case 1: 25 | return '${day}st'; 26 | case 2: 27 | return '${day}nd'; 28 | case 3: 29 | return '${day}rd'; 30 | default: 31 | return '${day}th'; 32 | } 33 | } 34 | 35 | String get yyyyMM => '$year-${month.toString().padLeft(2, '0')}'; 36 | String get yyyyMMdd => 37 | '$year-${month.toString().padLeft(2, '0')}-${day.toString().padLeft(2, '0')}'; 38 | 39 | DateTime get firstDayOfMonth => DateTime(year, month, 1); 40 | DateTime get lastDayOfMonth => DateTime(year, month + 1, 0); 41 | 42 | bool isSameDay(DateTime other) { 43 | return year == other.year && month == other.month && day == other.day; 44 | } 45 | 46 | /// 예: "January 1st", "February 2nd", "March 3rd" 47 | String get monthDayOrdinal => '${_months[month - 1]} ${_getOrdinal(day)}'; 48 | 49 | /// 예: "01/1/23 14:30", "02/2/23 09:15" 50 | String get ddMyyHHmm => DateFormat('dd/M/yy HH:mm').format(this); 51 | 52 | /// 예: "July 11th, 2024" 53 | String get fullDateOrdinal => 54 | '${_months[month - 1]} ${_getOrdinal(day)}, $year'; 55 | } 56 | -------------------------------------------------------------------------------- /lib/data/model/chat.dart: -------------------------------------------------------------------------------- 1 | import 'package:diary_flutter/common/enums.dart'; 2 | import 'package:diary_flutter/data/model/chat_metadata.dart'; 3 | import 'package:json_annotation/json_annotation.dart'; 4 | 5 | part 'chat.g.dart'; 6 | 7 | @JsonSerializable() 8 | class Chat { 9 | final Role role; 10 | final String message; 11 | final DateTime createdAt; 12 | ChatMetadata? chatMetadata; 13 | 14 | bool get isUser => role == Role.user; 15 | 16 | bool get isAcceptable { 17 | var metaData = chatMetadata; 18 | if (metaData is AskFeedbackMetadata) { 19 | return metaData.didAccept == null; 20 | } else { 21 | return false; 22 | } 23 | } 24 | 25 | Chat({ 26 | required this.role, 27 | required this.message, 28 | required this.createdAt, 29 | this.chatMetadata, 30 | }); 31 | 32 | factory Chat.user(String message) => Chat( 33 | role: Role.user, 34 | message: message, 35 | createdAt: DateTime.now(), 36 | ); 37 | 38 | factory Chat.fromJson(Map json) => _$ChatFromJson(json); 39 | Map toJson() => _$ChatToJson(this); 40 | 41 | Chat copyWith({ 42 | Role? role, 43 | String? message, 44 | DateTime? createdAt, 45 | ChatMetadata? chatMetadata, 46 | }) { 47 | return Chat( 48 | role: role ?? this.role, 49 | message: message ?? this.message, 50 | createdAt: createdAt ?? this.createdAt, 51 | chatMetadata: chatMetadata ?? this.chatMetadata, 52 | ); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /lib/data/model/chat.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'chat.dart'; 4 | 5 | // ************************************************************************** 6 | // JsonSerializableGenerator 7 | // ************************************************************************** 8 | 9 | Chat _$ChatFromJson(Map json) => Chat( 10 | role: $enumDecode(_$RoleEnumMap, json['role']), 11 | message: json['message'] as String, 12 | createdAt: DateTime.parse(json['createdAt'] as String), 13 | chatMetadata: json['chatMetadata'] == null 14 | ? null 15 | : ChatMetadata.fromJson(json['chatMetadata'] as Map), 16 | ); 17 | 18 | Map _$ChatToJson(Chat instance) => { 19 | 'role': _$RoleEnumMap[instance.role]!, 20 | 'message': instance.message, 21 | 'createdAt': instance.createdAt.toIso8601String(), 22 | 'chatMetadata': instance.chatMetadata, 23 | }; 24 | 25 | const _$RoleEnumMap = { 26 | Role.assistant: 'assistant', 27 | Role.user: 'user', 28 | }; 29 | -------------------------------------------------------------------------------- /lib/data/model/chat_metadata.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'chat_metadata.dart'; 4 | 5 | // ************************************************************************** 6 | // JsonSerializableGenerator 7 | // ************************************************************************** 8 | 9 | AskFeedbackMetadata _$AskFeedbackMetadataFromJson(Map json) => 10 | AskFeedbackMetadata( 11 | json['didAccept'] as bool?, 12 | json['askFeedbackMessage'] as String, 13 | ); 14 | 15 | Map _$AskFeedbackMetadataToJson( 16 | AskFeedbackMetadata instance) => 17 | { 18 | 'didAccept': instance.didAccept, 19 | 'askFeedbackMessage': instance.askFeedbackMessage, 20 | }; 21 | 22 | ErrorMessageMetadata _$ErrorMessageMetadataFromJson( 23 | Map json) => 24 | ErrorMessageMetadata( 25 | json['errorMessage'] as String, 26 | ); 27 | 28 | Map _$ErrorMessageMetadataToJson( 29 | ErrorMessageMetadata instance) => 30 | { 31 | 'errorMessage': instance.errorMessage, 32 | }; 33 | -------------------------------------------------------------------------------- /lib/data/model/diary.dart: -------------------------------------------------------------------------------- 1 | import 'package:diary_flutter/common/enums.dart'; 2 | import 'package:json_annotation/json_annotation.dart'; 3 | 4 | part 'diary.g.dart'; 5 | 6 | @JsonSerializable() 7 | class Diary { 8 | static int maxLength = 100; 9 | 10 | final DateTime dateTime; 11 | final String content; 12 | final Moods? mood; 13 | final List? playlist; 14 | 15 | int get contentLength => content.length; 16 | bool get isEmpty => content.isEmpty; 17 | 18 | Diary(this.dateTime, this.content, this.mood, this.playlist); 19 | 20 | factory Diary.fromJson(Map json) => _$DiaryFromJson(json); 21 | Map toJson() => _$DiaryToJson(this); 22 | 23 | Diary copyWith({ 24 | DateTime? dateTime, 25 | String? content, 26 | Moods? mood, 27 | List? playlist, 28 | }) => 29 | Diary( 30 | dateTime ?? this.dateTime, 31 | content ?? this.content, 32 | mood ?? this.mood, 33 | playlist ?? this.playlist, 34 | ); 35 | } 36 | -------------------------------------------------------------------------------- /lib/data/model/diary.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'diary.dart'; 4 | 5 | // ************************************************************************** 6 | // JsonSerializableGenerator 7 | // ************************************************************************** 8 | 9 | Diary _$DiaryFromJson(Map json) => Diary( 10 | DateTime.parse(json['dateTime'] as String), 11 | json['content'] as String, 12 | $enumDecodeNullable(_$MoodsEnumMap, json['mood']), 13 | (json['playlist'] as List?)?.map((e) => e as String).toList(), 14 | ); 15 | 16 | Map _$DiaryToJson(Diary instance) => { 17 | 'dateTime': instance.dateTime.toIso8601String(), 18 | 'content': instance.content, 19 | 'mood': _$MoodsEnumMap[instance.mood], 20 | 'playlist': instance.playlist, 21 | }; 22 | 23 | const _$MoodsEnumMap = { 24 | Moods.happy: 'happy', 25 | Moods.sad: 'sad', 26 | Moods.angry: 'angry', 27 | Moods.neutral: 'neutral', 28 | }; 29 | -------------------------------------------------------------------------------- /lib/data/model/diary/chats_output.dart: -------------------------------------------------------------------------------- 1 | import 'package:json_annotation/json_annotation.dart'; 2 | part 'chats_output.g.dart'; 3 | 4 | @JsonSerializable() 5 | class ChatsOutput { 6 | final String messageType; 7 | final String content; 8 | 9 | ChatsOutput({required this.messageType, required this.content}); 10 | 11 | Map toJson() => _$ChatsOutputToJson(this); 12 | factory ChatsOutput.fromJson(Map json) => 13 | _$ChatsOutputFromJson(json); 14 | } 15 | -------------------------------------------------------------------------------- /lib/data/model/diary/chats_output.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'chats_output.dart'; 4 | 5 | // ************************************************************************** 6 | // JsonSerializableGenerator 7 | // ************************************************************************** 8 | 9 | ChatsOutput _$ChatsOutputFromJson(Map json) => ChatsOutput( 10 | messageType: json['messageType'] as String, 11 | content: json['content'] as String, 12 | ); 13 | 14 | Map _$ChatsOutputToJson(ChatsOutput instance) => 15 | { 16 | 'messageType': instance.messageType, 17 | 'content': instance.content, 18 | }; 19 | -------------------------------------------------------------------------------- /lib/data/model/diary/chats_result.dart: -------------------------------------------------------------------------------- 1 | import 'package:diary_flutter/data/model/diary/chats_output.dart'; 2 | import 'package:json_annotation/json_annotation.dart'; 3 | 4 | part 'chats_result.g.dart'; 5 | 6 | @JsonSerializable() 7 | class ChatsResult { 8 | final ChatsOutput output; 9 | 10 | ChatsResult({required this.output}); 11 | 12 | Map toJson() => _$ChatsResultToJson(this); 13 | factory ChatsResult.fromJson(Map json) => 14 | _$ChatsResultFromJson(json); 15 | } 16 | -------------------------------------------------------------------------------- /lib/data/model/diary/chats_result.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'chats_result.dart'; 4 | 5 | // ************************************************************************** 6 | // JsonSerializableGenerator 7 | // ************************************************************************** 8 | 9 | ChatsResult _$ChatsResultFromJson(Map json) => ChatsResult( 10 | output: ChatsOutput.fromJson(json['output'] as Map), 11 | ); 12 | 13 | Map _$ChatsResultToJson(ChatsResult instance) => 14 | { 15 | 'output': instance.output, 16 | }; 17 | -------------------------------------------------------------------------------- /lib/data/model/diary/evaluated_prompt_content.dart: -------------------------------------------------------------------------------- 1 | import 'package:json_annotation/json_annotation.dart'; 2 | 3 | part 'evaluated_prompt_content.g.dart'; 4 | 5 | @JsonSerializable() 6 | class EvaluatedPromptContent { 7 | final bool canFeedback; 8 | final String react; 9 | 10 | EvaluatedPromptContent({ 11 | required this.canFeedback, 12 | required this.react, 13 | }); 14 | 15 | factory EvaluatedPromptContent.fromJson(Map json) => 16 | _$EvaluatedPromptContentFromJson(json); 17 | Map toJson() => _$EvaluatedPromptContentToJson(this); 18 | } 19 | -------------------------------------------------------------------------------- /lib/data/model/diary/evaluated_prompt_content.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'evaluated_prompt_content.dart'; 4 | 5 | // ************************************************************************** 6 | // JsonSerializableGenerator 7 | // ************************************************************************** 8 | 9 | EvaluatedPromptContent _$EvaluatedPromptContentFromJson( 10 | Map json) => 11 | EvaluatedPromptContent( 12 | canFeedback: json['canFeedback'] as bool, 13 | react: json['react'] as String, 14 | ); 15 | 16 | Map _$EvaluatedPromptContentToJson( 17 | EvaluatedPromptContent instance) => 18 | { 19 | 'canFeedback': instance.canFeedback, 20 | 'react': instance.react, 21 | }; 22 | -------------------------------------------------------------------------------- /lib/data/model/diary/generated_feedback_content.dart: -------------------------------------------------------------------------------- 1 | import 'package:diary_flutter/data/model/song.dart'; 2 | import 'package:json_annotation/json_annotation.dart'; 3 | 4 | part 'generated_feedback_content.g.dart'; 5 | 6 | @JsonSerializable() 7 | class GeneratedFeedbackContent { 8 | final String comment; 9 | final Song song; 10 | String get queryString => '${song.singer}, ${song.title}'; 11 | 12 | GeneratedFeedbackContent({required this.comment, required this.song}); 13 | 14 | factory GeneratedFeedbackContent.fromJson(Map json) => 15 | _$GeneratedFeedbackContentFromJson(json); 16 | Map toJson() => _$GeneratedFeedbackContentToJson(this); 17 | } 18 | -------------------------------------------------------------------------------- /lib/data/model/diary/generated_feedback_content.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'generated_feedback_content.dart'; 4 | 5 | // ************************************************************************** 6 | // JsonSerializableGenerator 7 | // ************************************************************************** 8 | 9 | GeneratedFeedbackContent _$GeneratedFeedbackContentFromJson( 10 | Map json) => 11 | GeneratedFeedbackContent( 12 | comment: json['comment'] as String, 13 | song: Song.fromJson(json['song'] as Map), 14 | ); 15 | 16 | Map _$GeneratedFeedbackContentToJson( 17 | GeneratedFeedbackContent instance) => 18 | { 19 | 'comment': instance.comment, 20 | 'song': instance.song, 21 | }; 22 | -------------------------------------------------------------------------------- /lib/data/model/feedback_evaluate_result.dart: -------------------------------------------------------------------------------- 1 | import 'package:json_annotation/json_annotation.dart'; 2 | 3 | part 'feedback_evaluate_result.g.dart'; 4 | 5 | @JsonSerializable() 6 | class FeedbackEvaluateResult { 7 | final bool canFeedback; 8 | final String react; 9 | 10 | FeedbackEvaluateResult(this.canFeedback, this.react); 11 | 12 | factory FeedbackEvaluateResult.fromJson(Map json) => 13 | _$FeedbackEvaluateResultFromJson(json); 14 | Map toJson() => _$FeedbackEvaluateResultToJson(this); 15 | } 16 | -------------------------------------------------------------------------------- /lib/data/model/feedback_evaluate_result.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'feedback_evaluate_result.dart'; 4 | 5 | // ************************************************************************** 6 | // JsonSerializableGenerator 7 | // ************************************************************************** 8 | 9 | FeedbackEvaluateResult _$FeedbackEvaluateResultFromJson( 10 | Map json) => 11 | FeedbackEvaluateResult( 12 | json['canFeedback'] as bool, 13 | json['react'] as String, 14 | ); 15 | 16 | Map _$FeedbackEvaluateResultToJson( 17 | FeedbackEvaluateResult instance) => 18 | { 19 | 'canFeedback': instance.canFeedback, 20 | 'react': instance.react, 21 | }; 22 | -------------------------------------------------------------------------------- /lib/data/model/history.dart: -------------------------------------------------------------------------------- 1 | import 'package:diary_flutter/common/enums.dart'; 2 | import 'package:json_annotation/json_annotation.dart'; 3 | 4 | part 'history.g.dart'; 5 | 6 | @JsonSerializable() 7 | class History { 8 | final Role role; 9 | final String message; 10 | 11 | @override 12 | String toString() { 13 | return 'History(role: $role, message: $message)'; 14 | } 15 | 16 | Map toJson() => _$HistoryToJson(this); 17 | factory History.fromJson(Map json) => 18 | _$HistoryFromJson(json); 19 | History({required this.role, required this.message}); 20 | } 21 | -------------------------------------------------------------------------------- /lib/data/model/history.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'history.dart'; 4 | 5 | // ************************************************************************** 6 | // JsonSerializableGenerator 7 | // ************************************************************************** 8 | 9 | History _$HistoryFromJson(Map json) => History( 10 | role: $enumDecode(_$RoleEnumMap, json['role']), 11 | message: json['message'] as String, 12 | ); 13 | 14 | Map _$HistoryToJson(History instance) => { 15 | 'role': _$RoleEnumMap[instance.role]!, 16 | 'message': instance.message, 17 | }; 18 | 19 | const _$RoleEnumMap = { 20 | Role.assistant: 'assistant', 21 | Role.user: 'user', 22 | }; 23 | -------------------------------------------------------------------------------- /lib/data/model/music.dart: -------------------------------------------------------------------------------- 1 | import 'package:json_annotation/json_annotation.dart'; 2 | 3 | part 'music.g.dart'; 4 | 5 | @JsonSerializable() 6 | class Music { 7 | final String id; 8 | final String url; 9 | final String title; 10 | final String description; 11 | final String thumbnailUrl; 12 | 13 | Music({ 14 | required this.id, 15 | required this.url, 16 | required this.title, 17 | required this.description, 18 | required this.thumbnailUrl, 19 | }); 20 | 21 | factory Music.fromJson(Map json) => _$MusicFromJson(json); 22 | Map toJson() => _$MusicToJson(this); 23 | 24 | @override 25 | String toString() { 26 | return 'Music(id: $id, url: $url, title: $title, description: $description, thumbnailUrl: $thumbnailUrl)'; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /lib/data/model/music.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'music.dart'; 4 | 5 | // ************************************************************************** 6 | // JsonSerializableGenerator 7 | // ************************************************************************** 8 | 9 | Music _$MusicFromJson(Map json) => Music( 10 | id: json['id'] as String, 11 | url: json['url'] as String, 12 | title: json['title'] as String, 13 | description: json['description'] as String, 14 | thumbnailUrl: json['thumbnailUrl'] as String, 15 | ); 16 | 17 | Map _$MusicToJson(Music instance) => { 18 | 'id': instance.id, 19 | 'url': instance.url, 20 | 'title': instance.title, 21 | 'description': instance.description, 22 | 'thumbnailUrl': instance.thumbnailUrl, 23 | }; 24 | -------------------------------------------------------------------------------- /lib/data/model/song.dart: -------------------------------------------------------------------------------- 1 | import 'package:json_annotation/json_annotation.dart'; 2 | 3 | part 'song.g.dart'; 4 | 5 | @JsonSerializable() 6 | class Song { 7 | final String singer; 8 | final String title; 9 | final String reason; 10 | 11 | Song(this.title, this.singer, this.reason); 12 | 13 | factory Song.fromJson(Map json) => _$SongFromJson(json); 14 | Map toJson() => _$SongToJson(this); 15 | 16 | @override 17 | String toString() { 18 | return 'Song(title: $title, singer: $singer, reason: $reason)'; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /lib/data/model/song.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'song.dart'; 4 | 5 | // ************************************************************************** 6 | // JsonSerializableGenerator 7 | // ************************************************************************** 8 | 9 | Song _$SongFromJson(Map json) => Song( 10 | json['title'] as String, 11 | json['singer'] as String, 12 | json['reason'] as String, 13 | ); 14 | 15 | Map _$SongToJson(Song instance) => { 16 | 'singer': instance.singer, 17 | 'title': instance.title, 18 | 'reason': instance.reason, 19 | }; 20 | -------------------------------------------------------------------------------- /lib/data/model/user.dart: -------------------------------------------------------------------------------- 1 | class User { 2 | bool? isAgreed; 3 | User({this.isAgreed}); 4 | 5 | User copyWith({ 6 | bool? isAgreed, 7 | }) { 8 | return User( 9 | isAgreed: isAgreed ?? this.isAgreed, 10 | ); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /lib/data/model/user_put_agreement_body.dart: -------------------------------------------------------------------------------- 1 | import 'package:json_annotation/json_annotation.dart'; 2 | part 'user_put_agreement_body.g.dart'; 3 | 4 | @JsonSerializable() 5 | class UserPutAgreementBody { 6 | bool? agreement; 7 | 8 | UserPutAgreementBody({ 9 | this.agreement, 10 | }); 11 | 12 | factory UserPutAgreementBody.fromJson(Map json) => 13 | _$UserPutAgreementBodyFromJson(json); 14 | 15 | Map toJson() => _$UserPutAgreementBodyToJson(this); 16 | 17 | UserPutAgreementBody copyWith({ 18 | bool? agreement, 19 | }) { 20 | return UserPutAgreementBody( 21 | agreement: agreement ?? this.agreement, 22 | ); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /lib/data/model/user_put_agreement_body.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'user_put_agreement_body.dart'; 4 | 5 | // ************************************************************************** 6 | // JsonSerializableGenerator 7 | // ************************************************************************** 8 | 9 | UserPutAgreementBody _$UserPutAgreementBodyFromJson( 10 | Map json) => 11 | UserPutAgreementBody( 12 | agreement: json['agreement'] as bool?, 13 | ); 14 | 15 | Map _$UserPutAgreementBodyToJson( 16 | UserPutAgreementBody instance) => 17 | { 18 | 'agreement': instance.agreement, 19 | }; 20 | -------------------------------------------------------------------------------- /lib/data/model/user_put_agreement_response.dart: -------------------------------------------------------------------------------- 1 | import 'package:json_annotation/json_annotation.dart'; 2 | part 'user_put_agreement_response.g.dart'; 3 | 4 | @JsonSerializable() 5 | class UserPutAgreementResponse { 6 | String? name; 7 | String? email; 8 | bool? agreement; 9 | int? code; 10 | 11 | UserPutAgreementResponse({ 12 | this.name, 13 | this.email, 14 | this.agreement, 15 | this.code, 16 | }); 17 | 18 | factory UserPutAgreementResponse.fromJson(Map json) => 19 | _$UserPutAgreementResponseFromJson(json); 20 | 21 | Map toJson() => _$UserPutAgreementResponseToJson(this); 22 | } 23 | -------------------------------------------------------------------------------- /lib/data/model/user_put_agreement_response.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'user_put_agreement_response.dart'; 4 | 5 | // ************************************************************************** 6 | // JsonSerializableGenerator 7 | // ************************************************************************** 8 | 9 | UserPutAgreementResponse _$UserPutAgreementResponseFromJson( 10 | Map json) => 11 | UserPutAgreementResponse( 12 | name: json['name'] as String?, 13 | email: json['email'] as String?, 14 | agreement: json['agreement'] as bool?, 15 | code: (json['code'] as num?)?.toInt(), 16 | ); 17 | 18 | Map _$UserPutAgreementResponseToJson( 19 | UserPutAgreementResponse instance) => 20 | { 21 | 'name': instance.name, 22 | 'email': instance.email, 23 | 'agreement': instance.agreement, 24 | 'code': instance.code, 25 | }; 26 | -------------------------------------------------------------------------------- /lib/data/model/user_response.dart: -------------------------------------------------------------------------------- 1 | import 'package:json_annotation/json_annotation.dart'; 2 | part 'user_response.g.dart'; 3 | 4 | @JsonSerializable() 5 | class UserResponse { 6 | String name; 7 | String? email; 8 | bool? agreement; 9 | String? nickname; 10 | String? gender; 11 | int? code; 12 | 13 | bool get isAgreed => agreement ?? false; 14 | 15 | UserResponse({ 16 | required this.name, 17 | this.email, 18 | this.agreement, 19 | this.nickname, 20 | this.gender, 21 | this.code, 22 | }); 23 | 24 | factory UserResponse.fromJson(Map json) => 25 | _$UserResponseFromJson(json); 26 | 27 | Map toJson() => _$UserResponseToJson(this); 28 | 29 | @override 30 | String toString() { 31 | return 'UserResponse(name: $name, email: $email, agreement: $agreement, nickname: $nickname, gender: $gender, code: $code, isAgreed: $isAgreed)'; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /lib/data/model/user_response.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'user_response.dart'; 4 | 5 | // ************************************************************************** 6 | // JsonSerializableGenerator 7 | // ************************************************************************** 8 | 9 | UserResponse _$UserResponseFromJson(Map json) => UserResponse( 10 | name: json['name'] as String, 11 | email: json['email'] as String?, 12 | agreement: json['agreement'] as bool?, 13 | nickname: json['nickname'] as String?, 14 | gender: json['gender'] as String?, 15 | code: (json['code'] as num?)?.toInt(), 16 | ); 17 | 18 | Map _$UserResponseToJson(UserResponse instance) => 19 | { 20 | 'name': instance.name, 21 | 'email': instance.email, 22 | 'agreement': instance.agreement, 23 | 'nickname': instance.nickname, 24 | 'gender': instance.gender, 25 | 'code': instance.code, 26 | }; 27 | -------------------------------------------------------------------------------- /lib/data/provider/chats_repository_provider.dart: -------------------------------------------------------------------------------- 1 | import 'package:diary_flutter/data/provider/dio_provider.dart'; 2 | import 'package:diary_flutter/data/repository/chats_repository.dart'; 3 | import 'package:diary_flutter/env/env.dart'; 4 | import 'package:riverpod_annotation/riverpod_annotation.dart'; 5 | 6 | part 'chats_repository_provider.g.dart'; 7 | 8 | @riverpod 9 | ChatsRepository chatsRepository(ChatsRepositoryRef ref) { 10 | final dio = ref.watch(dioProvider(baseUrl: Env.baseUrl)); 11 | return ChatsRepository(dio); 12 | } 13 | -------------------------------------------------------------------------------- /lib/data/provider/chats_repository_provider.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'chats_repository_provider.dart'; 4 | 5 | // ************************************************************************** 6 | // RiverpodGenerator 7 | // ************************************************************************** 8 | 9 | String _$chatsRepositoryHash() => r'78565455826b11dc02fd76f3f874e0fa6ef3aedb'; 10 | 11 | /// See also [chatsRepository]. 12 | @ProviderFor(chatsRepository) 13 | final chatsRepositoryProvider = AutoDisposeProvider.internal( 14 | chatsRepository, 15 | name: r'chatsRepositoryProvider', 16 | debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') 17 | ? null 18 | : _$chatsRepositoryHash, 19 | dependencies: null, 20 | allTransitiveDependencies: null, 21 | ); 22 | 23 | typedef ChatsRepositoryRef = AutoDisposeProviderRef; 24 | // ignore_for_file: type=lint 25 | // ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member 26 | -------------------------------------------------------------------------------- /lib/data/provider/diary_repository_provider.dart: -------------------------------------------------------------------------------- 1 | import 'package:diary_flutter/data/provider/dio_provider.dart'; 2 | import 'package:diary_flutter/data/repository/diary_repository.dart'; 3 | import 'package:diary_flutter/env/env.dart'; 4 | import 'package:riverpod_annotation/riverpod_annotation.dart'; 5 | 6 | part 'diary_repository_provider.g.dart'; 7 | 8 | @riverpod 9 | DiaryRepository diaryRepository(DiaryRepositoryRef ref) { 10 | final dio = ref.watch(dioProvider(baseUrl: Env.baseUrl)); 11 | return DiaryRepository(dio); 12 | } 13 | -------------------------------------------------------------------------------- /lib/data/provider/diary_repository_provider.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'diary_repository_provider.dart'; 4 | 5 | // ************************************************************************** 6 | // RiverpodGenerator 7 | // ************************************************************************** 8 | 9 | String _$diaryRepositoryHash() => r'2291e16e8f18f1c02cbf0cc89c452e62595bccd9'; 10 | 11 | /// See also [diaryRepository]. 12 | @ProviderFor(diaryRepository) 13 | final diaryRepositoryProvider = AutoDisposeProvider.internal( 14 | diaryRepository, 15 | name: r'diaryRepositoryProvider', 16 | debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') 17 | ? null 18 | : _$diaryRepositoryHash, 19 | dependencies: null, 20 | allTransitiveDependencies: null, 21 | ); 22 | 23 | typedef DiaryRepositoryRef = AutoDisposeProviderRef; 24 | // ignore_for_file: type=lint 25 | // ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member 26 | -------------------------------------------------------------------------------- /lib/data/provider/dio_provider.dart: -------------------------------------------------------------------------------- 1 | import 'package:dio/dio.dart'; 2 | import 'package:pretty_dio_logger/pretty_dio_logger.dart'; 3 | import 'package:riverpod_annotation/riverpod_annotation.dart'; 4 | 5 | part 'dio_provider.g.dart'; 6 | 7 | @Riverpod(keepAlive: false) 8 | Dio dio(DioRef ref, {required String baseUrl}) { 9 | final dio = Dio( 10 | BaseOptions( 11 | baseUrl: baseUrl, 12 | ), 13 | ); 14 | dio.interceptors.addAll([ 15 | PrettyDioLogger(requestBody: true), 16 | ]); 17 | return dio; 18 | } 19 | -------------------------------------------------------------------------------- /lib/data/provider/gemini_repository_provider.dart: -------------------------------------------------------------------------------- 1 | import 'package:diary_flutter/common/enums.dart'; 2 | import 'package:diary_flutter/data/repository/gemeni_repository.dart'; 3 | import 'package:google_generative_ai/google_generative_ai.dart'; 4 | import 'package:riverpod_annotation/riverpod_annotation.dart'; 5 | 6 | part 'gemini_repository_provider.g.dart'; 7 | 8 | @Riverpod(keepAlive: false) 9 | GeminiRepository geminiRepository( 10 | GeminiRepositoryRef ref, { 11 | required GeminiModels model, 12 | required String apiKey, 13 | required String systemPrompt, 14 | GeminiResponseMimeTypes responseMimeType = GeminiResponseMimeTypes.text, 15 | }) { 16 | return GeminiRepository( 17 | model: GenerativeModel( 18 | model: model.name, 19 | apiKey: apiKey, 20 | systemInstruction: Content.system(systemPrompt), 21 | generationConfig: GenerationConfig( 22 | responseMimeType: responseMimeType.parameter, 23 | ), 24 | ), 25 | ); 26 | } 27 | -------------------------------------------------------------------------------- /lib/data/provider/google_auth_repository_provider.dart: -------------------------------------------------------------------------------- 1 | import 'package:diary_flutter/data/repository/google_auth_repository.dart'; 2 | import 'package:riverpod_annotation/riverpod_annotation.dart'; 3 | 4 | part 'google_auth_repository_provider.g.dart'; 5 | 6 | @Riverpod(keepAlive: false) 7 | GoogleAuthRepository googleAuthRepository(GoogleAuthRepositoryRef ref) { 8 | return GoogleAuthRepository(); 9 | } 10 | -------------------------------------------------------------------------------- /lib/data/provider/google_auth_repository_provider.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'google_auth_repository_provider.dart'; 4 | 5 | // ************************************************************************** 6 | // RiverpodGenerator 7 | // ************************************************************************** 8 | 9 | String _$googleAuthRepositoryHash() => 10 | r'9cd54e1176c158ec11e2bed7b1a3b122206a1fd1'; 11 | 12 | /// See also [googleAuthRepository]. 13 | @ProviderFor(googleAuthRepository) 14 | final googleAuthRepositoryProvider = 15 | AutoDisposeProvider.internal( 16 | googleAuthRepository, 17 | name: r'googleAuthRepositoryProvider', 18 | debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') 19 | ? null 20 | : _$googleAuthRepositoryHash, 21 | dependencies: null, 22 | allTransitiveDependencies: null, 23 | ); 24 | 25 | typedef GoogleAuthRepositoryRef = AutoDisposeProviderRef; 26 | // ignore_for_file: type=lint 27 | // ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member 28 | -------------------------------------------------------------------------------- /lib/data/provider/persistance_storage_provider.dart: -------------------------------------------------------------------------------- 1 | import 'package:diary_flutter/data/storage/persistance_storage.dart'; 2 | import 'package:riverpod_annotation/riverpod_annotation.dart'; 3 | 4 | part 'persistance_storage_provider.g.dart'; 5 | 6 | @riverpod 7 | PersistanceStorage persistanceStorage(PersistanceStorageRef ref) { 8 | throw UnimplementedError(); 9 | } 10 | -------------------------------------------------------------------------------- /lib/data/provider/persistance_storage_provider.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'persistance_storage_provider.dart'; 4 | 5 | // ************************************************************************** 6 | // RiverpodGenerator 7 | // ************************************************************************** 8 | 9 | String _$persistanceStorageHash() => 10 | r'b2678d9aa6fd4ce648390a2d7316284f822cafdf'; 11 | 12 | /// See also [persistanceStorage]. 13 | @ProviderFor(persistanceStorage) 14 | final persistanceStorageProvider = 15 | AutoDisposeProvider.internal( 16 | persistanceStorage, 17 | name: r'persistanceStorageProvider', 18 | debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') 19 | ? null 20 | : _$persistanceStorageHash, 21 | dependencies: null, 22 | allTransitiveDependencies: null, 23 | ); 24 | 25 | typedef PersistanceStorageRef = AutoDisposeProviderRef; 26 | // ignore_for_file: type=lint 27 | // ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member 28 | -------------------------------------------------------------------------------- /lib/data/provider/users_repository_provider.dart: -------------------------------------------------------------------------------- 1 | import 'package:diary_flutter/data/provider/dio_provider.dart'; 2 | import 'package:diary_flutter/data/repository/users_repository.dart'; 3 | import 'package:diary_flutter/env/env.dart'; 4 | import 'package:riverpod_annotation/riverpod_annotation.dart'; 5 | 6 | part 'users_repository_provider.g.dart'; 7 | 8 | @riverpod 9 | UsersRepository usersRepository(UsersRepositoryRef ref) { 10 | final dio = ref.watch(dioProvider(baseUrl: Env.baseUrl)); 11 | return UsersRepository(dio); 12 | } 13 | -------------------------------------------------------------------------------- /lib/data/provider/users_repository_provider.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'users_repository_provider.dart'; 4 | 5 | // ************************************************************************** 6 | // RiverpodGenerator 7 | // ************************************************************************** 8 | 9 | String _$usersRepositoryHash() => r'76d4743b6feb8d96838436fef7461c5efa1e01c2'; 10 | 11 | /// See also [usersRepository]. 12 | @ProviderFor(usersRepository) 13 | final usersRepositoryProvider = AutoDisposeProvider.internal( 14 | usersRepository, 15 | name: r'usersRepositoryProvider', 16 | debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') 17 | ? null 18 | : _$usersRepositoryHash, 19 | dependencies: null, 20 | allTransitiveDependencies: null, 21 | ); 22 | 23 | typedef UsersRepositoryRef = AutoDisposeProviderRef; 24 | // ignore_for_file: type=lint 25 | // ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member 26 | -------------------------------------------------------------------------------- /lib/data/repository/gemeni_repository.dart: -------------------------------------------------------------------------------- 1 | import 'package:diary_flutter/data/repository/llm_repository.dart'; 2 | import 'package:google_generative_ai/google_generative_ai.dart'; 3 | 4 | class GeminiRepository implements LLMRepository { 5 | final GenerativeModel model; 6 | 7 | GeminiRepository({required this.model}); 8 | 9 | @override 10 | Future request(String input) async { 11 | try { 12 | var response = await model.generateContent([ 13 | Content.text(input), 14 | ]); 15 | return GenerativeResult( 16 | isSuccess: response.text != null, 17 | message: response.text ?? '', 18 | ); 19 | } on GenerativeAIException catch (e) { 20 | return GenerativeResult( 21 | isSuccess: false, 22 | message: e.message, 23 | ); 24 | } catch (e) { 25 | return GenerativeResult( 26 | isSuccess: false, 27 | message: e.toString(), 28 | ); 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /lib/data/repository/google_auth_repository.dart: -------------------------------------------------------------------------------- 1 | import 'package:firebase_auth/firebase_auth.dart'; 2 | import 'package:google_sign_in/google_sign_in.dart'; 3 | 4 | class GoogleAuthRepository { 5 | final FirebaseAuth _auth = FirebaseAuth.instance; 6 | final GoogleAuthProvider _googleAuthProvider = GoogleAuthProvider(); 7 | 8 | // 웹에서만 동작함 9 | Future signIn() async { 10 | try { 11 | final UserCredential userCredential = 12 | await _auth.signInWithPopup(_googleAuthProvider); 13 | return userCredential.user; 14 | } catch (e) { 15 | return null; 16 | } 17 | } 18 | 19 | User? currentUser() { 20 | return FirebaseAuth.instance.currentUser; 21 | } 22 | 23 | Future signInWithGoogle() async { 24 | try { 25 | const List scopes = [ 26 | 'email', 27 | 'https://www.googleapis.com/auth/contacts.readonly', 28 | ]; 29 | final GoogleSignInAccount? googleUser = 30 | await GoogleSignIn(scopes: scopes).signIn(); 31 | final GoogleSignInAuthentication? googleAuth = 32 | await googleUser?.authentication; 33 | 34 | // Create a new credential 35 | final credential = GoogleAuthProvider.credential( 36 | accessToken: googleAuth?.accessToken, 37 | idToken: googleAuth?.idToken, 38 | ); 39 | 40 | // Once signed in, return the UserCredential 41 | final userCredential = 42 | await FirebaseAuth.instance.signInWithCredential(credential); 43 | return userCredential.user; 44 | } catch (e) { 45 | return null; 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /lib/data/repository/llm_repository.dart: -------------------------------------------------------------------------------- 1 | class GenerativeResult { 2 | final String message; 3 | final bool isSuccess; 4 | 5 | GenerativeResult({ 6 | required this.isSuccess, 7 | required this.message, 8 | }); 9 | } 10 | 11 | abstract class LLMRepository { 12 | Future request(String input); 13 | } 14 | -------------------------------------------------------------------------------- /lib/data/storage/persistance_storage.dart: -------------------------------------------------------------------------------- 1 | abstract class PersistanceStorage { 2 | setValue(String key, T value); 3 | T? getValue(String key); 4 | removeValue(String key); 5 | } 6 | -------------------------------------------------------------------------------- /lib/data/storage/shared_preference_persistance_storage.dart: -------------------------------------------------------------------------------- 1 | import 'package:diary_flutter/data/storage/persistance_storage.dart'; 2 | import 'package:shared_preferences/shared_preferences.dart'; 3 | 4 | class SharedPreferencePersistanceStorage implements PersistanceStorage { 5 | final SharedPreferences sharedPreferences; 6 | SharedPreferencePersistanceStorage({required this.sharedPreferences}); 7 | 8 | @override 9 | setValue(String key, T value) => switch (value) { 10 | (String _) => sharedPreferences.setString(key, value), 11 | (bool _) => sharedPreferences.setBool(key, value), 12 | (int _) => sharedPreferences.setInt(key, value), 13 | (double _) => sharedPreferences.setDouble(key, value), 14 | (List _) => sharedPreferences.setStringList(key, value), 15 | _ => throw Exception("지원하지 않는 타입의 값입니다.") 16 | }; 17 | 18 | @override 19 | T? getValue(String key) { 20 | final value = sharedPreferences.get(key); 21 | if (value == null) { 22 | return null; 23 | } 24 | if (T == String) { 25 | return value as T; 26 | } 27 | if (T == int) { 28 | return value as T; 29 | } 30 | if (T == double) { 31 | return value as T; 32 | } 33 | if (T == bool) { 34 | return value as T; 35 | } 36 | if (T == List) { 37 | return sharedPreferences.getStringList(key) as T; 38 | } 39 | throw Exception('$T 타입은 지원하지 않는 타입의 값입니다.'); 40 | } 41 | 42 | @override 43 | removeValue(String key) { 44 | sharedPreferences.remove(key); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /lib/domain/provider/archived_diaries.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | 3 | import 'package:diary_flutter/data/model/diary.dart'; 4 | import 'package:diary_flutter/data/provider/persistance_storage_provider.dart'; 5 | import 'package:diary_flutter/domain/provider/temporary_diary.dart'; 6 | import 'package:riverpod_annotation/riverpod_annotation.dart'; 7 | 8 | part 'archived_diaries.g.dart'; 9 | 10 | @Riverpod(keepAlive: true) 11 | class ArchivedDiaries extends _$ArchivedDiaries { 12 | static const String key = "archived_diaries"; 13 | 14 | void archive() { 15 | final temporaryDiary = ref.read(temporaryDiaryProvider); 16 | final persistanceStorage = ref.read(persistanceStorageProvider); 17 | final archivedDiaries = 18 | persistanceStorage.getValue>(key) ?? []; 19 | archivedDiaries.add(jsonEncode(temporaryDiary.toJson())); 20 | persistanceStorage.setValue(key, archivedDiaries); 21 | ref.read(temporaryDiaryProvider.notifier).clear(); 22 | state = [ 23 | ...state, 24 | temporaryDiary, 25 | ]; 26 | } 27 | 28 | @override 29 | List build() { 30 | final persistanceStorage = ref.read(persistanceStorageProvider); 31 | final storedDiaries = persistanceStorage.getValue>(key); 32 | if (storedDiaries != null) { 33 | return storedDiaries.map((e) => Diary.fromJson(jsonDecode(e))).toList(); 34 | } else { 35 | return []; 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /lib/domain/provider/archived_diaries.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'archived_diaries.dart'; 4 | 5 | // ************************************************************************** 6 | // RiverpodGenerator 7 | // ************************************************************************** 8 | 9 | String _$archivedDiariesHash() => r'95cf84625853f4a7f869fc96afb2f101c950b6cd'; 10 | 11 | /// See also [ArchivedDiaries]. 12 | @ProviderFor(ArchivedDiaries) 13 | final archivedDiariesProvider = 14 | NotifierProvider>.internal( 15 | ArchivedDiaries.new, 16 | name: r'archivedDiariesProvider', 17 | debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') 18 | ? null 19 | : _$archivedDiariesHash, 20 | dependencies: null, 21 | allTransitiveDependencies: null, 22 | ); 23 | 24 | typedef _$ArchivedDiaries = Notifier>; 25 | // ignore_for_file: type=lint 26 | // ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member 27 | -------------------------------------------------------------------------------- /lib/domain/provider/auth/auth.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'auth.dart'; 4 | 5 | // ************************************************************************** 6 | // RiverpodGenerator 7 | // ************************************************************************** 8 | 9 | String _$authHash() => r'a748ca4faea314162502d5b826c3be6e095c48eb'; 10 | 11 | /// See also [Auth]. 12 | @ProviderFor(Auth) 13 | final authProvider = AsyncNotifierProvider.internal( 14 | Auth.new, 15 | name: r'authProvider', 16 | debugGetCreateSourceHash: 17 | const bool.fromEnvironment('dart.vm.product') ? null : _$authHash, 18 | dependencies: null, 19 | allTransitiveDependencies: null, 20 | ); 21 | 22 | typedef _$Auth = AsyncNotifier; 23 | // ignore_for_file: type=lint 24 | // ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member 25 | -------------------------------------------------------------------------------- /lib/domain/provider/auth/get_my_id_token.dart: -------------------------------------------------------------------------------- 1 | import 'package:riverpod_annotation/riverpod_annotation.dart'; 2 | import 'package:diary_flutter/data/provider/persistance_storage_provider.dart'; 3 | 4 | part 'get_my_id_token.g.dart'; 5 | 6 | @riverpod 7 | String getMyIdToken(GetMyIdTokenRef ref) { 8 | final persistanceStorage = ref.watch(persistanceStorageProvider); 9 | final idToken = persistanceStorage.getValue("id_token"); 10 | if (idToken == null || idToken.isEmpty) { 11 | throw Exception("ID token not found in storage"); 12 | } 13 | 14 | return idToken; 15 | } 16 | -------------------------------------------------------------------------------- /lib/domain/provider/auth/get_my_id_token.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'get_my_id_token.dart'; 4 | 5 | // ************************************************************************** 6 | // RiverpodGenerator 7 | // ************************************************************************** 8 | 9 | String _$getMyIdTokenHash() => r'3d6c29ee3775b2751f8397374fc50d66ab0d103d'; 10 | 11 | /// See also [getMyIdToken]. 12 | @ProviderFor(getMyIdToken) 13 | final getMyIdTokenProvider = AutoDisposeProvider.internal( 14 | getMyIdToken, 15 | name: r'getMyIdTokenProvider', 16 | debugGetCreateSourceHash: 17 | const bool.fromEnvironment('dart.vm.product') ? null : _$getMyIdTokenHash, 18 | dependencies: null, 19 | allTransitiveDependencies: null, 20 | ); 21 | 22 | typedef GetMyIdTokenRef = AutoDisposeProviderRef; 23 | // ignore_for_file: type=lint 24 | // ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member 25 | -------------------------------------------------------------------------------- /lib/domain/provider/auth/get_my_name.dart: -------------------------------------------------------------------------------- 1 | import 'package:diary_flutter/domain/provider/auth/auth.dart'; 2 | import 'package:riverpod_annotation/riverpod_annotation.dart'; 3 | 4 | part 'get_my_name.g.dart'; 5 | 6 | @riverpod 7 | String getMyName(GetMyNameRef ref) { 8 | final authState = ref.watch(authProvider); 9 | 10 | return authState.maybeWhen( 11 | data: (state) { 12 | if (state is SignedInState) { 13 | return state.name; 14 | } else { 15 | throw Exception('User not signed in'); 16 | } 17 | }, 18 | orElse: () => throw Exception('User not signed in'), 19 | ); 20 | } 21 | -------------------------------------------------------------------------------- /lib/domain/provider/auth/get_my_name.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'get_my_name.dart'; 4 | 5 | // ************************************************************************** 6 | // RiverpodGenerator 7 | // ************************************************************************** 8 | 9 | String _$getMyNameHash() => r'2ae6c7e7b95289c489de4543ba3e4a9c87216c19'; 10 | 11 | /// See also [getMyName]. 12 | @ProviderFor(getMyName) 13 | final getMyNameProvider = AutoDisposeProvider.internal( 14 | getMyName, 15 | name: r'getMyNameProvider', 16 | debugGetCreateSourceHash: 17 | const bool.fromEnvironment('dart.vm.product') ? null : _$getMyNameHash, 18 | dependencies: null, 19 | allTransitiveDependencies: null, 20 | ); 21 | 22 | typedef GetMyNameRef = AutoDisposeProviderRef; 23 | // ignore_for_file: type=lint 24 | // ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member 25 | -------------------------------------------------------------------------------- /lib/domain/provider/chats/chats_feedback_notifier.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'chats_feedback_notifier.dart'; 4 | 5 | // ************************************************************************** 6 | // RiverpodGenerator 7 | // ************************************************************************** 8 | 9 | String _$chatsFeedbackNotifierHash() => 10 | r'da5ae1e7d33d691fb801a99d136c82d48c6ed2b2'; 11 | 12 | /// See also [ChatsFeedbackNotifier]. 13 | @ProviderFor(ChatsFeedbackNotifier) 14 | final chatsFeedbackNotifierProvider = AutoDisposeNotifierProvider< 15 | ChatsFeedbackNotifier, AsyncValue>.internal( 16 | ChatsFeedbackNotifier.new, 17 | name: r'chatsFeedbackNotifierProvider', 18 | debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') 19 | ? null 20 | : _$chatsFeedbackNotifierHash, 21 | dependencies: null, 22 | allTransitiveDependencies: null, 23 | ); 24 | 25 | typedef _$ChatsFeedbackNotifier 26 | = AutoDisposeNotifier>; 27 | // ignore_for_file: type=lint 28 | // ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member 29 | -------------------------------------------------------------------------------- /lib/domain/provider/chats/chats_prompt_notifier.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'chats_prompt_notifier.dart'; 4 | 5 | // ************************************************************************** 6 | // RiverpodGenerator 7 | // ************************************************************************** 8 | 9 | String _$chatsPromptNotifierHash() => 10 | r'3be3bfb5dc66f3f041e44e7c79c130f7c79db06c'; 11 | 12 | /// See also [ChatsPromptNotifier]. 13 | @ProviderFor(ChatsPromptNotifier) 14 | final chatsPromptNotifierProvider = AutoDisposeNotifierProvider< 15 | ChatsPromptNotifier, AsyncValue>.internal( 16 | ChatsPromptNotifier.new, 17 | name: r'chatsPromptNotifierProvider', 18 | debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') 19 | ? null 20 | : _$chatsPromptNotifierHash, 21 | dependencies: null, 22 | allTransitiveDependencies: null, 23 | ); 24 | 25 | typedef _$ChatsPromptNotifier 26 | = AutoDisposeNotifier>; 27 | // ignore_for_file: type=lint 28 | // ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member 29 | -------------------------------------------------------------------------------- /lib/domain/provider/chats/count_chats.dart: -------------------------------------------------------------------------------- 1 | import 'package:diary_flutter/domain/provider/chats/stored_chats.dart'; 2 | import 'package:riverpod_annotation/riverpod_annotation.dart'; 3 | 4 | part 'count_chats.g.dart'; 5 | 6 | @riverpod 7 | int countChats(CountChatsRef ref) { 8 | return ref.watch(storedChatsProvider.select((value) => value.length)); 9 | } 10 | -------------------------------------------------------------------------------- /lib/domain/provider/chats/count_chats.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'count_chats.dart'; 4 | 5 | // ************************************************************************** 6 | // RiverpodGenerator 7 | // ************************************************************************** 8 | 9 | String _$countChatsHash() => r'e8426e2680cb923e2bf6c97bccc35c321dbd3d69'; 10 | 11 | /// See also [countChats]. 12 | @ProviderFor(countChats) 13 | final countChatsProvider = AutoDisposeProvider.internal( 14 | countChats, 15 | name: r'countChatsProvider', 16 | debugGetCreateSourceHash: 17 | const bool.fromEnvironment('dart.vm.product') ? null : _$countChatsHash, 18 | dependencies: null, 19 | allTransitiveDependencies: null, 20 | ); 21 | 22 | typedef CountChatsRef = AutoDisposeProviderRef; 23 | // ignore_for_file: type=lint 24 | // ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member 25 | -------------------------------------------------------------------------------- /lib/domain/provider/chats/get_chat.dart: -------------------------------------------------------------------------------- 1 | import 'package:diary_flutter/data/model/chat.dart'; 2 | import 'package:diary_flutter/domain/provider/chats/stored_chats.dart'; 3 | import 'package:riverpod_annotation/riverpod_annotation.dart'; 4 | 5 | part 'get_chat.g.dart'; 6 | 7 | @riverpod 8 | Chat getChat(GetChatRef ref, int index) { 9 | return ref.watch(storedChatsProvider.select((value) => value[index])); 10 | } 11 | -------------------------------------------------------------------------------- /lib/domain/provider/chats/stored_chats.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'stored_chats.dart'; 4 | 5 | // ************************************************************************** 6 | // RiverpodGenerator 7 | // ************************************************************************** 8 | 9 | String _$storedChatsHash() => r'98766c5e723a4d2aa2d6a5aeaab1885bcc50c8e4'; 10 | 11 | /// See also [StoredChats]. 12 | @ProviderFor(StoredChats) 13 | final storedChatsProvider = NotifierProvider>.internal( 14 | StoredChats.new, 15 | name: r'storedChatsProvider', 16 | debugGetCreateSourceHash: 17 | const bool.fromEnvironment('dart.vm.product') ? null : _$storedChatsHash, 18 | dependencies: null, 19 | allTransitiveDependencies: null, 20 | ); 21 | 22 | typedef _$StoredChats = Notifier>; 23 | // ignore_for_file: type=lint 24 | // ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member 25 | -------------------------------------------------------------------------------- /lib/domain/provider/chats/stored_feedback_target_chats.dart: -------------------------------------------------------------------------------- 1 | import 'package:diary_flutter/data/model/chat.dart'; 2 | import 'package:diary_flutter/data/provider/persistance_storage_provider.dart'; 3 | import 'package:diary_flutter/domain/provider/evaluate_feedback.dart'; 4 | import 'package:riverpod_annotation/riverpod_annotation.dart'; 5 | 6 | part 'stored_feedback_target_chats.g.dart'; 7 | 8 | @Riverpod(keepAlive: true) 9 | class StoredFeedbackTargetChats extends _$StoredFeedbackTargetChats { 10 | static const String key = "stored_feedback_target_chats"; 11 | 12 | @override 13 | List build() { 14 | final persistanceStorage = ref.read(persistanceStorageProvider); 15 | return persistanceStorage.getValue>(key) ?? List.empty(); 16 | } 17 | 18 | reset() { 19 | final persistanceStorage = ref.read(persistanceStorageProvider); 20 | persistanceStorage.removeValue(key); 21 | state = List.empty(); 22 | } 23 | 24 | storeOnlyUser(Chat chat) { 25 | if (!chat.isUser) { 26 | return; 27 | } 28 | 29 | state = [ 30 | ...state, 31 | chat.message, 32 | ]; 33 | final persistanceStorage = ref.read(persistanceStorageProvider); 34 | persistanceStorage.setValue( 35 | key, 36 | state, 37 | ); 38 | 39 | if (state.isNotEmpty) { 40 | ref.read(evaluateFeedbackProvider.notifier).generate(state); 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /lib/domain/provider/chats/stored_feedback_target_chats.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'stored_feedback_target_chats.dart'; 4 | 5 | // ************************************************************************** 6 | // RiverpodGenerator 7 | // ************************************************************************** 8 | 9 | String _$storedFeedbackTargetChatsHash() => 10 | r'28e747575f27261795c262bde15f2843a0ed3beb'; 11 | 12 | /// See also [StoredFeedbackTargetChats]. 13 | @ProviderFor(StoredFeedbackTargetChats) 14 | final storedFeedbackTargetChatsProvider = 15 | NotifierProvider>.internal( 16 | StoredFeedbackTargetChats.new, 17 | name: r'storedFeedbackTargetChatsProvider', 18 | debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') 19 | ? null 20 | : _$storedFeedbackTargetChatsHash, 21 | dependencies: null, 22 | allTransitiveDependencies: null, 23 | ); 24 | 25 | typedef _$StoredFeedbackTargetChats = Notifier>; 26 | // ignore_for_file: type=lint 27 | // ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member 28 | -------------------------------------------------------------------------------- /lib/domain/provider/common/focused_date.dart: -------------------------------------------------------------------------------- 1 | import 'package:riverpod_annotation/riverpod_annotation.dart'; 2 | 3 | part 'focused_date.g.dart'; 4 | 5 | @Riverpod(keepAlive: true) 6 | class FocusedDate extends _$FocusedDate { 7 | @override 8 | DateTime build() { 9 | return DateTime.now(); 10 | } 11 | 12 | Future updateDate(DateTime newDate) async { 13 | state = newDate; 14 | } 15 | 16 | Future resetToToday() async { 17 | state = DateTime.now(); 18 | } 19 | 20 | String toQueryString() { 21 | return state.toIso8601String(); 22 | } 23 | 24 | void fromQueryString(String? dateString) { 25 | if (dateString != null) { 26 | final parsedDate = DateTime.tryParse(dateString); 27 | if (parsedDate != null) { 28 | state = parsedDate; 29 | } 30 | } 31 | } 32 | 33 | bool isToday() { 34 | final now = DateTime.now(); 35 | return state.year == now.year && 36 | state.month == now.month && 37 | state.day == now.day; 38 | } 39 | 40 | Future setTonextDay() async { 41 | state = state.add(const Duration(days: 1)); 42 | } 43 | 44 | Future setTopreviousDay() async { 45 | state = state.subtract(const Duration(days: 1)); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /lib/domain/provider/common/focused_date.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'focused_date.dart'; 4 | 5 | // ************************************************************************** 6 | // RiverpodGenerator 7 | // ************************************************************************** 8 | 9 | String _$focusedDateHash() => r'22a4015ffbc3b03a23d6a6784acf750b06c358a3'; 10 | 11 | /// See also [FocusedDate]. 12 | @ProviderFor(FocusedDate) 13 | final focusedDateProvider = NotifierProvider.internal( 14 | FocusedDate.new, 15 | name: r'focusedDateProvider', 16 | debugGetCreateSourceHash: 17 | const bool.fromEnvironment('dart.vm.product') ? null : _$focusedDateHash, 18 | dependencies: null, 19 | allTransitiveDependencies: null, 20 | ); 21 | 22 | typedef _$FocusedDate = Notifier; 23 | // ignore_for_file: type=lint 24 | // ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member 25 | -------------------------------------------------------------------------------- /lib/domain/provider/evaluate_feedback.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'evaluate_feedback.dart'; 4 | 5 | // ************************************************************************** 6 | // RiverpodGenerator 7 | // ************************************************************************** 8 | 9 | String _$evaluateFeedbackHash() => r'09b93e0528ecb7899d472e8d8f67f4bca6549552'; 10 | 11 | /// See also [EvaluateFeedback]. 12 | @ProviderFor(EvaluateFeedback) 13 | final evaluateFeedbackProvider = 14 | NotifierProvider.internal( 15 | EvaluateFeedback.new, 16 | name: r'evaluateFeedbackProvider', 17 | debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') 18 | ? null 19 | : _$evaluateFeedbackHash, 20 | dependencies: null, 21 | allTransitiveDependencies: null, 22 | ); 23 | 24 | typedef _$EvaluateFeedback = Notifier; 25 | // ignore_for_file: type=lint 26 | // ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member 27 | -------------------------------------------------------------------------------- /lib/domain/provider/generate_feedback.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'generate_feedback.dart'; 4 | 5 | // ************************************************************************** 6 | // RiverpodGenerator 7 | // ************************************************************************** 8 | 9 | String _$generateFeedbackHash() => r'4ce62b51daf9eb649ff09fc48482b033706006f0'; 10 | 11 | /// See also [GenerateFeedback]. 12 | @ProviderFor(GenerateFeedback) 13 | final generateFeedbackProvider = 14 | NotifierProvider.internal( 15 | GenerateFeedback.new, 16 | name: r'generateFeedbackProvider', 17 | debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') 18 | ? null 19 | : _$generateFeedbackHash, 20 | dependencies: null, 21 | allTransitiveDependencies: null, 22 | ); 23 | 24 | typedef _$GenerateFeedback = Notifier; 25 | // ignore_for_file: type=lint 26 | // ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member 27 | -------------------------------------------------------------------------------- /lib/domain/provider/journal/my_journal_store.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'my_journal_store.dart'; 4 | 5 | // ************************************************************************** 6 | // RiverpodGenerator 7 | // ************************************************************************** 8 | 9 | String _$myJournalStoreHash() => r'257c229a7fe087087fdc6fcd4b81b8e45affe7b1'; 10 | 11 | /// See also [MyJournalStore]. 12 | @ProviderFor(MyJournalStore) 13 | final myJournalStoreProvider = 14 | AutoDisposeNotifierProvider>.internal( 15 | MyJournalStore.new, 16 | name: r'myJournalStoreProvider', 17 | debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') 18 | ? null 19 | : _$myJournalStoreHash, 20 | dependencies: null, 21 | allTransitiveDependencies: null, 22 | ); 23 | 24 | typedef _$MyJournalStore = AutoDisposeNotifier>; 25 | // ignore_for_file: type=lint 26 | // ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member 27 | -------------------------------------------------------------------------------- /lib/domain/provider/onboarding/agreement_notifier.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'agreement_notifier.dart'; 4 | 5 | // ************************************************************************** 6 | // RiverpodGenerator 7 | // ************************************************************************** 8 | 9 | String _$agreementNotifierHash() => r'f3d8c4fdcbea03a55944a5098b32f1e00108ba73'; 10 | 11 | /// See also [AgreementNotifier]. 12 | @ProviderFor(AgreementNotifier) 13 | final agreementNotifierProvider = 14 | AutoDisposeNotifierProvider.internal( 15 | AgreementNotifier.new, 16 | name: r'agreementNotifierProvider', 17 | debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') 18 | ? null 19 | : _$agreementNotifierHash, 20 | dependencies: null, 21 | allTransitiveDependencies: null, 22 | ); 23 | 24 | typedef _$AgreementNotifier = AutoDisposeNotifier; 25 | // ignore_for_file: type=lint 26 | // ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member 27 | -------------------------------------------------------------------------------- /lib/domain/provider/onboarding/onbording_notifier.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'onbording_notifier.dart'; 4 | 5 | // ************************************************************************** 6 | // RiverpodGenerator 7 | // ************************************************************************** 8 | 9 | String _$onboardingNotifierHash() => 10 | r'c94842ffdc1fbfdebbacfeb9e5eabc2aaddbcc9a'; 11 | 12 | /// See also [OnboardingNotifier]. 13 | @ProviderFor(OnboardingNotifier) 14 | final onboardingNotifierProvider = 15 | AutoDisposeNotifierProvider.internal( 16 | OnboardingNotifier.new, 17 | name: r'onboardingNotifierProvider', 18 | debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') 19 | ? null 20 | : _$onboardingNotifierHash, 21 | dependencies: null, 22 | allTransitiveDependencies: null, 23 | ); 24 | 25 | typedef _$OnboardingNotifier = AutoDisposeNotifier; 26 | // ignore_for_file: type=lint 27 | // ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member 28 | -------------------------------------------------------------------------------- /lib/domain/provider/temporary_diary.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'temporary_diary.dart'; 4 | 5 | // ************************************************************************** 6 | // RiverpodGenerator 7 | // ************************************************************************** 8 | 9 | String _$temporaryDiaryHash() => r'00a0aa8ec4ab8784cfecd4592506981139bd8430'; 10 | 11 | /// See also [TemporaryDiary]. 12 | @ProviderFor(TemporaryDiary) 13 | final temporaryDiaryProvider = 14 | AutoDisposeNotifierProvider.internal( 15 | TemporaryDiary.new, 16 | name: r'temporaryDiaryProvider', 17 | debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') 18 | ? null 19 | : _$temporaryDiaryHash, 20 | dependencies: null, 21 | allTransitiveDependencies: null, 22 | ); 23 | 24 | typedef _$TemporaryDiary = AutoDisposeNotifier; 25 | // ignore_for_file: type=lint 26 | // ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member 27 | -------------------------------------------------------------------------------- /lib/domain/provider/temporary_mood.dart: -------------------------------------------------------------------------------- 1 | import 'package:diary_flutter/common/enums.dart'; 2 | import 'package:diary_flutter/domain/provider/temporary_diary.dart'; 3 | import 'package:riverpod_annotation/riverpod_annotation.dart'; 4 | 5 | part 'temporary_mood.g.dart'; 6 | 7 | @riverpod 8 | Moods? temporaryMood(TemporaryMoodRef ref) { 9 | return ref.watch(temporaryDiaryProvider.select((diary) => diary.mood)); 10 | } 11 | -------------------------------------------------------------------------------- /lib/domain/provider/temporary_mood.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'temporary_mood.dart'; 4 | 5 | // ************************************************************************** 6 | // RiverpodGenerator 7 | // ************************************************************************** 8 | 9 | String _$temporaryMoodHash() => r'5996bca6625e6ab6f0c9d048548c5d7169838947'; 10 | 11 | /// See also [temporaryMood]. 12 | @ProviderFor(temporaryMood) 13 | final temporaryMoodProvider = AutoDisposeProvider.internal( 14 | temporaryMood, 15 | name: r'temporaryMoodProvider', 16 | debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') 17 | ? null 18 | : _$temporaryMoodHash, 19 | dependencies: null, 20 | allTransitiveDependencies: null, 21 | ); 22 | 23 | typedef TemporaryMoodRef = AutoDisposeProviderRef; 24 | // ignore_for_file: type=lint 25 | // ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member 26 | -------------------------------------------------------------------------------- /lib/domain/provider/user/agreed_user.dart: -------------------------------------------------------------------------------- 1 | import 'package:diary_flutter/data/model/user.dart'; 2 | import 'package:diary_flutter/data/provider/users_repository_provider.dart'; 3 | import 'package:diary_flutter/data/repository/users_repository.dart'; 4 | import 'package:diary_flutter/domain/provider/auth/auth.dart'; 5 | import 'package:flutter/foundation.dart'; 6 | import 'package:riverpod_annotation/riverpod_annotation.dart'; 7 | 8 | part 'agreed_user.g.dart'; 9 | 10 | @Riverpod(keepAlive: true) 11 | class AgreedUser extends _$AgreedUser { 12 | @override 13 | User build() { 14 | return User(); 15 | } 16 | 17 | agree() async { 18 | try { 19 | final user = ref.read(authProvider).value; 20 | if (user != null && user is SignedInState) { 21 | final response = 22 | await ref.read(usersRepositoryProvider).putUsersAgreement( 23 | bearerToken: 'Bearer ${user.idToken}', 24 | body: UsersAgreementBody(agreement: true), 25 | ); 26 | state = state.copyWith(isAgreed: response.isAgreed); 27 | } 28 | } catch (e) { 29 | if (kDebugMode) { 30 | print(e); 31 | } 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /lib/domain/provider/user/agreed_user.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'agreed_user.dart'; 4 | 5 | // ************************************************************************** 6 | // RiverpodGenerator 7 | // ************************************************************************** 8 | 9 | String _$agreedUserHash() => r'5f3dc7a65ecba065e1a99df9801b2119743029c5'; 10 | 11 | /// See also [AgreedUser]. 12 | @ProviderFor(AgreedUser) 13 | final agreedUserProvider = NotifierProvider.internal( 14 | AgreedUser.new, 15 | name: r'agreedUserProvider', 16 | debugGetCreateSourceHash: 17 | const bool.fromEnvironment('dart.vm.product') ? null : _$agreedUserHash, 18 | dependencies: null, 19 | allTransitiveDependencies: null, 20 | ); 21 | 22 | typedef _$AgreedUser = Notifier; 23 | // ignore_for_file: type=lint 24 | // ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member 25 | -------------------------------------------------------------------------------- /lib/domain/provider/user/user_me_notifier.dart: -------------------------------------------------------------------------------- 1 | import 'package:diary_flutter/data/model/user_response.dart'; 2 | import 'package:diary_flutter/data/provider/users_repository_provider.dart'; 3 | import 'package:diary_flutter/domain/provider/auth/auth.dart'; 4 | import 'package:riverpod_annotation/riverpod_annotation.dart'; 5 | 6 | part 'user_me_notifier.g.dart'; 7 | 8 | @riverpod 9 | Future userMeNotifier(UserMeNotifierRef ref) async { 10 | final user = ref.read(authProvider).value; 11 | if (user != null && user is SignedInState) { 12 | return ref.read(usersRepositoryProvider).getCurrentUser( 13 | bearerToken: 'Bearer ${user.idToken}', 14 | ); 15 | } else { 16 | throw Exception('User not signed in'); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /lib/domain/provider/user/user_me_notifier.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'user_me_notifier.dart'; 4 | 5 | // ************************************************************************** 6 | // RiverpodGenerator 7 | // ************************************************************************** 8 | 9 | String _$userMeNotifierHash() => r'9813881520ed8fbd5f7c3276208c2d4424af4dd8'; 10 | 11 | /// See also [userMeNotifier]. 12 | @ProviderFor(userMeNotifier) 13 | final userMeNotifierProvider = AutoDisposeFutureProvider.internal( 14 | userMeNotifier, 15 | name: r'userMeNotifierProvider', 16 | debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') 17 | ? null 18 | : _$userMeNotifierHash, 19 | dependencies: null, 20 | allTransitiveDependencies: null, 21 | ); 22 | 23 | typedef UserMeNotifierRef = AutoDisposeFutureProviderRef; 24 | // ignore_for_file: type=lint 25 | // ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member 26 | -------------------------------------------------------------------------------- /lib/env/env.dart: -------------------------------------------------------------------------------- 1 | import 'package:envied/envied.dart'; 2 | 3 | part 'env.g.dart'; 4 | 5 | @Envied(path: '.env') 6 | abstract class Env { 7 | @EnviedField(varName: 'GEMENI_API_KEY') 8 | static const String geminiApiKey = _Env.geminiApiKey; 9 | 10 | @EnviedField(varName: 'YOUTUBE_DATA_API_KEY') 11 | static const String youtubeDataApiKey = _Env.youtubeDataApiKey; 12 | 13 | @EnviedField(varName: 'BASE_URL') 14 | static const String baseUrl = _Env.baseUrl; 15 | 16 | @EnviedField(varName: 'GOOGLE_CLIENT_ID') 17 | static const String googleClientId = _Env.googleClientId; 18 | } 19 | -------------------------------------------------------------------------------- /lib/gen/fonts.gen.dart: -------------------------------------------------------------------------------- 1 | /// GENERATED CODE - DO NOT MODIFY BY HAND 2 | /// ***************************************************** 3 | /// FlutterGen 4 | /// ***************************************************** 5 | 6 | // coverage:ignore-file 7 | // ignore_for_file: type=lint 8 | // ignore_for_file: directives_ordering,unnecessary_import,implicit_dynamic_list_literal,deprecated_member_use 9 | 10 | class FontFamily { 11 | FontFamily._(); 12 | 13 | /// Font family: Adamina 14 | static const String adamina = 'Adamina'; 15 | 16 | /// Font family: Texgyreheros 17 | static const String texgyreheros = 'Texgyreheros'; 18 | 19 | /// Font family: Texgyreheroscn 20 | static const String texgyreheroscn = 'Texgyreheroscn'; 21 | } 22 | -------------------------------------------------------------------------------- /lib/gen/gen_assets.dart: -------------------------------------------------------------------------------- 1 | import 'package:diary_flutter/gen/assets.gen.dart'; 2 | 3 | class GenAssets { 4 | GenAssets._(); 5 | static const $AssetsImagesGen images = $AssetsImagesGen(); 6 | static const $AssetsLottiesGen lottie = $AssetsLottiesGen(); 7 | } 8 | -------------------------------------------------------------------------------- /lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'package:diary_flutter/app.dart'; 2 | import 'package:diary_flutter/data/provider/persistance_storage_provider.dart'; 3 | import 'package:diary_flutter/data/storage/shared_preference_persistance_storage.dart'; 4 | import 'package:diary_flutter/firebase_options.dart'; 5 | import 'package:firebase_core/firebase_core.dart'; 6 | import 'package:flutter/material.dart'; 7 | import 'package:flutter_riverpod/flutter_riverpod.dart'; 8 | import 'package:shared_preferences/shared_preferences.dart'; 9 | 10 | void main() async { 11 | WidgetsFlutterBinding.ensureInitialized(); 12 | await Firebase.initializeApp( 13 | options: DefaultFirebaseOptions.currentPlatform, 14 | ); 15 | 16 | final sharedPreferencePersistanceStorage = SharedPreferencePersistanceStorage( 17 | sharedPreferences: await SharedPreferences.getInstance(), 18 | ); 19 | runApp( 20 | ProviderScope( 21 | overrides: [ 22 | persistanceStorageProvider.overrideWith( 23 | (ref) => sharedPreferencePersistanceStorage, 24 | ), 25 | ], 26 | child: const App(), 27 | ), 28 | ); 29 | } 30 | -------------------------------------------------------------------------------- /lib/material_theme_data.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | mixin MaterialThemeDataMixin { 4 | ThemeData get themeData { 5 | return ThemeData( 6 | colorScheme: ColorScheme.fromSeed(seedColor: Colors.blue), 7 | bottomNavigationBarTheme: BottomNavigationBarThemeData( 8 | selectedItemColor: Colors.blue, 9 | unselectedItemColor: Colors.grey[400], 10 | ), 11 | useMaterial3: true, 12 | ); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /lib/presentation/calendar/calendar_day.dart: -------------------------------------------------------------------------------- 1 | import 'package:diary_flutter/presentation/style/gem_text_style.dart'; 2 | import 'package:diary_flutter/presentation/style/gem_theme.dart'; 3 | import 'package:flutter/material.dart'; 4 | import 'package:hooks_riverpod/hooks_riverpod.dart'; 5 | 6 | class CalendarDay extends ConsumerWidget { 7 | final int day; 8 | const CalendarDay({ 9 | super.key, 10 | required this.day, 11 | }); 12 | 13 | @override 14 | Widget build(BuildContext context, WidgetRef ref) { 15 | final textStyle = GemTheme.of(ref).textStyle; 16 | return SizedBox( 17 | width: 40, 18 | child: Center( 19 | child: Text( 20 | '$day', 21 | style: textStyle.button.withColor( 22 | const Color(0xFF0C0C0C).withOpacity(0.56), 23 | ), 24 | ), 25 | ), 26 | ); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /lib/presentation/calendar/calendar_diary.dart: -------------------------------------------------------------------------------- 1 | import 'package:diary_flutter/domain/provider/diary/diary_use_cases.dart'; 2 | import 'package:diary_flutter/presentation/calendar/calendar_scroll_view.dart'; 3 | import 'package:diary_flutter/presentation/calendar/calendar_inherited_notifier.dart'; 4 | import 'package:flutter/material.dart'; 5 | import 'package:flutter_riverpod/flutter_riverpod.dart'; 6 | import 'dart:core'; 7 | 8 | class CalendarDiary extends ConsumerWidget { 9 | const CalendarDiary({super.key}); 10 | 11 | @override 12 | Widget build(BuildContext context, WidgetRef ref) { 13 | final calendarChangeNotifier = CalendarInheritedNotifier.watch(context); 14 | return ref 15 | .watch( 16 | getDiariesProvider(calendarChangeNotifier.selectedDateTime), 17 | ) 18 | .when( 19 | data: (diaryResponse) => CalendarScrollView( 20 | musicDiaries: diaryResponse.diary, 21 | ), 22 | loading: () => CalendarScrollView( 23 | musicDiaries: List.empty(), 24 | ), 25 | error: (error, stackTrace) => Text('Error: $error'), 26 | ); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /lib/presentation/calendar/calendar_inherited_notifier.dart: -------------------------------------------------------------------------------- 1 | import 'package:diary_flutter/presentation/calendar/calendar_change_notifier.dart'; 2 | import 'package:flutter/widgets.dart'; 3 | 4 | class CalendarInheritedNotifier 5 | extends InheritedNotifier { 6 | const CalendarInheritedNotifier({ 7 | super.key, 8 | required super.notifier, 9 | required super.child, 10 | }); 11 | 12 | static CalendarChangeNotifier watch(BuildContext context) { 13 | final notifier = context 14 | .dependOnInheritedWidgetOfExactType() 15 | ?.notifier; 16 | assert( 17 | notifier != null, 'Cannot find CalendarInheritedNotifier in context.'); 18 | return notifier!; 19 | } 20 | 21 | static CalendarChangeNotifier read(BuildContext context) { 22 | final notifier = context 23 | .findAncestorWidgetOfExactType() 24 | ?.notifier; 25 | assert( 26 | notifier != null, 'Cannot find CalendarInheritedNotifier in context.'); 27 | return notifier!; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /lib/presentation/calendar/calendar_journal_music_chip.dart: -------------------------------------------------------------------------------- 1 | import 'package:diary_flutter/data/model/music.dart'; 2 | import 'package:diary_flutter/gen/gen_assets.dart'; 3 | import 'package:flutter/material.dart'; 4 | 5 | class CalendarJournalMusicChip extends StatelessWidget { 6 | final Music music; 7 | const CalendarJournalMusicChip({ 8 | super.key, 9 | required this.music, 10 | }); 11 | 12 | @override 13 | Widget build(BuildContext context) { 14 | return Align( 15 | alignment: Alignment.centerLeft, 16 | child: Container( 17 | width: 146, 18 | height: 29, 19 | padding: const EdgeInsets.symmetric(horizontal: 12.0), 20 | decoration: BoxDecoration( 21 | color: const Color(0xFFF6F5EC), 22 | borderRadius: BorderRadius.circular(40.0), 23 | ), 24 | child: Row( 25 | children: [ 26 | GenAssets.images.music.image(scale: 2), 27 | const SizedBox( 28 | width: 5, 29 | ), 30 | Expanded( 31 | child: Text( 32 | music.title, 33 | overflow: TextOverflow.ellipsis, 34 | ), 35 | ), 36 | ], 37 | ), 38 | ), 39 | ); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /lib/presentation/calendar/calendar_music_day.dart: -------------------------------------------------------------------------------- 1 | import 'package:cached_network_image/cached_network_image.dart'; 2 | import 'package:diary_flutter/data/repository/diary_repository.dart'; 3 | import 'package:flutter/material.dart'; 4 | 5 | class CalendarMusicDay extends StatelessWidget { 6 | final MusicDiary musicDiary; 7 | final GestureTapCallback onTap; 8 | const CalendarMusicDay({ 9 | super.key, 10 | required this.musicDiary, 11 | required this.onTap, 12 | }); 13 | 14 | @override 15 | Widget build(BuildContext context) { 16 | return GestureDetector( 17 | onTap: onTap, 18 | child: Center( 19 | child: SizedBox( 20 | width: 30, 21 | height: 30, 22 | child: ClipRRect( 23 | borderRadius: BorderRadius.circular(15.0), 24 | child: CachedNetworkImage( 25 | imageUrl: musicDiary.musicThumbnailImageUrl, 26 | fit: BoxFit.cover, 27 | placeholder: (context, url) => const CircularProgressIndicator(), 28 | errorWidget: (context, url, error) => const Icon(Icons.error), 29 | ), 30 | ), 31 | ), 32 | ), 33 | ); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /lib/presentation/calendar/calendar_screen.dart: -------------------------------------------------------------------------------- 1 | import 'package:diary_flutter/presentation/calendar/calendar_change_notifier.dart'; 2 | import 'package:diary_flutter/presentation/calendar/calendar_inherited_notifier.dart'; 3 | import 'package:diary_flutter/presentation/calendar/calendar_diary.dart'; 4 | import 'package:diary_flutter/presentation/style/gem_theme.dart'; 5 | import 'package:flutter/material.dart'; 6 | import 'package:hooks_riverpod/hooks_riverpod.dart'; 7 | 8 | class CalendarScreen extends ConsumerWidget { 9 | static const String path = '/$name'; 10 | static const String name = 'calendar'; 11 | const CalendarScreen({super.key}); 12 | 13 | @override 14 | Widget build(BuildContext context, WidgetRef ref) { 15 | final colors = GemTheme.of(ref).colors; 16 | return Scaffold( 17 | backgroundColor: colors.background, 18 | body: SafeArea( 19 | bottom: false, 20 | child: CalendarInheritedNotifier( 21 | notifier: CalendarChangeNotifier( 22 | selectedDateTime: DateTime.now(), 23 | ), 24 | child: const CalendarDiary(), 25 | ), 26 | ), 27 | ); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /lib/presentation/calendar/calendar_scroll_view.dart: -------------------------------------------------------------------------------- 1 | import 'package:diary_flutter/data/repository/diary_repository.dart'; 2 | import 'package:diary_flutter/presentation/calendar/calendar_diary_navigation_bar.dart'; 3 | import 'package:diary_flutter/presentation/calendar/calendar_journal_card.dart'; 4 | import 'package:diary_flutter/presentation/calendar/music_calendar.dart'; 5 | import 'package:flutter/cupertino.dart'; 6 | 7 | class CalendarScrollView extends StatelessWidget { 8 | final List musicDiaries; 9 | const CalendarScrollView({ 10 | super.key, 11 | required this.musicDiaries, 12 | }); 13 | 14 | @override 15 | Widget build(BuildContext context) { 16 | return CustomScrollView( 17 | slivers: [ 18 | SliverList.separated( 19 | itemCount: musicDiaries.length + 2, 20 | itemBuilder: (context, index) => switch (index) { 21 | 0 => const CalendarDiaryNavigationBar(), 22 | 1 => const MusicCalendar(), 23 | _ => CalendarJournalCard( 24 | diary: musicDiaries.elementAt(index - 2), 25 | ), 26 | }, 27 | separatorBuilder: (context, index) => const SizedBox(height: 20), 28 | ), 29 | ], 30 | ); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /lib/presentation/calendar/calendar_weekend.dart: -------------------------------------------------------------------------------- 1 | import 'package:diary_flutter/common/enums.dart'; 2 | import 'package:diary_flutter/presentation/calendar/weekday_row_builder.dart'; 3 | import 'package:diary_flutter/presentation/style/gem_text_style.dart'; 4 | import 'package:diary_flutter/presentation/style/gem_theme.dart'; 5 | import 'package:flutter/material.dart'; 6 | import 'package:hooks_riverpod/hooks_riverpod.dart'; 7 | 8 | class CalendarWeekend extends ConsumerWidget { 9 | const CalendarWeekend({super.key}); 10 | 11 | @override 12 | Widget build(BuildContext context, WidgetRef ref) { 13 | var textStyle = GemTheme.of(ref).textStyle; 14 | return WeekdayRowBuilder( 15 | itemBuilder: (context, weekday) { 16 | return SizedBox( 17 | width: 40, 18 | child: Center( 19 | child: Transform.translate( 20 | offset: const Offset(0, -6), 21 | child: Text( 22 | weekday.name, 23 | style: textStyle.button.withColor( 24 | const Color(0xFF0C0C0C).withOpacity(0.56), 25 | ), 26 | ), 27 | ), 28 | ), 29 | ); 30 | }, 31 | ); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /lib/presentation/calendar/music_calendar.dart: -------------------------------------------------------------------------------- 1 | import 'package:diary_flutter/presentation/calendar/calendar_days.dart'; 2 | import 'package:diary_flutter/presentation/calendar/calendar_header.dart'; 3 | import 'package:diary_flutter/presentation/calendar/calendar_weekend.dart'; 4 | import 'package:flutter/material.dart'; 5 | import 'package:hooks_riverpod/hooks_riverpod.dart'; 6 | 7 | class MusicCalendar extends ConsumerWidget { 8 | const MusicCalendar({super.key}); 9 | 10 | @override 11 | Widget build(BuildContext context, WidgetRef ref) { 12 | return const Padding( 13 | padding: EdgeInsets.symmetric( 14 | horizontal: 20.0, 15 | ), 16 | child: Column( 17 | children: [ 18 | CalendarHeader(), 19 | SizedBox(height: 24), 20 | CalendarWeekend(), 21 | CalendarMusicDays(), 22 | ], 23 | ), 24 | ); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /lib/presentation/calendar/weekday_row_builder.dart: -------------------------------------------------------------------------------- 1 | import 'package:diary_flutter/common/enums.dart'; 2 | import 'package:flutter/material.dart'; 3 | 4 | typedef WeekdayRowItemBuilder = Widget Function( 5 | BuildContext context, Weekday weekday); 6 | 7 | class WeekdayRowBuilder extends StatelessWidget { 8 | final WeekdayRowItemBuilder itemBuilder; 9 | const WeekdayRowBuilder({ 10 | super.key, 11 | required this.itemBuilder, 12 | }); 13 | 14 | @override 15 | Widget build(BuildContext context) { 16 | return SizedBox( 17 | width: double.infinity, 18 | height: 52, 19 | child: Row( 20 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 21 | children: [ 22 | ...Weekday.values.map( 23 | (weekday) => itemBuilder(context, weekday), 24 | ), 25 | ], 26 | ), 27 | ); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /lib/presentation/common/hero_list_back_button.dart: -------------------------------------------------------------------------------- 1 | import 'package:diary_flutter/presentation/style/gem_theme.dart'; 2 | import 'package:flutter/cupertino.dart'; 3 | import 'package:flutter/material.dart'; 4 | import 'package:hooks_riverpod/hooks_riverpod.dart'; 5 | 6 | class HeroListBackButton extends ConsumerWidget { 7 | final void Function() onBack; 8 | const HeroListBackButton({ 9 | super.key, 10 | required this.onBack, 11 | }); 12 | 13 | @override 14 | Widget build(BuildContext context, WidgetRef ref) { 15 | final colors = GemTheme.of(ref).colors; 16 | final textStyle = GemTheme.of(ref).textStyle; 17 | return Hero( 18 | tag: 'floating', 19 | child: SizedBox( 20 | width: 100, 21 | height: 36, 22 | child: ElevatedButton.icon( 23 | label: Text( 24 | 'List', 25 | style: textStyle.button.copyWith(color: colors.grayScale0), 26 | ), 27 | icon: Icon(CupertinoIcons.back, size: 18, color: colors.grayScale50), 28 | style: ElevatedButton.styleFrom( 29 | overlayColor: Colors.transparent, 30 | foregroundColor: colors.grayScale80, 31 | elevation: 0, 32 | shadowColor: Colors.transparent, 33 | shape: RoundedRectangleBorder( 34 | borderRadius: BorderRadius.circular(32), 35 | ), 36 | ), 37 | onPressed: onBack, 38 | ), 39 | ), 40 | ); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /lib/presentation/common/home_under_construction_tab.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class HomeUnderConstruction extends StatelessWidget { 4 | const HomeUnderConstruction({super.key}); 5 | 6 | @override 7 | Widget build(BuildContext context) { 8 | return const Center( 9 | child: Text( 10 | '🚧 Under Construction 🚧', 11 | style: TextStyle(fontSize: 20), 12 | ), 13 | ); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /lib/presentation/common/hook/use_sync_animation_value.dart: -------------------------------------------------------------------------------- 1 | import 'package:diary_flutter/presentation/common/provider/primitive_notifiers.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:flutter_hooks/flutter_hooks.dart'; 4 | import 'package:hooks_riverpod/hooks_riverpod.dart'; 5 | 6 | AnimationController useSyncAnimationController({ 7 | required AnimationController controller, 8 | required WidgetRef ref, 9 | required String key, 10 | }) { 11 | useEffect(() { 12 | void syncControllerToProvider() { 13 | ref 14 | .read(doubleNotifierProvider(key: key).notifier) 15 | .setValue(controller.value); 16 | } 17 | 18 | WidgetsBinding.instance.addPostFrameCallback((_) { 19 | controller.addListener(syncControllerToProvider); 20 | 21 | // 초기 동기화 22 | syncControllerToProvider(); 23 | }); 24 | 25 | return () { 26 | controller.removeListener(syncControllerToProvider); 27 | }; 28 | }, [controller, key]); 29 | 30 | return controller; 31 | } 32 | -------------------------------------------------------------------------------- /lib/presentation/common/hook/use_sync_scorll_value.dart: -------------------------------------------------------------------------------- 1 | import 'package:diary_flutter/presentation/common/provider/primitive_notifiers.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:flutter_hooks/flutter_hooks.dart'; 4 | import 'package:hooks_riverpod/hooks_riverpod.dart'; 5 | 6 | ScrollController useSyncScrollController({ 7 | required ScrollController controller, 8 | required WidgetRef ref, 9 | required String key, 10 | }) { 11 | useEffect(() { 12 | void syncControllerToProvider() { 13 | ref 14 | .read(doubleNotifierProvider(key: key).notifier) 15 | .setValue(controller.offset); 16 | } 17 | 18 | WidgetsBinding.instance.addPostFrameCallback((_) { 19 | controller.addListener(syncControllerToProvider); 20 | 21 | // 초기 동기화 22 | syncControllerToProvider(); 23 | }); 24 | 25 | return () { 26 | controller.removeListener(syncControllerToProvider); 27 | }; 28 | }, [controller, key]); 29 | 30 | return controller; 31 | } 32 | -------------------------------------------------------------------------------- /lib/presentation/common/hook/use_top_of_stack_callback.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_hooks/flutter_hooks.dart'; 3 | import 'package:go_router/go_router.dart'; 4 | 5 | void useTopOfStackCallback( 6 | BuildContext context, 7 | VoidCallback callback, { 8 | Duration? delay, 9 | }) { 10 | final router = GoRouter.of(context); 11 | final currentRoute = router.routerDelegate.currentConfiguration.matches.last; 12 | 13 | final isTop = useState(true); 14 | final isFirstRun = useState(true); 15 | 16 | useEffect(() { 17 | void executeCallback() { 18 | final initialdelay = delay ?? Duration.zero; 19 | Future.delayed(initialdelay, callback); 20 | isFirstRun.value = false; 21 | } 22 | 23 | void listener() { 24 | final matches = router.routerDelegate.currentConfiguration.matches; 25 | final newIsTop = matches.isNotEmpty && matches.last == currentRoute; 26 | 27 | if (newIsTop) { 28 | if (!isTop.value || isFirstRun.value) { 29 | executeCallback(); 30 | } 31 | } 32 | 33 | isTop.value = newIsTop; 34 | } 35 | 36 | // 초기 상태 확인 및 콜백 실행 37 | listener(); 38 | 39 | router.routerDelegate.addListener(listener); 40 | return () => router.routerDelegate.removeListener(listener); 41 | }, [callback, delay]); 42 | } 43 | -------------------------------------------------------------------------------- /lib/presentation/common/horizontal_swipe_detector.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | enum HorizontalSwipeDirection { rightToleft, leftToRight } 4 | 5 | class HorizontalSwipeDetector extends StatelessWidget { 6 | final WidgetBuilder builder; 7 | final void Function(HorizontalSwipeDirection direction) onSwipe; 8 | const HorizontalSwipeDetector({ 9 | super.key, 10 | required this.builder, 11 | required this.onSwipe, 12 | }); 13 | 14 | @override 15 | Widget build(BuildContext context) { 16 | return GestureDetector( 17 | onHorizontalDragEnd: (DragEndDetails details) { 18 | if (details.primaryVelocity! > 0) { 19 | onSwipe(HorizontalSwipeDirection.leftToRight); 20 | } else if (details.primaryVelocity! < 0) { 21 | onSwipe(HorizontalSwipeDirection.rightToleft); 22 | } 23 | }, 24 | child: builder(context), 25 | ); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /lib/presentation/common/popup/popup_button_param.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class PopupButtonParam { 4 | final String title; 5 | final bool isPrimary; 6 | final Function(BuildContext context) onTap; 7 | const PopupButtonParam({ 8 | required this.title, 9 | required this.isPrimary, 10 | required this.onTap, 11 | }); 12 | } 13 | -------------------------------------------------------------------------------- /lib/presentation/common/provider/primitive_notifiers.dart: -------------------------------------------------------------------------------- 1 | import 'package:riverpod_annotation/riverpod_annotation.dart'; 2 | 3 | part 'primitive_notifiers.g.dart'; 4 | 5 | @riverpod 6 | class StringNotifier extends _$StringNotifier { 7 | @override 8 | String build({required String key}) { 9 | return ''; 10 | } 11 | 12 | void setValue(String newValue) { 13 | state = newValue; 14 | } 15 | 16 | void clearValue() { 17 | state = ''; 18 | } 19 | } 20 | 21 | @riverpod 22 | class DoubleNotifier extends _$DoubleNotifier { 23 | @override 24 | double build({required String key}) { 25 | return 0.0; 26 | } 27 | 28 | void setValue(double newValue) { 29 | state = newValue; 30 | } 31 | 32 | void clearValue() { 33 | state = 0.0; 34 | } 35 | } 36 | 37 | @riverpod 38 | class IntNotifier extends _$IntNotifier { 39 | @override 40 | int build({required String key}) { 41 | return 0; 42 | } 43 | 44 | void setValue(int newValue) { 45 | state = newValue; 46 | } 47 | 48 | void clearValue() { 49 | state = 0; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /lib/presentation/common/router.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'router.dart'; 4 | 5 | // ************************************************************************** 6 | // RiverpodGenerator 7 | // ************************************************************************** 8 | 9 | String _$routerHash() => r'2d04e7ad9e888c21107290c0d90e5415bae5d8b9'; 10 | 11 | /// See also [router]. 12 | @ProviderFor(router) 13 | final routerProvider = Provider.internal( 14 | router, 15 | name: r'routerProvider', 16 | debugGetCreateSourceHash: 17 | const bool.fromEnvironment('dart.vm.product') ? null : _$routerHash, 18 | dependencies: null, 19 | allTransitiveDependencies: null, 20 | ); 21 | 22 | typedef RouterRef = ProviderRef; 23 | // ignore_for_file: type=lint 24 | // ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member 25 | -------------------------------------------------------------------------------- /lib/presentation/common/text_theme_getter_mixin.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | mixin TextThemeGetterMixin { 4 | TextTheme textTheme(BuildContext context) => Theme.of(context).textTheme; 5 | } 6 | -------------------------------------------------------------------------------- /lib/presentation/diary/archived_diary_item_content.dart: -------------------------------------------------------------------------------- 1 | import 'package:diary_flutter/data/model/diary.dart'; 2 | import 'package:flutter/material.dart'; 3 | 4 | class ArchivedDiaryItemContent extends StatelessWidget { 5 | final Diary diary; 6 | const ArchivedDiaryItemContent({super.key, required this.diary}); 7 | 8 | @override 9 | Widget build(BuildContext context) { 10 | return Text( 11 | diary.content, 12 | style: const TextStyle( 13 | color: Colors.black, 14 | fontWeight: FontWeight.w400, 15 | fontSize: 18, 16 | ), 17 | ); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /lib/presentation/diary/archived_diary_item_header.dart: -------------------------------------------------------------------------------- 1 | import 'package:diary_flutter/data/model/diary.dart'; 2 | import 'package:flutter/material.dart'; 3 | 4 | class ArchivedDiaryItemHeader extends StatelessWidget { 5 | final Diary diary; 6 | const ArchivedDiaryItemHeader({ 7 | super.key, 8 | required this.diary, 9 | }); 10 | 11 | @override 12 | Widget build(BuildContext context) { 13 | return Row( 14 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 15 | crossAxisAlignment: CrossAxisAlignment.center, 16 | children: [ 17 | Text( 18 | '${diary.dateTime.year}-${diary.dateTime.month}-${diary.dateTime.day}', 19 | style: const TextStyle( 20 | color: Colors.grey, 21 | fontWeight: FontWeight.w400, 22 | fontSize: 16, 23 | ), 24 | ), 25 | Text( 26 | diary.mood?.name ?? '', 27 | style: const TextStyle( 28 | color: Colors.blue, 29 | fontWeight: FontWeight.bold, 30 | fontSize: 30, 31 | ), 32 | ), 33 | ], 34 | ); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /lib/presentation/diary/archived_diary_item_playlist.dart: -------------------------------------------------------------------------------- 1 | import 'package:auto_size_text/auto_size_text.dart'; 2 | import 'package:flutter/material.dart'; 3 | 4 | class ArchiviedDiaryItemPlayList extends StatelessWidget { 5 | const ArchiviedDiaryItemPlayList({super.key}); 6 | 7 | @override 8 | Widget build(BuildContext context) { 9 | return Container( 10 | width: 80, 11 | height: 80, 12 | padding: const EdgeInsets.all(8), 13 | color: Colors.grey[200], 14 | child: const Column( 15 | mainAxisAlignment: MainAxisAlignment.center, 16 | crossAxisAlignment: CrossAxisAlignment.center, 17 | children: [ 18 | Icon(Icons.music_note), 19 | AutoSizeText( 20 | '사운드 오브 뮤직 OST', 21 | style: TextStyle( 22 | fontSize: 10, 23 | ), 24 | minFontSize: 5, 25 | maxLines: 2, 26 | ), 27 | ], 28 | ), 29 | ); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /lib/presentation/diary/home_diary_tab.dart: -------------------------------------------------------------------------------- 1 | import 'package:diary_flutter/domain/provider/archived_diaries.dart'; 2 | import 'package:diary_flutter/presentation/common/text_theme_getter_mixin.dart'; 3 | import 'package:diary_flutter/presentation/diary/archived_diary_item.dart'; 4 | import 'package:flutter/material.dart'; 5 | import 'package:flutter_riverpod/flutter_riverpod.dart'; 6 | 7 | class HomeDiaryTab extends ConsumerWidget with TextThemeGetterMixin { 8 | const HomeDiaryTab({super.key}); 9 | 10 | @override 11 | Widget build(BuildContext context, WidgetRef ref) { 12 | final archivedDiaries = ref.watch(archivedDiariesProvider); 13 | if (archivedDiaries.isEmpty) { 14 | return Center( 15 | child: Text( 16 | 'No archived diaries', 17 | style: textTheme(context).headlineMedium, 18 | ), 19 | ); 20 | } else { 21 | return Padding( 22 | padding: const EdgeInsets.only(left: 16, right: 16, top: 16), 23 | child: ListView.separated( 24 | itemCount: archivedDiaries.length, 25 | separatorBuilder: (context, index) { 26 | return const SizedBox( 27 | width: double.infinity, 28 | height: 16, 29 | ); 30 | }, 31 | itemBuilder: (context, index) => 32 | ArchivedDiaryItem(diary: archivedDiaries[index]), 33 | ), 34 | ); 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /lib/presentation/journal/assistant_chat_item.dart: -------------------------------------------------------------------------------- 1 | import 'package:diary_flutter/domain/provider/chats/chats_prompt_notifier.dart'; 2 | import 'package:diary_flutter/presentation/style/index.dart'; 3 | import 'package:flutter/material.dart'; 4 | import 'package:hooks_riverpod/hooks_riverpod.dart'; 5 | 6 | class AssistantChatItem extends ConsumerWidget { 7 | final String message; 8 | 9 | const AssistantChatItem({super.key, required this.message}); 10 | 11 | @override 12 | Widget build(BuildContext context, WidgetRef ref) { 13 | final colors = ref.gemColors; 14 | final textStyle = ref.gemTextStyle; 15 | // ignore: unused_local_variable 16 | final chatsPrompt = ref.watch(chatsPromptNotifierProvider); 17 | return Column( 18 | crossAxisAlignment: CrossAxisAlignment.start, 19 | children: [ 20 | const SizedBox(height: 10), 21 | Text( 22 | message, 23 | style: 24 | textStyle.paragraph.withColor(colors.grayScale60).withHeight(1.2), 25 | ), 26 | const SizedBox(height: 10), 27 | Divider( 28 | color: colors.grayScale80, 29 | thickness: 1, 30 | ), 31 | ], 32 | ); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /lib/presentation/journal/date_header_display.dart: -------------------------------------------------------------------------------- 1 | import 'package:diary_flutter/common/enums.dart'; 2 | import 'package:diary_flutter/common/extension/date_time_extension.dart'; 3 | import 'package:diary_flutter/presentation/style/index.dart'; 4 | import 'package:flutter/material.dart'; 5 | import 'package:hooks_riverpod/hooks_riverpod.dart'; 6 | 7 | class DateHeaderDisplay extends ConsumerWidget { 8 | final DateTime date; 9 | final FeedbackType feedbackType; 10 | const DateHeaderDisplay({ 11 | super.key, 12 | required this.feedbackType, 13 | required this.date, 14 | }); 15 | 16 | @override 17 | Widget build(BuildContext context, WidgetRef ref) { 18 | final colors = ref.gemColors; 19 | final textStyle = ref.gemTextStyle; 20 | return Column( 21 | crossAxisAlignment: CrossAxisAlignment.start, 22 | children: [ 23 | Text( 24 | date.monthDayOrdinal, 25 | style: textStyle.h1.withColor(colors.grayScale0), 26 | ), 27 | const SizedBox(height: 12), 28 | Text( 29 | 'From ${date.ddMyyHHmm} ${feedbackType.value.capitalize()}', 30 | style: textStyle.paragraph.withColor(colors.grayScale60), 31 | ), 32 | const SizedBox(height: 10), 33 | Divider( 34 | color: colors.grayScale80, 35 | thickness: 1, 36 | ), 37 | const SizedBox(height: 10), 38 | ], 39 | ); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /lib/presentation/journal/provider/feedback_active.dart: -------------------------------------------------------------------------------- 1 | import 'package:diary_flutter/data/provider/persistance_storage_provider.dart'; 2 | import 'package:riverpod_annotation/riverpod_annotation.dart'; 3 | 4 | part 'feedback_active.g.dart'; 5 | 6 | @riverpod 7 | class FeedbackActive extends _$FeedbackActive { 8 | static const key = 'feedback_active'; 9 | @override 10 | bool build() { 11 | final persistenceStorage = ref.watch(persistanceStorageProvider); 12 | final value = persistenceStorage.getValue(key); 13 | return value ?? true; // null이면 true 반환 14 | } 15 | 16 | void toggle() { 17 | final persistenceStorage = ref.read(persistanceStorageProvider); 18 | state = !state; 19 | persistenceStorage.setValue(key, state); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /lib/presentation/journal/provider/feedback_active.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'feedback_active.dart'; 4 | 5 | // ************************************************************************** 6 | // RiverpodGenerator 7 | // ************************************************************************** 8 | 9 | String _$feedbackActiveHash() => r'74b7c1c008f4b5633d4330503da2d1b8f4ed3d1b'; 10 | 11 | /// See also [FeedbackActive]. 12 | @ProviderFor(FeedbackActive) 13 | final feedbackActiveProvider = 14 | AutoDisposeNotifierProvider.internal( 15 | FeedbackActive.new, 16 | name: r'feedbackActiveProvider', 17 | debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') 18 | ? null 19 | : _$feedbackActiveHash, 20 | dependencies: null, 21 | allTransitiveDependencies: null, 22 | ); 23 | 24 | typedef _$FeedbackActive = AutoDisposeNotifier; 25 | // ignore_for_file: type=lint 26 | // ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member 27 | -------------------------------------------------------------------------------- /lib/presentation/journal/provider/post_text_input.dart: -------------------------------------------------------------------------------- 1 | import 'package:riverpod_annotation/riverpod_annotation.dart'; 2 | 3 | part 'post_text_input.g.dart'; 4 | 5 | @riverpod 6 | class PostTextInput extends _$PostTextInput { 7 | @override 8 | String? build() => null; 9 | 10 | Future setText(String? newText) async { 11 | state = newText; 12 | } 13 | 14 | Future clear() async { 15 | state = null; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /lib/presentation/journal/provider/post_text_input.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'post_text_input.dart'; 4 | 5 | // ************************************************************************** 6 | // RiverpodGenerator 7 | // ************************************************************************** 8 | 9 | String _$postTextInputHash() => r'15eaca98b9342ccd878607fb9ef92c37c74fb435'; 10 | 11 | /// See also [PostTextInput]. 12 | @ProviderFor(PostTextInput) 13 | final postTextInputProvider = 14 | AutoDisposeNotifierProvider.internal( 15 | PostTextInput.new, 16 | name: r'postTextInputProvider', 17 | debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') 18 | ? null 19 | : _$postTextInputHash, 20 | dependencies: null, 21 | allTransitiveDependencies: null, 22 | ); 23 | 24 | typedef _$PostTextInput = AutoDisposeNotifier; 25 | // ignore_for_file: type=lint 26 | // ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member 27 | -------------------------------------------------------------------------------- /lib/presentation/journal/user_chat_item.dart: -------------------------------------------------------------------------------- 1 | import 'package:diary_flutter/presentation/style/index.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:hooks_riverpod/hooks_riverpod.dart'; 4 | 5 | class UserChatItem extends ConsumerWidget { 6 | final String message; 7 | 8 | const UserChatItem({super.key, required this.message}); 9 | 10 | @override 11 | Widget build(BuildContext context, WidgetRef ref) { 12 | final textStyle = ref.gemTextStyle; 13 | final colors = ref.gemColors; 14 | return Column( 15 | crossAxisAlignment: CrossAxisAlignment.start, 16 | children: [ 17 | const SizedBox(height: 10), 18 | Text( 19 | message, 20 | style: textStyle.h2.withColor(colors.grayScale0), 21 | ), 22 | const SizedBox(height: 10), 23 | Divider( 24 | color: colors.grayScale80, 25 | thickness: 1, 26 | ), 27 | ], 28 | ); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /lib/presentation/main/home_generative_text_seperator.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class HomeGenerativeTextSeperator extends StatelessWidget { 4 | const HomeGenerativeTextSeperator({super.key}); 5 | 6 | @override 7 | Widget build(BuildContext context) { 8 | return Container( 9 | margin: const EdgeInsets.symmetric(vertical: 8), 10 | height: 0.5, 11 | color: Colors.grey[400], 12 | ); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /lib/presentation/main/home_main_generative_text.dart: -------------------------------------------------------------------------------- 1 | import 'package:diary_flutter/data/model/diary/generated_feedback_content.dart'; 2 | import 'package:diary_flutter/presentation/main/home_generative_text_seperator.dart'; 3 | import 'package:flutter/material.dart'; 4 | 5 | class HomeMainGenerativeText extends StatelessWidget { 6 | final GeneratedFeedbackContent feedback; 7 | const HomeMainGenerativeText(this.feedback, {super.key}); 8 | 9 | @override 10 | Widget build(BuildContext context) { 11 | return Padding( 12 | padding: const EdgeInsets.only(top: 36), 13 | child: Column( 14 | crossAxisAlignment: CrossAxisAlignment.start, 15 | children: [ 16 | SelectionArea(child: Text(feedback.comment)), 17 | const HomeGenerativeTextSeperator(), 18 | SelectionArea(child: Text('🎤 ${feedback.song.singer}')), 19 | const HomeGenerativeTextSeperator(), 20 | SelectionArea(child: Text('🎵 ${feedback.song.title}')), 21 | const HomeGenerativeTextSeperator(), 22 | SelectionArea(child: Text('😇 ${feedback.song.reason}')), 23 | const HomeGenerativeTextSeperator(), 24 | ], 25 | ), 26 | ); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /lib/presentation/main/home_main_loading.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class HomeMainLoading extends StatelessWidget { 4 | const HomeMainLoading({super.key}); 5 | 6 | @override 7 | Widget build(BuildContext context) { 8 | return const SizedBox( 9 | height: 300, 10 | child: Center( 11 | child: CircularProgressIndicator(), 12 | ), 13 | ); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /lib/presentation/main/main_carousel_sliver.dart: -------------------------------------------------------------------------------- 1 | import 'package:diary_flutter/presentation/main/main_horizontal_carousel.dart'; 2 | import 'package:flutter/material.dart'; 3 | 4 | class MainCarouselSliver extends StatelessWidget { 5 | static const double carouselHeight = 490.0 + kToolbarHeight; 6 | 7 | const MainCarouselSliver({super.key}); 8 | 9 | @override 10 | Widget build(BuildContext context) { 11 | return SliverPersistentHeader( 12 | pinned: true, 13 | delegate: _SliverAppBarDelegate( 14 | minHeight: carouselHeight, 15 | maxHeight: carouselHeight, 16 | child: const MainHorizontalCarousel( 17 | carouselHeight: carouselHeight, 18 | ), 19 | ), 20 | ); 21 | } 22 | } 23 | 24 | class _SliverAppBarDelegate extends SliverPersistentHeaderDelegate { 25 | final double minHeight; 26 | final double maxHeight; 27 | final Widget child; 28 | 29 | _SliverAppBarDelegate({ 30 | required this.minHeight, 31 | required this.maxHeight, 32 | required this.child, 33 | }); 34 | 35 | @override 36 | double get minExtent => minHeight; 37 | @override 38 | double get maxExtent => maxHeight; 39 | 40 | @override 41 | Widget build( 42 | BuildContext context, double shrinkOffset, bool overlapsContent) { 43 | return SizedBox.expand(child: child); 44 | } 45 | 46 | @override 47 | bool shouldRebuild(_SliverAppBarDelegate oldDelegate) { 48 | return maxHeight != oldDelegate.maxHeight || 49 | minHeight != oldDelegate.minHeight || 50 | child != oldDelegate.child; 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /lib/presentation/main/main_header_button.dart: -------------------------------------------------------------------------------- 1 | import 'package:diary_flutter/presentation/style/index.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:hooks_riverpod/hooks_riverpod.dart'; 4 | 5 | class MainHeaderButton extends ConsumerWidget { 6 | final String text; 7 | final double? width; 8 | final VoidCallback onTap; 9 | 10 | const MainHeaderButton({ 11 | super.key, 12 | this.width, 13 | required this.text, 14 | required this.onTap, 15 | }); 16 | 17 | @override 18 | Widget build(BuildContext context, WidgetRef ref) { 19 | final textStyle = ref.gemTextStyle; 20 | final colors = ref.gemColors; 21 | 22 | return Material( 23 | color: colors.subButtonBackground, 24 | borderRadius: BorderRadius.circular(32), 25 | child: InkWell( 26 | borderRadius: BorderRadius.circular(32), 27 | onTap: onTap, 28 | child: Padding( 29 | padding: const EdgeInsets.symmetric(horizontal: 15, vertical: 6.0), 30 | child: SizedBox( 31 | height: 31, 32 | width: width ?? 130, 33 | child: Align( 34 | alignment: Alignment.center, 35 | child: Text( 36 | text, 37 | textAlign: TextAlign.center, 38 | style: textStyle.paragraph.copyWith(color: colors.grayScale0), 39 | ), 40 | ), 41 | ), 42 | ), 43 | ), 44 | ); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /lib/presentation/my_info/my_info_option_title.dart: -------------------------------------------------------------------------------- 1 | import 'package:diary_flutter/presentation/style/gem_text_style.dart'; 2 | import 'package:diary_flutter/presentation/style/gem_theme.dart'; 3 | import 'package:flutter/material.dart'; 4 | import 'package:flutter_riverpod/flutter_riverpod.dart'; 5 | 6 | class MyInfoRowTitle extends ConsumerWidget { 7 | final String title; 8 | final bool isPrimary; 9 | const MyInfoRowTitle({ 10 | super.key, 11 | required this.title, 12 | required this.isPrimary, 13 | }); 14 | 15 | @override 16 | Widget build(BuildContext context, WidgetRef ref) { 17 | final textStyle = GemTheme.of(ref).textStyle; 18 | final colors = GemTheme.of(ref).colors; 19 | return Text( 20 | title, 21 | style: isPrimary 22 | ? textStyle.paragraph.withColor(colors.error) 23 | : textStyle.paragraph, 24 | ); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /lib/presentation/my_info/my_info_screen.dart: -------------------------------------------------------------------------------- 1 | import 'package:diary_flutter/common/enums.dart'; 2 | import 'package:diary_flutter/presentation/my_info/my_info_option.dart'; 3 | import 'package:diary_flutter/presentation/my_info/my_info_screen_header.dart'; 4 | import 'package:diary_flutter/presentation/style/gem_theme.dart'; 5 | import 'package:flutter/material.dart'; 6 | import 'package:hooks_riverpod/hooks_riverpod.dart'; 7 | 8 | class MyInfoScreen extends ConsumerWidget { 9 | static const String path = '/$name'; 10 | static const String name = 'my_info'; 11 | const MyInfoScreen({super.key}); 12 | 13 | @override 14 | Widget build(BuildContext context, WidgetRef ref) { 15 | final colors = GemTheme.of(ref).colors; 16 | return Scaffold( 17 | backgroundColor: colors.background, 18 | body: SafeArea( 19 | bottom: false, 20 | child: CustomScrollView( 21 | slivers: [ 22 | SliverList( 23 | delegate: SliverChildListDelegate( 24 | [ 25 | const MyInfoScreenHeader(), 26 | ...MyInfoOptions.values.map( 27 | (value) => MyInfoOption(option: value), 28 | ), 29 | ], 30 | ), 31 | ), 32 | ], 33 | ), 34 | ), 35 | ); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /lib/presentation/onbording/onboarding_animated_text.dart: -------------------------------------------------------------------------------- 1 | import 'package:diary_flutter/presentation/style/gem_theme.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:hooks_riverpod/hooks_riverpod.dart'; 4 | 5 | class OnboardingAnimatedText extends ConsumerWidget { 6 | final AnimationController animationController; 7 | final String content; 8 | const OnboardingAnimatedText({ 9 | super.key, 10 | required this.animationController, 11 | required this.content, 12 | }); 13 | 14 | @override 15 | Widget build(BuildContext context, WidgetRef ref) { 16 | final textStyle = GemTheme.of(ref).textStyle; 17 | return AnimatedBuilder( 18 | animation: animationController, 19 | child: Text( 20 | content, 21 | textAlign: TextAlign.left, 22 | style: textStyle.h2, 23 | ), 24 | builder: (context, child) { 25 | return Opacity( 26 | opacity: animationController.value, 27 | child: Transform.translate( 28 | offset: Offset( 29 | 0.0 + 10.0 * (1 - animationController.value), 30 | 0.0, 31 | ), 32 | child: child, 33 | ), 34 | ); 35 | }, 36 | ); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /lib/presentation/onbording/onbording_dot_indicator.dart: -------------------------------------------------------------------------------- 1 | import 'package:diary_flutter/presentation/style/gem_theme.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:flutter_riverpod/flutter_riverpod.dart'; 4 | 5 | class OnbordingDotIndicator extends ConsumerWidget { 6 | final int currentIndex; 7 | final int indicatorCount; 8 | const OnbordingDotIndicator({ 9 | super.key, 10 | required this.currentIndex, 11 | required this.indicatorCount, 12 | }); 13 | 14 | @override 15 | Widget build(BuildContext context, WidgetRef ref) { 16 | final colors = GemTheme.of(ref).colors; 17 | return SizedBox( 18 | height: 10, 19 | child: ListView.separated( 20 | scrollDirection: Axis.horizontal, 21 | itemBuilder: (context, index) => Container( 22 | width: 10.0, 23 | height: 10.0, 24 | decoration: BoxDecoration( 25 | shape: BoxShape.circle, 26 | color: 27 | index == currentIndex ? colors.primary50 : colors.grayScale60, 28 | ), 29 | ), 30 | separatorBuilder: (context, index) => const SizedBox(width: 9.0), 31 | itemCount: indicatorCount, 32 | ), 33 | ); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /lib/presentation/onbording/onbording_screen.dart: -------------------------------------------------------------------------------- 1 | import 'package:diary_flutter/presentation/onbording/onboarding_contents.dart'; 2 | import 'package:diary_flutter/presentation/style/gem_theme.dart'; 3 | import 'package:flutter/material.dart'; 4 | import 'package:flutter_riverpod/flutter_riverpod.dart'; 5 | import 'package:go_router/go_router.dart'; 6 | 7 | class OnboardingScreen extends ConsumerWidget { 8 | static String get path => '/onboarding'; 9 | const OnboardingScreen({super.key}); 10 | 11 | factory OnboardingScreen.from(GoRouterState state) { 12 | final index = int.tryParse(state.pathParameters['index'] ?? ''); 13 | if (index is int) { 14 | return const OnboardingScreen(); 15 | } else { 16 | throw Exception('index path param is not valid'); 17 | } 18 | } 19 | 20 | @override 21 | Widget build(BuildContext context, WidgetRef ref) { 22 | final colors = GemTheme.of(ref).colors; 23 | return Scaffold( 24 | backgroundColor: colors.background, 25 | body: const OnboardingContents(), 26 | ); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /lib/presentation/onbording/onbording_title.dart: -------------------------------------------------------------------------------- 1 | import 'package:diary_flutter/presentation/style/gem_theme.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:hooks_riverpod/hooks_riverpod.dart'; 4 | 5 | class OnbordingTitle extends ConsumerWidget { 6 | const OnbordingTitle({super.key}); 7 | 8 | @override 9 | Widget build(BuildContext context, WidgetRef ref) { 10 | final textStyle = GemTheme.of(ref).textStyle; 11 | return SafeArea( 12 | child: Padding( 13 | padding: const EdgeInsets.only(left: 16, top: 92), 14 | child: Text( 15 | 'Record\nYour Day', 16 | style: textStyle.h1, 17 | ), 18 | ), 19 | ); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /lib/presentation/settings/setting_app_bar.dart: -------------------------------------------------------------------------------- 1 | import 'package:diary_flutter/gen/gen_assets.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:flutter_riverpod/flutter_riverpod.dart'; 4 | import 'package:go_router/go_router.dart'; 5 | 6 | class SettingAppBar extends ConsumerWidget { 7 | const SettingAppBar({super.key}); 8 | 9 | @override 10 | Widget build(BuildContext context, WidgetRef ref) { 11 | return Padding( 12 | padding: const EdgeInsets.symmetric(vertical: 16.0), 13 | child: Align( 14 | alignment: Alignment.bottomCenter, 15 | child: Row( 16 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 17 | children: [ 18 | Material( 19 | color: Colors.transparent, 20 | child: InkWell( 21 | onTap: () => context.pop(), 22 | child: SizedBox( 23 | width: 24, 24 | height: 24, 25 | child: GenAssets.images.backButton.image(scale: 2), 26 | ), 27 | ), 28 | ), 29 | ], 30 | ), 31 | ), 32 | ); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /lib/presentation/style/gem_theme.dart: -------------------------------------------------------------------------------- 1 | import 'package:diary_flutter/presentation/style/gem_colors.dart'; 2 | import 'package:diary_flutter/presentation/style/gem_text_style.dart'; 3 | import 'package:diary_flutter/presentation/style/gem_theme_notifier_provider.dart'; 4 | import 'package:flutter_riverpod/flutter_riverpod.dart'; 5 | 6 | class GemTheme { 7 | final GemColors colors; 8 | final GemTextStyle textStyle; 9 | 10 | const GemTheme({required this.colors, required this.textStyle}); 11 | 12 | factory GemTheme.of(WidgetRef ref) { 13 | return ref.watch(gemThemeNotifierProvider); 14 | } 15 | 16 | factory GemTheme.light() { 17 | return GemTheme( 18 | colors: GemColors.light(), 19 | textStyle: const GemTextStyle(), 20 | ); 21 | } 22 | 23 | factory GemTheme.dark() { 24 | return GemTheme( 25 | colors: GemColors.dark(), 26 | textStyle: const GemTextStyle(), 27 | ); 28 | } 29 | 30 | GemTheme copyWith({GemColors? colors, GemTextStyle? textStyle}) { 31 | return GemTheme( 32 | colors: colors ?? this.colors, 33 | textStyle: textStyle ?? this.textStyle, 34 | ); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /lib/presentation/style/gem_theme_extension.dart: -------------------------------------------------------------------------------- 1 | import 'package:diary_flutter/presentation/style/index.dart'; 2 | import 'package:flutter_riverpod/flutter_riverpod.dart'; 3 | 4 | extension GemThemeExtension on WidgetRef { 5 | GemTheme get gemTheme => GemTheme.of(this); 6 | GemColors get gemColors => gemTheme.colors; 7 | GemTextStyle get gemTextStyle => gemTheme.textStyle; 8 | } 9 | -------------------------------------------------------------------------------- /lib/presentation/style/gem_theme_inherited.dart: -------------------------------------------------------------------------------- 1 | import 'package:diary_flutter/presentation/style/gem_theme.dart'; 2 | import 'package:flutter/material.dart'; 3 | 4 | class GemThemeInherited extends InheritedWidget { 5 | final GemTheme theme; 6 | 7 | const GemThemeInherited({ 8 | super.key, 9 | required this.theme, 10 | required super.child, 11 | }); 12 | 13 | static GemThemeInherited of(BuildContext context) { 14 | final GemThemeInherited? result = 15 | context.dependOnInheritedWidgetOfExactType(); 16 | assert(result != null, 'No GemThemeInherited found in context'); 17 | return result!; 18 | } 19 | 20 | @override 21 | bool updateShouldNotify(GemThemeInherited oldWidget) { 22 | return theme != oldWidget.theme; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /lib/presentation/style/index.dart: -------------------------------------------------------------------------------- 1 | export 'gem_theme.dart'; 2 | export 'gem_theme_extension.dart'; 3 | export 'gem_colors.dart'; 4 | export 'gem_text_style.dart'; 5 | export 'enums.dart'; 6 | -------------------------------------------------------------------------------- /lib/presentation/utils/hooks/use_init_max_scroll_extent.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_hooks/flutter_hooks.dart'; 3 | 4 | void useInitMaxScrollExtent({ 5 | required ScrollController scrollController, 6 | }) { 7 | useEffect(() { 8 | WidgetsBinding.instance.addPostFrameCallback((_) { 9 | scrollController.jumpTo(scrollController.position.maxScrollExtent); 10 | }); 11 | return null; 12 | }, []); 13 | } 14 | -------------------------------------------------------------------------------- /lib/presentation/utils/hooks/use_is_text_editing_controller_empty.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_hooks/flutter_hooks.dart'; 3 | 4 | bool useIsTextEditingControllerEmpty(TextEditingController textEditController) { 5 | final isEmpty = useState(textEditController.text.isEmpty); 6 | useEffect(() { 7 | listener() => isEmpty.value = textEditController.text.isEmpty; 8 | textEditController.addListener(listener); 9 | return () => textEditController.removeListener(listener); 10 | }, []); 11 | return isEmpty.value; 12 | } 13 | -------------------------------------------------------------------------------- /lib/presentation/utils/hooks/use_scroll_animate_to_bottom.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_hooks/flutter_hooks.dart'; 3 | 4 | void useScrollAnimateToBottom({ 5 | required ScrollController scrollController, 6 | required T scrollTriggerValue, 7 | }) { 8 | useEffect(() { 9 | WidgetsBinding.instance.addPostFrameCallback((_) { 10 | scrollController.animateTo( 11 | scrollController.position.maxScrollExtent, 12 | duration: const Duration(milliseconds: 200), 13 | curve: Curves.easeOut, 14 | ); 15 | }); 16 | return null; 17 | }, [scrollTriggerValue]); 18 | } 19 | -------------------------------------------------------------------------------- /lib/presentation/write/home_write_tab.dart: -------------------------------------------------------------------------------- 1 | import 'package:diary_flutter/presentation/common/text_theme_getter_mixin.dart'; 2 | import 'package:diary_flutter/presentation/write/diary_editor.dart'; 3 | import 'package:diary_flutter/presentation/write/mood_items.dart'; 4 | import 'package:diary_flutter/presentation/write/music_items.dart'; 5 | import 'package:flutter/material.dart'; 6 | 7 | class HomeWriteTab extends StatelessWidget with TextThemeGetterMixin { 8 | const HomeWriteTab({super.key}); 9 | 10 | @override 11 | Widget build(BuildContext context) { 12 | return SingleChildScrollView( 13 | child: Padding( 14 | padding: const EdgeInsets.all(16.0), 15 | child: Column( 16 | crossAxisAlignment: CrossAxisAlignment.start, 17 | children: [ 18 | const SizedBox(height: 16), 19 | Text('🎵 Music Diary', style: textTheme(context).headlineMedium), 20 | const SizedBox(height: 16), 21 | const DiaryEditor(), 22 | const SizedBox(height: 32), 23 | Text( 24 | 'How are you feeling today?', 25 | style: textTheme(context).headlineSmall, 26 | ), 27 | const SizedBox(height: 16), 28 | const MoodItems(), 29 | const SizedBox(height: 32), 30 | Text('Your Mood Playlist', style: textTheme(context).headlineSmall), 31 | const SizedBox(height: 16), 32 | const MusicItems(), 33 | ], 34 | ), 35 | ), 36 | ); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /lib/presentation/write/music_items.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class MusicItem extends StatelessWidget { 4 | const MusicItem({super.key}); 5 | 6 | @override 7 | Widget build(BuildContext context) { 8 | return Container( 9 | color: Colors.grey[300], 10 | child: const Column( 11 | mainAxisAlignment: MainAxisAlignment.center, 12 | children: [ 13 | Icon(Icons.music_note), 14 | Text('Song Title'), 15 | Text('Artist Name'), 16 | ], 17 | ), 18 | ); 19 | } 20 | } 21 | 22 | class MusicItems extends StatelessWidget { 23 | const MusicItems({super.key}); 24 | 25 | @override 26 | Widget build(BuildContext context) { 27 | return GridView.count( 28 | crossAxisCount: 2, 29 | shrinkWrap: true, 30 | mainAxisSpacing: 16, 31 | crossAxisSpacing: 16, 32 | childAspectRatio: 2, 33 | children: const [ 34 | MusicItem(), 35 | MusicItem(), 36 | MusicItem(), 37 | MusicItem(), 38 | ], 39 | ); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /linux/.gitignore: -------------------------------------------------------------------------------- 1 | flutter/ephemeral 2 | -------------------------------------------------------------------------------- /linux/flutter/generated_plugin_registrant.cc: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | // clang-format off 6 | 7 | #include "generated_plugin_registrant.h" 8 | 9 | #include 10 | 11 | void fl_register_plugins(FlPluginRegistry* registry) { 12 | g_autoptr(FlPluginRegistrar) url_launcher_linux_registrar = 13 | fl_plugin_registry_get_registrar_for_plugin(registry, "UrlLauncherPlugin"); 14 | url_launcher_plugin_register_with_registrar(url_launcher_linux_registrar); 15 | } 16 | -------------------------------------------------------------------------------- /linux/flutter/generated_plugin_registrant.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | // clang-format off 6 | 7 | #ifndef GENERATED_PLUGIN_REGISTRANT_ 8 | #define GENERATED_PLUGIN_REGISTRANT_ 9 | 10 | #include 11 | 12 | // Registers Flutter plugins. 13 | void fl_register_plugins(FlPluginRegistry* registry); 14 | 15 | #endif // GENERATED_PLUGIN_REGISTRANT_ 16 | -------------------------------------------------------------------------------- /linux/flutter/generated_plugins.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Generated file, do not edit. 3 | # 4 | 5 | list(APPEND FLUTTER_PLUGIN_LIST 6 | url_launcher_linux 7 | ) 8 | 9 | list(APPEND FLUTTER_FFI_PLUGIN_LIST 10 | ) 11 | 12 | set(PLUGIN_BUNDLED_LIBRARIES) 13 | 14 | foreach(plugin ${FLUTTER_PLUGIN_LIST}) 15 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/linux plugins/${plugin}) 16 | target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) 17 | list(APPEND PLUGIN_BUNDLED_LIBRARIES $) 18 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) 19 | endforeach(plugin) 20 | 21 | foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) 22 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/linux plugins/${ffi_plugin}) 23 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) 24 | endforeach(ffi_plugin) 25 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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/.gitignore: -------------------------------------------------------------------------------- 1 | # Flutter-related 2 | **/Flutter/ephemeral/ 3 | **/Pods/ 4 | 5 | # Xcode-related 6 | **/dgph 7 | **/xcuserdata/ 8 | -------------------------------------------------------------------------------- /macos/Flutter/Flutter-Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" 2 | #include "ephemeral/Flutter-Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /macos/Flutter/Flutter-Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" 2 | #include "ephemeral/Flutter-Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /macos/Flutter/GeneratedPluginRegistrant.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | import FlutterMacOS 6 | import Foundation 7 | 8 | import firebase_auth 9 | import firebase_core 10 | import google_sign_in_ios 11 | import path_provider_foundation 12 | import shared_preferences_foundation 13 | import sqflite 14 | import url_launcher_macos 15 | 16 | func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { 17 | FLTFirebaseAuthPlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseAuthPlugin")) 18 | FLTFirebaseCorePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseCorePlugin")) 19 | FLTGoogleSignInPlugin.register(with: registry.registrar(forPlugin: "FLTGoogleSignInPlugin")) 20 | PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin")) 21 | SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin")) 22 | SqflitePlugin.register(with: registry.registrar(forPlugin: "SqflitePlugin")) 23 | UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin")) 24 | } 25 | -------------------------------------------------------------------------------- /macos/Podfile: -------------------------------------------------------------------------------- 1 | platform :osx, '10.14' 2 | 3 | # CocoaPods analytics sends network stats synchronously affecting flutter build latency. 4 | ENV['COCOAPODS_DISABLE_STATS'] = 'true' 5 | 6 | project 'Runner', { 7 | 'Debug' => :debug, 8 | 'Profile' => :release, 9 | 'Release' => :release, 10 | } 11 | 12 | def flutter_root 13 | generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'ephemeral', 'Flutter-Generated.xcconfig'), __FILE__) 14 | unless File.exist?(generated_xcode_build_settings_path) 15 | raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure \"flutter pub get\" is executed first" 16 | end 17 | 18 | File.foreach(generated_xcode_build_settings_path) do |line| 19 | matches = line.match(/FLUTTER_ROOT\=(.*)/) 20 | return matches[1].strip if matches 21 | end 22 | raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Flutter-Generated.xcconfig, then run \"flutter pub get\"" 23 | end 24 | 25 | require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) 26 | 27 | flutter_macos_podfile_setup 28 | 29 | target 'Runner' do 30 | use_frameworks! 31 | use_modular_headers! 32 | 33 | flutter_install_all_macos_pods File.dirname(File.realpath(__FILE__)) 34 | target 'RunnerTests' do 35 | inherit! :search_paths 36 | end 37 | end 38 | 39 | post_install do |installer| 40 | installer.pods_project.targets.each do |target| 41 | flutter_additional_macos_build_settings(target) 42 | end 43 | end 44 | -------------------------------------------------------------------------------- /macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /macos/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /macos/Runner/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import Cocoa 2 | import FlutterMacOS 3 | 4 | @main 5 | class AppDelegate: FlutterAppDelegate { 6 | override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { 7 | return true 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geminiApiDevKorea/diary_flutter/0efc31f81fa2a49e9599b6e6bcb7df6c3b64e334/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geminiApiDevKorea/diary_flutter/0efc31f81fa2a49e9599b6e6bcb7df6c3b64e334/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geminiApiDevKorea/diary_flutter/0efc31f81fa2a49e9599b6e6bcb7df6c3b64e334/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geminiApiDevKorea/diary_flutter/0efc31f81fa2a49e9599b6e6bcb7df6c3b64e334/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geminiApiDevKorea/diary_flutter/0efc31f81fa2a49e9599b6e6bcb7df6c3b64e334/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geminiApiDevKorea/diary_flutter/0efc31f81fa2a49e9599b6e6bcb7df6c3b64e334/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geminiApiDevKorea/diary_flutter/0efc31f81fa2a49e9599b6e6bcb7df6c3b64e334/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png -------------------------------------------------------------------------------- /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 = diary_flutter 9 | 10 | // The application's bundle identifier 11 | PRODUCT_BUNDLE_IDENTIFIER = com.gem.diaryFlutter 12 | 13 | // The copyright displayed in application information 14 | PRODUCT_COPYRIGHT = Copyright © 2024 com.gem. All rights reserved. 15 | -------------------------------------------------------------------------------- /macos/Runner/Configs/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "../../Flutter/Flutter-Debug.xcconfig" 2 | #include "Warnings.xcconfig" 3 | -------------------------------------------------------------------------------- /macos/Runner/Configs/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "../../Flutter/Flutter-Release.xcconfig" 2 | #include "Warnings.xcconfig" 3 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /macos/Runner/MainFlutterWindow.swift: -------------------------------------------------------------------------------- 1 | import Cocoa 2 | import FlutterMacOS 3 | 4 | class MainFlutterWindow: NSWindow { 5 | override func awakeFromNib() { 6 | let flutterViewController = FlutterViewController() 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 | -------------------------------------------------------------------------------- /macos/Runner/Release.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.app-sandbox 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /macos/RunnerTests/RunnerTests.swift: -------------------------------------------------------------------------------- 1 | import Cocoa 2 | import FlutterMacOS 3 | import XCTest 4 | 5 | class RunnerTests: XCTestCase { 6 | 7 | func testExample() { 8 | // If you add code to the Runner application, consider adding tests here. 9 | // See https://developer.apple.com/documentation/xctest for more information about using XCTest. 10 | } 11 | 12 | } 13 | -------------------------------------------------------------------------------- /package_rename_config.yaml: -------------------------------------------------------------------------------- 1 | # dart run package_rename 2 | package_rename_config: 3 | android: 4 | app_name: Muse Diary 5 | package_name: com.gem.diary_flutter 6 | 7 | ios: 8 | app_name: Muse Diary 9 | bundle_name: Muse Diary 10 | package_name: com.gem.diaryFlutter 11 | 12 | # linux: 13 | # app_name: Muse Diary 14 | # package_name: gem.musediary.app 15 | # exe_name: muse_diary 16 | 17 | # macos: 18 | # app_name: Muse Diary 19 | # package_name: gem.musediary.app 20 | # copyright_notice: Copyright © 2023 Muse Diary. All rights reserved. 21 | 22 | # web: 23 | # app_name: Muse Diary 24 | # description: A diary app with music regemmendations 25 | 26 | # windows: 27 | # app_name: Muse Diary 28 | # organization: Muse Diary 29 | # copyright_notice: Copyright © 2023 Muse Diary. All rights reserved. 30 | # exe_name: muse_diary 31 | -------------------------------------------------------------------------------- /test/widget_test.dart: -------------------------------------------------------------------------------- 1 | // This is a basic Flutter widget test. 2 | // 3 | // To perform an interaction with a widget in your test, use the WidgetTester 4 | // utility in the flutter_test package. For example, you can send tap and scroll 5 | // gestures. You can also use WidgetTester to find child widgets in the widget 6 | // tree, read text, and verify that the values of widget properties are correct. 7 | 8 | void main() {} 9 | -------------------------------------------------------------------------------- /web/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geminiApiDevKorea/diary_flutter/0efc31f81fa2a49e9599b6e6bcb7df6c3b64e334/web/favicon.png -------------------------------------------------------------------------------- /web/icons/Icon-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geminiApiDevKorea/diary_flutter/0efc31f81fa2a49e9599b6e6bcb7df6c3b64e334/web/icons/Icon-192.png -------------------------------------------------------------------------------- /web/icons/Icon-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geminiApiDevKorea/diary_flutter/0efc31f81fa2a49e9599b6e6bcb7df6c3b64e334/web/icons/Icon-512.png -------------------------------------------------------------------------------- /web/icons/Icon-maskable-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geminiApiDevKorea/diary_flutter/0efc31f81fa2a49e9599b6e6bcb7df6c3b64e334/web/icons/Icon-maskable-192.png -------------------------------------------------------------------------------- /web/icons/Icon-maskable-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geminiApiDevKorea/diary_flutter/0efc31f81fa2a49e9599b6e6bcb7df6c3b64e334/web/icons/Icon-maskable-512.png -------------------------------------------------------------------------------- /web/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "diary_flutter", 3 | "short_name": "diary_flutter", 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/.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 | -------------------------------------------------------------------------------- /windows/flutter/generated_plugin_registrant.cc: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | // clang-format off 6 | 7 | #include "generated_plugin_registrant.h" 8 | 9 | #include 10 | #include 11 | #include 12 | 13 | void RegisterPlugins(flutter::PluginRegistry* registry) { 14 | FirebaseAuthPluginCApiRegisterWithRegistrar( 15 | registry->GetRegistrarForPlugin("FirebaseAuthPluginCApi")); 16 | FirebaseCorePluginCApiRegisterWithRegistrar( 17 | registry->GetRegistrarForPlugin("FirebaseCorePluginCApi")); 18 | UrlLauncherWindowsRegisterWithRegistrar( 19 | registry->GetRegistrarForPlugin("UrlLauncherWindows")); 20 | } 21 | -------------------------------------------------------------------------------- /windows/flutter/generated_plugin_registrant.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | // clang-format off 6 | 7 | #ifndef GENERATED_PLUGIN_REGISTRANT_ 8 | #define GENERATED_PLUGIN_REGISTRANT_ 9 | 10 | #include 11 | 12 | // Registers Flutter plugins. 13 | void RegisterPlugins(flutter::PluginRegistry* registry); 14 | 15 | #endif // GENERATED_PLUGIN_REGISTRANT_ 16 | -------------------------------------------------------------------------------- /windows/flutter/generated_plugins.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Generated file, do not edit. 3 | # 4 | 5 | list(APPEND FLUTTER_PLUGIN_LIST 6 | firebase_auth 7 | firebase_core 8 | url_launcher_windows 9 | ) 10 | 11 | list(APPEND FLUTTER_FFI_PLUGIN_LIST 12 | ) 13 | 14 | set(PLUGIN_BUNDLED_LIBRARIES) 15 | 16 | foreach(plugin ${FLUTTER_PLUGIN_LIST}) 17 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/windows plugins/${plugin}) 18 | target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) 19 | list(APPEND PLUGIN_BUNDLED_LIBRARIES $) 20 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) 21 | endforeach(plugin) 22 | 23 | foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) 24 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/windows plugins/${ffi_plugin}) 25 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) 26 | endforeach(ffi_plugin) 27 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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"diary_flutter", 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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /windows/runner/resources/app_icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geminiApiDevKorea/diary_flutter/0efc31f81fa2a49e9599b6e6bcb7df6c3b64e334/windows/runner/resources/app_icon.ico -------------------------------------------------------------------------------- /windows/runner/runner.exe.manifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PerMonitorV2 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /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 | --------------------------------------------------------------------------------