├── .github
└── workflows
│ └── publish.yml
├── .gitignore
├── .gitmodules
├── LICENSE
├── README.md
├── RELEASE_CHANGELOG.md
├── analysis_options.yaml
├── android
├── .gitignore
├── app
│ ├── build.gradle
│ └── src
│ │ ├── debug
│ │ └── AndroidManifest.xml
│ │ ├── main
│ │ ├── AndroidManifest.xml
│ │ ├── kotlin
│ │ │ └── com
│ │ │ │ └── example
│ │ │ │ └── kyc
│ │ │ │ └── MainActivity.kt
│ │ └── res
│ │ │ ├── drawable-v21
│ │ │ └── launch_background.xml
│ │ │ ├── drawable
│ │ │ └── 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
│ │ └── profile
│ │ └── AndroidManifest.xml
├── build.gradle
├── gradle.properties
├── gradle
│ └── wrapper
│ │ └── gradle-wrapper.properties
├── kyc_android.iml
└── settings.gradle
├── asset
├── 7z2405-x64.exe
├── ChineseSimplified.isl
├── appimagetool-x86_64.AppImage
├── font
│ ├── Droid_Sans_Mono.ttf
│ ├── HarmonyOS_Sans_SC_Bold.ttf
│ ├── HarmonyOS_Sans_SC_Light.ttf
│ ├── HarmonyOS_Sans_SC_Medium.ttf
│ └── HarmonyOS_Sans_SC_Regular.ttf
├── icon
│ ├── icon.ico
│ └── icon.png
└── is.exe
├── changelog.txt
├── fonts
├── JetBrainsMono-Regular.ttf
└── MyFlutterApp.ttf
├── img
├── 1.png
└── 2.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
└── RunnerTests
│ └── RunnerTests.swift
├── kyc.iml
├── lib
├── assets
│ ├── aifadian.svg
│ ├── alipay.svg
│ ├── colorEgg.png
│ ├── donate_alipay.png
│ ├── donate_wechat.png
│ ├── icon.png
│ ├── iconWin.ico
│ ├── loading.gif
│ ├── logo.png
│ ├── logo_Old.png
│ ├── my_flutter_app_icons.dart
│ └── wechat.svg
├── main.dart
├── ui
│ ├── broadcast
│ │ ├── detail.dart
│ │ └── list.dart
│ ├── deploy
│ │ ├── deploy.dart
│ │ └── deployment.dart
│ ├── mainPage
│ │ ├── createbot.dart
│ │ ├── fast_deploy.dart
│ │ ├── import_bot.dart
│ │ └── manage_bot.dart
│ ├── manage
│ │ ├── adapter.dart
│ │ ├── driver.dart
│ │ ├── env.dart
│ │ ├── manage_cli.dart
│ │ ├── manage_plugin.dart
│ │ ├── manage_protocol.dart
│ │ ├── managecli.dart
│ │ ├── plugin.dart
│ │ └── stderr.dart
│ └── settings
│ │ ├── about.dart
│ │ ├── more_page.dart
│ │ └── setting.dart
└── utils
│ ├── core.dart
│ ├── deployBot.dart
│ ├── global.dart
│ ├── manage.dart
│ └── userConfig.dart
├── linux
├── .gitignore
├── CMakeLists.txt
├── flutter
│ ├── CMakeLists.txt
│ ├── generated_plugin_registrant.cc
│ ├── generated_plugin_registrant.h
│ └── generated_plugins.cmake
├── main.cc
├── my_application.cc
├── my_application.h
└── packaging
│ ├── appimage
│ └── make_config.yaml
│ ├── deb
│ └── make_config.yaml
│ └── rpm
│ └── make_config.yaml
├── macos
├── .gitignore
├── Flutter
│ ├── Flutter-Debug.xcconfig
│ ├── Flutter-Release.xcconfig
│ └── GeneratedPluginRegistrant.swift
├── Runner.xcodeproj
│ ├── project.pbxproj
│ ├── project.xcworkspace
│ │ └── xcshareddata
│ │ │ └── IDEWorkspaceChecks.plist
│ └── xcshareddata
│ │ └── xcschemes
│ │ └── Runner.xcscheme
├── Runner.xcworkspace
│ ├── contents.xcworkspacedata
│ └── xcshareddata
│ │ └── IDEWorkspaceChecks.plist
├── Runner
│ ├── AppDelegate.swift
│ ├── Assets.xcassets
│ │ └── AppIcon.appiconset
│ │ │ ├── Contents.json
│ │ │ ├── app_icon_1024.png
│ │ │ ├── app_icon_128.png
│ │ │ ├── app_icon_16.png
│ │ │ ├── app_icon_256.png
│ │ │ ├── app_icon_32.png
│ │ │ ├── app_icon_512.png
│ │ │ └── app_icon_64.png
│ ├── Base.lproj
│ │ └── MainMenu.xib
│ ├── Configs
│ │ ├── AppInfo.xcconfig
│ │ ├── Debug.xcconfig
│ │ ├── Release.xcconfig
│ │ └── Warnings.xcconfig
│ ├── DebugProfile.entitlements
│ ├── Info.plist
│ ├── MainFlutterWindow.swift
│ └── Release.entitlements
├── RunnerTests
│ └── RunnerTests.swift
└── packaging
│ └── dmg
│ └── make_config.yaml
├── pubspec.lock
├── pubspec.yaml
├── test
├── tem.dart
└── 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
├── website
├── assets
│ ├── animatecss
│ │ └── animate.min.css
│ ├── as-pie-progress
│ │ ├── css
│ │ │ └── progress.min.css
│ │ └── jquery-as-pie-progress.min.js
│ ├── bootstrap
│ │ ├── css
│ │ │ ├── bootstrap-grid.min.css
│ │ │ ├── bootstrap-reboot.min.css
│ │ │ └── bootstrap.min.css
│ │ └── js
│ │ │ └── bootstrap.min.js
│ ├── busuanzi.pure.mini.js
│ ├── imagesloaded.pkgd.min.js
│ ├── mobirise
│ │ └── css
│ │ │ └── mbr-additional.css
│ ├── mystyle.css
│ ├── parallax
│ │ └── jarallax.min.js
│ ├── popper
│ │ └── popper.min.js
│ ├── simple-pre-loader
│ │ ├── images
│ │ │ ├── loader-128x
│ │ │ │ ├── preloader_1.gif
│ │ │ │ ├── preloader_2.gif
│ │ │ │ ├── preloader_3.gif
│ │ │ │ ├── preloader_4.gif
│ │ │ │ ├── preloader_5.gif
│ │ │ │ ├── preloader_6.gif
│ │ │ │ └── preloader_7.gif
│ │ │ ├── loader-32x
│ │ │ │ ├── loader1.gif
│ │ │ │ ├── loader2.gif
│ │ │ │ ├── loader3.gif
│ │ │ │ ├── loader4.gif
│ │ │ │ ├── loader5.gif
│ │ │ │ ├── loader6.gif
│ │ │ │ └── loader7.gif
│ │ │ └── loader-64x
│ │ │ │ ├── preloader_1.gif
│ │ │ │ ├── preloader_2.gif
│ │ │ │ ├── preloader_3.gif
│ │ │ │ ├── preloader_4.gif
│ │ │ │ ├── preloader_5.gif
│ │ │ │ ├── preloader_6.gif
│ │ │ │ └── preloader_7.gif
│ │ ├── index.html
│ │ ├── loader-icons-set-1-32x64x128.zip
│ │ ├── loader-icons-set-2-32x64x128.zip
│ │ ├── loading.gif
│ │ └── readme.txt
│ ├── smoothscroll
│ │ └── smooth-scroll.js
│ ├── socicon
│ │ ├── css
│ │ │ └── styles.css
│ │ └── fonts
│ │ │ ├── socicon.eot
│ │ │ ├── socicon.svg
│ │ │ ├── socicon.ttf
│ │ │ └── socicon.woff
│ ├── tether
│ │ ├── tether.min.css
│ │ └── tether.min.js
│ ├── theme
│ │ ├── css
│ │ │ └── style.css
│ │ └── js
│ │ │ └── script.js
│ ├── viewportchecker
│ │ └── jquery.viewportchecker.js
│ └── web
│ │ └── assets
│ │ ├── jquery
│ │ └── jquery.min.js
│ │ └── mobirise-icons
│ │ ├── mobirise-icons.css
│ │ ├── mobirise-icons.eot
│ │ ├── mobirise-icons.svg
│ │ ├── mobirise-icons.ttf
│ │ └── mobirise-icons.woff
├── bingsiteauth.xml
├── image
│ ├── 1.png
│ ├── 2.png
│ ├── 3.png
│ ├── 4.png
│ ├── 5.png
│ ├── cloudflare.svg
│ ├── icon.png
│ └── netlify.svg
├── index.html
└── sitemap.xml
└── windows
├── .gitignore
├── CMakeLists.txt
├── flutter
├── CMakeLists.txt
├── generated_plugin_registrant.cc
├── generated_plugin_registrant.h
└── generated_plugins.cmake
├── packaging
└── exe
│ ├── inno_setup.iss
│ └── make_config.yaml
└── 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 | migrate_working_dir/
12 |
13 | # IntelliJ related
14 | *.iml
15 | *.ipr
16 | *.iws
17 | .idea/
18 |
19 | # The .vscode folder contains launch configuration and tasks you configure in
20 | # VS Code which you may wish to be included in version control, so this line
21 | # is commented out by default.
22 | #.vscode/
23 |
24 | # Flutter/Dart/Pub related
25 | **/doc/api/
26 | **/ios/Flutter/.last_build_id
27 | .dart_tool/
28 | .flutter-plugins
29 | .flutter-plugins-dependencies
30 | .packages
31 | .pub-cache/
32 | .pub/
33 | /build/
34 | /dist/
35 |
36 | # Symbolication related
37 | app.*.symbols
38 |
39 | # Obfuscation related
40 | app.*.map.json
41 |
42 | # Android Studio will place build artifacts here
43 | /android/app/debug
44 | /android/app/profile
45 | /android/app/release
46 |
47 | .vscode
--------------------------------------------------------------------------------
/.gitmodules:
--------------------------------------------------------------------------------
1 | [submodule "tool/flutter_distributor"]
2 | path = tool/flutter_distributor
3 | url = https://github.com/Muska-Ami/flutter_distributor
4 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
29 |
30 | > [!warning]
31 | > 本项目包含了**大量的史山代码**
32 |
33 | ## 📖 介绍
34 |
35 | 新一代 NoneBot 图形化界面,基于 Dart 和 Flutter 开发
36 |
37 | ## ✨ 特性
38 |
39 | - 简约 UI
40 | - 快速上手,开箱即用
41 | - 全平台支持(Windows,Linux,MacOS ~~(待测试)~~)
42 | - 实用高效,一步到位
43 | - 支持多 Bot 管理
44 | - 快速部署,一键连接
45 |
46 |
47 | ## 🤓安装前置
48 | ### Windows
49 | 本软件运行需要安装 Microsoft Visual C++ Redistributable 依赖,如无法打开请尝试从此处下载安装运行后使用。
50 | [https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist](https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist)
51 |
52 | ### Linux
53 | 请使用以下命令安装依赖(以 Debian 系为例)
54 |
55 | ```bash
56 | sudo apt-get install appindicator3-0.1 libappindicator3-dev libnotify-dev
57 | ```
58 |
59 |
60 | ## ⚙️安装
61 |
62 | 即刻前往:[Release](https://github.com/NonebotGUI/nonebot-flutter-gui/releases)
63 |
64 |
65 | ## 🖼️ 使用截图
66 |
67 | 
68 |
69 | 
70 |
71 | ## 🚚 旧数据迁移指南
72 |
73 | 从 `0.1.7` 版本开始,NoneBotGUI 将不再使用 `用户目录/.nbgui`作为数据文件夹,而是使用 `path_provider`提供路径
74 | 你需要**手动**将旧版本 `.nbgui` 下的所有目录和文件移动到新版本的文件夹中,在应用程序的 `更多-设置-旧版本数据迁移指南` 中可以看见新版本的路径
75 |
76 | ## 📑 TODO List
77 |
78 | - [X] 清理史山【完成度:50%】
79 | - [X] 重构新的 UI
80 | - [X] 在主页面直接启动 Bot
81 | - [X] 检查更新
82 |
83 | ## 📄 协议
84 |
85 | GPL-3.0 license
86 |
87 | ## 🐧 QQ Group
88 |
89 | 欢迎加入我们的 QQ 群组!
90 |
91 |
92 | 972526136
93 |
94 |
--------------------------------------------------------------------------------
/RELEASE_CHANGELOG.md:
--------------------------------------------------------------------------------
1 | ## 🌈ChangeLog 2025.03.21 🤯
2 | by @XTxiaoting14332
3 | 修复一键部署时填写路径错误的问题
--------------------------------------------------------------------------------
/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 | analyzer:
12 | exclude:
13 | - tool/**
14 |
15 | linter:
16 | # The lint rules applied to this project can be customized in the
17 | # section below to disable rules from the `package:flutter_lints/flutter.yaml`
18 | # included above or to enable additional rules. A list of all available lints
19 | # and their documentation is published at https://dart.dev/lints.
20 | #
21 | # Instead of disabling a lint rule for the entire project in the
22 | # section below, it can also be suppressed for a single line of code
23 | # or a specific dart file by using the `// ignore: name_of_lint` and
24 | # `// ignore_for_file: name_of_lint` syntax on the line or in the file
25 | # producing the lint.
26 | rules:
27 | always_use_package_imports: true
28 | avoid_web_libraries_in_flutter: true
29 | use_build_context_synchronously: false
30 | annotate_overrides: true
31 | # avoid_print: false # Uncomment to disable the `avoid_print` rule
32 | # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule
33 |
34 | # Additional information about this file can be found at
35 | # https://dart.dev/guides/language/analysis-options
36 |
--------------------------------------------------------------------------------
/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 | plugins {
2 | id "com.android.application"
3 | id "kotlin-android"
4 | id "dev.flutter.flutter-gradle-plugin"
5 | }
6 |
7 | def localProperties = new Properties()
8 | def localPropertiesFile = rootProject.file('local.properties')
9 | if (localPropertiesFile.exists()) {
10 | localPropertiesFile.withReader('UTF-8') { reader ->
11 | localProperties.load(reader)
12 | }
13 | }
14 |
15 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
16 | if (flutterVersionCode == null) {
17 | flutterVersionCode = '1'
18 | }
19 |
20 | def flutterVersionName = localProperties.getProperty('flutter.versionName')
21 | if (flutterVersionName == null) {
22 | flutterVersionName = '1.0'
23 | }
24 |
25 | android {
26 | namespace "com.nightwind.NonebotGUI"
27 | compileSdk flutter.compileSdkVersion
28 | ndkVersion flutter.ndkVersion
29 |
30 | compileOptions {
31 | sourceCompatibility JavaVersion.VERSION_1_8
32 | targetCompatibility JavaVersion.VERSION_1_8
33 | }
34 |
35 | kotlinOptions {
36 | jvmTarget = '1.8'
37 | }
38 |
39 | sourceSets {
40 | main.java.srcDirs += 'src/main/kotlin'
41 | }
42 |
43 | defaultConfig {
44 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
45 | applicationId "com.nightwind.NonebotGUI"
46 | // You can update the following values to match your application needs.
47 | // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
48 | minSdkVersion flutter.minSdkVersion
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 |
--------------------------------------------------------------------------------
/android/app/src/debug/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/android/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
14 |
18 |
22 |
23 |
24 |
25 |
26 |
27 |
29 |
32 |
33 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
--------------------------------------------------------------------------------
/android/app/src/main/kotlin/com/example/kyc/MainActivity.kt:
--------------------------------------------------------------------------------
1 | package com.nightwind.NonebotGUI
2 |
3 | import io.flutter.embedding.android.FlutterActivity
4 |
5 | class MainActivity: FlutterActivity()
6 |
--------------------------------------------------------------------------------
/android/app/src/main/res/drawable-v21/launch_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
12 |
13 |
--------------------------------------------------------------------------------
/android/app/src/main/res/drawable/launch_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
12 |
13 |
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NonebotGUI/nonebot-flutter-gui/74fb214e9247bacde29baf0f476f2d968b93e842/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NonebotGUI/nonebot-flutter-gui/74fb214e9247bacde29baf0f476f2d968b93e842/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NonebotGUI/nonebot-flutter-gui/74fb214e9247bacde29baf0f476f2d968b93e842/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NonebotGUI/nonebot-flutter-gui/74fb214e9247bacde29baf0f476f2d968b93e842/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NonebotGUI/nonebot-flutter-gui/74fb214e9247bacde29baf0f476f2d968b93e842/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/values-night/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
15 |
18 |
19 |
--------------------------------------------------------------------------------
/android/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
15 |
18 |
19 |
--------------------------------------------------------------------------------
/android/app/src/profile/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/android/build.gradle:
--------------------------------------------------------------------------------
1 | allprojects {
2 | repositories {
3 | google()
4 | mavenCentral()
5 | }
6 | }
7 |
8 | rootProject.buildDir = '../build'
9 | subprojects {
10 | project.buildDir = "${rootProject.buildDir}/${project.name}"
11 | }
12 | subprojects {
13 | project.evaluationDependsOn(':app')
14 | }
15 |
16 | tasks.register("clean", Delete) {
17 | delete rootProject.buildDir
18 | }
19 |
--------------------------------------------------------------------------------
/android/gradle.properties:
--------------------------------------------------------------------------------
1 | org.gradle.jvmargs=-Xmx4G
2 | android.useAndroidX=true
3 | android.enableJetifier=true
4 |
--------------------------------------------------------------------------------
/android/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionBase=GRADLE_USER_HOME
2 | distributionPath=wrapper/dists
3 | zipStoreBase=GRADLE_USER_HOME
4 | zipStorePath=wrapper/dists
5 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip
6 |
--------------------------------------------------------------------------------
/android/kyc_android.iml:
--------------------------------------------------------------------------------
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 |
--------------------------------------------------------------------------------
/android/settings.gradle:
--------------------------------------------------------------------------------
1 | pluginManagement {
2 | def flutterSdkPath = {
3 | def properties = new Properties()
4 | file("local.properties").withInputStream { properties.load(it) }
5 | def flutterSdkPath = properties.getProperty("flutter.sdk")
6 | assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
7 | return flutterSdkPath
8 | }
9 | settings.ext.flutterSdkPath = flutterSdkPath()
10 |
11 | includeBuild("${settings.ext.flutterSdkPath}/packages/flutter_tools/gradle")
12 |
13 | repositories {
14 | google()
15 | mavenCentral()
16 | gradlePluginPortal()
17 | }
18 | }
19 |
20 | plugins {
21 | id "dev.flutter.flutter-plugin-loader" version "1.0.0"
22 | id "com.android.application" version "7.3.0" apply false
23 | id "org.jetbrains.kotlin.android" version "1.7.10" apply false
24 | }
25 |
26 | include ":app"
27 |
--------------------------------------------------------------------------------
/asset/7z2405-x64.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NonebotGUI/nonebot-flutter-gui/74fb214e9247bacde29baf0f476f2d968b93e842/asset/7z2405-x64.exe
--------------------------------------------------------------------------------
/asset/appimagetool-x86_64.AppImage:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NonebotGUI/nonebot-flutter-gui/74fb214e9247bacde29baf0f476f2d968b93e842/asset/appimagetool-x86_64.AppImage
--------------------------------------------------------------------------------
/asset/font/Droid_Sans_Mono.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NonebotGUI/nonebot-flutter-gui/74fb214e9247bacde29baf0f476f2d968b93e842/asset/font/Droid_Sans_Mono.ttf
--------------------------------------------------------------------------------
/asset/font/HarmonyOS_Sans_SC_Bold.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NonebotGUI/nonebot-flutter-gui/74fb214e9247bacde29baf0f476f2d968b93e842/asset/font/HarmonyOS_Sans_SC_Bold.ttf
--------------------------------------------------------------------------------
/asset/font/HarmonyOS_Sans_SC_Light.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NonebotGUI/nonebot-flutter-gui/74fb214e9247bacde29baf0f476f2d968b93e842/asset/font/HarmonyOS_Sans_SC_Light.ttf
--------------------------------------------------------------------------------
/asset/font/HarmonyOS_Sans_SC_Medium.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NonebotGUI/nonebot-flutter-gui/74fb214e9247bacde29baf0f476f2d968b93e842/asset/font/HarmonyOS_Sans_SC_Medium.ttf
--------------------------------------------------------------------------------
/asset/font/HarmonyOS_Sans_SC_Regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NonebotGUI/nonebot-flutter-gui/74fb214e9247bacde29baf0f476f2d968b93e842/asset/font/HarmonyOS_Sans_SC_Regular.ttf
--------------------------------------------------------------------------------
/asset/icon/icon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NonebotGUI/nonebot-flutter-gui/74fb214e9247bacde29baf0f476f2d968b93e842/asset/icon/icon.ico
--------------------------------------------------------------------------------
/asset/icon/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NonebotGUI/nonebot-flutter-gui/74fb214e9247bacde29baf0f476f2d968b93e842/asset/icon/icon.png
--------------------------------------------------------------------------------
/asset/is.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NonebotGUI/nonebot-flutter-gui/74fb214e9247bacde29baf0f476f2d968b93e842/asset/is.exe
--------------------------------------------------------------------------------
/changelog.txt:
--------------------------------------------------------------------------------
1 | 修复一键部署时填写路径错误的问题
--------------------------------------------------------------------------------
/fonts/JetBrainsMono-Regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NonebotGUI/nonebot-flutter-gui/74fb214e9247bacde29baf0f476f2d968b93e842/fonts/JetBrainsMono-Regular.ttf
--------------------------------------------------------------------------------
/fonts/MyFlutterApp.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NonebotGUI/nonebot-flutter-gui/74fb214e9247bacde29baf0f476f2d968b93e842/fonts/MyFlutterApp.ttf
--------------------------------------------------------------------------------
/img/1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NonebotGUI/nonebot-flutter-gui/74fb214e9247bacde29baf0f476f2d968b93e842/img/1.png
--------------------------------------------------------------------------------
/img/2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NonebotGUI/nonebot-flutter-gui/74fb214e9247bacde29baf0f476f2d968b93e842/img/2.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 | 12.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 |
43 |
49 |
50 |
51 |
52 |
53 |
63 |
65 |
71 |
72 |
73 |
74 |
80 |
82 |
88 |
89 |
90 |
91 |
93 |
94 |
97 |
98 |
99 |
--------------------------------------------------------------------------------
/ios/Runner.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PreviewsEnabled
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/ios/Runner/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | import UIKit
2 | import Flutter
3 |
4 | @UIApplicationMain
5 | @objc class AppDelegate: FlutterAppDelegate {
6 | override func application(
7 | _ application: UIApplication,
8 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
9 | ) -> Bool {
10 | GeneratedPluginRegistrant.register(with: self)
11 | return super.application(application, didFinishLaunchingWithOptions: launchOptions)
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "size" : "20x20",
5 | "idiom" : "iphone",
6 | "filename" : "Icon-App-20x20@2x.png",
7 | "scale" : "2x"
8 | },
9 | {
10 | "size" : "20x20",
11 | "idiom" : "iphone",
12 | "filename" : "Icon-App-20x20@3x.png",
13 | "scale" : "3x"
14 | },
15 | {
16 | "size" : "29x29",
17 | "idiom" : "iphone",
18 | "filename" : "Icon-App-29x29@1x.png",
19 | "scale" : "1x"
20 | },
21 | {
22 | "size" : "29x29",
23 | "idiom" : "iphone",
24 | "filename" : "Icon-App-29x29@2x.png",
25 | "scale" : "2x"
26 | },
27 | {
28 | "size" : "29x29",
29 | "idiom" : "iphone",
30 | "filename" : "Icon-App-29x29@3x.png",
31 | "scale" : "3x"
32 | },
33 | {
34 | "size" : "40x40",
35 | "idiom" : "iphone",
36 | "filename" : "Icon-App-40x40@2x.png",
37 | "scale" : "2x"
38 | },
39 | {
40 | "size" : "40x40",
41 | "idiom" : "iphone",
42 | "filename" : "Icon-App-40x40@3x.png",
43 | "scale" : "3x"
44 | },
45 | {
46 | "size" : "60x60",
47 | "idiom" : "iphone",
48 | "filename" : "Icon-App-60x60@2x.png",
49 | "scale" : "2x"
50 | },
51 | {
52 | "size" : "60x60",
53 | "idiom" : "iphone",
54 | "filename" : "Icon-App-60x60@3x.png",
55 | "scale" : "3x"
56 | },
57 | {
58 | "size" : "20x20",
59 | "idiom" : "ipad",
60 | "filename" : "Icon-App-20x20@1x.png",
61 | "scale" : "1x"
62 | },
63 | {
64 | "size" : "20x20",
65 | "idiom" : "ipad",
66 | "filename" : "Icon-App-20x20@2x.png",
67 | "scale" : "2x"
68 | },
69 | {
70 | "size" : "29x29",
71 | "idiom" : "ipad",
72 | "filename" : "Icon-App-29x29@1x.png",
73 | "scale" : "1x"
74 | },
75 | {
76 | "size" : "29x29",
77 | "idiom" : "ipad",
78 | "filename" : "Icon-App-29x29@2x.png",
79 | "scale" : "2x"
80 | },
81 | {
82 | "size" : "40x40",
83 | "idiom" : "ipad",
84 | "filename" : "Icon-App-40x40@1x.png",
85 | "scale" : "1x"
86 | },
87 | {
88 | "size" : "40x40",
89 | "idiom" : "ipad",
90 | "filename" : "Icon-App-40x40@2x.png",
91 | "scale" : "2x"
92 | },
93 | {
94 | "size" : "76x76",
95 | "idiom" : "ipad",
96 | "filename" : "Icon-App-76x76@1x.png",
97 | "scale" : "1x"
98 | },
99 | {
100 | "size" : "76x76",
101 | "idiom" : "ipad",
102 | "filename" : "Icon-App-76x76@2x.png",
103 | "scale" : "2x"
104 | },
105 | {
106 | "size" : "83.5x83.5",
107 | "idiom" : "ipad",
108 | "filename" : "Icon-App-83.5x83.5@2x.png",
109 | "scale" : "2x"
110 | },
111 | {
112 | "size" : "1024x1024",
113 | "idiom" : "ios-marketing",
114 | "filename" : "Icon-App-1024x1024@1x.png",
115 | "scale" : "1x"
116 | }
117 | ],
118 | "info" : {
119 | "version" : 1,
120 | "author" : "xcode"
121 | }
122 | }
123 |
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NonebotGUI/nonebot-flutter-gui/74fb214e9247bacde29baf0f476f2d968b93e842/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/NonebotGUI/nonebot-flutter-gui/74fb214e9247bacde29baf0f476f2d968b93e842/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/NonebotGUI/nonebot-flutter-gui/74fb214e9247bacde29baf0f476f2d968b93e842/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/NonebotGUI/nonebot-flutter-gui/74fb214e9247bacde29baf0f476f2d968b93e842/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/NonebotGUI/nonebot-flutter-gui/74fb214e9247bacde29baf0f476f2d968b93e842/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/NonebotGUI/nonebot-flutter-gui/74fb214e9247bacde29baf0f476f2d968b93e842/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/NonebotGUI/nonebot-flutter-gui/74fb214e9247bacde29baf0f476f2d968b93e842/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/NonebotGUI/nonebot-flutter-gui/74fb214e9247bacde29baf0f476f2d968b93e842/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/NonebotGUI/nonebot-flutter-gui/74fb214e9247bacde29baf0f476f2d968b93e842/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/NonebotGUI/nonebot-flutter-gui/74fb214e9247bacde29baf0f476f2d968b93e842/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/NonebotGUI/nonebot-flutter-gui/74fb214e9247bacde29baf0f476f2d968b93e842/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/NonebotGUI/nonebot-flutter-gui/74fb214e9247bacde29baf0f476f2d968b93e842/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/NonebotGUI/nonebot-flutter-gui/74fb214e9247bacde29baf0f476f2d968b93e842/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/NonebotGUI/nonebot-flutter-gui/74fb214e9247bacde29baf0f476f2d968b93e842/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/NonebotGUI/nonebot-flutter-gui/74fb214e9247bacde29baf0f476f2d968b93e842/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/NonebotGUI/nonebot-flutter-gui/74fb214e9247bacde29baf0f476f2d968b93e842/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NonebotGUI/nonebot-flutter-gui/74fb214e9247bacde29baf0f476f2d968b93e842/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NonebotGUI/nonebot-flutter-gui/74fb214e9247bacde29baf0f476f2d968b93e842/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 | NoneBotGUI
9 | CFBundleExecutable
10 | $(EXECUTABLE_NAME)
11 | CFBundleIdentifier
12 | $(PRODUCT_BUNDLE_IDENTIFIER)
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | NoneBotGUI
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 | CADisableMinimumFrameDurationOnPhone
45 |
46 | UIApplicationSupportsIndirectInputEvents
47 |
48 |
49 |
50 |
--------------------------------------------------------------------------------
/ios/Runner/Runner-Bridging-Header.h:
--------------------------------------------------------------------------------
1 | #import "GeneratedPluginRegistrant.h"
2 |
--------------------------------------------------------------------------------
/ios/RunnerTests/RunnerTests.swift:
--------------------------------------------------------------------------------
1 | import Flutter
2 | import UIKit
3 | import XCTest
4 |
5 | class RunnerTests: XCTestCase {
6 |
7 | func testExample() {
8 | // If you add code to the Runner application, consider adding tests here.
9 | // See https://developer.apple.com/documentation/xctest for more information about using XCTest.
10 | }
11 |
12 | }
13 |
--------------------------------------------------------------------------------
/kyc.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/lib/assets/aifadian.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/lib/assets/alipay.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/lib/assets/colorEgg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NonebotGUI/nonebot-flutter-gui/74fb214e9247bacde29baf0f476f2d968b93e842/lib/assets/colorEgg.png
--------------------------------------------------------------------------------
/lib/assets/donate_alipay.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NonebotGUI/nonebot-flutter-gui/74fb214e9247bacde29baf0f476f2d968b93e842/lib/assets/donate_alipay.png
--------------------------------------------------------------------------------
/lib/assets/donate_wechat.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NonebotGUI/nonebot-flutter-gui/74fb214e9247bacde29baf0f476f2d968b93e842/lib/assets/donate_wechat.png
--------------------------------------------------------------------------------
/lib/assets/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NonebotGUI/nonebot-flutter-gui/74fb214e9247bacde29baf0f476f2d968b93e842/lib/assets/icon.png
--------------------------------------------------------------------------------
/lib/assets/iconWin.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NonebotGUI/nonebot-flutter-gui/74fb214e9247bacde29baf0f476f2d968b93e842/lib/assets/iconWin.ico
--------------------------------------------------------------------------------
/lib/assets/loading.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NonebotGUI/nonebot-flutter-gui/74fb214e9247bacde29baf0f476f2d968b93e842/lib/assets/loading.gif
--------------------------------------------------------------------------------
/lib/assets/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NonebotGUI/nonebot-flutter-gui/74fb214e9247bacde29baf0f476f2d968b93e842/lib/assets/logo.png
--------------------------------------------------------------------------------
/lib/assets/logo_Old.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NonebotGUI/nonebot-flutter-gui/74fb214e9247bacde29baf0f476f2d968b93e842/lib/assets/logo_Old.png
--------------------------------------------------------------------------------
/lib/assets/my_flutter_app_icons.dart:
--------------------------------------------------------------------------------
1 | /// Flutter icons MyFlutterApp
2 | /// Copyright (C) 2024 by original authors @ fluttericon.com, fontello.com
3 | /// This font was generated by FlutterIcon.com, which is derived from Fontello.
4 | ///
5 | /// To use this font, place it in your fonts/ directory and include the
6 | /// following in your pubspec.yaml
7 | ///
8 | /// flutter:
9 | /// fonts:
10 | /// - family: MyFlutterApp
11 | /// fonts:
12 | /// - asset: fonts/MyFlutterApp.ttf
13 | ///
14 | ///
15 | ///
16 | library;
17 |
18 | import 'package:flutter/widgets.dart';
19 |
20 | class MyFlutterApp {
21 | MyFlutterApp._();
22 |
23 | static const _kFontFam = 'MyFlutterApp';
24 | static const String? _kFontPkg = null;
25 |
26 | static const IconData github =
27 | IconData(0xe800, fontFamily: _kFontFam, fontPackage: _kFontPkg);
28 | }
29 |
--------------------------------------------------------------------------------
/lib/assets/wechat.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/lib/ui/broadcast/detail.dart:
--------------------------------------------------------------------------------
1 | import 'dart:convert';
2 |
3 | import 'package:bitsdojo_window/bitsdojo_window.dart';
4 | import 'package:flutter/material.dart';
5 | import 'package:NoneBotGUI/utils/global.dart';
6 | import 'package:flutter_markdown/flutter_markdown.dart';
7 | import 'package:http/http.dart' as http;
8 | import 'package:window_manager/window_manager.dart';
9 |
10 | class BroadcastDetail extends StatefulWidget {
11 | const BroadcastDetail({super.key});
12 |
13 | @override
14 | State createState() => _HomeScreenState();
15 | }
16 |
17 | class _HomeScreenState extends State {
18 | @override
19 | void initState() {
20 | super.initState();
21 | fetchData();
22 | }
23 |
24 | @override
25 | void dispose() {
26 | super.dispose();
27 | }
28 |
29 | String md = '';
30 | Future fetchData() async {
31 | final response = await http.get(Uri.parse(
32 | 'https://api.zobyic.top/api/nbgui/broadcast/detail?id=${MainApp.broadcastId}'));
33 | if (response.statusCode == 200) {
34 | setState(() {
35 | String decodedBody = utf8.decode(response.bodyBytes);
36 | Map jsonMap = json.decode(decodedBody);
37 | md = jsonMap['content'];
38 | });
39 | } else {
40 | throw Exception('Failed to load data');
41 | }
42 | }
43 |
44 | @override
45 | Widget build(BuildContext context) {
46 | return Scaffold(
47 | appBar: PreferredSize(
48 | preferredSize: const Size.fromHeight(50),
49 | child: Row(
50 | children: [
51 | Expanded(
52 | child: MoveWindow(
53 | child: AppBar(
54 | title: const Text(
55 | '公告详情',
56 | style: TextStyle(color: Colors.white),
57 | ),
58 | actions: [
59 | IconButton(
60 | icon: const Icon(Icons.remove_rounded),
61 | color: Colors.white,
62 | onPressed: () => appWindow.minimize(),
63 | iconSize: 20,
64 | tooltip: "最小化",
65 | ),
66 | appWindow.isMaximized
67 | ? IconButton(
68 | icon: const Icon(Icons.rectangle_outlined),
69 | color: Colors.white,
70 | onPressed: () => appWindow.restore(),
71 | iconSize: 20,
72 | tooltip: "恢复大小",
73 | )
74 | : IconButton(
75 | icon: const Icon(Icons.rectangle_outlined),
76 | color: Colors.white,
77 | onPressed: () => appWindow.maximize(),
78 | iconSize: 20,
79 | tooltip: "最大化",
80 | ),
81 | IconButton(
82 | icon: const Icon(Icons.close_rounded),
83 | color: Colors.white,
84 | onPressed: () => windowManager.hide(),
85 | iconSize: 20,
86 | tooltip: "关闭",
87 | )
88 | ],
89 | ),
90 | ),
91 | ),
92 | ],
93 | ),
94 | ),
95 | body: md.isEmpty
96 | ? const Center(
97 | child: Column(
98 | mainAxisAlignment: MainAxisAlignment.center,
99 | children: [CircularProgressIndicator()],
100 | ),
101 | )
102 | : Markdown(
103 | styleSheet: MarkdownStyleSheet(textScaleFactor: 1.3),
104 | data: md));
105 | }
106 | }
107 |
--------------------------------------------------------------------------------
/lib/ui/broadcast/list.dart:
--------------------------------------------------------------------------------
1 | import 'dart:convert';
2 | import 'package:NoneBotGUI/utils/global.dart';
3 | import 'package:NoneBotGUI/ui/broadcast/detail.dart';
4 | import 'package:flutter/material.dart';
5 | import 'package:http/http.dart' as http;
6 |
7 | class BoradcastList extends StatefulWidget {
8 | const BoradcastList({super.key});
9 |
10 | @override
11 | State createState() => _HomeScreenState();
12 | }
13 |
14 | class _HomeScreenState extends State {
15 | List data = [];
16 |
17 | //拉取公告列表
18 | @override
19 | void initState() {
20 | super.initState();
21 | fetchData();
22 | }
23 |
24 | @override
25 | void dispose() {
26 | super.dispose();
27 | }
28 |
29 | Future fetchData() async {
30 | final response = await http
31 | .get(Uri.parse('https://api.nbgui.top/api/nbgui/broadcast/list/'));
32 | if (response.statusCode == 200) {
33 | setState(() {
34 | String decodedBody = utf8.decode(response.bodyBytes);
35 | final List jsonData = json.decode(decodedBody);
36 | jsonData.sort((a, b) => b['id'] - a['id']); // 按id从大到小排序
37 | data = jsonData;
38 | });
39 | } else {
40 | throw Exception('Failed to load data');
41 | }
42 | }
43 |
44 | InkWell list(broadcast) => InkWell(
45 | onTap: () {
46 | MainApp.broadcastId = broadcast['id'];
47 | Navigator.push(
48 | context,
49 | MaterialPageRoute(
50 | builder: (context) => const BroadcastDetail(),
51 | ),
52 | );
53 | },
54 | child: Card(
55 | child: Stack(
56 | children: [
57 | Positioned.fill(
58 | child: Padding(
59 | padding: const EdgeInsets.all(8.0),
60 | child: Column(
61 | mainAxisAlignment: MainAxisAlignment.start,
62 | crossAxisAlignment: CrossAxisAlignment.start,
63 | children: [
64 | Text(
65 | broadcast['name']
66 | .toString()
67 | .substring(0, broadcast['name'].length - 3),
68 | style: const TextStyle(
69 | fontWeight: FontWeight.bold,
70 | ),
71 | ),
72 | ],
73 | ),
74 | ),
75 | ),
76 | Positioned(
77 | left: 0,
78 | right: 0,
79 | bottom: 0,
80 | child: Padding(
81 | padding: const EdgeInsets.all(8.0),
82 | child: Text(
83 | broadcast['time'],
84 | style: TextStyle(
85 | fontSize: MediaQuery.of(context).textScaleFactor * 12,
86 | color: Colors.grey[550]),
87 | ),
88 | ),
89 | ),
90 | ],
91 | ),
92 | ),
93 | );
94 |
95 | @override
96 | Widget build(BuildContext context) {
97 | return Scaffold(
98 | body: data.isEmpty
99 | ? const Center(
100 | child: Column(
101 | mainAxisAlignment: MainAxisAlignment.center,
102 | children: [CircularProgressIndicator()],
103 | ),
104 | )
105 | : Container(
106 | margin: const EdgeInsets.fromLTRB(32, 20, 32, 12),
107 | child: GridView.builder(
108 | gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
109 | crossAxisCount: 3,
110 | crossAxisSpacing: 2,
111 | mainAxisSpacing: 2,
112 | childAspectRatio: 6 / 1,
113 | mainAxisExtent: 100),
114 | itemCount: data.length,
115 | itemBuilder: (BuildContext context, int index) =>
116 | list(data[index]),
117 | ),
118 | ),
119 | floatingActionButton: FloatingActionButton(
120 | onPressed: () {
121 | setState(() {
122 | data.clear();
123 | fetchData();
124 | });
125 | },
126 | tooltip: "刷新列表",
127 | shape: const CircleBorder(),
128 | child: const Icon(
129 | Icons.refresh_rounded,
130 | color: Colors.white,
131 | ),
132 | ),
133 | floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked,
134 | );
135 | }
136 | }
137 |
--------------------------------------------------------------------------------
/lib/ui/mainPage/fast_deploy.dart:
--------------------------------------------------------------------------------
1 | import 'dart:convert';
2 | import 'package:NoneBotGUI/utils/global.dart';
3 |
4 | import 'package:NoneBotGUI/utils/userConfig.dart';
5 | import 'package:flutter/material.dart';
6 | import 'package:http/http.dart' as http;
7 |
8 | class FastDeployList extends StatefulWidget {
9 | const FastDeployList({super.key});
10 |
11 | @override
12 | State createState() => _HomeScreenState();
13 | }
14 |
15 | class _HomeScreenState extends State {
16 | List data = [];
17 |
18 | @override
19 | void initState() {
20 | super.initState();
21 | fetchData();
22 | }
23 |
24 | @override
25 | void dispose() {
26 | super.dispose();
27 | }
28 |
29 | Future fetchData() async {
30 | final response = await http
31 | .get(Uri.parse('https://api.nbgui.top/api/nbgui/deploy/list'));
32 | if (response.statusCode == 200) {
33 | setState(() {
34 | String decodedBody =
35 | UserConfig.httpEncoding().decode(response.bodyBytes);
36 | final List jsonData = json.decode(decodedBody);
37 | jsonData.sort((a, b) => b['id'] - a['id']); // 按id从大到小排序
38 | data = jsonData;
39 | });
40 | } else {
41 | throw Exception('Failed to load data');
42 | }
43 | }
44 |
45 | InkWell list(deploy) => InkWell(
46 | onTap: () {
47 | FastDeploy.id = deploy['id'];
48 | setState(() {
49 | FastDeploy.page++;
50 | });
51 | },
52 | child: Card(
53 | child: Stack(
54 | children: [
55 | Positioned.fill(
56 | child: Padding(
57 | padding: const EdgeInsets.all(8.0),
58 | child: Column(
59 | mainAxisAlignment: MainAxisAlignment.start,
60 | crossAxisAlignment: CrossAxisAlignment.start,
61 | children: [
62 | Text(
63 | deploy['name']
64 | .toString()
65 | .substring(0, deploy['name'].length - 5),
66 | style: const TextStyle(
67 | fontWeight: FontWeight.bold,
68 | ),
69 | ),
70 | ],
71 | ),
72 | ),
73 | ),
74 | Positioned(
75 | left: 0,
76 | right: 0,
77 | bottom: 25,
78 | child: Padding(
79 | padding: const EdgeInsets.all(8.0),
80 | child: Text(
81 | deploy['desc'],
82 | style: TextStyle(
83 | fontSize: MediaQuery.of(context).textScaleFactor * 12,
84 | color: Colors.grey[550]),
85 | ),
86 | ),
87 | ),
88 | ],
89 | ),
90 | ),
91 | );
92 |
93 | @override
94 | Widget build(BuildContext context) {
95 | return Scaffold(
96 | body: data.isEmpty
97 | ? const Center(
98 | child: Column(
99 | mainAxisAlignment: MainAxisAlignment.center,
100 | children: [CircularProgressIndicator()],
101 | ),
102 | )
103 | : Container(
104 | margin: const EdgeInsets.fromLTRB(32, 20, 32, 12),
105 | child: GridView.builder(
106 | gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
107 | crossAxisCount: 3,
108 | crossAxisSpacing: 2,
109 | mainAxisSpacing: 2,
110 | childAspectRatio: 6 / 1,
111 | mainAxisExtent: 125),
112 | itemCount: data.length,
113 | itemBuilder: (BuildContext context, int index) =>
114 | list(data[index]),
115 | ),
116 | ),
117 | floatingActionButton: FloatingActionButton(
118 | onPressed: () {
119 | setState(() {
120 | data.clear();
121 | fetchData();
122 | });
123 | },
124 | tooltip: "刷新列表",
125 | shape: const CircleBorder(),
126 | child: const Icon(
127 | Icons.refresh_rounded,
128 | color: Colors.white,
129 | ),
130 | ),
131 | floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked,
132 | );
133 | }
134 | }
135 |
--------------------------------------------------------------------------------
/lib/ui/manage/stderr.dart:
--------------------------------------------------------------------------------
1 | import 'package:NoneBotGUI/utils/manage.dart';
2 | import 'package:bitsdojo_window/bitsdojo_window.dart';
3 | import 'package:flutter/material.dart';
4 | import 'package:window_manager/window_manager.dart';
5 |
6 | class StdErr extends StatefulWidget {
7 | const StdErr({super.key});
8 |
9 | @override
10 | State createState() => _HomeScreenState();
11 | }
12 |
13 | class _HomeScreenState extends State {
14 | @override
15 | void dispose() {
16 | super.dispose();
17 | }
18 |
19 | @override
20 | Widget build(BuildContext context) {
21 | return Scaffold(
22 | appBar: PreferredSize(
23 | preferredSize: const Size.fromHeight(50),
24 | child: Row(
25 | children: [
26 | Expanded(
27 | child: MoveWindow(
28 | child: AppBar(
29 | title: Text(
30 | "${Bot.name()} - stderr.log",
31 | style: const TextStyle(
32 | color: Colors.white,
33 | fontSize: 20,
34 | ),
35 | ),
36 | actions: [
37 | IconButton(
38 | icon: const Icon(Icons.delete_rounded),
39 | onPressed: () => _showConfirmationDialog(context),
40 | iconSize: 20,
41 | tooltip: "删除",
42 | ),
43 | IconButton(
44 | icon: const Icon(Icons.remove_rounded),
45 | color: Colors.white,
46 | onPressed: () => appWindow.minimize(),
47 | iconSize: 20,
48 | tooltip: "最小化",
49 | ),
50 | appWindow.isMaximized
51 | ? IconButton(
52 | icon: const Icon(Icons.rectangle_outlined),
53 | color: Colors.white,
54 | onPressed: () => setState(() {
55 | appWindow.restore();
56 | }),
57 | iconSize: 20,
58 | tooltip: "恢复大小",
59 | )
60 | : IconButton(
61 | icon: const Icon(Icons.rectangle_outlined),
62 | color: Colors.white,
63 | onPressed: () => setState(() {
64 | appWindow.maximize();
65 | }),
66 | iconSize: 20,
67 | tooltip: "最大化",
68 | ),
69 | IconButton(
70 | icon: const Icon(Icons.close_rounded),
71 | color: Colors.white,
72 | onPressed: () => windowManager.hide(),
73 | iconSize: 20,
74 | tooltip: "关闭",
75 | )
76 | ],
77 | ),
78 | ),
79 | )
80 | ],
81 | ),
82 | ),
83 | body: SingleChildScrollView(
84 | child: SizedBox(
85 | width: 20000,
86 | child: Row(
87 | children: [
88 | Expanded(
89 | child: Align(
90 | alignment: Alignment.centerLeft,
91 | child: Text(Bot.stderr()))),
92 | ],
93 | ),
94 | ),
95 | ),
96 | );
97 | }
98 | }
99 |
100 | void _showConfirmationDialog(BuildContext context) {
101 | showDialog(
102 | context: context,
103 | builder: (BuildContext context) {
104 | return AlertDialog(
105 | title: const Text('删除'),
106 | content: const Text('你确定要删除吗?'),
107 | actions: [
108 | TextButton(
109 | child: const Text('取消'),
110 | onPressed: () {
111 | Navigator.of(context).pop();
112 | },
113 | ),
114 | TextButton(
115 | child: const Text(
116 | '确定',
117 | style: TextStyle(color: Color.fromRGBO(238, 109, 109, 1)),
118 | ),
119 | onPressed: () {
120 | Navigator.of(context).pop();
121 | Bot.deleteStderr();
122 | ScaffoldMessenger.of(context).showSnackBar(
123 | const SnackBar(
124 | content: Text('已删除'),
125 | duration: Duration(seconds: 3),
126 | ),
127 | );
128 | },
129 | ),
130 | ],
131 | );
132 | },
133 | );
134 | }
135 |
--------------------------------------------------------------------------------
/lib/utils/core.dart:
--------------------------------------------------------------------------------
1 | import 'dart:convert';
2 | import 'dart:io';
3 | import 'dart:core';
4 | import 'package:NoneBotGUI/utils/manage.dart';
5 | import 'package:NoneBotGUI/utils/userConfig.dart';
6 | import 'package:path_provider/path_provider.dart';
7 | import 'package:NoneBotGUI/utils/global.dart';
8 | import 'package:toml/toml.dart';
9 | import 'package:path/path.dart' as path;
10 |
11 | ///初始化nbgui
12 | nbguiInit() async {
13 | Directory usrDir = await getApplicationSupportDirectory();
14 | if (!usrDir.existsSync()) {
15 | usrDir.createSync();
16 | }
17 | String dir = usrDir.path;
18 | File cfgFile = File('$dir/user_config.json');
19 | if (!cfgFile.existsSync()) {
20 | String cfg = '''
21 | {
22 | "python":"default",
23 | "nbcli":"default",
24 | "color":"light",
25 | "checkUpdate": true,
26 | "encoding": "systemEncoding",
27 | "httpencoding": "utf8",
28 | "botEncoding": "systemEncoding",
29 | "protocolEncoding": "utf8",
30 | "deployEncoding": "systemEncoding",
31 | "mirror": "https://registry.nonebot.dev",
32 | "refreshMode": "auto"
33 | }
34 | ''';
35 | cfgFile.writeAsStringSync(cfg);
36 | }
37 | Directory botDir = Directory('$dir/bots/');
38 | if (!botDir.existsSync()) {
39 | botDir.createSync();
40 | }
41 | return dir;
42 | }
43 |
44 | ///检查py
45 | Future getPyVer() async {
46 | try {
47 | ProcessResult results =
48 | await Process.run('${UserConfig.pythonPath()}', ['--version']);
49 | return results.stdout.trim();
50 | } catch (e) {
51 | return '你似乎还没有安装python?';
52 | }
53 | }
54 |
55 | ///检查nbcli
56 | Future getnbcliver() async {
57 | try {
58 | final ProcessResult results =
59 | await Process.run('${UserConfig.nbcliPath()}', ['-V']);
60 | return results.stdout;
61 | } catch (error) {
62 | return '你似乎还没有安装nb-cli?';
63 | }
64 | }
65 |
66 | //补救用,发现进managebot时如果找不到stderr就会炸()
67 | createLog(path) {
68 | File stdout = File('$path/nbgui_stdout.log');
69 | File stderr = File('$path/nbgui_stderr.log');
70 | File disable = File('$path/.disabled_plugins');
71 | if (!stdout.existsSync()) {
72 | stdout.createSync();
73 | }
74 | if (!stderr.existsSync()) {
75 | stderr.createSync();
76 | }
77 | if (!disable.existsSync()) {
78 | disable.createSync();
79 | }
80 | }
81 |
82 | ///清除日志
83 | clearLog(path) async {
84 | File stdout = File('$path/nbgui_stdout.log');
85 | stdout.delete();
86 | String info = "[INFO]Welcome to Nonebot GUI!";
87 | stdout.writeAsString(info);
88 | }
89 |
90 | ///从pyproject.toml中读取插件列表
91 | List getPluginList() {
92 | File pyprojectFile = File('${Bot.path()}/pyproject.toml');
93 | pyprojectFile.writeAsStringSync(pyprojectFile
94 | .readAsStringSync()
95 | .replaceAll('\r\n', '\n')
96 | .replaceAll('\r', '\n'));
97 | String pyprojectContent =
98 | pyprojectFile.readAsStringSync(encoding: systemEncoding);
99 | List linesWithoutComments = pyprojectContent
100 | .split('\n')
101 | .map((line) {
102 | int commentIndex = line.indexOf('#');
103 | if (commentIndex != -1) {
104 | return line.substring(0, commentIndex).trim();
105 | }
106 | return line;
107 | })
108 | .where((line) => line.isNotEmpty)
109 | .toList();
110 | String pyprojectWithoutComments = linesWithoutComments.join('\n');
111 | // 解析 TOML 文件
112 | var toml = TomlDocument.parse(pyprojectWithoutComments).toMap();
113 | var nonebot = toml['tool']['nonebot'];
114 | List pluginsList = nonebot['plugins'];
115 |
116 | return pluginsList;
117 | }
118 |
119 | getDisabledPluginList() {
120 | File disable = File('${Bot.path()}/.disabled_plugins');
121 | String content = disable.readAsStringSync();
122 | List disabledPlugins = content.split('\n');
123 | return disabledPlugins;
124 | }
125 |
126 | ///获取协议端文件名
127 | getProtocolFileName() {
128 | String ucmd = FastDeploy.cmd.replaceAll('./', '').replaceAll('.\\', '');
129 | List cmdList = ucmd.split(' ').toList();
130 | String pcmd = '';
131 | if (cmdList.length > 1) {
132 | pcmd = cmdList[0];
133 | } else {
134 | pcmd = cmdList[0];
135 | }
136 | FastDeploy.protocolFileName = pcmd;
137 | }
138 |
139 | //获取extDir
140 | Future getExtDir(String fileName, String searchDirectory) async {
141 | Directory dir = Directory(searchDirectory);
142 |
143 | if (await dir.exists()) {
144 | List entities = dir.listSync(recursive: true);
145 | for (FileSystemEntity entity in entities) {
146 | if (entity is File && path.basename(entity.path) == fileName) {
147 | String normalizedPath =
148 | path.normalize(path.dirname(entity.absolute.path));
149 | String escapedPath = normalizedPath.replaceAll(r'\', r'\\');
150 | return escapedPath;
151 | }
152 | }
153 | } else {
154 | print('Directory does not exist: $searchDirectory');
155 | }
156 | return null;
157 | }
158 |
159 | ///打开文件夹
160 | Future openFolder(path) async {
161 | if (Platform.isWindows) {
162 | await Process.run('explorer', [path]);
163 | } else if (Platform.isLinux) {
164 | await Process.run('xdg-open', [path]);
165 | } else if (Platform.isMacOS) {
166 | await Process.run('open', [path]);
167 | }
168 | }
169 |
170 | ///清除stderr
171 | deleteStderr(dir) {
172 | File stderrfile = File('$dir/nbgui_stderr.log');
173 | String clear = "";
174 | stderrfile.writeAsString(clear);
175 | }
176 |
177 | ///检查bot的type键
178 | //适配老东西(
179 | checkBotType() {
180 | File botcfg = File('$userDir/bots/${gOnOpen}.json');
181 | Map jsonMap = jsonDecode(botcfg.readAsStringSync());
182 | if (jsonMap.containsKey('type')) {
183 | return (jsonMap['type'] == 'deployed') ? true : false;
184 | } else {
185 | return false;
186 | }
187 | }
188 |
189 | ///设置快速部署的路径
190 | setDeployPath(path, name) {
191 | if (Platform.isWindows) {
192 | FastDeploy.path = '${path.toString().replaceAll('\\', '\\\\')}\\\\$name';
193 | } else if (Platform.isLinux || Platform.isMacOS) {
194 | FastDeploy.path = '$path/$name';
195 | }
196 | }
197 |
--------------------------------------------------------------------------------
/lib/utils/global.dart:
--------------------------------------------------------------------------------
1 | //全局变量
2 | //用户目录
3 | late final userDir;
4 |
5 | ///当前打开的Bot
6 | String gOnOpen = '';
7 |
8 | class MainApp {
9 | ///log
10 | static late String nbLog;
11 |
12 | ///协议端日志
13 | static late String protocolLog;
14 |
15 | ///版本号
16 | static late String version;
17 |
18 | static late int broadcastId;
19 |
20 | ///部署id
21 | static late int deployId;
22 |
23 | ///侧边栏是否展开
24 | static late bool barExtended;
25 | }
26 |
27 | ///快速部署相关
28 | class FastDeploy {
29 | ///快速部署页面
30 | static late int page;
31 |
32 | ///编号
33 | static late int id;
34 |
35 | ///下载连接
36 | static late List dlLink;
37 |
38 | ///部署时是否启用虚拟环境
39 | static late bool venv;
40 |
41 | ///部署路径
42 | static late String path;
43 |
44 | ///选择的路径
45 | static late String selectPath;
46 |
47 | ///部署名称
48 | static late String name;
49 |
50 | ///Websocket主机
51 | static late String wsHost;
52 |
53 | ///Websocket端口
54 | static late String wsPort;
55 |
56 | ///协议端本体解压后的目录
57 | static late String extDir;
58 |
59 | ///协议端配置文件
60 | static late String botConfig;
61 |
62 | ///协议端配置文件是否包含QQ号
63 | static late bool needQQ;
64 |
65 | ///如果需要QQ号,那么Bot的QQ号是?(诶诶真麻烦)
66 | static late String botQQ;
67 |
68 | ///协议端配置文件的相对路径
69 | static late String configPath;
70 |
71 | ///协议端配置文件的名称
72 | static late String configName;
73 |
74 | ///配套安装的驱动器
75 | static late String driver;
76 |
77 | ///配套安装的适配器
78 | static late String adapter;
79 |
80 | ///启动协议端的命令
81 | static late String cmd;
82 |
83 | ///模板
84 | static late String template;
85 |
86 | ///插件存放位置
87 | static late String pluginDir;
88 |
89 | ///协议端文件名
90 | static late String protocolFileName;
91 | }
92 |
93 | ///创建Bot相关
94 | class Create {
95 | ///Bot名称
96 | static late String name;
97 |
98 | ///Bot路径
99 | static late String? path;
100 |
101 | ///是否启用虚拟环境
102 | static late bool venv;
103 |
104 | ///是否立刻安装依赖
105 | static late bool installDep;
106 |
107 | ///适配器
108 | static late String adapter;
109 |
110 | ///驱动器
111 | static late String driver;
112 |
113 | ///模板
114 | static late String template;
115 |
116 | ///插件存放位置
117 | static late String pluginDir;
118 | }
119 |
120 | ///Bot.time列表
121 | List botList = [];
122 |
--------------------------------------------------------------------------------
/linux/.gitignore:
--------------------------------------------------------------------------------
1 | flutter/ephemeral
2 |
--------------------------------------------------------------------------------
/linux/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | # Project-level configuration.
2 | cmake_minimum_required(VERSION 3.10)
3 | project(runner LANGUAGES CXX)
4 |
5 | # The name of the executable created for the application. Change this to change
6 | # the on-disk name of your application.
7 | set(BINARY_NAME "NoneBotGUI")
8 | # The unique GTK application identifier for this application. See:
9 | # https://wiki.gnome.org/HowDoI/ChooseApplicationID
10 | set(APPLICATION_ID "com.nightwind.NonebotGUI")
11 |
12 | # Explicitly opt in to modern CMake behaviors to avoid warnings with recent
13 | # versions of CMake.
14 | cmake_policy(SET CMP0063 NEW)
15 |
16 | # Load bundled libraries from the lib/ directory relative to the binary.
17 | set(CMAKE_INSTALL_RPATH "$ORIGIN/lib")
18 |
19 | # Root filesystem for cross-building.
20 | if(FLUTTER_TARGET_PLATFORM_SYSROOT)
21 | set(CMAKE_SYSROOT ${FLUTTER_TARGET_PLATFORM_SYSROOT})
22 | set(CMAKE_FIND_ROOT_PATH ${CMAKE_SYSROOT})
23 | set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
24 | set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
25 | set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
26 | set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
27 | endif()
28 |
29 | # Define build configuration options.
30 | if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
31 | set(CMAKE_BUILD_TYPE "Debug" CACHE
32 | STRING "Flutter build mode" FORCE)
33 | set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS
34 | "Debug" "Profile" "Release")
35 | endif()
36 |
37 | # Compilation settings that should be applied to most targets.
38 | #
39 | # Be cautious about adding new options here, as plugins use this function by
40 | # default. In most cases, you should add new options to specific targets instead
41 | # of modifying this function.
42 | function(APPLY_STANDARD_SETTINGS TARGET)
43 | target_compile_features(${TARGET} PUBLIC cxx_std_14)
44 | target_compile_options(${TARGET} PRIVATE -Wall -Werror)
45 | target_compile_options(${TARGET} PRIVATE "$<$>:-O3>")
46 | target_compile_definitions(${TARGET} PRIVATE "$<$>:NDEBUG>")
47 | endfunction()
48 |
49 | # Flutter library and tool build rules.
50 | set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter")
51 | add_subdirectory(${FLUTTER_MANAGED_DIR})
52 |
53 | # System-level dependencies.
54 | find_package(PkgConfig REQUIRED)
55 | pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0)
56 |
57 | add_definitions(-DAPPLICATION_ID="${APPLICATION_ID}")
58 |
59 | # Define the application target. To change its name, change BINARY_NAME above,
60 | # not the value here, or `flutter run` will no longer work.
61 | #
62 | # Any new source files that you add to the application should be added here.
63 | add_executable(${BINARY_NAME}
64 | "main.cc"
65 | "my_application.cc"
66 | "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc"
67 | )
68 |
69 | # Apply the standard set of build settings. This can be removed for applications
70 | # that need different build settings.
71 | apply_standard_settings(${BINARY_NAME})
72 |
73 | # Add dependency libraries. Add any application-specific dependencies here.
74 | target_link_libraries(${BINARY_NAME} PRIVATE flutter)
75 | target_link_libraries(${BINARY_NAME} PRIVATE PkgConfig::GTK)
76 |
77 | # Run the Flutter tool portions of the build. This must not be removed.
78 | add_dependencies(${BINARY_NAME} flutter_assemble)
79 |
80 | # Only the install-generated bundle's copy of the executable will launch
81 | # correctly, since the resources must in the right relative locations. To avoid
82 | # people trying to run the unbundled copy, put it in a subdirectory instead of
83 | # the default top-level location.
84 | set_target_properties(${BINARY_NAME}
85 | PROPERTIES
86 | RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/intermediates_do_not_run"
87 | )
88 |
89 |
90 | # Generated plugin build rules, which manage building the plugins and adding
91 | # them to the application.
92 | include(flutter/generated_plugins.cmake)
93 |
94 |
95 | # === Installation ===
96 | # By default, "installing" just makes a relocatable bundle in the build
97 | # directory.
98 | set(BUILD_BUNDLE_DIR "${PROJECT_BINARY_DIR}/bundle")
99 | if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
100 | set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE)
101 | endif()
102 |
103 | # Start with a clean build bundle directory every time.
104 | install(CODE "
105 | file(REMOVE_RECURSE \"${BUILD_BUNDLE_DIR}/\")
106 | " COMPONENT Runtime)
107 |
108 | set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data")
109 | set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}/lib")
110 |
111 | install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}"
112 | COMPONENT Runtime)
113 |
114 | install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}"
115 | COMPONENT Runtime)
116 |
117 | install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"
118 | COMPONENT Runtime)
119 |
120 | foreach(bundled_library ${PLUGIN_BUNDLED_LIBRARIES})
121 | install(FILES "${bundled_library}"
122 | DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"
123 | COMPONENT Runtime)
124 | endforeach(bundled_library)
125 |
126 | # Copy the native assets provided by the build.dart from all packages.
127 | set(NATIVE_ASSETS_DIR "${PROJECT_BUILD_DIR}native_assets/linux/")
128 | install(DIRECTORY "${NATIVE_ASSETS_DIR}"
129 | DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"
130 | COMPONENT Runtime)
131 |
132 | # Fully re-copy the assets directory on each build to avoid having stale files
133 | # from a previous install.
134 | set(FLUTTER_ASSET_DIR_NAME "flutter_assets")
135 | install(CODE "
136 | file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\")
137 | " COMPONENT Runtime)
138 | install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}"
139 | DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime)
140 |
141 | # Install the AOT library on non-Debug builds only.
142 | if(NOT CMAKE_BUILD_TYPE MATCHES "Debug")
143 | install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"
144 | COMPONENT Runtime)
145 | endif()
146 |
--------------------------------------------------------------------------------
/linux/flutter/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | # This file controls Flutter-level build steps. It should not be edited.
2 | cmake_minimum_required(VERSION 3.10)
3 |
4 | set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral")
5 |
6 | # Configuration provided via flutter tool.
7 | include(${EPHEMERAL_DIR}/generated_config.cmake)
8 |
9 | # TODO: Move the rest of this into files in ephemeral. See
10 | # https://github.com/flutter/flutter/issues/57146.
11 |
12 | # Serves the same purpose as list(TRANSFORM ... PREPEND ...),
13 | # which isn't available in 3.10.
14 | function(list_prepend LIST_NAME PREFIX)
15 | set(NEW_LIST "")
16 | foreach(element ${${LIST_NAME}})
17 | list(APPEND NEW_LIST "${PREFIX}${element}")
18 | endforeach(element)
19 | set(${LIST_NAME} "${NEW_LIST}" PARENT_SCOPE)
20 | endfunction()
21 |
22 | # === Flutter Library ===
23 | # System-level dependencies.
24 | find_package(PkgConfig REQUIRED)
25 | pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0)
26 | pkg_check_modules(GLIB REQUIRED IMPORTED_TARGET glib-2.0)
27 | pkg_check_modules(GIO REQUIRED IMPORTED_TARGET gio-2.0)
28 |
29 | set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/libflutter_linux_gtk.so")
30 |
31 | # Published to parent scope for install step.
32 | set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE)
33 | set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE)
34 | set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE)
35 | set(AOT_LIBRARY "${PROJECT_DIR}/build/lib/libapp.so" PARENT_SCOPE)
36 |
37 | list(APPEND FLUTTER_LIBRARY_HEADERS
38 | "fl_basic_message_channel.h"
39 | "fl_binary_codec.h"
40 | "fl_binary_messenger.h"
41 | "fl_dart_project.h"
42 | "fl_engine.h"
43 | "fl_json_message_codec.h"
44 | "fl_json_method_codec.h"
45 | "fl_message_codec.h"
46 | "fl_method_call.h"
47 | "fl_method_channel.h"
48 | "fl_method_codec.h"
49 | "fl_method_response.h"
50 | "fl_plugin_registrar.h"
51 | "fl_plugin_registry.h"
52 | "fl_standard_message_codec.h"
53 | "fl_standard_method_codec.h"
54 | "fl_string_codec.h"
55 | "fl_value.h"
56 | "fl_view.h"
57 | "flutter_linux.h"
58 | )
59 | list_prepend(FLUTTER_LIBRARY_HEADERS "${EPHEMERAL_DIR}/flutter_linux/")
60 | add_library(flutter INTERFACE)
61 | target_include_directories(flutter INTERFACE
62 | "${EPHEMERAL_DIR}"
63 | )
64 | target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}")
65 | target_link_libraries(flutter INTERFACE
66 | PkgConfig::GTK
67 | PkgConfig::GLIB
68 | PkgConfig::GIO
69 | )
70 | add_dependencies(flutter flutter_assemble)
71 |
72 | # === Flutter tool backend ===
73 | # _phony_ is a non-existent file to force this command to run every time,
74 | # since currently there's no way to get a full input/output list from the
75 | # flutter tool.
76 | add_custom_command(
77 | OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS}
78 | ${CMAKE_CURRENT_BINARY_DIR}/_phony_
79 | COMMAND ${CMAKE_COMMAND} -E env
80 | ${FLUTTER_TOOL_ENVIRONMENT}
81 | "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.sh"
82 | ${FLUTTER_TARGET_PLATFORM} ${CMAKE_BUILD_TYPE}
83 | VERBATIM
84 | )
85 | add_custom_target(flutter_assemble DEPENDS
86 | "${FLUTTER_LIBRARY}"
87 | ${FLUTTER_LIBRARY_HEADERS}
88 | )
89 |
--------------------------------------------------------------------------------
/linux/flutter/generated_plugin_registrant.cc:
--------------------------------------------------------------------------------
1 | //
2 | // Generated file. Do not edit.
3 | //
4 |
5 | // clang-format off
6 |
7 | #include "generated_plugin_registrant.h"
8 |
9 | #include
10 | #include
11 | #include
12 | #include
13 | #include
14 | #include
15 |
16 | void fl_register_plugins(FlPluginRegistry* registry) {
17 | g_autoptr(FlPluginRegistrar) bitsdojo_window_linux_registrar =
18 | fl_plugin_registry_get_registrar_for_plugin(registry, "BitsdojoWindowPlugin");
19 | bitsdojo_window_plugin_register_with_registrar(bitsdojo_window_linux_registrar);
20 | g_autoptr(FlPluginRegistrar) local_notifier_registrar =
21 | fl_plugin_registry_get_registrar_for_plugin(registry, "LocalNotifierPlugin");
22 | local_notifier_plugin_register_with_registrar(local_notifier_registrar);
23 | g_autoptr(FlPluginRegistrar) screen_retriever_registrar =
24 | fl_plugin_registry_get_registrar_for_plugin(registry, "ScreenRetrieverPlugin");
25 | screen_retriever_plugin_register_with_registrar(screen_retriever_registrar);
26 | g_autoptr(FlPluginRegistrar) tray_manager_registrar =
27 | fl_plugin_registry_get_registrar_for_plugin(registry, "TrayManagerPlugin");
28 | tray_manager_plugin_register_with_registrar(tray_manager_registrar);
29 | g_autoptr(FlPluginRegistrar) url_launcher_linux_registrar =
30 | fl_plugin_registry_get_registrar_for_plugin(registry, "UrlLauncherPlugin");
31 | url_launcher_plugin_register_with_registrar(url_launcher_linux_registrar);
32 | g_autoptr(FlPluginRegistrar) window_manager_registrar =
33 | fl_plugin_registry_get_registrar_for_plugin(registry, "WindowManagerPlugin");
34 | window_manager_plugin_register_with_registrar(window_manager_registrar);
35 | }
36 |
--------------------------------------------------------------------------------
/linux/flutter/generated_plugin_registrant.h:
--------------------------------------------------------------------------------
1 | //
2 | // Generated file. Do not edit.
3 | //
4 |
5 | // clang-format off
6 |
7 | #ifndef GENERATED_PLUGIN_REGISTRANT_
8 | #define GENERATED_PLUGIN_REGISTRANT_
9 |
10 | #include
11 |
12 | // Registers Flutter plugins.
13 | void fl_register_plugins(FlPluginRegistry* registry);
14 |
15 | #endif // GENERATED_PLUGIN_REGISTRANT_
16 |
--------------------------------------------------------------------------------
/linux/flutter/generated_plugins.cmake:
--------------------------------------------------------------------------------
1 | #
2 | # Generated file, do not edit.
3 | #
4 |
5 | list(APPEND FLUTTER_PLUGIN_LIST
6 | bitsdojo_window_linux
7 | local_notifier
8 | screen_retriever
9 | tray_manager
10 | url_launcher_linux
11 | window_manager
12 | )
13 |
14 | list(APPEND FLUTTER_FFI_PLUGIN_LIST
15 | )
16 |
17 | set(PLUGIN_BUNDLED_LIBRARIES)
18 |
19 | foreach(plugin ${FLUTTER_PLUGIN_LIST})
20 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/linux plugins/${plugin})
21 | target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin)
22 | list(APPEND PLUGIN_BUNDLED_LIBRARIES $)
23 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries})
24 | endforeach(plugin)
25 |
26 | foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST})
27 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/linux plugins/${ffi_plugin})
28 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries})
29 | endforeach(ffi_plugin)
30 |
--------------------------------------------------------------------------------
/linux/main.cc:
--------------------------------------------------------------------------------
1 | #include "my_application.h"
2 |
3 | int main(int argc, char** argv) {
4 | g_autoptr(MyApplication) app = my_application_new();
5 | return g_application_run(G_APPLICATION(app), argc, argv);
6 | }
7 |
--------------------------------------------------------------------------------
/linux/my_application.cc:
--------------------------------------------------------------------------------
1 | #include "my_application.h"
2 |
3 | #include
4 | #ifdef GDK_WINDOWING_X11
5 | #include
6 | #endif
7 |
8 | #include "flutter/generated_plugin_registrant.h"
9 | #include
10 |
11 |
12 | struct _MyApplication {
13 | GtkApplication parent_instance;
14 | char** dart_entrypoint_arguments;
15 | };
16 |
17 | G_DEFINE_TYPE(MyApplication, my_application, GTK_TYPE_APPLICATION)
18 |
19 | // Implements GApplication::activate.
20 | static void my_application_activate(GApplication* application) {
21 | MyApplication* self = MY_APPLICATION(application);
22 | GtkWindow* window =
23 | GTK_WINDOW(gtk_application_window_new(GTK_APPLICATION(application)));
24 |
25 | // Use a header bar when running in GNOME as this is the common style used
26 | // by applications and is the setup most users will be using (e.g. Ubuntu
27 | // desktop).
28 | // If running on X and not using GNOME then just use a traditional title bar
29 | // in case the window manager does more exotic layout, e.g. tiling.
30 | // If running on Wayland assume the header bar will work (may need changing
31 | // if future cases occur).
32 | gboolean use_header_bar = TRUE;
33 | #ifdef GDK_WINDOWING_X11
34 | GdkScreen* screen = gtk_window_get_screen(window);
35 | if (GDK_IS_X11_SCREEN(screen)) {
36 | const gchar* wm_name = gdk_x11_screen_get_window_manager_name(screen);
37 | if (g_strcmp0(wm_name, "GNOME Shell") != 0) {
38 | use_header_bar = FALSE;
39 | }
40 | }
41 | #endif
42 | if (use_header_bar) {
43 | GtkHeaderBar* header_bar = GTK_HEADER_BAR(gtk_header_bar_new());
44 | gtk_widget_show(GTK_WIDGET(header_bar));
45 | gtk_header_bar_set_title(header_bar, "NoneBot GUI");
46 | gtk_header_bar_set_show_close_button(header_bar, TRUE);
47 | gtk_window_set_titlebar(window, GTK_WIDGET(header_bar));
48 | } else {
49 | gtk_window_set_title(window, "NoneBot GUI");
50 | }
51 |
52 | auto bdw = bitsdojo_window_from(window); // <--- add this line
53 | bdw->setCustomFrame(true); // <-- add this line
54 | //gtk_window_set_default_size(window, 1280, 720); // <-- comment this line
55 | gtk_widget_show(GTK_WIDGET(window));
56 |
57 |
58 | g_autoptr(FlDartProject) project = fl_dart_project_new();
59 | fl_dart_project_set_dart_entrypoint_arguments(project, self->dart_entrypoint_arguments);
60 |
61 | FlView* view = fl_view_new(project);
62 | gtk_widget_show(GTK_WIDGET(view));
63 | gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(view));
64 |
65 | fl_register_plugins(FL_PLUGIN_REGISTRY(view));
66 |
67 | gtk_widget_grab_focus(GTK_WIDGET(view));
68 | }
69 |
70 | // Implements GApplication::local_command_line.
71 | static gboolean my_application_local_command_line(GApplication* application, gchar*** arguments, int* exit_status) {
72 | MyApplication* self = MY_APPLICATION(application);
73 | // Strip out the first argument as it is the binary name.
74 | self->dart_entrypoint_arguments = g_strdupv(*arguments + 1);
75 |
76 | g_autoptr(GError) error = nullptr;
77 | if (!g_application_register(application, nullptr, &error)) {
78 | g_warning("Failed to register: %s", error->message);
79 | *exit_status = 1;
80 | return TRUE;
81 | }
82 |
83 | g_application_activate(application);
84 | *exit_status = 0;
85 |
86 | return TRUE;
87 | }
88 |
89 | // Implements GApplication::startup.
90 | static void my_application_startup(GApplication* application) {
91 | //MyApplication* self = MY_APPLICATION(object);
92 |
93 | // Perform any actions required at application startup.
94 |
95 | G_APPLICATION_CLASS(my_application_parent_class)->startup(application);
96 | }
97 |
98 | // Implements GApplication::shutdown.
99 | static void my_application_shutdown(GApplication* application) {
100 | //MyApplication* self = MY_APPLICATION(object);
101 |
102 | // Perform any actions required at application shutdown.
103 |
104 | G_APPLICATION_CLASS(my_application_parent_class)->shutdown(application);
105 | }
106 |
107 | // Implements GObject::dispose.
108 | static void my_application_dispose(GObject* object) {
109 | MyApplication* self = MY_APPLICATION(object);
110 | g_clear_pointer(&self->dart_entrypoint_arguments, g_strfreev);
111 | G_OBJECT_CLASS(my_application_parent_class)->dispose(object);
112 | }
113 |
114 | static void my_application_class_init(MyApplicationClass* klass) {
115 | G_APPLICATION_CLASS(klass)->activate = my_application_activate;
116 | G_APPLICATION_CLASS(klass)->local_command_line = my_application_local_command_line;
117 | G_APPLICATION_CLASS(klass)->startup = my_application_startup;
118 | G_APPLICATION_CLASS(klass)->shutdown = my_application_shutdown;
119 | G_OBJECT_CLASS(klass)->dispose = my_application_dispose;
120 | }
121 |
122 | static void my_application_init(MyApplication* self) {}
123 |
124 | MyApplication* my_application_new() {
125 | return MY_APPLICATION(g_object_new(my_application_get_type(),
126 | "application-id", APPLICATION_ID,
127 | "flags", G_APPLICATION_NON_UNIQUE,
128 | nullptr));
129 | }
130 |
--------------------------------------------------------------------------------
/linux/my_application.h:
--------------------------------------------------------------------------------
1 | #ifndef FLUTTER_MY_APPLICATION_H_
2 | #define FLUTTER_MY_APPLICATION_H_
3 |
4 | #include
5 |
6 | G_DECLARE_FINAL_TYPE(MyApplication, my_application, MY, APPLICATION,
7 | GtkApplication)
8 |
9 | /**
10 | * my_application_new:
11 | *
12 | * Creates a new Flutter-based application.
13 | *
14 | * Returns: a new #MyApplication.
15 | */
16 | MyApplication* my_application_new();
17 |
18 | #endif // FLUTTER_MY_APPLICATION_H_
19 |
--------------------------------------------------------------------------------
/linux/packaging/appimage/make_config.yaml:
--------------------------------------------------------------------------------
1 | display_name: NoneBotGUI
2 | app_binary_name: NoneBotGUI
3 |
4 | icon: asset/icon/icon.png
5 |
6 | keywords:
7 | - Nonebot
8 |
9 | generic_name: NoneBotGUI
10 |
11 | actions: []
12 |
13 | categories:
14 | - Utility
15 |
16 | startup_notify: true
17 |
18 | # 您可以指定要与您的应用捆绑的共享库
19 | #
20 | # flutter_distributor 会自动检测您的应用所依赖的共享库,但您也可以在此处手动指定它们。
21 | #
22 | # 以下示例展示了如何将 libcurl 库与您的应用捆绑在一起
23 | #
24 | # include:
25 | # - libcurl.so.4
26 | include: []
--------------------------------------------------------------------------------
/linux/packaging/deb/make_config.yaml:
--------------------------------------------------------------------------------
1 | display_name: NoneBotGUI
2 | package_name: NoneBotGUI
3 | maintainer:
4 | name: 【夜风】NightWind
5 | email: HT30332@126.com
6 | co_authors:
7 | - name: 【夜风】NightWind
8 | email: HT30332@126.com
9 | priority: optional
10 | section: x11
11 | installed_size: 6604
12 | essential: false
13 | icon: asset/icon/icon.png
14 |
15 | postinstall_scripts: []
16 | postuninstall_scripts:
17 | - 'echo 感谢您的使用,再见!'
18 |
19 | keywords:
20 | - Nonebot
21 |
22 | generic_name: NoneBotGUI
23 |
24 | categories:
25 | - Utility
26 |
27 | startup_notify: true
28 |
--------------------------------------------------------------------------------
/linux/packaging/rpm/make_config.yaml:
--------------------------------------------------------------------------------
1 | icon: asset/icon/icon.png
2 | summary: 新一代Nonebot图形化界面
3 | group: Application/Utility
4 | vendor: 【夜风】NightWind
5 | packager: 【夜风】NightWind
6 | packagerEmail: HT30332@126.com
7 | license: GPL3
8 | url: https://github.com/XTxiaoting14332/nonebot-flutter-gui
9 | build_arch: x86_64
10 |
11 | display_name: NoneBotGUI
12 |
13 | keywords:
14 | - Nonebot
15 |
16 | generic_name: NoneBotGUI
17 |
18 | categories:
19 | - Utility
20 |
21 | startup_notify: true
--------------------------------------------------------------------------------
/macos/.gitignore:
--------------------------------------------------------------------------------
1 | # Flutter-related
2 | **/Flutter/ephemeral/
3 | **/Pods/
4 |
5 | # Xcode-related
6 | **/dgph
7 | **/xcuserdata/
8 |
--------------------------------------------------------------------------------
/macos/Flutter/Flutter-Debug.xcconfig:
--------------------------------------------------------------------------------
1 | #include "ephemeral/Flutter-Generated.xcconfig"
2 |
--------------------------------------------------------------------------------
/macos/Flutter/Flutter-Release.xcconfig:
--------------------------------------------------------------------------------
1 | #include "ephemeral/Flutter-Generated.xcconfig"
2 |
--------------------------------------------------------------------------------
/macos/Flutter/GeneratedPluginRegistrant.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Generated file. Do not edit.
3 | //
4 |
5 | import FlutterMacOS
6 | import Foundation
7 |
8 | import bitsdojo_window_macos
9 | import local_notifier
10 | import path_provider_foundation
11 | import screen_retriever
12 | import tray_manager
13 | import url_launcher_macos
14 | import window_manager
15 |
16 | func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
17 | BitsdojoWindowPlugin.register(with: registry.registrar(forPlugin: "BitsdojoWindowPlugin"))
18 | LocalNotifierPlugin.register(with: registry.registrar(forPlugin: "LocalNotifierPlugin"))
19 | PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
20 | ScreenRetrieverPlugin.register(with: registry.registrar(forPlugin: "ScreenRetrieverPlugin"))
21 | TrayManagerPlugin.register(with: registry.registrar(forPlugin: "TrayManagerPlugin"))
22 | UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin"))
23 | WindowManagerPlugin.register(with: registry.registrar(forPlugin: "WindowManagerPlugin"))
24 | }
25 |
--------------------------------------------------------------------------------
/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
37 |
38 |
39 |
40 |
43 |
49 |
50 |
51 |
52 |
53 |
63 |
65 |
71 |
72 |
73 |
74 |
80 |
82 |
88 |
89 |
90 |
91 |
93 |
94 |
97 |
98 |
99 |
--------------------------------------------------------------------------------
/macos/Runner.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/macos/Runner/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | import Cocoa
2 | import FlutterMacOS
3 |
4 | @NSApplicationMain
5 | class AppDelegate: FlutterAppDelegate {
6 | override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool {
7 | return true
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "size" : "16x16",
5 | "idiom" : "mac",
6 | "filename" : "app_icon_16.png",
7 | "scale" : "1x"
8 | },
9 | {
10 | "size" : "16x16",
11 | "idiom" : "mac",
12 | "filename" : "app_icon_32.png",
13 | "scale" : "2x"
14 | },
15 | {
16 | "size" : "32x32",
17 | "idiom" : "mac",
18 | "filename" : "app_icon_32.png",
19 | "scale" : "1x"
20 | },
21 | {
22 | "size" : "32x32",
23 | "idiom" : "mac",
24 | "filename" : "app_icon_64.png",
25 | "scale" : "2x"
26 | },
27 | {
28 | "size" : "128x128",
29 | "idiom" : "mac",
30 | "filename" : "app_icon_128.png",
31 | "scale" : "1x"
32 | },
33 | {
34 | "size" : "128x128",
35 | "idiom" : "mac",
36 | "filename" : "app_icon_256.png",
37 | "scale" : "2x"
38 | },
39 | {
40 | "size" : "256x256",
41 | "idiom" : "mac",
42 | "filename" : "app_icon_256.png",
43 | "scale" : "1x"
44 | },
45 | {
46 | "size" : "256x256",
47 | "idiom" : "mac",
48 | "filename" : "app_icon_512.png",
49 | "scale" : "2x"
50 | },
51 | {
52 | "size" : "512x512",
53 | "idiom" : "mac",
54 | "filename" : "app_icon_512.png",
55 | "scale" : "1x"
56 | },
57 | {
58 | "size" : "512x512",
59 | "idiom" : "mac",
60 | "filename" : "app_icon_1024.png",
61 | "scale" : "2x"
62 | }
63 | ],
64 | "info" : {
65 | "version" : 1,
66 | "author" : "xcode"
67 | }
68 | }
69 |
--------------------------------------------------------------------------------
/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NonebotGUI/nonebot-flutter-gui/74fb214e9247bacde29baf0f476f2d968b93e842/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png
--------------------------------------------------------------------------------
/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NonebotGUI/nonebot-flutter-gui/74fb214e9247bacde29baf0f476f2d968b93e842/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png
--------------------------------------------------------------------------------
/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NonebotGUI/nonebot-flutter-gui/74fb214e9247bacde29baf0f476f2d968b93e842/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png
--------------------------------------------------------------------------------
/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NonebotGUI/nonebot-flutter-gui/74fb214e9247bacde29baf0f476f2d968b93e842/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png
--------------------------------------------------------------------------------
/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NonebotGUI/nonebot-flutter-gui/74fb214e9247bacde29baf0f476f2d968b93e842/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png
--------------------------------------------------------------------------------
/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NonebotGUI/nonebot-flutter-gui/74fb214e9247bacde29baf0f476f2d968b93e842/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png
--------------------------------------------------------------------------------
/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NonebotGUI/nonebot-flutter-gui/74fb214e9247bacde29baf0f476f2d968b93e842/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png
--------------------------------------------------------------------------------
/macos/Runner/Configs/AppInfo.xcconfig:
--------------------------------------------------------------------------------
1 | // Application-level settings for the Runner target.
2 | //
3 | // This may be replaced with something auto-generated from metadata (e.g., pubspec.yaml) in the
4 | // future. If not, the values below would default to using the project name when this becomes a
5 | // 'flutter create' template.
6 |
7 | // The application's name. By default this is also the title of the Flutter window.
8 | PRODUCT_NAME = NoneBotGUI
9 |
10 | // The application's bundle identifier
11 | PRODUCT_BUNDLE_IDENTIFIER = com.nightwind.NonebotGUI
12 |
13 | // The copyright displayed in application information
14 | PRODUCT_COPYRIGHT = Copyright © 2023 com.nightwind. All rights reserved.
15 |
--------------------------------------------------------------------------------
/macos/Runner/Configs/Debug.xcconfig:
--------------------------------------------------------------------------------
1 | #include "../../Flutter/Flutter-Debug.xcconfig"
2 | #include "Warnings.xcconfig"
3 |
--------------------------------------------------------------------------------
/macos/Runner/Configs/Release.xcconfig:
--------------------------------------------------------------------------------
1 | #include "../../Flutter/Flutter-Release.xcconfig"
2 | #include "Warnings.xcconfig"
3 |
--------------------------------------------------------------------------------
/macos/Runner/Configs/Warnings.xcconfig:
--------------------------------------------------------------------------------
1 | WARNING_CFLAGS = -Wall -Wconditional-uninitialized -Wnullable-to-nonnull-conversion -Wmissing-method-return-type -Woverlength-strings
2 | GCC_WARN_UNDECLARED_SELECTOR = YES
3 | CLANG_UNDEFINED_BEHAVIOR_SANITIZER_NULLABILITY = YES
4 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE
5 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES
6 | CLANG_WARN_PRAGMA_PACK = YES
7 | CLANG_WARN_STRICT_PROTOTYPES = YES
8 | CLANG_WARN_COMMA = YES
9 | GCC_WARN_STRICT_SELECTOR_MATCH = YES
10 | CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = YES
11 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES
12 | GCC_WARN_SHADOW = YES
13 | CLANG_WARN_UNREACHABLE_CODE = YES
14 |
--------------------------------------------------------------------------------
/macos/Runner/DebugProfile.entitlements:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | com.apple.security.app-sandbox
6 |
7 | com.apple.security.cs.allow-jit
8 |
9 | com.apple.security.network.server
10 |
11 | com.apple.security.filesystem.read-write
12 |
13 | com.apple.security.files.bookmarks.app-scope
14 |
15 | com.apple.security.files.downloads.read-write
16 |
17 | com.apple.security.network.client
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/macos/Runner/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIconFile
10 |
11 | CFBundleIdentifier
12 | $(PRODUCT_BUNDLE_IDENTIFIER)
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | $(PRODUCT_NAME)
17 | CFBundlePackageType
18 | APPL
19 | CFBundleShortVersionString
20 | $(FLUTTER_BUILD_NAME)
21 | CFBundleVersion
22 | $(FLUTTER_BUILD_NUMBER)
23 | LSMinimumSystemVersion
24 | $(MACOSX_DEPLOYMENT_TARGET)
25 | NSHumanReadableCopyright
26 | $(PRODUCT_COPYRIGHT)
27 | NSMainNibFile
28 | MainMenu
29 | NSPrincipalClass
30 | NSApplication
31 | CFBundleURLTypes
32 |
33 |
34 | CFBundleURLName
35 |
36 | LoCyanFrp
37 | CFBundleURLSchemes
38 |
39 |
40 | locyanfrp
41 |
42 |
43 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/macos/Runner/MainFlutterWindow.swift:
--------------------------------------------------------------------------------
1 | import Cocoa
2 | import FlutterMacOS
3 |
4 | import bitsdojo_window_macos
5 |
6 | class MainFlutterWindow: BitsdojoWindow {
7 | override func bitsdojo_window_configure() -> UInt {
8 | return BDW_CUSTOM_FRAME | BDW_HIDE_ON_STARTUP
9 | }
10 |
11 | override func awakeFromNib() {
12 | let flutterViewController = FlutterViewController()
13 | let windowFrame = self.frame
14 | self.contentViewController = flutterViewController
15 | self.standardWindowButton(NSWindow.ButtonType.closeButton)?.isHidden = true
16 | self.standardWindowButton(NSWindow.ButtonType.miniaturizeButton)?.isHidden = true
17 | self.standardWindowButton(NSWindow.ButtonType.zoomButton)?.isHidden = true
18 | self.setFrame(windowFrame, display: true)
19 |
20 | RegisterGeneratedPlugins(registry: flutterViewController)
21 |
22 | super.awakeFromNib()
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/macos/Runner/Release.entitlements:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | com.apple.security.app-sandbox
6 |
7 | com.apple.security.filesystem.read-write
8 |
9 | com.apple.security.files.bookmarks.app-scope
10 |
11 | com.apple.security.files.downloads.read-write
12 |
13 | com.apple.security.network.client
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/macos/RunnerTests/RunnerTests.swift:
--------------------------------------------------------------------------------
1 | import FlutterMacOS
2 | import Cocoa
3 | import XCTest
4 |
5 | class RunnerTests: XCTestCase {
6 |
7 | func testExample() {
8 | // If you add code to the Runner application, consider adding tests here.
9 | // See https://developer.apple.com/documentation/xctest for more information about using XCTest.
10 | }
11 |
12 | }
13 |
--------------------------------------------------------------------------------
/macos/packaging/dmg/make_config.yaml:
--------------------------------------------------------------------------------
1 | title: NoneBot GUI
2 | contents:
3 | - x: 448
4 | y: 344
5 | type: link
6 | path: "/Applications"
7 | - x: 192
8 | y: 344
9 | type: file
10 | path: NoneBotGUI.app
--------------------------------------------------------------------------------
/pubspec.yaml:
--------------------------------------------------------------------------------
1 | name: "NoneBotGUI"
2 | description: "新一代Nonebot图形化界面"
3 | # The following line prevents the package from being accidentally published to
4 | # pub.dev using `flutter pub publish`. This is preferred for private packages.
5 | publish_to: 'none' # Remove this line if you wish to publish to pub.dev
6 |
7 | # The following defines the version and build number for your application.
8 | # A version number is three numbers separated by dots, like 1.2.43
9 | # followed by an optional build number separated by a +.
10 | # Both the version and the builder number may be overridden in flutter
11 | # build by specifying --build-name and --build-number, respectively.
12 | # In Android, build-name is used as versionName while build-number used as versionCode.
13 | # Read more about Android versioning at https://developer.android.com/studio/publish/versioning
14 | # In iOS, build-name is used as CFBundleShortVersionString while build-number is used as CFBundleVersion.
15 | # Read more about iOS versioning at
16 | # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
17 | # In Windows, build-name is used as the major, minor, and patch parts
18 | # of the product and file versions while build-number is used as the build suffix.
19 | version: 1.1.2+1
20 | environment:
21 | sdk: '>=3.3.1 <4.0.0'
22 |
23 | # Dependencies specify other packages that your package needs in order to work.
24 | # To automatically upgrade your package dependencies to the latest versions
25 | # consider running `flutter pub upgrade --major-versions`. Alternatively,
26 | # dependencies can be manually updated by changing the version numbers below to
27 | # the latest version available on pub.dev. To see which dependencies have newer
28 | # versions available, run `flutter pub outdated`.
29 | dependencies:
30 | flutter:
31 | sdk: flutter
32 | file_picker: ^8.0.0
33 | path_provider: ^2.1.2
34 | flutter_launcher_icons: ^0.13.1
35 | url_launcher: ^6.2.5
36 | http: ^1.2.1
37 | toml: ^0.15.0
38 | ansicolor: ^2.0.2
39 |
40 | # The following adds the Cupertino Icons font to your application.
41 | # Use with the CupertinoIcons class for iOS style icons.
42 | cupertino_icons: ^1.0.6
43 | flutter_markdown: ^0.7.1
44 | tray_manager: ^0.2.3
45 | window_manager: ^0.3.9
46 | bitsdojo_window: ^0.1.6
47 | dio: ^5.5.0+1
48 | archive: ^3.6.1
49 | watcher: ^1.1.0
50 | flutter_svg: ^2.0.10+1
51 | local_notifier: ^0.1.6
52 | path: ^1.9.0
53 |
54 | dev_dependencies:
55 | flutter_test:
56 | sdk: flutter
57 |
58 | # The "flutter_lints" package below contains a set of recommended lints to
59 | # encourage good coding practices. The lint set provided by the package is
60 | # activated in the `analysis_options.yaml` file located at the root of your
61 | # package. See that file for information about deactivating specific lint
62 | # rules and activating additional ones.
63 | flutter_lints: ^3.0.2
64 |
65 | flutter_launcher_icons:
66 | image_path: "asset/icon/icon.png"
67 | windows:
68 | generate: true
69 | macos:
70 | generate: true
71 | linux:
72 | generate: true
73 |
74 | # For information on the generic Dart part of this file, see the
75 | # following page: https://dart.dev/tools/pub/pubspec
76 |
77 | # The following section is specific to Flutter packages.
78 | flutter:
79 |
80 | # The following line ensures that the Material Icons font is
81 | # included with your application, so that you can use the icons in
82 | # the material Icons class.
83 | uses-material-design: true
84 |
85 | # To add assets to your application, add an assets section, like this:
86 | assets:
87 | - lib/assets/logo.png
88 | - lib/assets/colorEgg.png
89 | - lib/assets/loading.gif
90 | - lib/assets/iconWin.ico
91 | - lib/assets/icon.png
92 | - lib/assets/alipay.svg
93 | - lib/assets/wechat.svg
94 | - lib/assets/donate_wechat.png
95 | - lib/assets/donate_alipay.png
96 | - lib/assets/aifadian.svg
97 |
98 |
99 | # An image asset can refer to one or more resolution-specific "variants", see
100 | # https://flutter.dev/assets-and-images/#resolution-aware
101 |
102 | # For details regarding adding assets from package dependencies, see
103 | # https://flutter.dev/assets-and-images/#from-packages
104 |
105 | # To add custom fonts to your application, add a fonts section here,
106 | # in this "flutter" section. Each entry in this list should have a
107 | # "family" key with the font family name, and a "fonts" key with a
108 | # list giving the asset and other descriptors for the font. For
109 | # example:
110 | fonts:
111 | - family: MyFlutterApp
112 | fonts:
113 | - asset: fonts/MyFlutterApp.ttf
114 |
115 | - family: JetBrainsMono
116 | fonts:
117 | - asset: fonts/JetBrainsMono-Regular.ttf
118 | # - family: Trajan Pro
119 | # fonts:
120 | # - asset: fonts/TrajanPro.ttf
121 | # - asset: fonts/TrajanPro_Bold.ttf
122 | # weight: 700
123 | #
124 | # For details regarding fonts from package dependencies,
125 | # see https://flutter.dev/custom-fonts/#from-packages
126 |
--------------------------------------------------------------------------------
/test/tem.dart:
--------------------------------------------------------------------------------
1 | import 'package:bitsdojo_window/bitsdojo_window.dart';
2 | import 'package:flutter/material.dart';
3 | import 'package:window_manager/window_manager.dart';
4 |
5 | // 这段无意义的main不知道有什么用Test应该放到 /test 进行
6 | // 如果只是检查单页状态,可以在DEBUG Console里面调用NavPush来跳转路由
7 | // void main() {
8 | // runApp(
9 | // const MyApp(),
10 | // );
11 | //
12 | // }
13 | // class MyApp extends StatelessWidget {
14 | // const MyApp({super.key});
15 | //
16 | // @override
17 | // Widget build(BuildContext context) {
18 | // return MaterialApp(
19 | // home: Template(),
20 | // );
21 | // }
22 | // }
23 |
24 | class Template extends StatefulWidget {
25 | const Template({super.key});
26 |
27 | @override
28 | State createState() => _HomeScreenState();
29 | }
30 |
31 | class _HomeScreenState extends State {
32 |
33 | final myController = TextEditingController();
34 |
35 | @override
36 | Widget build(BuildContext context) {
37 | return Scaffold(
38 | appBar: PreferredSize(
39 | preferredSize: const Size.fromHeight(50),
40 | child: Row(
41 | children: [
42 | Expanded(
43 | child: MoveWindow(
44 | child: AppBar(
45 | title: Text("data"),
46 | actions: [
47 | IconButton(
48 | icon: const Icon(Icons.remove_rounded),
49 | color: Colors.white,
50 | onPressed: () => appWindow.minimize(),
51 | iconSize: 20,
52 | tooltip: "最小化",
53 | ),
54 | appWindow.isMaximized ?
55 | IconButton(
56 | icon: const Icon(Icons.rectangle_outlined),
57 | color: Colors.white,
58 | onPressed: () => appWindow.restore(),
59 | iconSize: 20,
60 | tooltip: "恢复大小",
61 | ) :
62 | IconButton(
63 | icon: const Icon(Icons.rectangle_outlined),
64 | color: Colors.white,
65 | onPressed: () => appWindow.maximize(),
66 | iconSize: 20,
67 | tooltip: "最大化",
68 | ),
69 | IconButton(
70 | icon: const Icon(Icons.close_rounded),
71 | color: Colors.white,
72 | onPressed: () => windowManager.hide(),
73 | iconSize: 20,
74 | tooltip: "关闭",
75 | )
76 | ],
77 | ),
78 | ),
79 | )
80 | ],
81 | ),
82 | ),
83 | backgroundColor: const Color.fromRGBO(238, 109, 109, 1),
84 | );
85 | }
86 | }
87 |
88 |
--------------------------------------------------------------------------------
/test/widget_test.dart:
--------------------------------------------------------------------------------
1 | // This is a basic Flutter widget test.
2 | //
3 | // To perform an interaction with a widget in your test, use the WidgetTester
4 | // utility in the flutter_test package. For example, you can send tap and scroll
5 | // gestures. You can also use WidgetTester to find child widgets in the widget
6 | // tree, read text, and verify that the values of widget properties are correct.
7 |
8 | import 'package:flutter/material.dart';
9 | import 'package:flutter_test/flutter_test.dart';
10 |
11 | void main() {
12 | testWidgets('Counter increments smoke test', (WidgetTester tester) async {
13 | // Build our app and trigger a frame.
14 | // await tester.pumpWidget(const MyApp());
15 |
16 | // Verify that our counter starts at 0.
17 | expect(find.text('0'), findsOneWidget);
18 | expect(find.text('1'), findsNothing);
19 |
20 | // Tap the '+' icon and trigger a frame.
21 | await tester.tap(find.byIcon(Icons.add));
22 | await tester.pump();
23 |
24 | // Verify that our counter has incremented.
25 | expect(find.text('0'), findsNothing);
26 | expect(find.text('1'), findsOneWidget);
27 | });
28 | }
29 |
--------------------------------------------------------------------------------
/web/favicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NonebotGUI/nonebot-flutter-gui/74fb214e9247bacde29baf0f476f2d968b93e842/web/favicon.png
--------------------------------------------------------------------------------
/web/icons/Icon-192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NonebotGUI/nonebot-flutter-gui/74fb214e9247bacde29baf0f476f2d968b93e842/web/icons/Icon-192.png
--------------------------------------------------------------------------------
/web/icons/Icon-512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NonebotGUI/nonebot-flutter-gui/74fb214e9247bacde29baf0f476f2d968b93e842/web/icons/Icon-512.png
--------------------------------------------------------------------------------
/web/icons/Icon-maskable-192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NonebotGUI/nonebot-flutter-gui/74fb214e9247bacde29baf0f476f2d968b93e842/web/icons/Icon-maskable-192.png
--------------------------------------------------------------------------------
/web/icons/Icon-maskable-512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NonebotGUI/nonebot-flutter-gui/74fb214e9247bacde29baf0f476f2d968b93e842/web/icons/Icon-maskable-512.png
--------------------------------------------------------------------------------
/web/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 | NoneBotGUI
33 |
34 |
35 |
39 |
40 |
41 |
42 |
43 |
58 |
59 |
60 |
--------------------------------------------------------------------------------
/web/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "NoneBotGUI",
3 | "short_name": "NoneBotGUI",
4 | "start_url": ".",
5 | "display": "standalone",
6 | "background_color": "#0175C2",
7 | "theme_color": "#0175C2",
8 | "description": "A new Flutter project.",
9 | "orientation": "portrait-primary",
10 | "prefer_related_applications": false,
11 | "icons": [
12 | {
13 | "src": "icons/Icon-192.png",
14 | "sizes": "192x192",
15 | "type": "image/png"
16 | },
17 | {
18 | "src": "icons/Icon-512.png",
19 | "sizes": "512x512",
20 | "type": "image/png"
21 | },
22 | {
23 | "src": "icons/Icon-maskable-192.png",
24 | "sizes": "192x192",
25 | "type": "image/png",
26 | "purpose": "maskable"
27 | },
28 | {
29 | "src": "icons/Icon-maskable-512.png",
30 | "sizes": "512x512",
31 | "type": "image/png",
32 | "purpose": "maskable"
33 | }
34 | ]
35 | }
36 |
--------------------------------------------------------------------------------
/website/assets/as-pie-progress/css/progress.min.css:
--------------------------------------------------------------------------------
1 | /**
2 | * jQuery asPieProgress
3 | * A jQuery plugin that animate the progress bar
4 | * Compiled: Fri Sep 02 2016 14:07:00 GMT+0800 (CST)
5 | * @version v0.3.4
6 | * @link https://github.com/amazingSurge/jquery-asPieProgress
7 | * @copyright LGPL-3.0
8 | */
9 | .pie_progress{position:relative;text-align:center;-webkit-transform-style:preserve-3d;transform-style:preserve-3d}.pie_progress svg{margin:0 auto}.pie_progress__content,.pie_progress__icon,.pie_progress__label,.pie_progress__number{position:absolute;top:50%;left:0;width:100%;-webkit-transform:translateY(-50%);-ms-transform:translateY(-50%);transform:translateY(-50%)}.pie_progress__number{font-size:42px}.pie_progress__label{margin-top:32px;font-size:12px}.pie_progress__svg{position:relative;display:inline-block;width:100%;padding-bottom:100%;overflow:hidden;vertical-align:middle}.pie_progress__svg svg{position:absolute;top:0;left:0;display:inline-block}
--------------------------------------------------------------------------------
/website/assets/bootstrap/css/bootstrap-reboot.min.css:
--------------------------------------------------------------------------------
1 | /*!
2 | * Bootstrap Reboot v4.0.0 (https://getbootstrap.com)
3 | * Copyright 2011-2018 The Bootstrap Authors
4 | * Copyright 2011-2018 Twitter, Inc.
5 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
6 | * Forked from Normalize.css, licensed MIT (https://github.com/necolas/normalize.css/blob/master/LICENSE.md)
7 | */*,::after,::before{box-sizing:border-box}html{font-family:sans-serif;line-height:1.15;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;-ms-overflow-style:scrollbar;-webkit-tap-highlight-color:transparent}@-ms-viewport{width:device-width}article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}body{margin:0;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";font-size:1rem;font-weight:400;line-height:1.5;color:#212529;text-align:left;background-color:#fff}[tabindex="-1"]:focus{outline:0!important}hr{box-sizing:content-box;height:0;overflow:visible}h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:.5rem}p{margin-top:0;margin-bottom:1rem}abbr[data-original-title],abbr[title]{text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted;cursor:help;border-bottom:0}address{margin-bottom:1rem;font-style:normal;line-height:inherit}dl,ol,ul{margin-top:0;margin-bottom:1rem}ol ol,ol ul,ul ol,ul ul{margin-bottom:0}dt{font-weight:700}dd{margin-bottom:.5rem;margin-left:0}blockquote{margin:0 0 1rem}dfn{font-style:italic}b,strong{font-weight:bolder}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}a{color:#007bff;text-decoration:none;background-color:transparent;-webkit-text-decoration-skip:objects}a:hover{color:#0056b3;text-decoration:underline}a:not([href]):not([tabindex]){color:inherit;text-decoration:none}a:not([href]):not([tabindex]):focus,a:not([href]):not([tabindex]):hover{color:inherit;text-decoration:none}a:not([href]):not([tabindex]):focus{outline:0}code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}pre{margin-top:0;margin-bottom:1rem;overflow:auto;-ms-overflow-style:scrollbar}figure{margin:0 0 1rem}img{vertical-align:middle;border-style:none}svg:not(:root){overflow:hidden}table{border-collapse:collapse}caption{padding-top:.75rem;padding-bottom:.75rem;color:#6c757d;text-align:left;caption-side:bottom}th{text-align:inherit}label{display:inline-block;margin-bottom:.5rem}button{border-radius:0}button:focus{outline:1px dotted;outline:5px auto -webkit-focus-ring-color}button,input,optgroup,select,textarea{margin:0;font-family:inherit;font-size:inherit;line-height:inherit}button,input{overflow:visible}button,select{text-transform:none}[type=reset],[type=submit],button,html [type=button]{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{padding:0;border-style:none}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}input[type=date],input[type=datetime-local],input[type=month],input[type=time]{-webkit-appearance:listbox}textarea{overflow:auto;resize:vertical}fieldset{min-width:0;padding:0;margin:0;border:0}legend{display:block;width:100%;max-width:100%;padding:0;margin-bottom:.5rem;font-size:1.5rem;line-height:inherit;color:inherit;white-space:normal}progress{vertical-align:baseline}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{outline-offset:-2px;-webkit-appearance:none}[type=search]::-webkit-search-cancel-button,[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{font:inherit;-webkit-appearance:button}output{display:inline-block}summary{display:list-item;cursor:pointer}template{display:none}[hidden]{display:none!important}
8 | /*# sourceMappingURL=bootstrap-reboot.min.css.map */
--------------------------------------------------------------------------------
/website/assets/busuanzi.pure.mini.js:
--------------------------------------------------------------------------------
1 | var bszCaller, bszTag;
2 | ! function() {
3 | var c, d, e, a = !1,
4 | b = [];
5 | ready = function(c) { return a || "interactive" === document.readyState || "complete" === document.readyState ? c.call(document) : b.push(function() { return c.call(this) }), this }, d = function() {
6 | for (var a = 0, c = b.length; c > a; a++) b[a].apply(document);
7 | b = []
8 | }, e = function() { a || (a = !0, d.call(window), document.removeEventListener ? document.removeEventListener("DOMContentLoaded", e, !1) : document.attachEvent && (document.detachEvent("onreadystatechange", e), window == window.top && (clearInterval(c), c = null))) }, document.addEventListener ? document.addEventListener("DOMContentLoaded", e, !1) : document.attachEvent && (document.attachEvent("onreadystatechange", function() { /loaded|complete/.test(document.readyState) && e() }), window == window.top && (c = setInterval(function() { try { a || document.documentElement.doScroll("left") } catch (b) { return } e() }, 5)))
9 | }(), bszCaller = {
10 | fetch: function(a, b) {
11 | var c = "BusuanziCallback_" + Math.floor(1099511627776 * Math.random());
12 | window[c] = this.evalCall(b), a = a.replace("=BusuanziCallback", "=" + c), scriptTag = document.createElement("SCRIPT"), scriptTag.type = "text/javascript", scriptTag.defer = !0, scriptTag.src = a, document.getElementsByTagName("HEAD")[0].appendChild(scriptTag)
13 | },
14 | evalCall: function(a) { return function(b) { ready(function() { try { a(b), scriptTag.parentElement.removeChild(scriptTag) } catch (c) { bszTag.hides() } }) } }
15 | }, bszCaller.fetch("https://busuanzi.ibruce.info/busuanzi?jsonpCallback=BusuanziCallback", function(a) { bszTag.texts(a), bszTag.shows() }), bszTag = {
16 | bszs: ["site_pv", "page_pv", "site_uv"],
17 | texts: function(a) {
18 | this.bszs.map(function(b) {
19 | var c = document.getElementById("busuanzi_value_" + b);
20 | c && (c.innerHTML = a[b])
21 | })
22 | },
23 | hides: function() {
24 | this.bszs.map(function(a) {
25 | var b = document.getElementById("busuanzi_container_" + a);
26 | b && (b.style.display = "none")
27 | })
28 | },
29 | shows: function() {
30 | this.bszs.map(function(a) {
31 | var b = document.getElementById("busuanzi_container_" + a);
32 | b && (b.style.display = "inline")
33 | })
34 | }
35 | };
--------------------------------------------------------------------------------
/website/assets/imagesloaded.pkgd.min.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * imagesLoaded PACKAGED v4.1.4
3 | * JavaScript is all like "You images are done yet or what?"
4 | * MIT License
5 | */
6 |
7 | !function(e,t){"function"==typeof define&&define.amd?define("ev-emitter/ev-emitter",t):"object"==typeof module&&module.exports?module.exports=t():e.EvEmitter=t()}("undefined"!=typeof window?window:this,function(){function e(){}var t=e.prototype;return t.on=function(e,t){if(e&&t){var i=this._events=this._events||{},n=i[e]=i[e]||[];return n.indexOf(t)==-1&&n.push(t),this}},t.once=function(e,t){if(e&&t){this.on(e,t);var i=this._onceEvents=this._onceEvents||{},n=i[e]=i[e]||{};return n[t]=!0,this}},t.off=function(e,t){var i=this._events&&this._events[e];if(i&&i.length){var n=i.indexOf(t);return n!=-1&&i.splice(n,1),this}},t.emitEvent=function(e,t){var i=this._events&&this._events[e];if(i&&i.length){i=i.slice(0),t=t||[];for(var n=this._onceEvents&&this._onceEvents[e],o=0;o
2 |
3 |
4 |
5 |
6 |
7 | SmallEnvelop : Simple PreLoader
8 |
9 |
25 |
26 |
27 |
28 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |

48 |
49 |
57 |
58 | Copyright © 2014 SmallEnvelop.com
59 |
--------------------------------------------------------------------------------
/website/assets/simple-pre-loader/loader-icons-set-1-32x64x128.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NonebotGUI/nonebot-flutter-gui/74fb214e9247bacde29baf0f476f2d968b93e842/website/assets/simple-pre-loader/loader-icons-set-1-32x64x128.zip
--------------------------------------------------------------------------------
/website/assets/simple-pre-loader/loader-icons-set-2-32x64x128.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NonebotGUI/nonebot-flutter-gui/74fb214e9247bacde29baf0f476f2d968b93e842/website/assets/simple-pre-loader/loader-icons-set-2-32x64x128.zip
--------------------------------------------------------------------------------
/website/assets/simple-pre-loader/loading.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NonebotGUI/nonebot-flutter-gui/74fb214e9247bacde29baf0f476f2d968b93e842/website/assets/simple-pre-loader/loading.gif
--------------------------------------------------------------------------------
/website/assets/simple-pre-loader/readme.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NonebotGUI/nonebot-flutter-gui/74fb214e9247bacde29baf0f476f2d968b93e842/website/assets/simple-pre-loader/readme.txt
--------------------------------------------------------------------------------
/website/assets/socicon/fonts/socicon.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NonebotGUI/nonebot-flutter-gui/74fb214e9247bacde29baf0f476f2d968b93e842/website/assets/socicon/fonts/socicon.eot
--------------------------------------------------------------------------------
/website/assets/socicon/fonts/socicon.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NonebotGUI/nonebot-flutter-gui/74fb214e9247bacde29baf0f476f2d968b93e842/website/assets/socicon/fonts/socicon.ttf
--------------------------------------------------------------------------------
/website/assets/socicon/fonts/socicon.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NonebotGUI/nonebot-flutter-gui/74fb214e9247bacde29baf0f476f2d968b93e842/website/assets/socicon/fonts/socicon.woff
--------------------------------------------------------------------------------
/website/assets/tether/tether.min.css:
--------------------------------------------------------------------------------
1 | .tether-element,.tether-element *,.tether-element :after,.tether-element :before,.tether-element:after,.tether-element:before{box-sizing:border-box}.tether-element{position:absolute;display:none}.tether-element.tether-open{display:block}
--------------------------------------------------------------------------------
/website/assets/viewportchecker/jquery.viewportchecker.js:
--------------------------------------------------------------------------------
1 | /*
2 | The MIT License (MIT)
3 |
4 | Copyright (c) 2014 Dirk Groenen
5 |
6 | Permission is hereby granted, free of charge, to any person obtaining a copy of
7 | this software and associated documentation files (the "Software"), to deal in
8 | the Software without restriction, including without limitation the rights to
9 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
10 | the Software, and to permit persons to whom the Software is furnished to do so,
11 | subject to the following conditions:
12 |
13 | The above copyright notice and this permission notice shall be included in all
14 | copies or substantial portions of the Software.
15 | */
16 | !function(t){t.fn.viewportChecker=function(o){var e={classToAdd:"visible",classToRemove:"invisible",classToAddForFullView:"full-visible",removeClassAfterAnimation:!1,offset:100,repeat:!1,invertBottomOffset:!0,callbackFunction:function(t,o){},scrollHorizontal:!1,scrollBox:window};t.extend(e,o);var a=this,s={height:t(e.scrollBox).height(),width:t(e.scrollBox).width()};return this.checkElements=function(){var o,l;e.scrollHorizontal?(o=Math.max(t("html").scrollLeft(),t("body").scrollLeft(),t(window).scrollLeft()),l=o+s.width):(o=Math.max(t("html").scrollTop(),t("body").scrollTop(),t(window).scrollTop()),l=o+s.height),a.each(function(){var a=t(this),i={},n={};if(a.data("vp-add-class")&&(n.classToAdd=a.data("vp-add-class")),a.data("vp-remove-class")&&(n.classToRemove=a.data("vp-remove-class")),a.data("vp-add-class-full-view")&&(n.classToAddForFullView=a.data("vp-add-class-full-view")),a.data("vp-keep-add-class")&&(n.removeClassAfterAnimation=a.data("vp-remove-after-animation")),a.data("vp-offset")&&(n.offset=a.data("vp-offset")),a.data("vp-repeat")&&(n.repeat=a.data("vp-repeat")),a.data("vp-scrollHorizontal")&&(n.scrollHorizontal=a.data("vp-scrollHorizontal")),a.data("vp-invertBottomOffset")&&(n.scrollHorizontal=a.data("vp-invertBottomOffset")),t.extend(i,e),t.extend(i,n),!a.data("vp-animated")||i.repeat){String(i.offset).indexOf("%")>0&&(i.offset=parseInt(i.offset)/100*s.height);var d=i.scrollHorizontal?a.offset().left:a.offset().top,r=i.scrollHorizontal?d+a.width():d+a.height(),c=Math.round(d)+i.offset,h=i.scrollHorizontal?c+a.width():c+a.height();i.invertBottomOffset&&(h-=2*i.offset),co?(a.removeClass(i.classToRemove),a.addClass(i.classToAdd),i.callbackFunction(a,"add"),r<=l&&d>=o?a.addClass(i.classToAddForFullView):a.removeClass(i.classToAddForFullView),a.data("vp-animated",!0),i.removeClassAfterAnimation&&a.one("webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend",function(){a.removeClass(i.classToAdd)})):a.hasClass(i.classToAdd)&&i.repeat&&(a.removeClass(i.classToAdd+" "+i.classToAddForFullView),i.callbackFunction(a,"remove"),a.data("vp-animated",!1))}})},("ontouchstart"in window||"onmsgesturechange"in window)&&t(document).bind("touchmove MSPointerMove pointermove",this.checkElements),t(e.scrollBox).bind("load scroll",this.checkElements),t(window).resize(function(o){s={height:t(e.scrollBox).height(),width:t(e.scrollBox).width()},a.checkElements()}),this.checkElements(),this}}(jQuery);var isBuilder=$("html").hasClass("is-builder");isBuilder||$(".counters").each(function(){$(this).viewportChecker({callbackFunction:function(t,o){$("#"+t.attr("id")+" .count").each(function(){$(this).prop("Counter",0).animate({Counter:$(this).text()},{duration:3e3,easing:"swing",step:function(t){$(this).text(Math.ceil(t))}})})}})});
--------------------------------------------------------------------------------
/website/assets/web/assets/mobirise-icons/mobirise-icons.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NonebotGUI/nonebot-flutter-gui/74fb214e9247bacde29baf0f476f2d968b93e842/website/assets/web/assets/mobirise-icons/mobirise-icons.eot
--------------------------------------------------------------------------------
/website/assets/web/assets/mobirise-icons/mobirise-icons.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NonebotGUI/nonebot-flutter-gui/74fb214e9247bacde29baf0f476f2d968b93e842/website/assets/web/assets/mobirise-icons/mobirise-icons.ttf
--------------------------------------------------------------------------------
/website/assets/web/assets/mobirise-icons/mobirise-icons.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NonebotGUI/nonebot-flutter-gui/74fb214e9247bacde29baf0f476f2d968b93e842/website/assets/web/assets/mobirise-icons/mobirise-icons.woff
--------------------------------------------------------------------------------
/website/bingsiteauth.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | CC44690B94B45436BBA5686950304210
4 |
--------------------------------------------------------------------------------
/website/image/1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NonebotGUI/nonebot-flutter-gui/74fb214e9247bacde29baf0f476f2d968b93e842/website/image/1.png
--------------------------------------------------------------------------------
/website/image/2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NonebotGUI/nonebot-flutter-gui/74fb214e9247bacde29baf0f476f2d968b93e842/website/image/2.png
--------------------------------------------------------------------------------
/website/image/3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NonebotGUI/nonebot-flutter-gui/74fb214e9247bacde29baf0f476f2d968b93e842/website/image/3.png
--------------------------------------------------------------------------------
/website/image/4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NonebotGUI/nonebot-flutter-gui/74fb214e9247bacde29baf0f476f2d968b93e842/website/image/4.png
--------------------------------------------------------------------------------
/website/image/5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NonebotGUI/nonebot-flutter-gui/74fb214e9247bacde29baf0f476f2d968b93e842/website/image/5.png
--------------------------------------------------------------------------------
/website/image/cloudflare.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/website/image/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NonebotGUI/nonebot-flutter-gui/74fb214e9247bacde29baf0f476f2d968b93e842/website/image/icon.png
--------------------------------------------------------------------------------
/website/image/netlify.svg:
--------------------------------------------------------------------------------
1 |
2 |
9 |
--------------------------------------------------------------------------------
/website/sitemap.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 | xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5 | xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9
6 | http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">
7 |
8 |
9 | https://nbgui.zobyic.top/
10 | 2024-04-13
11 | 0.8
12 |
13 |
14 | https://nbgui.zobyic.top/cdn-cgi/l/email-protection
15 | 2024-04-13
16 | 0.5
17 |
18 |
19 |
--------------------------------------------------------------------------------
/windows/.gitignore:
--------------------------------------------------------------------------------
1 | flutter/ephemeral/
2 |
3 | # Visual Studio user-specific files.
4 | *.suo
5 | *.user
6 | *.userosscache
7 | *.sln.docstates
8 |
9 | # Visual Studio build-related files.
10 | x64/
11 | x86/
12 |
13 | # Visual Studio cache files
14 | # files ending in .cache can be ignored
15 | *.[Cc]ache
16 | # but keep track of directories ending in .cache
17 | !*.[Cc]ache/
18 |
--------------------------------------------------------------------------------
/windows/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | # Project-level configuration.
2 | cmake_minimum_required(VERSION 3.14)
3 | project(NoneBotGUI LANGUAGES CXX)
4 |
5 | # The name of the executable created for the application. Change this to change
6 | # the on-disk name of your application.
7 | set(BINARY_NAME "NoneBotGUI")
8 |
9 | # Explicitly opt in to modern CMake behaviors to avoid warnings with recent
10 | # versions of CMake.
11 | cmake_policy(VERSION 3.14...3.25)
12 |
13 | # Define build configuration option.
14 | get_property(IS_MULTICONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
15 | if(IS_MULTICONFIG)
16 | set(CMAKE_CONFIGURATION_TYPES "Debug;Profile;Release"
17 | CACHE STRING "" FORCE)
18 | else()
19 | if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
20 | set(CMAKE_BUILD_TYPE "Debug" CACHE
21 | STRING "Flutter build mode" FORCE)
22 | set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS
23 | "Debug" "Profile" "Release")
24 | endif()
25 | endif()
26 | # Define settings for the Profile build mode.
27 | set(CMAKE_EXE_LINKER_FLAGS_PROFILE "${CMAKE_EXE_LINKER_FLAGS_RELEASE}")
28 | set(CMAKE_SHARED_LINKER_FLAGS_PROFILE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE}")
29 | set(CMAKE_C_FLAGS_PROFILE "${CMAKE_C_FLAGS_RELEASE}")
30 | set(CMAKE_CXX_FLAGS_PROFILE "${CMAKE_CXX_FLAGS_RELEASE}")
31 |
32 | # Use Unicode for all projects.
33 | add_definitions(-DUNICODE -D_UNICODE)
34 |
35 | # Compilation settings that should be applied to most targets.
36 | #
37 | # Be cautious about adding new options here, as plugins use this function by
38 | # default. In most cases, you should add new options to specific targets instead
39 | # of modifying this function.
40 | function(APPLY_STANDARD_SETTINGS TARGET)
41 | target_compile_features(${TARGET} PUBLIC cxx_std_17)
42 | target_compile_options(${TARGET} PRIVATE /W4 /WX /wd"4100")
43 | target_compile_options(${TARGET} PRIVATE /EHsc)
44 | target_compile_definitions(${TARGET} PRIVATE "_HAS_EXCEPTIONS=0")
45 | target_compile_definitions(${TARGET} PRIVATE "$<$:_DEBUG>")
46 | endfunction()
47 |
48 | # Flutter library and tool build rules.
49 | set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter")
50 | add_subdirectory(${FLUTTER_MANAGED_DIR})
51 |
52 | # Application build; see runner/CMakeLists.txt.
53 | add_subdirectory("runner")
54 |
55 |
56 | # Generated plugin build rules, which manage building the plugins and adding
57 | # them to the application.
58 | include(flutter/generated_plugins.cmake)
59 |
60 |
61 | # === Installation ===
62 | # Support files are copied into place next to the executable, so that it can
63 | # run in place. This is done instead of making a separate bundle (as on Linux)
64 | # so that building and running from within Visual Studio will work.
65 | set(BUILD_BUNDLE_DIR "$")
66 | # Make the "install" step default, as it's required to run.
67 | set(CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD 1)
68 | if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
69 | set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE)
70 | endif()
71 |
72 | set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data")
73 | set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}")
74 |
75 | install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}"
76 | COMPONENT Runtime)
77 |
78 | install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}"
79 | COMPONENT Runtime)
80 |
81 | install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"
82 | COMPONENT Runtime)
83 |
84 | if(PLUGIN_BUNDLED_LIBRARIES)
85 | install(FILES "${PLUGIN_BUNDLED_LIBRARIES}"
86 | DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"
87 | COMPONENT Runtime)
88 | endif()
89 |
90 | # Copy the native assets provided by the build.dart from all packages.
91 | set(NATIVE_ASSETS_DIR "${PROJECT_BUILD_DIR}native_assets/windows/")
92 | install(DIRECTORY "${NATIVE_ASSETS_DIR}"
93 | DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"
94 | COMPONENT Runtime)
95 |
96 | # Fully re-copy the assets directory on each build to avoid having stale files
97 | # from a previous install.
98 | set(FLUTTER_ASSET_DIR_NAME "flutter_assets")
99 | install(CODE "
100 | file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\")
101 | " COMPONENT Runtime)
102 | install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}"
103 | DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime)
104 |
105 | # Install the AOT library on non-Debug builds only.
106 | install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}"
107 | CONFIGURATIONS Profile;Release
108 | COMPONENT Runtime)
109 |
--------------------------------------------------------------------------------
/windows/flutter/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | # This file controls Flutter-level build steps. It should not be edited.
2 | cmake_minimum_required(VERSION 3.14)
3 |
4 | set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral")
5 |
6 | # Configuration provided via flutter tool.
7 | include(${EPHEMERAL_DIR}/generated_config.cmake)
8 |
9 | # TODO: Move the rest of this into files in ephemeral. See
10 | # https://github.com/flutter/flutter/issues/57146.
11 | set(WRAPPER_ROOT "${EPHEMERAL_DIR}/cpp_client_wrapper")
12 |
13 | # Set fallback configurations for older versions of the flutter tool.
14 | if (NOT DEFINED FLUTTER_TARGET_PLATFORM)
15 | set(FLUTTER_TARGET_PLATFORM "windows-x64")
16 | endif()
17 |
18 | # === Flutter Library ===
19 | set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/flutter_windows.dll")
20 |
21 | # Published to parent scope for install step.
22 | set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE)
23 | set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE)
24 | set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE)
25 | set(AOT_LIBRARY "${PROJECT_DIR}/build/windows/app.so" PARENT_SCOPE)
26 |
27 | list(APPEND FLUTTER_LIBRARY_HEADERS
28 | "flutter_export.h"
29 | "flutter_windows.h"
30 | "flutter_messenger.h"
31 | "flutter_plugin_registrar.h"
32 | "flutter_texture_registrar.h"
33 | )
34 | list(TRANSFORM FLUTTER_LIBRARY_HEADERS PREPEND "${EPHEMERAL_DIR}/")
35 | add_library(flutter INTERFACE)
36 | target_include_directories(flutter INTERFACE
37 | "${EPHEMERAL_DIR}"
38 | )
39 | target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}.lib")
40 | add_dependencies(flutter flutter_assemble)
41 |
42 | # === Wrapper ===
43 | list(APPEND CPP_WRAPPER_SOURCES_CORE
44 | "core_implementations.cc"
45 | "standard_codec.cc"
46 | )
47 | list(TRANSFORM CPP_WRAPPER_SOURCES_CORE PREPEND "${WRAPPER_ROOT}/")
48 | list(APPEND CPP_WRAPPER_SOURCES_PLUGIN
49 | "plugin_registrar.cc"
50 | )
51 | list(TRANSFORM CPP_WRAPPER_SOURCES_PLUGIN PREPEND "${WRAPPER_ROOT}/")
52 | list(APPEND CPP_WRAPPER_SOURCES_APP
53 | "flutter_engine.cc"
54 | "flutter_view_controller.cc"
55 | )
56 | list(TRANSFORM CPP_WRAPPER_SOURCES_APP PREPEND "${WRAPPER_ROOT}/")
57 |
58 | # Wrapper sources needed for a plugin.
59 | add_library(flutter_wrapper_plugin STATIC
60 | ${CPP_WRAPPER_SOURCES_CORE}
61 | ${CPP_WRAPPER_SOURCES_PLUGIN}
62 | )
63 | apply_standard_settings(flutter_wrapper_plugin)
64 | set_target_properties(flutter_wrapper_plugin PROPERTIES
65 | POSITION_INDEPENDENT_CODE ON)
66 | set_target_properties(flutter_wrapper_plugin PROPERTIES
67 | CXX_VISIBILITY_PRESET hidden)
68 | target_link_libraries(flutter_wrapper_plugin PUBLIC flutter)
69 | target_include_directories(flutter_wrapper_plugin PUBLIC
70 | "${WRAPPER_ROOT}/include"
71 | )
72 | add_dependencies(flutter_wrapper_plugin flutter_assemble)
73 |
74 | # Wrapper sources needed for the runner.
75 | add_library(flutter_wrapper_app STATIC
76 | ${CPP_WRAPPER_SOURCES_CORE}
77 | ${CPP_WRAPPER_SOURCES_APP}
78 | )
79 | apply_standard_settings(flutter_wrapper_app)
80 | target_link_libraries(flutter_wrapper_app PUBLIC flutter)
81 | target_include_directories(flutter_wrapper_app PUBLIC
82 | "${WRAPPER_ROOT}/include"
83 | )
84 | add_dependencies(flutter_wrapper_app flutter_assemble)
85 |
86 | # === Flutter tool backend ===
87 | # _phony_ is a non-existent file to force this command to run every time,
88 | # since currently there's no way to get a full input/output list from the
89 | # flutter tool.
90 | set(PHONY_OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/_phony_")
91 | set_source_files_properties("${PHONY_OUTPUT}" PROPERTIES SYMBOLIC TRUE)
92 | add_custom_command(
93 | OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS}
94 | ${CPP_WRAPPER_SOURCES_CORE} ${CPP_WRAPPER_SOURCES_PLUGIN}
95 | ${CPP_WRAPPER_SOURCES_APP}
96 | ${PHONY_OUTPUT}
97 | COMMAND ${CMAKE_COMMAND} -E env
98 | ${FLUTTER_TOOL_ENVIRONMENT}
99 | "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.bat"
100 | ${FLUTTER_TARGET_PLATFORM} $
101 | VERBATIM
102 | )
103 | add_custom_target(flutter_assemble DEPENDS
104 | "${FLUTTER_LIBRARY}"
105 | ${FLUTTER_LIBRARY_HEADERS}
106 | ${CPP_WRAPPER_SOURCES_CORE}
107 | ${CPP_WRAPPER_SOURCES_PLUGIN}
108 | ${CPP_WRAPPER_SOURCES_APP}
109 | )
110 |
--------------------------------------------------------------------------------
/windows/flutter/generated_plugin_registrant.cc:
--------------------------------------------------------------------------------
1 | //
2 | // Generated file. Do not edit.
3 | //
4 |
5 | // clang-format off
6 |
7 | #include "generated_plugin_registrant.h"
8 |
9 | #include
10 | #include
11 | #include
12 | #include
13 | #include
14 | #include
15 |
16 | void RegisterPlugins(flutter::PluginRegistry* registry) {
17 | BitsdojoWindowPluginRegisterWithRegistrar(
18 | registry->GetRegistrarForPlugin("BitsdojoWindowPlugin"));
19 | LocalNotifierPluginRegisterWithRegistrar(
20 | registry->GetRegistrarForPlugin("LocalNotifierPlugin"));
21 | ScreenRetrieverPluginRegisterWithRegistrar(
22 | registry->GetRegistrarForPlugin("ScreenRetrieverPlugin"));
23 | TrayManagerPluginRegisterWithRegistrar(
24 | registry->GetRegistrarForPlugin("TrayManagerPlugin"));
25 | UrlLauncherWindowsRegisterWithRegistrar(
26 | registry->GetRegistrarForPlugin("UrlLauncherWindows"));
27 | WindowManagerPluginRegisterWithRegistrar(
28 | registry->GetRegistrarForPlugin("WindowManagerPlugin"));
29 | }
30 |
--------------------------------------------------------------------------------
/windows/flutter/generated_plugin_registrant.h:
--------------------------------------------------------------------------------
1 | //
2 | // Generated file. Do not edit.
3 | //
4 |
5 | // clang-format off
6 |
7 | #ifndef GENERATED_PLUGIN_REGISTRANT_
8 | #define GENERATED_PLUGIN_REGISTRANT_
9 |
10 | #include
11 |
12 | // Registers Flutter plugins.
13 | void RegisterPlugins(flutter::PluginRegistry* registry);
14 |
15 | #endif // GENERATED_PLUGIN_REGISTRANT_
16 |
--------------------------------------------------------------------------------
/windows/flutter/generated_plugins.cmake:
--------------------------------------------------------------------------------
1 | #
2 | # Generated file, do not edit.
3 | #
4 |
5 | list(APPEND FLUTTER_PLUGIN_LIST
6 | bitsdojo_window_windows
7 | local_notifier
8 | screen_retriever
9 | tray_manager
10 | url_launcher_windows
11 | window_manager
12 | )
13 |
14 | list(APPEND FLUTTER_FFI_PLUGIN_LIST
15 | )
16 |
17 | set(PLUGIN_BUNDLED_LIBRARIES)
18 |
19 | foreach(plugin ${FLUTTER_PLUGIN_LIST})
20 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/windows plugins/${plugin})
21 | target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin)
22 | list(APPEND PLUGIN_BUNDLED_LIBRARIES $)
23 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries})
24 | endforeach(plugin)
25 |
26 | foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST})
27 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/windows plugins/${ffi_plugin})
28 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries})
29 | endforeach(ffi_plugin)
30 |
--------------------------------------------------------------------------------
/windows/packaging/exe/inno_setup.iss:
--------------------------------------------------------------------------------
1 | [Setup]
2 | AppId={{APP_ID}}
3 | AppVersion={{APP_VERSION}}
4 | AppName={{DISPLAY_NAME}}
5 | AppPublisher={{PUBLISHER_NAME}}
6 | AppPublisherURL={{PUBLISHER_URL}}
7 | AppSupportURL={{PUBLISHER_URL}}
8 | AppUpdatesURL={{PUBLISHER_URL}}
9 | DefaultDirName={autopf}/{{INSTALL_DIR_NAME}}
10 | DisableProgramGroupPage=yes
11 | OutputDir=.
12 | OutputBaseFilename={{OUTPUT_BASE_FILENAME}}
13 | Compression=lzma
14 | ChangesAssociations=yes
15 | SolidCompression=yes
16 | SetupIconFile={{SETUP_ICON_FILE}}
17 | WizardStyle=modern
18 | PrivilegesRequired={{PRIVILEGES_REQUIRED}}
19 | PrivilegesRequiredOverridesAllowed=dialog
20 |
21 | [Languages]
22 | {% for locale in LOCALES %}
23 | {% if locale == 'en' %}Name: "english"; MessagesFile: "compiler:Default.isl"{% endif %}
24 | {% if locale == 'hy' %}Name: "armenian"; MessagesFile: "compiler:Languages\\Armenian.isl"{% endif %}
25 | {% if locale == 'bg' %}Name: "bulgarian"; MessagesFile: "compiler:Languages\\Bulgarian.isl"{% endif %}
26 | {% if locale == 'ca' %}Name: "catalan"; MessagesFile: "compiler:Languages\\Catalan.isl"{% endif %}
27 | {% if locale == 'zh' %}Name: "chinesesimplified"; MessagesFile: "compiler:Languages\\ChineseSimplified.isl"{% endif %}
28 | {% if locale == 'co' %}Name: "corsican"; MessagesFile: "compiler:Languages\\Corsican.isl"{% endif %}
29 | {% if locale == 'cs' %}Name: "czech"; MessagesFile: "compiler:Languages\\Czech.isl"{% endif %}
30 | {% if locale == 'da' %}Name: "danish"; MessagesFile: "compiler:Languages\\Danish.isl"{% endif %}
31 | {% if locale == 'nl' %}Name: "dutch"; MessagesFile: "compiler:Languages\\Dutch.isl"{% endif %}
32 | {% if locale == 'fi' %}Name: "finnish"; MessagesFile: "compiler:Languages\\Finnish.isl"{% endif %}
33 | {% if locale == 'fr' %}Name: "french"; MessagesFile: "compiler:Languages\\French.isl"{% endif %}
34 | {% if locale == 'de' %}Name: "german"; MessagesFile: "compiler:Languages\\German.isl"{% endif %}
35 | {% if locale == 'he' %}Name: "hebrew"; MessagesFile: "compiler:Languages\\Hebrew.isl"{% endif %}
36 | {% if locale == 'is' %}Name: "icelandic"; MessagesFile: "compiler:Languages\\Icelandic.isl"{% endif %}
37 | {% if locale == 'it' %}Name: "italian"; MessagesFile: "compiler:Languages\\Italian.isl"{% endif %}
38 | {% if locale == 'ja' %}Name: "japanese"; MessagesFile: "compiler:Languages\\Japanese.isl"{% endif %}
39 | {% if locale == 'no' %}Name: "norwegian"; MessagesFile: "compiler:Languages\\Norwegian.isl"{% endif %}
40 | {% if locale == 'pl' %}Name: "polish"; MessagesFile: "compiler:Languages\\Polish.isl"{% endif %}
41 | {% if locale == 'pt' %}Name: "portuguese"; MessagesFile: "compiler:Languages\\Portuguese.isl"{% endif %}
42 | {% if locale == 'ru' %}Name: "russian"; MessagesFile: "compiler:Languages\\Russian.isl"{% endif %}
43 | {% if locale == 'sk' %}Name: "slovak"; MessagesFile: "compiler:Languages\\Slovak.isl"{% endif %}
44 | {% if locale == 'sl' %}Name: "slovenian"; MessagesFile: "compiler:Languages\\Slovenian.isl"{% endif %}
45 | {% if locale == 'es' %}Name: "spanish"; MessagesFile: "compiler:Languages\\Spanish.isl"{% endif %}
46 | {% if locale == 'tr' %}Name: "turkish"; MessagesFile: "compiler:Languages\\Turkish.isl"{% endif %}
47 | {% if locale == 'uk' %}Name: "ukrainian"; MessagesFile: "compiler:Languages\\Ukrainian.isl"{% endif %}
48 | {% endfor %}
49 |
50 | [Tasks]
51 | Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: {% if CREATE_DESKTOP_ICON != true %}unchecked{% else %}checkedonce{% endif %}
52 | [Files]
53 | Source: "{{SOURCE_DIR}}\\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
54 | ; NOTE: Don't use "Flags: ignoreversion" on any shared system files
55 |
56 | [Icons]
57 | Name: "{autodesktop}\\{{DISPLAY_NAME}}"; Filename: "{app}\\{{EXECUTABLE_NAME}}"; Tasks: desktopicon
58 | Name: "{group}\{{DISPLAY_NAME}}"; Filename: "{app}\{{EXECUTABLE_NAME}}"
59 | Name: "{autoprograms}\\{{DISPLAY_NAME}}"; Filename: "{app}\\{{EXECUTABLE_NAME}}"
60 | [Run]
61 | Filename: "{app}\\{{EXECUTABLE_NAME}}"; Description: "{cm:LaunchProgram,{{DISPLAY_NAME}}}"; Flags: {% if PRIVILEGES_REQUIRED == 'admin' %}runascurrentuser{% endif %} nowait postinstall skipifsilent
62 |
63 | [UninstallDelete]
64 | Type: filesandordirs; Name: "{app}";
65 | Type: filesandordirs; Name: "{userappdata}/com.nightwind.NonebotGUI";
66 | Type: filesandordirs; Name: "{commonappdata}/com.nightwind.NonebotGUI";
--------------------------------------------------------------------------------
/windows/packaging/exe/make_config.yaml:
--------------------------------------------------------------------------------
1 | app_id: E74DE52E-9367-42FA-A15C-FF0EE4F5E071
2 | publisher: 【夜风】NightWind
3 | publisher_url: https://github.com/XTxiaoting14332/nonebot-flutter-gui
4 | display_name: NoneBotGUI
5 | create_desktop_icon: true
6 | install_dir_name: NoneBotGUI
7 | script_template: inno_setup.iss
8 | locales:
9 | - zh
10 |
--------------------------------------------------------------------------------
/windows/runner/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 3.14)
2 | project(runner LANGUAGES CXX)
3 |
4 | # Define the application target. To change its name, change BINARY_NAME in the
5 | # top-level CMakeLists.txt, not the value here, or `flutter run` will no longer
6 | # work.
7 | #
8 | # Any new source files that you add to the application should be added here.
9 | add_executable(${BINARY_NAME} WIN32
10 | "flutter_window.cpp"
11 | "main.cpp"
12 | "utils.cpp"
13 | "win32_window.cpp"
14 | "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc"
15 | "Runner.rc"
16 | "runner.exe.manifest"
17 | )
18 |
19 | # Apply the standard set of build settings. This can be removed for applications
20 | # that need different build settings.
21 | apply_standard_settings(${BINARY_NAME})
22 |
23 | # Add preprocessor definitions for the build version.
24 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION=\"${FLUTTER_VERSION}\"")
25 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MAJOR=${FLUTTER_VERSION_MAJOR}")
26 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MINOR=${FLUTTER_VERSION_MINOR}")
27 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_PATCH=${FLUTTER_VERSION_PATCH}")
28 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_BUILD=${FLUTTER_VERSION_BUILD}")
29 |
30 | # Disable Windows macros that collide with C++ standard library functions.
31 | target_compile_definitions(${BINARY_NAME} PRIVATE "NOMINMAX")
32 |
33 | # Add dependency libraries and include directories. Add any application-specific
34 | # dependencies here.
35 | target_link_libraries(${BINARY_NAME} PRIVATE flutter flutter_wrapper_app)
36 | target_link_libraries(${BINARY_NAME} PRIVATE "dwmapi.lib")
37 | target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}")
38 |
39 | # Run the Flutter tool portions of the build. This must not be removed.
40 | add_dependencies(${BINARY_NAME} flutter_assemble)
41 |
--------------------------------------------------------------------------------
/windows/runner/Runner.rc:
--------------------------------------------------------------------------------
1 | // Microsoft Visual C++ generated resource script.
2 | //
3 | #pragma code_page(65001)
4 | #include "resource.h"
5 |
6 | #define APSTUDIO_READONLY_SYMBOLS
7 | /////////////////////////////////////////////////////////////////////////////
8 | //
9 | // Generated from the TEXTINCLUDE 2 resource.
10 | //
11 | #include "winres.h"
12 |
13 | /////////////////////////////////////////////////////////////////////////////
14 | #undef APSTUDIO_READONLY_SYMBOLS
15 |
16 | /////////////////////////////////////////////////////////////////////////////
17 | // English (United States) resources
18 |
19 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
20 | LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
21 |
22 | #ifdef APSTUDIO_INVOKED
23 | /////////////////////////////////////////////////////////////////////////////
24 | //
25 | // TEXTINCLUDE
26 | //
27 |
28 | 1 TEXTINCLUDE
29 | BEGIN
30 | "resource.h\0"
31 | END
32 |
33 | 2 TEXTINCLUDE
34 | BEGIN
35 | "#include ""winres.h""\r\n"
36 | "\0"
37 | END
38 |
39 | 3 TEXTINCLUDE
40 | BEGIN
41 | "\r\n"
42 | "\0"
43 | END
44 |
45 | #endif // APSTUDIO_INVOKED
46 |
47 |
48 | /////////////////////////////////////////////////////////////////////////////
49 | //
50 | // Icon
51 | //
52 |
53 | // Icon with lowest ID value placed first to ensure application icon
54 | // remains consistent on all systems.
55 | IDI_APP_ICON ICON "resources\\app_icon.ico"
56 |
57 |
58 | /////////////////////////////////////////////////////////////////////////////
59 | //
60 | // Version
61 | //
62 |
63 | #if defined(FLUTTER_VERSION_MAJOR) && defined(FLUTTER_VERSION_MINOR) && defined(FLUTTER_VERSION_PATCH) && defined(FLUTTER_VERSION_BUILD)
64 | #define VERSION_AS_NUMBER FLUTTER_VERSION_MAJOR,FLUTTER_VERSION_MINOR,FLUTTER_VERSION_PATCH,FLUTTER_VERSION_BUILD
65 | #else
66 | #define VERSION_AS_NUMBER 1,0,0,0
67 | #endif
68 |
69 | #if defined(FLUTTER_VERSION)
70 | #define VERSION_AS_STRING FLUTTER_VERSION
71 | #else
72 | #define VERSION_AS_STRING "1.0.0"
73 | #endif
74 |
75 | VS_VERSION_INFO VERSIONINFO
76 | FILEVERSION VERSION_AS_NUMBER
77 | PRODUCTVERSION VERSION_AS_NUMBER
78 | FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
79 | #ifdef _DEBUG
80 | FILEFLAGS VS_FF_DEBUG
81 | #else
82 | FILEFLAGS 0x0L
83 | #endif
84 | FILEOS VOS__WINDOWS32
85 | FILETYPE VFT_APP
86 | FILESUBTYPE 0x0L
87 | BEGIN
88 | BLOCK "StringFileInfo"
89 | BEGIN
90 | BLOCK "040904e4"
91 | BEGIN
92 | VALUE "CompanyName", "com.nightwind" "\0"
93 | VALUE "FileDescription", "NoneBotGUI" "\0"
94 | VALUE "FileVersion", VERSION_AS_STRING "\0"
95 | VALUE "InternalName", "NoneBotGUI" "\0"
96 | VALUE "LegalCopyright", "Copyright (C) 2024 com.nightwind. All rights reserved." "\0"
97 | VALUE "OriginalFilename", "NoneBotGUI.exe" "\0"
98 | VALUE "ProductName", "NoneBotGUI" "\0"
99 | VALUE "ProductVersion", VERSION_AS_STRING "\0"
100 | END
101 | END
102 | BLOCK "VarFileInfo"
103 | BEGIN
104 | VALUE "Translation", 0x409, 1252
105 | END
106 | END
107 |
108 | #endif // English (United States) resources
109 | /////////////////////////////////////////////////////////////////////////////
110 |
111 |
112 |
113 | #ifndef APSTUDIO_INVOKED
114 | /////////////////////////////////////////////////////////////////////////////
115 | //
116 | // Generated from the TEXTINCLUDE 3 resource.
117 | //
118 |
119 |
120 | /////////////////////////////////////////////////////////////////////////////
121 | #endif // not APSTUDIO_INVOKED
122 |
--------------------------------------------------------------------------------
/windows/runner/flutter_window.cpp:
--------------------------------------------------------------------------------
1 | #include "flutter_window.h"
2 |
3 | #include
4 |
5 | #include "flutter/generated_plugin_registrant.h"
6 |
7 | FlutterWindow::FlutterWindow(const flutter::DartProject& project)
8 | : project_(project) {}
9 |
10 | FlutterWindow::~FlutterWindow() {}
11 |
12 | bool FlutterWindow::OnCreate() {
13 | if (!Win32Window::OnCreate()) {
14 | return false;
15 | }
16 |
17 | RECT frame = GetClientArea();
18 |
19 | // The size here must match the window dimensions to avoid unnecessary surface
20 | // creation / destruction in the startup path.
21 | flutter_controller_ = std::make_unique(
22 | frame.right - frame.left, frame.bottom - frame.top, project_);
23 | // Ensure that basic setup of the controller was successful.
24 | if (!flutter_controller_->engine() || !flutter_controller_->view()) {
25 | return false;
26 | }
27 | RegisterPlugins(flutter_controller_->engine());
28 | SetChildContent(flutter_controller_->view()->GetNativeWindow());
29 |
30 | flutter_controller_->engine()->SetNextFrameCallback([&]() {
31 | this->Show();
32 | });
33 |
34 | // Flutter can complete the first frame before the "show window" callback is
35 | // registered. The following call ensures a frame is pending to ensure the
36 | // window is shown. It is a no-op if the first frame hasn't completed yet.
37 | flutter_controller_->ForceRedraw();
38 |
39 | return true;
40 | }
41 |
42 | void FlutterWindow::OnDestroy() {
43 | if (flutter_controller_) {
44 | flutter_controller_ = nullptr;
45 | }
46 |
47 | Win32Window::OnDestroy();
48 | }
49 |
50 | LRESULT
51 | FlutterWindow::MessageHandler(HWND hwnd, UINT const message,
52 | WPARAM const wparam,
53 | LPARAM const lparam) noexcept {
54 | // Give Flutter, including plugins, an opportunity to handle window messages.
55 | if (flutter_controller_) {
56 | std::optional result =
57 | flutter_controller_->HandleTopLevelWindowProc(hwnd, message, wparam,
58 | lparam);
59 | if (result) {
60 | return *result;
61 | }
62 | }
63 |
64 | switch (message) {
65 | case WM_FONTCHANGE:
66 | flutter_controller_->engine()->ReloadSystemFonts();
67 | break;
68 | }
69 |
70 | return Win32Window::MessageHandler(hwnd, message, wparam, lparam);
71 | }
72 |
--------------------------------------------------------------------------------
/windows/runner/flutter_window.h:
--------------------------------------------------------------------------------
1 | #ifndef RUNNER_FLUTTER_WINDOW_H_
2 | #define RUNNER_FLUTTER_WINDOW_H_
3 |
4 | #include
5 | #include
6 |
7 | #include
8 |
9 | #include "win32_window.h"
10 |
11 | // A window that does nothing but host a Flutter view.
12 | class FlutterWindow : public Win32Window {
13 | public:
14 | // Creates a new FlutterWindow hosting a Flutter view running |project|.
15 | explicit FlutterWindow(const flutter::DartProject& project);
16 | virtual ~FlutterWindow();
17 |
18 | protected:
19 | // Win32Window:
20 | bool OnCreate() override;
21 | void OnDestroy() override;
22 | LRESULT MessageHandler(HWND window, UINT const message, WPARAM const wparam,
23 | LPARAM const lparam) noexcept override;
24 |
25 | private:
26 | // The project to run.
27 | flutter::DartProject project_;
28 |
29 | // The Flutter instance hosted by this window.
30 | std::unique_ptr flutter_controller_;
31 | };
32 |
33 | #endif // RUNNER_FLUTTER_WINDOW_H_
34 |
--------------------------------------------------------------------------------
/windows/runner/main.cpp:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 | #include
4 |
5 | #include "flutter_window.h"
6 | #include "utils.h"
7 | #include
8 | auto bdw = bitsdojo_window_configure(BDW_CUSTOM_FRAME | BDW_HIDE_ON_STARTUP);
9 |
10 | int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev,
11 | _In_ wchar_t *command_line, _In_ int show_command) {
12 | // Attach to console when present (e.g., 'flutter run') or create a
13 | // new console when running with a debugger.
14 | if (!::AttachConsole(ATTACH_PARENT_PROCESS) && ::IsDebuggerPresent()) {
15 | CreateAndAttachConsole();
16 | }
17 |
18 | // Initialize COM, so that it is available for use in the library and/or
19 | // plugins.
20 | ::CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED);
21 |
22 | flutter::DartProject project(L"data");
23 |
24 | std::vector command_line_arguments =
25 | GetCommandLineArguments();
26 |
27 | project.set_dart_entrypoint_arguments(std::move(command_line_arguments));
28 |
29 | FlutterWindow window(project);
30 | Win32Window::Point origin(10, 10);
31 | Win32Window::Size size(1280, 720);
32 | if (!window.Create(L"NoneBotGUI", origin, size)) {
33 | return EXIT_FAILURE;
34 | }
35 | window.SetQuitOnClose(true);
36 |
37 | ::MSG msg;
38 | while (::GetMessage(&msg, nullptr, 0, 0)) {
39 | ::TranslateMessage(&msg);
40 | ::DispatchMessage(&msg);
41 | }
42 |
43 | ::CoUninitialize();
44 | return EXIT_SUCCESS;
45 | }
46 |
--------------------------------------------------------------------------------
/windows/runner/resource.h:
--------------------------------------------------------------------------------
1 | //{{NO_DEPENDENCIES}}
2 | // Microsoft Visual C++ generated include file.
3 | // Used by Runner.rc
4 | //
5 | #define IDI_APP_ICON 101
6 |
7 | // Next default values for new objects
8 | //
9 | #ifdef APSTUDIO_INVOKED
10 | #ifndef APSTUDIO_READONLY_SYMBOLS
11 | #define _APS_NEXT_RESOURCE_VALUE 102
12 | #define _APS_NEXT_COMMAND_VALUE 40001
13 | #define _APS_NEXT_CONTROL_VALUE 1001
14 | #define _APS_NEXT_SYMED_VALUE 101
15 | #endif
16 | #endif
17 |
--------------------------------------------------------------------------------
/windows/runner/resources/app_icon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NonebotGUI/nonebot-flutter-gui/74fb214e9247bacde29baf0f476f2d968b93e842/windows/runner/resources/app_icon.ico
--------------------------------------------------------------------------------
/windows/runner/runner.exe.manifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PerMonitorV2
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/windows/runner/utils.cpp:
--------------------------------------------------------------------------------
1 | #include "utils.h"
2 |
3 | #include
4 | #include
5 | #include
6 | #include
7 |
8 | #include
9 |
10 | void CreateAndAttachConsole() {
11 | if (::AllocConsole()) {
12 | FILE *unused;
13 | if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
14 | _dup2(_fileno(stdout), 1);
15 | }
16 | if (freopen_s(&unused, "CONOUT$", "w", stderr)) {
17 | _dup2(_fileno(stdout), 2);
18 | }
19 | std::ios::sync_with_stdio();
20 | FlutterDesktopResyncOutputStreams();
21 | }
22 | }
23 |
24 | std::vector GetCommandLineArguments() {
25 | // Convert the UTF-16 command line arguments to UTF-8 for the Engine to use.
26 | int argc;
27 | wchar_t** argv = ::CommandLineToArgvW(::GetCommandLineW(), &argc);
28 | if (argv == nullptr) {
29 | return std::vector();
30 | }
31 |
32 | std::vector command_line_arguments;
33 |
34 | // Skip the first argument as it's the binary name.
35 | for (int i = 1; i < argc; i++) {
36 | command_line_arguments.push_back(Utf8FromUtf16(argv[i]));
37 | }
38 |
39 | ::LocalFree(argv);
40 |
41 | return command_line_arguments;
42 | }
43 |
44 | std::string Utf8FromUtf16(const wchar_t* utf16_string) {
45 | if (utf16_string == nullptr) {
46 | return std::string();
47 | }
48 | int target_length = ::WideCharToMultiByte(
49 | CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string,
50 | -1, nullptr, 0, nullptr, nullptr)
51 | -1; // remove the trailing null character
52 | int input_length = (int)wcslen(utf16_string);
53 | std::string utf8_string;
54 | if (target_length <= 0 || target_length > utf8_string.max_size()) {
55 | return utf8_string;
56 | }
57 | utf8_string.resize(target_length);
58 | int converted_length = ::WideCharToMultiByte(
59 | CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string,
60 | input_length, utf8_string.data(), target_length, nullptr, nullptr);
61 | if (converted_length == 0) {
62 | return std::string();
63 | }
64 | return utf8_string;
65 | }
66 |
--------------------------------------------------------------------------------
/windows/runner/utils.h:
--------------------------------------------------------------------------------
1 | #ifndef RUNNER_UTILS_H_
2 | #define RUNNER_UTILS_H_
3 |
4 | #include
5 | #include
6 |
7 | // Creates a console for the process, and redirects stdout and stderr to
8 | // it for both the runner and the Flutter library.
9 | void CreateAndAttachConsole();
10 |
11 | // Takes a null-terminated wchar_t* encoded in UTF-16 and returns a std::string
12 | // encoded in UTF-8. Returns an empty std::string on failure.
13 | std::string Utf8FromUtf16(const wchar_t* utf16_string);
14 |
15 | // Gets the command line arguments passed in as a std::vector,
16 | // encoded in UTF-8. Returns an empty std::vector on failure.
17 | std::vector GetCommandLineArguments();
18 |
19 | #endif // RUNNER_UTILS_H_
20 |
--------------------------------------------------------------------------------
/windows/runner/win32_window.h:
--------------------------------------------------------------------------------
1 | #ifndef RUNNER_WIN32_WINDOW_H_
2 | #define RUNNER_WIN32_WINDOW_H_
3 |
4 | #include
5 |
6 | #include
7 | #include
8 | #include
9 |
10 | // A class abstraction for a high DPI-aware Win32 Window. Intended to be
11 | // inherited from by classes that wish to specialize with custom
12 | // rendering and input handling
13 | class Win32Window {
14 | public:
15 | struct Point {
16 | unsigned int x;
17 | unsigned int y;
18 | Point(unsigned int x, unsigned int y) : x(x), y(y) {}
19 | };
20 |
21 | struct Size {
22 | unsigned int width;
23 | unsigned int height;
24 | Size(unsigned int width, unsigned int height)
25 | : width(width), height(height) {}
26 | };
27 |
28 | Win32Window();
29 | virtual ~Win32Window();
30 |
31 | // Creates a win32 window with |title| that is positioned and sized using
32 | // |origin| and |size|. New windows are created on the default monitor. Window
33 | // sizes are specified to the OS in physical pixels, hence to ensure a
34 | // consistent size this function will scale the inputted width and height as
35 | // as appropriate for the default monitor. The window is invisible until
36 | // |Show| is called. Returns true if the window was created successfully.
37 | bool Create(const std::wstring& title, const Point& origin, const Size& size);
38 |
39 | // Show the current window. Returns true if the window was successfully shown.
40 | bool Show();
41 |
42 | // Release OS resources associated with window.
43 | void Destroy();
44 |
45 | // Inserts |content| into the window tree.
46 | void SetChildContent(HWND content);
47 |
48 | // Returns the backing Window handle to enable clients to set icon and other
49 | // window properties. Returns nullptr if the window has been destroyed.
50 | HWND GetHandle();
51 |
52 | // If true, closing this window will quit the application.
53 | void SetQuitOnClose(bool quit_on_close);
54 |
55 | // Return a RECT representing the bounds of the current client area.
56 | RECT GetClientArea();
57 |
58 | protected:
59 | // Processes and route salient window messages for mouse handling,
60 | // size change and DPI. Delegates handling of these to member overloads that
61 | // inheriting classes can handle.
62 | virtual LRESULT MessageHandler(HWND window,
63 | UINT const message,
64 | WPARAM const wparam,
65 | LPARAM const lparam) noexcept;
66 |
67 | // Called when CreateAndShow is called, allowing subclass window-related
68 | // setup. Subclasses should return false if setup fails.
69 | virtual bool OnCreate();
70 |
71 | // Called when Destroy is called.
72 | virtual void OnDestroy();
73 |
74 | private:
75 | friend class WindowClassRegistrar;
76 |
77 | // OS callback called by message pump. Handles the WM_NCCREATE message which
78 | // is passed when the non-client area is being created and enables automatic
79 | // non-client DPI scaling so that the non-client area automatically
80 | // responds to changes in DPI. All other messages are handled by
81 | // MessageHandler.
82 | static LRESULT CALLBACK WndProc(HWND const window,
83 | UINT const message,
84 | WPARAM const wparam,
85 | LPARAM const lparam) noexcept;
86 |
87 | // Retrieves a class instance pointer for |window|
88 | static Win32Window* GetThisFromHandle(HWND const window) noexcept;
89 |
90 | // Update the window frame's theme to match the system theme.
91 | static void UpdateTheme(HWND const window);
92 |
93 | bool quit_on_close_ = false;
94 |
95 | // window handle for top level window.
96 | HWND window_handle_ = nullptr;
97 |
98 | // window handle for hosted content.
99 | HWND child_content_ = nullptr;
100 | };
101 |
102 | #endif // RUNNER_WIN32_WINDOW_H_
103 |
--------------------------------------------------------------------------------