1 Commits

30 changed files with 162 additions and 108 deletions
Binary file not shown.

Before

Width:  |  Height:  |  Size: 149 KiB

After

Width:  |  Height:  |  Size: 149 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 148 KiB

After

Width:  |  Height:  |  Size: 148 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 154 KiB

After

Width:  |  Height:  |  Size: 154 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 120 KiB

After

Width:  |  Height:  |  Size: 120 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 124 KiB

After

Width:  |  Height:  |  Size: 124 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 150 KiB

After

Width:  |  Height:  |  Size: 149 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 62 KiB

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 144 KiB

After

Width:  |  Height:  |  Size: 144 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 121 KiB

After

Width:  |  Height:  |  Size: 120 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 118 KiB

After

Width:  |  Height:  |  Size: 118 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 86 KiB

After

Width:  |  Height:  |  Size: 85 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 122 KiB

After

Width:  |  Height:  |  Size: 122 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 175 KiB

After

Width:  |  Height:  |  Size: 174 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 170 KiB

After

Width:  |  Height:  |  Size: 170 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 180 KiB

After

Width:  |  Height:  |  Size: 180 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 98 KiB

After

Width:  |  Height:  |  Size: 98 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 107 KiB

After

Width:  |  Height:  |  Size: 107 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 98 KiB

After

Width:  |  Height:  |  Size: 98 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 133 KiB

After

Width:  |  Height:  |  Size: 133 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 95 KiB

After

Width:  |  Height:  |  Size: 95 KiB

+15
View File
@@ -1486,6 +1486,21 @@ class AppController extends ChangeNotifier {
archFit(); archFit();
} }
/// 识别当前墨迹(不载入示例):把画布上待识别的笔迹逐笔转化。
///
/// 顶部「识别(N)」按钮与手动确认识别模式使用;没有墨迹时只给提示。
void archRecognizeInk() {
if (arch.strokes.isEmpty) {
_status = '没有待识别的墨迹(先用「手绘」画几笔)';
notifyListeners();
return;
}
_archSelIds = const <String>[];
_archPlayToken++;
_status = '识别中:逐笔转化(${arch.strokes.length} 笔)…';
notifyListeners();
}
/// 清空架构图。 /// 清空架构图。
void archClear() { void archClear() {
_archSelIds = const <String>[]; _archSelIds = const <String>[];
+1 -1
View File
@@ -1225,7 +1225,7 @@ class _AppShellState extends State<AppShell> {
border: Border.all(color: t.line2), border: Border.all(color: t.line2),
), ),
child: InkWell( child: InkWell(
onTap: c.arch.strokes.isEmpty ? null : c.archPlayDemo, onTap: c.arch.strokes.isEmpty ? null : c.archRecognizeInk,
borderRadius: BorderRadius.circular(9), borderRadius: BorderRadius.circular(9),
child: Container( child: Container(
height: 34 * _toolScale, height: 34 * _toolScale,
+43 -101
View File
@@ -16,7 +16,6 @@ import 'package:flutter/material.dart';
import '../arch/arch_models.dart'; import '../arch/arch_models.dart';
import '../arch/arch_painter.dart'; import '../arch/arch_painter.dart';
import '../arch/arch_samples.dart';
import '../library/symbol_library.dart'; import '../library/symbol_library.dart';
import '../persistence/android_docs.dart'; import '../persistence/android_docs.dart';
import '../sketch/sketch_models.dart'; import '../sketch/sketch_models.dart';
@@ -348,69 +347,26 @@ class ArchLeftBody extends StatelessWidget {
Text('影响新绘制的图形;选中图形后点色块可直接换色(支持多选)。', Text('影响新绘制的图形;选中图形后点色块可直接换色(支持多选)。',
style: TextStyle(color: t.dim, fontSize: 10, height: 1.5)), style: TextStyle(color: t.dim, fontSize: 10, height: 1.5)),
const SizedBox(height: 14), const SizedBox(height: 14),
_sec(t, '示例场景'), SizedBox(
const SizedBox(height: 8), width: double.infinity,
Row( child: TextButton.icon(
children: <Widget>[ onPressed: c.archClear,
Expanded( icon: const Icon(Icons.delete_sweep_outlined, size: 15),
child: OutlinedButton( label: const Text('清空画布'),
onPressed: () => c.archLoadDemo(ArchDemoKind.ink), style: TextButton.styleFrom(
style: _btnStyle(), foregroundColor: t.danger,
child: const Text('手绘稿'), visualDensity: VisualDensity.compact,
textStyle: const TextStyle(
fontSize: 11.5,
fontFamily: 'Microsoft YaHei UI',
fontFamilyFallback: <String>[
'Microsoft YaHei',
'Segoe UI',
'sans-serif',
],
), ),
), ),
const SizedBox(width: 8), ),
Expanded(
child: FilledButton(
onPressed: c.archPlayDemo,
style: FilledButton.styleFrom(
visualDensity: VisualDensity.compact,
textStyle: const TextStyle(
fontSize: 11.5,
fontFamily: 'Microsoft YaHei UI',
fontFamilyFallback: <String>[
'Microsoft YaHei',
'Segoe UI',
'sans-serif',
],
),
),
child: const Text('识别墨迹 ▶'),
),
),
],
),
const SizedBox(height: 8),
Row(
children: <Widget>[
Expanded(
child: OutlinedButton(
onPressed: () => c.archLoadDemo(ArchDemoKind.done),
style: _btnStyle(),
child: const Text('完成图'),
),
),
const SizedBox(width: 8),
Expanded(
child: TextButton(
onPressed: c.archClear,
style: TextButton.styleFrom(
foregroundColor: t.danger,
visualDensity: VisualDensity.compact,
textStyle: const TextStyle(
fontSize: 11.5,
fontFamily: 'Microsoft YaHei UI',
fontFamilyFallback: <String>[
'Microsoft YaHei',
'Segoe UI',
'sans-serif',
],
),
),
child: const Text('清空画布'),
),
),
],
), ),
const SizedBox(height: 14), const SizedBox(height: 14),
Container( Container(
@@ -543,20 +499,6 @@ class ArchLeftBody extends StatelessWidget {
), ),
); );
} }
/// 小尺寸描边按钮样式。
ButtonStyle _btnStyle() => OutlinedButton.styleFrom(
visualDensity: VisualDensity.compact,
textStyle: const TextStyle(
fontSize: 11.5,
fontFamily: 'Microsoft YaHei UI',
fontFamilyFallback: <String>[
'Microsoft YaHei',
'Segoe UI',
'sans-serif',
],
),
);
} }
/// 架构图右侧栏主体:选中对象属性(支持多选)。 /// 架构图右侧栏主体:选中对象属性(支持多选)。
@@ -662,31 +604,6 @@ class ArchRightBody extends StatelessWidget {
style: TextStyle(color: t.sub, fontSize: 11), style: TextStyle(color: t.sub, fontSize: 11),
), ),
const SizedBox(height: 8), const SizedBox(height: 8),
Row(
children: <Widget>[
_mini(t, '编辑文字', () => _editText(context, c, s)),
const SizedBox(width: 6),
_mini(t, '上移一层', () => c.moveArchZ(s, 1)),
const SizedBox(width: 6),
_mini(t, '下移一层', () => c.moveArchZ(s, -1)),
],
),
const SizedBox(height: 6),
Row(
children: <Widget>[
if (s.type == ArchShapeType.polyline ||
s.type == ArchShapeType.curve) ...<Widget>[
_mini(
t,
s.type == ArchShapeType.polyline ? '平滑为曲线' : '折线化',
() => _togglePolyCurve(c, s),
),
const SizedBox(width: 6),
],
_mini(t, '删除(Del)', c.removeArchSelection, danger: true),
],
),
const SizedBox(height: 10),
Row( Row(
children: <Widget>[ children: <Widget>[
Text('尺寸 · mm(点数值直接修改)', Text('尺寸 · mm(点数值直接修改)',
@@ -771,6 +688,31 @@ class ArchRightBody extends StatelessWidget {
], ],
), ),
), ),
const SizedBox(height: 8),
Row(
children: <Widget>[
_mini(t, '编辑文字', () => _editText(context, c, s)),
const SizedBox(width: 6),
_mini(t, '上移一层', () => c.moveArchZ(s, 1)),
const SizedBox(width: 6),
_mini(t, '下移一层', () => c.moveArchZ(s, -1)),
],
),
const SizedBox(height: 6),
Row(
children: <Widget>[
if (s.type == ArchShapeType.polyline ||
s.type == ArchShapeType.curve) ...<Widget>[
_mini(
t,
s.type == ArchShapeType.polyline ? '平滑为曲线' : '折线化',
() => _togglePolyCurve(c, s),
),
const SizedBox(width: 6),
],
_mini(t, '删除(Del)', c.removeArchSelection, danger: true),
],
),
]) ])
else if (cn != null) else if (cn != null)
_card(t, <Widget>[ _card(t, <Widget>[
+7 -3
View File
@@ -48,6 +48,9 @@ class BrandMenuButton extends StatelessWidget {
} }
/// 构建按钮。 /// 构建按钮。
///
/// 与工具栏「手绘 / 选择」等分段按钮**等高同形**(圆角矩形):
/// 固定高度 34×scale、圆角 10、内容垂直居中。
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final Tokens t = context.tok; final Tokens t = context.tok;
@@ -62,8 +65,9 @@ class BrandMenuButton extends StatelessWidget {
borderRadius: radius, borderRadius: radius,
hoverColor: t.accent.withValues(alpha: 0.08), hoverColor: t.accent.withValues(alpha: 0.08),
child: Container( child: Container(
// 高度只由内容决定:去掉上下留白(按钮高度 = 内容高度)。 height: 34 * scale,
padding: EdgeInsets.only(left: 9 * scale, right: 9 * scale), padding: EdgeInsets.symmetric(horizontal: 9 * scale),
alignment: Alignment.center,
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: radius, borderRadius: radius,
border: Border.all(color: t.line2), border: Border.all(color: t.line2),
@@ -71,7 +75,7 @@ class BrandMenuButton extends StatelessWidget {
child: Row( child: Row(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: <Widget>[ children: <Widget>[
AppLogo(size: (compact ? 22 : 24) * scale), AppLogo(size: 20 * scale),
SizedBox(width: 7 * scale), SizedBox(width: 7 * scale),
Column( Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
+2 -1
View File
@@ -2479,7 +2479,8 @@ Future<String?> showTextEditDialog(
); );
}, },
); );
ctrl.dispose(); // 等对话框退场动画结束后再释放输入控制器(动画期间组件仍会引用它)。
Future<void>.delayed(const Duration(milliseconds: 400), ctrl.dispose);
return result; return result;
} }
+1 -1
View File
@@ -2,7 +2,7 @@
/// ///
/// 应用内更新检查用它判断服务器发布的版本是否更新; /// 应用内更新检查用它判断服务器发布的版本是否更新;
/// **每次发版必须与 pubspec 同步更新**(见 BUILD-NOTES 的发布流程)。 /// **每次发版必须与 pubspec 同步更新**(见 BUILD-NOTES 的发布流程)。
const String kAppVersion = '1.3.6'; const String kAppVersion = '1.3.7';
/// 是否要求授权(License)才能导出。 /// 是否要求授权(License)才能导出。
/// ///
+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.3.6+28 version: 1.3.7+29
environment: environment:
sdk: ^3.13.3 sdk: ^3.13.3
+27
View File
@@ -0,0 +1,27 @@
# V1.3.7 更新内容
> ⚠️ 本版为 1.3.5 / 1.3.6 之后的修复增强版。新功能仍可能存在较多 bug 与问题,
> 遇到问题欢迎反馈(开发者邮箱 liuyu65@126.com / 微信 online-goose)。
## 安卓体验修复(本版重点)
- **左上角 logo 按钮**:与「手绘 / 选择」等工具按钮**等高同形**
(圆角矩形、固定高度),不再出现"两头圆"的矮胶囊外观;
- **顶部「识别(N)」按钮**:现在**只识别你刚画的墨迹**——不再误载入示例场景;
- **移除「示例场景」入口**(手绘稿 / 完成图 / 识别演示):保留「清空画布」;
- **「尺寸 · mm」移到属性卡最上方**(选中图形即可看到):
宽度 / 高度 / 长度 / 直径点数值直接修改,几何按比例缩放;
「标注全部」在画布上显示尺寸标签,双击标签也可改值;
- **修复**:文本 / 数值编辑对话框在退场动画期间释放输入控制器导致的偶发异常
(安卓上编辑尺寸、文字、标签时更容易命中)。
## 说明:安卓桌面显示旧名称怎么办
安装包名称已为 **EDC|易得设计**。若桌面/应用列表仍显示旧名(如"时序图设计"),
这是**桌面启动器缓存了旧标签**,不是安装包问题:请**卸载后重新安装一次**,
或重启手机刷新桌面缓存;在应用内「关于」页可核对当前版本号是否为 1.3.7。
## 其它
- 更新通道:仓库 `admin/EasyDesignCollection`(旧地址 301 兼容老客户端);
- 下载 / 上传统一限速 320KB/s;安卓包约 53MB(≈3 分钟)/ Windows 整包约 12MB(≈40 秒)。
+47
View File
@@ -0,0 +1,47 @@
// 架构图属性面板回归:选中图形后「尺寸 · mm」可见、可改值驱动几何。
import 'package:flutter/material.dart' hide Action;
import 'package:flutter_test/flutter_test.dart';
import 'package:sequence_diagram/arch/arch_models.dart';
import 'package:sequence_diagram/model/models.dart';
import 'package:sequence_diagram/state/app_controller.dart';
import 'package:sequence_diagram/theme/tokens.dart';
import 'package:sequence_diagram/ui/arch_panel.dart';
void main() {
testWidgets('选中图元后右栏出现「尺寸 · mm」,改值直接缩放几何',
(WidgetTester tester) async {
final AppController c = AppController(project: Project.demo());
c.addArchShape(const ArchShape(
id: 'S1',
type: ArchShapeType.symbol,
symbolId: 'pe-ground',
rect: Rect.fromLTWH(100, 100, 80, 150),
));
c.selectArch('S1');
await tester.pumpWidget(MaterialApp(
theme: buildTheme(Tokens.light),
home: Scaffold(
body: SingleChildScrollView(child: ArchRightBody(controller: c)),
),
));
await tester.pump();
expect(find.textContaining('尺寸 · mm'), findsOneWidget);
expect(find.textContaining('标注全部'), findsOneWidget);
expect(find.text('80.0 mm'), findsOneWidget);
expect(find.text('150.0 mm'), findsOneWidget);
// 点宽度值 → 弹出改值对话框 → 输入 160 → 几何宽变 160。
await tester.tap(find.text('80.0 mm'));
await tester.pumpAndSettle();
expect(find.textContaining('编辑宽度'), findsOneWidget);
await tester.enterText(find.byType(TextField), '160');
await tester.tap(find.text('确定'));
await tester.pumpAndSettle();
expect(c.arch.shapeById('S1')!.rect.width, 160);
// 清理:先卸载组件树,再释放控制器(避免已释放断言)。
await tester.pumpWidget(const SizedBox());
c.dispose();
});
}
+18
View File
@@ -835,6 +835,24 @@ void main() {
expect(c.archAutoRecognize, isFalse); expect(c.archAutoRecognize, isFalse);
expect(c.status, contains('手动')); expect(c.status, contains('手动'));
}); });
test('识别按钮只识别当前墨迹(不载入示例)', () {
final AppController c = AppController(project: Project.demo());
addTearDown(c.dispose);
c.archClear();
final int t0 = c.archPlayToken;
c.archRecognizeInk();
expect(c.archPlayToken, t0, reason: '没有墨迹时不应触发识别');
expect(c.arch.strokes, isEmpty);
expect(c.arch.shapes, isEmpty, reason: '不得载入示例图形');
c.addArchStroke(const ArchStroke(
id: 'K1',
pts: <Offset>[Offset(0, 0), Offset(10, 0), Offset(10, 10)],
));
c.archRecognizeInk();
expect(c.archPlayToken, t0 + 1);
expect(c.arch.strokes.length, 1, reason: '识别前墨迹保持不动');
});
}); });
} }