feat(android): 平板版适配(1280×800dp,免授权,应用商店分发)

- flutter create 增加 android 平台:包名 cc.sincos.sequence_diagram,应用名「时序图设计器」,minSdk 24 / targetSdk 36

- 多分辨率动态兼容:触屏侧栏默认贴边把手(点把手直接停靠),面板宽度随屏宽压缩,窄屏双侧栏停靠不溢出

- 免授权:LicenseService 非 Windows 平台直接判定已授权

- 移动端存储/文件浏览器适配(无 APPDATA/盘符/桌面);edge-to-edge + SafeArea + 文本缩放固定 1.0

- launcher 图标沿用「环序」标志(tools/gen-android-icons.py);Gradle 腾讯镜像 + Maven 阿里镜像

- 自测:7 种分辨率无溢出回归(test/tablet_layout_test.dart)+ 平板截图(demo/tablet-*.png)

- 产物:release/sequence_diagram_tablet_v1.0.1_release.apk(universal,50.3MB)
This commit is contained in:
admin
2026-10-06 21:04:38 +08:00
parent f5412ee99d
commit fad82a30d8
37 changed files with 772 additions and 42 deletions
+22
View File
@@ -5,6 +5,8 @@
// Storage(本地持久化),并通过 AppController 向整个 UI 层提供状态与
// 业务动作。启动后还会检查是否存在异常退出遗留的自动快照,并引导用户
// 选择恢复方式。
import 'dart:io' show Platform;
import 'dart:ui' show AppExitResponse;
import 'package:flutter/material.dart';
@@ -23,6 +25,16 @@ import 'ui/app_shell.dart';
/// 然后启动根组件 [SequenceDiagramApp]。
Future<void> main() async {
WidgetsFlutterBinding.ensureInitialized();
// 移动端:沉浸式(edge-to-edge)显示,配合 SafeArea 自动避让系统栏。
if (Platform.isAndroid || Platform.isIOS) {
await SystemChrome.setEnabledSystemUIMode(SystemUiMode.edgeToEdge);
SystemChrome.setSystemUIOverlayStyle(const SystemUiOverlayStyle(
statusBarColor: Colors.transparent,
systemNavigationBarColor: Colors.transparent,
statusBarIconBrightness: Brightness.dark,
statusBarBrightness: Brightness.light,
));
}
await Storage.instance.init();
runApp(const SequenceDiagramApp());
}
@@ -158,6 +170,16 @@ class _SequenceDiagramAppState extends State<SequenceDiagramApp> {
title: '时序图设计器 · Sequence Diagram Studio',
debugShowCheckedModeBanner: false,
theme: buildTheme(tokens),
// 固定文本缩放并包裹 SafeArea:保证平板等分辨率下布局像素级精准,
// 不受系统字体缩放影响,并自动避让状态栏 / 导航栏。
builder: (BuildContext context, Widget? child) {
return MediaQuery(
data: MediaQuery.of(context).copyWith(
textScaler: const TextScaler.linear(1.0),
),
child: SafeArea(child: child ?? const SizedBox.shrink()),
);
},
home: AppShell(controller: _controller),
);
},