feat: 实现导航页基础功能
- 添加导航条目和分类数据模型 - 实现导航卡片网格展示 - 支持点击卡片打开链接 - 添加主题样式(渐变色、卡片阴影) - 区分系统默认和自定义条目 - 添加分类统计信息"
This commit is contained in:
@@ -14,6 +14,8 @@ class LinkSectionView extends StatelessWidget {
|
||||
super.key,
|
||||
required this.section,
|
||||
required this.onOpen,
|
||||
this.onEdit,
|
||||
this.onDelete,
|
||||
});
|
||||
|
||||
/// 分组数据。
|
||||
@@ -22,6 +24,12 @@ class LinkSectionView extends StatelessWidget {
|
||||
/// 打开某个站点。
|
||||
final ValueChanged<LinkItem> onOpen;
|
||||
|
||||
/// 编辑某个站点;为空时卡片不显示编辑入口。
|
||||
final ValueChanged<LinkItem>? onEdit;
|
||||
|
||||
/// 删除某个站点;为空时卡片不显示删除入口。
|
||||
final ValueChanged<LinkItem>? onDelete;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Column(
|
||||
@@ -47,7 +55,12 @@ class LinkSectionView extends StatelessWidget {
|
||||
for (final LinkItem item in section.items)
|
||||
SizedBox(
|
||||
width: itemWidth,
|
||||
child: LinkCard(item: item, onOpen: () => onOpen(item)),
|
||||
child: LinkCard(
|
||||
item: item,
|
||||
onOpen: () => onOpen(item),
|
||||
onEdit: onEdit == null ? null : () => onEdit!(item),
|
||||
onDelete: onDelete == null ? null : () => onDelete!(item),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user