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 @@
// 导航条目模型
class NavItem {
final String id; // 唯一标识
final String title; // 显示名称
final String url; // 链接地址
final String icon; // 图标emoji 或文字)
final bool isSystem; // 是否系统默认true=不可修改)
// 构造函数
NavItem({
required this.id,
required this.title,
required this.url,
required this.icon,
required this.isSystem,
});
// 从 JSON 创建对象(后续从后端获取数据时使用)
factory NavItem.fromJson(Map<String, dynamic> json) {
return NavItem(
id: json['id'],
title: json['title'],
url: json['url'],
icon: json['icon'] ?? '🔗',
isSystem: json['isSystem'] ?? false,
);
}
}