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