File size: 1,057 Bytes
b225a21
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import 'package:auto_gpt_flutter_client/models/skill_tree/ground.dart';
import 'package:auto_gpt_flutter_client/models/skill_tree/info.dart';

class SkillNodeData {
  final String name;
  final List<String> category;
  final String task;
  final List<String> dependencies;
  final int cutoff;
  final Ground ground;
  final Info info;
  final String evalId;

  SkillNodeData({
    required this.name,
    required this.category,
    required this.task,
    required this.dependencies,
    required this.cutoff,
    required this.ground,
    required this.info,
    required this.evalId,
  });

  factory SkillNodeData.fromJson(Map<String, dynamic> json) {
    return SkillNodeData(
      name: json['name'] ?? "",
      category: List<String>.from(json['category'] ?? []),
      task: json['task'] ?? "",
      dependencies: List<String>.from(json['dependencies'] ?? []),
      cutoff: json['cutoff'] ?? 0,
      ground: Ground.fromJson(json['ground'] ?? {}),
      info: Info.fromJson(json['info'] ?? {}),
      evalId: json['eval_id'] ?? "",
    );
  }
}