From e99f14479392d6604e435987a8719ee62bad27e5 Mon Sep 17 00:00:00 2001 From: admin Date: Wed, 7 Oct 2026 22:44:28 +0800 Subject: [PATCH 1/2] =?UTF-8?q?feat(touch):=20=E5=8D=95=E6=8C=87=E7=82=B9?= =?UTF-8?q?=E9=80=89+=E6=8C=89=E4=BD=8F=E7=A7=BB=E5=8A=A8=E5=8A=A8?= =?UTF-8?q?=E4=BD=9C=E3=80=81=E7=AB=AF=E7=82=B9=E6=8A=8A=E6=89=8B=E6=8B=96?= =?UTF-8?q?=E6=8B=BD=E6=94=B9=E6=97=B6=E9=95=BF=EF=BC=88=E8=A7=A6=E5=B1=8F?= =?UTF-8?q?=E7=9B=AE=E6=A0=87=E5=8A=A0=E5=A4=A7=EF=BC=89=EF=BC=9B=E7=A9=BA?= =?UTF-8?q?=E7=99=BD=E5=8D=95=E6=8C=87=E4=B8=8D=E5=B9=B3=E7=A7=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 选中动作后两端绘制白色把手,端点抓取半径触屏 28px(桌面保持 8px 精确),命中容差 14px - 短条两端都够得着时抓离手指更近的一端,居中则整体移动 - 触屏空白单指不再平移画布(单指只做选择/编辑,双指捏合缩放+平移);Windows 操作模式不变 - 重建签名 APK --- BUILD-NOTES.md | 4 +++ README.md | 2 +- lib/layout/layout.dart | 15 ++++---- lib/render/bar_painter.dart | 18 ++++++++++ lib/render/circular_painter.dart | 15 ++++++++ lib/ui/canvas_view.dart | 60 ++++++++++++++++++++++---------- 6 files changed, 88 insertions(+), 26 deletions(-) diff --git a/BUILD-NOTES.md b/BUILD-NOTES.md index 75c8089..0410e98 100644 --- a/BUILD-NOTES.md +++ b/BUILD-NOTES.md @@ -168,6 +168,10 @@ flutter build apk --release # 产物:build\app\outputs\flutter-apk\app- - **桌面(Windows)文件保存**:仍使用应用内文件浏览器,默认起始目录为桌面, 并跨会话记忆上次使用的目录。 - **自动保存**:安卓落于应用私有缓存目录(仅用于崩溃恢复,不对外可见)。 +- **画布手势(触屏)**:单指点选选中动作;按住动作整体拖动 = 平移相位;选中后动作两端显示 + **白色把手**,抓把手拖拽 = 改起止角 / 时长(端点抓取半径加大到 28dp,命中容差加大); + 空白区域单指不平移;**双指捏合缩放、双指拖拽平移**。桌面端保持原操作模式 + (鼠标拖拽平移画布、Ctrl+滚轮缩放、端部 8px 精确抓取)。 - **侧栏**:触屏默认收起为贴边把手(点把手直接停靠展开);面板宽度随屏幕动态压缩, 窄屏双侧栏停靠也不溢出。 - **系统栏**:edge-to-edge,状态栏/导航栏区域由工具栏/状态栏底色填满(全屏无黑边), diff --git a/README.md b/README.md index 02de04a..2d61f83 100644 --- a/README.md +++ b/README.md @@ -93,7 +93,7 @@ Flutter 3.29+(Desktop) · CustomPainter 自绘 · Riverpod · 不可变模 - **无 license 授权**(面向应用商店分发);包名 `cc.sincos.sequence_diagram`,应用名「时序图设计器」; - **文件保存**:工程 / SVG / PNG 保存到平板可见的公共目录(默认 `Documents/SequenceDiagram`,可在保存对话框「更改位置」中选择文档/下载/图片 + 自定义子文件夹;Android 10+ 走 MediaStore,无需权限); - **导出格式**:固定 **1920×1080**,标题恒定左上、图例恒定左下,内容按包围盒自适应缩放居中(SVG / PNG 一致,exe 与安卓一致); -- **触控手势**:画布支持**双指捏合缩放 / 双指平移**(以捏合焦点为锚点),单指拖拽编辑不变;全屏无黑边(状态栏/导航栏区域融入界面); +- **触控手势**:**单指点选选中动作,按住整体拖动移动**;选中后两端显示白色把手,抓把手拖动改时长(抓取目标加大);**双指捏合缩放 / 双指平移**(以捏合焦点为锚点);空白单指不平移;全屏无黑边(状态栏/导航栏区域融入界面); - **正式签名**:release 用独立 keystore 签名(`android/key/release.jks`,见 `BUILD-NOTES.md`),更新安装无需卸载重装; - **构建**:JDK 17 + Android SDK 36(详见 `BUILD-NOTES.md`),Gradle 与 Maven 已配置国内镜像: ```bash diff --git a/lib/layout/layout.dart b/lib/layout/layout.dart index 59b6f3d..fc4d2b6 100644 --- a/lib/layout/layout.dart +++ b/lib/layout/layout.dart @@ -190,11 +190,12 @@ class BarLayout { /// 命中测试:返回坐标 [p] 处最上层的动作,未命中返回 null。 /// - /// 从后往前遍历(后绘制的在上层),并向外膨胀 4px 提升可点性。 - Action? hitTest(Offset p) { + /// 从后往前遍历(后绘制的在上层),并按 [slop] 向外膨胀矩形提升可点性 + /// (触屏平台可传入更大的容差)。 + Action? hitTest(Offset p, {double slop = 4}) { for (int i = ordered.length - 1; i >= 0; i--) { final Action a = ordered[i]; - final Rect r = rectFor(a).inflate(4); + final Rect r = rectFor(a).inflate(slop); if (r.contains(p)) return a; } return null; @@ -281,16 +282,16 @@ class CircularLayout { /// 命中测试:返回坐标 [p] 命中的动作,未命中返回 null。 /// /// 算法:计算点相对圆心的距离 [d] 与角度 [a];遍历所有动作,先按径向 - /// 距离过滤(与所在环的偏差不超过半个环宽 + 3px),再判断角度是否落在 - /// 该动作弧段内;在候选中取径向偏差最小者。 - Action? hitTest(Offset p) { + /// 距离过滤(与所在环的偏差不超过半个环宽 + [slop]),再判断角度是否落在 + /// 该动作弧段内;在候选中取径向偏差最小者(触屏平台可传入更大的容差)。 + Action? hitTest(Offset p, {double slop = 3}) { final double d = (p - center).distance; final double a = angleOf(center, p); Action? best; double bestDelta = double.infinity; for (final Action a2 in project.actions) { final double r = radiusFor(a2.layer); - if ((d - r).abs() > ringWidth / 2 + 3) continue; + if ((d - r).abs() > ringWidth / 2 + slop) continue; if (_inArc(a2, a)) { final double delta = (d - r).abs(); if (delta < bestDelta) { diff --git a/lib/render/bar_painter.dart b/lib/render/bar_painter.dart index f9cd544..7a3831b 100644 --- a/lib/render/bar_painter.dart +++ b/lib/render/bar_painter.dart @@ -360,6 +360,11 @@ class BarPainter extends CustomPainter { ..color = tokens.crit, ); } + // 选中时在两端绘制把手:提示可拖拽端点改时长(触屏目标更大、更好抓)。 + if (sel) { + _handle(canvas, Offset(r.left, r.center.dy)); + _handle(canvas, Offset(r.right, r.center.dy)); + } if (a.wrap && u.autoSplitWrap) { final double wx = layout.xFor(a.endAngle - 360) - layout.plotLeft; final Rect tail = Rect.fromLTWH(layout.plotLeft, r.top, math.max(wx, 2), r.height); @@ -389,6 +394,19 @@ class BarPainter extends CustomPainter { color: tokens.dim, size: 10, align: TextAlign.right); } + /// 绘制端点把手:白边圆点,提示可拖拽端点改时长。 + void _handle(Canvas canvas, Offset o) { + canvas.drawCircle(o, 6, Paint()..color = tokens.accent); + canvas.drawCircle( + o, + 6, + Paint() + ..style = PaintingStyle.stroke + ..strokeWidth = 2 + ..color = Colors.white, + ); + } + /// 绘制动作依赖连线(正交折线)。 /// /// 算法要点: diff --git a/lib/render/circular_painter.dart b/lib/render/circular_painter.dart index e4a1194..00b0c51 100644 --- a/lib/render/circular_painter.dart +++ b/lib/render/circular_painter.dart @@ -349,6 +349,21 @@ class CircularPainter extends CustomPainter { ..color = tokens.accent, ); } + // 选中时在弧两端绘制把手:提示可拖拽端点改持续角(触屏更好抓)。 + for (final Offset h in [ + polar(c, r, a.startAngle), + polar(c, r, math.min(a.endAngle, 360)), + ]) { + canvas.drawCircle(h, 6, Paint()..color = tokens.accent); + canvas.drawCircle( + h, + 6, + Paint() + ..style = PaintingStyle.stroke + ..strokeWidth = 2 + ..color = Colors.white, + ); + } } // 文字沿圆弧排列并按弧长截断,保证始终位于动作色带之内。 diff --git a/lib/ui/canvas_view.dart b/lib/ui/canvas_view.dart index d16cc81..26f4af9 100644 --- a/lib/ui/canvas_view.dart +++ b/lib/ui/canvas_view.dart @@ -7,6 +7,7 @@ // · 点选、双击新建、拖拽移动相位、拖拽端点改持续角、Shift 拖拽改层; // · 空白区域拖拽平移、Ctrl + 滚轮缩放; // · 右键上下文菜单。 +import 'dart:io' show Platform; import 'dart:math' as math; import 'package:flutter/gestures.dart'; @@ -85,6 +86,15 @@ class _CanvasViewState extends State { /// 捏合开始时的焦点(逻辑坐标),作为缩放锚点。 Offset _pinchFocalLogical = Offset.zero; + /// 是否触屏平台(Android / iOS):端点拖拽容差加大、空白单指不平移。 + bool get _touch => Platform.isAndroid || Platform.isIOS; + + /// 命中容差:触屏用更大的目标,桌面保持精确。 + double get _hitSlop => _touch ? 14 : 4; + + /// 动作端点(两端把手)的抓取半径:触屏显著加大,避免误判为平移。 + double get _grabRadius => _touch ? 28 : 8; + /// 控制器快捷访问器。 AppController get c => widget.controller; @@ -97,7 +107,7 @@ class _CanvasViewState extends State { final List zones = c.project.phaseZones; int best = -1; bool bestStart = false; - double bestDist = 9; + double bestDist = _touch ? 24 : 9; for (int i = 0; i < zones.length; i++) { final double xs = layout.xFor(zones[i].startAngle); final double xe = layout.xFor(zones[i].endAngle); @@ -256,8 +266,8 @@ class _CanvasViewState extends State { void _onTapDown(TapDownDetails d, Size size) { final Offset p = _toLogical(d.localPosition, size); final Action? hit = c.project.viewState.mode == ViewMode.bar - ? BarLayout(c.project, size).hitTest(p) - : CircularLayout(c.project, size).hitTest(p); + ? BarLayout(c.project, size).hitTest(p, slop: _hitSlop) + : CircularLayout(c.project, size).hitTest(p, slop: _hitSlop); // Ctrl(或 Shift)点击:切换该动作的选中状态,实现多选。 final bool toggle = HardwareKeyboard.instance.isControlPressed || HardwareKeyboard.instance.isShiftPressed; @@ -277,8 +287,8 @@ class _CanvasViewState extends State { } } final Action? hit = c.project.viewState.mode == ViewMode.bar - ? BarLayout(c.project, size).hitTest(p) - : CircularLayout(c.project, size).hitTest(p); + ? BarLayout(c.project, size).hitTest(p, slop: _hitSlop) + : CircularLayout(c.project, size).hitTest(p, slop: _hitSlop); // 双击动作色块 / 圆弧:进入该动作的编辑对话框。 if (hit != null) { showDialog( @@ -298,8 +308,10 @@ class _CanvasViewState extends State { } /// 拖拽开始:判断落点是否命中动作。 - /// 条形视图下靠近动作右端 8px 视为“调整持续角”,否则为“平移相位”; - /// 圆周视图下统一为“平移相位”。未命中则进入画布平移模式。 + /// 条形视图下靠近动作端部([_grabRadius],触屏显著加大)视为“调整持续角 / 起始角”, + /// 否则为“平移相位”;圆周视图同理。未命中动作时: + /// - 桌面:进入画布平移模式; + /// - 触屏:不平移(单指只做选择 / 编辑,平移缩放交给双指)。 void _onPanStart(Offset p, Size size) { if (c.project.viewState.mode == ViewMode.bar) { final BarLayout layout = BarLayout(c.project, size); @@ -313,14 +325,25 @@ class _CanvasViewState extends State { _startPointer = p; return; } - final Action? hit = layout.hitTest(p); + final Action? hit = layout.hitTest(p, slop: _hitSlop); if (hit != null) { final Rect r = layout.rectFor(hit); - final bool nearRight = (p.dx - r.right).abs() <= 8; - final bool nearLeft = (p.dx - r.left).abs() <= 8; - _mode = nearRight - ? _DragMode.resize - : (nearLeft ? _DragMode.resizeStart : _DragMode.move); + final double dr = (p.dx - r.right).abs(); + final double dl = (p.dx - r.left).abs(); + final bool nearRight = dr <= _grabRadius; + final bool nearLeft = dl <= _grabRadius; + if (nearRight && nearLeft) { + // 两端都够得着(短条):抓离手指更近的一端;几乎居中则整体移动。 + _mode = dr < dl - 6 + ? _DragMode.resize + : (dl < dr - 6 ? _DragMode.resizeStart : _DragMode.move); + } else if (nearRight) { + _mode = _DragMode.resize; + } else if (nearLeft) { + _mode = _DragMode.resizeStart; + } else { + _mode = _DragMode.move; + } _dragAction = hit; _startPointer = p; _startAngle = hit.startAngle; @@ -330,12 +353,12 @@ class _CanvasViewState extends State { } } else { final CircularLayout layout = CircularLayout(c.project, size); - final Action? hit = layout.hitTest(p); + final Action? hit = layout.hitTest(p, slop: _hitSlop); if (hit != null) { final double a = angleOf(layout.center, p); final double rad = (p - layout.center).distance; - // 距端点约 9px 以内视为拖拽端点(改起止角),否则整体旋转。 - final double tolDeg = math.atan2(9, math.max(rad, 1)) * 180 / math.pi; + // 距端点 [grabRadius] 以内视为拖拽端点(改起止角),否则整体旋转。 + final double tolDeg = math.atan2(_grabRadius, math.max(rad, 1)) * 180 / math.pi; final bool nearStart = _angleNear(a, hit.startAngle, tolDeg); final bool nearEnd = _angleNear(a, math.min(hit.endAngle, 360), tolDeg); _mode = nearStart @@ -368,9 +391,10 @@ class _CanvasViewState extends State { c.movePhaseZoneBoundary(_zoneIndex, _zoneIsStart, angle); return; } - // 未命中动作:整幅画布跟随指针平移。 + // 未命中动作:桌面端整幅画布跟随指针平移;触屏端不平移 + // (单指只做选择 / 编辑,平移与缩放交给双指捏合)。 if (_dragAction == null) { - c.panBy(screenDelta); + if (!_touch) c.panBy(screenDelta); return; } final bool shift = HardwareKeyboard.instance.isShiftPressed; From aed6292f010892e1bc132a2a64912c1a704f54de Mon Sep 17 00:00:00 2001 From: admin Date: Wed, 7 Oct 2026 23:01:53 +0800 Subject: [PATCH 2/2] =?UTF-8?q?feat:=20=E7=89=88=E6=9C=AC=E5=8D=87?= =?UTF-8?q?=E7=BA=A7=20V1.0.2=EF=BC=9B=E5=AE=8C=E5=96=84=E3=80=8C=E5=85=B3?= =?UTF-8?q?=E4=BA=8E/=E5=B8=AE=E5=8A=A9=E3=80=8D=E9=A1=B5=EF=BC=88?= =?UTF-8?q?=E5=88=86=E5=B9=B3=E5=8F=B0=E6=98=BE=E7=A4=BA=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 版本 1.0.2+4(Android versionCode 4,可覆盖安装) - 关于页重构:Logo + 名称/版本/平台;安卓显示「已授权(平板版免授权)」与保存位置说明,桌面显示授权状态/MAC/授权指南;官网入口安卓走原生 Intent - 帮助中心「界面与快捷键」按平台显示触屏操作说明(单指点选/按住移动/端点把手改时长/双指缩放平移) - 重建 dist 与签名 APK(release/sequence_diagram_tablet_v1.0.2_release.apk) --- BUILD-NOTES.md | 2 +- README.md | 6 +- .../sincos/sequence_diagram/MainActivity.kt | 14 ++ lib/persistence/android_docs.dart | 7 + lib/ui/dialogs.dart | 135 +++++++++++++----- pubspec.yaml | 2 +- 6 files changed, 125 insertions(+), 41 deletions(-) diff --git a/BUILD-NOTES.md b/BUILD-NOTES.md index 0410e98..da74d45 100644 --- a/BUILD-NOTES.md +++ b/BUILD-NOTES.md @@ -127,7 +127,7 @@ flutter pub get flutter build apk --release # 产物:build\app\outputs\flutter-apk\app-release.apk ``` -- 发布包归档:`release\sequence_diagram_tablet_v1.0.1_release.apk`(universal:arm64-v8a / armeabi-v7a / x86_64)。 +- 发布包归档:`release\sequence_diagram_tablet_v1.0.2_release.apk`(universal:arm64-v8a / armeabi-v7a / x86_64)。 - 上架应用商店时建议在 `android\app\build.gradle.kts` 配置正式签名后再构建 AAB: `flutter build appbundle --release`。 - 应用名「时序图设计器」、包名 `cc.sincos.sequence_diagram`、launcher 图标由 diff --git a/README.md b/README.md index 2d61f83..1b8b0df 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ - **深色 / 浅色双主题**:右上角 ☀ / ☾ 一键切换,语义颜色不变,导出 SVG 与屏幕一致 - **导出 SVG**:矢量、分层、带语义 `id` / `data-*` 元数据,可直接进工艺卡与 MES -## 正式版 V1.1.1 +## 正式版 V1.0.2 **可运行的 Flutter Windows 桌面正式版**(源码在 `lib/`),设计人:呆头鹅。 @@ -97,7 +97,7 @@ Flutter 3.29+(Desktop) · CustomPainter 自绘 · Riverpod · 不可变模 - **正式签名**:release 用独立 keystore 签名(`android/key/release.jks`,见 `BUILD-NOTES.md`),更新安装无需卸载重装; - **构建**:JDK 17 + Android SDK 36(详见 `BUILD-NOTES.md`),Gradle 与 Maven 已配置国内镜像: ```bash - flutter build apk --release # 产物 → release/sequence_diagram_tablet_v1.0.1_release.apk + flutter build apk --release # 产物 → release/sequence_diagram_tablet_v1.0.2_release.apk ``` - **自测**:`test/tablet_layout_test.dart` 覆盖 1280×800、2560×1600、960×600、800×480、竖屏 800×1280、600×960 等 7 种分辨率的无溢出回归; - **demo 图**:`demo/tablet-*.png`(由 `test/tablet_screenshots_test.dart` 生成)。 @@ -113,6 +113,6 @@ Flutter 3.29+(Desktop) · CustomPainter 自绘 · Riverpod · 不可变模 - **软件**:时序图设计器 · Sequence Diagram Studio - **设计人**:呆头鹅 -- **版本**:V1.1.1 +- **版本**:V1.0.2 - **版权**:Copyright © 2026 呆头鹅。保留所有权利。 - **架构文档**:[`docs/ARCHITECTURE.md`](docs/ARCHITECTURE.md) · **使用帮助**:[`docs/HELP.md`](docs/HELP.md) diff --git a/android/app/src/main/kotlin/cc/sincos/sequence_diagram/MainActivity.kt b/android/app/src/main/kotlin/cc/sincos/sequence_diagram/MainActivity.kt index e692614..2c1dcca 100644 --- a/android/app/src/main/kotlin/cc/sincos/sequence_diagram/MainActivity.kt +++ b/android/app/src/main/kotlin/cc/sincos/sequence_diagram/MainActivity.kt @@ -1,6 +1,7 @@ package cc.sincos.sequence_diagram import android.content.ContentValues +import android.content.Intent import android.net.Uri import android.os.Build import android.os.Environment @@ -67,6 +68,19 @@ class MainActivity : FlutterActivity() { } } } + "openUrl" -> { + val url = call.argument("url") + if (url == null) { + result.error("ARGS", "url required", null) + } else { + try { + startActivity(Intent(Intent.ACTION_VIEW, Uri.parse(url))) + result.success(true) + } catch (e: Exception) { + result.error("OPEN", e.message, null) + } + } + } else -> result.notImplemented() } } diff --git a/lib/persistence/android_docs.dart b/lib/persistence/android_docs.dart index 0b15f9a..de303d3 100644 --- a/lib/persistence/android_docs.dart +++ b/lib/persistence/android_docs.dart @@ -117,4 +117,11 @@ class AndroidDocs { if (r == null) return null; return r as Uint8List; } + + /// 用系统浏览器打开网址(官网入口;安卓经原生 Intent)。 + static Future openUrl(String url) async { + try { + await _channel.invokeMethod('openUrl', {'url': url}); + } catch (_) {} + } } diff --git a/lib/ui/dialogs.dart b/lib/ui/dialogs.dart index 913c6f6..e02e575 100644 --- a/lib/ui/dialogs.dart +++ b/lib/ui/dialogs.dart @@ -18,6 +18,7 @@ import '../persistence/android_docs.dart'; import '../persistence/storage.dart'; import '../state/app_controller.dart'; import '../theme/tokens.dart'; +import 'app_logo.dart'; // ===================== 对话框等比缩放 ===================== @@ -2036,9 +2037,13 @@ class HelpDialog extends StatelessWidget { ['我要隐藏 / 显示侧栏', '工具栏右侧两个侧栏按钮,分别控制左、右侧栏。'], ['我要钉住侧栏', '侧栏标题右侧图钉:钉住=固定占位;取消钉住=悬浮,鼠标移开自动收起。'], ['边缘把手', '侧栏收起后画布边缘有细把手:悬停临时展开,点击固定显示。'], - ['拖拽 / 缩放', '左键拖拽平移相位;拖端点改时长;Shift+拖拽改层;Ctrl+滚轮缩放。'], + if (Platform.isAndroid) + ['触屏操作', '单指点选选中动作;按住动作整体拖动移动;选中后抓两端白色把手拖拽改时长;空白单指不平移;双指捏合缩放、双指拖拽平移。'] + else + ['拖拽 / 缩放', '左键拖拽平移相位;拖端点改时长;Shift+拖拽改层;Ctrl+滚轮缩放。'], ['双击编辑', '双击画布色块(条形块 / 圆弧)或左侧动作行 → 打开动作编辑对话框。'], - ['右键动作', '菜单:添加依赖 / 改层 / 复制 / 删除。'], + if (!Platform.isAndroid) + ['右键动作', '菜单:添加依赖 / 改层 / 复制 / 删除。'], ['撤销 / 保存', 'Ctrl+Z / Ctrl+Y 撤销重做;Ctrl+S 保存;Ctrl+O / Ctrl+N 打开 / 新建。'], ['帮助入口', '顶部工具栏右侧「?」或 F1 打开帮助中心;画布编辑工具条不重复放置帮助按钮。'], ['导出入口', '导出 SVG / PNG 统一放在顶部工具栏右侧,避免多处重复。'], @@ -2065,7 +2070,13 @@ class HelpDialog extends StatelessWidget { } /// 用系统默认程序打开网址(官网导航)。 + /// + /// 安卓经原生 Intent 打开浏览器;桌面用 rundll32 / start。 Future _openUrl(String url) async { + if (AndroidDocs.isAvailable) { + await AndroidDocs.openUrl(url); + return; + } try { await Process.run('rundll32', ['url.dll,FileProtocolHandler', url]); } catch (_) { @@ -2075,8 +2086,10 @@ class HelpDialog extends StatelessWidget { } } - /// 「关于」页:软件信息 + 授权状态 + 本机 MAC + 授权指南 + 官网入口。 + /// 「关于」页:软件信息 + 平台 / 授权状态 + 官网入口; + /// 桌面版追加授权指南(MAC 申请 .lic),平板版展示免授权与保存位置说明。 Widget _about(BuildContext context, Tokens t) { + final bool android = AndroidDocs.isAvailable; final LicenseInfo info = LicenseService.instance.info; final String lic = info.valid ? '已授权(${info.filePath?.split(RegExp(r'[\\/]')).last ?? '.lic'})' @@ -2096,21 +2109,43 @@ class HelpDialog extends StatelessWidget { ], ), ); - Widget guideLine(String s) => - Text(s, style: TextStyle(color: t.sub, fontSize: 11.5, height: 1.7)); + Widget guideLine(String s) => Text(s, style: TextStyle(color: t.sub, fontSize: 11.5, height: 1.7)); return ListView( padding: const EdgeInsets.only(top: 14), children: [ - row('软件名称', '时序图设计器 · Sequence Diagram Studio'), + Row( + children: [ + const AppLogo(size: 48), + const SizedBox(width: 14), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text('时序图设计器 · Sequence Diagram Studio', + style: TextStyle(color: t.text, fontSize: 15, fontWeight: FontWeight.w700)), + const SizedBox(height: 4), + Text('V1.0.2(${android ? 'Android 平板版' : 'Windows 桌面版'})', + style: TextStyle(color: t.dim, fontSize: 12)), + ], + ), + ), + ], + ), + const SizedBox(height: 14), row('设计人', '呆头鹅'), - row('版本', 'V1.1.1'), - row('授权状态', lic, vc: info.valid ? t.ok : t.danger), - // 注意:绝不能展示「期望授权串」——它等同于 .lic 内容,公开即可被绕过授权。 - row('本机 MAC', info.mac ?? '读取失败'), + row( + '授权状态', + android ? '已授权(平板版免授权)' : lic, + vc: (android || info.valid) ? t.ok : t.danger, + ), + if (!android) + // 注意:绝不能展示「期望授权串」——它等同于 .lic 内容,公开即可被绕过授权。 + row('本机 MAC', info.mac ?? '读取失败'), row('版权声明', 'Copyright © 2026 呆头鹅。保留所有权利。'), - row('用途', '面向 PLC 流程节拍 / 相位角设计;未经许可不得用于商业再分发。'), + row('产品简介', '面向 PLC 流程节拍 / 相位角设计的时序图工具:条形 / 圆周双视图、' + 'FS / SS 依赖与关键路径、SVG / PNG 导出,成果可直接进工艺卡与 MES。'), const SizedBox(height: 6), - // 官网入口(点击图标导航到 sincos.cc)。 + // 官网入口(点击导航到 sincos.cc)。 Row( children: [ InkWell( @@ -2131,31 +2166,59 @@ class HelpDialog extends StatelessWidget { ], ), const SizedBox(height: 10), - // 授权指南(替代原来的邮件申请按钮)。 - Container( - padding: const EdgeInsets.all(12), - decoration: BoxDecoration( - color: t.info, - borderRadius: BorderRadius.circular(10), - border: Border.all(color: t.line), + if (!android) + // 授权指南(桌面版:按本机 MAC 申请 .lic)。 + Container( + padding: const EdgeInsets.all(12), + decoration: BoxDecoration( + color: t.info, + borderRadius: BorderRadius.circular(10), + border: Border.all(color: t.line), + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + Icon(Icons.menu_book_outlined, size: 16, color: t.accent), + const SizedBox(width: 6), + Text('授权指南', style: TextStyle(color: t.accent, fontSize: 12.5, fontWeight: FontWeight.w600)), + ], + ), + const SizedBox(height: 8), + guideLine('1. 复制上方「本机 MAC」。'), + guideLine('2. 访问官网 sincos.cc,或把 MAC 发送到邮箱 liuyu65@126.com 申请授权。'), + guideLine('3. 收到 .lic 文件后,放入软件目录下的 license 文件夹,重启软件即可导出 SVG / PNG。'), + ], + ), + ) + else + // 平板版说明:免授权 + 保存位置 + 反馈方式。 + Container( + padding: const EdgeInsets.all(12), + decoration: BoxDecoration( + color: t.info, + borderRadius: BorderRadius.circular(10), + border: Border.all(color: t.line), + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + Icon(Icons.tablet_android, size: 16, color: t.accent), + const SizedBox(width: 6), + Text('平板版说明', style: TextStyle(color: t.accent, fontSize: 12.5, fontWeight: FontWeight.w600)), + ], + ), + const SizedBox(height: 8), + guideLine('本版面向应用商店分发,无需授权,全部功能可用。'), + guideLine('保存 / 导出文件位于平板「文件管理」可见的公共目录(默认 Documents/SequenceDiagram,' + '可在保存对话框中更改位置)。'), + guideLine('帮助与反馈:官网 sincos.cc 或邮箱 liuyu65@126.com。'), + ], + ), ), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - children: [ - Icon(Icons.menu_book_outlined, size: 16, color: t.accent), - const SizedBox(width: 6), - Text('授权指南', style: TextStyle(color: t.accent, fontSize: 12.5, fontWeight: FontWeight.w600)), - ], - ), - const SizedBox(height: 8), - guideLine('1. 复制上方「本机 MAC」。'), - guideLine('2. 访问官网 sincos.cc,或把 MAC 发送到邮箱 liuyu65@126.com 申请授权。'), - guideLine('3. 收到 .lic 文件后,放入软件目录下的 license 文件夹,重启软件即可导出 SVG / PNG。'), - ], - ), - ), ], ); } diff --git a/pubspec.yaml b/pubspec.yaml index beaef44..aecffbb 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -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.1.1+3 +version: 1.0.2+4 environment: sdk: ^3.13.3