Add SkillNodeData data model for skill tree

The SkillNodeData model aggregates various data related to a skill node.
It includes:
- Node name
- Node category
- Associated task
- Dependencies
- Cutoff value
- Ground object for evaluation details
- Info object for metadata
pull/5189/head
hunteraraujo 2023-09-10 13:56:59 -07:00
parent 5ed6a08c22
commit 5726613dfb
1 changed files with 34 additions and 0 deletions

View File

@ -0,0 +1,34 @@
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;
SkillNodeData({
required this.name,
required this.category,
required this.task,
required this.dependencies,
required this.cutoff,
required this.ground,
required this.info,
});
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'],
ground: Ground.fromJson(json['ground']),
info: Info.fromJson(json['info']),
);
}
}