1.3.7:安卓体验修复(logo 按钮等高同形、识别只识别当前墨迹、移除示例入口、尺寸区置顶)+ 修复编辑对话框控制器释放时序
This commit is contained in:
@@ -1486,6 +1486,21 @@ class AppController extends ChangeNotifier {
|
||||
archFit();
|
||||
}
|
||||
|
||||
/// 识别当前墨迹(不载入示例):把画布上待识别的笔迹逐笔转化。
|
||||
///
|
||||
/// 顶部「识别(N)」按钮与手动确认识别模式使用;没有墨迹时只给提示。
|
||||
void archRecognizeInk() {
|
||||
if (arch.strokes.isEmpty) {
|
||||
_status = '没有待识别的墨迹(先用「手绘」画几笔)';
|
||||
notifyListeners();
|
||||
return;
|
||||
}
|
||||
_archSelIds = const <String>[];
|
||||
_archPlayToken++;
|
||||
_status = '识别中:逐笔转化(${arch.strokes.length} 笔)…';
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
/// 清空架构图。
|
||||
void archClear() {
|
||||
_archSelIds = const <String>[];
|
||||
|
||||
@@ -1225,7 +1225,7 @@ class _AppShellState extends State<AppShell> {
|
||||
border: Border.all(color: t.line2),
|
||||
),
|
||||
child: InkWell(
|
||||
onTap: c.arch.strokes.isEmpty ? null : c.archPlayDemo,
|
||||
onTap: c.arch.strokes.isEmpty ? null : c.archRecognizeInk,
|
||||
borderRadius: BorderRadius.circular(9),
|
||||
child: Container(
|
||||
height: 34 * _toolScale,
|
||||
|
||||
+43
-101
@@ -16,7 +16,6 @@ import 'package:flutter/material.dart';
|
||||
|
||||
import '../arch/arch_models.dart';
|
||||
import '../arch/arch_painter.dart';
|
||||
import '../arch/arch_samples.dart';
|
||||
import '../library/symbol_library.dart';
|
||||
import '../persistence/android_docs.dart';
|
||||
import '../sketch/sketch_models.dart';
|
||||
@@ -348,69 +347,26 @@ class ArchLeftBody extends StatelessWidget {
|
||||
Text('影响新绘制的图形;选中图形后点色块可直接换色(支持多选)。',
|
||||
style: TextStyle(color: t.dim, fontSize: 10, height: 1.5)),
|
||||
const SizedBox(height: 14),
|
||||
_sec(t, '示例场景'),
|
||||
const SizedBox(height: 8),
|
||||
Row(
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
child: OutlinedButton(
|
||||
onPressed: () => c.archLoadDemo(ArchDemoKind.ink),
|
||||
style: _btnStyle(),
|
||||
child: const Text('手绘稿'),
|
||||
SizedBox(
|
||||
width: double.infinity,
|
||||
child: TextButton.icon(
|
||||
onPressed: c.archClear,
|
||||
icon: const Icon(Icons.delete_sweep_outlined, size: 15),
|
||||
label: const Text('清空画布'),
|
||||
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',
|
||||
],
|
||||
),
|
||||
),
|
||||
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),
|
||||
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),
|
||||
),
|
||||
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(
|
||||
children: <Widget>[
|
||||
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)
|
||||
_card(t, <Widget>[
|
||||
|
||||
@@ -48,6 +48,9 @@ class BrandMenuButton extends StatelessWidget {
|
||||
}
|
||||
|
||||
/// 构建按钮。
|
||||
///
|
||||
/// 与工具栏「手绘 / 选择」等分段按钮**等高同形**(圆角矩形):
|
||||
/// 固定高度 34×scale、圆角 10、内容垂直居中。
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final Tokens t = context.tok;
|
||||
@@ -62,8 +65,9 @@ class BrandMenuButton extends StatelessWidget {
|
||||
borderRadius: radius,
|
||||
hoverColor: t.accent.withValues(alpha: 0.08),
|
||||
child: Container(
|
||||
// 高度只由内容决定:去掉上下留白(按钮高度 = 内容高度)。
|
||||
padding: EdgeInsets.only(left: 9 * scale, right: 9 * scale),
|
||||
height: 34 * scale,
|
||||
padding: EdgeInsets.symmetric(horizontal: 9 * scale),
|
||||
alignment: Alignment.center,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: radius,
|
||||
border: Border.all(color: t.line2),
|
||||
@@ -71,7 +75,7 @@ class BrandMenuButton extends StatelessWidget {
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: <Widget>[
|
||||
AppLogo(size: (compact ? 22 : 24) * scale),
|
||||
AppLogo(size: 20 * scale),
|
||||
SizedBox(width: 7 * scale),
|
||||
Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
|
||||
+2
-1
@@ -2479,7 +2479,8 @@ Future<String?> showTextEditDialog(
|
||||
);
|
||||
},
|
||||
);
|
||||
ctrl.dispose();
|
||||
// 等对话框退场动画结束后再释放输入控制器(动画期间组件仍会引用它)。
|
||||
Future<void>.delayed(const Duration(milliseconds: 400), ctrl.dispose);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
///
|
||||
/// 应用内更新检查用它判断服务器发布的版本是否更新;
|
||||
/// **每次发版必须与 pubspec 同步更新**(见 BUILD-NOTES 的发布流程)。
|
||||
const String kAppVersion = '1.3.6';
|
||||
const String kAppVersion = '1.3.7';
|
||||
|
||||
/// 是否要求授权(License)才能导出。
|
||||
///
|
||||
|
||||
Reference in New Issue
Block a user