feat: 实现导航页基础功能
- 添加导航条目和分类数据模型 - 实现导航卡片网格展示 - 支持点击卡片打开链接 - 添加主题样式(渐变色、卡片阴影) - 区分系统默认和自定义条目 - 添加分类统计信息"
This commit is contained in:
@@ -155,6 +155,33 @@ abstract final class AppSizes {
|
||||
/// 悬停时上移距离(`translateY(-3px)`)。
|
||||
static const double backToTopHoverLift = 3;
|
||||
|
||||
// ---- 通用间距 ----
|
||||
//
|
||||
// 上面的常量按「用在哪」命名;表单这类地方间距是通用的,
|
||||
// 这里给一套通用刻度,避免在组件里写裸数字。
|
||||
static const double spaceXs = 4;
|
||||
static const double spaceSm = 8;
|
||||
static const double spaceMd = 12;
|
||||
static const double spaceLg = 16;
|
||||
static const double spaceXl = 24;
|
||||
|
||||
// ---- 表单 ----
|
||||
|
||||
/// 对话框内边距。
|
||||
static const double dialogPadding = 24;
|
||||
|
||||
/// 对话框最大宽度。
|
||||
static const double dialogMaxWidth = 480;
|
||||
|
||||
/// 字段标签与输入框之间的间距。
|
||||
static const double fieldLabelGap = 6;
|
||||
|
||||
/// 多行输入框高度(3 行)。
|
||||
static const double fieldMultilineHeight = 88;
|
||||
|
||||
/// 对话框右上角关闭按钮的点击热区。
|
||||
static const double iconButtonSize = 28;
|
||||
|
||||
// ---- 通用 ----
|
||||
|
||||
/// 通用过渡时长(CSS 里的 `transition: 0.2s`)。
|
||||
|
||||
@@ -44,6 +44,16 @@ abstract final class AppColors {
|
||||
/// 搜索框聚焦时的外发光(`0 0 0 3px rgba(59,130,246,.15)`)。
|
||||
static const Color focusRing = Color(0x263B82F6);
|
||||
|
||||
/// 错误色。
|
||||
///
|
||||
/// `index3.html` 的调色板里没有红色,但表单的字段错误、失败提示需要一个
|
||||
/// 明确区别于正文的颜色,所以新增这一个语义令牌——只用在错误提示上,
|
||||
/// 不参与任何现有视觉。
|
||||
static const Color danger = Color(0xFFE5484D);
|
||||
|
||||
/// 错误色 8% 叠加,用作错误提示条 / 错误输入框的底色。
|
||||
static const Color dangerFaint = Color(0x14E5484D);
|
||||
|
||||
// ---- 阴影 ----
|
||||
|
||||
/// 卡片默认阴影(`--shadow`)。
|
||||
|
||||
@@ -9,3 +9,9 @@ String firstChar(String text, {String fallback = '·'}) {
|
||||
}
|
||||
return String.fromCharCode(text.runes.first);
|
||||
}
|
||||
|
||||
/// 字符数(不是字节数)。
|
||||
///
|
||||
/// 和后端 `util::char_count` 的口径一致:先去掉首尾空白,再数字符。
|
||||
/// 中文一个字算一个,所以「最多 60 个字符」用 `runes.length` 而不是 `length`。
|
||||
int charCount(String text) => text.trim().runes.length;
|
||||
|
||||
Reference in New Issue
Block a user