├── .gitignore
├── .metadata
├── .vscode
└── launch.json
├── README.md
├── analysis_options.yaml
├── android
├── .gitignore
├── app
│ ├── build.gradle
│ └── src
│ │ ├── debug
│ │ └── AndroidManifest.xml
│ │ ├── main
│ │ ├── AndroidManifest.xml
│ │ ├── kotlin
│ │ │ └── com
│ │ │ │ └── example
│ │ │ │ ├── student_note
│ │ │ │ └── MainActivity.kt
│ │ │ │ └── yalda_students_notes
│ │ │ │ └── MainActivity.kt
│ │ └── res
│ │ │ ├── drawable-v21
│ │ │ └── launch_background.xml
│ │ │ ├── drawable
│ │ │ └── launch_background.xml
│ │ │ ├── mipmap-hdpi
│ │ │ ├── ic_launcher.png
│ │ │ └── launcher_icon.png
│ │ │ ├── mipmap-mdpi
│ │ │ ├── ic_launcher.png
│ │ │ └── launcher_icon.png
│ │ │ ├── mipmap-xhdpi
│ │ │ ├── ic_launcher.png
│ │ │ └── launcher_icon.png
│ │ │ ├── mipmap-xxhdpi
│ │ │ ├── ic_launcher.png
│ │ │ └── launcher_icon.png
│ │ │ ├── mipmap-xxxhdpi
│ │ │ ├── ic_launcher.png
│ │ │ └── launcher_icon.png
│ │ │ ├── values-night
│ │ │ └── styles.xml
│ │ │ └── values
│ │ │ └── styles.xml
│ │ └── profile
│ │ └── AndroidManifest.xml
├── build.gradle
├── gradle.properties
├── gradle
│ └── wrapper
│ │ └── gradle-wrapper.properties
└── settings.gradle
├── asset
├── fonts
│ ├── IRANMarker.ttf
│ └── ic_font.ttf
├── icon
│ └── icon.png
├── image
│ ├── category.jpg
│ ├── empty.jpg
│ ├── error-404.png
│ ├── lang.png
│ ├── notes.jpg
│ └── search.png
└── translation
│ ├── en.json
│ └── fa.json
├── generate_js.bat
├── generate_js.sh
├── ios
├── .gitignore
├── Flutter
│ ├── AppFrameworkInfo.plist
│ ├── Debug.xcconfig
│ └── Release.xcconfig
├── Podfile
├── Runner.xcodeproj
│ ├── project.pbxproj
│ ├── project.xcworkspace
│ │ ├── contents.xcworkspacedata
│ │ └── xcshareddata
│ │ │ ├── IDEWorkspaceChecks.plist
│ │ │ └── WorkspaceSettings.xcsettings
│ └── xcshareddata
│ │ └── xcschemes
│ │ └── Runner.xcscheme
├── Runner.xcworkspace
│ ├── contents.xcworkspacedata
│ └── xcshareddata
│ │ ├── IDEWorkspaceChecks.plist
│ │ └── WorkspaceSettings.xcsettings
└── Runner
│ ├── AppDelegate.swift
│ ├── Assets.xcassets
│ ├── AppIcon.appiconset
│ │ ├── Contents.json
│ │ ├── Icon-App-1024x1024@1x.png
│ │ ├── Icon-App-20x20@1x.png
│ │ ├── Icon-App-20x20@2x.png
│ │ ├── Icon-App-20x20@3x.png
│ │ ├── Icon-App-29x29@1x.png
│ │ ├── Icon-App-29x29@2x.png
│ │ ├── Icon-App-29x29@3x.png
│ │ ├── Icon-App-40x40@1x.png
│ │ ├── Icon-App-40x40@2x.png
│ │ ├── Icon-App-40x40@3x.png
│ │ ├── Icon-App-60x60@2x.png
│ │ ├── Icon-App-60x60@3x.png
│ │ ├── Icon-App-76x76@1x.png
│ │ ├── Icon-App-76x76@2x.png
│ │ └── Icon-App-83.5x83.5@2x.png
│ └── LaunchImage.imageset
│ │ ├── Contents.json
│ │ ├── LaunchImage.png
│ │ ├── LaunchImage@2x.png
│ │ ├── LaunchImage@3x.png
│ │ └── README.md
│ ├── Base.lproj
│ ├── LaunchScreen.storyboard
│ └── Main.storyboard
│ ├── Info.plist
│ └── Runner-Bridging-Header.h
├── lib
├── app
│ ├── app.dart
│ ├── app_prefs.dart
│ ├── app_providers.dart
│ ├── const.dart
│ ├── di.dart
│ ├── exception.dart
│ ├── extensions.dart
│ ├── functions.dart
│ └── global.dart
├── data
│ ├── datasource
│ │ ├── connection
│ │ │ ├── connection.dart
│ │ │ ├── native.dart
│ │ │ ├── unsupported.dart
│ │ │ └── web.dart
│ │ ├── database.dart
│ │ ├── database.g.dart
│ │ └── table
│ │ │ ├── category_data.dart
│ │ │ ├── note_data.dart
│ │ │ └── reastore_data.dart
│ ├── drift_config.dart
│ ├── mapper
│ │ └── mapper.dart
│ └── repository
│ │ ├── category_repository_impl.dart
│ │ └── note_repository_impl.dart
├── domain
│ ├── model
│ │ ├── category_model.dart
│ │ ├── country.dart
│ │ └── note_model.dart
│ └── repository
│ │ ├── category_repository.dart
│ │ └── note_repository.dart
├── gen
│ ├── assets.gen.dart
│ ├── fonts.gen.dart
│ └── translation
│ │ ├── codegen_loader.g.dart
│ │ └── locale_keys.g.dart
├── main.dart
├── presentation
│ ├── resources
│ │ ├── color_manager.dart
│ │ ├── font_manager.dart
│ │ ├── language_manager.dart
│ │ ├── style_manager.dart
│ │ └── value_manager.dart
│ ├── screen
│ │ ├── about
│ │ │ └── about_screen.dart
│ │ ├── add_note
│ │ │ ├── add_note_screen.dart
│ │ │ └── bloc
│ │ │ │ ├── addnote_bloc.dart
│ │ │ │ ├── addnote_event.dart
│ │ │ │ └── addnote_state.dart
│ │ ├── category
│ │ │ ├── bloc
│ │ │ │ ├── category_bloc.dart
│ │ │ │ ├── category_event.dart
│ │ │ │ └── category_state.dart
│ │ │ ├── category.dart
│ │ │ └── ext.dart
│ │ ├── category_notes
│ │ │ ├── bloc
│ │ │ │ ├── category_notes_bloc.dart
│ │ │ │ ├── category_notes_event.dart
│ │ │ │ └── category_notes_state.dart
│ │ │ └── category_notes.dart
│ │ ├── edit_note
│ │ │ ├── bloc
│ │ │ │ ├── editnote_bloc.dart
│ │ │ │ ├── editnote_event.dart
│ │ │ │ └── editnote_state.dart
│ │ │ └── edit_note_screen.dart
│ │ ├── favorite
│ │ │ ├── bloc
│ │ │ │ ├── starrednotes_bloc.dart
│ │ │ │ ├── starrednotes_event.dart
│ │ │ │ └── starrednotes_state.dart
│ │ │ └── favorite.dart
│ │ ├── home
│ │ │ └── home_screen.dart
│ │ ├── note
│ │ │ ├── bloc
│ │ │ │ ├── notelist_bloc.dart
│ │ │ │ ├── notelist_event.dart
│ │ │ │ └── notelist_state.dart
│ │ │ └── note.dart
│ │ ├── onboarding
│ │ │ ├── bloc
│ │ │ │ ├── language_bloc.dart
│ │ │ │ ├── language_event.dart
│ │ │ │ └── language_state.dart
│ │ │ └── onboard_screen.dart
│ │ ├── search
│ │ │ ├── bloc
│ │ │ │ ├── searchnote_bloc.dart
│ │ │ │ ├── searchnote_event.dart
│ │ │ │ └── searchnote_state.dart
│ │ │ └── search_screen.dart
│ │ └── setting
│ │ │ ├── setting_dialog.dart
│ │ │ └── setting_screen.dart
│ ├── util
│ │ ├── color_util.dart
│ │ ├── language_util.dart
│ │ └── theme_util.dart
│ └── widgets
│ │ ├── bottom_navigation.dart
│ │ ├── bottom_sheet.dart
│ │ ├── bouncing_spinner.dart
│ │ ├── category_dialog.dart
│ │ ├── category_item.dart
│ │ ├── color_picker.dart
│ │ ├── drawer.dart
│ │ ├── empty_state.dart
│ │ ├── invalid_state.dart
│ │ ├── language_radio_button.dart
│ │ ├── loading_state.dart
│ │ ├── note_category_item.dart
│ │ ├── note_grid.dart
│ │ ├── note_grid_item.dart
│ │ ├── note_item.dart
│ │ ├── note_list.dart
│ │ ├── note_list_item.dart
│ │ ├── pop_menu_item.dart
│ │ └── top_snackbar
│ │ ├── custom_snack_bar.dart
│ │ ├── safe_area_values.dart
│ │ ├── tap_bounce_container.dart
│ │ └── top_snack_bar.dart
└── tranlation
│ └── codegen_loader.g.dart
├── linux
├── .gitignore
├── CMakeLists.txt
├── flutter
│ ├── CMakeLists.txt
│ ├── generated_plugin_registrant.cc
│ ├── generated_plugin_registrant.h
│ └── generated_plugins.cmake
├── main.cc
├── my_application.cc
└── my_application.h
├── macos
├── .gitignore
├── Flutter
│ ├── Flutter-Debug.xcconfig
│ ├── Flutter-Release.xcconfig
│ ├── GeneratedPluginRegistrant.swift
│ └── ephemeral
│ │ ├── Flutter-Generated.xcconfig
│ │ └── flutter_export_environment.sh
├── 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
├── pictures
├── dark_note_list.jpg
├── dark_persian_note_list.png
├── dark_search.jpg
├── desktop.jpg
├── desktop_dark.jpg
├── light_categories.jpg
├── light_favorite.jpg
├── light_note_list.jpg
├── light_note_list.png
└── light_search_404.jpg
├── 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
├── shared_worker.dart.js
├── sql-wasm.js
├── sql-wasm.wasm
├── sqlite3.wasm
├── worker.dart
├── worker.dart.js
└── worker.dart.min.js
└── windows
├── .gitignore
├── CMakeLists.txt
├── flutter
├── CMakeLists.txt
├── generated_plugin_registrant.cc
├── generated_plugin_registrant.h
└── generated_plugins.cmake
└── runner
├── CMakeLists.txt
├── Runner.rc
├── flutter_window.cpp
├── flutter_window.h
├── main.cpp
├── resource.h
├── resources
└── app_icon.ico
├── runner.exe.manifest
├── utils.cpp
├── utils.h
├── win32_window.cpp
└── win32_window.h
/.gitignore:
--------------------------------------------------------------------------------
1 | # Miscellaneous
2 | *.class
3 | *.log
4 | *.pyc
5 | *.swp
6 | .DS_Store
7 | .atom/
8 | .buildlog/
9 | .history
10 | .svn/
11 |
12 | # IntelliJ related
13 | *.iml
14 | *.ipr
15 | *.iws
16 | .idea/
17 |
18 | # The .vscode folder contains launch configuration and tasks you configure in
19 | # VS Code which you may wish to be included in version control, so this line
20 | # is commented out by default.
21 | #.vscode/
22 |
23 | # Flutter/Dart/Pub related
24 | **/doc/api/
25 | **/ios/Flutter/.last_build_id
26 | .dart_tool/
27 | .flutter-plugins
28 | .flutter-plugins-dependencies
29 | .packages
30 | .pub-cache/
31 | .pub/
32 | /build/
33 | .fvm/
34 |
35 | lib/game_card.dart
36 |
37 | # Web related
38 | lib/generated_plugin_registrant.dart
39 |
40 | # Symbolication related
41 | app.*.symbols
42 |
43 | # Obfuscation related
44 | app.*.map.json
45 |
46 | # Android Studio will place build artifacts here
47 | /android/app/debug
48 | /android/app/profile
49 | /android/app/release
50 |
--------------------------------------------------------------------------------
/.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 and should not be manually edited.
5 |
6 | version:
7 | revision: fc7015e35aac7ab785e7ae15a47db5c9e669ec7f
8 | channel: beta
9 |
10 | project_type: app
11 |
--------------------------------------------------------------------------------
/.vscode/launch.json:
--------------------------------------------------------------------------------
1 | {
2 | // Use IntelliSense to learn about possible attributes.
3 | // Hover to view descriptions of existing attributes.
4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5 | "version": "0.2.0",
6 | "configurations": [
7 | {
8 | "name": "yalda_students_notes",
9 | "request": "launch",
10 | "type": "dart",
11 | },
12 | {
13 | "name": "yalda_students_notes (profile mode)",
14 | "request": "launch",
15 | "type": "dart",
16 | "flutterMode": "profile"
17 | },
18 | {
19 | "name": "yalda_students_notes (release mode)",
20 | "request": "launch",
21 | "type": "dart",
22 | "flutterMode": "release"
23 | }
24 | ]
25 | }
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # 📔 Note to Keep Application.
2 |
3 |
4 |
5 | ## ℹ️ Description
6 |
7 | - Develop by using Bloc library in clean architecture with Dependency injection
8 |
9 | - Note application; User can categorize their notes; star notes
10 |
11 | - This Note app is implemented with bloc and provider. It supports dark mode and user can switch between English or Persian language.
12 |
13 | - Run it on Mobile, Tablet, Desktop and your browser.
14 |
15 | - [UI design](https://dribbble.com/shots/16811788-Notes-app)
16 |
17 |
18 |
19 | ## ✅ Supported Platforms
20 | - Android
21 | - iOS
22 | - Desktop
23 | - Web
24 | - Linux
25 |
26 |
27 |
28 | ## 📦 Packages:
29 | - bloc
30 | - get_it
31 | - responsive framework
32 | - easy localization
33 | - drift
34 | - provider
35 |
36 |
37 |
38 | ## ⚜️ Features:
39 | - Adaptive and Responsive (mobile. web, windows)
40 | - dark mode
41 | - add, update and delete a note
42 | - star a note by double tapping on it
43 | - multi language
44 | - categorize notes
45 | - add, rename and delete(by long pressing on each category) a category
46 |
47 |
48 | 🔸 If you enjoy this project, ⭐ it ;)
49 |
50 |
51 |
52 | ## 🖼️ Screenshots:
53 |
54 |
55 |
56 |
57 |
58 |
59 |
--------------------------------------------------------------------------------
/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 Exception("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
12 | }
13 |
14 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
15 | if (flutterVersionCode == null) {
16 | flutterVersionCode = '1'
17 | }
18 |
19 | def flutterVersionName = localProperties.getProperty('flutter.versionName')
20 | if (flutterVersionName == null) {
21 | flutterVersionName = '1.0'
22 | }
23 |
24 | apply plugin: 'com.android.application'
25 | apply plugin: 'kotlin-android'
26 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
27 |
28 | android {
29 | compileSdkVersion 33
30 |
31 | compileOptions {
32 | sourceCompatibility JavaVersion.VERSION_1_8
33 | targetCompatibility JavaVersion.VERSION_1_8
34 | }
35 |
36 | kotlinOptions {
37 | jvmTarget = '1.8'
38 | }
39 |
40 | sourceSets {
41 | main.java.srcDirs += 'src/main/kotlin'
42 | }
43 |
44 | defaultConfig {
45 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
46 | applicationId "com.example.yalda_students_notes"
47 | minSdkVersion 21
48 | targetSdkVersion 33
49 | versionCode flutterVersionCode.toInteger()
50 | versionName flutterVersionName
51 | }
52 |
53 | buildTypes {
54 | release {
55 | // TODO: Add your own signing config for the release build.
56 | // Signing with the debug keys for now, so `flutter run --release` works.
57 | signingConfig signingConfigs.debug
58 | }
59 | }
60 | }
61 |
62 | flutter {
63 | source '../..'
64 | }
65 |
66 | dependencies {
67 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
68 | }
69 |
--------------------------------------------------------------------------------
/android/app/src/debug/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/android/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
15 |
23 |
27 |
30 |
31 |
32 |
33 |
34 |
35 |
37 |
40 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/android/app/src/main/kotlin/com/example/student_note/MainActivity.kt:
--------------------------------------------------------------------------------
1 | package com.example.student_note
2 |
3 | import io.flutter.embedding.android.FlutterActivity
4 |
5 | class MainActivity: FlutterActivity() {
6 | }
7 |
--------------------------------------------------------------------------------
/android/app/src/main/kotlin/com/example/yalda_students_notes/MainActivity.kt:
--------------------------------------------------------------------------------
1 | package com.example.yalda_students_notes
2 |
3 | import io.flutter.embedding.android.FlutterActivity
4 |
5 | class MainActivity: FlutterActivity() {
6 | }
7 |
--------------------------------------------------------------------------------
/android/app/src/main/res/drawable-v21/launch_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
12 |
13 |
--------------------------------------------------------------------------------
/android/app/src/main/res/drawable/launch_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
12 |
13 |
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yalda-student/note_to_remember/9cee70f4efb4d2f0555a0c84aae4ecfefe9639f8/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-hdpi/launcher_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yalda-student/note_to_remember/9cee70f4efb4d2f0555a0c84aae4ecfefe9639f8/android/app/src/main/res/mipmap-hdpi/launcher_icon.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yalda-student/note_to_remember/9cee70f4efb4d2f0555a0c84aae4ecfefe9639f8/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-mdpi/launcher_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yalda-student/note_to_remember/9cee70f4efb4d2f0555a0c84aae4ecfefe9639f8/android/app/src/main/res/mipmap-mdpi/launcher_icon.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yalda-student/note_to_remember/9cee70f4efb4d2f0555a0c84aae4ecfefe9639f8/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xhdpi/launcher_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yalda-student/note_to_remember/9cee70f4efb4d2f0555a0c84aae4ecfefe9639f8/android/app/src/main/res/mipmap-xhdpi/launcher_icon.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yalda-student/note_to_remember/9cee70f4efb4d2f0555a0c84aae4ecfefe9639f8/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xxhdpi/launcher_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yalda-student/note_to_remember/9cee70f4efb4d2f0555a0c84aae4ecfefe9639f8/android/app/src/main/res/mipmap-xxhdpi/launcher_icon.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yalda-student/note_to_remember/9cee70f4efb4d2f0555a0c84aae4ecfefe9639f8/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xxxhdpi/launcher_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yalda-student/note_to_remember/9cee70f4efb4d2f0555a0c84aae4ecfefe9639f8/android/app/src/main/res/mipmap-xxxhdpi/launcher_icon.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 |
3 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/android/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | ext.kotlin_version = '1.9.22'
3 | repositories {
4 | google()
5 | mavenCentral()
6 | }
7 |
8 | dependencies {
9 | classpath 'com.android.tools.build:gradle:7.1.2'
10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
11 | }
12 | }
13 |
14 | allprojects {
15 | repositories {
16 | google()
17 | jcenter()
18 | mavenCentral()
19 | }
20 | }
21 |
22 | rootProject.buildDir = '../build'
23 | subprojects {
24 | project.buildDir = "${rootProject.buildDir}/${project.name}"
25 | }
26 | subprojects {
27 | project.evaluationDependsOn(':app')
28 | }
29 |
30 | tasks.register("clean", Delete) {
31 | delete rootProject.buildDir
32 | }
33 |
--------------------------------------------------------------------------------
/android/gradle.properties:
--------------------------------------------------------------------------------
1 | org.gradle.jvmargs=-Xmx1536M
2 | android.useAndroidX=true
3 | android.enableJetifier=true
4 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-all.zip
5 |
--------------------------------------------------------------------------------
/android/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Fri Jun 23 08:50:38 CEST 2017
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip
7 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/asset/fonts/IRANMarker.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yalda-student/note_to_remember/9cee70f4efb4d2f0555a0c84aae4ecfefe9639f8/asset/fonts/IRANMarker.ttf
--------------------------------------------------------------------------------
/asset/fonts/ic_font.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yalda-student/note_to_remember/9cee70f4efb4d2f0555a0c84aae4ecfefe9639f8/asset/fonts/ic_font.ttf
--------------------------------------------------------------------------------
/asset/icon/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yalda-student/note_to_remember/9cee70f4efb4d2f0555a0c84aae4ecfefe9639f8/asset/icon/icon.png
--------------------------------------------------------------------------------
/asset/image/category.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yalda-student/note_to_remember/9cee70f4efb4d2f0555a0c84aae4ecfefe9639f8/asset/image/category.jpg
--------------------------------------------------------------------------------
/asset/image/empty.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yalda-student/note_to_remember/9cee70f4efb4d2f0555a0c84aae4ecfefe9639f8/asset/image/empty.jpg
--------------------------------------------------------------------------------
/asset/image/error-404.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yalda-student/note_to_remember/9cee70f4efb4d2f0555a0c84aae4ecfefe9639f8/asset/image/error-404.png
--------------------------------------------------------------------------------
/asset/image/lang.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yalda-student/note_to_remember/9cee70f4efb4d2f0555a0c84aae4ecfefe9639f8/asset/image/lang.png
--------------------------------------------------------------------------------
/asset/image/notes.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yalda-student/note_to_remember/9cee70f4efb4d2f0555a0c84aae4ecfefe9639f8/asset/image/notes.jpg
--------------------------------------------------------------------------------
/asset/image/search.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yalda-student/note_to_remember/9cee70f4efb4d2f0555a0c84aae4ecfefe9639f8/asset/image/search.png
--------------------------------------------------------------------------------
/asset/translation/en.json:
--------------------------------------------------------------------------------
1 | {
2 | "profileTitle": "My Notes",
3 | "notes": "Notes",
4 | "notesList": "List Notes",
5 | "search": "Search",
6 | "categories": "Categories",
7 | "setting": "Setting",
8 | "startSearching": "Start Searching",
9 | "editNote": "Edit Note",
10 | "title": "Title",
11 | "content": "Content",
12 | "startTyping": "Start Typing",
13 | "listCategories": "List Categories",
14 | "language": "Language",
15 | "add_note": "Add Note",
16 | "content_Cannot_Be_Empty": "content Can not Be Empty.",
17 | "favorite_Notes": "Favorite Notes",
18 | "any_note": "You don't have any note.",
19 | "theme": "Theme",
20 | "about": "About us",
21 | "lets_go": "Let's go right away!",
22 | "Colorful_Notes": "Colorful Notes",
23 | "note_tutorial": "Write and Save whatever you want.\nDouble tap on each one to star it.",
24 | "find_quickly": "Find out Quickly",
25 | "search_easily": "You can easily search between notes \nand find what you want.",
26 | "Manage_Notes": "Manage Notes",
27 | "categorize_notes": "Make as many categories as you want and categorize your notes.\n\nYou can delete any category by long pressing on it.",
28 | "select_language": "Select your preferred language.",
29 | "done": "Done",
30 | "save": "Save",
31 | "move": "Move",
32 | "delete": "Delete",
33 | "select_category": "Select category",
34 | "category_count_1": "You have",
35 | "category_count_2": "categories.",
36 | "cancel": "Cancel",
37 | "create": "Create",
38 | "update": "Update",
39 | "note": "Note",
40 | "delete_none_category": "You can't delete None Category.",
41 | "home": "Home",
42 | "note_to_remember": "Note to Remember",
43 | "new_category": "New Category",
44 | "new_note": "New Note",
45 | "copy" : "Copied",
46 | "share" : "Share"
47 | }
--------------------------------------------------------------------------------
/asset/translation/fa.json:
--------------------------------------------------------------------------------
1 | {
2 | "profileTitle": "یادداشت های من",
3 | "notes": "یادداشت ها",
4 | "notesList": "لیست یادداشت ها",
5 | "search": "جستجو",
6 | "categories": "دسته ها",
7 | "setting": "تنظیمات",
8 | "startSearching": "جستجو را آغاز کنید",
9 | "editNote": "ویرایش یادداشت",
10 | "title": "عنوان",
11 | "content": "محتوا",
12 | "startTyping": "تایپ کنید",
13 | "listCategories": "لیست دسته ها",
14 | "language": "زبان",
15 | "add_note": "اضافه کردن یادداشت",
16 | "content_Cannot_Be_Empty": "محتوا نمی تواند خال باشد",
17 | "favorite_Notes": "یادداشت های مورد علاقه",
18 | "any_note": "شما یادداشتی ندارید",
19 | "theme": "تم",
20 | "about": "درباره ما",
21 | "lets_go": "بزن بریم",
22 | "Colorful_Notes": "یادداشت های رنگی",
23 | "note_tutorial": "هر چیزی رو که میخوای بنویس و ذخیره اش کن.\n میتونی دوبار روش ضربه بزنی تا ستاره دار بشه.",
24 | "find_quickly": "سریع پیداش کن",
25 | "search_easily": "می تونی به راحتی بین یادداشت های جستجو کنی\nو هرچیزی رو که میخوای پیدا کنی.",
26 | "Manage_Notes": "مدیریت یادداشت ها",
27 | "categorize_notes": "هر تعداد که میخوای دسته بساز و یادداشت هات رو دسته بندی کن.\n\nبا دوبار ضربه روی اون میتونی حذفشون کنی.",
28 | "select_language": "زبان مورد نظر خود را انتخاب کنید.",
29 | "done": "تمام",
30 | "save": "ذخیره",
31 | "move": "انتقال",
32 | "delete": "حذف",
33 | "select_category": "دسته مورد نظر خود را انتخاب کنید.",
34 | "category_count_1": "شما",
35 | "category_count_2": "دسته دارید.",
36 | "cancel": "لغو",
37 | "create": "ایجاد",
38 | "update": "ذخیره",
39 | "note": "یادداشت",
40 | "delete_none_category": "شما نمی توانید دسته None را پاک کنید. ",
41 | "home": "خانه",
42 | "note_to_remember": "یادداشتی برای یادآوری",
43 | "new_category": "دسته جدید",
44 | "new_note": "یادداشت جدید",
45 | "copy" : "کپی شد",
46 | "share" : "اشتراک گذاری"
47 | }
--------------------------------------------------------------------------------
/generate_js.bat:
--------------------------------------------------------------------------------
1 | @echo off
2 |
3 | DEL "web\worker.dart.js"
4 | DEL "web\worker.dart.min.js"
5 | flutter "pub" "run" "build_runner" "build" "--delete-conflicting-outputs" "-o" "web:build\web\"
6 | COPY "build\web\worker.dart.js" "web\worker.dart.js"
7 | DEL /S "build\web"
8 | flutter "pub" "run" "build_runner" "build" "--release" "--delete-conflicting-outputs" "-o" "web:build\web\"
9 | COPY "build\web\worker.dart.js" "web\worker.dart.min.js"
10 | DEL /S "build\web"
--------------------------------------------------------------------------------
/generate_js.sh:
--------------------------------------------------------------------------------
1 | rm -f web/worker.dart.js
2 | rm -f web/worker.dart.min.js
3 | flutter pub run build_runner build --delete-conflicting-outputs -o web:build/web/
4 | cp -f build/web/worker.dart.js web/worker.dart.js
5 | rm -rf build/web
6 | flutter pub run build_runner build --release --delete-conflicting-outputs -o web:build/web/
7 | cp -f build/web/worker.dart.js web/worker.dart.min.js
8 | rm -rf build/web
9 |
--------------------------------------------------------------------------------
/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 | 9.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, '11.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 |
41 |
42 |
52 |
54 |
60 |
61 |
62 |
63 |
69 |
71 |
77 |
78 |
79 |
80 |
82 |
83 |
86 |
87 |
88 |
--------------------------------------------------------------------------------
/ios/Runner.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/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 |
4 | @UIApplicationMain
5 | @objc class AppDelegate: FlutterAppDelegate {
6 | override func application(
7 | _ application: UIApplication,
8 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
9 | ) -> Bool {
10 | GeneratedPluginRegistrant.register(with: self)
11 | return super.application(application, didFinishLaunchingWithOptions: launchOptions)
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "size" : "20x20",
5 | "idiom" : "iphone",
6 | "filename" : "Icon-App-20x20@2x.png",
7 | "scale" : "2x"
8 | },
9 | {
10 | "size" : "20x20",
11 | "idiom" : "iphone",
12 | "filename" : "Icon-App-20x20@3x.png",
13 | "scale" : "3x"
14 | },
15 | {
16 | "size" : "29x29",
17 | "idiom" : "iphone",
18 | "filename" : "Icon-App-29x29@1x.png",
19 | "scale" : "1x"
20 | },
21 | {
22 | "size" : "29x29",
23 | "idiom" : "iphone",
24 | "filename" : "Icon-App-29x29@2x.png",
25 | "scale" : "2x"
26 | },
27 | {
28 | "size" : "29x29",
29 | "idiom" : "iphone",
30 | "filename" : "Icon-App-29x29@3x.png",
31 | "scale" : "3x"
32 | },
33 | {
34 | "size" : "40x40",
35 | "idiom" : "iphone",
36 | "filename" : "Icon-App-40x40@2x.png",
37 | "scale" : "2x"
38 | },
39 | {
40 | "size" : "40x40",
41 | "idiom" : "iphone",
42 | "filename" : "Icon-App-40x40@3x.png",
43 | "scale" : "3x"
44 | },
45 | {
46 | "size" : "60x60",
47 | "idiom" : "iphone",
48 | "filename" : "Icon-App-60x60@2x.png",
49 | "scale" : "2x"
50 | },
51 | {
52 | "size" : "60x60",
53 | "idiom" : "iphone",
54 | "filename" : "Icon-App-60x60@3x.png",
55 | "scale" : "3x"
56 | },
57 | {
58 | "size" : "20x20",
59 | "idiom" : "ipad",
60 | "filename" : "Icon-App-20x20@1x.png",
61 | "scale" : "1x"
62 | },
63 | {
64 | "size" : "20x20",
65 | "idiom" : "ipad",
66 | "filename" : "Icon-App-20x20@2x.png",
67 | "scale" : "2x"
68 | },
69 | {
70 | "size" : "29x29",
71 | "idiom" : "ipad",
72 | "filename" : "Icon-App-29x29@1x.png",
73 | "scale" : "1x"
74 | },
75 | {
76 | "size" : "29x29",
77 | "idiom" : "ipad",
78 | "filename" : "Icon-App-29x29@2x.png",
79 | "scale" : "2x"
80 | },
81 | {
82 | "size" : "40x40",
83 | "idiom" : "ipad",
84 | "filename" : "Icon-App-40x40@1x.png",
85 | "scale" : "1x"
86 | },
87 | {
88 | "size" : "40x40",
89 | "idiom" : "ipad",
90 | "filename" : "Icon-App-40x40@2x.png",
91 | "scale" : "2x"
92 | },
93 | {
94 | "size" : "76x76",
95 | "idiom" : "ipad",
96 | "filename" : "Icon-App-76x76@1x.png",
97 | "scale" : "1x"
98 | },
99 | {
100 | "size" : "76x76",
101 | "idiom" : "ipad",
102 | "filename" : "Icon-App-76x76@2x.png",
103 | "scale" : "2x"
104 | },
105 | {
106 | "size" : "83.5x83.5",
107 | "idiom" : "ipad",
108 | "filename" : "Icon-App-83.5x83.5@2x.png",
109 | "scale" : "2x"
110 | },
111 | {
112 | "size" : "1024x1024",
113 | "idiom" : "ios-marketing",
114 | "filename" : "Icon-App-1024x1024@1x.png",
115 | "scale" : "1x"
116 | }
117 | ],
118 | "info" : {
119 | "version" : 1,
120 | "author" : "xcode"
121 | }
122 | }
123 |
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yalda-student/note_to_remember/9cee70f4efb4d2f0555a0c84aae4ecfefe9639f8/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yalda-student/note_to_remember/9cee70f4efb4d2f0555a0c84aae4ecfefe9639f8/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yalda-student/note_to_remember/9cee70f4efb4d2f0555a0c84aae4ecfefe9639f8/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yalda-student/note_to_remember/9cee70f4efb4d2f0555a0c84aae4ecfefe9639f8/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yalda-student/note_to_remember/9cee70f4efb4d2f0555a0c84aae4ecfefe9639f8/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yalda-student/note_to_remember/9cee70f4efb4d2f0555a0c84aae4ecfefe9639f8/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yalda-student/note_to_remember/9cee70f4efb4d2f0555a0c84aae4ecfefe9639f8/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yalda-student/note_to_remember/9cee70f4efb4d2f0555a0c84aae4ecfefe9639f8/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yalda-student/note_to_remember/9cee70f4efb4d2f0555a0c84aae4ecfefe9639f8/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yalda-student/note_to_remember/9cee70f4efb4d2f0555a0c84aae4ecfefe9639f8/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yalda-student/note_to_remember/9cee70f4efb4d2f0555a0c84aae4ecfefe9639f8/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yalda-student/note_to_remember/9cee70f4efb4d2f0555a0c84aae4ecfefe9639f8/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yalda-student/note_to_remember/9cee70f4efb4d2f0555a0c84aae4ecfefe9639f8/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yalda-student/note_to_remember/9cee70f4efb4d2f0555a0c84aae4ecfefe9639f8/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yalda-student/note_to_remember/9cee70f4efb4d2f0555a0c84aae4ecfefe9639f8/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "LaunchImage.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "filename" : "LaunchImage@2x.png",
11 | "scale" : "2x"
12 | },
13 | {
14 | "idiom" : "universal",
15 | "filename" : "LaunchImage@3x.png",
16 | "scale" : "3x"
17 | }
18 | ],
19 | "info" : {
20 | "version" : 1,
21 | "author" : "xcode"
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yalda-student/note_to_remember/9cee70f4efb4d2f0555a0c84aae4ecfefe9639f8/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yalda-student/note_to_remember/9cee70f4efb4d2f0555a0c84aae4ecfefe9639f8/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yalda-student/note_to_remember/9cee70f4efb4d2f0555a0c84aae4ecfefe9639f8/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md:
--------------------------------------------------------------------------------
1 | # Launch Screen Assets
2 |
3 | You can customize the launch presentation.screen with your own desired assets by replacing the image files in this directory.
4 |
5 | You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images.
--------------------------------------------------------------------------------
/ios/Runner/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 |
--------------------------------------------------------------------------------
/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 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | Note to Remember
15 | CFBundlePackageType
16 | APPL
17 | CFBundleShortVersionString
18 | $(FLUTTER_BUILD_NAME)
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | $(FLUTTER_BUILD_NUMBER)
23 | LSRequiresIPhoneOS
24 |
25 | UILaunchStoryboardName
26 | LaunchScreen
27 | UIMainStoryboardFile
28 | Main
29 | UISupportedInterfaceOrientations
30 |
31 | UIInterfaceOrientationPortrait
32 | UIInterfaceOrientationLandscapeLeft
33 | UIInterfaceOrientationLandscapeRight
34 |
35 | UISupportedInterfaceOrientations~ipad
36 |
37 | UIInterfaceOrientationPortrait
38 | UIInterfaceOrientationPortraitUpsideDown
39 | UIInterfaceOrientationLandscapeLeft
40 | UIInterfaceOrientationLandscapeRight
41 |
42 | UIViewControllerBasedStatusBarAppearance
43 |
44 | CFBundleLocalizations
45 |
46 | en
47 | fa
48 |
49 | LSApplicationQueriesSchemes
50 |
51 | https
52 | http
53 |
54 |
55 |
56 |
--------------------------------------------------------------------------------
/ios/Runner/Runner-Bridging-Header.h:
--------------------------------------------------------------------------------
1 | #import "GeneratedPluginRegistrant.h"
2 |
--------------------------------------------------------------------------------
/lib/app/app.dart:
--------------------------------------------------------------------------------
1 | import 'dart:math';
2 |
3 | import 'package:drift/drift.dart';
4 | import 'package:flutter/material.dart';
5 | import 'package:yalda_students_notes/app/app_prefs.dart';
6 | import 'package:yalda_students_notes/app/di.dart';
7 | import 'package:yalda_students_notes/app/global.dart';
8 | import 'package:yalda_students_notes/data/datasource/database.dart';
9 | import 'package:yalda_students_notes/domain/model/category_model.dart';
10 | import 'package:yalda_students_notes/domain/model/note_model.dart';
11 |
12 | mixin FetchData {
13 | List fetchNoteData(
14 | AppDatabase database, List result) {
15 | final noteList = [];
16 | for (final row in result) {
17 | var noteData = row.readTable(database.note);
18 | var categoryData = row.readTable(database.category);
19 |
20 | final model = NoteModel(
21 | id: noteData.id,
22 | title: noteData.title ?? '',
23 | content: noteData.content,
24 | createdAt: noteData.createdAt,
25 | colorIndex: noteData.colorIndex,
26 | isFavorite: noteData.isFavorite,
27 | categoryId: categoryData.id,
28 | category: categoryData.title,
29 | );
30 | noteList.add(model);
31 | }
32 | return noteList;
33 | }
34 |
35 | List fetchCategoryData(AppDatabase database,
36 | List result, Expression numberOfNotes) {
37 | final categories = [];
38 | for (final row in result) {
39 | var categoryData = row.readTable(database.category);
40 | final model = CategoryModel(
41 | id: categoryData.id,
42 | title: categoryData.title,
43 | color: categoryData.color,
44 | numberOfNotes: row.read(numberOfNotes));
45 | categories.add(model);
46 | }
47 |
48 | return categories;
49 | }
50 | }
51 |
52 | mixin ExtractCategoryData {
53 | CategoryModel extractCategoryData(String data) {
54 | debugPrint(data);
55 | final split = data.split(',');
56 | List values = [];
57 | for (int i = 0; i < split.length; i++) {
58 | values.add(split[i]);
59 | }
60 |
61 | int id = int.parse(values[0]!);
62 | int color = int.parse(values[1]!);
63 | values.removeRange(0, 2);
64 | String title = values.join();
65 |
66 | return CategoryModel(id: id, title: title, color: color);
67 | }
68 | }
69 |
70 | int generateColor() {
71 | return Color.fromRGBO(Random().nextInt(255), Random().nextInt(255),
72 | Random().nextInt(255), 1)
73 | .value;
74 | }
75 |
76 | bool isPersianLanguage() =>
77 | appLocale.languageCode == const Locale('fa', 'IR').languageCode;
78 |
79 | Future isFirstTime() async {
80 | final appPref = instance();
81 |
82 | var isFirstTime = await appPref.isFirstRun();
83 | if (!isFirstTime) {
84 | return false;
85 | } else {
86 | appPref.setFirstRun(false);
87 | return true;
88 | }
89 | }
90 |
--------------------------------------------------------------------------------
/lib/app/app_prefs.dart:
--------------------------------------------------------------------------------
1 | import 'package:shared_preferences/shared_preferences.dart';
2 |
3 | const String firstRun = 'first_time';
4 | const String darkMode = 'darkMode';
5 | const String appLanguage = 'appLang';
6 |
7 | class AppPreferences {
8 | final SharedPreferences _pref;
9 |
10 | AppPreferences(this._pref);
11 |
12 | Future setLanguage(String languageCode) async {
13 | return await _pref.setString(appLanguage, languageCode);
14 | }
15 |
16 | Future getLanguage() async {
17 | return _pref.getString(appLanguage) ?? "";
18 | }
19 |
20 | Future setFirstRun(bool isFirstRun) async {
21 | return _pref.setBool(firstRun, isFirstRun);
22 | }
23 |
24 | Future isFirstRun() async {
25 | //check def value
26 | return _pref.getBool(firstRun) ?? true;
27 | }
28 |
29 | Future setTheme(bool isDark) async {
30 | return _pref.setBool(darkMode, isDark);
31 | }
32 |
33 | Future getTheme() async {
34 | //check def value
35 | return _pref.getBool(darkMode) ?? false;
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/lib/app/app_providers.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter_bloc/flutter_bloc.dart';
2 | import 'package:provider/provider.dart';
3 | import 'package:yalda_students_notes/app/app.dart';
4 | import 'package:yalda_students_notes/data/datasource/database.dart';
5 | import 'package:yalda_students_notes/data/repository/category_repository_impl.dart';
6 | import 'package:yalda_students_notes/data/repository/note_repository_impl.dart';
7 | import 'package:yalda_students_notes/domain/model/category_model.dart';
8 | import 'package:yalda_students_notes/presentation/screen/category/bloc/category_bloc.dart';
9 | import 'package:yalda_students_notes/presentation/screen/category_notes/bloc/category_notes_bloc.dart';
10 | import 'package:yalda_students_notes/presentation/screen/note/bloc/notelist_bloc.dart';
11 | import 'package:yalda_students_notes/presentation/screen/onboarding/bloc/language_bloc.dart';
12 |
13 | final providerList = [
14 | ChangeNotifierProvider(create: (context) => AppDatabase()),
15 | BlocProvider(
16 | create: (context) => CategoryBloc(
17 | CategoryRepository(context.read()),
18 | CategoryModel(title: '', color: generateColor()))),
19 | BlocProvider(
20 | create: (context) =>
21 | NoteListBloc(NoteRepository(context.read()))),
22 | BlocProvider(create: (context) => OnBoardingBloc()),
23 | BlocProvider(
24 | create: (context) => CategoryNotesBloc(
25 | categoryRepository: CategoryRepository(context.read()),
26 | noteRepository: NoteRepository(context.read())),
27 | )
28 | ];
29 |
--------------------------------------------------------------------------------
/lib/app/const.dart:
--------------------------------------------------------------------------------
1 | class AppConstants {
2 |
3 | //config
4 | static const String appVersion = 'v1.0.0';
5 |
6 | //app
7 | static const double bottomNavigationHeight = 65;
8 | static const int openAnimationDuration = 1000;
9 |
10 | //routes
11 | static const String homeRoute = '/';
12 | static const String addNoteRoute = '/add_note';
13 | static const String editNoteRoute = '/edit_note';
14 |
15 | //URLs
16 | static const String githubUrl =
17 | 'https://github.com/yalda-student/student_note';
18 | static const String linkedInUrl =
19 | 'https://www.linkedin.com/in/yalda-mohasseli-270049178/';
20 |
21 | //messages
22 | static const String invalidDataType = 'Invalid data type';
23 | }
24 |
--------------------------------------------------------------------------------
/lib/app/di.dart:
--------------------------------------------------------------------------------
1 | import 'package:get_it/get_it.dart';
2 | import 'package:shared_preferences/shared_preferences.dart';
3 | import 'package:yalda_students_notes/app/app_prefs.dart';
4 |
5 | final instance = GetIt.instance;
6 |
7 | Future initAppModule() async {
8 | final sharedPrefs = await SharedPreferences.getInstance();
9 | instance.registerLazySingleton(() => sharedPrefs);
10 |
11 | instance.registerLazySingleton(
12 | () => AppPreferences(instance()));
13 | }
14 |
--------------------------------------------------------------------------------
/lib/app/exception.dart:
--------------------------------------------------------------------------------
1 | class AppException{
2 | final String message;
3 |
4 | AppException(this.message);
5 | }
--------------------------------------------------------------------------------
/lib/app/extensions.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:yalda_students_notes/app/app_prefs.dart';
3 | import 'package:yalda_students_notes/app/di.dart';
4 | import 'package:yalda_students_notes/presentation/util/theme_util.dart';
5 |
6 | extension BuildContextExts on BuildContext {
7 | bool screenIsHorizontal() {
8 | if (MediaQuery.of(this).size.width < MediaQuery.of(this).size.height) {
9 | //use horizontal |
10 | return true;
11 | } else {
12 | //use vertical __
13 | return false;
14 | }
15 | }
16 |
17 | void changeTheme(bool value, ThemeNotifier themeNotifier) async {
18 | (value)
19 | ? themeNotifier.setTheme(darkTheme)
20 | : themeNotifier.setTheme(lightTheme);
21 | final appPref = instance();
22 | await appPref.setTheme(value);
23 | }
24 |
25 | double get screenHeight => MediaQuery.of(this).size.height;
26 |
27 | double get screenWidth => MediaQuery.of(this).size.width;
28 | }
29 |
30 | extension StringExts on String {
31 | bool isLanguageRtl() {
32 | return this == (const Locale('fa', 'IR').languageCode);
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/lib/app/functions.dart:
--------------------------------------------------------------------------------
1 | import 'package:easy_localization/easy_localization.dart';
2 | import 'package:shamsi_date/shamsi_date.dart';
3 |
4 | String convertToJalaliDate(DateTime date){
5 | Jalali g2j1 = Gregorian.fromDateTime(date).toJalali();
6 | final jalaliDate = DateTime(g2j1.year, g2j1.month, g2j1.day);
7 | return DateFormat('yyyy/MM/dd').format(jalaliDate);
8 | }
--------------------------------------------------------------------------------
/lib/app/global.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | Locale appLocale = const Locale('en', 'US');
--------------------------------------------------------------------------------
/lib/data/datasource/connection/connection.dart:
--------------------------------------------------------------------------------
1 | // We use a conditional export to expose the right connection factory depending
2 | // on the platform.
3 | export 'unsupported.dart'
4 | if (dart.library.js) 'web.dart'
5 | if (dart.library.ffi) 'native.dart';
6 |
--------------------------------------------------------------------------------
/lib/data/datasource/connection/native.dart:
--------------------------------------------------------------------------------
1 | import 'dart:io';
2 | import 'dart:isolate';
3 |
4 | import 'package:drift/drift.dart';
5 | import 'package:drift/isolate.dart';
6 | import 'package:drift/native.dart';
7 | import 'package:path_provider/path_provider.dart';
8 | import 'package:path/path.dart' as p;
9 |
10 | /// Obtains a database connection for running drift in a Dart VM.
11 | ///
12 | /// The [NativeDatabase] from drift will synchronously use sqlite3's C APIs.
13 | /// To move synchronous database work off the main thread, we use a
14 | /// [DriftIsolate], which can run queries in a background isolate under the
15 | /// hood.
16 | DatabaseConnection connect() {
17 | return DatabaseConnection.delayed(Future.sync(() async {
18 | // Background isolates can't use platform channels, so let's use
19 | // `path_provider` in the main isolate and just send the result containing
20 | // the path over to the background isolate.
21 | final appDir = await getApplicationDocumentsDirectory();
22 | final dbPath = p.join(appDir.path, 'todos.db');
23 |
24 | final receiveDriftIsolate = ReceivePort();
25 | await Isolate.spawn(_entrypointForDriftIsolate,
26 | _IsolateStartRequest(receiveDriftIsolate.sendPort, dbPath));
27 |
28 | final driftIsolate = await receiveDriftIsolate.first as DriftIsolate;
29 | return driftIsolate.connect();
30 | }));
31 | }
32 |
33 | /// The entrypoint of isolates can only take a single message, but we need two
34 | /// (a send port to reach the originating isolate and the database's path that
35 | /// should be opened on the background isolate). So, we bundle this information
36 | /// in a single class.
37 | class _IsolateStartRequest {
38 | final SendPort talkToMain;
39 | final String databasePath;
40 |
41 | _IsolateStartRequest(this.talkToMain, this.databasePath);
42 | }
43 |
44 | /// The entrypoint for a background isolate launching a drift server.
45 | ///
46 | /// The main isolate can then connect to that isolate server to transparently
47 | /// run queries in the background.
48 | void _entrypointForDriftIsolate(_IsolateStartRequest request) {
49 | // The native database synchronously uses sqlite3's C API with `dart:ffi` for
50 | // a fast database implementation that doesn't require platform channels.
51 | final databaseImpl = NativeDatabase(File(request.databasePath));
52 |
53 | // We can use DriftIsolate.inCurrent because this function is the entrypoint
54 | // of a background isolate itself.
55 | final driftServer = DriftIsolate.inCurrent(
56 | () => DatabaseConnection.fromExecutor(databaseImpl));
57 |
58 | // Inform the main isolate about the server we just created.
59 | request.talkToMain.send(driftServer);
60 | }
61 |
--------------------------------------------------------------------------------
/lib/data/datasource/connection/unsupported.dart:
--------------------------------------------------------------------------------
1 | import 'package:drift/drift.dart';
2 |
3 | DatabaseConnection connect() {
4 | throw UnsupportedError(
5 | 'No suitable database implementation was found on this platform.');
6 | }
7 |
--------------------------------------------------------------------------------
/lib/data/datasource/connection/web.dart:
--------------------------------------------------------------------------------
1 | import 'dart:async';
2 | // ignore: avoid_web_libraries_in_flutter
3 | import 'dart:html';
4 |
5 | import 'package:drift/drift.dart';
6 | import 'package:drift/remote.dart';
7 | import 'package:drift/web.dart';
8 | import 'package:drift/wasm.dart';
9 | import 'package:http/http.dart' as http;
10 | import 'package:sqlite3/wasm.dart';
11 |
12 | const _useWorker = true;
13 |
14 | /// Obtains a database connection for running drift on the web.
15 | DatabaseConnection connect({bool isInWebWorker = false}) {
16 | if (_useWorker && !isInWebWorker) {
17 | final worker = SharedWorker('shared_worker.dart.js');
18 | return remote(worker.port!.channel());
19 | } else {
20 | return DatabaseConnection.delayed(Future.sync(() async {
21 | // We're using the experimental wasm support in Drift because this gives
22 | // us a recent sqlite3 version with fts5 support.
23 | // This is still experimental, so consider using the approach described in
24 | // https://drift.simonbinder.eu/web/ instead.
25 |
26 | final response = await http.get(Uri.parse('sqlite3.wasm'));
27 | final fs = await IndexedDbFileSystem.open(dbName: 'my_app');
28 | final sqlite3 = await WasmSqlite3.load(
29 | response.bodyBytes,
30 | SqliteEnvironment(fileSystem: fs),
31 | );
32 |
33 | final databaseImpl = WasmDatabase(sqlite3: sqlite3, path: 'app.db');
34 | return DatabaseConnection.fromExecutor(databaseImpl);
35 | }));
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/lib/data/datasource/table/category_data.dart:
--------------------------------------------------------------------------------
1 | import 'package:drift/drift.dart';
2 |
3 | class Category extends Table {
4 | IntColumn get id => integer().autoIncrement()();
5 |
6 | TextColumn get title => text().withLength(max: 255)();
7 |
8 | DateTimeColumn get createdAt => dateTime()();
9 |
10 | IntColumn get color => integer()();
11 | }
--------------------------------------------------------------------------------
/lib/data/datasource/table/note_data.dart:
--------------------------------------------------------------------------------
1 | import 'package:drift/drift.dart';
2 | import 'package:yalda_students_notes/data/datasource/table/category_data.dart';
3 |
4 | class Note extends Table {
5 | IntColumn get id => integer().autoIncrement()();
6 |
7 | TextColumn get title => text().withLength(max: 255).nullable()();
8 |
9 | TextColumn get content => text().named('body')();
10 |
11 | DateTimeColumn get createdAt => dateTime()();
12 |
13 | IntColumn get colorIndex => integer()();
14 |
15 | BoolColumn get isFavorite => boolean().withDefault(const Constant(false))();
16 |
17 | IntColumn get categoryId =>
18 | integer().withDefault(const Constant(1)).references(Category, #id,
19 | onDelete: KeyAction.setDefault, onUpdate: KeyAction.cascade)();
20 | }
--------------------------------------------------------------------------------
/lib/data/datasource/table/reastore_data.dart:
--------------------------------------------------------------------------------
1 | import 'package:drift/drift.dart';
2 | import 'package:yalda_students_notes/data/datasource/table/category_data.dart';
3 |
4 | class Note extends Table {
5 | IntColumn get id => integer().autoIncrement()();
6 | TextColumn get title => text().withLength(max: 255).nullable()();
7 | TextColumn get content => text().named('body')();
8 | DateTimeColumn get deletedAt => dateTime()();
9 | IntColumn get color => integer()();
10 | BoolColumn get isFavorite => boolean().withDefault(const Constant(false))();
11 | IntColumn get categoryId => integer()
12 | .nullable()
13 | .withDefault(const Constant(1))
14 | .references(Category, #id,
15 | onDelete: KeyAction.setDefault, onUpdate: KeyAction.cascade)();
16 | }
17 |
--------------------------------------------------------------------------------
/lib/data/drift_config.dart:
--------------------------------------------------------------------------------
1 |
2 | import 'package:yalda_students_notes/data/datasource/database.dart';
3 |
4 | class DriftConfig {
5 | static late AppDatabase appDatabase;
6 |
7 | static init() {
8 | appDatabase = AppDatabase();
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/lib/data/mapper/mapper.dart:
--------------------------------------------------------------------------------
1 | import 'package:drift/drift.dart';
2 | import 'package:yalda_students_notes/data/datasource/database.dart';
3 | import 'package:yalda_students_notes/domain/model/category_model.dart';
4 | import 'package:yalda_students_notes/domain/model/note_model.dart';
5 |
6 | extension CategoryModelMapper on CategoryModel {
7 | CategoryCompanion toCategoryCompanion() {
8 | return CategoryCompanion(
9 | id: const Value.absent(),
10 | title: Value(title),
11 | createdAt: Value(DateTime.now()),
12 | color: Value(color));
13 | }
14 |
15 | CategoryData toCategoryData() {
16 | return CategoryData(
17 | id: id, title: title, createdAt: DateTime.now(), color: color);
18 | }
19 | }
20 |
21 | extension NoteModelMapper on NoteModel {
22 | NoteData toNoteDate() {
23 | return NoteData(
24 | id: id,
25 | title: title,
26 | content: content,
27 | createdAt: createdAt,
28 | colorIndex: colorIndex,
29 | categoryId: categoryId,
30 | isFavorite: isFavorite);
31 | }
32 |
33 | NoteCompanion toNoteCompanion() {
34 | return NoteCompanion(
35 | id: const Value.absent(),
36 | title: Value(title),
37 | content: Value(content),
38 | createdAt: Value(createdAt),
39 | colorIndex: Value(colorIndex),
40 | isFavorite: Value(isFavorite),
41 | );
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/lib/data/repository/category_repository_impl.dart:
--------------------------------------------------------------------------------
1 | import 'package:yalda_students_notes/data/datasource/database.dart';
2 | import 'package:yalda_students_notes/domain/model/category_model.dart';
3 | import 'package:yalda_students_notes/domain/repository/category_repository.dart';
4 |
5 | class CategoryRepository implements ICategoryRepository {
6 | final AppDatabase datasource;
7 |
8 | CategoryRepository(this.datasource);
9 |
10 | @override
11 | Future insertCategory(CategoryModel category) {
12 | return datasource.addCategory(category);
13 | }
14 |
15 | @override
16 | Future updateCategory(CategoryModel category) {
17 | return datasource.updateCategory(category);
18 | }
19 |
20 | @override
21 | Future deleteCategory(int id) {
22 | return datasource.deleteCategory(id);
23 | }
24 |
25 | @override
26 | Future> getAllCategories() {
27 | return datasource.getAllCategories();
28 | }
29 |
30 | @override
31 | Future getCategoryTitle(int id) {
32 | return datasource.getCategoryTitle(id);
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/lib/data/repository/note_repository_impl.dart:
--------------------------------------------------------------------------------
1 | import 'package:yalda_students_notes/data/datasource/database.dart';
2 | import 'package:yalda_students_notes/domain/model/note_model.dart';
3 | import 'package:yalda_students_notes/domain/repository/note_repository.dart';
4 |
5 | class NoteRepository implements INoteRepository {
6 | final AppDatabase datasource;
7 |
8 | NoteRepository(this.datasource);
9 |
10 | @override
11 | Future insertNote(NoteModel note) {
12 | return datasource.insertNote(note);
13 | }
14 |
15 | @override
16 | Future updateNote(NoteModel note) async {
17 | return datasource.updateNote(note);
18 | }
19 |
20 | @override
21 | Future deleteNote(int id) {
22 | return datasource.deleteNote(id);
23 | }
24 |
25 | @override
26 | Future> getAllNotes({String searchKeyword = ''}) {
27 | return datasource.getAllNotes(searchKeyword);
28 | }
29 |
30 | @override
31 | Future getNoteById(int id) {
32 | return datasource.getNoteById(id);
33 | }
34 |
35 | @override
36 | Future> getNotesInCategory(int categoryId) async {
37 | return datasource.getNotesInCategory(categoryId);
38 | }
39 |
40 | @override
41 | Future> getStarredNotes() {
42 | return datasource.getStarNotes();
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/lib/domain/model/category_model.dart:
--------------------------------------------------------------------------------
1 | class CategoryModel {
2 | final int id;
3 | final String title;
4 | int color;
5 | int numberOfNotes;
6 |
7 | CategoryModel({
8 | this.id = -1,
9 | required this.title,
10 | required this.color,
11 | this.numberOfNotes = 0,
12 | });
13 |
14 | @override
15 | String toString() {
16 | return 'CategoryModel{id: $id, title: $title, color: $color, numberOfNotes: $numberOfNotes}';
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/lib/domain/model/country.dart:
--------------------------------------------------------------------------------
1 | import 'package:flag/flag.dart';
2 | import 'package:flutter/cupertino.dart';
3 |
4 | class Country {
5 | final String name;
6 | final Widget flag;
7 | final Locale locale;
8 |
9 | Country({required this.name, required this.flag, required this.locale});
10 | }
11 |
12 | final countries = [
13 | Country(
14 | name: 'English',
15 | locale: const Locale('en', 'US'),
16 | flag: Row(
17 | children: [
18 | SizedBox(
19 | width: 30,
20 | height: 30,
21 | child: Flag.fromCode(FlagsCode.US, height: 20)),
22 | const SizedBox(width: 8),
23 | const Text('English')
24 | ],
25 | )),
26 | Country(
27 | name: 'فارسی',
28 | locale: const Locale('fa', 'IR'),
29 | flag: Row(
30 | children: [
31 | SizedBox(
32 | width: 30,
33 | height: 30,
34 | child: Flag.fromCode(FlagsCode.IR, height: 20)),
35 | const SizedBox(width: 8),
36 | const Text('فارسی')
37 | ],
38 | )),
39 | ];
40 |
--------------------------------------------------------------------------------
/lib/domain/model/note_model.dart:
--------------------------------------------------------------------------------
1 | import 'package:yalda_students_notes/data/datasource/database.dart';
2 |
3 | class NoteModel {
4 | int id;
5 | String title;
6 | String content;
7 | DateTime createdAt;
8 | int colorIndex;
9 | bool isFavorite;
10 | int categoryId;
11 | String category;
12 |
13 | NoteModel(
14 | {this.id = -1,
15 | required this.title,
16 | required this.content,
17 | required this.createdAt,
18 | required this.colorIndex,
19 | required this.isFavorite,
20 | this.categoryId = 1,
21 | this.category = 'None'});
22 |
23 | NoteModel.fromNoteData(NoteData noteData)
24 | : id = noteData.id,
25 | title = noteData.title ?? '',
26 | content = noteData.content,
27 | createdAt = noteData.createdAt,
28 | colorIndex = noteData.colorIndex,
29 | isFavorite = noteData.isFavorite,
30 | category = '',
31 | categoryId = noteData.categoryId;
32 |
33 | @override
34 | String toString() {
35 | return 'NoteModel{id: $id, title: $title, content: $content, createdAt: $createdAt, color: $colorIndex, isFavorite: $isFavorite, categoryId: $categoryId, category: $category}';
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/lib/domain/repository/category_repository.dart:
--------------------------------------------------------------------------------
1 | import 'package:yalda_students_notes/domain/model/category_model.dart';
2 |
3 | abstract class ICategoryRepository {
4 | Future insertCategory(CategoryModel category);
5 |
6 | Future updateCategory(CategoryModel category);
7 |
8 | Future deleteCategory(int id);
9 |
10 | Future> getAllCategories();
11 |
12 | Future getCategoryTitle(int id);
13 | }
--------------------------------------------------------------------------------
/lib/domain/repository/note_repository.dart:
--------------------------------------------------------------------------------
1 | import 'package:yalda_students_notes/domain/model/note_model.dart';
2 |
3 | abstract class INoteRepository {
4 | Future insertNote(NoteModel note);
5 |
6 | Future updateNote(NoteModel note);
7 |
8 | Future deleteNote(int id);
9 |
10 | Future getNoteById(int id);
11 |
12 | Future> getAllNotes({String searchKeyword = ''});
13 |
14 | Future> getStarredNotes();
15 |
16 | Future> getNotesInCategory(int categoryId);
17 | }
--------------------------------------------------------------------------------
/lib/gen/fonts.gen.dart:
--------------------------------------------------------------------------------
1 | /// GENERATED CODE - DO NOT MODIFY BY HAND
2 | /// *****************************************************
3 | /// FlutterGen
4 | /// *****************************************************
5 |
6 | // coverage:ignore-file
7 | // ignore_for_file: type=lint
8 | // ignore_for_file: directives_ordering,unnecessary_import
9 |
10 | class FontFamily {
11 | FontFamily._();
12 |
13 | /// Font family: IRANMarker
14 | static const String iRANMarker = 'IRANMarker';
15 |
16 | /// Font family: ic_font
17 | static const String icFont = 'ic_font';
18 | }
19 |
--------------------------------------------------------------------------------
/lib/gen/translation/locale_keys.g.dart:
--------------------------------------------------------------------------------
1 | // DO NOT EDIT. This is code generated via package:easy_localization/generate.dart
2 |
3 | abstract class LocaleKeys {
4 | static const profileTitle = 'profileTitle';
5 | static const notes = 'notes';
6 | static const notesList = 'notesList';
7 | static const search = 'search';
8 | static const categories = 'categories';
9 | static const setting = 'setting';
10 | static const startSearching = 'startSearching';
11 | static const editNote = 'editNote';
12 | static const title = 'title';
13 | static const content = 'content';
14 | static const startTyping = 'startTyping';
15 | static const listCategories = 'listCategories';
16 | static const language = 'language';
17 | static const add_note = 'add_note';
18 | static const content_Cannot_Be_Empty = 'content_Cannot_Be_Empty';
19 | static const favorite_Notes = 'favorite_Notes';
20 | static const any_note = 'any_note';
21 | static const theme = 'theme';
22 | static const about = 'about';
23 | static const lets_go = 'lets_go';
24 | static const Colorful_Notes = 'Colorful_Notes';
25 | static const note_tutorial = 'note_tutorial';
26 | static const find_quickly = 'find_quickly';
27 | static const search_easily = 'search_easily';
28 | static const Manage_Notes = 'Manage_Notes';
29 | static const categorize_notes = 'categorize_notes';
30 | static const select_language = 'select_language';
31 | static const done = 'done';
32 | static const save = 'save';
33 | static const move = 'move';
34 | static const delete = 'delete';
35 | static const select_category = 'select_category';
36 | static const category_count_1 = 'category_count_1';
37 | static const category_count_2 = 'category_count_2';
38 | static const cancel = 'cancel';
39 | static const create = 'create';
40 | static const update = 'update';
41 | static const note = 'note';
42 | static const delete_none_category = 'delete_none_category';
43 | static const home = 'home';
44 | static const note_to_remember = 'note_to_remember';
45 | static const new_category = 'new_category';
46 | static const new_note = 'new_note';
47 | static const copy = 'copy';
48 | static const share = 'share';
49 |
50 | }
51 |
--------------------------------------------------------------------------------
/lib/presentation/resources/font_manager.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:responsive_framework/responsive_framework.dart';
3 |
4 | class FontConstants {
5 | static const String icFont = 'ic_font';
6 | static const String iranMarkerFont = 'IRANMarker';
7 | }
8 |
9 | class FontSize {
10 | static const double s11 = 11.0;
11 | static const double s12 = 12.0;
12 | static const double s13 = 13.0;
13 | static const double s14 = 14.0;
14 | static const double s15 = 15.0;
15 | static const double s16 = 16.0;
16 | static const double s17 = 17.0;
17 | static const double s18 = 18.0;
18 | static const double s19 = 19.0;
19 | static const double s20 = 20.0;
20 | static const double s22 = 22.0;
21 | static const double s28 = 28.0;
22 |
23 | static double alertDialogTitle(BuildContext context) =>
24 | ResponsiveValue(context, defaultValue: s19, valueWhen: [
25 | const Condition.equals(name: TABLET, value: s17),
26 | ]).value!;
27 |
28 | static double alertDialogContent(BuildContext context) =>
29 | ResponsiveValue(context, defaultValue: s16, valueWhen: [
30 | const Condition.equals(name: TABLET, value: s15),
31 | ]).value!;
32 |
33 | static double onBoardTitle(BuildContext context) =>
34 | ResponsiveValue(context, defaultValue: s28, valueWhen: [
35 | const Condition.equals(name: TABLET, value: s20),
36 | ]).value!;
37 |
38 | static double onBoardBody(BuildContext context) =>
39 | ResponsiveValue(context, defaultValue: s19, valueWhen: [
40 | const Condition.equals(name: TABLET, value: s16),
41 | ]).value!;
42 |
43 | static double body1(BuildContext context) =>
44 | ResponsiveValue(context, defaultValue: s16, valueWhen: [
45 | const Condition.equals(name: TABLET, value: s12),
46 | ]).value!;
47 |
48 |
49 | }
50 |
--------------------------------------------------------------------------------
/lib/presentation/resources/language_manager.dart:
--------------------------------------------------------------------------------
1 | import 'package:easy_localization/easy_localization.dart';
2 | import 'package:flutter/material.dart';
3 | import 'package:yalda_students_notes/app/app_prefs.dart';
4 | import 'package:yalda_students_notes/app/di.dart';
5 |
6 | mixin AppLanguage {
7 | void onLanguageChange(BuildContext context, Locale locale) async {
8 | await context.setLocale(locale);
9 | // EasyLocalization.of(context)!.setLocale(locale);
10 | final appPref = instance();
11 |
12 | if (locale == const Locale('en', 'US')) {
13 | appPref.setLanguage(const Locale('en', 'US').languageCode);
14 | } else {
15 | appPref.setLanguage(const Locale('fa', 'IR').languageCode);
16 | }
17 | }
18 | }
19 |
20 | Future getLanguageCode() async {
21 | final appPref = instance();
22 | return await appPref.getLanguage();
23 | }
24 |
25 | Map languagesMap = {
26 | const Locale('en', 'US'): "English",
27 | const Locale('fa', 'IR'): "فارسی",
28 | };
29 |
30 | List languagesList = ['English', 'فارسی'];
31 |
--------------------------------------------------------------------------------
/lib/presentation/resources/style_manager.dart:
--------------------------------------------------------------------------------
1 | import 'package:easy_localization/easy_localization.dart';
2 | import 'package:flutter/material.dart';
3 | import 'package:responsive_framework/responsive_framework.dart';
4 | import 'package:yalda_students_notes/presentation/resources/color_manager.dart';
5 | import 'package:yalda_students_notes/presentation/resources/font_manager.dart';
6 |
7 | class StyleManager {
8 | static TextStyle drawerTextStyle(BuildContext context) {
9 | return TextStyle(
10 | fontSize: ResponsiveValue(
11 | context,
12 | defaultValue: 15.0,
13 | valueWhen: const [
14 | Condition.equals(name: TABLET, value: 12.0),
15 | ],
16 | ).value,
17 | );
18 | }
19 |
20 | static TextStyle tabBarTextStyle(BuildContext context) {
21 | var isEn =
22 | EasyLocalization.of(context)!.currentLocale == const Locale('en', 'US');
23 | return Theme.of(context)
24 | .textTheme
25 | .bodyText1!
26 | .apply(fontSizeDelta: isEn ? 0.0 : -4.0);
27 | }
28 |
29 | static TextStyle headerTextStyle(BuildContext context) {
30 | var isEn =
31 | EasyLocalization.of(context)!.currentLocale == const Locale('en', 'US');
32 | return Theme.of(context)
33 | .textTheme
34 | .headline6!
35 | .apply(fontSizeDelta: isEn ? -2.0 : -5.0, fontWeightDelta: 5);
36 | }
37 |
38 | static TextStyle noteTitleTextStyle(ThemeData theme) {
39 | return TextStyle(
40 | overflow: TextOverflow.ellipsis,
41 | fontWeight: FontWeight.w800,
42 | fontSize: 18,
43 | color: theme.colorScheme.onSurface.withOpacity(0.85));
44 | }
45 |
46 | static TextStyle noteContentTextStyle(ThemeData theme) {
47 | return TextStyle(
48 | overflow: TextOverflow.ellipsis,
49 | fontWeight: FontWeight.w700,
50 | fontSize: 16,
51 | color: theme.colorScheme.onSurface.withOpacity(0.7));
52 | }
53 |
54 | static TextStyle noteCategoryTextStyle(ThemeData theme) {
55 | return TextStyle(
56 | overflow: TextOverflow.ellipsis,
57 | fontWeight: FontWeight.w400,
58 | fontSize: 10,
59 | color: theme.colorScheme.onSurface);
60 | }
61 |
62 | static TextStyle counterTextStyle(ThemeData theme) =>
63 | TextStyle(color: ColorManager.getNoteEditorTextColor(theme));
64 |
65 | static TextStyle dialogTitlePersianDarkTextStyle() => const TextStyle(
66 | fontFamily: FontConstants.iranMarkerFont,
67 | fontSize: 16,
68 | fontWeight: FontWeight.w500,
69 | color: Colors.white);
70 |
71 | static TextStyle dialogTitlePersianLightTextStyle() => const TextStyle(
72 | fontSize: 16,
73 | fontFamily: FontConstants.iranMarkerFont,
74 | fontWeight: FontWeight.w500,
75 | color: ColorManager.primaryDark);
76 |
77 | static TextStyle dialogTitleEnglishDarkTextStyle() => const TextStyle(
78 | fontFamily: FontConstants.icFont,
79 | fontSize: FontSize.s18,
80 | fontWeight: FontWeight.w600,
81 | color: Colors.white);
82 |
83 | static TextStyle dialogTitleEnglishLightTextStyle() => const TextStyle(
84 | fontFamily: FontConstants.icFont,
85 | fontSize: FontSize.s18,
86 | fontWeight: FontWeight.w600,
87 | color: ColorManager.primaryDark);
88 | }
89 |
--------------------------------------------------------------------------------
/lib/presentation/resources/value_manager.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:responsive_framework/responsive_framework.dart';
3 |
4 | class ValueManager {
5 | static const double gridSpacing = 20.0;
6 | }
7 |
8 | class AppPadding {
9 | static const double p0 = 0.0;
10 | static const double p4 = 4.0;
11 | static const double p6 = 6.0;
12 | static const double p8 = 8.0;
13 | static const double p10 = 10.0;
14 | static const double p12 = 12.0;
15 | static const double p16 = 16.0;
16 | }
17 |
18 | class AppSize {
19 | static const double s0 = 0.0;
20 | static const double s6 = 6.0;
21 | static const double s8 = 8.0;
22 | static const double s10 = 10.0;
23 | static const double s12 = 12.0;
24 | static const double s14 = 14.0;
25 | static const double s15 = 15.0;
26 | static const double s16 = 16.0;
27 | static const double s18 = 18.0;
28 | static const double s20 = 20.0;
29 | static const double s22 = 22.0;
30 | static const double s24 = 24.0;
31 | static const double s30 = 30.0;
32 |
33 | static double iconSize(BuildContext context) =>
34 | ResponsiveValue(context, defaultValue: s22, valueWhen: [
35 | const Condition.equals(name: TABLET, value: s20),
36 | ]).value!;
37 |
38 | static double colorPickerIconSize(BuildContext context) =>
39 | ResponsiveValue(context, defaultValue: s30, valueWhen: [
40 | const Condition.equals(name: TABLET, value: 24),
41 | ]).value!;
42 |
43 | static double checkIconSize(BuildContext context) =>
44 | ResponsiveValue(context, defaultValue: s18, valueWhen: [
45 | const Condition.equals(name: TABLET, value: s15),
46 | ]).value!;
47 | }
48 |
49 | const breakPoints = [
50 | ResponsiveBreakpoint.resize(300, name: MOBILE),
51 | ResponsiveBreakpoint.autoScale(650, name: TABLET),
52 | ResponsiveBreakpoint.resize(850, name: DESKTOP),
53 | ResponsiveBreakpoint.autoScale(1700, name: 'XL'),
54 | ];
55 |
--------------------------------------------------------------------------------
/lib/presentation/screen/add_note/bloc/addnote_bloc.dart:
--------------------------------------------------------------------------------
1 | import 'package:bloc/bloc.dart';
2 | import 'package:flutter/material.dart';
3 | import 'package:yalda_students_notes/data/repository/note_repository_impl.dart';
4 | import 'package:yalda_students_notes/domain/model/category_model.dart';
5 | import 'package:yalda_students_notes/domain/model/note_model.dart';
6 |
7 | part 'addnote_event.dart';
8 | part 'addnote_state.dart';
9 |
10 | class AddNoteBloc extends Bloc {
11 | final NoteModel _noteData;
12 | final NoteRepository repository;
13 |
14 | AddNoteBloc(this.repository, this._noteData)
15 | : super(AddNoteInitial(_noteData)) {
16 | on((event, emit) async {
17 | if (event is AddNoteSave) {
18 | if (_noteData.title.isEmpty) {
19 | _noteData.title = getFirstWord(_noteData.content);
20 | }
21 | await repository.insertNote(_noteData);
22 | } else if (event is AddNoteColorChange) {
23 | _noteData.colorIndex = event.colorIndex;
24 |
25 | emit(AddNoteInitial(_noteData));
26 | } else if (event is AddNoteTitleChange) {
27 | _noteData.title = event.title;
28 |
29 | emit(AddNoteInitial(_noteData));
30 | } else if (event is AddNoteCategoryChange) {
31 | _noteData.category = event.category.title;
32 | _noteData.categoryId = event.category.id;
33 |
34 | emit(AddNoteInitial(_noteData));
35 | } else if (event is AddNoteContentChange) {
36 | _noteData.content = event.content;
37 |
38 | emit(AddNoteInitial(_noteData));
39 | }
40 | });
41 | }
42 |
43 | String getFirstWord(String inputString) {
44 | List wordList = inputString.split(' ');
45 | if (wordList.isNotEmpty) {
46 | return wordList[0];
47 | } else {
48 | return ' ';
49 | }
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/lib/presentation/screen/add_note/bloc/addnote_event.dart:
--------------------------------------------------------------------------------
1 | part of 'addnote_bloc.dart';
2 |
3 | @immutable
4 | abstract class AddNoteEvent {}
5 |
6 | class AddNoteSave extends AddNoteEvent {}
7 |
8 | class AddNoteColorChange extends AddNoteEvent {
9 | final int colorIndex;
10 |
11 | AddNoteColorChange(this.colorIndex);
12 | }
13 |
14 | class AddNoteContentChange extends AddNoteEvent {
15 | final String content;
16 |
17 | AddNoteContentChange(this.content);
18 | }
19 |
20 | class AddNoteTitleChange extends AddNoteEvent {
21 | final String title;
22 |
23 | AddNoteTitleChange(this.title);
24 | }
25 |
26 | class AddNoteCategoryChange extends AddNoteEvent{
27 |
28 | final CategoryModel category;
29 |
30 | AddNoteCategoryChange(this.category);
31 | }
--------------------------------------------------------------------------------
/lib/presentation/screen/add_note/bloc/addnote_state.dart:
--------------------------------------------------------------------------------
1 | part of 'addnote_bloc.dart';
2 |
3 | @immutable
4 | abstract class AddNoteState {
5 | final NoteModel noteData;
6 |
7 | const AddNoteState(this.noteData);
8 | }
9 |
10 | class AddNoteInitial extends AddNoteState {
11 | const AddNoteInitial(NoteModel noteData) : super(noteData);
12 | }
13 |
--------------------------------------------------------------------------------
/lib/presentation/screen/category/bloc/category_bloc.dart:
--------------------------------------------------------------------------------
1 | import 'package:bloc/bloc.dart';
2 | import 'package:equatable/equatable.dart';
3 | import 'package:yalda_students_notes/app/app.dart';
4 | import 'package:yalda_students_notes/data/repository/category_repository_impl.dart';
5 | import 'package:yalda_students_notes/domain/model/category_model.dart';
6 |
7 | part 'category_event.dart';
8 | part 'category_state.dart';
9 |
10 | class CategoryBloc extends Bloc {
11 | final CategoryRepository repository;
12 | CategoryModel _category;
13 |
14 | CategoryBloc(this.repository, this._category) : super(CategoryInitial()) {
15 | on((event, emit) async {
16 | if (event is CategoryStart) {
17 | final data = await repository.getAllCategories();
18 | emit(CategorySuccess(data));
19 | } else if (event is CategoryInsert) {
20 | _category.color = generateColor();
21 | repository.insertCategory(_category);
22 | }
23 | if (event is CategoryDelete) {
24 | await repository.deleteCategory(event.categoryId);
25 | } else if (event is CategoryTextFieldChange) {
26 | _category =
27 | CategoryModel(title: event.categoryName, color: _category.color);
28 | }
29 | });
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/lib/presentation/screen/category/bloc/category_event.dart:
--------------------------------------------------------------------------------
1 | part of 'category_bloc.dart';
2 |
3 | abstract class CategoryEvent extends Equatable {
4 | const CategoryEvent();
5 | }
6 |
7 | class CategoryStart extends CategoryEvent {
8 | @override
9 | List