Compare commits

..

3 Commits

Author SHA1 Message Date
Caten
09bf75beed Change WPS command, remove alipay 2024-01-13 07:52:53 +08:00
Caten
b00ede9483 Merge pull request #9 from wyq0918dev/md3
Modify user interface to material3
2024-01-12 18:57:06 +08:00
王泳淇
b8393dacfd Modify user interface to material3 2024-01-12 16:27:32 +08:00
10 changed files with 121 additions and 94 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 163 KiB

View File

@@ -25,6 +25,7 @@ import 'dart:math';
//import 'package:flutter/services.dart';
import 'package:clipboard/clipboard.dart';
import 'package:dynamic_color/dynamic_color.dart';
import 'package:flutter/gestures.dart';
import 'package:flutter_pty/flutter_pty.dart';
import 'package:permission_handler/permission_handler.dart';
@@ -49,14 +50,23 @@ class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Tiny Computer',
theme: ThemeData(
colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
useMaterial3: true,
//fontFamily: "FiraCode",
),
home: const MyHomePage(title: 'Tiny Computer'),
return DynamicColorBuilder(
builder: (ColorScheme? lightDynamic, ColorScheme? darkDynamic) {
return MaterialApp(
title: 'Tiny Computer',
theme: ThemeData(
colorScheme: lightDynamic,
useMaterial3: true,
//fontFamily: "FiraCode",
),
darkTheme: ThemeData(
colorScheme: darkDynamic,
useMaterial3: true,
//fontFamily: "FiraCode",
),
home: const MyHomePage(title: 'Tiny Computer'),
);
}
);
}
}
@@ -155,7 +165,7 @@ class _SettingPageState extends State<SettingPage> {
SizedBox.fromSize(size: const Size.square(8)),
const Divider(height: 2, indent: 8, endIndent: 8),
SizedBox.fromSize(size: const Size.square(16)),
const Text("你可以在当前所有同一网络下的设备(如:连接同一路由器的手机,电脑等)里使用小小电脑。\n\n将下面的链接复制到其他设备在其他设备上把链接localhost字样改为当前设备的IP地址可以通过快捷指令查看然后使用浏览器打开链接即可。"),
const Text("你可以在当前所有同一网络下的设备(如:连接同一路由器的手机,电脑等)里使用小小电脑。\n\n将下面的链接复制到其他设备在其他设备上把链接localhost字样改为当前设备的IP地址可以通过快捷指令查看格式类似192.168.x.x),然后使用浏览器打开链接即可。"),
SizedBox.fromSize(size: const Size.square(16)),
TextFormField(maxLines: null, initialValue: Util.getCurrentProp("vncUrl"), decoration: const InputDecoration(border: OutlineInputBorder(), labelText: "网页跳转地址"), onChanged: (value) async {
await Util.setCurrentProp("vncUrl", value);
@@ -1253,19 +1263,8 @@ HiDPI环境变量修改: 观看12个广告
我注意到Unity提供了一些不那么合适的广告
一般如果我看到这些广告就在后台直接禁了
不过也可能有漏网之鱼
你们可以联系我禁掉
---下面是赛博乞讨环节---
(*>ω<*)
虽然感觉不太可能有人捐赠
但转念一想这个可能性不是比中彩票大多了吗
所以还是保留了下来
可以联系我禁掉
""")),
const FractionallySizedBox(
widthFactor: 0.8,
child: Image(image: AssetImage("images/alipay.png"))
),
ElevatedButton(
onPressed: () {
launchUrl(Uri.parse("https://github.com/Cateners/tiny_computer"), mode: LaunchMode.externalApplication);
@@ -1516,7 +1515,6 @@ class _MyHomePageState extends State<MyHomePage> {
return Scaffold(
appBar: AppBar(
backgroundColor: Theme.of(context).colorScheme.inversePrimary,
title: Text(isLoadingComplete?Util.getCurrentProp("name"):widget.title),
),
body: isLoadingComplete?Column(mainAxisSize: MainAxisSize.min, children: [
@@ -1564,15 +1562,25 @@ class _MyHomePageState extends State<MyHomePage> {
}))]):const LoadingPage(),
bottomNavigationBar: ValueListenableBuilder(valueListenable: G.pageIndex, builder:(context, value, child) {
return Visibility(visible: isLoadingComplete,
child: BottomNavigationBar(currentIndex: G.pageIndex.value,
onTap: (index) {
// child: BottomNavigationBar(currentIndex: G.pageIndex.value,
// onTap: (index) {
// G.pageIndex.value = index;
// },
// items: const [
// BottomNavigationBarItem(icon: Icon(Icons.monitor), label: "终端"),
// BottomNavigationBarItem(icon: Icon(Icons.video_settings), label: "控制"),
// ],
// )
child: NavigationBar(
selectedIndex: G.pageIndex.value,
destinations: const [
NavigationDestination(icon: Icon(Icons.monitor), label: "终端"),
NavigationDestination(icon: Icon(Icons.video_settings), label: "控制")
],
onDestinationSelected: (index) {
G.pageIndex.value = index;
},
items: const [
BottomNavigationBarItem(icon: Icon(Icons.monitor), label: "终端"),
BottomNavigationBarItem(icon: Icon(Icons.video_settings), label: "控制"),
],
)
),
);}),
floatingActionButton: ValueListenableBuilder(valueListenable: G.pageIndex, builder:(context, value, child) {
return Visibility(visible: isLoadingComplete && (value == 0),

View File

@@ -355,74 +355,75 @@ class TermPty {
class D {
//默认快捷指令
static const commands = [{"name":"检查更新并升级", "command":"sudo apt update && sudo apt upgrade -y"},
{"name":"查看系统信息", "command":"neofetch -L && neofetch --off"},
{"name":"清屏", "command":"clear"},
{"name":"查看IP", "command":"hostname -I | awk '{print \$NF}' # 如果显示无权限(Permission denied)请在全局设置里开启getifaddrs桥接"},
{"name":"中断任务", "command":"\x03"},
{"name":"安装图形处理软件Krita", "command":"sudo apt update && sudo apt install -y krita krita-l10n"},
{"name":"卸载Krita", "command":"sudo apt autoremove --purge -y krita krita-l10n"},
{"name":"安装视频剪辑软件Kdenlive", "command":"sudo apt update && sudo apt install -y kdenlive"},
{"name":"卸载Kdenlive", "command":"sudo apt autoremove --purge -y kdenlive"},
{"name":"安装科学计算软件Octave", "command":"sudo apt update && sudo apt install -y octave"},
{"name":"卸载Octave", "command":"sudo apt autoremove --purge -y octave"},
{"name":"安装WPS", "command":"""wget \$(curl -L https://linux.wps.cn/ | grep -oP 'href="\\K[^"]*arm64\\.deb' | head -n 1) -O /tmp/wps.deb && sudo apt update && sudo apt install -y /tmp/wps.deb; rm /tmp/wps.deb"""},
{"name":"卸载WPS", "command":"sudo apt autoremove --purge -y wps-office"},
{"name":"安装CAJViewer", "command":"wget https://download.cnki.net/net.cnki.cajviewer_1.3.20-1_arm64.deb -O /tmp/caj.deb && sudo apt update && sudo apt install -y /tmp/caj.deb && bash /home/tiny/.local/share/tiny/caj/postinst; rm /tmp/caj.deb"},
{"name":"卸载CAJViewer", "command":"sudo apt autoremove --purge -y net.cnki.cajviewer && bash /home/tiny/.local/share/tiny/caj/postrm"},
{"name":"安装亿图图示", "command":"wget https://www.edrawsoft.cn/2download/aarch64/edrawmax_11.5.6-3_arm64.deb -O /tmp/edraw.deb && sudo apt update && sudo apt install -y /tmp/edraw.deb && bash /home/tiny/.local/share/tiny/edraw/postinst; rm /tmp/edraw.deb"},
{"name":"卸载亿图图示", "command":"sudo apt autoremove --purge -y edrawmax libldap-2.4-2"},
{"name":"安装QQ", "command":"""wget \$(curl -L https://cdn-go.cn/qq-web/im.qq.com_new/latest/rainbow/linuxQQDownload.js | grep -oP 'deb":"\\K[^"]*arm64\\.deb' | head -n 1) -O /tmp/qq.deb && sudo apt update && sudo apt install -y /tmp/qq.deb && sed -i 's#Exec=/opt/QQ/qq %U#Exec=/opt/QQ/qq --no-sandbox %U#g' /usr/share/applications/qq.desktop; rm /tmp/qq.deb"""},
{"name":"卸载QQ", "command":"sudo apt autoremove --purge -y linuxqq"},
{"name":"安装UOS微信", "command":"wget https://home-store-packages.uniontech.com/appstore/pool/appstore/c/com.tencent.weixin/com.tencent.weixin_2.1.9_arm64.deb -O /tmp/wechat.deb && sudo apt update && sudo apt install -y /tmp/wechat.deb /home/tiny/.local/share/tiny/wechat/deepin-elf-verify_all.deb /home/tiny/.local/share/tiny/wechat/libssl1.1_1.1.1n-0+deb10u6_arm64.deb && sed -i 's#/opt/apps/com.tencent.weixin/files/weixin/weixin#/opt/apps/com.tencent.weixin/files/weixin/weixin --no-sandbox#g' /opt/apps/com.tencent.weixin/files/weixin/weixin.sh && echo '该微信为UOS特供版只有账号实名且在UOS系统上运行时可用。在使用前请前往全局设置开启UOS伪装。\n如果你使用微信只是为了传输文件那么可以考虑使用支持SAF的文件管理器质感文件直接访问小小电脑所有文件。'; rm /tmp/wechat.deb"},
{"name":"卸载UOS微信", "command":"sudo apt autoremove --purge -y com.tencent.weixin libssl1.1 deepin-elf-verify"},
{"name":"安装钉钉", "command":"""wget \$(curl -L https://g.alicdn.com/dingding/h5-home-download/0.2.4/js/index.js | grep -oP 'url:"\\K[^"]*arm64\\.deb' | head -n 1) -O /tmp/dingtalk.deb && sudo apt update && sudo apt install -y /tmp/dingtalk.deb && sed -i 's#\\./com.alibabainc.dingtalk#\\./com.alibabainc.dingtalk --no-sandbox#g' /opt/apps/com.alibabainc.dingtalk/files/Elevator.sh; rm /tmp/dingtalk.deb"""},
{"name":"卸载钉钉", "command":"sudo apt autoremove --purge -y com.alibabainc.dingtalk"},
{"name":"修复无法编译C语言程序", "command":"sudo apt update && sudo apt reinstall -y libc6-dev"},
{"name":"修复系统语言到中文", "command":"sudo localedef -c -i zh_CN -f UTF-8 zh_CN.UTF-8"},
{"name":"启用回收站", "command":"sudo apt update && sudo apt install -y gvfs && echo '安装完成, 重启软件即可使用回收站。'"},
{"name":"拉流测试", "command":"ffplay rtsp://127.0.0.1:8554/stream &"},
{"name":"关机", "command":"stopvnc\nexit\nexit"},
{"name":"???", "command":"timeout 8 cmatrix"}];
{"name":"查看系统信息", "command":"neofetch -L && neofetch --off"},
{"name":"清屏", "command":"clear"},
{"name":"查看IP", "command":"hostname -I # 如果显示无权限(Permission denied)请在全局设置里开启getifaddrs桥接"},
{"name":"中断任务", "command":"\x03"},
{"name":"安装图形处理软件Krita", "command":"sudo apt update && sudo apt install -y krita krita-l10n"},
{"name":"卸载Krita", "command":"sudo apt autoremove --purge -y krita krita-l10n"},
{"name":"安装视频剪辑软件Kdenlive", "command":"sudo apt update && sudo apt install -y kdenlive"},
{"name":"卸载Kdenlive", "command":"sudo apt autoremove --purge -y kdenlive"},
{"name":"安装科学计算软件Octave", "command":"sudo apt update && sudo apt install -y octave"},
{"name":"卸载Octave", "command":"sudo apt autoremove --purge -y octave"},
{"name":"安装WPS", "command":"""wget --referer="https://www.wps.cn/product/wpslinux" \$(curl -L https://linux.wps.cn/ | grep -oP 'href="\\K[^"]*arm64\\.deb' | head -n 1) -O /tmp/wps.deb && sudo apt update && sudo apt install -y /tmp/wps.deb; rm /tmp/wps.deb"""},
{"name":"卸载WPS", "command":"sudo apt autoremove --purge -y wps-office"},
{"name":"安装CAJViewer", "command":"wget https://download.cnki.net/net.cnki.cajviewer_1.3.20-1_arm64.deb -O /tmp/caj.deb && sudo apt update && sudo apt install -y /tmp/caj.deb && bash /home/tiny/.local/share/tiny/caj/postinst; rm /tmp/caj.deb"},
{"name":"卸载CAJViewer", "command":"sudo apt autoremove --purge -y net.cnki.cajviewer && bash /home/tiny/.local/share/tiny/caj/postrm"},
{"name":"安装亿图图示", "command":"wget https://www.edrawsoft.cn/2download/aarch64/edrawmax_11.5.6-3_arm64.deb -O /tmp/edraw.deb && sudo apt update && sudo apt install -y /tmp/edraw.deb && bash /home/tiny/.local/share/tiny/edraw/postinst; rm /tmp/edraw.deb"},
{"name":"卸载亿图图示", "command":"sudo apt autoremove --purge -y edrawmax libldap-2.4-2"},
{"name":"安装QQ", "command":"""wget \$(curl -L https://cdn-go.cn/qq-web/im.qq.com_new/latest/rainbow/linuxQQDownload.js | grep -oP 'deb":"\\K[^"]*arm64\\.deb' | head -n 1) -O /tmp/qq.deb && sudo apt update && sudo apt install -y /tmp/qq.deb && sed -i 's#Exec=/opt/QQ/qq %U#Exec=/opt/QQ/qq --no-sandbox %U#g' /usr/share/applications/qq.desktop; rm /tmp/qq.deb"""},
{"name":"卸载QQ", "command":"sudo apt autoremove --purge -y linuxqq"},
{"name":"安装UOS微信", "command":"wget https://home-store-packages.uniontech.com/appstore/pool/appstore/c/com.tencent.weixin/com.tencent.weixin_2.1.9_arm64.deb -O /tmp/wechat.deb && sudo apt update && sudo apt install -y /tmp/wechat.deb /home/tiny/.local/share/tiny/wechat/deepin-elf-verify_all.deb /home/tiny/.local/share/tiny/wechat/libssl1.1_1.1.1n-0+deb10u6_arm64.deb && sed -i 's#/opt/apps/com.tencent.weixin/files/weixin/weixin#/opt/apps/com.tencent.weixin/files/weixin/weixin --no-sandbox#g' /opt/apps/com.tencent.weixin/files/weixin/weixin.sh && echo '该微信为UOS特供版只有账号实名且在UOS系统上运行时可用。在使用前请前往全局设置开启UOS伪装。\n如果你使用微信只是为了传输文件那么可以考虑使用支持SAF的文件管理器质感文件直接访问小小电脑所有文件。'; rm /tmp/wechat.deb"},
{"name":"卸载UOS微信", "command":"sudo apt autoremove --purge -y com.tencent.weixin libssl1.1 deepin-elf-verify"},
{"name":"安装钉钉", "command":"""wget \$(curl -L https://g.alicdn.com/dingding/h5-home-download/0.2.4/js/index.js | grep -oP 'url:"\\K[^"]*arm64\\.deb' | head -n 1) -O /tmp/dingtalk.deb && sudo apt update && sudo apt install -y /tmp/dingtalk.deb && sed -i 's#\\./com.alibabainc.dingtalk#\\./com.alibabainc.dingtalk --no-sandbox#g' /opt/apps/com.alibabainc.dingtalk/files/Elevator.sh; rm /tmp/dingtalk.deb"""},
{"name":"卸载钉钉", "command":"sudo apt autoremove --purge -y com.alibabainc.dingtalk"},
{"name":"修复无法编译C语言程序", "command":"sudo apt update && sudo apt reinstall -y libc6-dev"},
{"name":"修复系统语言到中文", "command":"sudo localedef -c -i zh_CN -f UTF-8 zh_CN.UTF-8"},
{"name":"启用回收站", "command":"sudo apt update && sudo apt install -y gvfs && echo '安装完成, 重启软件即可使用回收站。'"},
{"name":"拉流测试", "command":"ffplay rtsp://127.0.0.1:8554/stream &"},
{"name":"关机", "command":"stopvnc\nexit\nexit"},
{"name":"???", "command":"timeout 8 cmatrix"}
];
//默认wine快捷指令
static const wineCommands = [{"name":"wine配置", "command":"wine64 winecfg"},
{"name":"我的电脑", "command":"wine64 explorer"},
{"name":"记事本", "command":"wine64 notepad"},
{"name":"扫雷", "command":"wine64 winemine"},
{"name":"注册表", "command":"wine64 regedit"},
{"name":"控制面板", "command":"wine64 control"},
{"name":"文件管理器", "command":"wine64 winefile"},
{"name":"任务管理器", "command":"wine64 taskmgr"},
{"name":"ie浏览器", "command":"wine64 iexplore"},
{"name":"强制关闭wine", "command":"wineserver -k"}];
{"name":"我的电脑", "command":"wine64 explorer"},
{"name":"记事本", "command":"wine64 notepad"},
{"name":"扫雷", "command":"wine64 winemine"},
{"name":"注册表", "command":"wine64 regedit"},
{"name":"控制面板", "command":"wine64 control"},
{"name":"文件管理器", "command":"wine64 winefile"},
{"name":"任务管理器", "command":"wine64 taskmgr"},
{"name":"ie浏览器", "command":"wine64 iexplore"},
{"name":"强制关闭wine", "command":"wineserver -k"}
];
//默认小键盘
static const termCommands = [
{"name": "Esc", "key": TerminalKey.escape},
{"name": "Tab", "key": TerminalKey.tab},
{"name": "", "key": TerminalKey.arrowUp},
{"name": "", "key": TerminalKey.arrowDown},
{"name": "", "key": TerminalKey.arrowLeft},
{"name": "", "key": TerminalKey.arrowRight},
{"name": "Del", "key": TerminalKey.delete},
{"name": "PgUp", "key": TerminalKey.pageUp},
{"name": "PgDn", "key": TerminalKey.pageDown},
{"name": "Home", "key": TerminalKey.home},
{"name": "End", "key": TerminalKey.end},
{"name": "F1", "key": TerminalKey.f1},
{"name": "F2", "key": TerminalKey.f2},
{"name": "F3", "key": TerminalKey.f3},
{"name": "F4", "key": TerminalKey.f4},
{"name": "F5", "key": TerminalKey.f5},
{"name": "F6", "key": TerminalKey.f6},
{"name": "F7", "key": TerminalKey.f7},
{"name": "F8", "key": TerminalKey.f8},
{"name": "F9", "key": TerminalKey.f9},
{"name": "F10", "key": TerminalKey.f10},
{"name": "F11", "key": TerminalKey.f11},
{"name": "F12", "key": TerminalKey.f12},
];
{"name": "Esc", "key": TerminalKey.escape},
{"name": "Tab", "key": TerminalKey.tab},
{"name": "", "key": TerminalKey.arrowUp},
{"name": "", "key": TerminalKey.arrowDown},
{"name": "", "key": TerminalKey.arrowLeft},
{"name": "", "key": TerminalKey.arrowRight},
{"name": "Del", "key": TerminalKey.delete},
{"name": "PgUp", "key": TerminalKey.pageUp},
{"name": "PgDn", "key": TerminalKey.pageDown},
{"name": "Home", "key": TerminalKey.home},
{"name": "End", "key": TerminalKey.end},
{"name": "F1", "key": TerminalKey.f1},
{"name": "F2", "key": TerminalKey.f2},
{"name": "F3", "key": TerminalKey.f3},
{"name": "F4", "key": TerminalKey.f4},
{"name": "F5", "key": TerminalKey.f5},
{"name": "F6", "key": TerminalKey.f6},
{"name": "F7", "key": TerminalKey.f7},
{"name": "F8", "key": TerminalKey.f8},
{"name": "F9", "key": TerminalKey.f9},
{"name": "F10", "key": TerminalKey.f10},
{"name": "F11", "key": TerminalKey.f11},
{"name": "F12", "key": TerminalKey.f12},
];
//看广告可以获得的奖励。
//weight抽奖权重singleUse使用一次花费的数量amount抽中可以获得的数量

View File

@@ -6,9 +6,13 @@
#include "generated_plugin_registrant.h"
#include <dynamic_color/dynamic_color_plugin.h>
#include <url_launcher_linux/url_launcher_plugin.h>
void fl_register_plugins(FlPluginRegistry* registry) {
g_autoptr(FlPluginRegistrar) dynamic_color_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "DynamicColorPlugin");
dynamic_color_plugin_register_with_registrar(dynamic_color_registrar);
g_autoptr(FlPluginRegistrar) url_launcher_linux_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "UrlLauncherPlugin");
url_launcher_plugin_register_with_registrar(url_launcher_linux_registrar);

View File

@@ -3,6 +3,7 @@
#
list(APPEND FLUTTER_PLUGIN_LIST
dynamic_color
url_launcher_linux
)

View File

@@ -5,6 +5,7 @@
import FlutterMacOS
import Foundation
import dynamic_color
import ffmpeg_kit_flutter_full_gpl
import package_info_plus
import path_provider_foundation
@@ -13,6 +14,7 @@ import url_launcher_macos
import wakelock_plus
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
DynamicColorPlugin.register(with: registry.registrar(forPlugin: "DynamicColorPlugin"))
FFmpegKitFlutterPlugin.register(with: registry.registrar(forPlugin: "FFmpegKitFlutterPlugin"))
FPPPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FPPPackageInfoPlusPlugin"))
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))

View File

@@ -73,6 +73,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "0.7.10"
dynamic_color:
dependency: "direct main"
description:
name: dynamic_color
sha256: a866f1f8947bfdaf674d7928e769eac7230388a2e7a2542824fad4bb5b87be3b
url: "https://pub.dev"
source: hosted
version: "1.6.9"
equatable:
dependency: transitive
description:

View File

@@ -16,7 +16,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
# In Windows, build-name is used as the major, minor, and patch parts
# of the product and file versions while build-number is used as the build suffix.
version: 1.0.12+3
version: 1.0.12+4
environment:
sdk: '>=3.1.0 <4.0.0'
@@ -44,7 +44,7 @@ dependencies:
clipboard: ^0.1.3
ffmpeg_kit_flutter_full_gpl: ^6.0.3
wakelock_plus: ^1.1.4
dynamic_color: ^1.6.9
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
@@ -79,7 +79,6 @@ flutter:
assets:
- assets/
- images/icon.png
- images/alipay.png
# An image asset can refer to one or more resolution-specific "variants", see
# https://flutter.dev/assets-and-images/#resolution-aware

View File

@@ -6,10 +6,13 @@
#include "generated_plugin_registrant.h"
#include <dynamic_color/dynamic_color_plugin_c_api.h>
#include <permission_handler_windows/permission_handler_windows_plugin.h>
#include <url_launcher_windows/url_launcher_windows.h>
void RegisterPlugins(flutter::PluginRegistry* registry) {
DynamicColorPluginCApiRegisterWithRegistrar(
registry->GetRegistrarForPlugin("DynamicColorPluginCApi"));
PermissionHandlerWindowsPluginRegisterWithRegistrar(
registry->GetRegistrarForPlugin("PermissionHandlerWindowsPlugin"));
UrlLauncherWindowsRegisterWithRegistrar(

View File

@@ -3,6 +3,7 @@
#
list(APPEND FLUTTER_PLUGIN_LIST
dynamic_color
permission_handler_windows
url_launcher_windows
)