feat: 原创「环序」标志;双视图与侧栏优化;工位管理;帮助完善

- 原创应用标志「环序/Cycle-Step」:tools/gen-icon.py 重写 + 工具栏 Logo 同源,小尺寸简化版

- 条形时序视图:标题/副标题精简、双刻度值置于分区与刻度线之间、时间默认内嵌、依赖线箭头收窄、同泳道箭头接色块外侧、图注自动避让

- 圆周时序视图:去掉色块描边、环宽与间隙优化、度数外侧标时间、方向箭头外移;固定顺时针(移除逆时针)

- 左侧栏:编辑工位/编辑相位分区入口;双击画布色块或动作行进入编辑;至少保留一个动作/泳道

- 右侧栏:移除重复的编辑操作、导出与单位卡片;文件浏览器新增「桌面」快捷入口

- AI 对话框:字号优化并新增「编辑示例」;节拍统计移除无依据的预估产能

- 文档:README 与 docs/HELP.md 全面更新;dist 同步重建
This commit is contained in:
admin
2026-09-18 23:32:36 +08:00
parent 71e84e05aa
commit 43c99fc4b6
18 changed files with 1079 additions and 779 deletions
+103 -408
View File
@@ -282,29 +282,6 @@ class _AppShellState extends State<AppShell> {
/// 构建顶部工具栏:左侧为品牌与文件/编辑操作,右侧为导出、缩放、
/// 单位、侧栏开关与主题切换。根据可用宽度在完整布局与紧凑布局间切换。
Widget _toolbar(Tokens t) {
final bool dirty = c.dirty;
final String fileLabel = c.filePath == null
? '文件:未保存(内存中)'
: '文件:${c.filePath!.split(RegExp(r'[\\/]')).last}';
final Widget fileChip = Container(
height: 34,
padding: const EdgeInsets.symmetric(horizontal: 12),
decoration: BoxDecoration(
color: t.panel,
borderRadius: BorderRadius.circular(9),
border: Border.all(color: t.line2),
),
child: Row(
children: <Widget>[
Text(fileLabel, style: TextStyle(color: t.sub, fontSize: 11)),
const SizedBox(width: 10),
Container(width: 7, height: 7, decoration: BoxDecoration(color: dirty ? t.warn : t.ok, shape: BoxShape.circle)),
const SizedBox(width: 6),
Text(dirty ? '未保存' : '已保存', style: TextStyle(color: dirty ? t.warn : t.ok, fontSize: 11)),
],
),
);
return Container(
height: 54,
padding: const EdgeInsets.symmetric(horizontal: 6),
@@ -344,7 +321,7 @@ class _AppShellState extends State<AppShell> {
final List<Widget> left;
final List<Widget> right;
if (!compact) {
// 完整布局:文字按钮 + 文件状态胶囊。
// 完整布局:文件 / 编辑操作图标化 + 分段视图切换。
left = <Widget>[
const AppLogo(size: 32),
const SizedBox(width: 10),
@@ -358,20 +335,13 @@ class _AppShellState extends State<AppShell> {
],
),
const SizedBox(width: 18),
_ghost(t, '新建', _newProject),
_ghost(t, '打开', _open),
_ghost(t, '保存', _save),
_iconBtn(t, Icons.note_add_outlined, _newProject, tooltip: '新建 Ctrl+N'),
_iconBtn(t, Icons.folder_open_outlined, _open, tooltip: '打开 Ctrl+O'),
_iconBtn(t, Icons.save_outlined, _save, tooltip: '保存 Ctrl+S'),
const SizedBox(width: 6),
_ghost(t, '撤销', c.canUndo ? c.undo : null, icon: Icons.undo),
_ghost(t, '重做', c.canRedo ? c.redo : null, icon: Icons.redo),
_iconBtn(t, Icons.undo, c.canUndo ? c.undo : null, tooltip: '撤销 Ctrl+Z'),
_iconBtn(t, Icons.redo, c.canRedo ? c.redo : null, tooltip: '重做 Ctrl+Y'),
const SizedBox(width: 6),
_addBtn(t, '添加动作', () => c.addAction(startAngle: 0)),
_toggleBtn(t, '编辑', Icons.edit, () {
final Action? a = c.selected;
if (a != null) {
showDialog<void>(context: context, builder: (_) => ActionEditorDialog(controller: c, action: a));
}
}),
_aiBtn(t),
const SizedBox(width: 12),
_segmented(t),
@@ -383,12 +353,10 @@ class _AppShellState extends State<AppShell> {
const SizedBox(width: 6),
_zoomBox(t),
const SizedBox(width: 6),
_ghost(t, '适应视图', c.fitView),
_iconBtn(t, Icons.crop_free, c.fitView, tooltip: '适应视图'),
const SizedBox(width: 8),
_unitDropdown(t),
const SizedBox(width: 8),
fileChip,
const SizedBox(width: 8),
sideToggleLeft,
sideToggleRight,
_iconBtn(t, Icons.help_outline, () =>
@@ -410,13 +378,6 @@ class _AppShellState extends State<AppShell> {
_iconBtn(t, Icons.undo, c.canUndo ? c.undo : null, tooltip: '撤销 Ctrl+Z'),
_iconBtn(t, Icons.redo, c.canRedo ? c.redo : null, tooltip: '重做 Ctrl+Y'),
const SizedBox(width: 4),
_iconBtn(t, Icons.add_circle_outline, () => c.addAction(startAngle: 0), tooltip: '添加动作', color: t.ok),
_iconBtn(t, Icons.edit, () {
final Action? a = c.selected;
if (a != null) {
showDialog<void>(context: context, builder: (_) => ActionEditorDialog(controller: c, action: a));
}
}, tooltip: '编辑', color: t.accent),
// AI 是核心卖点,紧凑布局下也保留「AI 生成」文字,避免认不出。
_aiBtn(t),
const SizedBox(width: 8),
@@ -625,44 +586,6 @@ class _AppShellState extends State<AppShell> {
);
}
/// 主强调“添加”按钮(绿色填充)。
Widget _addBtn(Tokens t, String label, VoidCallback onTap) {
return Padding(
padding: const EdgeInsets.symmetric(horizontal: 3),
child: FilledButton.icon(
onPressed: onTap,
icon: const Icon(Icons.add, size: 17),
label: Text(label, style: const TextStyle(fontSize: 11, fontWeight: FontWeight.w600)),
style: FilledButton.styleFrom(
backgroundColor: t.ok,
foregroundColor: t.onAccent,
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(9)),
padding: const EdgeInsets.symmetric(horizontal: 14, vertical: 10),
minimumSize: const Size(0, 34),
),
),
);
}
/// 强调色“编辑”按钮。
Widget _toggleBtn(Tokens t, String label, IconData icon, VoidCallback onTap) {
return Padding(
padding: const EdgeInsets.symmetric(horizontal: 3),
child: FilledButton.icon(
onPressed: onTap,
icon: Icon(icon, size: 16),
label: Text(label, style: const TextStyle(fontSize: 11, fontWeight: FontWeight.w600)),
style: FilledButton.styleFrom(
backgroundColor: t.accent,
foregroundColor: t.onAccent,
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(9)),
padding: const EdgeInsets.symmetric(horizontal: 14, vertical: 10),
minimumSize: const Size(0, 34),
),
),
);
}
/// 主色填充按钮(用于导出等主要动作)。
Widget _primaryBtn(Tokens t, String label, VoidCallback onTap) {
return FilledButton(
@@ -839,7 +762,6 @@ class _AppShellState extends State<AppShell> {
/// 构建左侧栏:项目概览、动作/工位列表、视图模式、显示选项、
/// 工位负载与操作提示。[floating] 为 true 时以悬浮卡片样式呈现。
Widget _leftPanel(Tokens t, {bool floating = false}) {
final List<Action> actions = c.project.actions;
final bool bar = c.project.viewState.mode == ViewMode.bar;
return Container(
width: 300,
@@ -857,116 +779,72 @@ class _AppShellState extends State<AppShell> {
children: <Widget>[
Row(
children: <Widget>[
_sectionLabel(t, '节拍周期设置'),
_sectionLabel(t, '时序创建和编辑'),
const Spacer(),
_panelControls(t, true),
],
),
const SizedBox(height: 8),
Container(
padding: const EdgeInsets.all(10),
decoration: BoxDecoration(
color: t.panel2,
borderRadius: BorderRadius.circular(12),
border: Border.all(color: t.line),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Row(
children: <Widget>[
Container(
width: 34,
height: 34,
decoration: BoxDecoration(
color: t.accent2.withValues(alpha: 0.2),
borderRadius: BorderRadius.circular(9),
),
alignment: Alignment.center,
child: Text('周', style: TextStyle(color: t.accent2, fontSize: 13, fontWeight: FontWeight.w700)),
),
const SizedBox(width: 10),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text('节拍周期设置',
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(color: t.text, fontSize: 13, fontWeight: FontWeight.w600)),
Text(
'项目:${c.project.name} · ${c.filePath == null ? '未保存' : c.filePath!.split(RegExp(r'[\\/]')).last}',
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(color: t.dim, fontSize: 10),
),
],
),
),
],
),
const Divider(height: 16),
// 循环时长(= 时间轴长度)即一个循环的 360°/100%,点击即可编辑。
Row(
children: <Widget>[
Text('循环', style: TextStyle(color: t.dim, fontSize: 10.5)),
const SizedBox(width: 6),
Expanded(
child: Tooltip(
message: '点击编辑循环时长 / 时间轴长度',
child: InkWell(
onTap: () => showDialog<void>(
context: context,
builder: (_) => SettingsDialog(controller: c),
),
borderRadius: BorderRadius.circular(6),
child: Row(
children: <Widget>[
Flexible(
child: Text(
'${tfmt(c.project.cycle.durationMs, c.project.units)} = 360° = 100%',
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(color: t.accent, fontSize: 11),
),
),
const SizedBox(width: 4),
Icon(Icons.edit, size: 12, color: t.accent),
],
),
),
),
),
const SizedBox(width: 8),
Text('动作 ${actions.length} · 依赖 ${_depCount()}',
style: TextStyle(color: t.dim, fontSize: 10.5)),
],
),
],
_editEntry(
t,
icon: Icons.edit_note,
label: '编辑时序与节拍参数',
onTap: () => showDialog<void>(
context: context,
builder: (_) => SettingsDialog(controller: c),
),
),
const SizedBox(height: 12),
// 较浅的分隔横线,区分上方「时序创建和编辑」与下方「动作和执行编辑」。
const SizedBox(height: 14),
Divider(height: 1, thickness: 1, color: t.line),
const SizedBox(height: 14),
Row(
children: <Widget>[
Flexible(
child: _sectionLabel(t, bar ? '动作 / 执行器泳道' : '动作列表(按轨道 L1→L${c.project.laneCount})'),
),
const Spacer(),
// 用 Expanded 占满剩余空间,标题不会被无谓地省略成「…」。
Expanded(child: _sectionLabel(t, '动作和执行编辑')),
_headerAction(t, Icons.add, '新建', t.ok, t.onAccent, () => c.addAction(startAngle: 0)),
const SizedBox(width: 6),
// 至少保留一个动作 / 泳道:只剩一个时禁用删除。
_headerAction(
t,
Icons.delete_outline,
'删除',
t.danger,
Colors.white,
c.selectedId == null ? null : () => c.deleteAction(c.selectedId!),
(c.selectedId == null || c.project.actions.length <= 1)
? null
: () => c.deleteAction(c.selectedId!),
),
],
),
const SizedBox(height: 8),
// 按泳道 / 轨道分组:同一泳道内的多个动作合并显示(最多两行,/ 分隔)。
..._laneRows(t, bar),
const SizedBox(height: 8),
// 工位 / 相位分区管理入口,同属「动作和执行编辑」区域。
// 工位:一个流程可包含多个工位,可增删改与排序。
_editEntry(
t,
icon: Icons.precision_manufacturing_outlined,
label: '编辑工位',
badge: c.project.stations.length,
onTap: () => showDialog<void>(
context: context,
builder: (_) => StationDialog(controller: c),
),
),
const SizedBox(height: 8),
// 相位分区:可任意增删、改名、改起止角。
_editEntry(
t,
icon: Icons.tune,
label: '编辑相位分区',
badge: c.project.phaseZones.length,
onTap: () => showDialog<void>(
context: context,
builder: (_) => PhaseZoneDialog(controller: c),
),
),
const SizedBox(height: 12),
_sectionLabel(t, '视图模式'),
const SizedBox(height: 8),
@@ -981,25 +859,6 @@ class _AppShellState extends State<AppShell> {
_sectionLabel(t, '显示选项'),
const SizedBox(height: 6),
..._displayOptions(t, bar),
const SizedBox(height: 4),
// 相位分区编辑入口:可任意增删、改名、改起止角。
Align(
alignment: Alignment.centerLeft,
child: TextButton.icon(
onPressed: () => showDialog<void>(
context: context,
builder: (_) => PhaseZoneDialog(controller: c),
),
icon: const Icon(Icons.tune, size: 14),
label: Text('编辑相位分区(${c.project.phaseZones.length})',
style: const TextStyle(fontSize: 11.5)),
style: TextButton.styleFrom(
foregroundColor: t.accent,
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 2),
minimumSize: const Size(0, 26),
),
),
),
const SizedBox(height: 8),
_sectionLabel(t, '工位负载 / 相位占用'),
const SizedBox(height: 10),
@@ -1034,9 +893,53 @@ class _AppShellState extends State<AppShell> {
s,
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(color: t.dim, fontSize: 11, letterSpacing: 1.4, fontWeight: FontWeight.w500),
style: TextStyle(color: t.text2, fontSize: 11.5, letterSpacing: 1.2, fontWeight: FontWeight.w600),
);
/// 侧栏中的“单行编辑入口”卡片:图标 + 文案 + 可选计数徽标 + 右箭头。
///
/// 用于把复杂的设置模块收敛为一个点击即可进入的入口。
Widget _editEntry(
Tokens t, {
required IconData icon,
required String label,
required VoidCallback onTap,
int? badge,
}) {
return InkWell(
onTap: onTap,
borderRadius: BorderRadius.circular(10),
child: Container(
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 11),
decoration: BoxDecoration(
color: t.panel2,
borderRadius: BorderRadius.circular(10),
border: Border.all(color: t.line),
),
child: Row(
children: <Widget>[
Icon(icon, size: 16, color: t.accent),
const SizedBox(width: 8),
Expanded(child: Text(label, style: TextStyle(color: t.text2, fontSize: 12))),
if (badge != null) ...<Widget>[
Container(
padding: const EdgeInsets.symmetric(horizontal: 6, vertical: 1),
decoration: BoxDecoration(
color: t.accent.withValues(alpha: 0.14),
borderRadius: BorderRadius.circular(6),
),
child: Text('$badge',
style: TextStyle(color: t.accent, fontSize: 10.5, fontWeight: FontWeight.w700)),
),
const SizedBox(width: 4),
],
Icon(Icons.chevron_right, size: 16, color: t.dim),
],
),
),
);
}
/// 动作列表小节标题右侧的紧凑按钮(新建 / 删除)。
///
/// [onTap] 为 null 时按钮呈禁用态(降低不透明度),用于「未选中动作时禁用删除」。
@@ -1100,6 +1003,9 @@ class _AppShellState extends State<AppShell> {
toggle: HardwareKeyboard.instance.isControlPressed ||
HardwareKeyboard.instance.isShiftPressed,
),
// 双击泳道行直接编辑该泳道的主动作。
onDoubleTap: () => showDialog<void>(
context: context, builder: (_) => ActionEditorDialog(controller: c, action: primary)),
borderRadius: BorderRadius.circular(10),
child: Container(
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 8),
@@ -1193,6 +1099,9 @@ class _AppShellState extends State<AppShell> {
toggle: HardwareKeyboard.instance.isControlPressed ||
HardwareKeyboard.instance.isShiftPressed,
),
// 双击动作行直接进入编辑。
onDoubleTap: () => showDialog<void>(
context: context, builder: (_) => ActionEditorDialog(controller: c, action: a)),
borderRadius: BorderRadius.circular(10),
child: Container(
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 8),
@@ -1256,8 +1165,8 @@ class _AppShellState extends State<AppShell> {
child: Icon(Icons.edit, size: 13, color: sel ? t.accent : t.dim),
),
),
// 选中该动作时才出现删除入口,避免误触。
if (sel) ...<Widget>[
// 选中该动作时才出现删除入口;至少保留一个动作 / 泳道。
if (sel && c.project.actions.length > 1) ...<Widget>[
const SizedBox(width: 4),
InkWell(
onTap: () => c.deleteAction(a.id),
@@ -1446,61 +1355,6 @@ class _AppShellState extends State<AppShell> {
(double v) => c.setActionDuration(a.id, v * 180)),
const SizedBox(height: 8),
],
_unitCard(t),
const SizedBox(height: 12),
_sectionLabel(t, bar ? '编辑操作' : '层 / 编辑操作'),
const SizedBox(height: 10),
if (bar)
Row(
children: <Widget>[
Expanded(child: _editTool(t, Icons.add, '添加动作', t.ok, t.onAccent, () => c.addAction(startAngle: 0))),
const SizedBox(width: 8),
Expanded(child: _editTool(t, Icons.edit, '编辑', t.accent, t.onAccent, () {
showDialog<void>(context: context, builder: (_) => ActionEditorDialog(controller: c, action: a));
})),
const SizedBox(width: 8),
Expanded(child: _editTool(t, Icons.copy, '复制', t.panel2, t.sub, c.duplicateSelected, border: t.line2)),
const SizedBox(width: 8),
Expanded(child: _editTool(t, Icons.delete_outline, '删除', t.panel2, t.sub, () => c.deleteAction(a.id), border: t.line2)),
],
)
else ...<Widget>[
Row(
children: <Widget>[
Expanded(child: _wideBtn(t, Icons.add, '新增轨道 L${c.project.laneCount + 1}', t.accent2, Colors.white,
() => c.changeLayer(a.id, 1))),
const SizedBox(width: 8),
Expanded(child: _wideBtn(t, Icons.keyboard_arrow_up, '重排 / 合并层', t.panel2, t.sub,
() => c.changeLayer(a.id, -1), border: t.line2)),
],
),
const SizedBox(height: 8),
Row(
children: <Widget>[
_editTool(t, Icons.copy, '复制动作', t.panel2, t.sub, c.duplicateSelected, border: t.line2),
const SizedBox(width: 8),
_editTool(t, Icons.delete_outline, '删除动作', t.panel2, t.sub, () => c.deleteAction(a.id), border: t.line2),
const SizedBox(width: 8),
_editTool(t, Icons.align_horizontal_left, '对齐相位', t.panel2, t.sub, c.alignPhase, border: t.line2),
],
),
const SizedBox(height: 12),
Container(
padding: const EdgeInsets.all(10),
decoration: BoxDecoration(
color: t.info,
borderRadius: BorderRadius.circular(10),
border: Border.all(color: t.line),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text('新增动作放在最外层;箭头方向即执行顺序', style: TextStyle(color: t.sub, fontSize: 10, height: 1.6)),
Text('绿实线 FS 严格顺序 · 琥珀虚线 SS 并行重叠', style: TextStyle(color: t.sub, fontSize: 10, height: 1.6)),
],
),
),
],
const SizedBox(height: 12),
// 输入依赖:允许多条(多前置)。
_sectionLabel(t, '前置依赖 · 输入(${a.deps.length})'),
@@ -1532,14 +1386,6 @@ class _AppShellState extends State<AppShell> {
else
for (final (Action target, Dependency d) in _outgoingDeps(a))
_outDepRow(t, a, target, d),
if (bar) ...<Widget>[
const SizedBox(height: 12),
_sectionLabel(t, '导出'),
const SizedBox(height: 8),
_exportRow(t, 'SVG(矢量 · 可编辑 · 打印级)', _exportSvg),
const SizedBox(height: 6),
_exportRow(t, 'PNG / PDF / 工艺卡', _exportPng),
],
const SizedBox(height: 12),
_helpCard(t),
],
@@ -1731,138 +1577,6 @@ class _AppShellState extends State<AppShell> {
);
}
/// 工艺单位与精度卡片:切换时间/相位单位并显示换算关系。
Widget _unitCard(Tokens t) {
final UnitSettings u = c.project.units;
return Container(
padding: const EdgeInsets.all(10),
decoration: BoxDecoration(
color: t.panel2,
borderRadius: BorderRadius.circular(12),
border: Border.all(color: t.line),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Row(
children: <Widget>[
_sectionLabel(t, '工艺单位与精度'),
const Spacer(),
InkWell(
onTap: () => showDialog<void>(
context: context, builder: (_) => SettingsDialog(controller: c)),
child: Row(
children: <Widget>[
Icon(Icons.tune, size: 14, color: t.accent),
const SizedBox(width: 4),
Text('参数', style: TextStyle(color: t.accent, fontSize: 11)),
],
),
),
],
),
const SizedBox(height: 10),
_unitRow(t, '时间单位', TimeUnit.values.map((TimeUnit x) => (timeUnitLabel(x), x == u.timeUnit)).toList(), (int i) {
c.setUnits(c.project.units.copyWith(timeUnit: TimeUnit.values[i]));
}),
const SizedBox(height: 8),
_unitRow(t, '相位单位', <(String, bool)>[('°', u.phaseUnit == PhaseUnit.deg), ('%', u.phaseUnit == PhaseUnit.percent)], (int i) {
c.setUnits(c.project.units.copyWith(phaseUnit: i == 0 ? PhaseUnit.deg : PhaseUnit.percent));
}),
const SizedBox(height: 10),
Divider(height: 1, color: t.line),
const SizedBox(height: 8),
Text(
'1° = ${tfmtAuto(c.project.cycle.durationMs / 360)} 1% = ${tfmtAuto(c.project.cycle.durationMs / 100)} 1 圈 = ${tfmt(c.project.cycle.durationMs, u)}',
style: TextStyle(color: t.dim, fontSize: 10),
),
],
),
);
}
/// 单位选择行:一组互斥的选项按钮。
Widget _unitRow(Tokens t, String label, List<(String, bool)> options, ValueChanged<int> onPick) {
return Row(
children: <Widget>[
SizedBox(width: 64, child: Text(label, style: TextStyle(color: t.sub, fontSize: 11))),
for (int i = 0; i < options.length; i++)
Padding(
padding: const EdgeInsets.only(right: 6),
child: InkWell(
onTap: () => onPick(i),
borderRadius: BorderRadius.circular(8),
child: Container(
width: 54,
height: 32,
alignment: Alignment.center,
decoration: BoxDecoration(
color: options[i].$2 ? t.accent.withValues(alpha: 0.18) : t.panel,
borderRadius: BorderRadius.circular(8),
border: Border.all(color: options[i].$2 ? t.accent : t.line2),
),
child: Text(options[i].$1,
style: TextStyle(color: options[i].$2 ? t.accent : t.sub, fontSize: 11)),
),
),
),
],
);
}
/// 右侧栏中的方形编辑工具按钮。
Widget _editTool(Tokens t, IconData icon, String label, Color bg, Color fg, VoidCallback onTap, {Color? border}) {
return InkWell(
onTap: onTap,
borderRadius: BorderRadius.circular(9),
child: Container(
width: 74,
height: 58,
decoration: BoxDecoration(
color: bg,
borderRadius: BorderRadius.circular(9),
border: Border.all(color: border ?? bg),
),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Icon(icon, size: 18, color: fg),
const SizedBox(height: 4),
Text(label, style: TextStyle(color: fg, fontSize: 10, fontWeight: FontWeight.w600)),
],
),
),
);
}
/// 横向加宽的按钮(图标 + 文字)。
Widget _wideBtn(Tokens t, IconData icon, String label, Color bg, Color fg, VoidCallback onTap, {Color? border}) {
return InkWell(
onTap: onTap,
borderRadius: BorderRadius.circular(9),
child: Container(
height: 40,
alignment: Alignment.center,
decoration: BoxDecoration(
color: bg,
borderRadius: BorderRadius.circular(9),
border: Border.all(color: border ?? bg),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Icon(icon, size: 15, color: fg),
const SizedBox(width: 6),
Flexible(
child: Text(label,
maxLines: 1, overflow: TextOverflow.ellipsis, style: TextStyle(color: fg, fontSize: 11)),
),
],
),
),
);
}
/// 单条依赖展示行:显示前后动作、类型与偏移角,并可删除。
Widget _depRow(Tokens t, Action a, Dependency d) {
final Color col = d.type == DepType.fs ? t.fs : t.ss;
@@ -1923,25 +1637,6 @@ class _AppShellState extends State<AppShell> {
);
}
/// 导出入口行(点击触发对应导出流程)。
Widget _exportRow(Tokens t, String label, VoidCallback onTap) {
return InkWell(
onTap: onTap,
borderRadius: BorderRadius.circular(10),
child: Container(
height: 42,
alignment: Alignment.centerLeft,
padding: const EdgeInsets.symmetric(horizontal: 12),
decoration: BoxDecoration(
color: t.panel2,
borderRadius: BorderRadius.circular(10),
border: Border.all(color: t.line2),
),
child: Text(label, style: TextStyle(color: t.sub, fontSize: 11)),
),
);
}
/// 右侧栏底部的帮助与快捷键提示卡片。
Widget _helpCard(Tokens t) {
return Container(