3 Commits

Author SHA1 Message Date
admin 440e017203 fix(android): 修复 release 版无法联网(缺 INTERNET 权限);发布 v1.2.2
- 根因:Flutter 模板只在 debug/profile 清单中声明 INTERNET,release 包默认没有,
  导致发布版「检查更新」与「AI 生成」全部无法联网
- 主清单补充 INTERNET 权限,并新增 network_security_config:仅对更新服务器
  放行明文 HTTP(其余域名仍禁止)
- UpdateService.check 支持传入模拟版本(自检用);新增 tool/check_update.dart
  开发自检工具,可直接验证更新链路
- 版本号 1.2.2+14
2026-10-09 10:12:19 +08:00
admin 81d0d1768a feat(ui): 动作两端改为方头小圆角(长度即真实时长);更新图标按设计稿重绘
- 条形视图:动作条圆角 8→3,两端方头(仅小圆角),长度严格等于真实时长
- 圆周视图:动作弧改为填充弧带(方头 + 小圆角)替代圆头描边,
  消除「圆头端帽在两端各多出半个环宽」造成的长度误读
- SVG 导出同步:条块 rx=3、动作弧 stroke-linecap=butt,导出与屏幕一致
- 更新按钮图标按 docs/更新.svg 设计稿矢量重绘(圆环 + 上箭头 + 两条底座横杠),
  替换原来的 refresh 图标;更新对话框标题图标同步
- 右下角缩略预览(条形 / 圆周)动作线条细化至约 2px
- 版本 1.2.1+13
2026-10-09 09:49:23 +08:00
admin c32be46adb fix(scripts): publish_release.ps1 转 UTF-8 with BOM
Windows PowerShell 5.1 按 ANSI 解码无 BOM 的 .ps1,中文会导致语法错误;
加 BOM 后脚本可正常解析执行。
2026-10-08 21:54:23 +08:00
21 changed files with 253 additions and 48 deletions
+1 -1
View File
@@ -127,7 +127,7 @@ flutter pub get
flutter build apk --release # 产物:build\app\outputs\flutter-apk\app-release.apk flutter build apk --release # 产物:build\app\outputs\flutter-apk\app-release.apk
``` ```
- 发布包归档:`release\sequence_diagram_android_v1.2.0_release.apk`(**本地保留,不入库**;exe 的 `dist\` 同理)。 - 发布包归档:`release\sequence_diagram_android_v1.2.2_release.apk`(**本地保留,不入库**;exe 的 `dist\` 同理)。
- 上架应用商店时建议在 `android\app\build.gradle.kts` 配置正式签名后再构建 AAB: - 上架应用商店时建议在 `android\app\build.gradle.kts` 配置正式签名后再构建 AAB:
`flutter build appbundle --release`。 `flutter build appbundle --release`。
- 应用名「时序图设计」、包名 `cc.sincos.sequence_diagram`、launcher 图标由 - 应用名「时序图设计」、包名 `cc.sincos.sequence_diagram`、launcher 图标由
+3 -3
View File
@@ -9,7 +9,7 @@
- **深色 / 浅色双主题**:右上角 ☀ / ☾ 一键切换,语义颜色不变,导出 SVG 与屏幕一致 - **深色 / 浅色双主题**:右上角 ☀ / ☾ 一键切换,语义颜色不变,导出 SVG 与屏幕一致
- **导出 SVG**:矢量、分层、带语义 `id` / `data-*` 元数据,可直接进工艺卡与 MES - **导出 SVG**:矢量、分层、带语义 `id` / `data-*` 元数据,可直接进工艺卡与 MES
## 正式版 V1.2.0 ## 正式版 V1.2.2
**可运行的 Flutter Windows 桌面正式版**(源码在 `lib/`),设计人:呆头鹅。 **可运行的 Flutter Windows 桌面正式版**(源码在 `lib/`),设计人:呆头鹅。
@@ -97,7 +97,7 @@ Flutter 3.29+(Desktop) · CustomPainter 自绘 · Riverpod · 不可变模
- **正式签名**:release 用独立 keystore 签名(`android/key/release.jks`,见 `BUILD-NOTES.md`),更新安装无需卸载重装; - **正式签名**:release 用独立 keystore 签名(`android/key/release.jks`,见 `BUILD-NOTES.md`),更新安装无需卸载重装;
- **构建**:JDK 17 + Android SDK 36(详见 `BUILD-NOTES.md`),Gradle 与 Maven 已配置国内镜像: - **构建**:JDK 17 + Android SDK 36(详见 `BUILD-NOTES.md`),Gradle 与 Maven 已配置国内镜像:
```bash ```bash
flutter build apk --release # 产物 → release/sequence_diagram_android_v1.2.0_release.apk flutter build apk --release # 产物 → release/sequence_diagram_android_v1.2.2_release.apk
``` ```
- **自测**:`test/tablet_layout_test.dart` 覆盖 1280×800、2560×1600、960×600、800×480、竖屏 800×1280、600×960 等 7 种分辨率的无溢出回归; - **自测**:`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` 生成)。 - **demo 图**:`demo/tablet-*.png`(由 `test/tablet_screenshots_test.dart` 生成)。
@@ -113,6 +113,6 @@ Flutter 3.29+(Desktop) · CustomPainter 自绘 · Riverpod · 不可变模
- **软件**:时序图设计 · Sequence Diagram Studio - **软件**:时序图设计 · Sequence Diagram Studio
- **设计人**:呆头鹅 - **设计人**:呆头鹅
- **版本**:V1.2.0 - **版本**:V1.2.2
- **版权**:Copyright © 2026 呆头鹅。保留所有权利。 - **版权**:Copyright © 2026 呆头鹅。保留所有权利。
- **架构文档**:[`docs/ARCHITECTURE.md`](docs/ARCHITECTURE.md) · **使用帮助**:[`docs/HELP.md`](docs/HELP.md) - **架构文档**:[`docs/ARCHITECTURE.md`](docs/ARCHITECTURE.md) · **使用帮助**:[`docs/HELP.md`](docs/HELP.md)
+3
View File
@@ -3,9 +3,12 @@
<uses-permission <uses-permission
android:name="android.permission.WRITE_EXTERNAL_STORAGE" android:name="android.permission.WRITE_EXTERNAL_STORAGE"
android:maxSdkVersion="28" /> android:maxSdkVersion="28" />
<!-- 应用内更新 / AI 生成:网络访问(release 包必须显式声明,否则无法联网)。 -->
<uses-permission android:name="android.permission.INTERNET" />
<!-- 应用内更新:允许拉起系统安装器安装新版本 APK(Android 8.0+)。 --> <!-- 应用内更新:允许拉起系统安装器安装新版本 APK(Android 8.0+)。 -->
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" /> <uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
<application <application
android:networkSecurityConfig="@xml/network_security_config"
android:label="时序图设计" android:label="时序图设计"
android:name="${applicationName}" android:name="${applicationName}"
android:icon="@mipmap/ic_launcher"> android:icon="@mipmap/ic_launcher">
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- 应用内更新:仅对本项目更新服务器的明文 HTTP 放行(其余域名仍禁止明文)。 -->
<network-security-config>
<domain-config cleartextTrafficPermitted="true">
<domain includeSubdomains="false">124.220.63.9</domain>
</domain-config>
</network-security-config>
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 8.6 KiB

+1
View File
@@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1791509219509" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6625" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M512 66c246.319 0 446 199.681 446 446S758.319 958 512 958 66 758.319 66 512 265.681 66 512 66z m0 59.773c-213.307 0-386.227 172.92-386.227 386.227S298.693 898.227 512 898.227 898.227 725.307 898.227 512 725.307 125.773 512 125.773z m128.12 636.815c16.506 0 29.887 13.38 29.887 29.886 0 16.27-13.001 29.504-29.181 29.879l-0.705 0.008H390.156c-16.506 0-29.887-13.38-29.887-29.887 0-16.27 13.001-29.503 29.181-29.878l0.706-0.008H640.12z m0-92.135c16.506 0 29.887 13.381 29.887 29.887 0 16.27-13.001 29.504-29.181 29.878l-0.705 0.008H390.156c-16.506 0-29.887-13.38-29.887-29.886 0-16.27 13.001-29.504 29.181-29.879l0.706-0.008H640.12zM494.114 207.261c11.503-10.613 29.245-10.554 40.677 0.135l247.338 231.266c19.804 18.517 6.7 51.717-20.412 51.717H658.61v118.087c0 16.27-13 29.503-29.18 29.878l-0.706 0.008H398.532c-16.506 0-29.887-13.38-29.887-29.886l-0.002-118.088H263.711c-26.937 0-40.002-32.737-20.856-51.294l0.59-0.558z m20.128 62.752L340.177 430.605h58.355c16.27 0 29.504 13.001 29.878 29.182l0.008 0.705-0.002 118.086h170.42l0.002-118.086c0-16.27 13-29.504 29.18-29.878l0.706-0.009h57.269L514.24 270.013z" fill="#333333" p-id="6626"></path></svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

+2 -2
View File
@@ -144,7 +144,7 @@ class SvgWriter {
final Color c = Color(a.color); final Color c = Color(a.color);
_b.write('<g id="${_esc(a.id)}" data-action="${_esc(a.id)}" data-start="${a.startAngle}" ' _b.write('<g id="${_esc(a.id)}" data-action="${_esc(a.id)}" data-start="${a.startAngle}" '
'data-duration="${a.durationAngle}" data-layer="${a.layer}" data-station="${_esc(a.stationId)}">'); 'data-duration="${a.durationAngle}" data-layer="${a.layer}" data-station="${_esc(a.stationId)}">');
_rect(r.left, r.top, r.width, r.height, fill: _hex(c), rx: 7, opacity: 0.92); _rect(r.left, r.top, r.width, r.height, fill: _hex(c), rx: 3, opacity: 0.92);
_text(r.left + 8, r.center.dy + 4, '${a.name} ${tfmt(a.durationAngle / 360 * cycle, u)}', _text(r.left + 8, r.center.dy + 4, '${a.name} ${tfmt(a.durationAngle / 360 * cycle, u)}',
color: _hex(tokens.arcText), size: 12, weight: '700'); color: _hex(tokens.arcText), size: 12, weight: '700');
_b.write('</g>'); _b.write('</g>');
@@ -231,7 +231,7 @@ class SvgWriter {
'data-duration="${a.durationAngle}" data-layer="${a.layer}" data-station="${_esc(a.stationId)}">'); 'data-duration="${a.durationAngle}" data-layer="${a.layer}" data-station="${_esc(a.stationId)}">');
for (final List<double> s in splitArcs(a.startAngle, a.endAngle)) { for (final List<double> s in splitArcs(a.startAngle, a.endAngle)) {
final String d = _arc(c, r, s[0], s[1]); final String d = _arc(c, r, s[0], s[1]);
_b.write('<path d="$d" fill="none" stroke="${_hex(col)}" stroke-width="$th" stroke-linecap="round"/>'); _b.write('<path d="$d" fill="none" stroke="${_hex(col)}" stroke-width="$th" stroke-linecap="butt"/>');
} }
final Offset mp = polar(c, r, (a.startAngle + a.endAngle) / 2); final Offset mp = polar(c, r, (a.startAngle + a.endAngle) / 2);
_text(mp.dx, mp.dy, '${a.id} ${a.name}', color: _hex(tokens.arcText), size: 12, anchor: 'middle', weight: '700'); _text(mp.dx, mp.dy, '${a.id} ${a.name}', color: _hex(tokens.arcText), size: 12, anchor: 'middle', weight: '700');
+5 -5
View File
@@ -337,15 +337,15 @@ class BarPainter extends CustomPainter {
final bool sel = selectedIds.contains(a.id); final bool sel = selectedIds.contains(a.id);
final bool crit = criticalActions.contains(a.id); final bool crit = criticalActions.contains(a.id);
canvas.drawRRect( canvas.drawRRect(
RRect.fromRectAndRadius(r.shift(const Offset(1.5, 2)), const Radius.circular(8)), RRect.fromRectAndRadius(r.shift(const Offset(1.5, 2)), const Radius.circular(3)),
Paint()..color = tokens.shadow.withValues(alpha: tokens.shadowOp), Paint()..color = tokens.shadow.withValues(alpha: tokens.shadowOp),
); );
canvas.drawRRect( canvas.drawRRect(
RRect.fromRectAndRadius(r, const Radius.circular(8)), RRect.fromRectAndRadius(r, const Radius.circular(3)),
Paint()..color = c.withValues(alpha: 0.92), Paint()..color = c.withValues(alpha: 0.92),
); );
canvas.drawRRect( canvas.drawRRect(
RRect.fromRectAndRadius(r, const Radius.circular(8)), RRect.fromRectAndRadius(r, const Radius.circular(3)),
Paint() Paint()
..style = PaintingStyle.stroke ..style = PaintingStyle.stroke
..strokeWidth = 1 ..strokeWidth = 1
@@ -353,7 +353,7 @@ class BarPainter extends CustomPainter {
); );
if (crit) { if (crit) {
canvas.drawRRect( canvas.drawRRect(
RRect.fromRectAndRadius(r, const Radius.circular(8)), RRect.fromRectAndRadius(r, const Radius.circular(3)),
Paint() Paint()
..style = PaintingStyle.stroke ..style = PaintingStyle.stroke
..strokeWidth = 2 ..strokeWidth = 2
@@ -369,7 +369,7 @@ class BarPainter extends CustomPainter {
final double wx = layout.xFor(a.endAngle - 360) - layout.plotLeft; 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); final Rect tail = Rect.fromLTWH(layout.plotLeft, r.top, math.max(wx, 2), r.height);
canvas.drawRRect( canvas.drawRRect(
RRect.fromRectAndRadius(tail, const Radius.circular(8)), RRect.fromRectAndRadius(tail, const Radius.circular(3)),
Paint()..color = c.withValues(alpha: tokens.tailOp), Paint()..color = c.withValues(alpha: tokens.tailOp),
); );
_text(canvas, '跨循环延续 ${(a.endAngle - 360).toStringAsFixed(0)}°', _text(canvas, '跨循环延续 ${(a.endAngle - 360).toStringAsFixed(0)}°',
+63 -17
View File
@@ -310,25 +310,13 @@ class CircularPainter extends CustomPainter {
for (int k = 0; k < segs.length; k++) { for (int k = 0; k < segs.length; k++) {
// 第二段且为跨循环时视为“尾巴”,需淡化处理。 // 第二段且为跨循环时视为“尾巴”,需淡化处理。
final bool tail = a.wrap && k == 1; final bool tail = a.wrap && k == 1;
final Path p = arcPath(c, r, segs[k][0], segs[k][1]); // 方头 + 小圆角:路径角度严格等于真实起止角,弧带长度即真实时长
//(原来的圆头端帽会在两端各多出半个环宽,造成长度误读)。
final Path p = _bandPath(c, r, th, segs[k][0], segs[k][1], 3);
// 圆周色块不加描边 / 阴影,保持干净。 // 圆周色块不加描边 / 阴影,保持干净。
canvas.drawPath( canvas.drawPath(p, Paint()..color = col.withValues(alpha: tail ? tokens.tailOp : 1));
p,
Paint()
..style = PaintingStyle.stroke
..strokeWidth = th
..strokeCap = a.wrap ? StrokeCap.butt : StrokeCap.round
..color = col.withValues(alpha: tail ? tokens.tailOp : 1),
);
if (tail) { if (tail) {
canvas.drawPath( canvas.drawPath(p, Paint()..color = col.withValues(alpha: 0.9));
p,
Paint()
..style = PaintingStyle.stroke
..strokeWidth = th
..strokeCap = StrokeCap.butt
..color = col.withValues(alpha: 0.9),
);
} }
} }
if (crit) { if (crit) {
@@ -377,6 +365,64 @@ class CircularPainter extends CustomPainter {
_arcLabel(canvas, c, r, mid, '$step. ${a.id} ${a.name}', tokens.arcText, 11, math.max(arcLen - 12, 20)); _arcLabel(canvas, c, r, mid, '$step. ${a.id} ${a.name}', tokens.arcText, 11, math.max(arcLen - 12, 20));
} }
/// 构造「方头 + 小圆角」的圆环动作带(填充路径)。
///
/// 与「圆头描边」不同,路径覆盖的角度范围严格等于 [a0] → [a1](顺时针):
/// 两端为径向直边、四角带 [cornerR] 的小圆角,因此弧带的长度就是动作的
/// 真实时长,不会再像圆头端帽那样在两端各多出半个环宽造成长度误读。
Path _bandPath(Offset c, double r, double w, double a0, double a1, double cornerR) {
final double ro = r + w / 2;
final double ri = r - w / 2;
final double rc = math.min(cornerR, w / 2 - 0.5);
final double span = a1 - a0;
final Path p = Path();
if (rc <= 0.5 || span <= 0.5) {
// 退化情形:直接方头四边形。
final Offset a = polar(c, ro, a0);
p.moveTo(a.dx, a.dy);
final Offset b = polar(c, ro, a1);
p.lineTo(b.dx, b.dy);
final Offset d = polar(c, ri, a1);
p.lineTo(d.dx, d.dy);
final Offset e = polar(c, ri, a0);
p.lineTo(e.dx, e.dy);
p.close();
return p;
}
// 小圆角在内 / 外缘占用的角向宽度(度),不超过跨度的 40%。
final double dOut = math.min(rc / ro * 180 / math.pi, span * 0.4);
final double dIn = math.min(rc / ri * 180 / math.pi, span * 0.4);
final Offset oStart = polar(c, ro, a0 + dOut);
final Offset oEnd = polar(c, ro, a1 - dOut);
final Offset iEnd = polar(c, ri, a1 - dIn);
final Offset iStart = polar(c, ri, a0 + dIn);
p.moveTo(oStart.dx, oStart.dy);
// 外缘弧(顺时针)
p.arcToPoint(oEnd,
radius: Radius.circular(ro), largeArc: span - 2 * dOut > 180, clockwise: true);
// 尾端:外角 → 小圆角 → 端面 → 小圆角 → 内缘
final Offset co = polar(c, ro, a1);
final Offset fo = polar(c, ro - rc, a1);
p.quadraticBezierTo(co.dx, co.dy, fo.dx, fo.dy);
final Offset fi = polar(c, ri + rc, a1);
p.lineTo(fi.dx, fi.dy);
final Offset ci = polar(c, ri, a1);
p.quadraticBezierTo(ci.dx, ci.dy, iEnd.dx, iEnd.dy);
// 内缘弧(逆时针返回)
p.arcToPoint(iStart,
radius: Radius.circular(ri), largeArc: span - 2 * dIn > 180, clockwise: false);
// 起始端:内角 → 小圆角 → 端面 → 小圆角 → 外角
final Offset ci0 = polar(c, ri, a0);
final Offset fi0 = polar(c, ri + rc, a0);
p.quadraticBezierTo(ci0.dx, ci0.dy, fi0.dx, fi0.dy);
final Offset fo0 = polar(c, ro - rc, a0);
p.lineTo(fo0.dx, fo0.dy);
final Offset co0 = polar(c, ro, a0);
p.quadraticBezierTo(co0.dx, co0.dy, oStart.dx, oStart.dy);
p.close();
return p;
}
/// 绘制圆形视图中的依赖连线。 /// 绘制圆形视图中的依赖连线。
/// ///
/// 路径由四段组成:从源弧末端沿半径到中间半径 [rC] → 沿圆弧走到目标弧 /// 路径由四段组成:从源弧末端沿半径到中间半径 [rC] → 沿圆弧走到目标弧
+20 -7
View File
@@ -30,6 +30,7 @@ import 'canvas_overlays.dart';
import 'canvas_view.dart'; import 'canvas_view.dart';
import 'dialogs.dart'; import 'dialogs.dart';
import 'update_dialog.dart'; import 'update_dialog.dart';
import 'update_icon.dart';
/// 应用外壳组件:承载主界面布局与文件/侧栏等交互逻辑。 /// 应用外壳组件:承载主界面布局与文件/侧栏等交互逻辑。
class AppShell extends StatefulWidget { class AppShell extends StatefulWidget {
@@ -458,15 +459,12 @@ class _AppShellState extends State<AppShell> {
} }
} }
/// 更新检查按钮。 /// 更新检查按钮:圆环 + 上箭头 + 底座(按 docs/更新.png 的设计绘制);
/// /// 检测到新版本时叠加红色角标。
/// 空闲态用环形箭头(检查更新,中文软件的通用语义);
/// 检测到新版本时换成下载图标并叠加红色角标,一眼可辨「有新版本可下载」。
Widget _updateBtn(Tokens t) { Widget _updateBtn(Tokens t) {
final UpdateInfo? info = _update; final UpdateInfo? info = _update;
final Widget btn = _iconBtn( final Widget btn = _iconWidgetBtn(
t, UpdateIcon(size: 18 * _toolScale, color: t.text),
info == null ? Icons.refresh : Icons.download,
_openUpdate, _openUpdate,
tooltip: info == null ? '检查更新' : '发现新版本 v${info.version}', tooltip: info == null ? '检查更新' : '发现新版本 v${info.version}',
); );
@@ -889,6 +887,21 @@ class _AppShellState extends State<AppShell> {
); );
} }
/// 自定义图标组件版按钮(用于更新按钮的矢量图标):
/// 尺寸与点按区域与 [_iconBtn] 完全一致。
Widget _iconWidgetBtn(Widget icon, VoidCallback? onTap, {String? tooltip}) {
final double s = _toolScale;
return IconButton(
onPressed: onTap,
icon: icon,
tooltip: tooltip,
splashRadius: 16 * s,
padding: EdgeInsets.zero,
constraints: BoxConstraints(minWidth: 34 * s, minHeight: 34 * s),
style: IconButton.styleFrom(tapTargetSize: s < 1 ? MaterialTapTargetSize.shrinkWrap : null),
);
}
// ===================== 侧栏停靠状态机(钉住 / 悬浮 / 轨道) ===================== // ===================== 侧栏停靠状态机(钉住 / 悬浮 / 轨道) =====================
/// 侧栏标题栏控制按钮:切换钉住状态与隐藏侧栏。 /// 侧栏标题栏控制按钮:切换钉住状态与隐藏侧栏。
+7 -5
View File
@@ -763,20 +763,21 @@ class _MiniBarPainter extends CustomPainter {
final double w = size.width - 4; final double w = size.width - 4;
// 行高按可用高度自适应,保证小预览里也排得下。 // 行高按可用高度自适应,保证小预览里也排得下。
final double pitch = n == 0 ? 12 : math.min(12, (size.height - 16) / n); final double pitch = n == 0 ? 12 : math.min(12, (size.height - 16) / n);
final double rh = math.max(pitch - 3, 4); // 缩略图里的动作条只是一条细线(约 2px),并在行内垂直居中。
final double rh = math.min(2.0, math.max(pitch * 0.5, 1.6));
for (int i = 0; i < n; i++) { for (int i = 0; i < n; i++) {
final Action a = project.actions[i]; final Action a = project.actions[i];
final double y = i * pitch; final double y = i * pitch + (pitch - rh) / 2;
final double x1 = 2 + a.startAngle / 360 * w; final double x1 = 2 + a.startAngle / 360 * w;
final double x2 = 2 + math.min(a.endAngle, 360) / 360 * w; final double x2 = 2 + math.min(a.endAngle, 360) / 360 * w;
final RRect r = RRect.fromRectAndRadius( final RRect r = RRect.fromRectAndRadius(
Rect.fromLTWH(x1, y, math.max(x2 - x1, 2), rh), Rect.fromLTWH(x1, y, math.max(x2 - x1, 2), rh),
const Radius.circular(2), Radius.circular(rh / 2),
); );
canvas.drawRRect(r, Paint()..color = Color(a.color).withValues(alpha: 0.9)); canvas.drawRRect(r, Paint()..color = Color(a.color).withValues(alpha: 0.9));
if (a.wrap) { if (a.wrap) {
canvas.drawRRect( canvas.drawRRect(
RRect.fromRectAndRadius(Rect.fromLTWH(2, y, (a.endAngle - 360) / 360 * w, rh), const Radius.circular(2)), RRect.fromRectAndRadius(Rect.fromLTWH(2, y, (a.endAngle - 360) / 360 * w, rh), Radius.circular(rh / 2)),
Paint()..color = Color(a.color).withValues(alpha: t.tailOp), Paint()..color = Color(a.color).withValues(alpha: t.tailOp),
); );
} }
@@ -865,7 +866,8 @@ class _MiniCircularPainter extends CustomPainter {
final double maxR = math.max(math.min(size.width, size.height) / 2 - 24, 24); final double maxR = math.max(math.min(size.width, size.height) / 2 - 24, 24);
final double r0 = n <= 1 ? maxR * 0.6 : maxR * 0.34; final double r0 = n <= 1 ? maxR * 0.6 : maxR * 0.34;
final double pitch = n <= 1 ? 0 : (maxR - r0) / (n - 1); final double pitch = n <= 1 ? 0 : (maxR - r0) / (n - 1);
final double pw = (pitch == 0 ? 10.0 : pitch * 0.5).clamp(6.0, 13.0); // 缩略图里的环与动作弧只需一条细线(约 2px)。
final double pw = 2.0;
canvas.drawCircle(c, r0 + (n - 1) * pitch + pw / 2, Paint()..color = t.dial); canvas.drawCircle(c, r0 + (n - 1) * pitch + pw / 2, Paint()..color = t.dial);
for (int i = 0; i < n; i++) { for (int i = 0; i < n; i++) {
final Action a = project.actions[i]; final Action a = project.actions[i];
+1 -1
View File
@@ -2124,7 +2124,7 @@ class HelpDialog extends StatelessWidget {
Text('时序图设计 · Sequence Diagram Studio', Text('时序图设计 · Sequence Diagram Studio',
style: TextStyle(color: t.text, fontSize: 15, fontWeight: FontWeight.w700)), style: TextStyle(color: t.text, fontSize: 15, fontWeight: FontWeight.w700)),
const SizedBox(height: 4), const SizedBox(height: 4),
Text('V1.2.0(${android ? '安卓版' : 'Windows 版'})', Text('V1.2.2(${android ? '安卓版' : 'Windows 版'})',
style: TextStyle(color: t.dim, fontSize: 12)), style: TextStyle(color: t.dim, fontSize: 12)),
], ],
), ),
+2 -1
View File
@@ -17,6 +17,7 @@ import '../theme/tokens.dart';
import '../update/update_service.dart'; import '../update/update_service.dart';
import '../version.dart'; import '../version.dart';
import 'dialogs.dart'; import 'dialogs.dart';
import 'update_icon.dart';
/// 应用内更新对话框。 /// 应用内更新对话框。
class UpdateDialog extends StatefulWidget { class UpdateDialog extends StatefulWidget {
@@ -197,7 +198,7 @@ class _UpdateDialogState extends State<UpdateDialog> {
// 标题 // 标题
Row( Row(
children: <Widget>[ children: <Widget>[
Icon(Icons.download, size: 21, color: t.accent), UpdateIcon(size: 21, color: t.accent),
const SizedBox(width: 8), const SizedBox(width: 8),
Text('发现新版本 v${info.version}', Text('发现新版本 v${info.version}',
style: TextStyle(color: t.text, fontSize: 17, fontWeight: FontWeight.w700)), style: TextStyle(color: t.text, fontSize: 17, fontWeight: FontWeight.w700)),
+88
View File
@@ -0,0 +1,88 @@
/// 应用内更新按钮矢量图标。
///
/// 造型与设计稿(docs/更新.svg,viewBox 1024)严格对应:
/// 圆环(外径 446 / 内径 386.2)+ 空心向上的箭头 + 底部两条圆头横杠。
/// 采用归一化坐标矢量绘制,可任意缩放、随主题变色,小尺寸下保持清晰。
library;
import 'package:flutter/material.dart';
/// 更新图标:圆环 + 空心上箭头 + 底座横杠。
class UpdateIcon extends StatelessWidget {
/// 构造;[size] 为正方形边长,[color] 为线条颜色。
const UpdateIcon({super.key, required this.size, required this.color});
/// 图标边长(逻辑像素)。
final double size;
/// 线条颜色(随主题传入)。
final Color color;
@override
Widget build(BuildContext context) {
return CustomPaint(
size: Size.square(size),
painter: _UpdateIconPainter(color),
);
}
}
/// 更新图标绘制器:按设计稿坐标换算为归一化路径。
class _UpdateIconPainter extends CustomPainter {
/// 构造;[color] 线条颜色。
_UpdateIconPainter(this.color);
/// 线条颜色。
final Color color;
@override
void paint(Canvas canvas, Size size) {
final double s = size.shortestSide;
Offset p(double x, double y) => Offset(x * s, y * s);
final Paint stroke = Paint()
..style = PaintingStyle.stroke
..strokeCap = StrokeCap.round
..strokeJoin = StrokeJoin.round
..color = color;
// 1) 外圈圆环:中线半径 0.4064、线宽 0.0584(对应外径 446 / 内径 386.2)。
stroke.strokeWidth = 0.0584 * s;
canvas.drawCircle(Offset(s / 2, s / 2), 0.4064 * s, stroke);
// 2) 空心向上的箭头:外轮廓 + 内轮廓(evenOdd 挖空,得到等宽描边效果)。
final Path arrow = Path()..fillType = PathFillType.evenOdd;
// 外轮廓(顶点 → 右翼尖 → 箭杆 → 左翼尖,坐标取自设计稿 / 1024)。
arrow.moveTo(0.5 * s, 0.202 * s);
arrow.lineTo(0.7638 * s, 0.4284 * s);
arrow.lineTo(0.7439 * s, 0.4789 * s);
arrow.lineTo(0.6432 * s, 0.4789 * s);
arrow.lineTo(0.6432 * s, 0.5942 * s);
arrow.lineTo(0.6146 * s, 0.6234 * s);
arrow.lineTo(0.3892 * s, 0.6234 * s);
arrow.lineTo(0.36 * s, 0.5942 * s);
arrow.lineTo(0.36 * s, 0.4789 * s);
arrow.lineTo(0.2575 * s, 0.4789 * s);
arrow.lineTo(0.2377 * s, 0.4283 * s);
arrow.close();
// 内轮廓(挖空)。
arrow.moveTo(0.5022 * s, 0.2637 * s);
arrow.lineTo(0.3322 * s, 0.4205 * s);
arrow.lineTo(0.3892 * s, 0.4205 * s);
arrow.lineTo(0.4184 * s, 0.4497 * s);
arrow.lineTo(0.4184 * s, 0.565 * s);
arrow.lineTo(0.5848 * s, 0.565 * s);
arrow.lineTo(0.5848 * s, 0.4497 * s);
arrow.lineTo(0.6146 * s, 0.4205 * s);
arrow.lineTo(0.6706 * s, 0.4205 * s);
arrow.close();
canvas.drawPath(arrow, Paint()..color = color);
// 3) 底座两条圆头横杠(中线 y=0.6839 / 0.7739,线宽同圆环)。
canvas.drawLine(p(0.381, 0.6839), p(0.625, 0.6839), stroke);
canvas.drawLine(p(0.381, 0.7739), p(0.625, 0.7739), stroke);
}
/// 线条颜色变化时需要重绘。
@override
bool shouldRepaint(covariant _UpdateIconPainter old) => old.color != color;
}
+5 -3
View File
@@ -86,10 +86,12 @@ class UpdateService {
/// 检查更新。 /// 检查更新。
/// ///
/// 远端版本高于 [kAppVersion] 且存在当前平台的安装包时返回 [UpdateInfo]; /// [currentVersion] 为当前版本(缺省用 [kAppVersion];自检工具可传入模拟值)。
/// 远端版本高于当前版本且存在当前平台的安装包时返回 [UpdateInfo];
/// 无更新(或尚未发布任何版本)返回 null;网络 / 服务器异常抛出 [Exception], /// 无更新(或尚未发布任何版本)返回 null;网络 / 服务器异常抛出 [Exception],
/// 由调用方决定是否静默。 /// 由调用方决定是否静默。
static Future<UpdateInfo?> check() async { static Future<UpdateInfo?> check({String? currentVersion}) async {
final String current = currentVersion ?? kAppVersion;
final HttpClient client = HttpClient() final HttpClient client = HttpClient()
..connectionTimeout = const Duration(seconds: 8); ..connectionTimeout = const Duration(seconds: 8);
try { try {
@@ -103,7 +105,7 @@ class UpdateService {
} }
final Map<String, dynamic> j = jsonDecode(text) as Map<String, dynamic>; final Map<String, dynamic> j = jsonDecode(text) as Map<String, dynamic>;
final String tag = (j['tag_name'] as String?) ?? ''; final String tag = (j['tag_name'] as String?) ?? '';
if (!isNewerVersion(tag, kAppVersion)) return null; if (!isNewerVersion(tag, current)) return null;
final String notes = (j['body'] as String?) ?? ''; final String notes = (j['body'] as String?) ?? '';
// 选择当前平台的安装包:安卓取 .apk;Windows 优先 .zip(绿色版整包)。 // 选择当前平台的安装包:安卓取 .apk;Windows 优先 .zip(绿色版整包)。
bool isTarget(String n) { bool isTarget(String n) {
+1 -1
View File
@@ -2,4 +2,4 @@
/// ///
/// 应用内更新检查用它判断服务器发布的版本是否更新; /// 应用内更新检查用它判断服务器发布的版本是否更新;
/// **每次发版必须与 pubspec 同步更新**(见 BUILD-NOTES 的发布流程)。 /// **每次发版必须与 pubspec 同步更新**(见 BUILD-NOTES 的发布流程)。
const String kAppVersion = '1.2.0'; const String kAppVersion = '1.2.2';
+1 -1
View File
@@ -16,7 +16,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html # 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 # 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. # of the product and file versions while build-number is used as the build suffix.
version: 1.2.0+12 version: 1.2.2+14
environment: environment:
sdk: ^3.13.3 sdk: ^3.13.3
+8
View File
@@ -0,0 +1,8 @@
# V1.2.1 更新内容
- 更新按钮图标改为全新设计的「升级」样式(圆环 + 上箭头 + 底座横杠),
与界面整体风格统一,一眼可辨是「检查更新」
- 更新对话框标题图标同步更新
- 右下角缩略预览(条形 / 圆周)中的动作线条改细到约 2px,更符合缩略图观感
- **动作两端改为方头**(带小圆角):条形与圆周视图中的动作长度严格等于
真实时长,不再因圆头端帽向外多出而误读;SVG / PNG 导出同步
+5
View File
@@ -0,0 +1,5 @@
# V1.2.2 更新内容
- **修复发布版无法联网的问题**:补充网络访问权限(INTERNET),并为更新服务器
配置明文 HTTP 白名单——应用内「检查更新」恢复正常(此前 release 版收不到更新提示)
- AI 自然语言生成在发布版中同样恢复可用
+1 -1
View File
@@ -1,4 +1,4 @@
# ============================================================ # ============================================================
# 发布新版本到 Gitea Releases(更新说明 + 安装包附件) # 发布新版本到 Gitea Releases(更新说明 + 安装包附件)
# #
# 用法(在仓库根目录或任意位置): # 用法(在仓库根目录或任意位置):
+29
View File
@@ -0,0 +1,29 @@
// 开发自检工具:直接调用应用内更新服务,检查服务器上的最新版本。
//
// 用途:验证更新链路(网络可达 / 接口解析 / 版本判定 / 附件匹配)。
// 运行:
// dart run tool\check_update.dart
//
// 说明:使用的是与客户端完全相同的 lib/update/update_service.dart。
import '../lib/update/update_service.dart';
import '../lib/version.dart';
Future<void> main(List<String> args) async {
// 可传入一个版本号模拟旧安装(如 `dart run tool\check_update.dart 1.2.1`)。
final String current = args.isNotEmpty ? args.first : kAppVersion;
print('当前版本(模拟): $current');
try {
final UpdateInfo? info = await UpdateService.check(currentVersion: current);
if (info == null) {
print('结果: 已是最新版本(服务器无更高版本或缺少当前平台的安装包)');
return;
}
print('结果: 发现新版本 v${info.version}');
print('安装包: ${info.assetName} ${(info.assetSize / 1048576).toStringAsFixed(1)} MB');
print('下载地址: ${info.assetUrl}');
print('---- 更新说明 ----');
print(info.notes.trim());
} catch (e) {
print('检查失败: $e');
}
}