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