feat(flow): 新增流程图视图(时序图自动生成);导出合并为菜单并支持 drawio;发布 v1.3.0
- 流程图视图:泳道 = 轨道、FS/SS 依赖连线、关键路径高亮、相位阶段栏 (每个动作行归属覆盖占比最大的分区,重叠分区台阶错位) - 无前置依赖的动作从「开始」并列引出(并行分支),无后继动作汇入「结束」 - 流程图只读:AI 生成 / 撤销重做 / 动作增删 / 属性与依赖编辑等入口自动置灰, 左栏视图模式只保留条形 / 圆周(流程图入口在顶部工具栏) - 导出升级:导出按钮合并为下拉菜单,SVG / PNG 三种视图通用; 流程图额外支持 drawio(diagrams.net 可继续编辑泳道 / 相位 / 依赖) - 连线走线统一收敛到 FlowLayout.routes,画布 / SVG / drawio 共用同一几何 - 默认示例升级为完整「装配线节拍」(8 动作 / 3 工位 / 4 相位分区) - 版本号 1.3.0+16,更新说明 release/RELEASE_NOTES_v1.3.0.md
This commit is contained in:
@@ -13,6 +13,7 @@ import 'helpers.dart';
|
||||
void main() {
|
||||
testWidgets('generate tablet demo screenshots', (WidgetTester tester) async {
|
||||
await tester.runAsync(() => loadZhFonts());
|
||||
await tester.runAsync(() => loadMaterialIcons());
|
||||
|
||||
tester.view.physicalSize = const Size(1280, 800);
|
||||
tester.view.devicePixelRatio = 1.0;
|
||||
@@ -25,6 +26,7 @@ void main() {
|
||||
key: const ValueKey<String>('shot'),
|
||||
child: MaterialApp(
|
||||
theme: buildTheme(t),
|
||||
debugShowCheckedModeBanner: false,
|
||||
home: AppShell(controller: c),
|
||||
),
|
||||
);
|
||||
@@ -38,13 +40,15 @@ void main() {
|
||||
await shot('../demo/tablet-bar-light.png');
|
||||
|
||||
// 展开左右侧栏(浮层)并钉住,展示停靠布局。
|
||||
await tester.tap(find.byIcon(Icons.chevron_right).first);
|
||||
// 注意:不能用 find.byIcon(Icons.chevron_right)——画布右下角的预览卡里
|
||||
// 也有同类图标且更早出现在组件树中,会误触「切换视图」;改为按坐标点贴边轨道。
|
||||
await tester.tapAt(const Offset(10, 300));
|
||||
await tester.pump();
|
||||
if (tester.any(find.byIcon(Icons.push_pin_outlined))) {
|
||||
await tester.tap(find.byIcon(Icons.push_pin_outlined).first);
|
||||
await tester.pump();
|
||||
}
|
||||
await tester.tap(find.byIcon(Icons.chevron_left).first);
|
||||
await tester.tapAt(const Offset(1270, 300));
|
||||
await tester.pump();
|
||||
if (tester.any(find.byIcon(Icons.push_pin_outlined))) {
|
||||
await tester.tap(find.byIcon(Icons.push_pin_outlined).first);
|
||||
@@ -56,12 +60,33 @@ void main() {
|
||||
c.setViewMode(ViewMode.circular);
|
||||
await shot('../demo/tablet-circular-light.png');
|
||||
|
||||
// 深色主题:条形与圆周。
|
||||
// 流程图视图(浅色):由时序图自动生成(泳道 = 轨道,只读)。
|
||||
c.setViewMode(ViewMode.flow);
|
||||
await shot('../demo/tablet-flow-light.png');
|
||||
|
||||
// 流程图导出菜单:SVG / PNG 之外额外提供 drawio 入口(仅流程图)。
|
||||
await tester.tap(find.text('导出'));
|
||||
await tester.pumpAndSettle();
|
||||
await shot('../demo/tablet-flow-export-menu-light.png');
|
||||
await tester.tapAt(const Offset(5, 5));
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
// 选中动作:右侧属性面板进入只读态(滑块 / 依赖编辑置灰)。
|
||||
c.select('A2');
|
||||
await shot('../demo/tablet-flow-selected-light.png');
|
||||
c.select(null);
|
||||
|
||||
// 深色主题:条形、圆周与流程图。
|
||||
// 注意:MaterialApp 的主题切换带 200ms 过渡动画,必须等动画结束再截图,
|
||||
// 否则截到的是过渡起点(仍然是浅色)。
|
||||
c.toggleTheme();
|
||||
await tester.pumpWidget(shell(Tokens.dark));
|
||||
await tester.pump(const Duration(milliseconds: 400));
|
||||
c.setViewMode(ViewMode.bar);
|
||||
await shot('../demo/tablet-bar-dark.png');
|
||||
c.setViewMode(ViewMode.circular);
|
||||
await shot('../demo/tablet-circular-dark.png');
|
||||
c.setViewMode(ViewMode.flow);
|
||||
await shot('../demo/tablet-flow-dark.png');
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user