feat: 实现导航页基础功能

- 添加导航条目和分类数据模型
- 实现导航卡片网格展示
- 支持点击卡片打开链接
- 添加主题样式(渐变色、卡片阴影)
- 区分系统默认和自定义条目
- 添加分类统计信息"
This commit is contained in:
2026-09-06 21:44:33 +08:00
parent a484d42a29
commit 4075519075
6 changed files with 424 additions and 97 deletions

View File

@@ -0,0 +1,28 @@
import 'nav_item.dart';
// 导航分类模型
class Category {
final String id; // 分类唯一标识
final String name; // 分类名称
final bool isSystem; // 是否系统分类true=不可修改)
final List<NavItem> entries; // 该分类下的导航条目
Category({
required this.id,
required this.name,
required this.isSystem,
required this.entries,
});
// 从 JSON 创建
factory Category.fromJson(Map<String, dynamic> json) {
return Category(
id: json['id'],
name: json['name'],
isSystem: json['isSystem'] ?? false,
entries: (json['entries'] as List)
.map((e) => NavItem.fromJson(e))
.toList(),
);
}
}