Replace the shadow-only inspector with layered effect and stroke controls and per-corner distortion editors. Share color inputs, layer rows, keyframe controls and property edit boundaries; keep nested selection menus within their property popover and update localized labels. Add property editing, preview interaction and benchmark comparison coverage. Validation: Dart analysis reports no issues and 160 targeted application tests pass. The macOS development app was rebuilt and visually checked during native rendering validation. Exclude local dependency override changes from the committed lockfile.
cutdex_ui
Cutdex workspace 内部 Flutter 包,维护通用组件与基础视觉主题,暂不发布。
theme.dart:主题、语义颜色、间距与控件尺寸。widgets.dart:菜单、选择框、对话框、输入控件、标签页、面板、下载进度、滚动渐隐等。icons.dart:AppIcons及 Phosphor Regular、Fill 静态图标目录。cutdex_ui.dart:上述三个入口。
组件通过参数接收文本、数据与回调;应用本地化与项目状态由调用方提供。选择框的空列表文案使用 emptyLabel,可搜索选择框同时传入 searchHint。对话框默认关闭提示由 Flutter 的 Material 本地化提供,也可传入 closeLabel。
WorkspacePanel 通过参数接收标题、控件与内容;ResourceDownloadProgress 接收字节数、速度与调用方提供的状态文案,formatResourceBytes 使用十进制字节单位。资源目录、下载任务与业务对话框由应用维护。
原生菜单通过 cutdex_native 展示,无法展示时回退到 Flutter 菜单。时间线与编辑器的业务样式由应用维护。
桌面入口通过 AppTheme.desktopWorkspaceTheme 应用 DesktopControlDensity,使用 AppDesktopMetrics 中的按钮、输入框、面板标题与播放栏尺寸。移动端不继承这套密度。AppCommandToolbar 接收分组命令及固定的右侧命令,空间不足时将次要操作收入更多菜单;预览位于 app_command_toolbar_previews.dart。
在应用根目录执行 fvm dart tool/flutter_local.dart pub get;在本包目录执行:
python3 ../../tool/project_tools.py dart run build_runner build
python3 ../../tool/project_tools.py flutter test
生成的 Freezed 文件随源码提交。测试维护在本包 test/,应用接线测试保留在应用中。
图标
图标使用随包打包的 Phosphor 官方字体,由 Flutter Icon 渲染,无第三方图标包依赖。
应用与共享组件优先使用 AppIcons,默认 Regular;填充图标使用显式的 Filled 名称。
import 'package:cutdex_ui/icons.dart';
const Icon(AppIcons.search);
const Icon(AppIcons.folderFilled);
需要新增项目图标时,在 lib/src/icons/app_icons.dart 增加语义映射。完整目录通过
PhosphorIconsRegular 与 PhosphorIconsFill 提供,例如
PhosphorIconsRegular.filmStrip。颜色、尺寸及无障碍标签使用 Icon 的参数,或由
IconTheme 继承。左右导航箭头和尖括号随 RTL 镜像,播放、撤销/重做及品牌图标保持原方向。
两套样式使用独立字体族,不能通过 fontWeight 在 Regular 与 Fill 之间切换。
图标定义均为 static const IconData,支持 Flutter release 构建的字体裁剪;不要在运行时
用 codepoint 创建图标。当前不包含 Duotone。
资源来自 Phosphor web 2.1.2,固定提交
3d40a3eaa73b25d20d263f0e1e55c9fed3e66809。来源路径、字体及原始映射 SHA-256
保存在 tool/phosphor/catalog.json,MIT 许可证随资源打包在
assets/fonts/PHOSPHOR_LICENSE.txt。
在本包目录执行以下命令,生成过程只依赖 Python 标准库,不联网:
python3 tool/generate_icons.py
python3 tool/generate_icons.py --check
升级时选定上游完整提交 SHA,并执行 python3 tool/generate_icons.py --update <COMMIT_SHA>。
脚本从同一提交下载 Regular、Fill 字体及映射,保留上游别名,验证两套目录一致,再生成
Dart 常量。字体、目录快照、生成代码和许可证一起提交。升级后运行图标测试及一次带字体
裁剪的 release 构建,确认资源可加载、图形正确。