From 029b4e0dbafbb1470f54d77bc48048484272a9a4 Mon Sep 17 00:00:00 2001 From: lollipopkit <10864310+lollipopkit@users.noreply.github.com> Date: Tue, 3 Dec 2024 00:13:58 +0800 Subject: [PATCH] chore: `README` --- README.md | 12 ++-- README_zh.md | 14 ++-- lib/view/page/server/detail/view.dart | 12 +++- lib/view/page/server/tab.dart | 95 ++++++++++++++------------- 4 files changed, 73 insertions(+), 60 deletions(-) diff --git a/README.md b/README.md index 01b1e1737..758287135 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ English | [简体中文](README_zh.md)

-A Flutter project which provide charts to display Linux server status and tools to manage server. +A Flutter project which provide charts to display Linux server status and tools to manage server.
Especially thanks to dartssh2 & xterm.dart.

@@ -28,11 +28,11 @@ Especially thanks to dartss ## 📥 Install -Platform | From ---- | --- -iOS / macOS | [AppStore](https://apps.apple.com/app/id1586449703) -Android | [GitHub](https://github.com/lollipopkit/flutter_server_box/releases) / [CDN](https://cdn.lolli.tech/serverbox/?sort=time&order=desc&layout=grid) / [F-Droid](https://f-droid.org/packages/tech.lolli.toolbox) / [OpenAPK](https://www.openapk.net/serverbox/tech.lolli.toolbox/) -Linux / Windows | [GitHub](https://github.com/lollipopkit/flutter_server_box/releases) / [CDN](https://cdn.lolli.tech/serverbox/?sort=time&order=desc&layout=grid) +Platform | From +----------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ +iOS / macOS | [AppStore](https://apps.apple.com/app/id1586449703) +Android | [GitHub](https://github.com/lollipopkit/flutter_server_box/releases) / [CDN](https://cdn.lpkt.cn/serverbox/pkg/?sort=time&order=desc&layout=grid) / [F-Droid](https://f-droid.org/packages/tech.lolli.toolbox) / [OpenAPK](https://www.openapk.net/serverbox/tech.lolli.toolbox/) +Linux / Windows | [GitHub](https://github.com/lollipopkit/flutter_server_box/releases) / [CDN](https://cdn.lpkt.cn/serverbox/pkg/?sort=time&order=desc&layout=grid) Please only download pkgs from the source that **you trust**! diff --git a/README_zh.md b/README_zh.md index c1809994f..1f358c86e 100644 --- a/README_zh.md +++ b/README_zh.md @@ -9,7 +9,7 @@

-使用 Flutter 开发的 Linux 服务器工具箱,提供服务器状态图表和管理工具。 +使用 Flutter 开发的 Linux 服务器工具箱,提供服务器状态图表和管理工具。
特别感谢 dartssh2 & xterm.dart

@@ -28,11 +28,11 @@ ## 📥 安装 -平台 | 下载 ---- | --- -iOS / macOS | [AppStore](https://apps.apple.com/app/id1586449703) -Android | [GitHub](https://github.com/lollipopkit/flutter_server_box/releases) / [CDN](https://cdn.lolli.tech/serverbox/?sort=time&order=desc&layout=grid) / [F-Droid](https://f-droid.org/packages/tech.lolli.toolbox) / [OpenAPK](https://www.openapk.net/serverbox/tech.lolli.toolbox/) -Linux / Windows | [GitHub](https://github.com/lollipopkit/flutter_server_box/releases) / [CDN](https://cdn.lolli.tech/serverbox/?sort=time&order=desc&layout=grid) +平台 | 下载 +----------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ +iOS / macOS | [AppStore](https://apps.apple.com/app/id1586449703) +Android | [GitHub](https://github.com/lollipopkit/flutter_server_box/releases) / [CDN](https://cdn.lpkt.cn/serverbox/pkg/?sort=time&order=desc&layout=grid) / [F-Droid](https://f-droid.org/packages/tech.lolli.toolbox) / [OpenAPK](https://www.openapk.net/serverbox/tech.lolli.toolbox/) +Linux / Windows | [GitHub](https://github.com/lollipopkit/flutter_server_box/releases) / [CDN](https://cdn.lpkt.cn/serverbox/pkg/?sort=time&order=desc&layout=grid) 请从 **信任** 的来源下载! @@ -72,7 +72,7 @@ Linux / Windows | [GitHub](https://github.com/lollipopkit/flutter_server_box/rel 3. 运行 `dart run fl_build -p PLATFORM` 构建应用 ### 翻译 -[指南](https://blog.lolli.tech/faq/) 可在我的博客中找到。 +[指南](https://blog.lpkt.cn/faq/) 可在我的博客中找到。 ## 💡 我的其它 Apps - [GPT Box](https://github.com/lollipopkit/flutter_gpt_box) - 支持 OpenAI API 的 第三方全平台客户端。 diff --git a/lib/view/page/server/detail/view.dart b/lib/view/page/server/detail/view.dart index 0e4a5240e..84c7f411e 100644 --- a/lib/view/page/server/detail/view.dart +++ b/lib/view/page/server/detail/view.dart @@ -124,7 +124,17 @@ class _ServerDetailPageState extends State return CustomAppBar( title: Hero( tag: 'home_card_title_${si.spi.id}', - child: Text(si.spi.name), + transitionOnUserGestures: true, + child: Material( + color: Colors.transparent, + child: Text( + si.spi.name, + style: TextStyle( + fontSize: 20, + color: context.isDark ? Colors.white : Colors.black, + ), + ), + ), ), actions: [ QrShareBtn( diff --git a/lib/view/page/server/tab.dart b/lib/view/page/server/tab.dart index 93dd3d364..818e1effe 100644 --- a/lib/view/page/server/tab.dart +++ b/lib/view/page/server/tab.dart @@ -316,44 +316,41 @@ class _ServerPageState extends State final cardStatus = _getCardNoti(id); final title = _buildServerCardTitle(srv); - return ListenableBuilder( - listenable: cardStatus, - builder: (_, __) { - final List children = [title]; - if (srv.conn == ServerConn.finished) { - if (cardStatus.value.flip) { - children.addAll(_buildFlippedCard(srv)); - } else { - children.addAll(_buildNormalCard(srv.status, srv.spi)); - } + return cardStatus.listenVal((_) { + final List children = [title]; + if (srv.conn == ServerConn.finished) { + if (cardStatus.value.flip) { + children.add(_buildFlippedCard(srv)); + } else { + children.addAll(_buildNormalCard(srv.status, srv.spi)); } + } - final height = _calcCardHeight(srv.conn, cardStatus.value.flip); - return AnimatedContainer( - duration: const Duration(milliseconds: 377), - curve: Curves.fastEaseInToSlowEaseOut, - height: height, - // Use [OverflowBox] to dismiss the warning of [Column] overflow. - child: OverflowBox( - // If `height == _kCardHeightMin`, the `maxHeight` will be ignored. - // - // You can comment the `maxHeight` then connect&disconnect the server - // to see the difference. - maxHeight: height != _kCardHeightMin ? height : null, - child: Column( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.spaceAround, - crossAxisAlignment: CrossAxisAlignment.center, - children: children, - ), + final height = _calcCardHeight(srv.conn, cardStatus.value.flip); + return AnimatedContainer( + duration: const Duration(milliseconds: 377), + curve: Curves.fastEaseInToSlowEaseOut, + height: height, + // Use [OverflowBox] to dismiss the warning of [Column] overflow. + child: OverflowBox( + // If `height == _kCardHeightMin`, the `maxHeight` will be ignored. + // + // You can comment the `maxHeight` then connect&disconnect the server + // to see the difference. + maxHeight: height != _kCardHeightMin ? height : null, + child: Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.center, + children: children, ), - ); - }, - ); + ), + ); + }); } - List _buildFlippedCard(Server srv) { - const textStyle = TextStyle(color: Colors.grey); + Widget _buildFlippedCard(Server srv) { + const color = Colors.grey; + const textStyle = TextStyle(fontSize: 13, color: color); final children = [ Btn.column( onTap: () => _askFor( @@ -374,7 +371,7 @@ class _ServerPageState extends State typ: l10n.suspend, name: srv.spi.name, ), - icon: const Icon(Icons.stop, color: Colors.grey), + icon: const Icon(Icons.stop, color: color), text: l10n.suspend, textStyle: textStyle, ), @@ -388,7 +385,7 @@ class _ServerPageState extends State typ: l10n.shutdown, name: srv.spi.name, ), - icon: const Icon(Icons.power_off, color: Colors.grey), + icon: const Icon(Icons.power_off, color: color), text: l10n.shutdown, textStyle: textStyle, ), @@ -402,29 +399,29 @@ class _ServerPageState extends State typ: l10n.reboot, name: srv.spi.name, ), - icon: const Icon(Icons.restart_alt, color: Colors.grey), + icon: const Icon(Icons.restart_alt, color: color), text: l10n.reboot, textStyle: textStyle, ), Btn.column( onTap: () => ServerEditPage.route.go(context, args: srv.spi), - icon: const Icon(Icons.edit, color: Colors.grey), + icon: const Icon(Icons.edit, color: color), text: libL10n.edit, textStyle: textStyle, ) ]; final width = (_media.size.width - _cardPad) / children.length; - return [ - UIs.height13, - Row( + return Padding( + padding: const EdgeInsets.only(top: 9), + child: Row( mainAxisAlignment: MainAxisAlignment.spaceAround, children: children.map((e) { if (width == 0) return e; return SizedBox(width: width, child: e); }).toList(), ), - ]; + ); } List _buildNormalCard(ServerStatus ss, Spi spi) { @@ -463,11 +460,17 @@ class _ServerPageState extends State constraints: BoxConstraints(maxWidth: _media.size.width / 2.3), child: Hero( tag: 'home_card_title_${s.spi.id}', - child: Text( - s.spi.name, - style: UIs.text13Bold, - maxLines: 1, - overflow: TextOverflow.ellipsis, + transitionOnUserGestures: true, + child: Material( + color: Colors.transparent, + child: Text( + s.spi.name, + style: UIs.text13Bold.copyWith( + color: context.isDark ? Colors.white : Colors.black, + ), + maxLines: 1, + overflow: TextOverflow.ellipsis, + ), ), ), ),