diff --git a/.metadata b/.metadata index facf12b..6f3ba3a 100644 --- a/.metadata +++ b/.metadata @@ -15,9 +15,6 @@ migration: - platform: root create_revision: c23637390482d4cf9598c3ce3f2be31aa7332daf base_revision: c23637390482d4cf9598c3ce3f2be31aa7332daf - - platform: web - create_revision: c23637390482d4cf9598c3ce3f2be31aa7332daf - base_revision: c23637390482d4cf9598c3ce3f2be31aa7332daf # User provided section diff --git a/.vscode/launch.json b/.vscode/launch.json index 5664d3a..5ff4044 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -4,6 +4,12 @@ // 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [ + { + "name": "Flutter", + "request": "launch", + "type": "dart", + "flutterMode": "profile" + }, { "name": "Flutter Run", "request": "launch", diff --git a/lib/app.dart b/lib/app.dart index 85a0135..0ba8d36 100644 --- a/lib/app.dart +++ b/lib/app.dart @@ -6,7 +6,6 @@ import 'dart:io'; import 'screens/Home.dart'; import 'config/themeconfiguration.dart'; import 'config/app_config.dart'; -import 'package:astral/utils/up.dart'; // 添加这行导入 // 定义应用程序的主要StatefulWidget class MyApp extends StatefulWidget { diff --git a/lib/config/navigationconfiguration.dart b/lib/config/navigationconfiguration.dart index 5128a90..51f767c 100644 --- a/lib/config/navigationconfiguration.dart +++ b/lib/config/navigationconfiguration.dart @@ -40,12 +40,12 @@ class NavigationConfig { currentThemeMode: currentThemeMode, )), ), - NavItem( - label: '房间', - icon: Icons.room_outlined, - selectedIcon: Icons.room, - pageBuilder: () => _getOrCreatePage(1, () => const RoomPage()), - ), + // NavItem( + // label: '房间', + // icon: Icons.room_outlined, + // selectedIcon: Icons.room, + // pageBuilder: () => _getOrCreatePage(1, () => const RoomPage()), + // ), NavItem( label: '设置', icon: Icons.settings_outlined, diff --git a/lib/screens/about.dart b/lib/screens/about.dart index 1a82ac8..e38ea68 100644 --- a/lib/screens/about.dart +++ b/lib/screens/about.dart @@ -2,35 +2,11 @@ import 'package:flutter/material.dart'; import 'package:url_launcher/url_launcher.dart'; -import 'dart:math' as math; import 'package:astral/utils/app_info.dart'; -class InfoPage extends StatefulWidget { +class InfoPage extends StatelessWidget { const InfoPage({super.key}); - @override - State createState() => _InfoPageState(); -} - -class _InfoPageState extends State - with SingleTickerProviderStateMixin { - late AnimationController _controller; - - @override - void initState() { - super.initState(); - _controller = AnimationController( - duration: const Duration(seconds: 10), - vsync: this, - )..repeat(); - } - - @override - void dispose() { - _controller.dispose(); - super.dispose(); - } - @override Widget build(BuildContext context) { return SingleChildScrollView( @@ -40,156 +16,95 @@ class _InfoPageState extends State child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ - // 旋转的图标效果 - AnimatedBuilder( - animation: _controller, - builder: (_, child) { - return Transform.rotate( - angle: _controller.value * 2 * math.pi, - child: Container( - height: 110, - width: 110, - decoration: BoxDecoration( - shape: BoxShape.circle, - gradient: SweepGradient( - colors: [ - Theme.of(context).colorScheme.primary, - Theme.of(context).colorScheme.secondary, - Theme.of(context).colorScheme.tertiary, - Theme.of(context).colorScheme.primary, - ], - stops: const [0.0, 0.3, 0.6, 1.0], - transform: - GradientRotation(_controller.value * 2 * math.pi), - ), - boxShadow: [ - BoxShadow( - color: Theme.of(context) - .colorScheme - .primary - .withOpacity(0.5), - blurRadius: 15, - spreadRadius: 1, - ), - ], - ), - child: Center( - child: Icon( - Icons.games, - size: 50, - color: Theme.of(context).colorScheme.onPrimary, - ), - ), + // 静态图标 + Container( + height: 110, + width: 110, + decoration: BoxDecoration( + shape: BoxShape.circle, + color: Theme.of(context).colorScheme.primary, + boxShadow: [ + BoxShadow( + color: Theme.of(context) + .colorScheme + .primary + .withOpacity(0.5), + blurRadius: 15, + spreadRadius: 1, ), - ); - }, + ], + ), + child: Center( + child: Icon( + Icons.games, + size: 50, + color: Theme.of(context).colorScheme.onPrimary, + ), + ), ), const SizedBox(height: 20), - // 应用名称添加渐变效果 - ShaderMask( - shaderCallback: (bounds) => LinearGradient( - colors: [ - Theme.of(context).colorScheme.primary, - Theme.of(context).colorScheme.tertiary, - ], - ).createShader(bounds), - child: Text( - 'ASTRAL', - style: Theme.of(context).textTheme.headlineMedium?.copyWith( - fontWeight: FontWeight.bold, - letterSpacing: 2.0, - ), - ), + // 应用名称 + Text( + 'ASTRAL', + style: Theme.of(context).textTheme.headlineMedium?.copyWith( + fontWeight: FontWeight.bold, + letterSpacing: 2.0, + color: Theme.of(context).colorScheme.primary, + ), ), const SizedBox(height: 8), - // 版本号添加动画效果 - TweenAnimationBuilder( - tween: Tween(begin: 0, end: 1), - duration: const Duration(milliseconds: 800), - builder: (context, value, child) { - return Opacity( - opacity: value, - child: Transform.translate( - offset: Offset(0, 20 * (1 - value)), - child: child, - ), - ); - }, - child: Text( - AppInfoUtil.getVersion(), - style: Theme.of(context).textTheme.bodyLarge, - ), + // 版本号 + Text( + AppInfoUtil.getVersion(), + style: Theme.of(context).textTheme.bodyLarge, ), const SizedBox(height: 20), - // 卡片添加动画和阴影效果 - _buildAnimatedCard( + // 静态卡片 + _buildCard( context, '特别鸣谢', '特别感谢EasyTier作者所做的工作和帮助,为本项目提供了重要的技术支持。如果您有功能需求或遇到bug,欢迎加入我们的QQ群获取帮助和了解最新动态。', Icons.favorite, - Colors.red, - delay: 200, ), // 合并后的卡片 const SizedBox(height: 30), - // 按钮添加动画效果 - TweenAnimationBuilder( - tween: Tween(begin: 0, end: 1), - duration: const Duration(milliseconds: 1000), - curve: Curves.elasticOut, - builder: (context, value, child) { - return Transform.scale( - scale: value, - child: child, - ); - }, - child: ElevatedButton.icon( - icon: const Icon(Icons.group_add), - label: const Text('加入QQ群'), - style: ElevatedButton.styleFrom( - padding: const EdgeInsets.symmetric( - horizontal: 24, vertical: 12), - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(30), - ), - elevation: 5, + // 静态按钮 + ElevatedButton.icon( + icon: const Icon(Icons.group_add), + label: const Text('加入QQ群'), + style: ElevatedButton.styleFrom( + padding: + const EdgeInsets.symmetric(horizontal: 24, vertical: 12), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(30), ), - onPressed: () async { - final url = 'https://qm.qq.com/q/ErscyNPTzO'; - if (await canLaunchUrl(Uri.parse(url))) { - await launchUrl(Uri.parse(url)); - } else { - // 无法打开链接时显示提示 - if (context.mounted) { - ScaffoldMessenger.of(context).showSnackBar( - const SnackBar(content: Text('无法打开QQ群链接')), - ); - } - } - }, + elevation: 5, ), + onPressed: () async { + final url = 'https://qm.qq.com/q/ErscyNPTzO'; + if (await canLaunchUrl(Uri.parse(url))) { + await launchUrl(Uri.parse(url)); + } else { + // 无法打开链接时显示提示 + if (context.mounted) { + ScaffoldMessenger.of(context).showSnackBar( + const SnackBar(content: Text('无法打开QQ群链接')), + ); + } + } + }, ), const SizedBox(height: 20), - // 添加版权信息 - TweenAnimationBuilder( - tween: Tween(begin: 0, end: 1), - duration: const Duration(milliseconds: 1200), - builder: (context, value, child) { - return Opacity( - opacity: value, - child: child, - ); - }, - child: Text( - '© ${DateTime.now().year} ASTRAL Team', - style: Theme.of(context).textTheme.bodySmall?.copyWith( - color: Theme.of(context) - .colorScheme - .onSurface - .withOpacity(0.6), - ), - ), + // 版权信息 + Text( + '© ${DateTime.now().year} ASTRAL Team', + style: Theme.of(context).textTheme.bodySmall?.copyWith( + color: Theme.of(context) + .colorScheme + .onSurface + .withOpacity(0.6), + ), ), ], ), @@ -198,129 +113,55 @@ class _InfoPageState extends State ); } - Widget _buildAnimatedCard(BuildContext context, String title, String content, - IconData icon, Color iconColor, - {int delay = 0}) { - // 根据当前主题调整颜色 - final isDarkMode = Theme.of(context).brightness == Brightness.dark; - final cardColor = Theme.of(context).cardColor; - final textColor = Theme.of(context).textTheme.bodyMedium?.color; - - return TweenAnimationBuilder( - tween: Tween(begin: 0, end: 1), - duration: Duration(milliseconds: 800 + delay), - curve: Curves.easeOutBack, - builder: (context, value, child) { - // 确保 opacity 值在有效范围内 (0.0 到 1.0) - final safeOpacity = value.clamp(0.0, 1.0); - return Opacity( - opacity: safeOpacity, - child: Transform.translate( - offset: Offset(100 * (1 - value), 0), - child: child, - ), - ); - }, - child: Card( - elevation: 8, - shadowColor: iconColor.withOpacity(isDarkMode ? 0.3 : 0.4), - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(16), - ), - child: Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(16), - gradient: LinearGradient( - begin: Alignment.topLeft, - end: Alignment.bottomRight, - colors: [ - cardColor, - isDarkMode - ? cardColor.withOpacity(0.9).withBlue(cardColor.blue + 5) - : iconColor.withOpacity(0.05), - cardColor, - ], - stops: const [0.0, 0.5, 1.0], - ), - boxShadow: [ - BoxShadow( - color: iconColor.withOpacity(isDarkMode ? 0.05 : 0.1), - blurRadius: 10, - spreadRadius: -5, - offset: const Offset(0, 5), + Widget _buildCard( + BuildContext context, + String title, + String content, + IconData icon, + ) { + return Card( + elevation: 2, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(16), + ), + child: Padding( + padding: const EdgeInsets.all(16.0), + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + padding: const EdgeInsets.all(12), + decoration: BoxDecoration( + color: Theme.of(context).colorScheme.primary.withOpacity(0.1), + shape: BoxShape.circle, + ), + child: Icon( + icon, + color: Theme.of(context).colorScheme.primary, + size: 30, ), - ], - ), - child: Padding( - padding: const EdgeInsets.all(16.0), - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - // 左侧图标 - 适配深色模式 - Container( - padding: const EdgeInsets.all(12), - decoration: BoxDecoration( - color: iconColor.withOpacity(isDarkMode ? 0.2 : 0.15), - shape: BoxShape.circle, - boxShadow: [ - BoxShadow( - color: iconColor.withOpacity(isDarkMode ? 0.15 : 0.2), - blurRadius: isDarkMode ? 6 : 8, - spreadRadius: isDarkMode ? 0 : 1, - ), - ], - gradient: RadialGradient( - colors: [ - iconColor.withOpacity(isDarkMode ? 0.8 : 0.7), - iconColor.withOpacity(isDarkMode ? 0.2 : 0.1), - ], - stops: const [0.0, 1.0], - radius: 0.8, - ), - ), - child: Icon( - icon, - color: Colors.white, - size: 30, - ), - ), - const SizedBox(width: 16), - // 右侧内容 - 适配深色模式 - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - title, - style: Theme.of(context).textTheme.titleLarge?.copyWith( - fontWeight: FontWeight.bold, - letterSpacing: 1.2, - color: - iconColor.withOpacity(isDarkMode ? 0.9 : 0.8), - ), - ), - const SizedBox(height: 8), - Divider( - color: iconColor.withOpacity(isDarkMode ? 0.4 : 0.3), - thickness: 1.5, - endIndent: 60, - ), - const SizedBox(height: 8), - Text( - content, - style: Theme.of(context).textTheme.bodyMedium?.copyWith( - height: 1.5, - letterSpacing: 0.5, - color: textColor - ?.withOpacity(isDarkMode ? 0.9 : 1.0), - ), - ), - ], - ), - ), - ], ), - ), + const SizedBox(width: 16), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + title, + style: Theme.of(context).textTheme.titleLarge?.copyWith( + fontWeight: FontWeight.bold, + color: Theme.of(context).colorScheme.primary, + ), + ), + const SizedBox(height: 8), + Text( + content, + style: Theme.of(context).textTheme.bodyMedium, + ), + ], + ), + ), + ], ), ), ); diff --git a/lib/screens/front.dart b/lib/screens/front.dart index 40cd78e..971e7cd 100644 --- a/lib/screens/front.dart +++ b/lib/screens/front.dart @@ -52,8 +52,7 @@ class HomePage extends StatefulWidget { } class _HomePageState extends State { - // 定义状态枚举 - + int connectionTimeoutCounter = 0; // 当前连接状态 ConnectionState _connectionState = ConnectionState.notStarted; @@ -160,11 +159,19 @@ class _HomePageState extends State { @override void dispose() { - // 释放资源 + // 取消所有计时器 + timer?.cancel(); + timer = null; + + // 释放所有控制器和焦点节点 + _roomNameController.dispose(); + _roomPasswordController.dispose(); + _usernameController.dispose(); + _virtualIPController.dispose(); + _virtualIPFocusNode.removeListener(_onVirtualIPFocusChange); _virtualIPFocusNode.dispose(); - // 释放新增的FocusNode资源 _usernameControllerFocusNode.removeListener(_onUsernameFocusChange); _usernameControllerFocusNode.dispose(); @@ -191,8 +198,6 @@ class _HomePageState extends State { roomName: roomName, roomPassword: roomPassword, severurl: Serverip); - // 添加连接超时计数器 - int connectionTimeoutCounter = 0; // 不再使用固定延迟模拟连接成功,而是通过定时检查IP来确定连接状态 timer = Timer.periodic(const Duration(seconds: 1), (timer) async { @@ -216,49 +221,40 @@ class _HomePageState extends State { final int? version = runin.myNodeInfo?.virtualIpv4?.address?.addr; if (version != null) { String ipStr = _intToIpv4String(version); - // 检查IP不为0.0.0.0时认为连接成功 - if (ipStr != "0.0.0.0") { - if (publicIP != ipStr) { - km.virtualIP = ipStr; - } + if (publicIP != ipStr) { + km.virtualIP = ipStr; + } - // 如果当前状态还是连接中,则更新为已连接 - if (_connectionState == ConnectionState.connecting) { - setState(() { - _connectionState = ConnectionState.connected; - }); - } - - // 重置超时计数器 + // 如果当前状态还是连接中,则更新为已连接 + if (_connectionState == ConnectionState.connecting) { + setState(() { + _connectionState = ConnectionState.connected; + }); + } + connectionTimeoutCounter = 0; + } else if (_connectionState == ConnectionState.connecting) { + connectionTimeoutCounter++; + if (connectionTimeoutCounter >= 10) { connectionTimeoutCounter = 0; - } else if (_connectionState == ConnectionState.connecting) { - // 只在连接状态下增加超时计数 - connectionTimeoutCounter++; + timer.cancel(); + setState(() { + isRunning = false; + _connectionState = ConnectionState.notStarted; + runningTime = Duration.zero; + }); - // 如果连续10秒都是0.0.0.0,判断为连接失败 - if (connectionTimeoutCounter >= 10) { - // 停止连接并显示失败消息 - timer.cancel(); - setState(() { - isRunning = false; - _connectionState = ConnectionState.notStarted; - runningTime = Duration.zero; - }); - - // 关闭服务器连接 - closeAllServer(); - - // 显示连接失败提示 - if (mounted) { - ScaffoldMessenger.of(context).showSnackBar( - const SnackBar( - content: Text('连接失败,请检查网络或房间信息后重试'), - duration: Duration(seconds: 3), - ), - ); - } - return; + closeAllServer(); +// 清空玩家列表数据 + Provider.of(context, listen: false).nodes = []; + if (mounted) { + ScaffoldMessenger.of(context).showSnackBar( + const SnackBar( + content: Text('连接失败,未能获取节点信息'), + duration: Duration(seconds: 3), + ), + ); } + return; } } @@ -277,6 +273,8 @@ class _HomePageState extends State { // 停止时重置状态 _connectionState = ConnectionState.notStarted; closeAllServer(); + // 清空玩家列表数据 + Provider.of(context, listen: false).nodes = []; timer?.cancel(); runningTime = Duration.zero; // 重置网络统计数据 @@ -286,6 +284,7 @@ class _HomePageState extends State { _lastDownloadBytes = 0; uploadSpeed = 0; downloadSpeed = 0; + //connectionTimeoutCounter } }); } @@ -549,88 +548,6 @@ class _HomePageState extends State { } } - // 修改卡片构建方法,移除多余的内边距 - Widget _buildDashboardCard(ColorScheme colorScheme) { - return FloatingCard( - colorScheme: colorScheme, - maxWidth: 600, // 设置最大宽度 - height: 200, - child: SizedBox( - child: PieChart( - PieChartData( - sections: [ - PieChartSectionData( - value: uploadSpeed, - title: '上传', - color: colorScheme.primary, - ), - PieChartSectionData( - value: downloadSpeed, - title: '下载', - color: colorScheme.secondary, - ), - ], - ), - ), - )); - } - - // 修改流量统计卡片,移除多余的内边距 - Widget _buildTrafficCard(ColorScheme colorScheme) { - return FloatingCard( - colorScheme: colorScheme, - maxWidth: 600, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - // 修改标题为图标+文字组合 - Row( - children: [ - Icon(Icons.data_usage, color: colorScheme.primary, size: 22), - const SizedBox(width: 8), - const Text('流量统计', - style: - TextStyle(fontSize: 18, fontWeight: FontWeight.bold)), - ], - ), - const SizedBox(height: 16), - Row( - mainAxisAlignment: MainAxisAlignment.spaceAround, - children: [ - _buildTrafficInfo('上传速度', '$uploadSpeed MB/s', Icons.upload, - colorScheme.primary), - _buildTrafficInfo('下载速度', '$downloadSpeed MB/s', Icons.download, - colorScheme.secondary), - ], - ), - ], - )); - } - - // 修改IP地址卡片,移除多余的内边距 - Widget _buildIPCard(ColorScheme colorScheme) { - return FloatingCard( - colorScheme: colorScheme, - maxWidth: 600, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - // 修改标题为图标+文字组合 - Row( - children: [ - Icon(Icons.wifi, color: colorScheme.primary, size: 22), - const SizedBox(width: 8), - const Text('网络信息', - style: TextStyle(fontSize: 18, fontWeight: FontWeight.bold)), - ], - ), - const SizedBox(height: 16), - _buildIPInfo('虚拟 IP', publicIP, Icons.public, colorScheme), - ], - ), - ); - } - Widget _buildTrafficInfo( String label, String value, IconData icon, Color color) { return Column( diff --git a/lib/screens/settings.dart b/lib/screens/settings.dart index 38b6c09..3cc1fb3 100644 --- a/lib/screens/settings.dart +++ b/lib/screens/settings.dart @@ -1,3 +1,5 @@ +import 'dart:async'; + import 'package:astral/utils/app_info.dart'; import 'package:astral/utils/up.dart'; import 'package:flutter/material.dart'; @@ -25,11 +27,11 @@ class _SettingsPageState extends State { late String _currentServer; final _appConfig = AppConfig(); bool _closeToTray = false; // 添加关闭进入托盘变量 + bool _pingEnabled = true; // 添加全局ping开关 String serverIP = ""; // 添加 ping 相关状态 Map pingResults = {}; - Map isPinging = {}; @override void initState() { @@ -42,55 +44,67 @@ class _SettingsPageState extends State { // 初始化 ping 状态 for (var server in _serverList) { pingResults[server] = null; - isPinging[server] = true; // 默认所有服务器都开启ping } // 开始 ping 所有服务器 - for (var server in _serverList) { - _pingServer(server); - } + _startPingAllServers(); + } + + // 添加一个计时器变量来控制 ping 操作 + Timer? _pingTimer; + + // 新增方法:开始 ping 所有服务器 + void _startPingAllServers() { + // 取消之前的计时器(如果存在) + _pingTimer?.cancel(); + + // 创建新的计时器,每秒执行一次 ping + _pingTimer = Timer.periodic(const Duration(seconds: 1), (timer) { + if (!mounted) { + timer.cancel(); + return; + } + + if (_pingEnabled) { + for (var server in _serverList) { + _pingServerOnce(server); + } + } + }); } @override void dispose() { - // 停止所有 ping - for (var server in _serverList) { - isPinging[server] = false; - } + // 取消计时器 + _pingTimer?.cancel(); + _pingTimer = null; super.dispose(); } - // 简化 ping 方法,移除强制持续 ping 参数 - void _startPingServer(String server) { - if (isPinging[server] == true) return; - - isPinging[server] = true; - _pingServer(server); - } - - // 修改停止 ping 方法 - 实际上不再需要,但保留以防将来需要 - void _stopPingServer(String server) { - isPinging[server] = false; - } - - // 执行 ping 操作 - Future _pingServer(String server) async { - if (isPinging[server] != true) return; - + // 执行单次 ping 操作 + Future _pingServerOnce(String server) async { final pingResult = await PingUtil.ping(server); if (mounted) { setState(() { pingResults[server] = pingResult; }); - - // 1秒后再次 ping - Future.delayed(const Duration(seconds: 1), () { - _pingServer(server); - }); } } + // 切换全局ping状态 + void _togglePingStatus(bool value) { + setState(() { + _pingEnabled = value; + if (!_pingEnabled) { + // 如果关闭ping,清空所有结果 + for (var server in _serverList) { + pingResults[server] = null; + } + } + }); + } + // 添加服务器对话框 Future _showAddServerDialog() async { final controller = TextEditingController(); @@ -123,14 +137,12 @@ class _SettingsPageState extends State { _serverList.add(result); _appConfig.setServerList(_serverList); - // 初始化新服务器的 ping 状态并立即开始 ping + // 初始化新服务器的 ping 状态 pingResults[result] = null; - isPinging[result] = true; - _pingServer(result); }); } } - + // 编辑服务器对话框 Future _showEditServerDialog(int index) async { final controller = TextEditingController(text: _serverList[index]); @@ -189,21 +201,16 @@ class _SettingsPageState extends State { if (confirm == true) { final server = _serverList[index]; - // 停止 ping - _stopPingServer(server); - setState(() { _serverList.removeAt(index); _appConfig.setServerList(_serverList); // 移除 ping 状态 pingResults.remove(server); - isPinging.remove(server); if (_currentServer == server && _serverList.isNotEmpty) { _currentServer = _serverList[0]; _appConfig.setCurrentServer(_currentServer); - _startPingServer(_currentServer); } }); } @@ -212,7 +219,9 @@ class _SettingsPageState extends State { // 添加构建 ping 显示组件的方法 Widget _buildPingWidget(String server) { final pingResult = pingResults[server]; - if (pingResult == null) { + if (!_pingEnabled) { + return const Text('Ping已关闭', style: TextStyle(color: Colors.grey)); + } else if (pingResult == null) { return const Text('测试中...', style: TextStyle(color: Colors.grey)); } else { return Text( @@ -250,9 +259,6 @@ class _SettingsPageState extends State { ExpansionTile( leading: const Icon(Icons.list), title: const Text('服务器列表'), - onExpansionChanged: (expanded) { - // 不再需要处理展开折叠时的 ping 状态,所有服务器都持续 ping - }, children: [ // 在服务器列表前添加当前服务器的 ping 状态显示 ListView.builder( @@ -261,22 +267,6 @@ class _SettingsPageState extends State { itemCount: _serverList.length, itemBuilder: (context, index) { final server = _serverList[index]; - final pingResult = pingResults[server]; - - // 构建延迟显示组件 - Widget pingWidget; - if (pingResult == null) { - pingWidget = const Text('测试中...', - style: TextStyle(color: Colors.grey)); - } else { - pingWidget = Text('${pingResult}ms', - style: TextStyle( - color: pingResult < 100 - ? Colors.green - : (pingResult < 300 - ? Colors.orange - : Colors.red))); - } return ListTile( leading: const Icon(Icons.computer), @@ -284,14 +274,13 @@ class _SettingsPageState extends State { children: [ Text('服务器 ${index + 1}'), const SizedBox(width: 8), - pingWidget, + _buildPingWidget(server), ], ), subtitle: Text(server), trailing: Row( mainAxisSize: MainAxisSize.min, children: [ - // 移除 ping 按钮,只保留编辑和删除按钮 IconButton( icon: const Icon(Icons.edit), onPressed: () => _showEditServerDialog(index), @@ -305,9 +294,8 @@ class _SettingsPageState extends State { onTap: () { setState(() { _currentServer = server; - Provider.of(context, listen: false).serverIP = - server; - // 不再需要特别开始 ping 新选择的服务器,因为所有服务器都在 ping + Provider.of(context, listen: false).serverIP = server; + _appConfig.setCurrentServer(_currentServer); }); ScaffoldMessenger.of(context).showSnackBar( SnackBar(content: Text('已切换到服务器: $server')), @@ -347,6 +335,12 @@ class _SettingsPageState extends State { }); }, ), + SwitchListTile( + title: const Text('启用服务器Ping测试'), + subtitle: const Text('定期测试所有服务器的网络延迟'), + value: _pingEnabled, + onChanged: _togglePingStatus, + ), ], ), ), diff --git a/lib/widgets/card.dart b/lib/widgets/card.dart index f02b13e..10da7d5 100644 --- a/lib/widgets/card.dart +++ b/lib/widgets/card.dart @@ -1,5 +1,4 @@ import 'package:flutter/material.dart'; -import 'dart:math' as math; class FloatingCard extends StatefulWidget { final ColorScheme colorScheme; @@ -8,14 +7,8 @@ class FloatingCard extends StatefulWidget { final EdgeInsetsGeometry padding; final Duration duration; final double hoverElevation; - final double? maxWidth; // 添加最大宽度参数 - final double? height; // 添加最大宽度参数 - final bool enable3DEffect; // 是否启用3D效果 - final double maxRotationDegree; // 最大旋转角度 - final bool enableTranslateEffect; // 是否启用偏移效果 - final double maxTranslateDistance; // 最大偏移距离 - final double zTranslation; // Z轴偏移距离 - final bool riseOnHover; // 控制悬浮时是升起还是降下 + final double? maxWidth; + final double? height; const FloatingCard({ super.key, @@ -27,12 +20,6 @@ class FloatingCard extends StatefulWidget { this.hoverElevation = 8, this.maxWidth, this.height, - this.enable3DEffect = true, // 默认启用3D效果 - this.maxRotationDegree = 10, // 默认最大旋转角度为10度 - this.enableTranslateEffect = true, // 默认启用偏移效果 - this.maxTranslateDistance = 5, // 默认最大偏移距离为5 - this.zTranslation = 10, // 默认Z轴偏移距离为20 - this.riseOnHover = true, // 默认悬浮时升起 }); @override @@ -41,67 +28,12 @@ class FloatingCard extends StatefulWidget { class _FloatingCardState extends State { bool isHovered = false; - Offset mousePosition = Offset.zero; - final GlobalKey _cardKey = GlobalKey(); - - // 获取卡片的尺寸和位置 - Rect? _getCardRect() { - final RenderBox? renderBox = - _cardKey.currentContext?.findRenderObject() as RenderBox?; - if (renderBox == null) return null; - final position = renderBox.localToGlobal(Offset.zero); - return Rect.fromLTWH( - position.dx, position.dy, renderBox.size.width, renderBox.size.height); - } - - // 计算旋转角度 - (double, double) _calculateRotation() { - final rect = _getCardRect(); - if (rect == null) return (0, 0); - - // 计算鼠标相对于卡片中心的位置 - final centerX = rect.width / 2; - final centerY = rect.height / 2; - final deltaX = (mousePosition.dx - centerX) / centerX; - final deltaY = (mousePosition.dy - centerY) / centerY; - - // 计算旋转角度,鼠标在右侧时向左倾斜(Y轴正向旋转),鼠标在下方时向上倾斜(X轴负向旋转) - final rotateY = deltaX * widget.maxRotationDegree; - final rotateX = -deltaY * widget.maxRotationDegree; - - return (rotateX, rotateY); - } @override Widget build(BuildContext context) { - // 根据是否启用3D效果计算旋转角度 - final (rotateX, rotateY) = - isHovered && widget.enable3DEffect ? _calculateRotation() : (0.0, 0.0); - - // 根据是否启用偏移效果计算偏移距离 - final translateX = isHovered && widget.enableTranslateEffect - ? rotateY * widget.maxTranslateDistance - : 0.0; - final translateY = isHovered && widget.enableTranslateEffect - ? rotateX * widget.maxTranslateDistance - : 0.0; - - // 根据riseOnHover决定Z轴偏移方向 - final zDirection = widget.riseOnHover ? 1.0 : -1.0; - final translateZ = isHovered && widget.enableTranslateEffect - ? widget.zTranslation * zDirection - : 0.0; - return MouseRegion( onEnter: (_) => setState(() => isHovered = true), onExit: (_) => setState(() => isHovered = false), - onHover: (event) { - if (widget.enable3DEffect || widget.enableTranslateEffect) { - setState(() { - mousePosition = event.localPosition; - }); - } - }, cursor: SystemMouseCursors.click, child: Center( child: ConstrainedBox( @@ -109,15 +41,7 @@ class _FloatingCardState extends State { maxWidth: widget.maxWidth ?? double.infinity, ), child: AnimatedContainer( - key: _cardKey, duration: widget.duration, - transform: Matrix4.identity() - ..setEntry(3, 2, 0.001) // 透视效果 - // 仅当启用3D效果时应用旋转 - ..rotateX(widget.enable3DEffect ? rotateX * math.pi / 180 : 0) - ..rotateY(widget.enable3DEffect ? rotateY * math.pi / 180 : 0) - // 仅当启用偏移效果时应用偏移 - ..translate(translateX, translateY, translateZ), transformAlignment: Alignment.center, child: Card( shape: RoundedRectangleBorder( diff --git a/pubspec.lock b/pubspec.lock index 5312922..dfde858 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -5,24 +5,29 @@ packages: dependency: transitive description: name: _fe_analyzer_shared - sha256: dc27559385e905ad30838356c5f5d574014ba39872d732111cd07ac0beff4c57 - url: "https://pub.flutter-io.cn" + sha256: "16e298750b6d0af7ce8a3ba7c18c69c3785d11b15ec83f6dcd0ad2a0009b3cab" + url: "https://pub.dev" source: hosted - version: "80.0.0" + version: "76.0.0" + _macros: + dependency: transitive + description: dart + source: sdk + version: "0.3.3" analyzer: dependency: transitive description: name: analyzer - sha256: "192d1c5b944e7e53b24b5586db760db934b177d4147c42fbca8c8c5f1eb8d11e" - url: "https://pub.flutter-io.cn" + sha256: "1f14db053a8c23e260789e9b0980fa27f2680dd640932cae5e1137cce0e46e1e" + url: "https://pub.dev" source: hosted - version: "7.3.0" + version: "6.11.0" args: dependency: transitive description: name: args sha256: d0481093c50b1da8910eb0bb301626d4d8eb7284aa739614d2b394ee09e3ea04 - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "2.7.0" async: @@ -30,7 +35,7 @@ packages: description: name: async sha256: d2872f9c19731c2e5f10444b14686eb7cc85c76274bd6c16e1816bff9a3bab63 - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "2.12.0" boolean_selector: @@ -38,71 +43,71 @@ packages: description: name: boolean_selector sha256: "8aab1771e1243a5063b8b0ff68042d67334e3feab9e95b9490f9a6ebf73b42ea" - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "2.1.2" build: dependency: transitive description: name: build - sha256: cef23f1eda9b57566c81e2133d196f8e3df48f244b317368d65c5943d91148f0 - url: "https://pub.flutter-io.cn" + sha256: "80184af8b6cb3e5c1c4ec6d8544d27711700bc3e6d2efad04238c7b5290889f0" + url: "https://pub.dev" source: hosted - version: "2.4.2" + version: "2.4.1" build_cli_annotations: dependency: transitive description: name: build_cli_annotations sha256: b59d2769769efd6c9ff6d4c4cede0be115a566afc591705c2040b707534b1172 - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "2.1.0" build_config: dependency: transitive description: name: build_config - sha256: "4ae2de3e1e67ea270081eaee972e1bd8f027d459f249e0f1186730784c2e7e33" - url: "https://pub.flutter-io.cn" + sha256: bf80fcfb46a29945b423bd9aad884590fb1dc69b330a4d4700cac476af1708d1 + url: "https://pub.dev" source: hosted - version: "1.1.2" + version: "1.1.1" build_daemon: dependency: transitive description: name: build_daemon - sha256: "8e928697a82be082206edb0b9c99c5a4ad6bc31c9e9b8b2f291ae65cd4a25daa" - url: "https://pub.flutter-io.cn" + sha256: "79b2aef6ac2ed00046867ed354c88778c9c0f029df8a20fe10b5436826721ef9" + url: "https://pub.dev" source: hosted - version: "4.0.4" + version: "4.0.2" build_resolvers: dependency: transitive description: name: build_resolvers - sha256: b9e4fda21d846e192628e7a4f6deda6888c36b5b69ba02ff291a01fd529140f0 - url: "https://pub.flutter-io.cn" + sha256: "339086358431fa15d7eca8b6a36e5d783728cf025e559b834f4609a1fcfb7b0a" + url: "https://pub.dev" source: hosted - version: "2.4.4" + version: "2.4.2" build_runner: dependency: "direct dev" description: name: build_runner - sha256: "058fe9dce1de7d69c4b84fada934df3e0153dd000758c4d65964d0166779aa99" - url: "https://pub.flutter-io.cn" + sha256: "028819cfb90051c6b5440c7e574d1896f8037e3c96cf17aaeb054c9311cfbf4d" + url: "https://pub.dev" source: hosted - version: "2.4.15" + version: "2.4.13" build_runner_core: dependency: transitive description: name: build_runner_core - sha256: "22e3aa1c80e0ada3722fe5b63fd43d9c8990759d0a2cf489c8c5d7b2bdebc021" - url: "https://pub.flutter-io.cn" + sha256: f8126682b87a7282a339b871298cc12009cb67109cfa1614d6436fb0289193e0 + url: "https://pub.dev" source: hosted - version: "8.0.0" + version: "7.3.2" built_collection: dependency: transitive description: name: built_collection sha256: "376e3dd27b51ea877c28d525560790aee2e6fbb5f20e2f85d5081027d94e2100" - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "5.1.1" built_value: @@ -110,7 +115,7 @@ packages: description: name: built_value sha256: ea90e81dc4a25a043d9bee692d20ed6d1c4a1662a28c03a96417446c093ed6b4 - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "8.9.5" characters: @@ -118,7 +123,7 @@ packages: description: name: characters sha256: f71061c654a3380576a52b451dd5532377954cf9dbd272a78fc8479606670803 - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "1.4.0" checked_yaml: @@ -126,7 +131,7 @@ packages: description: name: checked_yaml sha256: feb6bed21949061731a7a75fc5d2aa727cf160b91af9a3e464c5e3a32e28b5ff - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "2.0.3" clock: @@ -134,7 +139,7 @@ packages: description: name: clock sha256: fddb70d9b5277016c77a80201021d40a2247104d9f4aa7bab7157b7e3f05b84b - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "1.1.2" code_builder: @@ -142,7 +147,7 @@ packages: description: name: code_builder sha256: "0ec10bf4a89e4c613960bf1e8b42c64127021740fb21640c29c909826a5eea3e" - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "4.10.1" collection: @@ -150,7 +155,7 @@ packages: description: name: collection sha256: "2f5709ae4d3d59dd8f7cd309b4e023046b57d8a6c82130785d2b0e5868084e76" - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "1.19.1" convert: @@ -158,7 +163,7 @@ packages: description: name: convert sha256: b30acd5944035672bc15c6b7a8b47d773e41e2f17de064350988c5d02adb1c68 - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "3.1.2" crypto: @@ -166,7 +171,7 @@ packages: description: name: crypto sha256: "1e445881f28f22d6140f181e07737b22f1e099a5e1ff94b0af2f9e4a463f4855" - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "3.0.6" cupertino_icons: @@ -174,23 +179,23 @@ packages: description: name: cupertino_icons sha256: ba631d1c7f7bef6b729a622b7b752645a2d076dba9976925b8f25725a30e1ee6 - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "1.0.8" dart_style: dependency: transitive description: name: dart_style - sha256: "27eb0ae77836989a3bc541ce55595e8ceee0992807f14511552a898ddd0d88ac" - url: "https://pub.flutter-io.cn" + sha256: "7856d364b589d1f08986e140938578ed36ed948581fbc3bc9aef1805039ac5ab" + url: "https://pub.dev" source: hosted - version: "3.0.1" + version: "2.3.7" dbus: dependency: transitive description: name: dbus sha256: "79e0c23480ff85dc68de79e2cd6334add97e48f7f4865d17686dd6ea81a47e8c" - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "0.7.11" equatable: @@ -198,7 +203,7 @@ packages: description: name: equatable sha256: "567c64b3cb4cf82397aac55f4f0cbd3ca20d77c6c03bedbc4ceaddc08904aef7" - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "2.0.7" fake_async: @@ -206,23 +211,23 @@ packages: description: name: fake_async sha256: "6a95e56b2449df2273fd8c45a662d6947ce1ebb7aafe80e550a3f68297f3cacc" - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "1.3.2" ffi: dependency: transitive description: name: ffi - sha256: "289279317b4b16eb2bb7e271abccd4bf84ec9bdcbe999e278a94b804f5630418" - url: "https://pub.flutter-io.cn" + sha256: "16ed7b077ef01ad6170a3d0c57caa4a112a38d7a2ed5602e0aca9ca6f3d98da6" + url: "https://pub.dev" source: hosted - version: "2.1.4" + version: "2.1.3" file: dependency: transitive description: name: file sha256: a3b4f84adafef897088c160faf7dfffb7696046cb13ae90b508c2cbc95d3b8d4 - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "7.0.1" fixnum: @@ -230,7 +235,7 @@ packages: description: name: fixnum sha256: b6dc7065e46c974bc7c5f143080a6764ec7a4be6da1285ececdc37be96de53be - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "1.1.1" fl_chart: @@ -238,7 +243,7 @@ packages: description: name: fl_chart sha256: "5276944c6ffc975ae796569a826c38a62d2abcf264e26b88fa6f482e107f4237" - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "0.70.2" flutter: @@ -251,7 +256,7 @@ packages: description: name: flutter_colorpicker sha256: "969de5f6f9e2a570ac660fb7b501551451ea2a1ab9e2097e89475f60e07816ea" - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "1.1.0" flutter_driver: @@ -264,7 +269,7 @@ packages: description: name: flutter_lints sha256: "5398f14efa795ffb7a33e9b6a08798b26a180edac4ad7db3f231e40f82ce11e1" - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "5.0.0" flutter_local_notifications: @@ -272,7 +277,7 @@ packages: description: name: flutter_local_notifications sha256: d59eeafd6df92174b1d5f68fc9d66634c97ce2e7cfe2293476236547bb19bbbd - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "19.0.0" flutter_local_notifications_linux: @@ -280,7 +285,7 @@ packages: description: name: flutter_local_notifications_linux sha256: e3c277b2daab8e36ac5a6820536668d07e83851aeeb79c446e525a70710770a5 - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "6.0.0" flutter_local_notifications_platform_interface: @@ -288,7 +293,7 @@ packages: description: name: flutter_local_notifications_platform_interface sha256: "2569b973fc9d1f63a37410a9f7c1c552081226c597190cb359ef5d5762d1631c" - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "9.0.0" flutter_local_notifications_windows: @@ -296,7 +301,7 @@ packages: description: name: flutter_local_notifications_windows sha256: f8fc0652a601f83419d623c85723a3e82ad81f92b33eaa9bcc21ea1b94773e6e - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "1.0.0" flutter_localizations: @@ -309,7 +314,7 @@ packages: description: name: flutter_rust_bridge sha256: "5a5c7a5deeef2cc2ffe6076a33b0429f4a20ceac22a397297aed2b1eb067e611" - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "2.9.0" flutter_staggered_grid_view: @@ -317,7 +322,7 @@ packages: description: name: flutter_staggered_grid_view sha256: "19e7abb550c96fbfeb546b23f3ff356ee7c59a019a651f8f102a4ba9b7349395" - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "0.7.0" flutter_test: @@ -335,7 +340,7 @@ packages: description: name: frontend_server_client sha256: f64a0333a82f30b0cca061bc3d143813a486dc086b574bfb233b7c1372427694 - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "4.0.0" fuchsia_remote_debug_protocol: @@ -348,7 +353,7 @@ packages: description: name: glob sha256: c3f1ee72c96f8f78935e18aa8cecced9ab132419e8625dc187e1c2408efc20de - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "2.1.3" graphs: @@ -356,7 +361,7 @@ packages: description: name: graphs sha256: "741bbf84165310a68ff28fe9e727332eef1407342fca52759cb21ad8177bb8d0" - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "2.3.2" http: @@ -364,7 +369,7 @@ packages: description: name: http sha256: fe7ab022b76f3034adc518fb6ea04a82387620e19977665ea18d30a1cf43442f - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "1.3.0" http_multi_server: @@ -372,17 +377,17 @@ packages: description: name: http_multi_server sha256: aa6199f908078bb1c5efb8d8638d4ae191aac11b311132c3ef48ce352fb52ef8 - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "3.2.2" http_parser: dependency: transitive description: name: http_parser - sha256: "178d74305e7866013777bab2c3d8726205dc5a4dd935297175b19a23a2e66571" - url: "https://pub.flutter-io.cn" + sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b" + url: "https://pub.dev" source: hosted - version: "4.1.2" + version: "4.0.2" integration_test: dependency: "direct dev" description: flutter @@ -393,7 +398,7 @@ packages: description: name: intl sha256: d6f56758b7d3014a48af9701c085700aac781a92a87a62b1333b46d8879661cf - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "0.19.0" io: @@ -401,39 +406,39 @@ packages: description: name: io sha256: dfd5a80599cf0165756e3181807ed3e77daf6dd4137caaad72d0b7931597650b - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "1.0.5" js: dependency: transitive description: name: js - sha256: "53385261521cc4a0c4658fd0ad07a7d14591cf8fc33abbceae306ddb974888dc" - url: "https://pub.flutter-io.cn" + sha256: c1b2e9b5ea78c45e1a0788d29606ba27dc5f71f019f32ca5140f61ef071838cf + url: "https://pub.dev" source: hosted - version: "0.7.2" + version: "0.7.1" json_annotation: dependency: "direct main" description: name: json_annotation sha256: "1ce844379ca14835a50d2f019a3099f419082cfdd231cd86a142af94dd5c6bb1" - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "4.9.0" json_serializable: dependency: "direct dev" description: name: json_serializable - sha256: "81f04dee10969f89f604e1249382d46b97a1ccad53872875369622b5bfc9e58a" - url: "https://pub.flutter-io.cn" + sha256: c2fcb3920cf2b6ae6845954186420fca40bc0a8abcc84903b7801f17d7050d7c + url: "https://pub.dev" source: hosted - version: "6.9.4" + version: "6.9.0" leak_tracker: dependency: transitive description: name: leak_tracker sha256: c35baad643ba394b40aac41080300150a4f08fd0fd6a10378f8f7c6bc161acec - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "10.0.8" leak_tracker_flutter_testing: @@ -441,7 +446,7 @@ packages: description: name: leak_tracker_flutter_testing sha256: f8b613e7e6a13ec79cfdc0e97638fddb3ab848452eff057653abd3edba760573 - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "3.0.9" leak_tracker_testing: @@ -449,31 +454,39 @@ packages: description: name: leak_tracker_testing sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3" - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "3.0.1" lints: dependency: transitive description: name: lints - sha256: c35bb79562d980e9a453fc715854e1ed39e24e7d0297a880ef54e17f9874a9d7 - url: "https://pub.flutter-io.cn" + sha256: "3315600f3fb3b135be672bf4a178c55f274bebe368325ae18462c89ac1e3b413" + url: "https://pub.dev" source: hosted - version: "5.1.1" + version: "5.0.0" logging: dependency: transitive description: name: logging sha256: c8245ada5f1717ed44271ed1c26b8ce85ca3228fd2ffdb75468ab01979309d61 - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "1.3.0" + macros: + dependency: transitive + description: + name: macros + sha256: "1d9e801cd66f7ea3663c45fc708450db1fa57f988142c64289142c9b7ee80656" + url: "https://pub.dev" + source: hosted + version: "0.1.3-main.0" matcher: dependency: transitive description: name: matcher sha256: dc58c723c3c24bf8d3e2d3ad3f2f9d7bd9cf43ec6feaa64181775e60190153f2 - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "0.12.17" material_color_utilities: @@ -481,7 +494,7 @@ packages: description: name: material_color_utilities sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "0.11.1" menu_base: @@ -489,7 +502,7 @@ packages: description: name: menu_base sha256: "820368014a171bd1241030278e6c2617354f492f5c703d7b7d4570a6b8b84405" - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "0.1.1" meta: @@ -497,7 +510,7 @@ packages: description: name: meta sha256: e3641ec5d63ebf0d9b41bd43201a66e3fc79a65db5f61fc181f04cd27aab950c - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "1.16.0" mime: @@ -505,7 +518,7 @@ packages: description: name: mime sha256: "41a20518f0cb1256669420fdba0cd90d21561e560ac240f26ef8322e45bb7ed6" - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "2.0.0" nested: @@ -513,7 +526,7 @@ packages: description: name: nested sha256: "03bac4c528c64c95c722ec99280375a6f2fc708eec17c7b3f07253b626cd2a20" - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "1.0.0" package_config: @@ -521,7 +534,7 @@ packages: description: name: package_config sha256: f096c55ebb7deb7e384101542bfba8c52696c1b56fca2eb62827989ef2353bbc - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "2.2.0" package_info_plus: @@ -529,7 +542,7 @@ packages: description: name: package_info_plus sha256: "7976bfe4c583170d6cdc7077e3237560b364149fcd268b5f53d95a991963b191" - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "8.3.0" package_info_plus_platform_interface: @@ -537,7 +550,7 @@ packages: description: name: package_info_plus_platform_interface sha256: "6c935fb612dff8e3cc9632c2b301720c77450a126114126ffaafe28d2e87956c" - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "3.2.0" path: @@ -545,7 +558,7 @@ packages: description: name: path sha256: "75cca69d1490965be98c73ceaea117e8a04dd21217b37b292c9ddbec0d955bc5" - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "1.9.1" path_provider_linux: @@ -553,7 +566,7 @@ packages: description: name: path_provider_linux sha256: f7a1fe3a634fe7734c8d3f2766ad746ae2a2884abe22e241a8b301bf5cac3279 - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "2.2.1" path_provider_platform_interface: @@ -561,7 +574,7 @@ packages: description: name: path_provider_platform_interface sha256: "88f5779f72ba699763fa3a3b06aa4bf6de76c8e5de842cf6f29e2e06476c2334" - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "2.1.2" path_provider_windows: @@ -569,23 +582,23 @@ packages: description: name: path_provider_windows sha256: bd6f00dbd873bfb70d0761682da2b3a2c2fccc2b9e84c495821639601d81afe7 - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "2.3.0" petitparser: dependency: transitive description: name: petitparser - sha256: "07c8f0b1913bcde1ff0d26e57ace2f3012ccbf2b204e070290dad3bb22797646" - url: "https://pub.flutter-io.cn" + sha256: c15605cd28af66339f8eb6fbe0e541bfe2d1b72d5825efc6598f3e0a31b9ad27 + url: "https://pub.dev" source: hosted - version: "6.1.0" + version: "6.0.2" platform: dependency: transitive description: name: platform sha256: "5d6b1b0036a5f331ebc77c850ebc8506cbc1e9416c27e59b439f917a902a4984" - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "3.1.6" plugin_platform_interface: @@ -593,7 +606,7 @@ packages: description: name: plugin_platform_interface sha256: "4820fbfdb9478b1ebae27888254d445073732dae3d6ea81f0b7e06d5dedc3f02" - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "2.1.8" pool: @@ -601,7 +614,7 @@ packages: description: name: pool sha256: "20fe868b6314b322ea036ba325e6fc0711a22948856475e2c2b6306e8ab39c2a" - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "1.5.1" process: @@ -609,7 +622,7 @@ packages: description: name: process sha256: "107d8be718f120bbba9dcd1e95e3bd325b1b4a4f07db64154635ba03f2567a0d" - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "5.0.3" provider: @@ -617,7 +630,7 @@ packages: description: name: provider sha256: c8a055ee5ce3fd98d6fc872478b03823ffdb448699c6ebdbbc71d59b596fd48c - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "6.1.2" pub_semver: @@ -625,17 +638,17 @@ packages: description: name: pub_semver sha256: "5bfcf68ca79ef689f8990d1160781b4bad40a3bd5e5218ad4076ddb7f4081585" - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "2.2.0" pubspec_parse: dependency: transitive description: name: pubspec_parse - sha256: "0560ba233314abbed0a48a2956f7f022cce7c3e1e73df540277da7544cad4082" - url: "https://pub.flutter-io.cn" + sha256: "81876843eb50dc2e1e5b151792c9a985c5ed2536914115ed04e9c8528f6647b0" + url: "https://pub.dev" source: hosted - version: "1.5.0" + version: "1.4.0" rust_lib_fltier: dependency: "direct main" description: @@ -648,7 +661,7 @@ packages: description: name: screen_retriever sha256: "570dbc8e4f70bac451e0efc9c9bb19fa2d6799a11e6ef04f946d7886d2e23d0c" - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "0.2.0" screen_retriever_linux: @@ -656,7 +669,7 @@ packages: description: name: screen_retriever_linux sha256: f7f8120c92ef0784e58491ab664d01efda79a922b025ff286e29aa123ea3dd18 - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "0.2.0" screen_retriever_macos: @@ -664,7 +677,7 @@ packages: description: name: screen_retriever_macos sha256: "71f956e65c97315dd661d71f828708bd97b6d358e776f1a30d5aa7d22d78a149" - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "0.2.0" screen_retriever_platform_interface: @@ -672,7 +685,7 @@ packages: description: name: screen_retriever_platform_interface sha256: ee197f4581ff0d5608587819af40490748e1e39e648d7680ecf95c05197240c0 - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "0.2.0" screen_retriever_windows: @@ -680,7 +693,7 @@ packages: description: name: screen_retriever_windows sha256: "449ee257f03ca98a57288ee526a301a430a344a161f9202b4fcc38576716fe13" - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "0.2.0" shared_preferences: @@ -688,23 +701,23 @@ packages: description: name: shared_preferences sha256: "846849e3e9b68f3ef4b60c60cf4b3e02e9321bc7f4d8c4692cf87ffa82fc8a3a" - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "2.5.2" shared_preferences_android: dependency: transitive description: name: shared_preferences_android - sha256: "3ec7210872c4ba945e3244982918e502fa2bfb5230dff6832459ca0e1879b7ad" - url: "https://pub.flutter-io.cn" + sha256: "9f9f3d372d4304723e6136663bb291c0b93f5e4c8a4a6314347f481a33bda2b1" + url: "https://pub.dev" source: hosted - version: "2.4.8" + version: "2.4.7" shared_preferences_foundation: dependency: transitive description: name: shared_preferences_foundation sha256: "6a52cfcdaeac77cad8c97b539ff688ccfc458c007b4db12be584fbe5c0e49e03" - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "2.5.4" shared_preferences_linux: @@ -712,7 +725,7 @@ packages: description: name: shared_preferences_linux sha256: "580abfd40f415611503cae30adf626e6656dfb2f0cee8f465ece7b6defb40f2f" - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "2.4.1" shared_preferences_platform_interface: @@ -720,7 +733,7 @@ packages: description: name: shared_preferences_platform_interface sha256: "57cbf196c486bc2cf1f02b85784932c6094376284b3ad5779d1b1c6c6a816b80" - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "2.4.1" shared_preferences_web: @@ -728,7 +741,7 @@ packages: description: name: shared_preferences_web sha256: c49bd060261c9a3f0ff445892695d6212ff603ef3115edbb448509d407600019 - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "2.4.3" shared_preferences_windows: @@ -736,31 +749,31 @@ packages: description: name: shared_preferences_windows sha256: "94ef0f72b2d71bc3e700e025db3710911bd51a71cefb65cc609dd0d9a982e3c1" - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "2.4.1" shelf: dependency: transitive description: name: shelf - sha256: e7dd780a7ffb623c57850b33f43309312fc863fb6aa3d276a754bb299839ef12 - url: "https://pub.flutter-io.cn" + sha256: ad29c505aee705f41a4d8963641f91ac4cee3c8fad5947e033390a7bd8180fa4 + url: "https://pub.dev" source: hosted - version: "1.4.2" + version: "1.4.1" shelf_web_socket: dependency: transitive description: name: shelf_web_socket - sha256: "3632775c8e90d6c9712f883e633716432a27758216dfb61bd86a8321c0580925" - url: "https://pub.flutter-io.cn" + sha256: cc36c297b52866d203dbf9332263c94becc2fe0ceaa9681d07b6ef9807023b67 + url: "https://pub.dev" source: hosted - version: "3.0.0" + version: "2.0.1" shortid: dependency: transitive description: name: shortid sha256: d0b40e3dbb50497dad107e19c54ca7de0d1a274eb9b4404991e443dadb9ebedb - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "0.1.2" sky_engine: @@ -772,16 +785,16 @@ packages: dependency: transitive description: name: source_gen - sha256: "35c8150ece9e8c8d263337a265153c3329667640850b9304861faea59fc98f6b" - url: "https://pub.flutter-io.cn" + sha256: "14658ba5f669685cd3d63701d01b31ea748310f7ab854e471962670abcf57832" + url: "https://pub.dev" source: hosted - version: "2.0.0" + version: "1.5.0" source_helper: dependency: transitive description: name: source_helper sha256: "86d247119aedce8e63f4751bd9626fc9613255935558447569ad42f9f5b48b3c" - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "1.3.5" source_span: @@ -789,7 +802,7 @@ packages: description: name: source_span sha256: "254ee5351d6cb365c859e20ee823c3bb479bf4a293c22d17a9f1bf144ce86f7c" - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "1.10.1" stack_trace: @@ -797,7 +810,7 @@ packages: description: name: stack_trace sha256: "8b27215b45d22309b5cddda1aa2b19bdfec9df0e765f2de506401c071d38d1b1" - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "1.12.1" stream_channel: @@ -805,7 +818,7 @@ packages: description: name: stream_channel sha256: "969e04c80b8bcdf826f8f16579c7b14d780458bd97f56d107d3950fdbeef059d" - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "2.1.4" stream_transform: @@ -813,7 +826,7 @@ packages: description: name: stream_transform sha256: ad47125e588cfd37a9a7f86c7d6356dde8dfe89d071d293f80ca9e9273a33871 - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "2.1.1" string_scanner: @@ -821,7 +834,7 @@ packages: description: name: string_scanner sha256: "921cd31725b72fe181906c6a94d987c78e3b98c2e205b397ea399d4054872b43" - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "1.4.1" sync_http: @@ -829,7 +842,7 @@ packages: description: name: sync_http sha256: "7f0cd72eca000d2e026bcd6f990b81d0ca06022ef4e32fb257b30d3d1014a961" - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "0.3.1" system_tray: @@ -837,7 +850,7 @@ packages: description: name: system_tray sha256: "40444e5de8ed907822a98694fd031b8accc3cb3c0baa547634ce76189cf3d9cf" - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "2.0.3" term_glyph: @@ -845,7 +858,7 @@ packages: description: name: term_glyph sha256: "7f554798625ea768a7518313e58f83891c7f5024f88e46e7182a4558850a4b8e" - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "1.2.2" test_api: @@ -853,7 +866,7 @@ packages: description: name: test_api sha256: fb31f383e2ee25fbbfe06b40fe21e1e458d14080e3c67e7ba0acfde4df4e0bbd - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "0.7.4" timezone: @@ -861,7 +874,7 @@ packages: description: name: timezone sha256: ffc9d5f4d1193534ef051f9254063fa53d588609418c84299956c3db9383587d - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "0.10.0" timing: @@ -869,7 +882,7 @@ packages: description: name: timing sha256: "62ee18aca144e4a9f29d212f5a4c6a053be252b895ab14b5821996cff4ed90fe" - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "1.0.2" tray_manager: @@ -877,7 +890,7 @@ packages: description: name: tray_manager sha256: "80be6c508159a6f3c57983de795209ac13453e9832fd574143b06dceee188ed2" - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "0.3.2" typed_data: @@ -885,7 +898,7 @@ packages: description: name: typed_data sha256: f9049c039ebfeb4cf7a7104a675823cd72dba8297f264b6637062516699fa006 - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "1.4.0" url_launcher: @@ -893,23 +906,23 @@ packages: description: name: url_launcher sha256: "9d06212b1362abc2f0f0d78e6f09f726608c74e3b9462e8368bb03314aa8d603" - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "6.3.1" url_launcher_android: dependency: transitive description: name: url_launcher_android - sha256: "1d0eae19bd7606ef60fe69ef3b312a437a16549476c42321d5dc1506c9ca3bf4" - url: "https://pub.flutter-io.cn" + sha256: "6fc2f56536ee873eeb867ad176ae15f304ccccc357848b351f6f0d8d4a40d193" + url: "https://pub.dev" source: hosted - version: "6.3.15" + version: "6.3.14" url_launcher_ios: dependency: transitive description: name: url_launcher_ios sha256: "16a513b6c12bb419304e72ea0ae2ab4fed569920d1c7cb850263fe3acc824626" - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "6.3.2" url_launcher_linux: @@ -917,7 +930,7 @@ packages: description: name: url_launcher_linux sha256: "4e9ba368772369e3e08f231d2301b4ef72b9ff87c31192ef471b380ef29a4935" - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "3.2.1" url_launcher_macos: @@ -925,7 +938,7 @@ packages: description: name: url_launcher_macos sha256: "17ba2000b847f334f16626a574c702b196723af2a289e7a93ffcb79acff855c2" - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "3.2.2" url_launcher_platform_interface: @@ -933,23 +946,23 @@ packages: description: name: url_launcher_platform_interface sha256: "552f8a1e663569be95a8190206a38187b531910283c3e982193e4f2733f01029" - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "2.3.2" url_launcher_web: dependency: transitive description: name: url_launcher_web - sha256: "3ba963161bd0fe395917ba881d320b9c4f6dd3c4a233da62ab18a5025c85f1e9" - url: "https://pub.flutter-io.cn" + sha256: "772638d3b34c779ede05ba3d38af34657a05ac55b06279ea6edd409e323dca8e" + url: "https://pub.dev" source: hosted - version: "2.4.0" + version: "2.3.3" url_launcher_windows: dependency: transitive description: name: url_launcher_windows sha256: "3284b6d2ac454cf34f114e1d3319866fdd1e19cdc329999057e44ffe936cfa77" - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "3.1.4" uuid: @@ -957,7 +970,7 @@ packages: description: name: uuid sha256: "648e103079f7c64a36dc7d39369cabb358d377078a051d6ae2ad3aa539519313" - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "3.0.7" vector_math: @@ -965,7 +978,7 @@ packages: description: name: vector_math sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "2.1.4" vm_service: @@ -973,7 +986,7 @@ packages: description: name: vm_service sha256: "0968250880a6c5fe7edc067ed0a13d4bae1577fe2771dcf3010d52c4a9d3ca14" - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "14.3.1" watcher: @@ -981,7 +994,7 @@ packages: description: name: watcher sha256: "69da27e49efa56a15f8afe8f4438c4ec02eff0a117df1b22ea4aad194fe1c104" - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "1.1.1" web: @@ -989,7 +1002,7 @@ packages: description: name: web sha256: "868d88a33d8a87b18ffc05f9f030ba328ffefba92d6c127917a2ba740f9cfe4a" - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "1.1.1" web_socket: @@ -997,7 +1010,7 @@ packages: description: name: web_socket sha256: "3c12d96c0c9a4eec095246debcea7b86c0324f22df69893d538fcc6f1b8cce83" - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "0.1.6" web_socket_channel: @@ -1005,7 +1018,7 @@ packages: description: name: web_socket_channel sha256: "0b8e2457400d8a859b7b2030786835a28a8e80836ef64402abef392ff4f1d0e5" - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "3.0.2" webdriver: @@ -1013,23 +1026,23 @@ packages: description: name: webdriver sha256: "3d773670966f02a646319410766d3b5e1037efb7f07cc68f844d5e06cd4d61c8" - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "3.0.4" win32: dependency: transitive description: name: win32 - sha256: dc6ecaa00a7c708e5b4d10ee7bec8c270e9276dfcab1783f57e9962d7884305f - url: "https://pub.flutter-io.cn" + sha256: daf97c9d80197ed7b619040e86c8ab9a9dad285e7671ee7390f9180cc828a51e + url: "https://pub.dev" source: hosted - version: "5.12.0" + version: "5.10.1" window_manager: dependency: "direct main" description: name: window_manager sha256: "732896e1416297c63c9e3fb95aea72d0355f61390263982a47fd519169dc5059" - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "0.4.3" windows_notification: @@ -1037,7 +1050,7 @@ packages: description: name: windows_notification sha256: be3e650874615f315402c9b9f3656e29af156709c4b5cc272cb4ca0ab7ba94a8 - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "1.3.0" xdg_directories: @@ -1045,7 +1058,7 @@ packages: description: name: xdg_directories sha256: "7a3f37b05d989967cdddcbb571f1ea834867ae2faa29725fd085180e0883aa15" - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "1.1.0" xml: @@ -1053,7 +1066,7 @@ packages: description: name: xml sha256: b015a8ad1c488f66851d762d3090a21c600e479dc75e68328c52774040cf9226 - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "6.5.0" yaml: @@ -1061,9 +1074,9 @@ packages: description: name: yaml sha256: b9da305ac7c39faa3f030eccd175340f968459dae4af175130b3fc47e40d76ce - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "3.1.3" sdks: - dart: ">=3.7.0 <4.0.0" - flutter: ">=3.27.0" + dart: ">=3.7.0-0 <4.0.0" + flutter: ">=3.24.0" diff --git a/pubspec.yaml b/pubspec.yaml index 77b709d..50597b6 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -42,7 +42,6 @@ dependencies: flutter_rust_bridge: 2.9.0 flutter_colorpicker: ^1.1.0 window_manager: ^0.4.3 - fl_chart: ^0.70.2 flutter_staggered_grid_view: ^0.7.0 json_annotation: ^4.8.1 tray_manager: ^0.3.2 @@ -52,6 +51,7 @@ dependencies: yaml: ^3.1.2 flutter_local_notifications: ^19.0.0 windows_notification: ^1.3.0 + fl_chart: ^0.70.2 dev_dependencies: flutter_test: diff --git a/rust/src/api/simple.rs b/rust/src/api/simple.rs index f5f3a05..63ffce8 100644 --- a/rust/src/api/simple.rs +++ b/rust/src/api/simple.rs @@ -581,15 +581,19 @@ pub fn create_server( cfg.set_hostname(Option::from(username)); cfg.set_dhcp(enable_dhcp); let mut flags = cfg.get_flags(); - flags.dev_name = "Astral".to_string(); + // flags.dev_name = "astral".to_string(); cfg.set_flags(flags); - let peer_config = PeerConfig { - uri: ("tcp://".to_string() + &severurl).parse().unwrap(), - }; - let peer_config2 = PeerConfig { - uri: ("udp://".to_string() + &severurl).parse().unwrap(), - }; - cfg.set_peers(vec![peer_config, peer_config2]); + // 创建TCP和UDP连接配置列表 + let peer_configs = vec![ + PeerConfig { + uri: format!("tcp://{}", severurl).parse().unwrap(), + }, + PeerConfig { + uri: format!("udp://{}", severurl).parse().unwrap(), + } + ]; + + cfg.set_peers(peer_configs); if enable_dhcp == false { // 使用完整路径引用 cidr 模块的 Ipv4Inet // 解析IP地址和子网掩码 diff --git a/web/favicon.png b/web/favicon.png deleted file mode 100644 index 8aaa46a..0000000 Binary files a/web/favicon.png and /dev/null differ diff --git a/web/icons/Icon-192.png b/web/icons/Icon-192.png deleted file mode 100644 index b749bfe..0000000 Binary files a/web/icons/Icon-192.png and /dev/null differ diff --git a/web/icons/Icon-512.png b/web/icons/Icon-512.png deleted file mode 100644 index 88cfd48..0000000 Binary files a/web/icons/Icon-512.png and /dev/null differ diff --git a/web/icons/Icon-maskable-192.png b/web/icons/Icon-maskable-192.png deleted file mode 100644 index eb9b4d7..0000000 Binary files a/web/icons/Icon-maskable-192.png and /dev/null differ diff --git a/web/icons/Icon-maskable-512.png b/web/icons/Icon-maskable-512.png deleted file mode 100644 index d69c566..0000000 Binary files a/web/icons/Icon-maskable-512.png and /dev/null differ diff --git a/web/index.html b/web/index.html deleted file mode 100644 index b0e834b..0000000 --- a/web/index.html +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - - - - - - - - - - - - - - astral - - - - - - diff --git a/web/manifest.json b/web/manifest.json deleted file mode 100644 index 56decc4..0000000 --- a/web/manifest.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "name": "astral", - "short_name": "astral", - "start_url": ".", - "display": "standalone", - "background_color": "#0175C2", - "theme_color": "#0175C2", - "description": "A new Flutter project.", - "orientation": "portrait-primary", - "prefer_related_applications": false, - "icons": [ - { - "src": "icons/Icon-192.png", - "sizes": "192x192", - "type": "image/png" - }, - { - "src": "icons/Icon-512.png", - "sizes": "512x512", - "type": "image/png" - }, - { - "src": "icons/Icon-maskable-192.png", - "sizes": "192x192", - "type": "image/png", - "purpose": "maskable" - }, - { - "src": "icons/Icon-maskable-512.png", - "sizes": "512x512", - "type": "image/png", - "purpose": "maskable" - } - ] -} diff --git a/windows/CMakeLists.txt b/windows/CMakeLists.txt index ca97fa1..ca970b4 100644 --- a/windows/CMakeLists.txt +++ b/windows/CMakeLists.txt @@ -75,10 +75,6 @@ set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}") install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}" COMPONENT Runtime) -# 添加管理员权限要求(修正路径格式) -target_link_options(${BINARY_NAME} PRIVATE - "LINKER:/MANIFESTUAC:level='requireAdministrator' uiAccess='false'" - $<$:"LINKER:/MANIFESTINPUT:${CMAKE_CURRENT_SOURCE_DIR}/runner/runner.exe.manifest">) install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) diff --git a/windows/runner/CMakeLists.txt b/windows/runner/CMakeLists.txt index f686f62..e5aff02 100644 --- a/windows/runner/CMakeLists.txt +++ b/windows/runner/CMakeLists.txt @@ -26,7 +26,7 @@ target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MAJOR=${FLUTT target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MINOR=${FLUTTER_VERSION_MINOR}") target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_PATCH=${FLUTTER_VERSION_PATCH}") target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_BUILD=${FLUTTER_VERSION_BUILD}") - +SET_TARGET_PROPERTIES(${BINARY_NAME} PROPERTIES LINK_FLAGS "/MANIFESTUAC:\"level='requireAdministrator' uiAccess='false'\" /SUBSYSTEM:WINDOWS") # Disable Windows macros that collide with C++ standard library functions. target_compile_definitions(${BINARY_NAME} PRIVATE "NOMINMAX") diff --git a/windows/runner/runner.exe.manifest b/windows/runner/runner.exe.manifest index 7bf9e03..a871b45 100644 --- a/windows/runner/runner.exe.manifest +++ b/windows/runner/runner.exe.manifest @@ -1,12 +1,6 @@ - - - - - - - + PerMonitorV2 @@ -18,4 +12,14 @@ + + + + + + + +