├── .gitignore
├── .metadata
├── .vscode
└── settings.json
├── README.md
├── analysis_options.yaml
├── android
├── .gitignore
├── app
│ ├── build.gradle
│ └── src
│ │ ├── debug
│ │ └── AndroidManifest.xml
│ │ ├── main
│ │ ├── AndroidManifest.xml
│ │ ├── kotlin
│ │ │ └── com
│ │ │ │ └── example
│ │ │ │ └── simple_app
│ │ │ │ └── MainActivity.kt
│ │ └── res
│ │ │ ├── drawable-hdpi
│ │ │ └── splash.png
│ │ │ ├── drawable-mdpi
│ │ │ └── splash.png
│ │ │ ├── drawable-night-hdpi
│ │ │ └── splash.png
│ │ │ ├── drawable-night-mdpi
│ │ │ └── splash.png
│ │ │ ├── drawable-night-v21
│ │ │ ├── background.png
│ │ │ └── launch_background.xml
│ │ │ ├── drawable-night-xhdpi
│ │ │ └── splash.png
│ │ │ ├── drawable-night-xxhdpi
│ │ │ └── splash.png
│ │ │ ├── drawable-night-xxxhdpi
│ │ │ └── splash.png
│ │ │ ├── drawable-night
│ │ │ ├── background.png
│ │ │ └── launch_background.xml
│ │ │ ├── drawable-v21
│ │ │ ├── background.png
│ │ │ └── launch_background.xml
│ │ │ ├── drawable-xhdpi
│ │ │ └── splash.png
│ │ │ ├── drawable-xxhdpi
│ │ │ └── splash.png
│ │ │ ├── drawable-xxxhdpi
│ │ │ └── splash.png
│ │ │ ├── drawable
│ │ │ ├── background.png
│ │ │ └── launch_background.xml
│ │ │ ├── mipmap-hdpi
│ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-mdpi
│ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-xhdpi
│ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-xxhdpi
│ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-xxxhdpi
│ │ │ └── ic_launcher.png
│ │ │ ├── values-night
│ │ │ └── styles.xml
│ │ │ ├── values
│ │ │ └── styles.xml
│ │ │ └── xml
│ │ │ └── file_paths.xml
│ │ └── profile
│ │ └── AndroidManifest.xml
├── build.gradle
├── gradle.properties
├── gradle
│ └── wrapper
│ │ └── gradle-wrapper.properties
└── settings.gradle
├── assets
├── 15199.mp3
├── logo_lockup_flutter_vertical.png
└── logo_lockup_flutter_vertical_wht.png
├── build.sh
├── devtools_options.yaml
├── images
└── env
│ ├── 0}5OX~((%WGFCIN19`EL@DA.png
│ ├── 4~BQ3HG0O7TK11RFP@]$~_W.png
│ ├── 9J@{U3NEC~7%P)$KG}[ZOHY.png
│ └── JGY{NH0VV[F]XT07XQ$BJO3.png
├── ios
├── .gitignore
├── Flutter
│ ├── AppFrameworkInfo.plist
│ ├── Debug.xcconfig
│ └── Release.xcconfig
├── 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
├── common
│ ├── color.dart
│ └── global.dart
├── components
│ ├── base
│ │ ├── base_animated_opacity.dart
│ │ ├── base_icon.dart
│ │ ├── base_text.dart
│ │ ├── build_base_app_bar.dart
│ │ ├── draggable_floating_action_button.dart
│ │ ├── hide_key_bord.dart
│ │ ├── loading.dart
│ │ └── tabs.dart
│ ├── search_bar.dart
│ └── todoList
│ │ ├── build_todo_list_title.dart
│ │ └── todo_list.dart
├── data
│ └── index.dart
├── generated
│ ├── intl
│ │ ├── messages_all.dart
│ │ ├── messages_en.dart
│ │ └── messages_zh_CN.dart
│ └── l10n.dart
├── l10n
│ ├── intl_en.arb
│ └── intl_zh_CN.arb
├── main.dart
├── model
│ └── note.dart
├── page
│ ├── calculator.dart
│ ├── count_down.dart
│ ├── note_editor_page.dart
│ ├── note_page.dart
│ ├── setting_page.dart
│ ├── todo_list_page.dart
│ └── tool_kit_page.dart
├── provider
│ ├── current_locale.dart
│ └── current_theme.dart
├── router.dart
└── utils
│ ├── common_utils_import.dart
│ ├── index.dart
│ ├── notification.dart
│ ├── request_notice_permission.dart
│ ├── show_dialog.dart
│ └── show_toast.dart
├── my_webApp
├── assets
│ ├── AssetManifest.bin
│ ├── AssetManifest.bin.json
│ ├── AssetManifest.json
│ ├── FontManifest.json
│ ├── NOTICES
│ ├── assets
│ │ └── 15199.mp3
│ ├── fonts
│ │ └── MaterialIcons-Regular.otf
│ ├── packages
│ │ ├── cupertino_icons
│ │ │ └── assets
│ │ │ │ └── CupertinoIcons.ttf
│ │ ├── flutter_sound_web
│ │ │ ├── howler
│ │ │ │ └── howler.js
│ │ │ └── src
│ │ │ │ ├── flutter_sound.js
│ │ │ │ ├── flutter_sound_player.js
│ │ │ │ └── flutter_sound_recorder.js
│ │ ├── fluttertoast
│ │ │ └── assets
│ │ │ │ ├── toastify.css
│ │ │ │ └── toastify.js
│ │ └── quill_native_bridge_linux
│ │ │ └── assets
│ │ │ └── xclip
│ └── shaders
│ │ └── ink_sparkle.frag
├── canvaskit
│ ├── canvaskit.js
│ ├── canvaskit.js.symbols
│ ├── canvaskit.wasm
│ ├── chromium
│ │ ├── canvaskit.js
│ │ ├── canvaskit.js.symbols
│ │ └── canvaskit.wasm
│ ├── skwasm.js
│ ├── skwasm.js.symbols
│ ├── skwasm.wasm
│ └── skwasm.worker.js
├── favicon.png
├── flutter.js
├── flutter_bootstrap.js
├── flutter_service_worker.js
├── icons
│ ├── Icon-192.png
│ ├── Icon-512.png
│ ├── Icon-maskable-192.png
│ └── Icon-maskable-512.png
├── index.html
├── main.dart.js
├── manifest.json
└── version.json
├── pubspec.lock
├── pubspec.yaml
├── release
└── app.apk
├── test
└── widget_test.dart
├── web
├── favicon.png
├── icons
│ ├── Icon-192.png
│ ├── Icon-512.png
│ ├── Icon-maskable-192.png
│ └── Icon-maskable-512.png
├── index.html
└── manifest.json
└── windows
├── .gitignore
├── CMakeLists.txt
├── flutter
├── CMakeLists.txt
├── generated_plugin_registrant.cc
├── generated_plugin_registrant.h
└── generated_plugins.cmake
└── runner
├── CMakeLists.txt
├── Runner.rc
├── flutter_window.cpp
├── flutter_window.h
├── main.cpp
├── resource.h
├── resources
└── app_icon.ico
├── runner.exe.manifest
├── utils.cpp
├── utils.h
├── win32_window.cpp
└── win32_window.h
/.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 | .vscode/
18 |
19 | # The .vscode folder contains launch configuration and tasks you configure in
20 | # VS Code which you may wish to be included in version control, so this line
21 | # is commented out by default.
22 | #.vscode/
23 |
24 | # Flutter/Dart/Pub related
25 | **/doc/api/
26 | **/ios/Flutter/.last_build_id
27 | .dart_tool/
28 | .flutter-plugins
29 | .flutter-plugins-dependencies
30 | .packages
31 | .pub-cache/
32 | .pub/
33 | /build/
34 |
35 | # Web related
36 |
37 | # Symbolication related
38 | app.*.symbols
39 |
40 | # Obfuscation related
41 | app.*.map.json
42 |
43 | # Android Studio will place build artifacts here
44 | /android/app/debug
45 | /android/app/profile
46 | /android/app/release
47 |
--------------------------------------------------------------------------------
/.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: 5f105a6ca7a5ac7b8bc9b241f4c2d86f4188cf5c
8 | channel: stable
9 |
10 | project_type: app
11 |
--------------------------------------------------------------------------------
/.vscode/settings.json:
--------------------------------------------------------------------------------
1 | {
2 | "cSpell.words": [
3 | "appbar",
4 | "autofocus",
5 | "AUTOINCREMENT",
6 | "bord",
7 | "cupertino",
8 | "Draggable",
9 | "fluttertoast",
10 | "initialise",
11 | "listdata",
12 | "listkey",
13 | "localizely",
14 | "LTRB",
15 | "mipmap",
16 | "navigatorkey",
17 | "Neumorphic",
18 | "nullsafety",
19 | "prefs",
20 | "prefsinstance",
21 | "RGBO",
22 | "screenutil",
23 | "sqflite",
24 | "todolist",
25 | "unfocus",
26 | "zefyr"
27 | ]
28 | }
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # simple_app
2 |
3 | 这是一个好玩的flutter项目, 仅供学习,喜欢的话请点个star。
4 |
5 | ## 主要有这四大核心应用
6 | 1. 代办事项
7 | 2. 便签
8 | 3. 计算器
9 | 4. 计时器
10 |
11 | ## 功能点如下
12 |
13 | 1. 国际化(支持中英文语言环境切换)
14 | 2. 夜间模式
15 | 3. 下拉加载数据
16 | 4. 权限申请和本地通知
17 | 5. sqlite持久化储存
18 | 6. 启动页
19 | 7. 富文本编辑
20 | 8. 防误触退出App
21 | 9. 便签长按多选删除
22 | 10. todo置顶or取消置顶
23 | 11. todoList删除新增展开动画
24 | 12. todo滑动列表右滑菜单
25 | 13. 计算器表达式字体放大缩小动画,字体自动缩放大小
26 | 14. 便签列表瀑布流展示
27 | 15. 微光背景
28 | 16. 新拟物风格ui
29 | 17. 音乐播放振动
30 | 18. ...
31 |
32 | ## 环境配置如下
33 |
34 | ```
35 | Flutter (Channel stable, 2.10.0, on Microsoft Windows [Version 10.0.19043.1526], locale zh-CN)
36 | • Flutter version 2.10.0 at D:\software\flutter
37 | • Upstream repository https://github.com/flutter/flutter.git
38 | • Framework revision 5f105a6ca7 (3 weeks ago), 2022-02-01 14:15:42 -0800
39 | • Engine revision 776efd2034
40 | • Dart version 2.16.0
41 | • DevTools version 2.9.2
42 | • Pub download mirror https://pub.flutter-io.cn
43 | • Flutter download mirror https://storage.flutter-io.cn
44 |
45 | [√] Android toolchain - develop for Android devices (Android SDK version 32.0.0)
46 | • Android SDK at C:\Users\Admin\AppData\Local\Android\sdk
47 | • Platform android-32, build-tools 32.0.0
48 | • Java binary at: D:\software\AndroidStudio\jre\bin\java
49 | • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
50 | • All Android licenses accepted.
51 | ```
52 | 推荐安装 2.10.0 版本 [flutter](https://storage.flutter-io.cn/flutter_infra_release/releases/stable/windows/flutter_windows_2.10.0-stable.zip)
53 | ### Flutter 设定镜像配置环境变量
54 | ```shell
55 | set PUB_HOSTED_URL=https://pub.flutter-io.cn
56 | set FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn
57 | ```
58 |
59 | ## 打包部署命令
60 | ```shell
61 | flutter build apk --obfuscate --split-debug-info=splitMap --target-platform android-arm,android-arm64,android-x64 --split-per-abi
62 | ```
63 | ## 打包arm64架构app
64 | ```
65 | flutter build apk --obfuscate --split-debug-info=splitMap --target-platform android-arm64
66 | ```
67 |
68 | ### app相关截图如下
69 | 
70 |
71 | 
72 |
73 | 
74 |
75 | 
76 |
77 | 
78 |
79 | 
80 |
81 | 
82 |
83 | 
84 |
85 | 
86 |
87 | 
88 |
89 |
--------------------------------------------------------------------------------
/analysis_options.yaml:
--------------------------------------------------------------------------------
1 | # This file configures the analyzer, which statically analyzes Dart code to
2 | # check for errors, warnings, and lints.
3 | #
4 | # The issues identified by the analyzer are surfaced in the UI of Dart-enabled
5 | # IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
6 | # invoked from the command line by running `flutter analyze`.
7 |
8 | # The following line activates a set of recommended lints for Flutter apps,
9 | # packages, and plugins designed to encourage good coding practices.
10 | include: package:flutter_lints/flutter.yaml
11 |
12 | linter:
13 | # The lint rules applied to this project can be customized in the
14 | # section below to disable rules from the `package:flutter_lints/flutter.yaml`
15 | # included above or to enable additional rules. A list of all available lints
16 | # and their documentation is published at
17 | # https://dart-lang.github.io/linter/lints/index.html.
18 | #
19 | # Instead of disabling a lint rule for the entire project in the
20 | # section below, it can also be suppressed for a single line of code
21 | # or a specific dart file by using the `// ignore: name_of_lint` and
22 | # `// ignore_for_file: name_of_lint` syntax on the line or in the file
23 | # producing the lint.
24 | rules:
25 | # avoid_print: false # Uncomment to disable the `avoid_print` rule
26 | # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule
27 |
28 | # Additional information about this file can be found at
29 | # https://dart.dev/guides/language/analysis-options
30 |
--------------------------------------------------------------------------------
/android/.gitignore:
--------------------------------------------------------------------------------
1 | gradle-wrapper.jar
2 | /.gradle
3 | /captures/
4 | /gradlew
5 | /gradlew.bat
6 | /local.properties
7 | GeneratedPluginRegistrant.java
8 |
9 | # Remember to never publicly share your keystore.
10 | # See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app
11 | key.properties
12 | **/*.keystore
13 | **/*.jks
14 |
--------------------------------------------------------------------------------
/android/app/build.gradle:
--------------------------------------------------------------------------------
1 | def localProperties = new Properties()
2 | def localPropertiesFile = rootProject.file('local.properties')
3 | if (localPropertiesFile.exists()) {
4 | localPropertiesFile.withReader('UTF-8') { reader ->
5 | localProperties.load(reader)
6 | }
7 | }
8 |
9 | def flutterRoot = localProperties.getProperty('flutter.sdk')
10 | if (flutterRoot == null) {
11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
12 | }
13 |
14 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
15 | if (flutterVersionCode == null) {
16 | flutterVersionCode = '1'
17 | }
18 |
19 | def flutterVersionName = localProperties.getProperty('flutter.versionName')
20 | if (flutterVersionName == null) {
21 | flutterVersionName = '1.0'
22 | }
23 |
24 | apply plugin: 'com.android.application'
25 | apply plugin: 'kotlin-android'
26 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
27 |
28 | android {
29 | compileSdkVersion flutter.compileSdkVersion
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.simple_app"
47 | // minSdkVersion flutter.minSdkVersion
48 | minSdkVersion 18
49 | targetSdkVersion flutter.targetSdkVersion
50 | versionCode flutterVersionCode.toInteger()
51 | versionName flutterVersionName
52 | }
53 |
54 | buildTypes {
55 | release {
56 | // TODO: Add your own signing config for the release build.
57 | // Signing with the debug keys for now, so `flutter run --release` works.
58 | signingConfig signingConfigs.debug
59 | }
60 | }
61 | }
62 |
63 | flutter {
64 | source '../..'
65 | }
66 |
67 | dependencies {
68 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
69 | }
70 |
--------------------------------------------------------------------------------
/android/app/src/debug/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/android/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
7 |
11 |
21 |
25 |
29 |
30 |
31 |
32 |
33 |
34 |
36 |
39 |
44 |
47 |
48 |
49 |
50 |
--------------------------------------------------------------------------------
/android/app/src/main/kotlin/com/example/simple_app/MainActivity.kt:
--------------------------------------------------------------------------------
1 | package com.example.simple_app
2 |
3 | import io.flutter.embedding.android.FlutterActivity
4 |
5 | class MainActivity: FlutterActivity() {
6 | }
7 |
--------------------------------------------------------------------------------
/android/app/src/main/res/drawable-hdpi/splash.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/path-yu/simple_app/cba8bf127bf6020dbb8b914b8bac7a5d79b6ed21/android/app/src/main/res/drawable-hdpi/splash.png
--------------------------------------------------------------------------------
/android/app/src/main/res/drawable-mdpi/splash.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/path-yu/simple_app/cba8bf127bf6020dbb8b914b8bac7a5d79b6ed21/android/app/src/main/res/drawable-mdpi/splash.png
--------------------------------------------------------------------------------
/android/app/src/main/res/drawable-night-hdpi/splash.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/path-yu/simple_app/cba8bf127bf6020dbb8b914b8bac7a5d79b6ed21/android/app/src/main/res/drawable-night-hdpi/splash.png
--------------------------------------------------------------------------------
/android/app/src/main/res/drawable-night-mdpi/splash.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/path-yu/simple_app/cba8bf127bf6020dbb8b914b8bac7a5d79b6ed21/android/app/src/main/res/drawable-night-mdpi/splash.png
--------------------------------------------------------------------------------
/android/app/src/main/res/drawable-night-v21/background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/path-yu/simple_app/cba8bf127bf6020dbb8b914b8bac7a5d79b6ed21/android/app/src/main/res/drawable-night-v21/background.png
--------------------------------------------------------------------------------
/android/app/src/main/res/drawable-night-v21/launch_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | -
4 |
5 |
6 | -
7 |
8 |
9 |
--------------------------------------------------------------------------------
/android/app/src/main/res/drawable-night-xhdpi/splash.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/path-yu/simple_app/cba8bf127bf6020dbb8b914b8bac7a5d79b6ed21/android/app/src/main/res/drawable-night-xhdpi/splash.png
--------------------------------------------------------------------------------
/android/app/src/main/res/drawable-night-xxhdpi/splash.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/path-yu/simple_app/cba8bf127bf6020dbb8b914b8bac7a5d79b6ed21/android/app/src/main/res/drawable-night-xxhdpi/splash.png
--------------------------------------------------------------------------------
/android/app/src/main/res/drawable-night-xxxhdpi/splash.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/path-yu/simple_app/cba8bf127bf6020dbb8b914b8bac7a5d79b6ed21/android/app/src/main/res/drawable-night-xxxhdpi/splash.png
--------------------------------------------------------------------------------
/android/app/src/main/res/drawable-night/background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/path-yu/simple_app/cba8bf127bf6020dbb8b914b8bac7a5d79b6ed21/android/app/src/main/res/drawable-night/background.png
--------------------------------------------------------------------------------
/android/app/src/main/res/drawable-night/launch_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | -
4 |
5 |
6 | -
7 |
8 |
9 |
--------------------------------------------------------------------------------
/android/app/src/main/res/drawable-v21/background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/path-yu/simple_app/cba8bf127bf6020dbb8b914b8bac7a5d79b6ed21/android/app/src/main/res/drawable-v21/background.png
--------------------------------------------------------------------------------
/android/app/src/main/res/drawable-v21/launch_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | -
4 |
5 |
6 | -
7 |
8 |
9 |
--------------------------------------------------------------------------------
/android/app/src/main/res/drawable-xhdpi/splash.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/path-yu/simple_app/cba8bf127bf6020dbb8b914b8bac7a5d79b6ed21/android/app/src/main/res/drawable-xhdpi/splash.png
--------------------------------------------------------------------------------
/android/app/src/main/res/drawable-xxhdpi/splash.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/path-yu/simple_app/cba8bf127bf6020dbb8b914b8bac7a5d79b6ed21/android/app/src/main/res/drawable-xxhdpi/splash.png
--------------------------------------------------------------------------------
/android/app/src/main/res/drawable-xxxhdpi/splash.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/path-yu/simple_app/cba8bf127bf6020dbb8b914b8bac7a5d79b6ed21/android/app/src/main/res/drawable-xxxhdpi/splash.png
--------------------------------------------------------------------------------
/android/app/src/main/res/drawable/background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/path-yu/simple_app/cba8bf127bf6020dbb8b914b8bac7a5d79b6ed21/android/app/src/main/res/drawable/background.png
--------------------------------------------------------------------------------
/android/app/src/main/res/drawable/launch_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | -
4 |
5 |
6 | -
7 |
8 |
9 |
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/path-yu/simple_app/cba8bf127bf6020dbb8b914b8bac7a5d79b6ed21/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/path-yu/simple_app/cba8bf127bf6020dbb8b914b8bac7a5d79b6ed21/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/path-yu/simple_app/cba8bf127bf6020dbb8b914b8bac7a5d79b6ed21/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/path-yu/simple_app/cba8bf127bf6020dbb8b914b8bac7a5d79b6ed21/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/path-yu/simple_app/cba8bf127bf6020dbb8b914b8bac7a5d79b6ed21/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/values-night/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
16 |
19 |
--------------------------------------------------------------------------------
/android/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
16 |
19 |
--------------------------------------------------------------------------------
/android/app/src/main/res/xml/file_paths.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/android/app/src/profile/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/android/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | ext.kotlin_version = '1.6.10'
3 | repositories {
4 | google()
5 | mavenCentral()
6 | }
7 |
8 | dependencies {
9 | classpath 'com.android.tools.build:gradle:7.0.0'
10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
11 | }
12 | }
13 |
14 | allprojects {
15 | repositories {
16 | google()
17 | mavenCentral()
18 | }
19 | }
20 |
21 | rootProject.buildDir = '../build'
22 | subprojects {
23 | project.buildDir = "${rootProject.buildDir}/${project.name}"
24 | }
25 | subprojects {
26 | project.evaluationDependsOn(':app')
27 | }
28 |
29 | task clean(type: Delete) {
30 | delete rootProject.buildDir
31 | }
32 |
--------------------------------------------------------------------------------
/android/gradle.properties:
--------------------------------------------------------------------------------
1 | org.gradle.jvmargs=-Xmx1536M
2 | android.useAndroidX=true
3 | android.enableJetifier=true
4 |
--------------------------------------------------------------------------------
/android/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #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.3-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 |
--------------------------------------------------------------------------------
/assets/15199.mp3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/path-yu/simple_app/cba8bf127bf6020dbb8b914b8bac7a5d79b6ed21/assets/15199.mp3
--------------------------------------------------------------------------------
/assets/logo_lockup_flutter_vertical.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/path-yu/simple_app/cba8bf127bf6020dbb8b914b8bac7a5d79b6ed21/assets/logo_lockup_flutter_vertical.png
--------------------------------------------------------------------------------
/assets/logo_lockup_flutter_vertical_wht.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/path-yu/simple_app/cba8bf127bf6020dbb8b914b8bac7a5d79b6ed21/assets/logo_lockup_flutter_vertical_wht.png
--------------------------------------------------------------------------------
/build.sh:
--------------------------------------------------------------------------------
1 |
2 | flutter build web --release --web-renderer auto
3 |
4 | # 创建目标目录
5 | TARGET_DIR="my_webApp"
6 | mkdir -p $TARGET_DIR # 移动生成的文件到目标目录
7 | mv build/web/* $TARGET_DIR
--------------------------------------------------------------------------------
/devtools_options.yaml:
--------------------------------------------------------------------------------
1 | description: This file stores settings for Dart & Flutter DevTools.
2 | documentation: https://docs.flutter.dev/tools/devtools/extensions#configure-extension-enablement-states
3 | extensions:
4 |
--------------------------------------------------------------------------------
/images/env/0}5OX~((%WGFCIN19`EL@DA.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/path-yu/simple_app/cba8bf127bf6020dbb8b914b8bac7a5d79b6ed21/images/env/0}5OX~((%WGFCIN19`EL@DA.png
--------------------------------------------------------------------------------
/images/env/4~BQ3HG0O7TK11RFP@]$~_W.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/path-yu/simple_app/cba8bf127bf6020dbb8b914b8bac7a5d79b6ed21/images/env/4~BQ3HG0O7TK11RFP@]$~_W.png
--------------------------------------------------------------------------------
/images/env/9J@{U3NEC~7%P)$KG}[ZOHY.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/path-yu/simple_app/cba8bf127bf6020dbb8b914b8bac7a5d79b6ed21/images/env/9J@{U3NEC~7%P)$KG}[ZOHY.png
--------------------------------------------------------------------------------
/images/env/JGY{NH0VV[F]XT07XQ$BJO3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/path-yu/simple_app/cba8bf127bf6020dbb8b914b8bac7a5d79b6ed21/images/env/JGY{NH0VV[F]XT07XQ$BJO3.png
--------------------------------------------------------------------------------
/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 "Generated.xcconfig"
2 |
--------------------------------------------------------------------------------
/ios/Flutter/Release.xcconfig:
--------------------------------------------------------------------------------
1 | #include "Generated.xcconfig"
2 |
--------------------------------------------------------------------------------
/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 | if #available(iOS 10.0, *) {
12 | UNUserNotificationCenter.current().delegate = self as? UNUserNotificationCenterDelegate
13 | }
14 | return super.application(application, didFinishLaunchingWithOptions: launchOptions)
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/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/path-yu/simple_app/cba8bf127bf6020dbb8b914b8bac7a5d79b6ed21/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/path-yu/simple_app/cba8bf127bf6020dbb8b914b8bac7a5d79b6ed21/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/path-yu/simple_app/cba8bf127bf6020dbb8b914b8bac7a5d79b6ed21/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/path-yu/simple_app/cba8bf127bf6020dbb8b914b8bac7a5d79b6ed21/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/path-yu/simple_app/cba8bf127bf6020dbb8b914b8bac7a5d79b6ed21/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/path-yu/simple_app/cba8bf127bf6020dbb8b914b8bac7a5d79b6ed21/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/path-yu/simple_app/cba8bf127bf6020dbb8b914b8bac7a5d79b6ed21/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/path-yu/simple_app/cba8bf127bf6020dbb8b914b8bac7a5d79b6ed21/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/path-yu/simple_app/cba8bf127bf6020dbb8b914b8bac7a5d79b6ed21/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/path-yu/simple_app/cba8bf127bf6020dbb8b914b8bac7a5d79b6ed21/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/path-yu/simple_app/cba8bf127bf6020dbb8b914b8bac7a5d79b6ed21/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/path-yu/simple_app/cba8bf127bf6020dbb8b914b8bac7a5d79b6ed21/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/path-yu/simple_app/cba8bf127bf6020dbb8b914b8bac7a5d79b6ed21/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/path-yu/simple_app/cba8bf127bf6020dbb8b914b8bac7a5d79b6ed21/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/path-yu/simple_app/cba8bf127bf6020dbb8b914b8bac7a5d79b6ed21/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/path-yu/simple_app/cba8bf127bf6020dbb8b914b8bac7a5d79b6ed21/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/path-yu/simple_app/cba8bf127bf6020dbb8b914b8bac7a5d79b6ed21/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/path-yu/simple_app/cba8bf127bf6020dbb8b914b8bac7a5d79b6ed21/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md:
--------------------------------------------------------------------------------
1 | # Launch Screen Assets
2 |
3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory.
4 |
5 | You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images.
--------------------------------------------------------------------------------
/ios/Runner/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 | CFBundleDisplayName
8 | Simple App
9 | CFBundleExecutable
10 | $(EXECUTABLE_NAME)
11 | CFBundleIdentifier
12 | $(PRODUCT_BUNDLE_IDENTIFIER)
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | simple_app
17 | CFBundlePackageType
18 | APPL
19 | CFBundleShortVersionString
20 | $(FLUTTER_BUILD_NAME)
21 | CFBundleSignature
22 | ????
23 | CFBundleVersion
24 | $(FLUTTER_BUILD_NUMBER)
25 | LSRequiresIPhoneOS
26 |
27 | UILaunchStoryboardName
28 | LaunchScreen
29 | UIMainStoryboardFile
30 | Main
31 | UISupportedInterfaceOrientations
32 |
33 | UIInterfaceOrientationPortrait
34 | UIInterfaceOrientationLandscapeLeft
35 | UIInterfaceOrientationLandscapeRight
36 |
37 | UISupportedInterfaceOrientations~ipad
38 |
39 | UIInterfaceOrientationPortrait
40 | UIInterfaceOrientationPortraitUpsideDown
41 | UIInterfaceOrientationLandscapeLeft
42 | UIInterfaceOrientationLandscapeRight
43 |
44 | UIViewControllerBasedStatusBarAppearance
45 |
46 | NSMicrophoneUsageDescription
47 | This sample uses the microphone to record your speech and convert it to text.
48 | UIBackgroundModes
49 |
50 | audio
51 |
52 |
53 |
54 |
--------------------------------------------------------------------------------
/ios/Runner/Runner-Bridging-Header.h:
--------------------------------------------------------------------------------
1 | #import "GeneratedPluginRegistrant.h"
2 |
--------------------------------------------------------------------------------
/lib/common/color.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | // 主题色 121,188,154
4 | // const Color themeColor = Color.fromRGBO(121, 188, 157, 1);
5 | // 副主题色
6 | const Color secondThemeColor = Colors.blue;
7 | //0xff79BD98
8 | // app 背景颜色
9 | const Color appBackgroundColor = Color(0xfff7f7f7);
10 | // 搜索框灰色背景颜色
11 | const Color searchBarFillColor = Color(0xffEDEDED);
12 | // 暗黑色
13 | const easyDarkColor = Color.fromRGBO(48, 48, 48, 0.3);
14 | //暗黑色
15 | const darkColor = Color(0xFF3E3E3E);
16 |
--------------------------------------------------------------------------------
/lib/common/global.dart:
--------------------------------------------------------------------------------
1 | class ConstantKey {
2 | static String get localeKey => 'localeKey';
3 | static String get isNightMode => 'isNightMode';
4 | static String get todoListKey => 'todoListKey';
5 | }
6 |
--------------------------------------------------------------------------------
/lib/components/base/base_animated_opacity.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | baseAnimatedOpacity({required bool value, required Widget child}) {
4 | return AnimatedOpacity(
5 | opacity: value ? 1 : 0,
6 | duration: const Duration(milliseconds: 500),
7 | child: child);
8 | }
9 |
--------------------------------------------------------------------------------
/lib/components/base/base_icon.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:provider/provider.dart';
3 | import 'package:simple_app/main.dart';
4 | import 'package:simple_app/provider/current_theme.dart';
5 |
6 | Widget baseIcon(IconData icon, {Color? color}) {
7 | return Icon(
8 | icon,
9 | );
10 | }
11 |
--------------------------------------------------------------------------------
/lib/components/base/base_text.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:flutter_screenutil/flutter_screenutil.dart';
3 |
4 | // 16号字体
5 | Text baseText(String data, {Color? color, num fontSize = 16}) {
6 | return Text(
7 | data,
8 | style: TextStyle(
9 | fontSize: ScreenUtil().setSp(fontSize), color: color, height: 1.5),
10 | );
11 | }
12 |
--------------------------------------------------------------------------------
/lib/components/base/build_base_app_bar.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:flutter/services.dart';
3 | import 'package:flutter_screenutil/flutter_screenutil.dart';
4 | import "package:provider/provider.dart";
5 | import 'package:simple_app/main.dart';
6 | import 'package:simple_app/provider/current_theme.dart';
7 |
8 | // 基础Appbar
9 | AppBar buildBaseAppBar(
10 | {String? title,
11 | Widget? leading,
12 | List? action,
13 | Widget? titleWidget,
14 | Color? backgroundColor}) {
15 | return AppBar(
16 | toolbarHeight: ScreenUtil().setSp(55),
17 | leading: leading,
18 | actions: action,
19 | systemOverlayStyle: SystemUiOverlayStyle(
20 | // Status bar color
21 | statusBarColor: Colors.transparent,
22 | ),
23 | title: titleWidget ??
24 | Text(
25 | title!,
26 | style: TextStyle(fontSize: ScreenUtil().setSp(18)),
27 | ),
28 | centerTitle: true,
29 | );
30 | }
31 |
--------------------------------------------------------------------------------
/lib/components/base/draggable_floating_action_button.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/foundation.dart';
2 | import 'package:flutter/material.dart';
3 |
4 | // ignore: must_be_immutable
5 | class DragAbleFloatingActionButton extends StatefulWidget {
6 | //子控件
7 | Widget child;
8 | GlobalKey parentKey;
9 | DragAbleFloatingActionButton(
10 | {Key? key, required this.child, required this.parentKey})
11 | : super(key: key);
12 |
13 | @override
14 | State createState() =>
15 | _DragAbleFloatingActionButtonState();
16 | }
17 |
18 | class _DragAbleFloatingActionButtonState
19 | extends State {
20 | Offset position = const Offset(0, 0);
21 | double? maxHeight;
22 | double? maxWidth;
23 | final GlobalKey _key = GlobalKey();
24 |
25 | Offset? _minOffset;
26 | Offset? _maxOffset;
27 | void _updatePosition(PointerMoveEvent pointerMoveEvent) {
28 | double newOffsetX = position.dx + pointerMoveEvent.delta.dx;
29 | double newOffsetY = position.dy + pointerMoveEvent.delta.dy;
30 | // 边界限定
31 | if (newOffsetX < _minOffset!.dx) {
32 | newOffsetX = _minOffset!.dx;
33 | } else if (newOffsetX > _maxOffset!.dx) {
34 | newOffsetX = _maxOffset!.dx;
35 | }
36 |
37 | if (newOffsetY < _minOffset!.dy) {
38 | newOffsetY = _minOffset!.dy;
39 | } else if (newOffsetY > _maxOffset!.dy) {
40 | newOffsetY = _maxOffset!.dy;
41 | }
42 | setState(() {
43 | position = Offset(newOffsetX, newOffsetY);
44 | });
45 | }
46 |
47 | @override
48 | void initState() {
49 | super.initState();
50 | WidgetsBinding.instance?.addPostFrameCallback(_setBoundary);
51 | }
52 |
53 | void _setBoundary(_) {
54 | final RenderBox renderBox =
55 | _key.currentContext?.findRenderObject() as RenderBox;
56 | try {
57 | final Size size = renderBox.size;
58 | setState(() {
59 | _minOffset = const Offset(30, 30);
60 | _maxOffset = Offset(maxWidth! - size.width, maxHeight! - size.height);
61 | });
62 | } catch (e) {
63 | if (kDebugMode) {
64 | print('catch: $e');
65 | }
66 | }
67 | }
68 |
69 | @override
70 | Widget build(BuildContext context) {
71 | if (position.dx == 0 && position.dy == 0) {
72 | maxHeight = MediaQuery.of(context).size.height;
73 | maxWidth = MediaQuery.of(context).size.width;
74 | position = Offset(maxWidth! - 56, maxHeight! - 56);
75 | }
76 |
77 | return Stack(
78 | children: [
79 | Positioned(
80 | top: position.dy,
81 | left: position.dx,
82 | child: Listener(
83 | onPointerMove: (PointerMoveEvent pointerMoveEvent) {
84 | _updatePosition(pointerMoveEvent);
85 | },
86 | child: Container(
87 | child: widget.child,
88 | key: _key,
89 | ),
90 | ),
91 | )
92 | ],
93 | );
94 | }
95 | }
96 |
--------------------------------------------------------------------------------
/lib/components/base/hide_key_bord.dart:
--------------------------------------------------------------------------------
1 | // 因为不需要保持状态,所以这里继承的是StatelessWidget
2 | import 'package:flutter/material.dart';
3 |
4 | class HideKeyboard extends StatelessWidget {
5 | final Widget child;
6 |
7 | const HideKeyboard({Key? key, required this.child}) : super(key: key);
8 |
9 | @override
10 | Widget build(BuildContext context) {
11 | return GestureDetector(
12 | child: child,
13 | onTap: () {
14 | FocusScopeNode currentFocus = FocusScope.of(context);
15 | if (!currentFocus.hasPrimaryFocus &&
16 | currentFocus.focusedChild != null) {
17 | /// 取消焦点,相当于关闭键盘
18 | FocusManager.instance.primaryFocus?.unfocus();
19 | }
20 | },
21 | );
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/lib/components/base/loading.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/cupertino.dart';
2 | import "package:flutter/material.dart";
3 | import 'package:flutter_screenutil/flutter_screenutil.dart';
4 |
5 | class Loading extends StatelessWidget {
6 | const Loading({Key? key}) : super(key: key);
7 | @override
8 | Widget build(BuildContext context) {
9 | return Center(
10 | child: SizedBox(
11 | width: ScreenUtil().setWidth(45),
12 | height: ScreenUtil().setHeight(45),
13 | child: // 模糊进度条(会执行一个旋转动画)
14 | const CupertinoActivityIndicator(
15 | color: Colors.blue,
16 | ),
17 | ),
18 | );
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/lib/components/base/tabs.dart:
--------------------------------------------------------------------------------
1 | import 'package:back_button_interceptor/back_button_interceptor.dart';
2 | import "package:flutter/cupertino.dart";
3 | import 'package:flutter/material.dart';
4 | import 'package:flutter_screenutil/flutter_screenutil.dart';
5 | import 'package:simple_app/common/color.dart';
6 | import 'package:simple_app/common/global.dart';
7 | import 'package:simple_app/generated/l10n.dart';
8 | import 'package:simple_app/page/setting_page.dart';
9 | import 'package:simple_app/page/tool_kit_page.dart';
10 | import 'package:simple_app/utils/Notification.dart';
11 | import 'package:simple_app/utils/index.dart';
12 | import 'package:simple_app/utils/show_toast.dart';
13 |
14 | class Tabs extends StatefulWidget {
15 | const Tabs({Key? key}) : super(key: key);
16 |
17 | @override
18 | _TabsState createState() => _TabsState();
19 | }
20 |
21 | class _TabsState extends State {
22 | final tabsList = [
23 | const ToolKitPage(),
24 | const SettingPage(),
25 | ];
26 | //
27 | int currentIndex = 0;
28 | late Widget currentPage;
29 | DateTime? _lastQuitTime;
30 | @override
31 | void initState() {
32 | currentPage = tabsList[currentIndex];
33 | super.initState();
34 | BackButtonInterceptor.add(myInterceptor, name: '/', context: context);
35 | // 获取正在进行中的任务列表
36 | getLocalStorageData(ConstantKey.todoListKey).then((res) {
37 | List underwayList = filterListData(res, false);
38 | if (underwayList.isNotEmpty) {
39 | showNotification(
40 | message: S.of(context).todoNotCompleteMessage,
41 | payload: '/todo_list_page');
42 | }
43 | });
44 | }
45 |
46 | bool myInterceptor(bool stopDefaultButtonEvent, RouteInfo info) {
47 | if (info.ifRouteChanged(context)) {
48 | return false;
49 | }
50 | if (_lastQuitTime == null ||
51 | DateTime.now().difference(_lastQuitTime!).inSeconds > 1) {
52 | _lastQuitTime = DateTime.now();
53 | showToast(S.of(context).tryAgainExitApp);
54 | return true;
55 | } else {
56 | return false;
57 | }
58 | }
59 |
60 | @override
61 | void dispose() {
62 | super.dispose();
63 | BackButtonInterceptor.remove(myInterceptor);
64 | }
65 |
66 | @override
67 | Widget build(BuildContext context) {
68 | final List bottomTabsList = [
69 | BottomNavigationBarItem(
70 | icon: const Icon(
71 | Icons.toc_outlined,
72 | ),
73 | label: S.of(context).toolKit),
74 | BottomNavigationBarItem(
75 | icon: const Icon(
76 | CupertinoIcons.settings,
77 | ),
78 | label: S.of(context).setting),
79 | ];
80 |
81 | return Scaffold(
82 | backgroundColor: const Color.fromRGBO(244, 245, 245, 0.5),
83 | bottomNavigationBar: BottomNavigationBar(
84 | type: BottomNavigationBarType.fixed,
85 | currentIndex: currentIndex,
86 | items: bottomTabsList,
87 | onTap: (index) {
88 | setState(() {
89 | currentIndex = index;
90 | currentPage = tabsList[currentIndex];
91 | });
92 | },
93 | ),
94 | body: currentPage,
95 | );
96 | }
97 | }
98 |
--------------------------------------------------------------------------------
/lib/components/search_bar.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:flutter_screenutil/flutter_screenutil.dart';
3 | import 'package:simple_app/common/color.dart';
4 |
5 | class MySearchBar extends StatefulWidget {
6 | final TextEditingController _todoController;
7 | final void Function(String) addConfirm;
8 | final TextInputAction textInputAction;
9 | final String placeHolder;
10 | final Color fillColor;
11 | final Icon prefixIcon;
12 | final int inputWidth;
13 | const MySearchBar(this._todoController, this.addConfirm, this.textInputAction,
14 | this.placeHolder,
15 | {Key? key,
16 | required this.prefixIcon,
17 | this.fillColor = Colors.white,
18 | this.inputWidth = 250})
19 | : super(key: key);
20 |
21 | @override
22 | MySearchBarState createState() => MySearchBarState();
23 | }
24 |
25 | class MySearchBarState extends State {
26 | final FocusNode textFieldFocusNode = FocusNode();
27 | @override
28 | void initState() {
29 | super.initState();
30 | }
31 |
32 | @override
33 | void didChangeDependencies() {
34 | super.didChangeDependencies();
35 | }
36 |
37 | @override
38 | Widget build(BuildContext context) {
39 | return ConstrainedBox(
40 | constraints: BoxConstraints(
41 | maxHeight: ScreenUtil().setSp(40),
42 | maxWidth: ScreenUtil().setSp(widget.inputWidth)),
43 | child: TextField(
44 | controller: widget._todoController,
45 | textInputAction: widget.textInputAction,
46 | onSubmitted: widget.addConfirm,
47 | focusNode: textFieldFocusNode,
48 | style:
49 | TextStyle(color: Colors.black87, fontSize: ScreenUtil().setSp(15)),
50 | decoration: InputDecoration(
51 | contentPadding: const EdgeInsets.symmetric(vertical: 4.0),
52 | hintText: widget.placeHolder,
53 |
54 | hintStyle: TextStyle(
55 | fontSize: ScreenUtil().setSp(15), color: Colors.black26),
56 | prefixIcon: widget.prefixIcon,
57 | // 设置右边图标
58 | suffixIcon: IconButton(
59 | enableFeedback: false,
60 | icon: const Icon(Icons.clear),
61 | iconSize: ScreenUtil().setSp(20),
62 | splashColor: Colors.transparent,
63 | color: Theme.of(context).primaryColor,
64 | onPressed: () {
65 | widget._todoController.text = "";
66 | textFieldFocusNode.unfocus();
67 | }),
68 | border: const OutlineInputBorder(borderSide: BorderSide.none),
69 | filled: true,
70 | fillColor: widget.fillColor,
71 | ),
72 | ),
73 | );
74 | }
75 | }
76 |
--------------------------------------------------------------------------------
/lib/components/todoList/build_todo_list_title.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:flutter_screenutil/flutter_screenutil.dart';
3 | import 'package:simple_app/components/base/base_icon.dart';
4 |
5 | Widget buildTodoListTitle(String title, int count,
6 | {void Function()? onTap,
7 | required bool isSpread,
8 | required Color backgroundColor}) {
9 | return Container(
10 | color: backgroundColor,
11 | padding: EdgeInsets.all(ScreenUtil().setHeight(10)),
12 | child: InkWell(
13 | onTap: onTap,
14 | child: Row(
15 | mainAxisAlignment: MainAxisAlignment.spaceBetween,
16 | children: [
17 | Row(
18 | crossAxisAlignment: CrossAxisAlignment.center,
19 | children: [
20 | Text(
21 | title,
22 | style: TextStyle(
23 | fontWeight: FontWeight.bold,
24 | color: Colors.white,
25 | fontSize: ScreenUtil().setSp(20)),
26 | ),
27 | AnimatedRotation(
28 | turns: isSpread ? 0.5 : 0,
29 | curve: Curves.easeInExpo,
30 | duration: const Duration(milliseconds: 250),
31 | child: baseIcon(Icons.keyboard_arrow_up_sharp,color: Colors.white),
32 | )
33 | ],
34 | ),
35 | ClipOval(
36 | child: Container(
37 | width: ScreenUtil().setHeight(20),
38 | height: ScreenUtil().setHeight(20),
39 | color: const Color(0xffE6E6FA),
40 | child: Center(
41 | child: Text(
42 | count.toString(),
43 | textAlign: TextAlign.center,
44 | style: TextStyle(
45 | fontSize: ScreenUtil().setSp(10),
46 | color: const Color(0xFF666666)),
47 | ),
48 | ))),
49 | ],
50 | ),
51 | ),
52 | );
53 | }
54 |
--------------------------------------------------------------------------------
/lib/data/index.dart:
--------------------------------------------------------------------------------
1 | import 'dart:io' if (dart.library.html) 'dart:html';
2 | import 'package:flutter/foundation.dart';
3 | import 'package:path/path.dart' as p;
4 | import 'package:path_provider/path_provider.dart';
5 | import 'package:sembast_web/sembast_web.dart';
6 | import 'package:simple_app/model/note.dart';
7 | import 'package:sembast/sembast.dart';
8 | // import 'package:sembast/sembast_io.dart'
9 | // if (dart.library.html) 'package:sembast_web/sembast_web.dart';
10 | import 'package:sembast/sembast_io.dart';
11 |
12 | // if (dart.library.html) 'package:sembast_web/sembast_web.dart';
13 | class DBProvider {
14 | static final DBProvider _singleton = DBProvider._internal();
15 |
16 | factory DBProvider() {
17 | return _singleton;
18 | }
19 |
20 | DBProvider._internal();
21 |
22 | Database? _dbInstance;
23 | final _store = intMapStoreFactory.store('NoteList');
24 |
25 | // 获取db 实例对象 操作数据库
26 | Future get db async {
27 | if (_dbInstance != null) {
28 | return _dbInstance!;
29 | }
30 | _dbInstance = await _initDB();
31 | return _dbInstance!;
32 | }
33 |
34 | // 初始化数据库
35 | Future _initDB() async {
36 | DatabaseFactory dbFactory;
37 | String dbPath;
38 | if (!kIsWeb) {
39 | var dir = await getApplicationDocumentsDirectory();
40 | await dir.create(recursive: true);
41 | dbPath = p.join(dir.path, 'NoteList.db');
42 | dbFactory = databaseFactoryIo;
43 | } else {
44 | dbPath = 'NoteList.db';
45 | dbFactory = databaseFactoryWeb;
46 | }
47 | return await dbFactory.openDatabase(dbPath);
48 | }
49 |
50 | // 保存储存数据
51 | Future saveData(Note note) async {
52 | final db = await this.db;
53 | return await _store.add(db, note.toJson());
54 | }
55 |
56 | // 查询所有数据
57 | Future> findAll() async {
58 | final db = await this.db;
59 | final records = await _store.find(db);
60 | return records.map((record) {
61 | return Note.fromJson(record.value, record.key);
62 | }).toList();
63 | }
64 |
65 | // 根据id 查询数据
66 | Future findNoteById(int id) async {
67 | final db = await this.db;
68 | final record = await _store.record(id).get(db);
69 | if (record != null) {
70 | return Note.fromJson(record, id);
71 | }
72 | return null;
73 | }
74 |
75 | // 根据 note id 更新数据
76 | Future update(Note note) async {
77 | final db = await this.db;
78 | final finder = Finder(filter: Filter.byKey(note.id));
79 | return await _store.update(db, note.toJson(), finder: finder);
80 | }
81 |
82 | // 根据 note id 删除数据
83 | Future deleteData(int id) async {
84 | final db = await this.db;
85 | final finder = Finder(filter: Filter.byKey(id));
86 | return await _store.delete(db, finder: finder);
87 | }
88 |
89 | // 根据 note id 批量删除数据
90 | Future deleteByIds(List ids) async {
91 | final db = await this.db;
92 | final finder = Finder(filter: Filter.inList('id', ids));
93 | return await _store.delete(db, finder: finder);
94 | }
95 |
96 | // 根据标题 模糊查询
97 | Future> findTitleNoteList(String title) async {
98 | final db = await this.db;
99 | final finder = Finder(
100 | filter: Filter.or([
101 | Filter.matches('title', title),
102 | Filter.matches('content', title),
103 | ]),
104 | );
105 | final records = await _store.find(db, finder: finder);
106 | return records.map((record) {
107 | return Note.fromJson(record.value, record.key);
108 | }).toList();
109 | }
110 | }
111 |
--------------------------------------------------------------------------------
/lib/generated/intl/messages_all.dart:
--------------------------------------------------------------------------------
1 | // DO NOT EDIT. This is code generated via package:intl/generate_localized.dart
2 | // This is a library that looks up messages for specific locales by
3 | // delegating to the appropriate library.
4 |
5 | // Ignore issues from commonly used lints in this file.
6 | // ignore_for_file:implementation_imports, file_names, unnecessary_new
7 | // ignore_for_file:unnecessary_brace_in_string_interps, directives_ordering
8 | // ignore_for_file:argument_type_not_assignable, invalid_assignment
9 | // ignore_for_file:prefer_single_quotes, prefer_generic_function_type_aliases
10 | // ignore_for_file:comment_references
11 |
12 | import 'dart:async';
13 |
14 | import 'package:flutter/foundation.dart';
15 | import 'package:intl/intl.dart';
16 | import 'package:intl/message_lookup_by_library.dart';
17 | import 'package:intl/src/intl_helpers.dart';
18 |
19 | import 'messages_en.dart' as messages_en;
20 | import 'messages_zh_CN.dart' as messages_zh_cn;
21 |
22 | typedef Future LibraryLoader();
23 | Map _deferredLibraries = {
24 | 'en': () => new SynchronousFuture(null),
25 | 'zh_CN': () => new SynchronousFuture(null),
26 | };
27 |
28 | MessageLookupByLibrary? _findExact(String localeName) {
29 | switch (localeName) {
30 | case 'en':
31 | return messages_en.messages;
32 | case 'zh_CN':
33 | return messages_zh_cn.messages;
34 | default:
35 | return null;
36 | }
37 | }
38 |
39 | /// User programs should call this before using [localeName] for messages.
40 | Future initializeMessages(String localeName) {
41 | var availableLocale = Intl.verifiedLocale(
42 | localeName, (locale) => _deferredLibraries[locale] != null,
43 | onFailure: (_) => null);
44 | if (availableLocale == null) {
45 | return new SynchronousFuture(false);
46 | }
47 | var lib = _deferredLibraries[availableLocale];
48 | lib == null ? new SynchronousFuture(false) : lib();
49 | initializeInternalMessageLookup(() => new CompositeMessageLookup());
50 | messageLookup.addLocale(availableLocale, _findGeneratedMessagesFor);
51 | return new SynchronousFuture(true);
52 | }
53 |
54 | bool _messagesExistFor(String locale) {
55 | try {
56 | return _findExact(locale) != null;
57 | } catch (e) {
58 | return false;
59 | }
60 | }
61 |
62 | MessageLookupByLibrary? _findGeneratedMessagesFor(String locale) {
63 | var actualLocale =
64 | Intl.verifiedLocale(locale, _messagesExistFor, onFailure: (_) => null);
65 | if (actualLocale == null) return null;
66 | return _findExact(actualLocale);
67 | }
68 |
--------------------------------------------------------------------------------
/lib/generated/intl/messages_en.dart:
--------------------------------------------------------------------------------
1 | // DO NOT EDIT. This is code generated via package:intl/generate_localized.dart
2 | // This is a library that provides messages for a en locale. All the
3 | // messages from the main program should be duplicated here with the same
4 | // function name.
5 |
6 | // Ignore issues from commonly used lints in this file.
7 | // ignore_for_file:unnecessary_brace_in_string_interps, unnecessary_new
8 | // ignore_for_file:prefer_single_quotes,comment_references, directives_ordering
9 | // ignore_for_file:annotate_overrides,prefer_generic_function_type_aliases
10 | // ignore_for_file:unused_import, file_names, avoid_escaping_inner_quotes
11 | // ignore_for_file:unnecessary_string_interpolations, unnecessary_string_escapes
12 |
13 | import 'package:intl/intl.dart';
14 | import 'package:intl/message_lookup_by_library.dart';
15 |
16 | final messages = new MessageLookup();
17 |
18 | typedef String MessageIfAbsent(String messageStr, List args);
19 |
20 | class MessageLookup extends MessageLookupByLibrary {
21 | String get localeName => 'en';
22 |
23 | final messages = _notInlinedMessages(_notInlinedMessages);
24 | static Map _notInlinedMessages(_) => {
25 | "NoteNotNullMessage":
26 | MessageLookupByLibrary.simpleMessage("content cannot be empty!"),
27 | "addTodo": MessageLookupByLibrary.simpleMessage("Add todo"),
28 | "addTodoMessage":
29 | MessageLookupByLibrary.simpleMessage("You added a new todo!"),
30 | "afternoon": MessageLookupByLibrary.simpleMessage("afternoon"),
31 | "beforeDawn": MessageLookupByLibrary.simpleMessage("before dawn"),
32 | "calculator": MessageLookupByLibrary.simpleMessage("calculator"),
33 | "cancel": MessageLookupByLibrary.simpleMessage("cancel"),
34 | "cancelCountDownMessage": MessageLookupByLibrary.simpleMessage(
35 | "The countdown is not over yet. Are you sure you want to exit?"),
36 | "cancelTopping": MessageLookupByLibrary.simpleMessage("Cancel topping"),
37 | "complete": MessageLookupByLibrary.simpleMessage("Have finished"),
38 | "confirm": MessageLookupByLibrary.simpleMessage("confirm"),
39 | "countDown": MessageLookupByLibrary.simpleMessage("Count down"),
40 | "createNote": MessageLookupByLibrary.simpleMessage("Create note"),
41 | "delete": MessageLookupByLibrary.simpleMessage("delete"),
42 | "deleteFail": MessageLookupByLibrary.simpleMessage("Delete failed!"),
43 | "deleteMessage": MessageLookupByLibrary.simpleMessage(
44 | "Are you sure you want to delete?"),
45 | "deleteSuccess":
46 | MessageLookupByLibrary.simpleMessage("Deleted successfully!"),
47 | "deleteTodoMessage": MessageLookupByLibrary.simpleMessage(
48 | "Are you sure to delete the current todo?"),
49 | "dialogDeleteMessage": MessageLookupByLibrary.simpleMessage(
50 | "Are you sure you want to delete?"),
51 | "editorNote": MessageLookupByLibrary.simpleMessage("Editor note"),
52 | "enableAudioMessage":
53 | MessageLookupByLibrary.simpleMessage("Turn on sound?"),
54 | "enableShimmerMessage":
55 | MessageLookupByLibrary.simpleMessage("Enable shimmer background?"),
56 | "evening": MessageLookupByLibrary.simpleMessage("evening"),
57 | "forenoon": MessageLookupByLibrary.simpleMessage("forenoon"),
58 | "hint": MessageLookupByLibrary.simpleMessage("hint"),
59 | "item": MessageLookupByLibrary.simpleMessage("item"),
60 | "lastUpdateTime":
61 | MessageLookupByLibrary.simpleMessage("Last update time"),
62 | "lateNight": MessageLookupByLibrary.simpleMessage("late at night"),
63 | "morning": MessageLookupByLibrary.simpleMessage("morning"),
64 | "night": MessageLookupByLibrary.simpleMessage("night"),
65 | "nightMode": MessageLookupByLibrary.simpleMessage("Night mode"),
66 | "noDevelopment": MessageLookupByLibrary.simpleMessage("No development"),
67 | "noLongerTips": MessageLookupByLibrary.simpleMessage("No longer tips?"),
68 | "noNotificationPermission": MessageLookupByLibrary.simpleMessage(
69 | "No notification permission, go to the settings interface to set the permission?"),
70 | "noSelectNoteMessage":
71 | MessageLookupByLibrary.simpleMessage("Please select data!"),
72 | "noon": MessageLookupByLibrary.simpleMessage("noon"),
73 | "notEmpty": MessageLookupByLibrary.simpleMessage("Can not be empty"),
74 | "notNoteMessage": MessageLookupByLibrary.simpleMessage(
75 | "You haven\'t added a note yet. Please click the button to add a note!"),
76 | "notSearchNoteMessage": MessageLookupByLibrary.simpleMessage(
77 | "Unfortunately, no data was found!"),
78 | "note": MessageLookupByLibrary.simpleMessage("note"),
79 | "notificationDescription":
80 | MessageLookupByLibrary.simpleMessage("For a better day!"),
81 | "notificationName":
82 | MessageLookupByLibrary.simpleMessage("important notice"),
83 | "outCalculationRange":
84 | MessageLookupByLibrary.simpleMessage("Out of calculation range!"),
85 | "placeSearchContent": MessageLookupByLibrary.simpleMessage(
86 | "Please enter the search content!"),
87 | "saveFail": MessageLookupByLibrary.simpleMessage("Saved failed"),
88 | "saveSuccess":
89 | MessageLookupByLibrary.simpleMessage("Saved successfully"),
90 | "searchNote": MessageLookupByLibrary.simpleMessage("Search note"),
91 | "selected": MessageLookupByLibrary.simpleMessage("Selected"),
92 | "setting": MessageLookupByLibrary.simpleMessage("setting"),
93 | "startTiming": MessageLookupByLibrary.simpleMessage("Start timing"),
94 | "switchLanguage":
95 | MessageLookupByLibrary.simpleMessage("Switch language to english"),
96 | "timeOut": MessageLookupByLibrary.simpleMessage("Time out!"),
97 | "tipSaveMessage": MessageLookupByLibrary.simpleMessage(
98 | "You haven\'t saved it yet? Save?"),
99 | "title": MessageLookupByLibrary.simpleMessage("title"),
100 | "todoCompleteMessage": MessageLookupByLibrary.simpleMessage(
101 | "Today\'s todo has been completed, please make persistent efforts."),
102 | "todoList": MessageLookupByLibrary.simpleMessage("Todo list"),
103 | "todoNotCompleteMessage": MessageLookupByLibrary.simpleMessage(
104 | "Today\'s agency has not been completed yet. Please remember to complete it on time"),
105 | "todoNoticeTitle":
106 | MessageLookupByLibrary.simpleMessage("This is an announcement."),
107 | "toolKit": MessageLookupByLibrary.simpleMessage("Tool kit"),
108 | "topping": MessageLookupByLibrary.simpleMessage("topping"),
109 | "translate": MessageLookupByLibrary.simpleMessage("translate"),
110 | "tryAgainExitApp":
111 | MessageLookupByLibrary.simpleMessage("Press again to exit the App"),
112 | "underway": MessageLookupByLibrary.simpleMessage("underway"),
113 | "updateFail": MessageLookupByLibrary.simpleMessage("Update failed"),
114 | "updateSuccess":
115 | MessageLookupByLibrary.simpleMessage("Update successful"),
116 | "weatherQuery": MessageLookupByLibrary.simpleMessage("Weather query")
117 | };
118 | }
119 |
--------------------------------------------------------------------------------
/lib/generated/intl/messages_zh_CN.dart:
--------------------------------------------------------------------------------
1 | // DO NOT EDIT. This is code generated via package:intl/generate_localized.dart
2 | // This is a library that provides messages for a zh_CN locale. All the
3 | // messages from the main program should be duplicated here with the same
4 | // function name.
5 |
6 | // Ignore issues from commonly used lints in this file.
7 | // ignore_for_file:unnecessary_brace_in_string_interps, unnecessary_new
8 | // ignore_for_file:prefer_single_quotes,comment_references, directives_ordering
9 | // ignore_for_file:annotate_overrides,prefer_generic_function_type_aliases
10 | // ignore_for_file:unused_import, file_names, avoid_escaping_inner_quotes
11 | // ignore_for_file:unnecessary_string_interpolations, unnecessary_string_escapes
12 |
13 | import 'package:intl/intl.dart';
14 | import 'package:intl/message_lookup_by_library.dart';
15 |
16 | final messages = new MessageLookup();
17 |
18 | typedef String MessageIfAbsent(String messageStr, List args);
19 |
20 | class MessageLookup extends MessageLookupByLibrary {
21 | String get localeName => 'zh_CN';
22 |
23 | final messages = _notInlinedMessages(_notInlinedMessages);
24 | static Map _notInlinedMessages(_) => {
25 | "NoteNotNullMessage": MessageLookupByLibrary.simpleMessage("内容不能为空!"),
26 | "addTodo": MessageLookupByLibrary.simpleMessage("添加代办事项"),
27 | "addTodoMessage": MessageLookupByLibrary.simpleMessage("您添加了一条新代办事项!"),
28 | "afternoon": MessageLookupByLibrary.simpleMessage("下午"),
29 | "beforeDawn": MessageLookupByLibrary.simpleMessage("凌晨"),
30 | "calculator": MessageLookupByLibrary.simpleMessage("计算器"),
31 | "cancel": MessageLookupByLibrary.simpleMessage("取消"),
32 | "cancelCountDownMessage":
33 | MessageLookupByLibrary.simpleMessage("倒计时还未结束,确定要退出吗?"),
34 | "cancelTopping": MessageLookupByLibrary.simpleMessage("取消置顶"),
35 | "complete": MessageLookupByLibrary.simpleMessage("已经完成"),
36 | "confirm": MessageLookupByLibrary.simpleMessage("确认"),
37 | "countDown": MessageLookupByLibrary.simpleMessage("倒计时"),
38 | "createNote": MessageLookupByLibrary.simpleMessage("新建便签"),
39 | "delete": MessageLookupByLibrary.simpleMessage("删除"),
40 | "deleteFail": MessageLookupByLibrary.simpleMessage("删除失败"),
41 | "deleteMessage": MessageLookupByLibrary.simpleMessage("你确定要删除吗?"),
42 | "deleteSuccess": MessageLookupByLibrary.simpleMessage("删除成功!"),
43 | "deleteTodoMessage":
44 | MessageLookupByLibrary.simpleMessage("确定删除当前代办事项吗?"),
45 | "dialogDeleteMessage": MessageLookupByLibrary.simpleMessage("你确定要删除吗?"),
46 | "editorNote": MessageLookupByLibrary.simpleMessage("编辑便签"),
47 | "enableAudioMessage": MessageLookupByLibrary.simpleMessage("是否开启声音?"),
48 | "enableShimmerMessage":
49 | MessageLookupByLibrary.simpleMessage("是否开启微光背景?"),
50 | "evening": MessageLookupByLibrary.simpleMessage("傍晚"),
51 | "forenoon": MessageLookupByLibrary.simpleMessage("上午"),
52 | "hint": MessageLookupByLibrary.simpleMessage("提示"),
53 | "item": MessageLookupByLibrary.simpleMessage("项"),
54 | "lastUpdateTime": MessageLookupByLibrary.simpleMessage("最后更新时间"),
55 | "lateNight": MessageLookupByLibrary.simpleMessage("深夜"),
56 | "morning": MessageLookupByLibrary.simpleMessage("早晨"),
57 | "night": MessageLookupByLibrary.simpleMessage("晚上"),
58 | "nightMode": MessageLookupByLibrary.simpleMessage("夜间模式"),
59 | "noDevelopment": MessageLookupByLibrary.simpleMessage("暂未开发"),
60 | "noLongerTips": MessageLookupByLibrary.simpleMessage("不再提示?"),
61 | "noNotificationPermission":
62 | MessageLookupByLibrary.simpleMessage("没有通知权限, 前往设置界面设置权限?"),
63 | "noSelectNoteMessage": MessageLookupByLibrary.simpleMessage("请选择数据"),
64 | "noon": MessageLookupByLibrary.simpleMessage("中午"),
65 | "notEmpty": MessageLookupByLibrary.simpleMessage("不能为空!"),
66 | "notNoteMessage":
67 | MessageLookupByLibrary.simpleMessage("你还未添加添加便签,请点击按钮添加便签吧!"),
68 | "notSearchNoteMessage":
69 | MessageLookupByLibrary.simpleMessage("很遗憾,没有搜索到数据!"),
70 | "note": MessageLookupByLibrary.simpleMessage("便签"),
71 | "notificationDescription":
72 | MessageLookupByLibrary.simpleMessage("为了美好的每一天!"),
73 | "notificationName": MessageLookupByLibrary.simpleMessage("重要通知"),
74 | "outCalculationRange": MessageLookupByLibrary.simpleMessage("超出计算范围!"),
75 | "placeSearchContent": MessageLookupByLibrary.simpleMessage("请输入搜索内容!"),
76 | "saveFail": MessageLookupByLibrary.simpleMessage("保存失败"),
77 | "saveSuccess": MessageLookupByLibrary.simpleMessage("保存成功"),
78 | "searchNote": MessageLookupByLibrary.simpleMessage("搜索便签"),
79 | "selected": MessageLookupByLibrary.simpleMessage("已选择"),
80 | "setting": MessageLookupByLibrary.simpleMessage("设置"),
81 | "startTiming": MessageLookupByLibrary.simpleMessage("开始计时"),
82 | "switchLanguage": MessageLookupByLibrary.simpleMessage("切换语言为英语"),
83 | "timeOut": MessageLookupByLibrary.simpleMessage("时间到!"),
84 | "tipSaveMessage": MessageLookupByLibrary.simpleMessage("你还未保存?是否保存?"),
85 | "title": MessageLookupByLibrary.simpleMessage("标题"),
86 | "todoCompleteMessage":
87 | MessageLookupByLibrary.simpleMessage("今日的代办事项已经完成, 请再接再厉!"),
88 | "todoList": MessageLookupByLibrary.simpleMessage("待办事项列表"),
89 | "todoNotCompleteMessage":
90 | MessageLookupByLibrary.simpleMessage("今天的代办事项还未完成哦,请记得按时完成哦"),
91 | "todoNoticeTitle": MessageLookupByLibrary.simpleMessage("这是一条通知"),
92 | "toolKit": MessageLookupByLibrary.simpleMessage("工具箱"),
93 | "topping": MessageLookupByLibrary.simpleMessage("置顶"),
94 | "translate": MessageLookupByLibrary.simpleMessage("翻译"),
95 | "tryAgainExitApp": MessageLookupByLibrary.simpleMessage("再按一次退出App"),
96 | "underway": MessageLookupByLibrary.simpleMessage("正在进行"),
97 | "updateFail": MessageLookupByLibrary.simpleMessage("更新失败"),
98 | "updateSuccess": MessageLookupByLibrary.simpleMessage("更新成功"),
99 | "weatherQuery": MessageLookupByLibrary.simpleMessage("天气查询")
100 | };
101 | }
102 |
--------------------------------------------------------------------------------
/lib/l10n/intl_en.arb:
--------------------------------------------------------------------------------
1 | {
2 | "toolKit": "Tool kit",
3 | "setting": "setting",
4 | "translate": "translate",
5 | "weatherQuery": "Weather query",
6 | "note": "note",
7 | "calculator": "calculator",
8 | "todoList": "Todo list",
9 | "nightMode": "Night mode",
10 | "switchLanguage": "Switch language to english",
11 | "hint": "hint",
12 | "dialogDeleteMessage": "Are you sure you want to delete?",
13 | "cancel": "cancel",
14 | "delete": "delete",
15 | "confirm": "confirm",
16 | "addTodo": "Add todo",
17 | "addTodoMessage": "You added a new todo!",
18 | "todoNoticeTitle": "This is an announcement.",
19 | "todoCompleteMessage": "Today's todo has been completed, please make persistent efforts.",
20 | "todoNotCompleteMessage": "Today's agency has not been completed yet. Please remember to complete it on time",
21 | "noNotificationPermission": "No notification permission, go to the settings interface to set the permission?",
22 | "notificationName": "important notice",
23 | "notificationDescription": "For a better day!",
24 | "underway": "underway",
25 | "deleteTodoMessage": "Are you sure to delete the current todo?",
26 | "complete": "Have finished",
27 | "notEmpty": "Can not be empty",
28 | "tryAgainExitApp": "Press again to exit the App",
29 | "noDevelopment": "No development",
30 | "searchNote": "Search note",
31 | "editorNote": "Editor note",
32 | "createNote": "Create note",
33 | "title": "title",
34 | "notNoteMessage": "You haven't added a note yet. Please click the button to add a note!",
35 | "notSearchNoteMessage": "Unfortunately, no data was found!",
36 | "NoteNotNullMessage": "content cannot be empty!",
37 | "updateSuccess": "Update successful",
38 | "updateFail": "Update failed",
39 | "saveSuccess": "Saved successfully",
40 | "saveFail": "Saved failed",
41 | "placeSearchContent": "Please enter the search content!",
42 | "selected": "Selected",
43 | "item": "item",
44 | "deleteSuccess": "Deleted successfully!",
45 | "deleteFail": "Delete failed!",
46 | "deleteMessage": "Are you sure you want to delete?",
47 | "topping": "topping",
48 | "cancelTopping": "Cancel topping",
49 | "noSelectNoteMessage": "Please select data!",
50 | "outCalculationRange": "Out of calculation range!",
51 | "countDown": "Count down",
52 | "startTiming": "Start timing",
53 | "timeOut": "Time out!",
54 | "cancelCountDownMessage": "The countdown is not over yet. Are you sure you want to exit?",
55 | "enableShimmerMessage": "Enable shimmer background?",
56 | "enableAudioMessage": "Turn on sound?",
57 | "lastUpdateTime": "Last update time",
58 | "beforeDawn": "before dawn",
59 | "morning": "morning",
60 | "forenoon": "forenoon",
61 | "noon": "noon",
62 | "afternoon": "afternoon",
63 | "evening": "evening",
64 | "night": "night",
65 | "lateNight": "late at night",
66 | "tipSaveMessage": "You haven't saved it yet? Save?",
67 | "noLongerTips": "No longer tips?"
68 | }
--------------------------------------------------------------------------------
/lib/l10n/intl_zh_CN.arb:
--------------------------------------------------------------------------------
1 | {
2 | "toolKit": "工具箱",
3 | "setting": "设置",
4 | "translate": "翻译",
5 | "weatherQuery": "天气查询",
6 | "note": "便签",
7 | "calculator": "计算器",
8 | "todoList": "待办事项列表",
9 | "nightMode": "夜间模式",
10 | "switchLanguage": "切换语言为英语",
11 | "hint": "提示",
12 | "dialogDeleteMessage": "你确定要删除吗?",
13 | "cancel": "取消",
14 | "delete": "删除",
15 | "confirm": "确认",
16 | "addTodo": "添加代办事项",
17 | "addTodoMessage": "您添加了一条新代办事项!",
18 | "todoNoticeTitle": "这是一条通知",
19 | "todoCompleteMessage": "今日的代办事项已经完成, 请再接再厉!",
20 | "todoNotCompleteMessage": "今天的代办事项还未完成哦,请记得按时完成哦",
21 | "noNotificationPermission": "没有通知权限, 前往设置界面设置权限?",
22 | "notificationName": "重要通知",
23 | "notificationDescription": "为了美好的每一天!",
24 | "underway": "正在进行",
25 | "deleteTodoMessage": "确定删除当前代办事项吗?",
26 | "complete": "已经完成",
27 | "notEmpty": "不能为空!",
28 | "tryAgainExitApp": "再按一次退出App",
29 | "noDevelopment": "暂未开发",
30 | "searchNote": "搜索便签",
31 | "editorNote": "编辑便签",
32 | "createNote": "新建便签",
33 | "title": "标题",
34 | "notNoteMessage": "你还未添加添加便签,请点击按钮添加便签吧!",
35 | "notSearchNoteMessage": "很遗憾,没有搜索到数据!",
36 | "NoteNotNullMessage": "内容不能为空!",
37 | "updateSuccess": "更新成功",
38 | "updateFail": "更新失败",
39 | "saveSuccess": "保存成功",
40 | "saveFail": "保存失败",
41 | "placeSearchContent": "请输入搜索内容!",
42 | "selected": "已选择",
43 | "item": "项",
44 | "deleteSuccess": "删除成功!",
45 | "deleteFail": "删除失败",
46 | "deleteMessage": "你确定要删除吗?",
47 | "topping": "置顶",
48 | "cancelTopping": "取消置顶",
49 | "noSelectNoteMessage": "请选择数据",
50 | "outCalculationRange": "超出计算范围!",
51 | "countDown": "倒计时",
52 | "startTiming": "开始计时",
53 | "timeOut": "时间到!",
54 | "cancelCountDownMessage": "倒计时还未结束,确定要退出吗?",
55 | "enableShimmerMessage": "是否开启微光背景?",
56 | "enableAudioMessage": "是否开启声音?",
57 | "lastUpdateTime": "最后更新时间",
58 | "beforeDawn": "凌晨",
59 | "morning": "早晨",
60 | "forenoon": "上午",
61 | "noon": "中午",
62 | "afternoon": "下午",
63 | "evening": "傍晚",
64 | "night": "晚上",
65 | "lateNight": "深夜",
66 | "tipSaveMessage": "你还未保存?是否保存?",
67 | "noLongerTips": "不再提示?"
68 | }
69 |
--------------------------------------------------------------------------------
/lib/main.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/foundation.dart';
2 | import 'package:flutter/material.dart';
3 | import 'package:flutter_localizations/flutter_localizations.dart';
4 | import 'package:flutter_quill/translations.dart';
5 | import 'package:flutter_screenutil/flutter_screenutil.dart';
6 | import 'package:provider/provider.dart';
7 | import 'package:shared_preferences/shared_preferences.dart';
8 | import 'package:simple_app/common/color.dart';
9 | import 'package:simple_app/common/global.dart';
10 | import 'package:simple_app/generated/l10n.dart';
11 | import 'package:simple_app/provider/current_locale.dart';
12 | import 'package:simple_app/provider/current_theme.dart';
13 | import 'package:simple_app/router.dart';
14 | import 'package:simple_app/utils/Notification.dart';
15 |
16 | CurrentTheme? nightMode;
17 | CurrentLocale? locale;
18 |
19 | late String? strLocale;
20 | final Future _prefs = SharedPreferences.getInstance();
21 |
22 | void main(List args) {
23 | WidgetsFlutterBinding.ensureInitialized();
24 | // 读取持久化数据
25 | _prefs.then((prefs) async {
26 | strLocale = prefs.getString(ConstantKey.localeKey);
27 | bool? isNightMode = prefs.getBool(ConstantKey.isNightMode);
28 | // 优先读取持久化数据
29 | if (strLocale != null) {
30 | locale = CurrentLocale(locale: strLocaleToLocale(strLocale!));
31 | } else {
32 | locale = CurrentLocale();
33 | }
34 | if (isNightMode != null) {
35 | nightMode = CurrentTheme(
36 | themeMode: isNightMode ? ThemeMode.dark : ThemeMode.light);
37 | } else {
38 | nightMode = CurrentTheme(themeMode: ThemeMode.light);
39 | }
40 |
41 | runApp(MultiProvider(
42 | providers: [
43 | ChangeNotifierProvider(create: (_) => locale),
44 | ChangeNotifierProvider(create: (_) => nightMode),
45 | ],
46 | child: const MyApp(),
47 | ));
48 | // 初始化本地通知插件
49 | // 是否为web环境
50 | if (!kIsWeb) {
51 | await flutterLocalNotificationsPluginInit();
52 | }
53 | });
54 | }
55 |
56 | class MyApp extends StatefulWidget {
57 | const MyApp({Key? key}) : super(key: key);
58 |
59 | @override
60 | State createState() => _MyAppState();
61 | }
62 |
63 | // 通过navigatorKey的方式 保存全局的context
64 | final GlobalKey navigatorKey = GlobalKey();
65 |
66 | class _MyAppState extends State {
67 | @override
68 | Widget build(BuildContext context) {
69 | return ScreenUtilInit(
70 | designSize: const Size(375, 750),
71 | minTextAdapt: true,
72 | splitScreenMode: true,
73 | child: MaterialApp(
74 | debugShowCheckedModeBanner: false,
75 | initialRoute: '/',
76 | routes: routes,
77 | title: 'simple_app',
78 | // 国际化
79 | localizationsDelegates: const [
80 | GlobalMaterialLocalizations.delegate,
81 | GlobalWidgetsLocalizations.delegate,
82 | GlobalCupertinoLocalizations.delegate,
83 | FlutterQuillLocalizations.delegate,
84 | S.delegate
85 | ],
86 | themeMode: context.watch().value,
87 | theme: ThemeData(
88 | brightness: Brightness.light,
89 | ),
90 | darkTheme:
91 | ThemeData(brightness: Brightness.dark, primaryColor: darkColor),
92 | //应用支持的语言列表
93 | supportedLocales: const [
94 | Locale('en', 'US'), // English
95 | Locale('zh', 'CN'), // 中文
96 | ],
97 | // 保存全局navigatorkey
98 | navigatorKey: navigatorKey,
99 | // 当前语言
100 | locale: context.watch().value,
101 | localeResolutionCallback: (deviceLocale, supportedLocales) {
102 | _prefs.then((prefs) {
103 | strLocale = prefs.getString(ConstantKey.localeKey);
104 | // 如果本地环境不为中文,而且没有设置过语言,则设置为英文
105 | if (locale == null &&
106 | localeToStrLocale(deviceLocale!) != 'zh' &&
107 | strLocale == null) {
108 | locale?.setLocale(const Locale('en', 'US'));
109 | }
110 | });
111 | return null;
112 | },
113 | ),
114 | );
115 | }
116 | }
117 |
--------------------------------------------------------------------------------
/lib/model/note.dart:
--------------------------------------------------------------------------------
1 | //记录便列表数据类
2 | class Note {
3 | int? id;
4 | // 便签标题
5 | String? title;
6 | // 便签内
7 | late String content;
8 | // 创建时间
9 | late int time;
10 | // 更新时间
11 | late int updateTime;
12 |
13 | Note(
14 | {this.id,
15 | this.title,
16 | required this.content,
17 | required this.time,
18 | required this.updateTime});
19 |
20 | //将json 序列化为model对象
21 | Note.fromJson(Map json, int value) {
22 | title = json['title'];
23 | content = json['content'];
24 | time = json['time'];
25 | updateTime = json['updateTime'];
26 | id = value;
27 | }
28 |
29 | Map toJson() {
30 | final Map data = {};
31 | data['id'] = id;
32 | data['title'] = title;
33 | data['content'] = content;
34 | data['time'] = time;
35 | data['updateTime'] = updateTime;
36 | return data;
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/lib/page/setting_page.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:flutter_screenutil/flutter_screenutil.dart';
3 | import 'package:provider/provider.dart';
4 | import 'package:simple_app/common/color.dart';
5 | import 'package:simple_app/components/base/base_icon.dart';
6 | import 'package:simple_app/components/base/base_text.dart';
7 | import 'package:simple_app/components/base/build_base_app_bar.dart';
8 | import 'package:simple_app/generated/l10n.dart';
9 | import 'package:simple_app/provider/current_locale.dart';
10 | import 'package:simple_app/provider/current_theme.dart';
11 |
12 | class SettingPage extends StatefulWidget {
13 | const SettingPage({Key? key}) : super(key: key);
14 |
15 | @override
16 | State createState() => _SettingPageState();
17 | }
18 |
19 | class _SettingPageState extends State {
20 | // 切换当前语言环境
21 | void changeLanguage(bool value) {
22 | if (value) {
23 | context.read().setLocale(const Locale('en', 'US'));
24 | } else {
25 | context.read().setLocale(const Locale('zh', 'CN'));
26 | }
27 | }
28 |
29 | // 切换夜间模式
30 | void changeNightMode(value) {
31 | if (value) {
32 | context.read().changeMode(ThemeMode.dark);
33 | } else {
34 | context.read().changeMode(ThemeMode.light);
35 | }
36 | }
37 |
38 | // final NeumorphicStyle _neumorphicStyle = NeumorphicStyle(
39 | // depth: -4,
40 | // boxShape: NeumorphicBoxShape.roundRect(BorderRadius.circular(20)));
41 |
42 | @override
43 | Widget build(BuildContext context) {
44 | Color primaryColor = Theme.of(context).primaryColor;
45 |
46 | return Scaffold(
47 | appBar: buildBaseAppBar(
48 | title: S.of(context).setting,
49 | ),
50 | body: Container(
51 | padding: EdgeInsets.all(ScreenUtil().setWidth(10)),
52 | child: LayoutBuilder(
53 | builder: (BuildContext context, BoxConstraints constraints) {
54 | return SizedBox(
55 | height: constraints.maxHeight,
56 | child: SingleChildScrollView(
57 | physics: const BouncingScrollPhysics(
58 | parent: AlwaysScrollableScrollPhysics()),
59 | child: Column(
60 | children: [
61 | Padding(
62 | padding: const EdgeInsets.all(10),
63 | child: Row(
64 | mainAxisAlignment: MainAxisAlignment.spaceBetween,
65 | children: [
66 | Row(
67 | children: [
68 | baseIcon(Icons.language_rounded,
69 | color: primaryColor),
70 | SizedBox(
71 | width: ScreenUtil().setWidth(10),
72 | ),
73 | baseText(
74 | S.of(context).switchLanguage,
75 | )
76 | ],
77 | ),
78 | Switch(
79 | // height: ScreenUtil().setHeight(30),
80 | // style: const NeumorphicSwitchStyle(
81 | // activeTrackColor: themeColor),
82 | value: context
83 | .watch()
84 | .languageIsEnglishMode,
85 | onChanged: changeLanguage,
86 | )
87 | ],
88 | ),
89 | ),
90 | const SizedBox(
91 | height: 10,
92 | ),
93 | Padding(
94 | padding: const EdgeInsets.all(10),
95 | child: Row(
96 | mainAxisAlignment: MainAxisAlignment.spaceBetween,
97 | children: [
98 | Row(
99 | children: [
100 | baseIcon(Icons.mode_night_rounded,
101 | color: primaryColor),
102 | SizedBox(
103 | width: ScreenUtil().setWidth(10),
104 | ),
105 | baseText(
106 | S.of(context).nightMode,
107 | )
108 | ],
109 | ),
110 | Switch(
111 | // style: const NeumorphicSwitchStyle(
112 | // activeTrackColor: themeColor),
113 | value: context.watch().isNightMode,
114 | onChanged: changeNightMode,
115 | )
116 | ],
117 | ),
118 | )
119 | ],
120 | ),
121 | ),
122 | );
123 | },
124 | ),
125 | ),
126 | );
127 | }
128 | }
129 |
--------------------------------------------------------------------------------
/lib/page/tool_kit_page.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/cupertino.dart';
2 | import 'package:flutter/material.dart';
3 | import 'package:flutter_screenutil/flutter_screenutil.dart';
4 | import 'package:provider/provider.dart';
5 | import 'package:simple_app/components/base/build_base_app_bar.dart';
6 | import 'package:simple_app/generated/l10n.dart';
7 | import 'package:simple_app/page/calculator.dart';
8 | import 'package:simple_app/page/count_down.dart';
9 | import 'package:simple_app/page/note_page.dart';
10 | import 'package:simple_app/page/todo_list_page.dart';
11 | import 'package:simple_app/provider/current_theme.dart';
12 | import 'package:simple_app/utils/show_toast.dart';
13 |
14 | class ToolKitPage extends StatefulWidget {
15 | const ToolKitPage({Key? key}) : super(key: key);
16 |
17 | @override
18 | _ToolKitPageState createState() => _ToolKitPageState();
19 | }
20 |
21 | class _ToolKitPageState extends State {
22 | void toRouterPage(Map map) {
23 | if (map['RouterPath'].isEmpty) {
24 | showToast(S.of(context).noDevelopment);
25 | } else {
26 | Navigator.push(
27 | context, CupertinoPageRoute(builder: (context) => map['comp']));
28 | }
29 | }
30 |
31 | @override
32 | Widget build(BuildContext context) {
33 | final List