├── .github ├── ISSUE_TEMPLATE │ ├── bug_report.md │ └── feature_request.md └── PULL_REQUEST_TEMPLATE │ └── pull_request.md ├── .gitignore ├── .metadata ├── .vscode └── settings.json ├── LICENSE ├── README.md ├── analysis_options.yaml ├── android ├── .gitignore ├── app │ ├── build.gradle │ └── src │ │ ├── debug │ │ └── AndroidManifest.xml │ │ ├── main │ │ ├── AndroidManifest.xml │ │ ├── java │ │ │ └── io │ │ │ │ └── flutter │ │ │ │ └── app │ │ │ │ └── FlutterMultiDexApplication.java │ │ ├── kotlin │ │ │ └── com │ │ │ │ └── gpsxtreme │ │ │ │ └── notex │ │ │ │ └── notex │ │ │ │ └── MainActivity.kt │ │ └── res │ │ │ ├── drawable-hdpi-v11 │ │ │ └── ic_stat_logo.png │ │ │ ├── drawable-hdpi │ │ │ └── ic_stat_logo.png │ │ │ ├── drawable-mdpi-v11 │ │ │ └── ic_stat_logo.png │ │ │ ├── drawable-mdpi │ │ │ └── ic_stat_logo.png │ │ │ ├── drawable-v21 │ │ │ └── launch_background.xml │ │ │ ├── drawable-xhdpi-v11 │ │ │ └── ic_stat_logo.png │ │ │ ├── drawable-xhdpi │ │ │ └── ic_stat_logo.png │ │ │ ├── drawable-xxhdpi-v11 │ │ │ └── ic_stat_logo.png │ │ │ ├── drawable-xxhdpi │ │ │ └── ic_stat_logo.png │ │ │ ├── drawable-xxxhdpi │ │ │ └── ic_stat_logo.png │ │ │ ├── drawable │ │ │ ├── app_icon.png │ │ │ └── launch_background.xml │ │ │ ├── mipmap-anydpi-v26 │ │ │ └── ic_launcher.xml │ │ │ ├── mipmap-hdpi │ │ │ ├── ic_launcher.png │ │ │ ├── ic_launcher_background.png │ │ │ ├── ic_launcher_foreground.png │ │ │ └── ic_launcher_monochrome.png │ │ │ ├── mipmap-mdpi │ │ │ ├── ic_launcher.png │ │ │ ├── ic_launcher_background.png │ │ │ ├── ic_launcher_foreground.png │ │ │ └── ic_launcher_monochrome.png │ │ │ ├── mipmap-xhdpi │ │ │ ├── ic_launcher.png │ │ │ ├── ic_launcher_background.png │ │ │ ├── ic_launcher_foreground.png │ │ │ └── ic_launcher_monochrome.png │ │ │ ├── mipmap-xxhdpi │ │ │ ├── ic_launcher.png │ │ │ ├── ic_launcher_background.png │ │ │ ├── ic_launcher_foreground.png │ │ │ └── ic_launcher_monochrome.png │ │ │ ├── mipmap-xxxhdpi │ │ │ ├── ic_launcher.png │ │ │ ├── ic_launcher_background.png │ │ │ ├── ic_launcher_foreground.png │ │ │ └── ic_launcher_monochrome.png │ │ │ ├── values-night │ │ │ └── styles.xml │ │ │ └── values │ │ │ └── styles.xml │ │ └── profile │ │ └── AndroidManifest.xml ├── build.gradle ├── gradle.properties ├── gradle │ └── wrapper │ │ └── gradle-wrapper.properties └── settings.gradle ├── assets └── svg │ ├── add_icon.svg │ ├── app_logo.svg │ ├── app_logo_v2.svg │ ├── delete_icon.svg │ ├── delete_icon_light.svg │ ├── hide_icon.svg │ ├── incognito.svg │ ├── login_page_bg_decor.svg │ ├── magnify-glass.svg │ ├── notes_icon.svg │ ├── register_background_decoration.svg │ └── todo_icon.svg ├── ios ├── .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 │ │ │ ├── AppIcon-20@2x.png │ │ │ ├── AppIcon-20@2x~ipad.png │ │ │ ├── AppIcon-20@3x.png │ │ │ ├── AppIcon-20~ipad.png │ │ │ ├── AppIcon-29.png │ │ │ ├── AppIcon-29@2x.png │ │ │ ├── AppIcon-29@2x~ipad.png │ │ │ ├── AppIcon-29@3x.png │ │ │ ├── AppIcon-29~ipad.png │ │ │ ├── AppIcon-40@2x.png │ │ │ ├── AppIcon-40@2x~ipad.png │ │ │ ├── AppIcon-40@3x.png │ │ │ ├── AppIcon-40~ipad.png │ │ │ ├── AppIcon-60@2x~car.png │ │ │ ├── AppIcon-60@3x~car.png │ │ │ ├── AppIcon-83.5@2x~ipad.png │ │ │ ├── AppIcon@2x.png │ │ │ ├── AppIcon@2x~ipad.png │ │ │ ├── AppIcon@3x.png │ │ │ ├── AppIcon~ios-marketing.png │ │ │ ├── AppIcon~ipad.png │ │ │ └── Contents.json │ │ ├── Contents.json │ │ └── logo.imageset │ │ │ ├── Contents.json │ │ │ └── logo.png │ ├── Base.lproj │ │ ├── LaunchScreen.storyboard │ │ └── Main.storyboard │ ├── Info.plist │ ├── Runner-Bridging-Header.h │ └── Runner.entitlements └── RunnerTests │ └── RunnerTests.swift ├── lib ├── app.dart ├── core │ ├── config │ │ └── api_routes.dart │ ├── entities │ │ ├── note_data_entity.dart │ │ ├── todo_data_entity.dart │ │ └── token_data_entity.dart │ └── repositories │ │ ├── auth_repository.dart │ │ ├── jwt_decoder_repository.dart │ │ ├── local_database_repository.dart │ │ ├── notes_repository.dart │ │ ├── shared_preferences_repository.dart │ │ ├── todos_repository.dart │ │ ├── user_repository.dart │ │ └── util_repository.dart ├── data │ ├── datasources │ │ ├── settngs_data.dart │ │ └── user_data.dart │ ├── models │ │ ├── add_note_response_model.dart │ │ ├── add_todo_response_model.dart │ │ ├── generic_server_response.dart │ │ ├── get_notes_response_model.dart │ │ ├── get_todos_response_model.dart │ │ ├── login_response_model.dart │ │ ├── note_model.dart │ │ ├── register_response_model.dart │ │ ├── todo_model.dart │ │ ├── token_data_model.dart │ │ ├── updatable_user_data_model.dart │ │ ├── update_user_data_reponse_model.dart │ │ └── user_model.dart │ └── repositories │ │ ├── entitiy_to_json_repository.dart │ │ └── model_to_entity_repository.dart ├── external │ └── simpleMarkdown │ │ ├── emoji_parser.dart │ │ ├── markdown_toolbar.dart │ │ ├── modal_input_url.dart │ │ ├── modal_select_emoji.dart │ │ ├── toolbar.dart │ │ └── toolbar_item.dart ├── main.dart ├── presentation │ ├── animations │ │ └── fade_in_animation.dart │ ├── blocs │ │ ├── create_user_profile │ │ │ ├── create_user_profile_bloc.dart │ │ │ ├── create_user_profile_event.dart │ │ │ └── create_user_profile_state.dart │ │ ├── home │ │ │ ├── home_bloc.dart │ │ │ ├── home_event.dart │ │ │ └── home_state.dart │ │ ├── login │ │ │ ├── login_bloc.dart │ │ │ ├── login_event.dart │ │ │ └── login_state.dart │ │ ├── notes │ │ │ ├── notes_bloc.dart │ │ │ ├── notes_event.dart │ │ │ └── notes_state.dart │ │ ├── register │ │ │ ├── register_bloc.dart │ │ │ ├── register_event.dart │ │ │ └── register_state.dart │ │ ├── settings │ │ │ ├── settings_bloc.dart │ │ │ ├── settings_event.dart │ │ │ └── settings_state.dart │ │ ├── splash │ │ │ ├── splash_bloc.dart │ │ │ ├── splash_event.dart │ │ │ └── splash_state.dart │ │ ├── todos │ │ │ ├── todos_bloc.dart │ │ │ ├── todos_event.dart │ │ │ └── todos_state.dart │ │ └── user │ │ │ ├── user_bloc.dart │ │ │ ├── user_event.dart │ │ │ └── user_state.dart │ ├── pages │ │ ├── create_user_profile.dart │ │ ├── home.dart │ │ ├── login.dart │ │ ├── notes.dart │ │ ├── password_reset.dart │ │ ├── profile.dart │ │ ├── register.dart │ │ ├── settings.dart │ │ ├── splash.dart │ │ ├── todos.dart │ │ └── view_note.dart │ ├── physics │ │ └── custom_scroll_physics.dart │ ├── styles │ │ ├── app_colors.dart │ │ ├── app_styles.dart │ │ ├── app_text.dart │ │ ├── size_config.dart │ │ └── theme_data.dart │ └── widgets │ │ ├── add_todo_dialog_box.dart │ │ ├── common_widgets.dart │ │ ├── custom_image_builder.dart │ │ ├── fit_width_box.dart │ │ ├── note_tile.dart │ │ └── todo_tile.dart ├── router │ ├── app_route_config.dart │ ├── app_route_constants.dart │ └── router_transition_factory.dart └── services │ └── notification.dart ├── linux ├── .gitignore ├── CMakeLists.txt ├── flutter │ └── CMakeLists.txt ├── main.cc ├── my_application.cc └── my_application.h ├── macos ├── .gitignore ├── Flutter │ ├── Flutter-Debug.xcconfig │ └── Flutter-Release.xcconfig ├── 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 ├── pubspec.lock ├── 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 └── 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 /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: "[BUG]" 5 | labels: bug 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is. 12 | 13 | **To Reproduce** 14 | Steps to reproduce the behavior: 15 | 1. Go to '...' 16 | 2. Click on '....' 17 | 3. Scroll down to '....' 18 | 4. See error 19 | 20 | **Expected behavior** 21 | A clear and concise description of what you expected to happen. 22 | 23 | **Screenshots** 24 | If applicable, add screenshots to help explain your problem. 25 | 26 | **Smartphone (please complete the following information):** 27 | - Device: [e.g. iPhone6] 28 | - OS: [e.g. iOS8.1] 29 | - Version [e.g. 22] 30 | 31 | **Additional context** 32 | Add any other context about the problem here. 33 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature Request 3 | about: "For feature requests. Please search for existing issues first. Also see CONTRIBUTING." 4 | 5 | --- 6 | 7 | **Please Describe The Problem To Be Solved** 8 | (Replace This Text: Please present a concise description of the problem to be addressed by this feature request. Please be clear what parts of the problem are considered to be in-scope and out-of-scope.) 9 | 10 | **(Optional): Suggest A Solution** 11 | (Replace This Text: A concise description of your preferred solution. Things to address include: 12 | * Details of the technical implementation 13 | * Tradeoffs made in design decisions 14 | * Caveats and considerations for the future 15 | 16 | If there are multiple solutions, please present each one separately. Save comparisons for the very end.) -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE/pull_request.md: -------------------------------------------------------------------------------- 1 | Hi @GPSxtreme, 2 | 3 | Please thoroughly review this Pull Request! 4 | 5 | Here is the issue related to this PR: (Must repalce this with the issue number) 6 | 7 | I understand Pull Requests without having a corresponding issue will be automatically rejected. 8 | 9 | (Replace This Text: Include a description of the PR) 10 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | migrate_working_dir/ 12 | .env 13 | # IntelliJ related 14 | *.iml 15 | *.ipr 16 | *.iws 17 | .idea/ 18 | 19 | # The .vscode folder contains launch configuration and tasks you configure in 20 | # VS Code which you may wish to be included in version control, so this line 21 | # is commented out by default. 22 | #.vscode/ 23 | 24 | # Flutter/Dart/Pub related 25 | **/doc/api/ 26 | **/ios/Flutter/.last_build_id 27 | .dart_tool/ 28 | .flutter-plugins 29 | .flutter-plugins-dependencies 30 | .packages 31 | .pub-cache/ 32 | .pub/ 33 | /build/ 34 | 35 | # Symbolication related 36 | app.*.symbols 37 | 38 | # Obfuscation related 39 | app.*.map.json 40 | 41 | # Android Studio will place build artifacts here 42 | /android/app/debug 43 | /android/app/profile 44 | /android/app/release 45 | 46 | 47 | # Visual Studio Code related 48 | .classpath 49 | .project 50 | .settings/ 51 | .vscode/* 52 | 53 | # Flutter repo-specific 54 | /bin/cache/ 55 | /bin/internal/bootstrap.bat 56 | /bin/internal/bootstrap.sh 57 | /bin/mingit/ 58 | /dev/benchmarks/mega_gallery/ 59 | /dev/bots/.recipe_deps 60 | /dev/bots/android_tools/ 61 | /dev/devicelab/ABresults*.json 62 | /dev/docs/doc/ 63 | /dev/docs/api_docs.zip 64 | /dev/docs/flutter.docs.zip 65 | /dev/docs/lib/ 66 | /dev/docs/pubspec.yaml 67 | /dev/integration_tests/**/xcuserdata 68 | /dev/integration_tests/**/Pods 69 | /packages/flutter/coverage/ 70 | version 71 | analysis_benchmark.json 72 | 73 | # packages file containing multi-root paths 74 | .packages.generated 75 | 76 | # Flutter/Dart/Pub related 77 | **/generated_plugin_registrant.dart 78 | .pub-preload-cache/ 79 | build/ 80 | flutter_*.png 81 | linked_*.ds 82 | unlinked.ds 83 | unlinked_spec.ds 84 | 85 | # Android related 86 | **/android/**/gradle-wrapper.jar 87 | .gradle/ 88 | **/android/captures/ 89 | **/android/gradlew 90 | **/android/gradlew.bat 91 | **/android/local.properties 92 | **/android/**/GeneratedPluginRegistrant.java 93 | **/android/key.properties 94 | *.jks 95 | 96 | # iOS/XCode related 97 | **/ios/**/*.mode1v3 98 | **/ios/**/*.mode2v3 99 | **/ios/**/*.moved-aside 100 | **/ios/**/*.pbxuser 101 | **/ios/**/*.perspectivev3 102 | **/ios/**/*sync/ 103 | **/ios/**/.sconsign.dblite 104 | **/ios/**/.tags* 105 | **/ios/**/.vagrant/ 106 | **/ios/**/DerivedData/ 107 | **/ios/**/Icon? 108 | **/ios/**/Pods/ 109 | **/ios/**/.symlinks/ 110 | **/ios/**/profile 111 | **/ios/**/xcuserdata 112 | **/ios/.generated/ 113 | **/ios/Flutter/App.framework 114 | **/ios/Flutter/Flutter.framework 115 | **/ios/Flutter/Flutter.podspec 116 | **/ios/Flutter/Generated.xcconfig 117 | **/ios/Flutter/ephemeral 118 | **/ios/Flutter/app.flx 119 | **/ios/Flutter/app.zip 120 | **/ios/Flutter/flutter_assets/ 121 | **/ios/Flutter/flutter_export_environment.sh 122 | **/ios/ServiceDefinitions.json 123 | **/ios/Runner/GeneratedPluginRegistrant.* 124 | 125 | # macOS 126 | **/Flutter/ephemeral/ 127 | **/Pods/ 128 | **/macos/Flutter/GeneratedPluginRegistrant.swift 129 | **/macos/Flutter/ephemeral 130 | **/xcuserdata/ 131 | 132 | # Windows 133 | **/windows/flutter/generated_plugin_registrant.cc 134 | **/windows/flutter/generated_plugin_registrant.h 135 | **/windows/flutter/generated_plugins.cmake 136 | 137 | # Linux 138 | **/linux/flutter/generated_plugin_registrant.cc 139 | **/linux/flutter/generated_plugin_registrant.h 140 | **/linux/flutter/generated_plugins.cmake 141 | 142 | # Coverage 143 | coverage/ 144 | 145 | 146 | # Exceptions to above rules. 147 | !**/ios/**/default.mode1v3 148 | !**/ios/**/default.mode2v3 149 | !**/ios/**/default.pbxuser 150 | !**/ios/**/default.perspectivev3 151 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages 152 | !/dev/ci/**/Gemfile.lock 153 | !.vscode/settings.json -------------------------------------------------------------------------------- /.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled. 5 | 6 | version: 7 | revision: 796c8ef79279f9c774545b3771238c3098dbefab 8 | channel: stable 9 | 10 | project_type: app 11 | 12 | # Tracks metadata for the flutter migrate command 13 | migration: 14 | platforms: 15 | - platform: root 16 | create_revision: 796c8ef79279f9c774545b3771238c3098dbefab 17 | base_revision: 796c8ef79279f9c774545b3771238c3098dbefab 18 | - platform: android 19 | create_revision: 796c8ef79279f9c774545b3771238c3098dbefab 20 | base_revision: 796c8ef79279f9c774545b3771238c3098dbefab 21 | - platform: ios 22 | create_revision: 796c8ef79279f9c774545b3771238c3098dbefab 23 | base_revision: 796c8ef79279f9c774545b3771238c3098dbefab 24 | - platform: linux 25 | create_revision: 796c8ef79279f9c774545b3771238c3098dbefab 26 | base_revision: 796c8ef79279f9c774545b3771238c3098dbefab 27 | - platform: macos 28 | create_revision: 796c8ef79279f9c774545b3771238c3098dbefab 29 | base_revision: 796c8ef79279f9c774545b3771238c3098dbefab 30 | - platform: web 31 | create_revision: 796c8ef79279f9c774545b3771238c3098dbefab 32 | base_revision: 796c8ef79279f9c774545b3771238c3098dbefab 33 | - platform: windows 34 | create_revision: 796c8ef79279f9c774545b3771238c3098dbefab 35 | base_revision: 796c8ef79279f9c774545b3771238c3098dbefab 36 | 37 | # User provided section 38 | 39 | # List of Local paths (relative to this file) that should be 40 | # ignored by the migrate tool. 41 | # 42 | # Files that are not part of the templates will be ignored by default. 43 | unmanaged_files: 44 | - 'lib/main.dart' 45 | - 'ios/Runner.xcodeproj/project.pbxproj' 46 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "cSpell.words": [ 3 | "Blockquote" 4 | ] 5 | } -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 Notex 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Notex ✨ 2 | Cloud notes and tasks app. Never lose a note or miss a task. Stay organized. 3 | 4 | [Available on Google play store!](https://play.google.com/store/apps/details?id=com.gpsxtreme.notex.notex) 5 | 6 | 7 | ![notex_banner_resized](https://github.com/user-attachments/assets/18112c22-3d2c-4047-a051-b075c5d5ae9e) 8 | 9 | ## Table of Contents 10 | 1. [About](#about) 11 | 2. [Getting Started](#getting-started) 12 | - [Prerequisites](#prerequisites) 13 | - [Cloning](#cloning) 14 | - [Setup](#setup) 15 | 3. [Usage](#usage) 16 | 4. [Contributing](#contributing) 17 | 5. [License](#license) 18 | 19 | 20 | ## About 21 | 22 | Notex is a user-friendly notes and task app that lets users store their notes and tasks directly in the cloud ☁️. With Notex, you'll never forget to complete your tasks and you'll never lose your important notes. Notex is a completely open-source app built with Flutter and available on GitHub, welcoming contributions from the community.The backend node js rest api is also available on my [github](https://github.com/GPSxtreme/nodejs-mongodb-api) 23 | 24 | 25 | ## Getting Started 26 | 27 | These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. 28 | 29 | ### Prerequisites 30 | 31 | - Make sure you have Flutter installed on your local machine. For more instructions on how to install flutter, look [here](https://flutter.dev/docs/get-started/install). 32 | 33 | ### Cloning 34 | 35 | 1. Fork the repository from GitHub: [Notex-flutter on GitHub](https://github.com/GPSxtreme/notex-flutter) 36 | 37 | 2. Clone your forked repository onto your local machine: 38 | ``` 39 | git clone https://github.com/YOUR_USERNAME/notex-flutter.git 40 | ``` 41 | 42 | ### Setup 43 | 44 | 1. Enter the project directory: 45 | ``` 46 | cd notex 47 | ``` 48 | 49 | 2. Install the dependencies: 50 | ``` 51 | flutter pub get 52 | ``` 53 | 54 | ## Usage 55 | 56 | 1. Run the application on your emulator or physical device: 57 | ``` 58 | flutter run 59 | ``` 60 | 61 | ## Contributing 62 | 63 | Contributions are welcomed! Please feel free to fork the repository, make your changes, and submit pull requests. 64 | 65 | ## License 66 | 67 | This project is open-source, available under the MIT License. See [LICENSE.md](LICENSE) for more details. 68 | 69 | -------------------------------------------------------------------------------- /analysis_options.yaml: -------------------------------------------------------------------------------- 1 | # This file configures the analyzer, which statically analyzes Dart code to 2 | # check for errors, warnings, and lints. 3 | # 4 | # The issues identified by the analyzer are surfaced in the UI of Dart-enabled 5 | # IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be 6 | # invoked from the command line by running `flutter analyze`. 7 | 8 | # The following line activates a set of recommended lints for Flutter apps, 9 | # packages, and plugins designed to encourage good coding practices. 10 | include: package:flutter_lints/flutter.yaml 11 | 12 | linter: 13 | # The lint rules applied to this project can be customized in the 14 | # section below to disable rules from the `package:flutter_lints/flutter.yaml` 15 | # included above or to enable additional rules. A list of all available lints 16 | # and their documentation is published at 17 | # https://dart-lang.github.io/linter/lints/index.html. 18 | # 19 | # Instead of disabling a lint rule for the entire project in the 20 | # section below, it can also be suppressed for a single line of code 21 | # or a specific dart file by using the `// ignore: name_of_lint` and 22 | # `// ignore_for_file: name_of_lint` syntax on the line or in the file 23 | # producing the lint. 24 | rules: 25 | # avoid_print: false # Uncomment to disable the `avoid_print` rule 26 | # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule 27 | 28 | # Additional information about this file can be found at 29 | # https://dart.dev/guides/language/analysis-options 30 | -------------------------------------------------------------------------------- /android/.gitignore: -------------------------------------------------------------------------------- 1 | gradle-wrapper.jar 2 | /.gradle 3 | /captures/ 4 | /gradlew 5 | /gradlew.bat 6 | /local.properties 7 | GeneratedPluginRegistrant.java 8 | 9 | # Remember to never publicly share your keystore. 10 | # See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app 11 | key.properties 12 | **/*.keystore 13 | **/*.jks 14 | -------------------------------------------------------------------------------- /android/app/build.gradle: -------------------------------------------------------------------------------- 1 | def localProperties = new Properties() 2 | def localPropertiesFile = rootProject.file('local.properties') 3 | if (localPropertiesFile.exists()) { 4 | localPropertiesFile.withReader('UTF-8') { reader -> 5 | localProperties.load(reader) 6 | } 7 | } 8 | 9 | def flutterRoot = localProperties.getProperty('flutter.sdk') 10 | if (flutterRoot == null) { 11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") 12 | } 13 | 14 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode') 15 | if (flutterVersionCode == null) { 16 | flutterVersionCode = '1' 17 | } 18 | 19 | def flutterVersionName = localProperties.getProperty('flutter.versionName') 20 | if (flutterVersionName == null) { 21 | flutterVersionName = '1.0' 22 | } 23 | 24 | apply plugin: 'com.android.application' 25 | apply plugin: 'kotlin-android' 26 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" 27 | 28 | def keystoreProperties = new Properties() 29 | def keystorePropertiesFile = rootProject.file('key.properties') 30 | if (keystorePropertiesFile.exists()) { 31 | keystoreProperties.load(new FileInputStream(keystorePropertiesFile)) 32 | } 33 | 34 | android { 35 | namespace "com.gpsxtreme.notex.notex" 36 | compileSdkVersion flutter.compileSdkVersion 37 | ndkVersion flutter.ndkVersion 38 | 39 | compileOptions { 40 | sourceCompatibility JavaVersion.VERSION_1_8 41 | targetCompatibility JavaVersion.VERSION_1_8 42 | } 43 | 44 | kotlinOptions { 45 | jvmTarget = '1.8' 46 | } 47 | 48 | sourceSets { 49 | main.java.srcDirs += 'src/main/kotlin' 50 | } 51 | 52 | defaultConfig { 53 | applicationId "com.gpsxtreme.notex.notex" 54 | // You can update the following values to match your application needs. 55 | // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration. 56 | minSdkVersion 24 57 | targetSdkVersion 34 58 | versionCode flutterVersionCode.toInteger() 59 | versionName flutterVersionName 60 | multiDexEnabled true 61 | } 62 | 63 | signingConfigs { 64 | release { 65 | keyAlias keystoreProperties['keyAlias'] 66 | keyPassword keystoreProperties['keyPassword'] 67 | storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null 68 | storePassword keystoreProperties['storePassword'] 69 | } 70 | } 71 | buildTypes { 72 | release { 73 | signingConfig signingConfigs.debug 74 | signingConfig signingConfigs.release 75 | shrinkResources false // preserves notification icon 76 | } 77 | } 78 | 79 | } 80 | 81 | flutter { 82 | source '../..' 83 | } 84 | 85 | dependencies { 86 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 87 | implementation 'androidx.multidex:multidex:2.0.1' 88 | } 89 | -------------------------------------------------------------------------------- /android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 24 | 32 | 36 | 40 | 41 | 42 | 43 | 44 | 45 | 47 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /android/app/src/main/java/io/flutter/app/FlutterMultiDexApplication.java: -------------------------------------------------------------------------------- 1 | // Generated file. 2 | // 3 | // If you wish to remove Flutter's multidex support, delete this entire file. 4 | // 5 | // Modifications to this file should be done in a copy under a different name 6 | // as this file may be regenerated. 7 | 8 | package io.flutter.app; 9 | 10 | import android.app.Application; 11 | import android.content.Context; 12 | import androidx.annotation.CallSuper; 13 | import androidx.multidex.MultiDex; 14 | 15 | /** 16 | * Extension of {@link android.app.Application}, adding multidex support. 17 | */ 18 | public class FlutterMultiDexApplication extends Application { 19 | @Override 20 | @CallSuper 21 | protected void attachBaseContext(Context base) { 22 | super.attachBaseContext(base); 23 | MultiDex.install(this); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /android/app/src/main/kotlin/com/gpsxtreme/notex/notex/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.gpsxtreme.notex.notex 2 | 3 | import io.flutter.embedding.android.FlutterFragmentActivity 4 | 5 | class MainActivity: FlutterFragmentActivity() { 6 | } 7 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-hdpi-v11/ic_stat_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPSxtreme/notex-flutter/0a53d20f9804d097e04fc8b45366dd69c824d81a/android/app/src/main/res/drawable-hdpi-v11/ic_stat_logo.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-hdpi/ic_stat_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPSxtreme/notex-flutter/0a53d20f9804d097e04fc8b45366dd69c824d81a/android/app/src/main/res/drawable-hdpi/ic_stat_logo.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-mdpi-v11/ic_stat_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPSxtreme/notex-flutter/0a53d20f9804d097e04fc8b45366dd69c824d81a/android/app/src/main/res/drawable-mdpi-v11/ic_stat_logo.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-mdpi/ic_stat_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPSxtreme/notex-flutter/0a53d20f9804d097e04fc8b45366dd69c824d81a/android/app/src/main/res/drawable-mdpi/ic_stat_logo.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-v21/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 11 | 12 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-xhdpi-v11/ic_stat_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPSxtreme/notex-flutter/0a53d20f9804d097e04fc8b45366dd69c824d81a/android/app/src/main/res/drawable-xhdpi-v11/ic_stat_logo.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-xhdpi/ic_stat_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPSxtreme/notex-flutter/0a53d20f9804d097e04fc8b45366dd69c824d81a/android/app/src/main/res/drawable-xhdpi/ic_stat_logo.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-xxhdpi-v11/ic_stat_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPSxtreme/notex-flutter/0a53d20f9804d097e04fc8b45366dd69c824d81a/android/app/src/main/res/drawable-xxhdpi-v11/ic_stat_logo.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-xxhdpi/ic_stat_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPSxtreme/notex-flutter/0a53d20f9804d097e04fc8b45366dd69c824d81a/android/app/src/main/res/drawable-xxhdpi/ic_stat_logo.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-xxxhdpi/ic_stat_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPSxtreme/notex-flutter/0a53d20f9804d097e04fc8b45366dd69c824d81a/android/app/src/main/res/drawable-xxxhdpi/ic_stat_logo.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/app_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPSxtreme/notex-flutter/0a53d20f9804d097e04fc8b45366dd69c824d81a/android/app/src/main/res/drawable/app_icon.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPSxtreme/notex-flutter/0a53d20f9804d097e04fc8b45366dd69c824d81a/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher_background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPSxtreme/notex-flutter/0a53d20f9804d097e04fc8b45366dd69c824d81a/android/app/src/main/res/mipmap-hdpi/ic_launcher_background.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPSxtreme/notex-flutter/0a53d20f9804d097e04fc8b45366dd69c824d81a/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher_monochrome.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPSxtreme/notex-flutter/0a53d20f9804d097e04fc8b45366dd69c824d81a/android/app/src/main/res/mipmap-hdpi/ic_launcher_monochrome.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPSxtreme/notex-flutter/0a53d20f9804d097e04fc8b45366dd69c824d81a/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher_background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPSxtreme/notex-flutter/0a53d20f9804d097e04fc8b45366dd69c824d81a/android/app/src/main/res/mipmap-mdpi/ic_launcher_background.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPSxtreme/notex-flutter/0a53d20f9804d097e04fc8b45366dd69c824d81a/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher_monochrome.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPSxtreme/notex-flutter/0a53d20f9804d097e04fc8b45366dd69c824d81a/android/app/src/main/res/mipmap-mdpi/ic_launcher_monochrome.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPSxtreme/notex-flutter/0a53d20f9804d097e04fc8b45366dd69c824d81a/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher_background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPSxtreme/notex-flutter/0a53d20f9804d097e04fc8b45366dd69c824d81a/android/app/src/main/res/mipmap-xhdpi/ic_launcher_background.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPSxtreme/notex-flutter/0a53d20f9804d097e04fc8b45366dd69c824d81a/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher_monochrome.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPSxtreme/notex-flutter/0a53d20f9804d097e04fc8b45366dd69c824d81a/android/app/src/main/res/mipmap-xhdpi/ic_launcher_monochrome.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPSxtreme/notex-flutter/0a53d20f9804d097e04fc8b45366dd69c824d81a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher_background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPSxtreme/notex-flutter/0a53d20f9804d097e04fc8b45366dd69c824d81a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_background.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPSxtreme/notex-flutter/0a53d20f9804d097e04fc8b45366dd69c824d81a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher_monochrome.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPSxtreme/notex-flutter/0a53d20f9804d097e04fc8b45366dd69c824d81a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_monochrome.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPSxtreme/notex-flutter/0a53d20f9804d097e04fc8b45366dd69c824d81a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPSxtreme/notex-flutter/0a53d20f9804d097e04fc8b45366dd69c824d81a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_background.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPSxtreme/notex-flutter/0a53d20f9804d097e04fc8b45366dd69c824d81a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_monochrome.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPSxtreme/notex-flutter/0a53d20f9804d097e04fc8b45366dd69c824d81a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_monochrome.png -------------------------------------------------------------------------------- /android/app/src/main/res/values-night/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /android/app/src/profile/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext.kotlin_version = '1.9.10' 3 | repositories { 4 | google() 5 | mavenCentral() 6 | } 7 | 8 | dependencies { 9 | classpath 'com.android.tools.build:gradle:7.4.2' 10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 11 | } 12 | } 13 | 14 | allprojects { 15 | repositories { 16 | google() 17 | mavenCentral() 18 | } 19 | } 20 | 21 | rootProject.buildDir = '../build' 22 | subprojects { 23 | project.buildDir = "${rootProject.buildDir}/${project.name}" 24 | } 25 | subprojects { 26 | project.evaluationDependsOn(':app') 27 | } 28 | 29 | tasks.register("clean", Delete) { 30 | delete rootProject.buildDir 31 | } 32 | -------------------------------------------------------------------------------- /android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 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.5-all.zip 6 | -------------------------------------------------------------------------------- /android/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | 3 | def localPropertiesFile = new File(rootProject.projectDir, "local.properties") 4 | def properties = new Properties() 5 | 6 | assert localPropertiesFile.exists() 7 | localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } 8 | 9 | def flutterSdkPath = properties.getProperty("flutter.sdk") 10 | assert flutterSdkPath != null, "flutter.sdk not set in local.properties" 11 | apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle" 12 | -------------------------------------------------------------------------------- /assets/svg/add_icon.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /assets/svg/app_logo_v2.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /assets/svg/delete_icon.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /assets/svg/delete_icon_light.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /assets/svg/hide_icon.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /assets/svg/incognito.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /assets/svg/magnify-glass.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /assets/svg/register_background_decoration.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /assets/svg/todo_icon.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /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, '12.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.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 37 | 38 | 39 | 40 | 43 | 49 | 50 | 51 | 52 | 53 | 63 | 65 | 71 | 72 | 73 | 74 | 80 | 82 | 88 | 89 | 90 | 91 | 93 | 94 | 97 | 98 | 99 | -------------------------------------------------------------------------------- /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 UIKit 2 | import Flutter 3 | // This is required for calling FlutterLocalNotificationsPlugin.setPluginRegistrantCallback method. 4 | import flutter_local_notifications 5 | 6 | @main 7 | @objc class AppDelegate: FlutterAppDelegate { 8 | override func application( 9 | _ application: UIApplication, 10 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? 11 | ) -> Bool { 12 | // This is required to make any communication available in the action isolate. 13 | FlutterLocalNotificationsPlugin.setPluginRegistrantCallback { (registry) in 14 | GeneratedPluginRegistrant.register(with: registry) 15 | } 16 | GeneratedPluginRegistrant.register(with: self) 17 | return super.application(application, didFinishLaunchingWithOptions: launchOptions) 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/AppIcon-20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPSxtreme/notex-flutter/0a53d20f9804d097e04fc8b45366dd69c824d81a/ios/Runner/Assets.xcassets/AppIcon.appiconset/AppIcon-20@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/AppIcon-20@2x~ipad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPSxtreme/notex-flutter/0a53d20f9804d097e04fc8b45366dd69c824d81a/ios/Runner/Assets.xcassets/AppIcon.appiconset/AppIcon-20@2x~ipad.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/AppIcon-20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPSxtreme/notex-flutter/0a53d20f9804d097e04fc8b45366dd69c824d81a/ios/Runner/Assets.xcassets/AppIcon.appiconset/AppIcon-20@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/AppIcon-20~ipad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPSxtreme/notex-flutter/0a53d20f9804d097e04fc8b45366dd69c824d81a/ios/Runner/Assets.xcassets/AppIcon.appiconset/AppIcon-20~ipad.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/AppIcon-29.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPSxtreme/notex-flutter/0a53d20f9804d097e04fc8b45366dd69c824d81a/ios/Runner/Assets.xcassets/AppIcon.appiconset/AppIcon-29.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/AppIcon-29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPSxtreme/notex-flutter/0a53d20f9804d097e04fc8b45366dd69c824d81a/ios/Runner/Assets.xcassets/AppIcon.appiconset/AppIcon-29@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/AppIcon-29@2x~ipad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPSxtreme/notex-flutter/0a53d20f9804d097e04fc8b45366dd69c824d81a/ios/Runner/Assets.xcassets/AppIcon.appiconset/AppIcon-29@2x~ipad.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/AppIcon-29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPSxtreme/notex-flutter/0a53d20f9804d097e04fc8b45366dd69c824d81a/ios/Runner/Assets.xcassets/AppIcon.appiconset/AppIcon-29@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/AppIcon-29~ipad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPSxtreme/notex-flutter/0a53d20f9804d097e04fc8b45366dd69c824d81a/ios/Runner/Assets.xcassets/AppIcon.appiconset/AppIcon-29~ipad.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/AppIcon-40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPSxtreme/notex-flutter/0a53d20f9804d097e04fc8b45366dd69c824d81a/ios/Runner/Assets.xcassets/AppIcon.appiconset/AppIcon-40@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/AppIcon-40@2x~ipad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPSxtreme/notex-flutter/0a53d20f9804d097e04fc8b45366dd69c824d81a/ios/Runner/Assets.xcassets/AppIcon.appiconset/AppIcon-40@2x~ipad.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/AppIcon-40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPSxtreme/notex-flutter/0a53d20f9804d097e04fc8b45366dd69c824d81a/ios/Runner/Assets.xcassets/AppIcon.appiconset/AppIcon-40@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/AppIcon-40~ipad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPSxtreme/notex-flutter/0a53d20f9804d097e04fc8b45366dd69c824d81a/ios/Runner/Assets.xcassets/AppIcon.appiconset/AppIcon-40~ipad.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/AppIcon-60@2x~car.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPSxtreme/notex-flutter/0a53d20f9804d097e04fc8b45366dd69c824d81a/ios/Runner/Assets.xcassets/AppIcon.appiconset/AppIcon-60@2x~car.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/AppIcon-60@3x~car.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPSxtreme/notex-flutter/0a53d20f9804d097e04fc8b45366dd69c824d81a/ios/Runner/Assets.xcassets/AppIcon.appiconset/AppIcon-60@3x~car.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/AppIcon-83.5@2x~ipad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPSxtreme/notex-flutter/0a53d20f9804d097e04fc8b45366dd69c824d81a/ios/Runner/Assets.xcassets/AppIcon.appiconset/AppIcon-83.5@2x~ipad.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/AppIcon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPSxtreme/notex-flutter/0a53d20f9804d097e04fc8b45366dd69c824d81a/ios/Runner/Assets.xcassets/AppIcon.appiconset/AppIcon@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/AppIcon@2x~ipad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPSxtreme/notex-flutter/0a53d20f9804d097e04fc8b45366dd69c824d81a/ios/Runner/Assets.xcassets/AppIcon.appiconset/AppIcon@2x~ipad.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/AppIcon@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPSxtreme/notex-flutter/0a53d20f9804d097e04fc8b45366dd69c824d81a/ios/Runner/Assets.xcassets/AppIcon.appiconset/AppIcon@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/AppIcon~ios-marketing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPSxtreme/notex-flutter/0a53d20f9804d097e04fc8b45366dd69c824d81a/ios/Runner/Assets.xcassets/AppIcon.appiconset/AppIcon~ios-marketing.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/AppIcon~ipad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPSxtreme/notex-flutter/0a53d20f9804d097e04fc8b45366dd69c824d81a/ios/Runner/Assets.xcassets/AppIcon.appiconset/AppIcon~ipad.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images": [ 3 | { 4 | "filename": "AppIcon@2x.png", 5 | "idiom": "iphone", 6 | "scale": "2x", 7 | "size": "60x60" 8 | }, 9 | { 10 | "filename": "AppIcon@3x.png", 11 | "idiom": "iphone", 12 | "scale": "3x", 13 | "size": "60x60" 14 | }, 15 | { 16 | "filename": "AppIcon~ipad.png", 17 | "idiom": "ipad", 18 | "scale": "1x", 19 | "size": "76x76" 20 | }, 21 | { 22 | "filename": "AppIcon@2x~ipad.png", 23 | "idiom": "ipad", 24 | "scale": "2x", 25 | "size": "76x76" 26 | }, 27 | { 28 | "filename": "AppIcon-83.5@2x~ipad.png", 29 | "idiom": "ipad", 30 | "scale": "2x", 31 | "size": "83.5x83.5" 32 | }, 33 | { 34 | "filename": "AppIcon-40@2x.png", 35 | "idiom": "iphone", 36 | "scale": "2x", 37 | "size": "40x40" 38 | }, 39 | { 40 | "filename": "AppIcon-40@3x.png", 41 | "idiom": "iphone", 42 | "scale": "3x", 43 | "size": "40x40" 44 | }, 45 | { 46 | "filename": "AppIcon-40~ipad.png", 47 | "idiom": "ipad", 48 | "scale": "1x", 49 | "size": "40x40" 50 | }, 51 | { 52 | "filename": "AppIcon-40@2x~ipad.png", 53 | "idiom": "ipad", 54 | "scale": "2x", 55 | "size": "40x40" 56 | }, 57 | { 58 | "filename": "AppIcon-20@2x.png", 59 | "idiom": "iphone", 60 | "scale": "2x", 61 | "size": "20x20" 62 | }, 63 | { 64 | "filename": "AppIcon-20@3x.png", 65 | "idiom": "iphone", 66 | "scale": "3x", 67 | "size": "20x20" 68 | }, 69 | { 70 | "filename": "AppIcon-20~ipad.png", 71 | "idiom": "ipad", 72 | "scale": "1x", 73 | "size": "20x20" 74 | }, 75 | { 76 | "filename": "AppIcon-20@2x~ipad.png", 77 | "idiom": "ipad", 78 | "scale": "2x", 79 | "size": "20x20" 80 | }, 81 | { 82 | "filename": "AppIcon-29.png", 83 | "idiom": "iphone", 84 | "scale": "1x", 85 | "size": "29x29" 86 | }, 87 | { 88 | "filename": "AppIcon-29@2x.png", 89 | "idiom": "iphone", 90 | "scale": "2x", 91 | "size": "29x29" 92 | }, 93 | { 94 | "filename": "AppIcon-29@3x.png", 95 | "idiom": "iphone", 96 | "scale": "3x", 97 | "size": "29x29" 98 | }, 99 | { 100 | "filename": "AppIcon-29~ipad.png", 101 | "idiom": "ipad", 102 | "scale": "1x", 103 | "size": "29x29" 104 | }, 105 | { 106 | "filename": "AppIcon-29@2x~ipad.png", 107 | "idiom": "ipad", 108 | "scale": "2x", 109 | "size": "29x29" 110 | }, 111 | { 112 | "filename": "AppIcon-60@2x~car.png", 113 | "idiom": "car", 114 | "scale": "2x", 115 | "size": "60x60" 116 | }, 117 | { 118 | "filename": "AppIcon-60@3x~car.png", 119 | "idiom": "car", 120 | "scale": "3x", 121 | "size": "60x60" 122 | }, 123 | { 124 | "filename": "AppIcon~ios-marketing.png", 125 | "idiom": "ios-marketing", 126 | "scale": "1x", 127 | "size": "1024x1024" 128 | } 129 | ], 130 | "info": { 131 | "author": "iconkitchen", 132 | "version": 1 133 | } 134 | } -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/logo.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "logo.png", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/logo.imageset/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPSxtreme/notex-flutter/0a53d20f9804d097e04fc8b45366dd69c824d81a/ios/Runner/Assets.xcassets/logo.imageset/logo.png -------------------------------------------------------------------------------- /ios/Runner/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /ios/Runner/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /ios/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | UILaunchStoryboardName 6 | LaunchScreen 7 | NSCameraUsageDescription 8 | This app requires camera access to capture your profile photo 9 | NSPhotoLibraryUsageDescription 10 | This app requires photo library access to select your profile picture 11 | NSUserNotificationCenterUsageDescription 12 | We use notifications to remind you about upcoming movies and TV shows. 13 | NSLocalNotificationUsageDescription 14 | We use local notifications to remind you about upcoming movies and TV shows even when the app is not running. 15 | UIBackgroundModes 16 | 17 | fetch 18 | remote-notification 19 | 20 | CFBundleDevelopmentRegion 21 | $(DEVELOPMENT_LANGUAGE) 22 | CFBundleDisplayName 23 | Notex 24 | CFBundleExecutable 25 | $(EXECUTABLE_NAME) 26 | CFBundleIdentifier 27 | $(PRODUCT_BUNDLE_IDENTIFIER) 28 | ITunesSoftwareServiceIdentifier 29 | 6578461622 30 | CFBundleInfoDictionaryVersion 31 | 6.0 32 | CFBundleName 33 | Notex 34 | CFBundlePackageType 35 | APPL 36 | CFBundleShortVersionString 37 | $(FLUTTER_BUILD_NAME) 38 | CFBundleSignature 39 | ???? 40 | CFBundleVersion 41 | $(FLUTTER_BUILD_NUMBER) 42 | LSRequiresIPhoneOS 43 | 44 | UILaunchStoryboardName 45 | LaunchScreen 46 | UIMainStoryboardFile 47 | Main 48 | UISupportedInterfaceOrientations 49 | 50 | UIInterfaceOrientationPortrait 51 | UIInterfaceOrientationLandscapeLeft 52 | UIInterfaceOrientationLandscapeRight 53 | 54 | UISupportedInterfaceOrientations~ipad 55 | 56 | UIInterfaceOrientationPortrait 57 | UIInterfaceOrientationPortraitUpsideDown 58 | UIInterfaceOrientationLandscapeLeft 59 | UIInterfaceOrientationLandscapeRight 60 | 61 | UIViewControllerBasedStatusBarAppearance 62 | 63 | CADisableMinimumFrameDurationOnPhone 64 | 65 | UIApplicationSupportsIndirectInputEvents 66 | 67 | 68 | 69 | -------------------------------------------------------------------------------- /ios/Runner/Runner-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import "GeneratedPluginRegistrant.h" 2 | -------------------------------------------------------------------------------- /ios/Runner/Runner.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | aps-environment 6 | development 7 | 8 | 9 | -------------------------------------------------------------------------------- /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/app.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:notex/presentation/styles/size_config.dart'; 3 | import 'package:notex/presentation/styles/theme_data.dart'; 4 | import 'package:notex/router/app_route_config.dart'; 5 | 6 | class MyApp extends StatefulWidget { 7 | const MyApp({super.key}); 8 | 9 | @override 10 | State createState() => _MyAppState(); 11 | } 12 | 13 | class _MyAppState extends State { 14 | final router = MyAppRouter.getRouter(); 15 | @override 16 | Widget build(BuildContext context) { 17 | SizeConfig().init(context); 18 | return MaterialApp.router( 19 | darkTheme: defaultThemeData, 20 | themeMode: ThemeMode.dark, 21 | debugShowCheckedModeBanner: false, 22 | routerConfig: router, 23 | ); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /lib/core/config/api_routes.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: constant_identifier_names, non_constant_identifier_names 2 | 3 | import 'package:flutter_dotenv/flutter_dotenv.dart'; 4 | 5 | final apiEndPoint = dotenv.env["API_ENDPOINT"]; 6 | /* start of user routes */ 7 | final USER_LOGIN_ROUTE = '$apiEndPoint/user/login'; 8 | final USER_REGISTER_ROUTE = '$apiEndPoint/user/registration'; 9 | final USER_PROFILE_PICTURE_UPLOAD_ROUTE = '$apiEndPoint/data/uploadProfilePicture'; 10 | final USER_PROFILE_PICTURE_GET_ROUTE = '$apiEndPoint/data/getProfilePicture'; 11 | final USER_UPDATE_USER_DATA = '$apiEndPoint/user/updateUserData'; 12 | final USER_ACCOUNT_VERIFY_ROUTE = '$apiEndPoint/user/sendVerificationLink'; 13 | final USER_PASSWORD_RESET_ROUTE = '$apiEndPoint/user/sendPasswordResetLink'; 14 | /* end of user routes */ 15 | 16 | /* start of todo_routes */ 17 | final TODO_ADD_ROUTE = '$apiEndPoint/todo/addTodo'; 18 | final TODO_GET_ROUTE = '$apiEndPoint/todo/getTodos'; 19 | /// Required todoId in params 20 | final TODO_DELETE_ROUTE = '$apiEndPoint/todo/deleteTodo'; 21 | final TODO_UPDATE_ROUTE = '$apiEndPoint/todo/updateTodo'; 22 | /* end of todo_routes */ 23 | 24 | /*start of note routes */ 25 | final NOTE_ADD_ROUTE = '$apiEndPoint/note/addNote'; 26 | final NOTE_GET_ROUTE = '$apiEndPoint/note/getNotes'; 27 | final NOTE_UPDATE_ROUTE = '$apiEndPoint/note/updateNote'; 28 | /// Required noteId in params 29 | final NOTE_DELETE_ROUTE = '$apiEndPoint/note/deleteNote'; 30 | /*end of note routes */ 31 | -------------------------------------------------------------------------------- /lib/core/entities/note_data_entity.dart: -------------------------------------------------------------------------------- 1 | class NoteDataEntity { 2 | final String id; 3 | final String userId; 4 | final String title; 5 | final String body; 6 | final DateTime createdTime; 7 | final DateTime editedTime; 8 | final int v; 9 | final bool? isSynced; 10 | final bool isFavorite; 11 | final bool isUploaded; 12 | final bool isHidden; 13 | final bool isDeleted; 14 | final bool? deletedTime; 15 | NoteDataEntity( { 16 | required this.id, 17 | required this.userId, 18 | required this.title, 19 | required this.body, 20 | required this.createdTime, 21 | required this.editedTime, 22 | required this.v, 23 | this.isSynced, 24 | required this.isUploaded, 25 | required this.isFavorite, 26 | required this.isHidden, 27 | required this.isDeleted, 28 | this.deletedTime 29 | }); 30 | } 31 | -------------------------------------------------------------------------------- /lib/core/entities/todo_data_entity.dart: -------------------------------------------------------------------------------- 1 | class TodoDataEntity { 2 | final String id; 3 | final String userId; 4 | final String body; 5 | final bool isCompleted; 6 | final DateTime createdTime; 7 | final DateTime editedTime; 8 | final DateTime expireTime; 9 | final int v; 10 | final bool? isSynced; 11 | final bool isUploaded; 12 | 13 | TodoDataEntity({ 14 | required this.id, 15 | required this.userId, 16 | required this.body, 17 | required this.isCompleted, 18 | required this.createdTime, 19 | required this.editedTime, 20 | required this.expireTime, 21 | required this.v, 22 | this.isSynced, 23 | required this.isUploaded 24 | }); 25 | } 26 | -------------------------------------------------------------------------------- /lib/core/entities/token_data_entity.dart: -------------------------------------------------------------------------------- 1 | class TokenDataEntity { 2 | final String userId; 3 | final String name; 4 | final String email; 5 | 6 | TokenDataEntity({ 7 | required this.userId, 8 | required this.name, 9 | required this.email, 10 | }); 11 | } 12 | -------------------------------------------------------------------------------- /lib/core/repositories/jwt_decoder_repository.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/foundation.dart'; 2 | import 'package:jwt_decoder/jwt_decoder.dart'; 3 | 4 | class JwtDecoderRepository { 5 | // Method to decode the JWT token and extract user data 6 | static Map? decodeJwtToken(String token) { 7 | try { 8 | Map decodedToken = JwtDecoder.decode(token); 9 | return decodedToken; 10 | } catch (e) { 11 | if (kDebugMode) { 12 | print('Error decoding JWT token: $e'); 13 | } 14 | return null; 15 | } 16 | } 17 | // Method to verify the validity of the JWT token 18 | static bool verifyJwtToken(String token) { 19 | try { 20 | DateTime expirationDate = JwtDecoder.getExpirationDate(token); 21 | bool isExpired = DateTime.now().isAfter(expirationDate); 22 | return !isExpired; 23 | } catch (e) { 24 | if (kDebugMode) { 25 | print('Error verifying JWT token: $e'); 26 | } 27 | } 28 | return false; 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /lib/core/repositories/user_repository.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | import 'package:flutter/foundation.dart'; 3 | import 'package:http/http.dart' as http; 4 | import 'package:notex/core/repositories/auth_repository.dart'; 5 | import 'package:notex/core/repositories/shared_preferences_repository.dart'; 6 | import 'package:notex/data/models/updatable_user_data_model.dart'; 7 | import 'package:notex/data/models/update_user_data_reponse_model.dart'; 8 | import '../config/api_routes.dart'; 9 | import 'dart:io'; 10 | 11 | class UserRepository{ 12 | static Future updateUserData(UpdatableUserDataModel data)async{ 13 | final url = Uri.parse(USER_UPDATE_USER_DATA); 14 | final body = jsonEncode(data.toJson()); 15 | try{ 16 | final response = await http.post( 17 | url, 18 | headers: {'Content-Type': 'application/json', 19 | 'Authorization' : AuthRepository.userToken}, 20 | body: body, 21 | ); 22 | final UpdateUserDataResponseModel updateResponse = updateUserDataResponseModelFromJson(response.body); 23 | if(updateResponse.success){ 24 | //store token locally 25 | await SharedPreferencesRepository.saveJwtToken(updateResponse.token!); 26 | } 27 | return updateResponse; 28 | }catch(error){ 29 | return UpdateUserDataResponseModel(success: false, message: "An unexpected error occurred, $error"); 30 | } 31 | } 32 | static Future updateUserProfilePicture(File image) async{ 33 | final url = Uri.parse(USER_PROFILE_PICTURE_UPLOAD_ROUTE); 34 | final request = http.MultipartRequest('POST',url); 35 | try{ 36 | request.headers["Authorization"] = AuthRepository.userToken; 37 | final imageFile = await http.MultipartFile.fromPath('profilePicture', image.path); 38 | request.files.add(imageFile); 39 | final response = await request.send(); 40 | if(response.statusCode == 200){ 41 | return true; 42 | } else { 43 | return false; 44 | } 45 | }catch(error){ 46 | if (kDebugMode) { 47 | print(error); 48 | } 49 | return false; 50 | } 51 | } 52 | } -------------------------------------------------------------------------------- /lib/core/repositories/util_repository.dart: -------------------------------------------------------------------------------- 1 | import 'package:fluttertoast/fluttertoast.dart'; 2 | import 'package:in_app_update/in_app_update.dart'; 3 | import 'package:notex/presentation/styles/app_colors.dart'; 4 | import 'package:url_launcher/url_launcher.dart'; 5 | import 'package:url_launcher/url_launcher_string.dart'; 6 | 7 | class UtilRepository { 8 | static void toast(String msg) { 9 | Fluttertoast.cancel(); 10 | Fluttertoast.showToast( 11 | backgroundColor: AppColors.secondary, 12 | textColor: AppColors.foreground, 13 | msg: msg, 14 | toastLength: Toast.LENGTH_SHORT, 15 | gravity: ToastGravity.BOTTOM, 16 | timeInSecForIosWeb: 1, 17 | fontSize: 16.0); 18 | } 19 | 20 | /// checks for update from android play store. 21 | static Future checkForUpdate() async { 22 | try { 23 | final updateInfo = await InAppUpdate.checkForUpdate(); 24 | if (updateInfo.updateAvailability == UpdateAvailability.updateAvailable) { 25 | await InAppUpdate.performImmediateUpdate(); 26 | return true; 27 | } 28 | } catch (e) { 29 | UtilRepository.toast(e.toString()); 30 | } 31 | return false; 32 | } 33 | 34 | ///Launches the given url 35 | static Future launchLink(String url) async { 36 | try { 37 | final Uri uri = Uri.parse(url); 38 | await launchUrl(uri, mode: LaunchMode.externalApplication); 39 | } catch (e) { 40 | UtilRepository.toast(e.toString()); 41 | } 42 | } 43 | 44 | static Future launchEmail( 45 | {required List emailAddresses, 46 | String? subject, 47 | String? body}) async { 48 | final String emails = emailAddresses.join(','); 49 | String emailSubject = Uri.encodeComponent(subject ?? ""); 50 | String emailBody = Uri.encodeComponent(body ?? ""); 51 | String emailUrl = "mailto:$emails?subject=$emailSubject&body=$emailBody"; 52 | try { 53 | await launchUrlString(emailUrl); 54 | } catch (e) { 55 | UtilRepository.toast("Error redirecting to gmail."); 56 | } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /lib/data/datasources/settngs_data.dart: -------------------------------------------------------------------------------- 1 | 2 | import '../../core/repositories/shared_preferences_repository.dart'; 3 | 4 | class Settings{ 5 | late bool _isAutoSyncEnabled; 6 | late bool _isNotesOnlinePrefetchEnabled; 7 | late bool _isTodosOnlinePrefetchEnabled; 8 | late bool _isAppLockEnabled; 9 | late bool _isHiddenNotesLockEnabled; 10 | late bool _isDeletedNotesLockEnabled; 11 | late bool _isBiometricOnly; 12 | 13 | bool get isAutoSyncEnabled => _isAutoSyncEnabled; 14 | bool get isNotesOnlinePrefetchEnabled => _isNotesOnlinePrefetchEnabled; 15 | bool get isTodosOnlinePrefetchEnabled => _isTodosOnlinePrefetchEnabled; 16 | bool get isAppLockEnabled => _isAppLockEnabled; 17 | bool get isHiddenNotesLockEnabled => _isHiddenNotesLockEnabled; 18 | bool get isDeletedNotesLockEnabled => _isDeletedNotesLockEnabled; 19 | bool get isBiometricOnly => _isBiometricOnly; 20 | 21 | Future setAutoSyncEnabled (bool value) async{ 22 | _isAutoSyncEnabled = value; 23 | await SharedPreferencesRepository.setAutoSyncStatus(value); 24 | } 25 | Future setNotesOnlinePrefetch (bool value) async{ 26 | _isNotesOnlinePrefetchEnabled = value; 27 | await SharedPreferencesRepository.setNotesOnlinePrefetch(value); 28 | } 29 | Future setTodosOnlinePrefetch (bool value) async{ 30 | _isTodosOnlinePrefetchEnabled = value; 31 | await SharedPreferencesRepository.setTodosOnlinePrefetch(value); 32 | } 33 | Future setAppLockEnabled(bool value) async { 34 | _isAppLockEnabled = value; 35 | await SharedPreferencesRepository.setAppLockStatus(value); 36 | } 37 | 38 | Future setHiddenNotesLockEnabled(bool value) async { 39 | _isHiddenNotesLockEnabled = value; 40 | await SharedPreferencesRepository.setHiddenNotesLockStatus(value); 41 | } 42 | 43 | Future setDeletedNotesLockEnabled(bool value) async { 44 | _isDeletedNotesLockEnabled = value; 45 | await SharedPreferencesRepository.setDeletedNotesLockStatus(value); 46 | } 47 | 48 | Future setBiometricOnly(bool value) async { 49 | _isBiometricOnly = value; 50 | await SharedPreferencesRepository.setBiometricOnlyStatus(value); 51 | } 52 | 53 | Future init()async{ 54 | _isAutoSyncEnabled = await SharedPreferencesRepository.getAutoSyncStatus() ?? true; 55 | _isNotesOnlinePrefetchEnabled = await SharedPreferencesRepository.getNotesOnlinePrefetchStatus() ?? true; 56 | _isTodosOnlinePrefetchEnabled = await SharedPreferencesRepository.getTodosOnlinePrefetchStatus() ?? true; 57 | _isAppLockEnabled = await SharedPreferencesRepository.getAppLockStatus() ?? false; 58 | _isHiddenNotesLockEnabled = await SharedPreferencesRepository.getHiddenNotesLockStatus() ?? true; 59 | _isDeletedNotesLockEnabled = await SharedPreferencesRepository.getDeletedNotesLockStatus() ?? false; 60 | _isBiometricOnly = await SharedPreferencesRepository.getBiometricOnlyStatus() ?? false; 61 | } 62 | } -------------------------------------------------------------------------------- /lib/data/datasources/user_data.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/foundation.dart'; 2 | import 'package:notex/core/repositories/auth_repository.dart'; 3 | import 'package:notex/core/repositories/shared_preferences_repository.dart'; 4 | import 'package:notex/data/models/user_model.dart'; 5 | 6 | class User{ 7 | late UserDataModel? data; 8 | late String profilePictureCacheKey; 9 | void setData(UserDataModel newData) => data = newData; 10 | 11 | Future init()async{ 12 | try{ 13 | await AuthRepository.getUserData().then( 14 | (res){ 15 | if(res != null){ 16 | setData(res); 17 | if (kDebugMode) { 18 | print(data!.toJson()); 19 | } 20 | } 21 | } 22 | ); 23 | await SharedPreferencesRepository.getProfilePictureCacheKey().then( 24 | (key)async{ 25 | if(key == null){ 26 | profilePictureCacheKey = await SharedPreferencesRepository.generateProfilePictureCacheKey(); 27 | } else{ 28 | profilePictureCacheKey = key; 29 | } 30 | } 31 | ); 32 | }catch(error){ 33 | throw Exception(error); 34 | } 35 | } 36 | void destroy(){ 37 | data = null; 38 | } 39 | } -------------------------------------------------------------------------------- /lib/data/models/add_note_response_model.dart: -------------------------------------------------------------------------------- 1 | // To parse this JSON data, do 2 | // 3 | // final addNoteResponseModel = addNoteResponseModelFromJson(jsonString); 4 | 5 | import 'dart:convert'; 6 | 7 | AddNoteResponseModel addNoteResponseModelFromJson(String str) => AddNoteResponseModel.fromJson(json.decode(str)); 8 | 9 | String addNoteResponseModelToJson(AddNoteResponseModel data) => json.encode(data.toJson()); 10 | 11 | class AddNoteResponseModel { 12 | final bool success; 13 | final String message; 14 | final String noteId; 15 | 16 | AddNoteResponseModel({ 17 | required this.success, 18 | required this.message, 19 | required this.noteId, 20 | }); 21 | 22 | factory AddNoteResponseModel.fromJson(Map json) => AddNoteResponseModel( 23 | success: json["success"], 24 | message: json["message"], 25 | noteId: json["noteId"], 26 | ); 27 | 28 | Map toJson() => { 29 | "success": success, 30 | "message": message, 31 | "noteId": noteId, 32 | }; 33 | } 34 | -------------------------------------------------------------------------------- /lib/data/models/add_todo_response_model.dart: -------------------------------------------------------------------------------- 1 | // To parse this JSON data, do 2 | // 3 | // final addTodoResponseModel = addTodoResponseModelFromJson(jsonString); 4 | 5 | import 'dart:convert'; 6 | 7 | AddTodoResponseModel addTodoResponseModelFromJson(String str) => AddTodoResponseModel.fromJson(json.decode(str)); 8 | 9 | String addTodoResponseModelToJson(AddTodoResponseModel data) => json.encode(data.toJson()); 10 | 11 | class AddTodoResponseModel { 12 | final bool success; 13 | final String message; 14 | final String todoId; 15 | 16 | AddTodoResponseModel({ 17 | required this.success, 18 | required this.message, 19 | required this.todoId, 20 | }); 21 | 22 | factory AddTodoResponseModel.fromJson(Map json) => AddTodoResponseModel( 23 | success: json["success"], 24 | message: json["message"], 25 | todoId: json["todoId"], 26 | ); 27 | 28 | Map toJson() => { 29 | "success": success, 30 | "message": message, 31 | "todoId": todoId, 32 | }; 33 | } 34 | -------------------------------------------------------------------------------- /lib/data/models/generic_server_response.dart: -------------------------------------------------------------------------------- 1 | // To parse this JSON data, do 2 | // 3 | // final genericServerResponse = genericServerResponseFromJson(jsonString); 4 | 5 | import 'dart:convert'; 6 | 7 | GenericServerResponse genericServerResponseFromJson(String str) => GenericServerResponse.fromJson(json.decode(str)); 8 | 9 | String genericServerResponseToJson(GenericServerResponse data) => json.encode(data.toJson()); 10 | 11 | class GenericServerResponse { 12 | final bool success; 13 | final String message; 14 | 15 | GenericServerResponse({ 16 | required this.success, 17 | required this.message, 18 | }); 19 | 20 | factory GenericServerResponse.fromJson(Map json) => GenericServerResponse( 21 | success: json["success"], 22 | message: json["message"], 23 | ); 24 | 25 | Map toJson() => { 26 | "success": success, 27 | "message": message, 28 | }; 29 | } 30 | -------------------------------------------------------------------------------- /lib/data/models/get_notes_response_model.dart: -------------------------------------------------------------------------------- 1 | // To parse this JSON data, do 2 | // 3 | // final getNotesResponseModel = getNotesResponseModelFromJson(jsonString); 4 | 5 | import 'dart:convert'; 6 | 7 | import 'package:notex/data/models/note_model.dart'; 8 | 9 | GetNotesResponseModel getNotesResponseModelFromJson(String str) => GetNotesResponseModel.fromJson(json.decode(str)); 10 | 11 | String getNotesResponseModelToJson(GetNotesResponseModel data) => json.encode(data.toJson()); 12 | 13 | class GetNotesResponseModel { 14 | final bool success; 15 | final String message; 16 | final List? notes; 17 | 18 | GetNotesResponseModel({ 19 | required this.success, 20 | required this.message, 21 | this.notes, 22 | }); 23 | 24 | factory GetNotesResponseModel.fromJson(Map json) => GetNotesResponseModel( 25 | success: json["success"], 26 | message: json["message"], 27 | notes: List.from(json["notes"].map((x) => NoteModel.fromJson(x))), 28 | ); 29 | 30 | Map toJson() => { 31 | "status": success, 32 | "message": message, 33 | "todos": notes != null ? List.from(notes!.map((x) => x.toJson())) : null, 34 | }; 35 | } 36 | -------------------------------------------------------------------------------- /lib/data/models/get_todos_response_model.dart: -------------------------------------------------------------------------------- 1 | // To parse this JSON data, do 2 | // 3 | // final getTodosResponseModel = getTodosResponseModelFromJson(jsonString); 4 | 5 | import 'dart:convert'; 6 | 7 | import 'package:notex/data/models/todo_model.dart'; 8 | 9 | GetTodosResponseModel getTodosResponseModelFromJson(String str) => GetTodosResponseModel.fromJson(json.decode(str)); 10 | 11 | String getTodosResponseModelToJson(GetTodosResponseModel data) => json.encode(data.toJson()); 12 | 13 | class GetTodosResponseModel { 14 | final bool success; 15 | final String message; 16 | final List? todos; 17 | 18 | GetTodosResponseModel({ 19 | required this.success, 20 | required this.message, 21 | this.todos, 22 | }); 23 | 24 | factory GetTodosResponseModel.fromJson(Map json) => GetTodosResponseModel( 25 | success: json["success"], 26 | message: json["message"], 27 | todos: List.from(json["todos"].map((x) => TodoModel.fromJson(x))), 28 | ); 29 | 30 | Map toJson() => { 31 | "status": success, 32 | "message": message, 33 | "todos": todos != null ? List.from(todos!.map((x) => x.toJson())) : null, 34 | }; 35 | } -------------------------------------------------------------------------------- /lib/data/models/login_response_model.dart: -------------------------------------------------------------------------------- 1 | // To parse this JSON data, do 2 | // 3 | // final loginResponseModel = loginResponseModelFromJson(jsonString); 4 | 5 | import 'dart:convert'; 6 | 7 | LoginResponseModel loginResponseModelFromJson(String str) => LoginResponseModel.fromJson(json.decode(str)); 8 | 9 | String loginResponseModelToJson(LoginResponseModel data) => json.encode(data.toJson()); 10 | 11 | class LoginResponseModel { 12 | final bool success; 13 | final String message; 14 | final String? token; 15 | final String? tokenExpiresIn; 16 | 17 | LoginResponseModel({ 18 | required this.success, 19 | required this.message, 20 | this.token, 21 | this.tokenExpiresIn 22 | }); 23 | 24 | factory LoginResponseModel.fromJson(Map json) => LoginResponseModel( 25 | success: json["success"], 26 | message: json["message"], 27 | token: json["token"], 28 | tokenExpiresIn: json["tokenExpiresIn"] 29 | ); 30 | 31 | Map toJson() => { 32 | "success": success, 33 | "message": message, 34 | "token" : token, 35 | "tokenExpiresIn" : tokenExpiresIn 36 | }; 37 | } 38 | -------------------------------------------------------------------------------- /lib/data/models/register_response_model.dart: -------------------------------------------------------------------------------- 1 | // To parse this JSON data, do 2 | // 3 | // final registerResponseModel = registerResponseModelFromJson(jsonString); 4 | 5 | import 'dart:convert'; 6 | 7 | RegisterResponseModel registerResponseModelFromJson(String str) => RegisterResponseModel.fromJson(json.decode(str)); 8 | 9 | String registerResponseModelToJson(RegisterResponseModel data) => json.encode(data.toJson()); 10 | 11 | class RegisterResponseModel { 12 | final bool success; 13 | final String message; 14 | final String? token; 15 | final String? tokenExpiresIn; 16 | 17 | RegisterResponseModel({ 18 | required this.success, 19 | required this.message, 20 | this.token, 21 | this.tokenExpiresIn, 22 | }); 23 | 24 | factory RegisterResponseModel.fromJson(Map json) => RegisterResponseModel( 25 | success: json["success"], 26 | message: json["message"], 27 | token: json["token"], 28 | tokenExpiresIn: json["tokenExpiresIn"], 29 | ); 30 | 31 | Map toJson() => { 32 | "status": success, 33 | "message": message, 34 | "token": token, 35 | "tokenExpiresIn": tokenExpiresIn, 36 | }; 37 | } 38 | -------------------------------------------------------------------------------- /lib/data/models/todo_model.dart: -------------------------------------------------------------------------------- 1 | // To parse this JSON data, do 2 | // 3 | // final todoModel = todoModelFromJson(jsonString); 4 | 5 | import 'dart:convert'; 6 | 7 | TodoModel todoModelFromJson(String str) => TodoModel.fromJson(json.decode(str)); 8 | 9 | String todoModelToJson(TodoModel data) => json.encode(data.toJson()); 10 | 11 | class TodoModel { 12 | String id; 13 | final String userId; 14 | String body; 15 | dynamic isCompleted; 16 | final DateTime createdTime; 17 | DateTime editedTime; 18 | DateTime expireTime; 19 | final int v; 20 | dynamic isSynced; 21 | dynamic isUploaded; 22 | 23 | TodoModel({ 24 | required this.id, 25 | required this.userId, 26 | required this.body, 27 | required this.isCompleted, 28 | required this.createdTime, 29 | required this.editedTime, 30 | required this.expireTime, 31 | required this.v, 32 | this.isUploaded = false, 33 | this.isSynced = false, 34 | }); 35 | 36 | void updateId(String newId) => id = newId; 37 | void setIsSynced(dynamic value) => isSynced = value; 38 | void setIsUploaded(bool value) => isUploaded = value; 39 | void setEditedTime(DateTime time) => editedTime = time.toUtc(); 40 | void setIsCompleted(dynamic value) => isCompleted = value; 41 | 42 | factory TodoModel.fromJson(Map json) => TodoModel( 43 | id: json["_id"], 44 | userId: json["userId"], 45 | body: json["body"], 46 | isCompleted: json["isCompleted"], 47 | createdTime: DateTime.parse(json["createdTime"]), 48 | editedTime: DateTime.parse(json["editedTime"]), 49 | expireTime: DateTime.parse(json["expireTime"]), 50 | v: json["__v"], 51 | ); 52 | 53 | factory TodoModel.fromJsonOfLocalDb(Map json) => TodoModel( 54 | id: json["_id"], 55 | userId: json["userId"], 56 | body: json["body"], 57 | isCompleted: json["isCompleted"] == 0 ? false : true, 58 | createdTime: DateTime.parse(json["createdTime"]), 59 | editedTime: DateTime.parse(json["editedTime"]), 60 | expireTime: DateTime.parse(json["expireTime"]), 61 | v: json["__v"], 62 | isSynced: json['isSynced'] == 0 ? false : true, 63 | isUploaded: json['isUploaded'] == 0 ? false : true 64 | ); 65 | 66 | Map toJson() => { 67 | "_id": id, 68 | "userId": userId, 69 | "body": body, 70 | "isCompleted": isCompleted, 71 | "createdTime": createdTime.toIso8601String(), 72 | "editedTime": editedTime.toIso8601String(), 73 | "expireTime": expireTime.toIso8601String(), 74 | "__v": v, 75 | }; 76 | 77 | Map toJsonToServerAdd() => { 78 | "body": body, 79 | "isCompleted": isCompleted, 80 | "createdTime": createdTime.toIso8601String(), 81 | "editedTime": editedTime.toIso8601String(), 82 | "expireTime": expireTime.toIso8601String(), 83 | }; 84 | 85 | Map toJsonToServerUpdate() => { 86 | "_id": id, 87 | "body": body, 88 | "isCompleted": isCompleted, 89 | "editedTime": editedTime.toIso8601String(), 90 | "expireTime": expireTime.toIso8601String(), 91 | "__v": v, 92 | }; 93 | } 94 | -------------------------------------------------------------------------------- /lib/data/models/token_data_model.dart: -------------------------------------------------------------------------------- 1 | // To parse this JSON data, do 2 | // 3 | // final tokenDataModel = tokenDataModelFromJson(jsonString); 4 | 5 | import 'dart:convert'; 6 | 7 | TokenDataModel tokenDataModelFromJson(String str) => TokenDataModel.fromJson(json.decode(str)); 8 | 9 | String tokenDataModelToJson(TokenDataModel data) => json.encode(data.toJson()); 10 | 11 | class TokenDataModel { 12 | final String userId; 13 | final String name; 14 | final String email; 15 | 16 | TokenDataModel({ 17 | required this.userId, 18 | required this.name, 19 | required this.email, 20 | }); 21 | 22 | factory TokenDataModel.fromJson(Map json) => TokenDataModel( 23 | userId: json["userId"], 24 | name: json["name"], 25 | email: json["email"], 26 | ); 27 | 28 | Map toJson() => { 29 | "userId": userId, 30 | "name": name, 31 | "email": email, 32 | }; 33 | } 34 | -------------------------------------------------------------------------------- /lib/data/models/updatable_user_data_model.dart: -------------------------------------------------------------------------------- 1 | // To parse this JSON data, do 2 | // 3 | // final updatableUserDataModel = updatableUserDataModelFromJson(jsonString); 4 | 5 | import 'dart:convert'; 6 | 7 | UpdatableUserDataModel updatableUserDataModelFromJson(String str) => UpdatableUserDataModel.fromJson(json.decode(str)); 8 | 9 | String updatableUserDataModelToJson(UpdatableUserDataModel data) => json.encode(data.toJson()); 10 | 11 | class UpdatableUserDataModel { 12 | final String name; 13 | final String countryCode; 14 | final DateTime dob; 15 | 16 | UpdatableUserDataModel({ 17 | required this.name, 18 | required this.countryCode, 19 | required this.dob, 20 | }); 21 | 22 | factory UpdatableUserDataModel.fromJson(Map json) => UpdatableUserDataModel( 23 | name: json["name"], 24 | countryCode: json["country"], 25 | dob: DateTime.parse(json["dob"]), 26 | ); 27 | 28 | Map toJson() => { 29 | "name": name, 30 | "country": countryCode, 31 | "dob": dob.toUtc().toIso8601String(), 32 | }; 33 | } 34 | -------------------------------------------------------------------------------- /lib/data/models/update_user_data_reponse_model.dart: -------------------------------------------------------------------------------- 1 | // To parse this JSON data, do 2 | // 3 | // final updateUserDataResponseModel = updateUserDataResponseModelFromJson(jsonString); 4 | 5 | import 'dart:convert'; 6 | 7 | UpdateUserDataResponseModel updateUserDataResponseModelFromJson(String str) => UpdateUserDataResponseModel.fromJson(json.decode(str)); 8 | 9 | String updateUserDataResponseModelToJson(UpdateUserDataResponseModel data) => json.encode(data.toJson()); 10 | 11 | class UpdateUserDataResponseModel { 12 | final bool success; 13 | final String message; 14 | final String? token; 15 | 16 | UpdateUserDataResponseModel({ 17 | required this.success, 18 | required this.message, 19 | this.token, 20 | }); 21 | 22 | factory UpdateUserDataResponseModel.fromJson(Map json) => UpdateUserDataResponseModel( 23 | success: json["success"], 24 | message: json["message"], 25 | token: json["token"], 26 | ); 27 | 28 | Map toJson() => { 29 | "success": success, 30 | "message": message, 31 | "token": token, 32 | }; 33 | } 34 | -------------------------------------------------------------------------------- /lib/data/models/user_model.dart: -------------------------------------------------------------------------------- 1 | // To parse this JSON data, do 2 | // 3 | // final userDataModel = userDataModelFromJson(jsonString); 4 | 5 | import 'dart:convert'; 6 | 7 | UserDataModel userDataModelFromJson(String str) => UserDataModel.fromJson(json.decode(str)); 8 | 9 | String userDataModelToJson(UserDataModel data) => json.encode(data.toJson()); 10 | 11 | class UserDataModel { 12 | final String userId; 13 | final String email; 14 | final String name; 15 | final bool isEmailVerified; 16 | final String country; 17 | final DateTime dob; 18 | final int iat; 19 | final int exp; 20 | 21 | UserDataModel( { 22 | required this.userId, 23 | required this.email, 24 | required this.name, 25 | required this.isEmailVerified, 26 | required this.iat, 27 | required this.exp, 28 | required this.country, 29 | required this.dob 30 | }); 31 | 32 | factory UserDataModel.fromJson(Map json) => UserDataModel( 33 | userId: json["userId"], 34 | email: json["email"], 35 | name: json["name"], 36 | isEmailVerified: json["isEmailVerified"], 37 | iat: json["iat"], 38 | exp: json["exp"], 39 | country: json['country'], 40 | dob: DateTime.parse(json['dob']) 41 | ); 42 | 43 | Map toJson() => { 44 | "userId": userId, 45 | "email": email, 46 | "name": name, 47 | "isEmailVerified": isEmailVerified, 48 | "iat": iat, 49 | "exp": exp, 50 | 'country' : country, 51 | 'dob' : dob, 52 | }; 53 | } 54 | -------------------------------------------------------------------------------- /lib/data/repositories/entitiy_to_json_repository.dart: -------------------------------------------------------------------------------- 1 | 2 | import 'package:notex/core/entities/note_data_entity.dart'; 3 | import 'package:notex/core/entities/todo_data_entity.dart'; 4 | 5 | class EntityToJson { 6 | static Map noteEntityToJson(NoteDataEntity note, bool isSynced){ 7 | final noteMap = { 8 | '_id': note.id, 9 | 'userId': note.userId, 10 | 'title': note.title, 11 | 'body': note.body, 12 | 'createdTime': note.createdTime.toIso8601String(), 13 | 'editedTime': note.editedTime.toIso8601String(), 14 | '__v': note.v, 15 | 'isSynced': isSynced ? 1 : 0, 16 | 'isFavorite' : note.isFavorite ? 1 : 0, 17 | 'isUploaded' : note.isUploaded ? 1 : 0, 18 | 'isHidden' : note.isHidden ? 1 : 0, 19 | 'isDeleted' : note.isDeleted ? 1 : 0, 20 | 'deletedTime' : note.deletedTime 21 | }; 22 | return noteMap; 23 | } 24 | 25 | static Map todoEntityToJson(TodoDataEntity todo, bool isSynced){ 26 | final todoMap = { 27 | '_id': todo.id, 28 | 'userId': todo.userId, 29 | 'body': todo.body, 30 | 'isCompleted': todo.isCompleted ? 1 : 0, 31 | 'createdTime': todo.createdTime.toIso8601String(), 32 | 'editedTime': todo.editedTime.toIso8601String(), 33 | 'expireTime': todo.expireTime.toIso8601String(), 34 | '__v': todo.v, 35 | 'isSynced': isSynced ? 1 : 0, 36 | 'isUploaded' : todo.isUploaded ? 1 : 0 37 | }; 38 | return todoMap; 39 | } 40 | } -------------------------------------------------------------------------------- /lib/data/repositories/model_to_entity_repository.dart: -------------------------------------------------------------------------------- 1 | import '../../core/entities/note_data_entity.dart'; 2 | import '../../core/entities/todo_data_entity.dart'; 3 | import '../../core/entities/token_data_entity.dart'; 4 | import '../models/note_model.dart'; 5 | import '../models/todo_model.dart'; 6 | import '../models/token_data_model.dart'; 7 | 8 | class ModelToEntityRepository { 9 | static TokenDataEntity mapToTokenEntity(TokenDataModel model) { 10 | return TokenDataEntity( 11 | userId: model.userId, 12 | name: model.name, 13 | email: model.email, 14 | ); 15 | } 16 | 17 | static NoteDataEntity mapToNoteEntity( 18 | {required NoteModel model, bool? synced}) { 19 | return NoteDataEntity( 20 | id: model.id, 21 | userId: model.userId, 22 | title: model.title, 23 | body: model.body.toString(), 24 | createdTime: model.createdTime, 25 | editedTime: model.editedTime, 26 | v: model.v, 27 | isSynced: synced ?? model.isSynced, 28 | isUploaded: model.isUploaded, 29 | isFavorite: model.isFavorite, 30 | isHidden : model.isHidden, 31 | isDeleted: model.isDeleted, 32 | deletedTime: model.deletedTime 33 | ); 34 | } 35 | 36 | static TodoDataEntity mapToTodoEntity( 37 | {required TodoModel model, bool? synced}) { 38 | return TodoDataEntity( 39 | id: model.id, 40 | userId: model.userId, 41 | body: model.body, 42 | isCompleted: model.isCompleted, 43 | createdTime: model.createdTime, 44 | editedTime: model.editedTime, 45 | expireTime: model.expireTime, 46 | v: model.v, 47 | isSynced: synced ?? model.isSynced, 48 | isUploaded: model.isUploaded); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /lib/external/simpleMarkdown/modal_input_url.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:notex/external/simpleMarkdown/toolbar.dart'; 3 | import 'package:notex/presentation/styles/app_colors.dart'; 4 | import 'package:notex/presentation/styles/app_text.dart'; 5 | import 'package:notex/presentation/styles/size_config.dart'; 6 | 7 | class ModalInputUrl extends StatelessWidget { 8 | const ModalInputUrl({ 9 | super.key, 10 | required this.toolbar, 11 | required this.leftText, 12 | required this.selection, 13 | }); 14 | 15 | final Toolbar toolbar; 16 | final String leftText; 17 | final TextSelection selection; 18 | 19 | @override 20 | Widget build(BuildContext context) { 21 | return Padding( 22 | padding: 23 | EdgeInsets.fromLTRB(AppSpacing.md, 0, AppSpacing.md, AppSpacing.lg), 24 | child: Column( 25 | crossAxisAlignment: CrossAxisAlignment.start, 26 | mainAxisSize: MainAxisSize.min, 27 | children: [ 28 | Text( 29 | "Please provide valid image URL", 30 | style: AppText.textBaseMedium.copyWith(color: AppColors.foreground), 31 | ), 32 | SizedBox( 33 | height: AppSpacing.md, 34 | ), 35 | TextField( 36 | decoration: const InputDecoration( 37 | hintText: "https://example.com", 38 | ), 39 | onSubmitted: (String value) { 40 | Navigator.pop(context); 41 | 42 | /// check if the user entered an empty input 43 | if (value.isEmpty) { 44 | ScaffoldMessenger.of(context).showSnackBar( 45 | SnackBar( 46 | content: const Text( 47 | "https://example.com", 48 | style: TextStyle( 49 | color: Colors.white, 50 | ), 51 | ), 52 | backgroundColor: Colors.red.withOpacity(0.8), 53 | duration: const Duration(milliseconds: 700), 54 | ), 55 | ); 56 | } else { 57 | if (!value.contains(RegExp(r'https?:\/\/(www.)?([^\s]+)'))) { 58 | value = "http://" + value; 59 | } 60 | toolbar.action( 61 | "$leftText$value)", 62 | "", 63 | textSelection: selection, 64 | ); 65 | } 66 | }, 67 | ), 68 | ], 69 | ), 70 | ); 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /lib/external/simpleMarkdown/toolbar_item.dart: -------------------------------------------------------------------------------- 1 | import 'package:expandable/expandable.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:font_awesome_flutter/font_awesome_flutter.dart'; 4 | import 'package:notex/presentation/styles/app_colors.dart'; 5 | import 'package:notex/presentation/styles/size_config.dart'; 6 | 7 | class ToolbarItem extends StatelessWidget { 8 | const ToolbarItem({ 9 | super.key, 10 | required this.icon, 11 | this.onPressedButton, 12 | this.tooltip, 13 | this.isExpandable = false, 14 | this.items, 15 | }); 16 | 17 | final dynamic icon; 18 | final VoidCallback? onPressedButton; 19 | final String? tooltip; 20 | final bool isExpandable; 21 | final List? items; 22 | 23 | @override 24 | Widget build(BuildContext context) { 25 | return !isExpandable 26 | ? Material( 27 | type: MaterialType.transparency, 28 | child: IconButton( 29 | onPressed: onPressedButton, 30 | icon: icon is String 31 | ? Text( 32 | icon, 33 | style: const TextStyle( 34 | fontSize: 16, 35 | fontWeight: FontWeight.w900, 36 | ), 37 | ) 38 | : Icon( 39 | icon, 40 | size: 16, 41 | ), 42 | tooltip: tooltip, 43 | ), 44 | ) 45 | : ExpandableNotifier( 46 | child: Expandable( 47 | key: const Key("list_button"), 48 | collapsed: ExpandableButton( 49 | child: Padding( 50 | padding: const EdgeInsets.all(8.0), 51 | child: icon is String 52 | ? Text( 53 | icon, 54 | style: const TextStyle( 55 | fontSize: 14, 56 | fontWeight: FontWeight.w900, 57 | ), 58 | ) 59 | : Icon( 60 | icon, 61 | size: 16, 62 | ), 63 | ), 64 | ), 65 | expanded: Container( 66 | color: AppColors.secondary, 67 | child: SingleChildScrollView( 68 | scrollDirection: Axis.horizontal, 69 | physics: const NeverScrollableScrollPhysics(), 70 | child: Row( 71 | children: [ 72 | for (var item in items!) item, 73 | ExpandableButton( 74 | child: Padding( 75 | padding: EdgeInsets.all(AppSpacing.sm), 76 | child: Icon( 77 | FontAwesomeIcons.solidTimesCircle, 78 | size: AppSpacing.iconSizeLg, 79 | color: AppColors.destructive, 80 | ), 81 | ), 82 | ), 83 | ], 84 | ), 85 | ), 86 | ), 87 | ), 88 | ); 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /lib/main.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: non_constant_identifier_names 2 | import 'package:flutter/material.dart'; 3 | import 'package:flutter/services.dart'; 4 | import 'package:notex/core/repositories/local_database_repository.dart'; 5 | import 'package:notex/presentation/styles/app_colors.dart'; 6 | import 'package:notex/services/notification.dart'; 7 | import 'app.dart'; 8 | import 'package:flutter_dotenv/flutter_dotenv.dart'; 9 | import 'data/datasources/settngs_data.dart'; 10 | import 'data/datasources/user_data.dart'; 11 | import 'package:timezone/data/latest.dart' as tz; 12 | 13 | LocalDatabaseRepository LOCAL_DB = LocalDatabaseRepository(); 14 | User USER = User(); 15 | Settings SETTINGS = Settings(); 16 | NotificationService NOTIFICATION_SERVICES = NotificationService(); 17 | 18 | void main() async { 19 | await dotenv.load(); 20 | await NOTIFICATION_SERVICES.init(); 21 | // Configure the system navigation bar to use light content (dark color) 22 | SystemChrome.setSystemUIOverlayStyle(const SystemUiOverlayStyle( 23 | systemNavigationBarColor: AppColors.background, 24 | systemNavigationBarIconBrightness: Brightness.light, 25 | )); 26 | SystemChrome.setPreferredOrientations( 27 | [DeviceOrientation.portraitUp, DeviceOrientation.portraitDown]) 28 | .then((value) => runApp(const MyApp())); 29 | tz.initializeTimeZones(); 30 | runApp(const MyApp()); 31 | } 32 | -------------------------------------------------------------------------------- /lib/presentation/animations/fade_in_animation.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class FadeInAnimation extends StatefulWidget { 4 | const FadeInAnimation({super.key, required this.child}); 5 | final Widget child; 6 | @override 7 | State createState() => _FadeInAnimationState(); 8 | } 9 | 10 | class _FadeInAnimationState extends State with SingleTickerProviderStateMixin { 11 | late AnimationController _animationController; 12 | late Animation _animation; 13 | 14 | @override 15 | void initState() { 16 | super.initState(); 17 | _animationController = AnimationController( 18 | vsync: this, 19 | duration: const Duration(seconds: 1), 20 | ); 21 | _animation = Tween(begin: 0.0, end: 1.0).animate(_animationController); 22 | _animationController.forward(); 23 | } 24 | 25 | @override 26 | void dispose() { 27 | _animationController.dispose(); 28 | super.dispose(); 29 | } 30 | 31 | @override 32 | Widget build(BuildContext context) { 33 | return FadeTransition( 34 | opacity: _animation, 35 | child: widget.child, 36 | ); 37 | } 38 | } 39 | 40 | -------------------------------------------------------------------------------- /lib/presentation/blocs/create_user_profile/create_user_profile_bloc.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | import 'dart:io'; 3 | import 'package:bloc/bloc.dart'; 4 | import 'package:meta/meta.dart'; 5 | import 'package:notex/core/repositories/user_repository.dart'; 6 | import '../../../main.dart'; 7 | import '../../../data/models/updatable_user_data_model.dart'; 8 | 9 | part 'create_user_profile_event.dart'; 10 | 11 | part 'create_user_profile_state.dart'; 12 | 13 | class CreateUserProfileBloc 14 | extends Bloc { 15 | CreateUserProfileBloc() : super(CreateUserProfileInitial()) { 16 | on( 17 | (event, emit) => emit(CreateUserProfileOpenDatePickerState())); 18 | on(handleUserProfileCreate); 19 | } 20 | 21 | FutureOr handleUserProfileCreate( 22 | CreateUserProfileCreateEvent event, emit) async { 23 | // upload profile picture 24 | try { 25 | emit(CreateUserProfileLoadingState()); 26 | if (event.data.dob.isAfter(DateTime.now())) { 27 | emit(CreateUserProfileFailedState( 28 | "Date of birth can't be in the future")); 29 | return; 30 | } else if (DateTime.now().difference(event.data.dob).inDays < 8 * 365) { 31 | emit(CreateUserProfileFailedState("Must be at least 8 years old")); 32 | return; 33 | } 34 | await UserRepository.updateUserProfilePicture(event.imageFile) 35 | .then((_) async { 36 | // update remaining data 37 | await UserRepository.updateUserData(event.data).then((response) async { 38 | if (response.success) { 39 | await USER 40 | .init() 41 | .then((_) => emit(CreateUserProfileSuccessState())); 42 | } else { 43 | emit(CreateUserProfileFailedState(response.message)); 44 | } 45 | }); 46 | }); 47 | } catch (e) { 48 | emit(CreateUserProfileFailedState('Unexpected error occurred : $e')); 49 | } finally { 50 | emit(CreateUserProfileLoadedState()); 51 | } 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /lib/presentation/blocs/create_user_profile/create_user_profile_event.dart: -------------------------------------------------------------------------------- 1 | part of 'create_user_profile_bloc.dart'; 2 | 3 | @immutable 4 | abstract class CreateUserProfileEvent {} 5 | 6 | class CreateUserProfileOpenDatePickerEvent extends CreateUserProfileEvent{} 7 | 8 | class CreateUserProfileCreateEvent extends CreateUserProfileEvent { 9 | final UpdatableUserDataModel data; 10 | final File imageFile; 11 | CreateUserProfileCreateEvent(this.data, this.imageFile); 12 | } -------------------------------------------------------------------------------- /lib/presentation/blocs/create_user_profile/create_user_profile_state.dart: -------------------------------------------------------------------------------- 1 | part of 'create_user_profile_bloc.dart'; 2 | 3 | @immutable 4 | abstract class CreateUserProfileState {} 5 | 6 | abstract class CreateUserProfileActionState extends CreateUserProfileState{} 7 | 8 | class CreateUserProfileInitial extends CreateUserProfileState {} 9 | 10 | class CreateUserProfileLoadingState extends CreateUserProfileState {} 11 | 12 | class CreateUserProfileLoadedState extends CreateUserProfileState{} 13 | 14 | class CreateUserProfileSuccessState extends CreateUserProfileActionState {} 15 | 16 | class CreateUserProfileFailedState extends CreateUserProfileActionState { 17 | final String reason; 18 | CreateUserProfileFailedState(this.reason); 19 | } 20 | 21 | class CreateUserProfileOpenDatePickerState extends CreateUserProfileActionState{} -------------------------------------------------------------------------------- /lib/presentation/blocs/home/home_bloc.dart: -------------------------------------------------------------------------------- 1 | import 'package:bloc/bloc.dart'; 2 | import 'package:meta/meta.dart'; 3 | 4 | part 'home_event.dart'; 5 | part 'home_state.dart'; 6 | 7 | class HomeBloc extends Bloc { 8 | HomeBloc() : super(HomeInitial()) { 9 | on((event, emit) { 10 | // TODO: implement event handler 11 | }); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /lib/presentation/blocs/home/home_event.dart: -------------------------------------------------------------------------------- 1 | part of 'home_bloc.dart'; 2 | 3 | @immutable 4 | abstract class HomeEvent {} 5 | -------------------------------------------------------------------------------- /lib/presentation/blocs/home/home_state.dart: -------------------------------------------------------------------------------- 1 | part of 'home_bloc.dart'; 2 | 3 | @immutable 4 | abstract class HomeState {} 5 | 6 | class HomeInitial extends HomeState {} 7 | -------------------------------------------------------------------------------- /lib/presentation/blocs/login/login_bloc.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | import 'package:bloc/bloc.dart'; 3 | import 'package:meta/meta.dart'; 4 | import 'package:notex/core/repositories/auth_repository.dart'; 5 | 6 | import '../../../main.dart'; 7 | 8 | part 'login_event.dart'; 9 | 10 | part 'login_state.dart'; 11 | 12 | class LoginBloc extends Bloc { 13 | LoginBloc() : super(LoginInitialState()) { 14 | on(processLogin); 15 | on(processRedirectToRegisterPage); 16 | on(processRedirectToPasswordResetPage); 17 | } 18 | 19 | FutureOr processLogin( 20 | LoginPageLoginButtonClickedEvent event, Emitter emit) async { 21 | // login user 22 | try { 23 | emit(LoginLoadingSate()); 24 | await AuthRepository.loginUser( 25 | event.email, event.password, event.rememberDevice) 26 | .then((response) async { 27 | if (response.success) { 28 | await AuthRepository.init().then((_) async { 29 | try { 30 | await USER.init(); 31 | emit(LoginSuccessState()); 32 | } catch (error) { 33 | emit(LoginRedirectToCreateUserProfilePageAction()); 34 | } 35 | }); 36 | } else { 37 | emit(LoginFailedState(response.message)); 38 | } 39 | }); 40 | emit(LoginLoadedState()); 41 | } catch (error) { 42 | emit(LoginFailedState("An unexpected error occurred")); 43 | } 44 | } 45 | 46 | FutureOr processRedirectToRegisterPage( 47 | LoginPageRegisterButtonClickedEvent event, Emitter emit) { 48 | emit(LoginNavigateToRegisterPageActionState()); 49 | } 50 | FutureOr processRedirectToPasswordResetPage(LoginPageForgotPasswordButtonClickedEvent event,Emitter emit){ 51 | emit(LoginRedirectToPasswordResetPageAction()); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /lib/presentation/blocs/login/login_event.dart: -------------------------------------------------------------------------------- 1 | part of 'login_bloc.dart'; 2 | 3 | @immutable 4 | abstract class LoginEvent {} 5 | 6 | 7 | class LoginPageLoginButtonClickedEvent extends LoginEvent { 8 | final String email; 9 | final String password; 10 | final bool rememberDevice; 11 | LoginPageLoginButtonClickedEvent(this.email, this.password, this.rememberDevice); 12 | } 13 | 14 | class LoginPageRegisterButtonClickedEvent extends LoginEvent {} 15 | 16 | class LoginPageForgotPasswordButtonClickedEvent extends LoginEvent{} -------------------------------------------------------------------------------- /lib/presentation/blocs/login/login_state.dart: -------------------------------------------------------------------------------- 1 | part of 'login_bloc.dart'; 2 | 3 | @immutable 4 | abstract class LoginState {} 5 | abstract class LoginActionState extends LoginState {} 6 | 7 | class LoginInitialState extends LoginState {} 8 | 9 | class LoginLoadingSate extends LoginState {} 10 | 11 | class LoginLoadedState extends LoginState {} 12 | 13 | class LoginFailedState extends LoginActionState { 14 | final String reason; 15 | LoginFailedState(this.reason); 16 | } 17 | 18 | class LoginSuccessState extends LoginActionState {} 19 | 20 | class LoginNavigateToRegisterPageActionState extends LoginActionState {} 21 | 22 | class LoginRedirectToCreateUserProfilePageAction extends LoginActionState {} 23 | 24 | class LoginRedirectToPasswordResetPageAction extends LoginActionState{} -------------------------------------------------------------------------------- /lib/presentation/blocs/notes/notes_event.dart: -------------------------------------------------------------------------------- 1 | part of 'notes_bloc.dart'; 2 | 3 | @immutable 4 | abstract class NotesEvent { 5 | final bool isInHiddenMode; 6 | final bool isInDeletedMode; 7 | const NotesEvent({this.isInHiddenMode = false,this.isInDeletedMode = false}); 8 | } 9 | 10 | class NotesInitialEvent extends NotesEvent { 11 | const NotesInitialEvent({super.isInHiddenMode,super.isInDeletedMode}); 12 | } 13 | 14 | class NotesRefetchNotesEvent extends NotesEvent { 15 | final NoteModel? note; 16 | 17 | const NotesRefetchNotesEvent(this.note,{super.isInHiddenMode,super.isInDeletedMode}); 18 | } 19 | 20 | class NotesEnteredEditingEvent extends NotesEvent { 21 | const NotesEnteredEditingEvent({super.isInHiddenMode,super.isInDeletedMode}); 22 | } 23 | 24 | class NotesAddNoteEvent extends NotesEvent{ 25 | final NoteModel newNote; 26 | 27 | const NotesAddNoteEvent(this.newNote); 28 | } 29 | 30 | class NotesExitedEditingEvent extends NotesEvent { 31 | const NotesExitedEditingEvent({super.isInHiddenMode,super.isInDeletedMode}); 32 | } 33 | 34 | class NotesDeleteSelectedNotesEvent extends NotesEvent { 35 | const NotesDeleteSelectedNotesEvent({super.isInHiddenMode,super.isInDeletedMode}); 36 | } 37 | 38 | class NotesHideSelectedNotesEvent extends NotesEvent{} 39 | 40 | class NotesUnHideSelectedNotesEvent extends NotesEvent{ 41 | const NotesUnHideSelectedNotesEvent({super.isInHiddenMode,super.isInDeletedMode}); 42 | } 43 | 44 | class NotesSyncSelectedNotesEvent extends NotesEvent{ 45 | const NotesSyncSelectedNotesEvent({super.isInHiddenMode,super.isInDeletedMode}); 46 | } 47 | 48 | class NotesAreAllNotesSelectedEvent extends NotesEvent { 49 | final bool areAllSelected; 50 | const NotesAreAllNotesSelectedEvent(this.areAllSelected, 51 | {super.isInHiddenMode,super.isInDeletedMode}); 52 | } 53 | 54 | class NotesSetAllNotesSelectedCheckBoxEvent extends NotesEvent { 55 | final bool flag; 56 | const NotesSetAllNotesSelectedCheckBoxEvent(this.flag,{super.isInHiddenMode,super.isInDeletedMode}); 57 | } 58 | 59 | class NotesIsNoteSelectedEvent extends NotesEvent{ 60 | final bool isSelected; 61 | final NoteModel note; 62 | const NotesIsNoteSelectedEvent(this.isSelected, this.note,{super.isInHiddenMode,super.isInDeletedMode}); 63 | } 64 | 65 | class NotesSetNoteFavoriteEvent extends NotesEvent{ 66 | final NoteModel note; 67 | final bool value; 68 | const NotesSetNoteFavoriteEvent(this.value, this.note,{super.isInHiddenMode}); 69 | } 70 | 71 | class NotesUploadNoteToCloudEvent extends NotesEvent{ 72 | final NoteModel note; 73 | const NotesUploadNoteToCloudEvent(this.note); 74 | } 75 | 76 | class NotesSyncAllNotesEvent extends NotesEvent{ 77 | const NotesSyncAllNotesEvent({super.isInHiddenMode,super.isInDeletedMode}); 78 | } 79 | 80 | class NotesShowHiddenNotesEvent extends NotesEvent { 81 | final bool value; 82 | const NotesShowHiddenNotesEvent({this.value = true}); 83 | } 84 | 85 | class NotesShowDeletedNotesEvent extends NotesEvent { 86 | final bool value; 87 | const NotesShowDeletedNotesEvent({this.value = true}); 88 | } 89 | 90 | class NotesRestoreDeletedNoteEvent extends NotesEvent { 91 | final NoteModel note; 92 | const NotesRestoreDeletedNoteEvent(this.note); 93 | } -------------------------------------------------------------------------------- /lib/presentation/blocs/notes/notes_state.dart: -------------------------------------------------------------------------------- 1 | part of 'notes_bloc.dart'; 2 | 3 | @immutable 4 | abstract class NotesState { 5 | final bool isInHiddenMode; 6 | final bool isInDeletedMode; 7 | const NotesState({this.isInHiddenMode = false,this.isInDeletedMode = false}); 8 | } 9 | 10 | abstract class NotesHomeState extends NotesState { 11 | const NotesHomeState({super.isInHiddenMode,super.isInDeletedMode}); 12 | } 13 | 14 | abstract class NotesActionState extends NotesState {} 15 | 16 | abstract class NotesHomeActionState extends NotesActionState {} 17 | 18 | class NotesInitialState extends NotesState {} 19 | 20 | class NotesFetchingState extends NotesHomeState {} 21 | 22 | class NotesFetchedState extends NotesHomeState { 23 | final List notes; 24 | final List? syncingNotes; 25 | const NotesFetchedState( 26 | this.notes, {this.syncingNotes,super.isInHiddenMode,super.isInDeletedMode} 27 | ); 28 | } 29 | 30 | class NotesEditingState extends NotesFetchedState { 31 | const NotesEditingState( 32 | super.notes, { super.syncingNotes ,this.selectedNotesIds, this.areAllSelected = false,super.isInHiddenMode,super.isInDeletedMode}); 33 | 34 | final List? selectedNotesIds; 35 | final bool areAllSelected; 36 | } 37 | 38 | class NotesFetchingFailedState extends NotesState { 39 | final String reason; 40 | const NotesFetchingFailedState(this.reason,{super.isInHiddenMode,super.isInDeletedMode}); 41 | } 42 | 43 | class NotesOperationFailedState extends NotesActionState { 44 | final String reason; 45 | NotesOperationFailedState(this.reason); 46 | } 47 | 48 | class NotesSetAllNotesSelectedCheckBoxState extends NotesHomeActionState { 49 | final bool flag; 50 | NotesSetAllNotesSelectedCheckBoxState(this.flag); 51 | } 52 | 53 | class NotesLoadingState extends NotesState {} 54 | 55 | class NotesLoadedState extends NotesState {} 56 | 57 | class NotesEmptyState extends NotesHomeState { 58 | const NotesEmptyState({super.isInHiddenMode,super.isInDeletedMode}); 59 | } 60 | 61 | class NotesEnteredEditingState extends NotesHomeState { 62 | const NotesEnteredEditingState({super.isInHiddenMode,super.isInDeletedMode}); 63 | } 64 | 65 | class NotesExitedEditingState extends NotesHomeState { 66 | const NotesExitedEditingState({super.isInHiddenMode,super.isInDeletedMode}); 67 | } 68 | -------------------------------------------------------------------------------- /lib/presentation/blocs/register/register_bloc.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | 3 | import 'package:bloc/bloc.dart'; 4 | import 'package:meta/meta.dart'; 5 | import 'package:notex/core/repositories/auth_repository.dart'; 6 | 7 | part 'register_event.dart'; 8 | 9 | part 'register_state.dart'; 10 | 11 | class RegisterBloc extends Bloc { 12 | RegisterBloc() : super(RegisterInitialState()) { 13 | on(processRegisterUser); 14 | on(processRedirectToLoginPage); 15 | on(processEmptyCredentialsError); 16 | on(processPasswordsDoNotMatchError); 17 | } 18 | 19 | FutureOr processRegisterUser( 20 | RegisterPageRegisterButtonPressedEvent event, 21 | Emitter emit) async { 22 | try { 23 | emit(RegisterLoadingState()); 24 | await AuthRepository.registerUser( 25 | event.email, event.password, event.rememberDevice) 26 | .then((response) async { 27 | if (response.success) { 28 | await AuthRepository.init().then((_) async { 29 | emit(RegisterSuccessState()); 30 | }); 31 | } else { 32 | emit(RegisterFailedState(response.message.contains('duplicate') 33 | ? "User already exists" 34 | : "Something went wrong. Please try again later")); 35 | } 36 | }); 37 | emit(RegisterLoadedState()); 38 | } catch (error) { 39 | emit(RegisterFailedState("An unexpected error occurred")); 40 | } 41 | } 42 | 43 | FutureOr processRedirectToLoginPage( 44 | RegisterPageLoginButtonPressedEvent event, Emitter emit) { 45 | emit(RegisterRedirectToLoginState()); 46 | } 47 | 48 | FutureOr processEmptyCredentialsError( 49 | RegisterPageEmptyCredentialsEvent event, Emitter emit) { 50 | emit(RegisterEmptyCredentialsState()); 51 | } 52 | 53 | FutureOr processPasswordsDoNotMatchError( 54 | RegisterPagePasswordsDoNotMatchEvent event, Emitter emit) { 55 | emit(RegisterPasswordsDoNotMatchState()); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /lib/presentation/blocs/register/register_event.dart: -------------------------------------------------------------------------------- 1 | part of 'register_bloc.dart'; 2 | 3 | @immutable 4 | abstract class RegisterEvent {} 5 | 6 | class RegisterPageEmptyCredentialsEvent extends RegisterEvent {} 7 | 8 | class RegisterPagePasswordsDoNotMatchEvent extends RegisterEvent {} 9 | 10 | class RegisterPageRegisterButtonPressedEvent extends RegisterEvent { 11 | final String email; 12 | final String password; 13 | final bool rememberDevice; 14 | RegisterPageRegisterButtonPressedEvent(this.email, this.password, this.rememberDevice); 15 | } 16 | 17 | class RegisterPageLoginButtonPressedEvent extends RegisterEvent {} -------------------------------------------------------------------------------- /lib/presentation/blocs/register/register_state.dart: -------------------------------------------------------------------------------- 1 | part of 'register_bloc.dart'; 2 | 3 | @immutable 4 | abstract class RegisterState {} 5 | 6 | abstract class RegisterActionState extends RegisterState {} 7 | 8 | class RegisterInitialState extends RegisterState {} 9 | 10 | class RegisterLoadingState extends RegisterState{} 11 | 12 | class RegisterLoadedState extends RegisterState {} 13 | 14 | class RegisterEmptyCredentialsState extends RegisterActionState {} 15 | 16 | class RegisterPasswordsDoNotMatchState extends RegisterActionState {} 17 | 18 | class RegisterFailedState extends RegisterActionState { 19 | final String reason; 20 | RegisterFailedState(this.reason); 21 | } 22 | 23 | class RegisterSuccessState extends RegisterActionState {} 24 | 25 | class RegisterRedirectToLoginState extends RegisterActionState {} -------------------------------------------------------------------------------- /lib/presentation/blocs/settings/settings_event.dart: -------------------------------------------------------------------------------- 1 | part of 'settings_bloc.dart'; 2 | 3 | @immutable 4 | abstract class SettingsEvent {} 5 | 6 | class SettingsInitialEvent extends SettingsEvent{} 7 | 8 | class SettingsOperationFailedEvent extends SettingsEvent{ 9 | final String reason; 10 | SettingsOperationFailedEvent(this.reason); 11 | } 12 | 13 | class SettingsSetAutoSyncEvent extends SettingsEvent{ 14 | final bool value; 15 | SettingsSetAutoSyncEvent(this.value); 16 | } 17 | 18 | class SettingsSetPrefetchCloudNotesEvent extends SettingsEvent{ 19 | final bool value; 20 | SettingsSetPrefetchCloudNotesEvent(this.value); 21 | } 22 | 23 | class SettingsSetPrefetchCloudTodosEvent extends SettingsEvent{ 24 | final bool value; 25 | SettingsSetPrefetchCloudTodosEvent(this.value); 26 | } 27 | 28 | class SettingsSetAppLockEvent extends SettingsEvent { 29 | final bool value; 30 | SettingsSetAppLockEvent(this.value); 31 | } 32 | 33 | class SettingsSetHiddenNotesLockEvent extends SettingsEvent { 34 | final bool value; 35 | SettingsSetHiddenNotesLockEvent(this.value); 36 | } 37 | 38 | class SettingsSetDeletedNotesLockEvent extends SettingsEvent { 39 | final bool value; 40 | SettingsSetDeletedNotesLockEvent(this.value); 41 | } 42 | 43 | class SettingsSetBiometricOnlyEvent extends SettingsEvent { 44 | final bool value; 45 | SettingsSetBiometricOnlyEvent(this.value); 46 | } 47 | 48 | 49 | class SettingsUserLogoutEvent extends SettingsEvent{ 50 | final String? title; 51 | final String? body; 52 | SettingsUserLogoutEvent({this.title, this.body}); 53 | } 54 | 55 | class SettingsUserAccountDeletionEvent extends SettingsEvent{} 56 | 57 | class SettingsUserAccountVerifyEvent extends SettingsEvent{} 58 | 59 | class SettingsUserPasswordResetEvent extends SettingsEvent{} 60 | 61 | class SettingsDeleteAllNotesEvent extends SettingsEvent{} 62 | 63 | class SettingsDeleteAllTodosEvent extends SettingsEvent{} 64 | 65 | class SettingsRedirectToGithubEvent extends SettingsEvent{} 66 | 67 | class SettingsRedirectToGithubBugReportEvent extends SettingsEvent{} 68 | 69 | class SettingsRedirectToGithubRequestFeatureEvent extends SettingsEvent{} 70 | 71 | class SettingsRedirectToDevSiteEvent extends SettingsEvent{} 72 | 73 | class SettingsRedirectToDevMailEvent extends SettingsEvent{} 74 | 75 | class SettingsCheckForAppUpdatesEvent extends SettingsEvent{} 76 | -------------------------------------------------------------------------------- /lib/presentation/blocs/settings/settings_state.dart: -------------------------------------------------------------------------------- 1 | part of 'settings_bloc.dart'; 2 | 3 | @immutable 4 | abstract class SettingsState {} 5 | 6 | abstract class SettingsActionState extends SettingsState {} 7 | 8 | class SettingsInitial extends SettingsState {} 9 | 10 | class SettingsFetchingState extends SettingsState {} 11 | 12 | class SettingsFetchingFailedState extends SettingsState { 13 | final String reason; 14 | 15 | SettingsFetchingFailedState(this.reason); 16 | } 17 | 18 | class SettingsFetchedState extends SettingsState { 19 | final bool isAutoSyncEnabled; 20 | final bool isNotesOnlinePrefetchEnabled; 21 | final bool isTodosOnlinePrefetchEnabled; 22 | final bool isAppLockEnabled; 23 | final bool isHiddenNotesLockEnabled; 24 | final bool isDeletedNotesLockEnabled; 25 | final bool isBiometricOnly; 26 | 27 | SettingsFetchedState( 28 | {required this.isAutoSyncEnabled, 29 | required this.isNotesOnlinePrefetchEnabled, 30 | required this.isTodosOnlinePrefetchEnabled, 31 | required this.isAppLockEnabled, 32 | required this.isHiddenNotesLockEnabled, 33 | required this.isDeletedNotesLockEnabled, 34 | required this.isBiometricOnly}); 35 | } 36 | 37 | class SettingsSnackBarAction extends SettingsActionState { 38 | final String reason; 39 | 40 | SettingsSnackBarAction(this.reason); 41 | } 42 | 43 | class SettingsUserLogoutAction extends SettingsActionState { 44 | final String? title; 45 | final String? body; 46 | final String? agreeLabel; 47 | final String? disagreeLabel; 48 | final bool isSingleButton; 49 | final bool isBarrierDismissible; 50 | 51 | SettingsUserLogoutAction( 52 | {this.title, 53 | this.body, 54 | this.agreeLabel, 55 | this.disagreeLabel, 56 | this.isSingleButton = false, 57 | this.isBarrierDismissible = true}); 58 | } 59 | 60 | class SettingsDeleteAllNotesAction extends SettingsActionState{} 61 | 62 | class SettingsDeleteAllTodosAction extends SettingsActionState{} 63 | 64 | class SettingsRedirectToGithubAction extends SettingsActionState{} 65 | 66 | class SettingsRedirectToGithubBugReportAction extends SettingsActionState{} 67 | 68 | class SettingsRedirectToGithubRequestFeatureAction extends SettingsActionState{} 69 | 70 | class SettingsRedirectToDevSiteAction extends SettingsActionState{} 71 | 72 | class SettingsRedirectToDevMailAction extends SettingsActionState{} 73 | 74 | class SettingsCheckForAppUpdateAction extends SettingsActionState{} 75 | 76 | class SettingsUserAccountDeletionAction extends SettingsActionState{} -------------------------------------------------------------------------------- /lib/presentation/blocs/splash/splash_bloc.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | import 'dart:io'; 3 | import 'package:bloc/bloc.dart'; 4 | import 'package:flutter/foundation.dart'; 5 | import 'package:notex/core/repositories/auth_repository.dart'; 6 | import 'package:notex/core/repositories/jwt_decoder_repository.dart'; 7 | import 'package:notex/core/repositories/shared_preferences_repository.dart'; 8 | import 'package:notex/core/repositories/util_repository.dart'; 9 | import 'package:notex/main.dart'; 10 | part 'splash_event.dart'; 11 | part 'splash_state.dart'; 12 | 13 | class SplashBloc extends Bloc { 14 | SplashBloc() : super(SplashInitialState()) { 15 | on(splashInitialEvent); 16 | } 17 | 18 | Future authenticateUser(Emitter emit) async { 19 | if (Platform.isAndroid) { 20 | await UtilRepository.checkForUpdate(); 21 | } 22 | String? userToken = await SharedPreferencesRepository.getJwtToken(); 23 | if (userToken != null) { 24 | await AuthRepository.init().then((_) async { 25 | bool isValid = JwtDecoderRepository.verifyJwtToken(userToken); 26 | if (isValid) { 27 | try { 28 | await USER.init(); 29 | emit(SplashUserAuthenticatedState()); 30 | } catch (error) { 31 | emit(SplashRedirectToCreateUserProfilePageAction()); 32 | } 33 | } 34 | }); 35 | } else { 36 | emit(SplashUserNotAuthenticatedState()); 37 | } 38 | } 39 | 40 | FutureOr splashInitialEvent( 41 | SplashInitialEvent event, Emitter emit) async { 42 | emit(SplashLoadingState()); 43 | await Future.delayed(const Duration(seconds: 1)); 44 | //initialize local db 45 | await LOCAL_DB.init(); 46 | // initialize local settings 47 | await SETTINGS.init(); 48 | if (SETTINGS.isAppLockEnabled) { 49 | await AuthRepository.authenticateUser(isNotes: false) 50 | .then((response) async { 51 | if (response) { 52 | await authenticateUser(emit); 53 | } else { 54 | emit(SplashUserLocalAuthenticationFailedState()); 55 | } 56 | }); 57 | } else { 58 | await authenticateUser(emit); 59 | } 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /lib/presentation/blocs/splash/splash_event.dart: -------------------------------------------------------------------------------- 1 | part of 'splash_bloc.dart'; 2 | 3 | @immutable 4 | abstract class SplashEvent {} 5 | 6 | class SplashInitialEvent extends SplashEvent{} -------------------------------------------------------------------------------- /lib/presentation/blocs/splash/splash_state.dart: -------------------------------------------------------------------------------- 1 | part of 'splash_bloc.dart'; 2 | 3 | @immutable 4 | abstract class SplashState {} 5 | 6 | abstract class SplashActionState extends SplashState {} 7 | 8 | class SplashInitialState extends SplashState {} 9 | 10 | class SplashLoadingState extends SplashState {} 11 | 12 | class SplashUserNotAuthenticatedState extends SplashActionState {} 13 | 14 | class SplashUserAuthenticatedState extends SplashActionState{} 15 | 16 | class SplashUserLocalAuthenticationFailedState extends SplashState{} 17 | 18 | class SplashRedirectToCreateUserProfilePageAction extends SplashActionState {} -------------------------------------------------------------------------------- /lib/presentation/blocs/todos/todos_event.dart: -------------------------------------------------------------------------------- 1 | part of 'todos_bloc.dart'; 2 | 3 | @immutable 4 | abstract class TodosEvent {} 5 | 6 | class TodosInitialEvent extends TodosEvent {} 7 | 8 | class TodosRefetchTodosEvent extends TodosEvent{ 9 | final TodoModel? todo; 10 | TodosRefetchTodosEvent(this.todo); 11 | } 12 | 13 | class TodosMarkTodoDoneEvent extends TodosEvent { 14 | final TodoModel todo; 15 | 16 | TodosMarkTodoDoneEvent(this.todo); 17 | } 18 | 19 | class TodosMarkTodoNotDoneEvent extends TodosEvent { 20 | final TodoModel todo; 21 | 22 | TodosMarkTodoNotDoneEvent(this.todo); 23 | } 24 | 25 | class TodosShowAddTodoDialogBoxEvent extends TodosEvent {} 26 | 27 | class TodosAddTodoEvent extends TodosEvent { 28 | final TodoModel todo; 29 | TodosAddTodoEvent(this.todo); 30 | 31 | } 32 | 33 | class TodosEnteredEditingEvent extends TodosEvent {} 34 | 35 | class TodosAreAllTodosSelectedEvent extends TodosEvent { 36 | final bool areAllSelected; 37 | 38 | TodosAreAllTodosSelectedEvent(this.areAllSelected); 39 | } 40 | 41 | class TodosSetAllTodosSelectedCheckBoxEvent extends TodosEvent { 42 | final bool flag; 43 | 44 | TodosSetAllTodosSelectedCheckBoxEvent(this.flag); 45 | } 46 | 47 | class TodosIsTodoSelectedEvent extends TodosEvent { 48 | final bool isSelected; 49 | final TodoModel todo; 50 | TodosIsTodoSelectedEvent(this.isSelected, this.todo); 51 | } 52 | 53 | class TodosDeleteSelectedTodosEvent extends TodosEvent {} 54 | 55 | class TodosExitedEditingEvent extends TodosEvent {} 56 | 57 | class TodosUploadTodosToCloudEvent extends TodosEvent { 58 | final List todos; 59 | TodosUploadTodosToCloudEvent(this.todos); 60 | } 61 | 62 | class TodosSyncSelectedTodosEvent extends TodosEvent{} 63 | 64 | class TodosSyncAllTodosEvent extends TodosEvent{} -------------------------------------------------------------------------------- /lib/presentation/blocs/todos/todos_state.dart: -------------------------------------------------------------------------------- 1 | part of 'todos_bloc.dart'; 2 | 3 | @immutable 4 | abstract class TodosState {} 5 | 6 | abstract class TodosHomeState extends TodosState{} 7 | 8 | abstract class TodosActionState extends TodosState {} 9 | 10 | abstract class TodosHomeActionState extends TodosActionState {} 11 | 12 | class TodosInitialState extends TodosState {} 13 | 14 | class TodosFetchingState extends TodosHomeState{} 15 | 16 | class TodosFetchedState extends TodosHomeState { 17 | final List doneTodos; 18 | final List notDoneTodos; 19 | final List? syncingTodos; 20 | 21 | TodosFetchedState( 22 | this.doneTodos, 23 | this.notDoneTodos,{this.syncingTodos}); 24 | } 25 | 26 | class TodosEditingState extends TodosFetchedState { 27 | TodosEditingState(super.doneTodos, super.notDoneTodos, 28 | {this.areAllSelected = false, this.selectedTodoIds}); 29 | final bool areAllSelected; 30 | final List? selectedTodoIds; 31 | } 32 | 33 | class TodosFetchingFailedState extends TodosState { 34 | final String reason; 35 | 36 | TodosFetchingFailedState(this.reason); 37 | } 38 | 39 | class TodosLoadingState extends TodosState {} 40 | 41 | class TodosLoadedState extends TodosState {} 42 | 43 | class TodosEmptyState extends TodosHomeState {} 44 | 45 | class TodosTodoDoneState extends TodosState {} 46 | 47 | class TodosTodoUndoneState extends TodosState {} 48 | 49 | class TodosShowAddTodoDialogBoxState extends TodosActionState {} 50 | 51 | class TodosAddTodoSuccessState extends TodosActionState {} 52 | 53 | class TodosAddTodoFailedState extends TodosActionState { 54 | final String reason; 55 | 56 | TodosAddTodoFailedState(this.reason); 57 | } 58 | 59 | class TodosOperationFailedState extends TodosActionState { 60 | final String reason; 61 | TodosOperationFailedState(this.reason); 62 | } 63 | 64 | class TodosEnteredEditingState extends TodosHomeState {} 65 | 66 | class TodosExitedEditingState extends TodosHomeState {} 67 | 68 | class TodosSetAllTodosSelectedCheckBoxState extends TodosHomeActionState{ 69 | final bool flag; 70 | TodosSetAllTodosSelectedCheckBoxState(this.flag); 71 | } -------------------------------------------------------------------------------- /lib/presentation/blocs/user/user_bloc.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | import 'dart:io'; 3 | import 'package:bloc/bloc.dart'; 4 | import 'package:cached_network_image/cached_network_image.dart'; 5 | import 'package:meta/meta.dart'; 6 | import 'package:notex/core/config/api_routes.dart'; 7 | import 'package:notex/core/repositories/shared_preferences_repository.dart'; 8 | import 'package:notex/core/repositories/user_repository.dart'; 9 | import 'package:notex/data/models/updatable_user_data_model.dart'; 10 | import 'package:notex/data/models/update_user_data_reponse_model.dart'; 11 | import 'package:notex/data/models/user_model.dart'; 12 | import '../../../core/repositories/auth_repository.dart'; 13 | import '../../../main.dart'; 14 | 15 | part 'user_event.dart'; 16 | 17 | part 'user_state.dart'; 18 | 19 | class UserBloc extends Bloc { 20 | UserBloc() : super(UserInitial()) { 21 | on(handleFetchData); 22 | on(handleUpdateData); 23 | } 24 | 25 | final CachedNetworkImageProvider img = CachedNetworkImageProvider( 26 | USER_PROFILE_PICTURE_GET_ROUTE, 27 | headers: { 28 | 'Content-Type': 'application/json', 29 | 'Authorization': AuthRepository.userToken 30 | }, 31 | cacheKey: USER.profilePictureCacheKey, 32 | ); 33 | 34 | FutureOr handleFetchData( 35 | UserInitialEvent event, Emitter emit) async { 36 | try { 37 | emit(UserFetchingState()); 38 | 39 | emit(UserSettingsFetchedState(USER.data!, img)); 40 | } catch (error) { 41 | emit(UserOperationFailedState(error.toString())); 42 | } 43 | } 44 | 45 | FutureOr handleUpdateData( 46 | UserUpdateUserDataEvent event, Emitter emit) async { 47 | try { 48 | emit(UserSettingsFetchedState(USER.data!, img, isUpdating: true)); 49 | // update profile picture 50 | if (event.img != null) { 51 | bool response = 52 | await UserRepository.updateUserProfilePicture(event.img!); 53 | if (!response) { 54 | emit(UserOperationFailedState("Failed updating profile picture")); 55 | } else { 56 | await CachedNetworkImage.evictFromCache(USER.profilePictureCacheKey); 57 | await SharedPreferencesRepository.generateProfilePictureCacheKey(); 58 | } 59 | } 60 | if (event.data != null) { 61 | if (event.data!.dob.isAfter(DateTime.now())) { 62 | emit( 63 | UserOperationFailedState("Date of birth can't be in the future")); 64 | emit(UserSettingsFetchedState(USER.data!, img)); 65 | return; 66 | } else if (DateTime.now().difference(event.data!.dob).inDays < 67 | 8 * 365) { 68 | emit(UserOperationFailedState("Must be at least 8 years old")); 69 | emit(UserSettingsFetchedState(USER.data!, img)); 70 | return; 71 | } 72 | UpdateUserDataResponseModel response = 73 | await UserRepository.updateUserData(event.data!); 74 | if (response.success) { 75 | emit(UserSendScaffoldMessageState(response.message)); 76 | // update login token 77 | await SharedPreferencesRepository.saveJwtToken(response.token!); 78 | await AuthRepository.init(); 79 | await USER.init().then((_) { 80 | emit(UserSettingsFetchedState(USER.data!, img)); 81 | }); 82 | } else { 83 | emit(UserUpdateUserDataFailedState(response.message)); 84 | emit(UserSettingsFetchedState(USER.data!, img)); 85 | } 86 | } 87 | } catch (error) { 88 | emit(UserOperationFailedState(error.toString())); 89 | } finally { 90 | emit(UserResetAfterUpdateState()); 91 | } 92 | } 93 | } 94 | -------------------------------------------------------------------------------- /lib/presentation/blocs/user/user_event.dart: -------------------------------------------------------------------------------- 1 | part of 'user_bloc.dart'; 2 | 3 | @immutable 4 | abstract class UserEvent {} 5 | 6 | class UserInitialEvent extends UserEvent{} 7 | 8 | class UserUpdateUserDataEvent extends UserEvent{ 9 | final File? img; 10 | final UpdatableUserDataModel? data; 11 | UserUpdateUserDataEvent({this.img, this.data}); 12 | } -------------------------------------------------------------------------------- /lib/presentation/blocs/user/user_state.dart: -------------------------------------------------------------------------------- 1 | part of 'user_bloc.dart'; 2 | 3 | @immutable 4 | abstract class UserState {} 5 | 6 | class UserInitial extends UserState {} 7 | 8 | abstract class UserActionState extends UserState{} 9 | 10 | class UserFetchingState extends UserState{} 11 | 12 | class UserSettingsFetchedState extends UserState{ 13 | final UserDataModel user; 14 | final CachedNetworkImageProvider profilePicture; 15 | final bool isUpdating; 16 | UserSettingsFetchedState(this.user, this.profilePicture, {this.isUpdating = false}); 17 | } 18 | 19 | class UserOperationFailedState extends UserActionState{ 20 | final String reason; 21 | UserOperationFailedState(this.reason); 22 | } 23 | 24 | class UserSendScaffoldMessageState extends UserActionState{ 25 | final String message; 26 | UserSendScaffoldMessageState(this.message); 27 | } 28 | 29 | class UserUpdateUserDataFailedState extends UserActionState{ 30 | final String reason; 31 | UserUpdateUserDataFailedState(this.reason); 32 | } 33 | 34 | class UserResetAfterUpdateState extends UserActionState{} -------------------------------------------------------------------------------- /lib/presentation/physics/custom_scroll_physics.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class CustomScrollPhysics extends ClampingScrollPhysics { 4 | final Color? overscrollColor; 5 | 6 | const CustomScrollPhysics({this.overscrollColor, ScrollPhysics? parent}) 7 | : super(parent: parent); 8 | 9 | @override 10 | CustomScrollPhysics applyTo(ScrollPhysics? ancestor) { 11 | return CustomScrollPhysics( 12 | overscrollColor: overscrollColor, 13 | parent: buildParent(ancestor), 14 | ); 15 | } 16 | 17 | Color? get overscrollIndicatorColor => overscrollColor; 18 | } 19 | 20 | class CustomScrollBehavior extends ScrollBehavior { 21 | final Color scrollColor; 22 | 23 | const CustomScrollBehavior(this.scrollColor); 24 | Widget buildViewportChrome(BuildContext context, Widget child, AxisDirection axisDirection) { 25 | return GlowingOverscrollIndicator( 26 | axisDirection: axisDirection, 27 | color: scrollColor, // Set the desired overscroll color 28 | child: child, 29 | ); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /lib/presentation/styles/app_colors.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class AppColors { 4 | static const Color background = Color.fromARGB(255, 0, 0, 0); 5 | static const Color foreground = Color.fromARGB(255, 249, 249, 249); 6 | static const Color card = Color.fromARGB(255, 7, 7, 7); 7 | static const Color cardForeground = Color.fromARGB(255, 249, 249, 249); 8 | static const Color popover = Color.fromARGB(255, 7, 7, 7); 9 | static const Color popoverForeground = Color.fromARGB(255, 249, 249, 249); 10 | static const Color primary = Color.fromARGB(255, 117, 119, 255); 11 | static const Color primaryForeground = Color.fromARGB(255, 5, 5, 5); 12 | static const Color secondary = Color.fromARGB(255, 15, 15, 15); 13 | static const Color secondaryForeground = Color.fromARGB(255, 249, 249, 249); 14 | static const Color muted = Color.fromARGB(255, 22, 22, 22); 15 | static const Color mutedForeground = Color.fromARGB(255, 124, 124, 124); 16 | static const Color accent = Color.fromARGB(255, 15, 15, 15); 17 | static const Color accentForeground = Color.fromARGB(255, 249, 249, 249); 18 | static const Color destructive = Color.fromARGB(255, 238, 67, 67); 19 | static const Color destructiveForeground = Color.fromARGB(255, 249, 249, 249); 20 | static const Color border = Color.fromARGB(255, 28, 28, 28); 21 | static const Color input = Color.fromARGB(255, 40, 40, 40); 22 | static const Color ring = Color.fromARGB(255, 0, 3, 204); 23 | } 24 | -------------------------------------------------------------------------------- /lib/presentation/styles/app_styles.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:awesome_snackbar_content/awesome_snackbar_content.dart'; 3 | import 'package:notex/presentation/styles/app_colors.dart'; 4 | import 'package:notex/presentation/styles/app_text.dart'; 5 | 6 | kSnackBar(BuildContext context, String text) { 7 | ScaffoldMessenger.of(context).hideCurrentSnackBar(); 8 | ScaffoldMessenger.of(context).showSnackBar(SnackBar( 9 | content: Text( 10 | text, 11 | style: AppText.textBaseSemiBold, 12 | ), 13 | backgroundColor: AppColors.muted, 14 | padding: const EdgeInsets.symmetric(vertical: 20, horizontal: 30), 15 | )); 16 | } 17 | 18 | kFancySnackBar( 19 | BuildContext context, String title, String body, ContentType contentType) { 20 | final snackBar = SnackBar( 21 | elevation: 0, 22 | behavior: SnackBarBehavior.floating, 23 | backgroundColor: Colors.transparent, 24 | content: AwesomeSnackbarContent( 25 | title: title, 26 | message: body, 27 | contentType: contentType, 28 | ), 29 | ); 30 | 31 | ScaffoldMessenger.of(context) 32 | ..hideCurrentSnackBar() 33 | ..showSnackBar(snackBar); 34 | } 35 | -------------------------------------------------------------------------------- /lib/presentation/widgets/common_widgets.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:notex/presentation/styles/app_colors.dart'; 3 | import 'package:notex/presentation/styles/app_text.dart'; 4 | import 'package:notex/presentation/styles/size_config.dart'; 5 | 6 | class CommonWidgets { 7 | static Future commonAlertDialog( 8 | BuildContext context, { 9 | required String title, 10 | required String body, 11 | required String agreeLabel, 12 | required String denyLabel, 13 | bool isSingleBtn = false, 14 | bool isBarrierDismissible = true, 15 | Color? agreeButtonColor, 16 | Color? denyButtonColor, 17 | Color? titleColor, 18 | Color? bodyColor, 19 | }) async { 20 | return await showDialog( 21 | context: context, 22 | barrierDismissible: isBarrierDismissible, 23 | builder: (context) => AlertDialog( 24 | shape: RoundedRectangleBorder(borderRadius: AppBorderRadius.lg), 25 | contentPadding: EdgeInsets.all(AppSpacing.lg), 26 | actionsPadding: EdgeInsets.zero, 27 | title: Text(title, 28 | style: AppText.textXlSemiBold 29 | .copyWith(color: titleColor ?? AppColors.foreground)), 30 | content: Text( 31 | body, 32 | style: AppText.textBase 33 | .copyWith(color: bodyColor ?? AppColors.foreground), 34 | ), 35 | actions: [ 36 | Column( 37 | mainAxisAlignment: MainAxisAlignment.center, 38 | children: [ 39 | Material( 40 | color: Colors.transparent, 41 | child: InkWell( 42 | onTap: () { 43 | Navigator.of(context).pop(true); 44 | }, 45 | child: Container( 46 | padding: const EdgeInsets.symmetric(vertical: 10), 47 | width: double.maxFinite, 48 | child: Center( 49 | child: Text(agreeLabel, 50 | style: AppText.textBaseMedium.copyWith( 51 | color: agreeButtonColor ?? AppColors.primary)), 52 | ), 53 | ), 54 | ), 55 | ), 56 | if (!isSingleBtn) ...[ 57 | const Divider( 58 | color: AppColors.border, 59 | height: 10, 60 | ), 61 | Material( 62 | color: Colors.transparent, 63 | child: InkWell( 64 | onTap: () { 65 | Navigator.of(context).pop(false); 66 | }, 67 | child: Container( 68 | padding: const EdgeInsets.symmetric(vertical: 10), 69 | width: double.maxFinite, 70 | child: Center( 71 | child: Text(denyLabel, 72 | style: AppText.textBaseMedium.copyWith( 73 | color: 74 | denyButtonColor ?? AppColors.foreground)), 75 | ), 76 | ), 77 | ), 78 | ), 79 | ], 80 | SizedBox( 81 | height: AppSpacing.sm, 82 | ) 83 | ], 84 | ), 85 | ], 86 | ), 87 | ); 88 | } 89 | } 90 | -------------------------------------------------------------------------------- /lib/presentation/widgets/custom_image_builder.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:cached_network_image/cached_network_image.dart'; 3 | import 'package:flutter_spinkit/flutter_spinkit.dart'; 4 | import 'package:notex/presentation/styles/app_colors.dart'; 5 | import 'package:notex/presentation/styles/size_config.dart'; 6 | 7 | // Custom Image Builder 8 | Widget customImageBuilder( 9 | String url, Map attributes, BuildContext context) { 10 | // Get screen size and orientation 11 | var screenSize = MediaQuery.of(context).size; 12 | var orientation = MediaQuery.of(context).orientation; 13 | 14 | // Decide image size based on orientation 15 | double imageWidth = orientation == Orientation.portrait 16 | ? screenSize.width 17 | : screenSize.height; 18 | 19 | return SizedBox( 20 | width: imageWidth, 21 | child: CachedNetworkImage( 22 | imageUrl: url, 23 | fit: BoxFit 24 | .scaleDown, // Maintains aspect ratio and scales down if necessary 25 | placeholder: (context, url) => SpinKitRing( 26 | color: AppColors.primary, 27 | size: AppSpacing.iconSize2Xl, 28 | lineWidth: 4.0, 29 | ), // Placeholder widget 30 | errorWidget: (context, url, error) => const Padding( 31 | padding: EdgeInsets.symmetric(vertical: 15), 32 | child: Column( 33 | children: [ 34 | Icon( 35 | Icons.error, 36 | ), 37 | SizedBox( 38 | height: 10, 39 | ), 40 | Text( 41 | "Failed loading image", 42 | ), 43 | ], 44 | ), 45 | ), // Error widget 46 | ), 47 | ); 48 | } 49 | -------------------------------------------------------------------------------- /lib/presentation/widgets/fit_width_box.dart: -------------------------------------------------------------------------------- 1 | import 'dart:math'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:notex/presentation/styles/size_config.dart'; 4 | 5 | class FitWidthBox extends StatelessWidget { 6 | const FitWidthBox({super.key, required this.child}); 7 | final Widget child; 8 | @override 9 | Widget build(BuildContext context) { 10 | SizeConfig().init(context); 11 | return SizedBox( 12 | width: min(SizeConfig.screenWidth!, 900), 13 | child: child, 14 | ); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /lib/router/app_route_constants.dart: -------------------------------------------------------------------------------- 1 | class AppRouteConstants { 2 | static const String splashRouteName = 'splash'; 3 | static const String loginRouteName = 'login'; 4 | static const String registerRouteName = 'register'; 5 | static const String homeRouteName = 'home'; 6 | static const String createUserProfileName = 'createUserProfile'; 7 | static const String notesRouteName = 'notes'; 8 | static const String noteViewRouteName = 'view-note'; 9 | static const String todosRouteName = 'todos'; 10 | static const String settingsRouteName = 'settings'; 11 | static const String profileRouteName = 'profile'; 12 | static const String passwordResetRouteName = 'passwordReset'; 13 | } -------------------------------------------------------------------------------- /lib/router/router_transition_factory.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:go_router/go_router.dart'; 3 | 4 | class RouterTransitionFactory { 5 | static CustomTransitionPage getTransitionPage( 6 | {required BuildContext context, 7 | required GoRouterState state, 8 | required Widget child, 9 | required String type}) { 10 | return CustomTransitionPage( 11 | key: state.pageKey, 12 | child: child, 13 | transitionsBuilder: (context, animation, secondaryAnimation, child) { 14 | switch (type) { 15 | case 'fade': 16 | return FadeTransition(opacity: animation, child: child); 17 | case 'rotation': 18 | return RotationTransition(turns: animation, child: child); 19 | case 'size': 20 | return SizeTransition(sizeFactor: animation, child: child); 21 | case 'scale': 22 | return ScaleTransition(scale: animation, child: child); 23 | case 'slide': 24 | return SlideTransition( 25 | position: Tween( 26 | begin: const Offset(1.0, 0.0), 27 | end: Offset.zero, 28 | ).animate(animation), 29 | child: child, 30 | ); 31 | default: 32 | return FadeTransition(opacity: animation, child: child); 33 | } 34 | }); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /lib/services/notification.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_local_notifications/flutter_local_notifications.dart'; 2 | import 'package:timezone/timezone.dart' as tz; 3 | 4 | class NotificationService { 5 | final FlutterLocalNotificationsPlugin notificationsPlugin = 6 | FlutterLocalNotificationsPlugin(); 7 | 8 | Future init() async { 9 | AndroidInitializationSettings initializationSettingsAndroid = 10 | const AndroidInitializationSettings('ic_stat_logo'); 11 | 12 | var initializationSettingsIOS = DarwinInitializationSettings( 13 | requestAlertPermission: true, 14 | requestBadgePermission: true, 15 | requestSoundPermission: true, 16 | onDidReceiveLocalNotification: 17 | (int id, String? title, String? body, String? payload) async {}); 18 | 19 | var initializationSettings = InitializationSettings( 20 | android: initializationSettingsAndroid, iOS: initializationSettingsIOS); 21 | await notificationsPlugin.initialize(initializationSettings, 22 | onDidReceiveNotificationResponse: 23 | (NotificationResponse notificationResponse) async {}); 24 | requestNotificationPermission(); 25 | } 26 | 27 | void requestNotificationPermission() { 28 | notificationsPlugin 29 | .resolvePlatformSpecificImplementation< 30 | AndroidFlutterLocalNotificationsPlugin>() 31 | ?.requestNotificationsPermission(); 32 | } 33 | 34 | NotificationDetails notificationDetails() { 35 | return const NotificationDetails( 36 | android: AndroidNotificationDetails('channelId', 'Todo reminders', 37 | icon: 'ic_stat_logo', 38 | largeIcon: DrawableResourceAndroidBitmap('app_icon'), 39 | channelDescription: 'TODO reminders', 40 | priority: Priority.max, 41 | importance: Importance.max), 42 | iOS: DarwinNotificationDetails( 43 | presentAlert: true, 44 | presentBadge: true, 45 | presentSound: true, 46 | )); 47 | } 48 | 49 | Future showNotification( 50 | {int id = 0, String? title, String? body, String? payLoad}) async { 51 | return notificationsPlugin.show(id, title, body, notificationDetails()); 52 | } 53 | 54 | Future scheduleNotification( 55 | {int id = 0, 56 | String? title, 57 | String? body, 58 | String? payLoad, 59 | required DateTime scheduledNotificationDateTime}) async { 60 | requestNotificationPermission(); 61 | return notificationsPlugin.zonedSchedule( 62 | id, 63 | title, 64 | body, 65 | tz.TZDateTime.from( 66 | scheduledNotificationDateTime, 67 | tz.local, 68 | ), 69 | notificationDetails(), 70 | // ignore: deprecated_member_use 71 | androidAllowWhileIdle: true, 72 | uiLocalNotificationDateInterpretation: 73 | UILocalNotificationDateInterpretation.absoluteTime); 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /linux/.gitignore: -------------------------------------------------------------------------------- 1 | flutter/ephemeral 2 | -------------------------------------------------------------------------------- /linux/flutter/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # This file controls Flutter-level build steps. It should not be edited. 2 | cmake_minimum_required(VERSION 3.10) 3 | 4 | set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral") 5 | 6 | # Configuration provided via flutter tool. 7 | include(${EPHEMERAL_DIR}/generated_config.cmake) 8 | 9 | # TODO: Move the rest of this into files in ephemeral. See 10 | # https://github.com/flutter/flutter/issues/57146. 11 | 12 | # Serves the same purpose as list(TRANSFORM ... PREPEND ...), 13 | # which isn't available in 3.10. 14 | function(list_prepend LIST_NAME PREFIX) 15 | set(NEW_LIST "") 16 | foreach(element ${${LIST_NAME}}) 17 | list(APPEND NEW_LIST "${PREFIX}${element}") 18 | endforeach(element) 19 | set(${LIST_NAME} "${NEW_LIST}" PARENT_SCOPE) 20 | endfunction() 21 | 22 | # === Flutter Library === 23 | # System-level dependencies. 24 | find_package(PkgConfig REQUIRED) 25 | pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0) 26 | pkg_check_modules(GLIB REQUIRED IMPORTED_TARGET glib-2.0) 27 | pkg_check_modules(GIO REQUIRED IMPORTED_TARGET gio-2.0) 28 | 29 | set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/libflutter_linux_gtk.so") 30 | 31 | # Published to parent scope for install step. 32 | set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE) 33 | set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE) 34 | set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE) 35 | set(AOT_LIBRARY "${PROJECT_DIR}/build/lib/libapp.so" PARENT_SCOPE) 36 | 37 | list(APPEND FLUTTER_LIBRARY_HEADERS 38 | "fl_basic_message_channel.h" 39 | "fl_binary_codec.h" 40 | "fl_binary_messenger.h" 41 | "fl_dart_project.h" 42 | "fl_engine.h" 43 | "fl_json_message_codec.h" 44 | "fl_json_method_codec.h" 45 | "fl_message_codec.h" 46 | "fl_method_call.h" 47 | "fl_method_channel.h" 48 | "fl_method_codec.h" 49 | "fl_method_response.h" 50 | "fl_plugin_registrar.h" 51 | "fl_plugin_registry.h" 52 | "fl_standard_message_codec.h" 53 | "fl_standard_method_codec.h" 54 | "fl_string_codec.h" 55 | "fl_value.h" 56 | "fl_view.h" 57 | "flutter_linux.h" 58 | ) 59 | list_prepend(FLUTTER_LIBRARY_HEADERS "${EPHEMERAL_DIR}/flutter_linux/") 60 | add_library(flutter INTERFACE) 61 | target_include_directories(flutter INTERFACE 62 | "${EPHEMERAL_DIR}" 63 | ) 64 | target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}") 65 | target_link_libraries(flutter INTERFACE 66 | PkgConfig::GTK 67 | PkgConfig::GLIB 68 | PkgConfig::GIO 69 | ) 70 | add_dependencies(flutter flutter_assemble) 71 | 72 | # === Flutter tool backend === 73 | # _phony_ is a non-existent file to force this command to run every time, 74 | # since currently there's no way to get a full input/output list from the 75 | # flutter tool. 76 | add_custom_command( 77 | OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS} 78 | ${CMAKE_CURRENT_BINARY_DIR}/_phony_ 79 | COMMAND ${CMAKE_COMMAND} -E env 80 | ${FLUTTER_TOOL_ENVIRONMENT} 81 | "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.sh" 82 | ${FLUTTER_TARGET_PLATFORM} ${CMAKE_BUILD_TYPE} 83 | VERBATIM 84 | ) 85 | add_custom_target(flutter_assemble DEPENDS 86 | "${FLUTTER_LIBRARY}" 87 | ${FLUTTER_LIBRARY_HEADERS} 88 | ) 89 | -------------------------------------------------------------------------------- /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/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 | @NSApplicationMain 5 | class AppDelegate: FlutterAppDelegate { 6 | override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { 7 | return true 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "16x16", 5 | "idiom" : "mac", 6 | "filename" : "app_icon_16.png", 7 | "scale" : "1x" 8 | }, 9 | { 10 | "size" : "16x16", 11 | "idiom" : "mac", 12 | "filename" : "app_icon_32.png", 13 | "scale" : "2x" 14 | }, 15 | { 16 | "size" : "32x32", 17 | "idiom" : "mac", 18 | "filename" : "app_icon_32.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "32x32", 23 | "idiom" : "mac", 24 | "filename" : "app_icon_64.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "128x128", 29 | "idiom" : "mac", 30 | "filename" : "app_icon_128.png", 31 | "scale" : "1x" 32 | }, 33 | { 34 | "size" : "128x128", 35 | "idiom" : "mac", 36 | "filename" : "app_icon_256.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "256x256", 41 | "idiom" : "mac", 42 | "filename" : "app_icon_256.png", 43 | "scale" : "1x" 44 | }, 45 | { 46 | "size" : "256x256", 47 | "idiom" : "mac", 48 | "filename" : "app_icon_512.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "512x512", 53 | "idiom" : "mac", 54 | "filename" : "app_icon_512.png", 55 | "scale" : "1x" 56 | }, 57 | { 58 | "size" : "512x512", 59 | "idiom" : "mac", 60 | "filename" : "app_icon_1024.png", 61 | "scale" : "2x" 62 | } 63 | ], 64 | "info" : { 65 | "version" : 1, 66 | "author" : "xcode" 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPSxtreme/notex-flutter/0a53d20f9804d097e04fc8b45366dd69c824d81a/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPSxtreme/notex-flutter/0a53d20f9804d097e04fc8b45366dd69c824d81a/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPSxtreme/notex-flutter/0a53d20f9804d097e04fc8b45366dd69c824d81a/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPSxtreme/notex-flutter/0a53d20f9804d097e04fc8b45366dd69c824d81a/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPSxtreme/notex-flutter/0a53d20f9804d097e04fc8b45366dd69c824d81a/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPSxtreme/notex-flutter/0a53d20f9804d097e04fc8b45366dd69c824d81a/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPSxtreme/notex-flutter/0a53d20f9804d097e04fc8b45366dd69c824d81a/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 = Notex; 9 | 10 | // The application's bundle identifier 11 | PRODUCT_BUNDLE_IDENTIFIER = com.gpsxtreme.notex.notex; 12 | 13 | // The copyright displayed in application information 14 | PRODUCT_COPYRIGHT = Copyright © 2023 com.gpsxtreme.notex. 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 FlutterMacOS 2 | import Cocoa 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 | -------------------------------------------------------------------------------- /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 | import 'package:flutter/material.dart'; 9 | import 'package:flutter_test/flutter_test.dart'; 10 | import 'package:notex/app.dart'; 11 | 12 | import 'package:notex/main.dart'; 13 | 14 | void main() { 15 | testWidgets('Counter increments smoke test', (WidgetTester tester) async { 16 | // Build our app and trigger a frame. 17 | await tester.pumpWidget(const MyApp()); 18 | 19 | // Verify that our counter starts at 0. 20 | expect(find.text('0'), findsOneWidget); 21 | expect(find.text('1'), findsNothing); 22 | 23 | // Tap the '+' icon and trigger a frame. 24 | await tester.tap(find.byIcon(Icons.add)); 25 | await tester.pump(); 26 | 27 | // Verify that our counter has incremented. 28 | expect(find.text('0'), findsNothing); 29 | expect(find.text('1'), findsOneWidget); 30 | }); 31 | } 32 | -------------------------------------------------------------------------------- /web/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPSxtreme/notex-flutter/0a53d20f9804d097e04fc8b45366dd69c824d81a/web/favicon.png -------------------------------------------------------------------------------- /web/icons/Icon-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPSxtreme/notex-flutter/0a53d20f9804d097e04fc8b45366dd69c824d81a/web/icons/Icon-192.png -------------------------------------------------------------------------------- /web/icons/Icon-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPSxtreme/notex-flutter/0a53d20f9804d097e04fc8b45366dd69c824d81a/web/icons/Icon-512.png -------------------------------------------------------------------------------- /web/icons/Icon-maskable-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPSxtreme/notex-flutter/0a53d20f9804d097e04fc8b45366dd69c824d81a/web/icons/Icon-maskable-192.png -------------------------------------------------------------------------------- /web/icons/Icon-maskable-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPSxtreme/notex-flutter/0a53d20f9804d097e04fc8b45366dd69c824d81a/web/icons/Icon-maskable-512.png -------------------------------------------------------------------------------- /web/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | Notex 33 | 34 | 35 | 39 | 40 | 41 | 42 | 43 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /web/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "notex", 3 | "short_name": "notex", 4 | "start_url": ".", 5 | "display": "standalone", 6 | "background_color": "#0175C2", 7 | "theme_color": "#0175C2", 8 | "description": "A simple notes and todo app.", 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/runner/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.14) 2 | project(runner LANGUAGES CXX) 3 | 4 | # Define the application target. To change its name, change BINARY_NAME in the 5 | # top-level CMakeLists.txt, not the value here, or `flutter run` will no longer 6 | # work. 7 | # 8 | # Any new source files that you add to the application should be added here. 9 | add_executable(${BINARY_NAME} WIN32 10 | "flutter_window.cpp" 11 | "main.cpp" 12 | "utils.cpp" 13 | "win32_window.cpp" 14 | "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" 15 | "Runner.rc" 16 | "runner.exe.manifest" 17 | ) 18 | 19 | # Apply the standard set of build settings. This can be removed for applications 20 | # that need different build settings. 21 | apply_standard_settings(${BINARY_NAME}) 22 | 23 | # Add preprocessor definitions for the build version. 24 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION=\"${FLUTTER_VERSION}\"") 25 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MAJOR=${FLUTTER_VERSION_MAJOR}") 26 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MINOR=${FLUTTER_VERSION_MINOR}") 27 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_PATCH=${FLUTTER_VERSION_PATCH}") 28 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_BUILD=${FLUTTER_VERSION_BUILD}") 29 | 30 | # Disable Windows macros that collide with C++ standard library functions. 31 | target_compile_definitions(${BINARY_NAME} PRIVATE "NOMINMAX") 32 | 33 | # Add dependency libraries and include directories. Add any application-specific 34 | # dependencies here. 35 | target_link_libraries(${BINARY_NAME} PRIVATE flutter flutter_wrapper_app) 36 | target_link_libraries(${BINARY_NAME} PRIVATE "dwmapi.lib") 37 | target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}") 38 | 39 | # Run the Flutter tool portions of the build. This must not be removed. 40 | add_dependencies(${BINARY_NAME} flutter_assemble) 41 | -------------------------------------------------------------------------------- /windows/runner/Runner.rc: -------------------------------------------------------------------------------- 1 | // Microsoft Visual C++ generated resource script. 2 | // 3 | #pragma code_page(65001) 4 | #include "resource.h" 5 | 6 | #define APSTUDIO_READONLY_SYMBOLS 7 | ///////////////////////////////////////////////////////////////////////////// 8 | // 9 | // Generated from the TEXTINCLUDE 2 resource. 10 | // 11 | #include "winres.h" 12 | 13 | ///////////////////////////////////////////////////////////////////////////// 14 | #undef APSTUDIO_READONLY_SYMBOLS 15 | 16 | ///////////////////////////////////////////////////////////////////////////// 17 | // English (United States) resources 18 | 19 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) 20 | LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US 21 | 22 | #ifdef APSTUDIO_INVOKED 23 | ///////////////////////////////////////////////////////////////////////////// 24 | // 25 | // TEXTINCLUDE 26 | // 27 | 28 | 1 TEXTINCLUDE 29 | BEGIN 30 | "resource.h\0" 31 | END 32 | 33 | 2 TEXTINCLUDE 34 | BEGIN 35 | "#include ""winres.h""\r\n" 36 | "\0" 37 | END 38 | 39 | 3 TEXTINCLUDE 40 | BEGIN 41 | "\r\n" 42 | "\0" 43 | END 44 | 45 | #endif // APSTUDIO_INVOKED 46 | 47 | 48 | ///////////////////////////////////////////////////////////////////////////// 49 | // 50 | // Icon 51 | // 52 | 53 | // Icon with lowest ID value placed first to ensure application icon 54 | // remains consistent on all systems. 55 | IDI_APP_ICON ICON "resources\\app_icon.ico" 56 | 57 | 58 | ///////////////////////////////////////////////////////////////////////////// 59 | // 60 | // Version 61 | // 62 | 63 | #if defined(FLUTTER_VERSION_MAJOR) && defined(FLUTTER_VERSION_MINOR) && defined(FLUTTER_VERSION_PATCH) && defined(FLUTTER_VERSION_BUILD) 64 | #define VERSION_AS_NUMBER FLUTTER_VERSION_MAJOR,FLUTTER_VERSION_MINOR,FLUTTER_VERSION_PATCH,FLUTTER_VERSION_BUILD 65 | #else 66 | #define VERSION_AS_NUMBER 1,0,0,0 67 | #endif 68 | 69 | #if defined(FLUTTER_VERSION) 70 | #define VERSION_AS_STRING FLUTTER_VERSION 71 | #else 72 | #define VERSION_AS_STRING "1.0.0" 73 | #endif 74 | 75 | VS_VERSION_INFO VERSIONINFO 76 | FILEVERSION VERSION_AS_NUMBER 77 | PRODUCTVERSION VERSION_AS_NUMBER 78 | FILEFLAGSMASK VS_FFI_FILEFLAGSMASK 79 | #ifdef _DEBUG 80 | FILEFLAGS VS_FF_DEBUG 81 | #else 82 | FILEFLAGS 0x0L 83 | #endif 84 | FILEOS VOS__WINDOWS32 85 | FILETYPE VFT_APP 86 | FILESUBTYPE 0x0L 87 | BEGIN 88 | BLOCK "StringFileInfo" 89 | BEGIN 90 | BLOCK "040904e4" 91 | BEGIN 92 | VALUE "CompanyName", "com.gpsxtreme.notex" "\0" 93 | VALUE "FileDescription", "Notex" "\0" 94 | VALUE "FileVersion", VERSION_AS_STRING "\0" 95 | VALUE "InternalName", "Notex" "\0" 96 | VALUE "LegalCopyright", "Copyright (C) 2023 com.gpsxtreme.notex. All rights reserved." "\0" 97 | VALUE "OriginalFilename", "notex.exe" "\0" 98 | VALUE "ProductName", "Notex" "\0" 99 | VALUE "ProductVersion", VERSION_AS_STRING "\0" 100 | END 101 | END 102 | BLOCK "VarFileInfo" 103 | BEGIN 104 | VALUE "Translation", 0x409, 1252 105 | END 106 | END 107 | 108 | #endif // English (United States) resources 109 | ///////////////////////////////////////////////////////////////////////////// 110 | 111 | 112 | 113 | #ifndef APSTUDIO_INVOKED 114 | ///////////////////////////////////////////////////////////////////////////// 115 | // 116 | // Generated from the TEXTINCLUDE 3 resource. 117 | // 118 | 119 | 120 | ///////////////////////////////////////////////////////////////////////////// 121 | #endif // not APSTUDIO_INVOKED 122 | -------------------------------------------------------------------------------- /windows/runner/flutter_window.cpp: -------------------------------------------------------------------------------- 1 | #include "flutter_window.h" 2 | 3 | #include 4 | 5 | #include "flutter/generated_plugin_registrant.h" 6 | 7 | FlutterWindow::FlutterWindow(const flutter::DartProject& project) 8 | : project_(project) {} 9 | 10 | FlutterWindow::~FlutterWindow() {} 11 | 12 | bool FlutterWindow::OnCreate() { 13 | if (!Win32Window::OnCreate()) { 14 | return false; 15 | } 16 | 17 | RECT frame = GetClientArea(); 18 | 19 | // The size here must match the window dimensions to avoid unnecessary surface 20 | // creation / destruction in the startup path. 21 | flutter_controller_ = std::make_unique( 22 | frame.right - frame.left, frame.bottom - frame.top, project_); 23 | // Ensure that basic setup of the controller was successful. 24 | if (!flutter_controller_->engine() || !flutter_controller_->view()) { 25 | return false; 26 | } 27 | RegisterPlugins(flutter_controller_->engine()); 28 | SetChildContent(flutter_controller_->view()->GetNativeWindow()); 29 | 30 | flutter_controller_->engine()->SetNextFrameCallback([&]() { 31 | this->Show(); 32 | }); 33 | 34 | return true; 35 | } 36 | 37 | void FlutterWindow::OnDestroy() { 38 | if (flutter_controller_) { 39 | flutter_controller_ = nullptr; 40 | } 41 | 42 | Win32Window::OnDestroy(); 43 | } 44 | 45 | LRESULT 46 | FlutterWindow::MessageHandler(HWND hwnd, UINT const message, 47 | WPARAM const wparam, 48 | LPARAM const lparam) noexcept { 49 | // Give Flutter, including plugins, an opportunity to handle window messages. 50 | if (flutter_controller_) { 51 | std::optional result = 52 | flutter_controller_->HandleTopLevelWindowProc(hwnd, message, wparam, 53 | lparam); 54 | if (result) { 55 | return *result; 56 | } 57 | } 58 | 59 | switch (message) { 60 | case WM_FONTCHANGE: 61 | flutter_controller_->engine()->ReloadSystemFonts(); 62 | break; 63 | } 64 | 65 | return Win32Window::MessageHandler(hwnd, message, wparam, lparam); 66 | } 67 | -------------------------------------------------------------------------------- /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"notex", 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/GPSxtreme/notex-flutter/0a53d20f9804d097e04fc8b45366dd69c824d81a/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 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /windows/runner/utils.cpp: -------------------------------------------------------------------------------- 1 | #include "utils.h" 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #include 9 | 10 | void CreateAndAttachConsole() { 11 | if (::AllocConsole()) { 12 | FILE *unused; 13 | if (freopen_s(&unused, "CONOUT$", "w", stdout)) { 14 | _dup2(_fileno(stdout), 1); 15 | } 16 | if (freopen_s(&unused, "CONOUT$", "w", stderr)) { 17 | _dup2(_fileno(stdout), 2); 18 | } 19 | std::ios::sync_with_stdio(); 20 | FlutterDesktopResyncOutputStreams(); 21 | } 22 | } 23 | 24 | std::vector GetCommandLineArguments() { 25 | // Convert the UTF-16 command line arguments to UTF-8 for the Engine to use. 26 | int argc; 27 | wchar_t** argv = ::CommandLineToArgvW(::GetCommandLineW(), &argc); 28 | if (argv == nullptr) { 29 | return std::vector(); 30 | } 31 | 32 | std::vector command_line_arguments; 33 | 34 | // Skip the first argument as it's the binary name. 35 | for (int i = 1; i < argc; i++) { 36 | command_line_arguments.push_back(Utf8FromUtf16(argv[i])); 37 | } 38 | 39 | ::LocalFree(argv); 40 | 41 | return command_line_arguments; 42 | } 43 | 44 | std::string Utf8FromUtf16(const wchar_t* utf16_string) { 45 | if (utf16_string == nullptr) { 46 | return std::string(); 47 | } 48 | int target_length = ::WideCharToMultiByte( 49 | CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, 50 | -1, nullptr, 0, nullptr, nullptr) 51 | -1; // remove the trailing null character 52 | int input_length = (int)wcslen(utf16_string); 53 | std::string utf8_string; 54 | if (target_length <= 0 || target_length > utf8_string.max_size()) { 55 | return utf8_string; 56 | } 57 | utf8_string.resize(target_length); 58 | int converted_length = ::WideCharToMultiByte( 59 | CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, 60 | input_length, utf8_string.data(), target_length, nullptr, nullptr); 61 | if (converted_length == 0) { 62 | return std::string(); 63 | } 64 | return utf8_string; 65 | } 66 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /windows/runner/win32_window.h: -------------------------------------------------------------------------------- 1 | #ifndef RUNNER_WIN32_WINDOW_H_ 2 | #define RUNNER_WIN32_WINDOW_H_ 3 | 4 | #include 5 | 6 | #include 7 | #include 8 | #include 9 | 10 | // A class abstraction for a high DPI-aware Win32 Window. Intended to be 11 | // inherited from by classes that wish to specialize with custom 12 | // rendering and input handling 13 | class Win32Window { 14 | public: 15 | struct Point { 16 | unsigned int x; 17 | unsigned int y; 18 | Point(unsigned int x, unsigned int y) : x(x), y(y) {} 19 | }; 20 | 21 | struct Size { 22 | unsigned int width; 23 | unsigned int height; 24 | Size(unsigned int width, unsigned int height) 25 | : width(width), height(height) {} 26 | }; 27 | 28 | Win32Window(); 29 | virtual ~Win32Window(); 30 | 31 | // Creates a win32 window with |title| that is positioned and sized using 32 | // |origin| and |size|. New windows are created on the default monitor. Window 33 | // sizes are specified to the OS in physical pixels, hence to ensure a 34 | // consistent size this function will scale the inputted width and height as 35 | // as appropriate for the default monitor. The window is invisible until 36 | // |Show| is called. Returns true if the window was created successfully. 37 | bool Create(const std::wstring& title, const Point& origin, const Size& size); 38 | 39 | // Show the current window. Returns true if the window was successfully shown. 40 | bool Show(); 41 | 42 | // Release OS resources associated with window. 43 | void Destroy(); 44 | 45 | // Inserts |content| into the window tree. 46 | void SetChildContent(HWND content); 47 | 48 | // Returns the backing Window handle to enable clients to set icon and other 49 | // window properties. Returns nullptr if the window has been destroyed. 50 | HWND GetHandle(); 51 | 52 | // If true, closing this window will quit the application. 53 | void SetQuitOnClose(bool quit_on_close); 54 | 55 | // Return a RECT representing the bounds of the current client area. 56 | RECT GetClientArea(); 57 | 58 | protected: 59 | // Processes and route salient window messages for mouse handling, 60 | // size change and DPI. Delegates handling of these to member overloads that 61 | // inheriting classes can handle. 62 | virtual LRESULT MessageHandler(HWND window, 63 | UINT const message, 64 | WPARAM const wparam, 65 | LPARAM const lparam) noexcept; 66 | 67 | // Called when CreateAndShow is called, allowing subclass window-related 68 | // setup. Subclasses should return false if setup fails. 69 | virtual bool OnCreate(); 70 | 71 | // Called when Destroy is called. 72 | virtual void OnDestroy(); 73 | 74 | private: 75 | friend class WindowClassRegistrar; 76 | 77 | // OS callback called by message pump. Handles the WM_NCCREATE message which 78 | // is passed when the non-client area is being created and enables automatic 79 | // non-client DPI scaling so that the non-client area automatically 80 | // responds to changes in DPI. All other messages are handled by 81 | // MessageHandler. 82 | static LRESULT CALLBACK WndProc(HWND const window, 83 | UINT const message, 84 | WPARAM const wparam, 85 | LPARAM const lparam) noexcept; 86 | 87 | // Retrieves a class instance pointer for |window| 88 | static Win32Window* GetThisFromHandle(HWND const window) noexcept; 89 | 90 | // Update the window frame's theme to match the system theme. 91 | static void UpdateTheme(HWND const window); 92 | 93 | bool quit_on_close_ = false; 94 | 95 | // window handle for top level window. 96 | HWND window_handle_ = nullptr; 97 | 98 | // window handle for hosted content. 99 | HWND child_content_ = nullptr; 100 | }; 101 | 102 | #endif // RUNNER_WIN32_WINDOW_H_ 103 | --------------------------------------------------------------------------------