/// 知识点模型 class KnowledgeNode { final String code; final String name; final List children; final String? fullPath; final bool isLeaf; KnowledgeNode({ required this.code, required this.name, this.children = const [], this.fullPath, this.isLeaf = false, }); factory KnowledgeNode.fromJson(Map json) { return KnowledgeNode( code: json['code'] ?? '', name: json['name'] ?? '', children: (json['children'] as List?) ?.map((c) => KnowledgeNode.fromJson(c as Map)) .toList() ?? [], fullPath: json['full_path'], isLeaf: json['full_path'] != null || (json['children'] == null || (json['children'] as List).isEmpty), ); } }