feat: 实现导航页基础功能
- 添加导航条目和分类数据模型 - 实现导航卡片网格展示 - 支持点击卡片打开链接 - 添加主题样式(渐变色、卡片阴影) - 区分系统默认和自定义条目 - 添加分类统计信息"
This commit is contained in:
@@ -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