This commit replaces the placeholder implementation of the SkillTreeView class with a complete, functional version.
Features:
- Initializes the skill tree from the SkillTreeViewModel during `initState`.
- Dynamically creates Node and Edge objects for GraphView based on ViewModel data.
- Utilizes the TreeNodeView to render individual nodes.
- Integrates node selection functionality from the ViewModel.
- Adds InteractiveViewer for zoom and pan capabilities.
The new SkillTreeView is designed to work closely with SkillTreeViewModel to manage and display the skill tree.
This commit adds the TreeNodeView class, a StatelessWidget responsible for rendering individual nodes in the skill tree.
Features:
- Displays the node ID in the view.
- Uses the Provider package to interact with the SkillTreeViewModel.
- Includes an onTap method to toggle node selection state.
- Updates the UI to reflect the selected state by changing the background color.
The TreeNodeView is designed to work in conjunction with SkillTreeViewModel to manage node selection states.
The SkillTreeViewModel class serves as the view model for the skill tree and extends Flutter's ChangeNotifier for state management.
Features include:
- Storing and managing the list of SkillTreeNodes and SkillTreeEdges.
- Managing the state of the selected node.
- Initializing the skill tree with predefined nodes and edges.
- Methods for toggling node selection, allowing for only a single node to be selected at any given time.
The view model utilizes the GraphView package for visualization and layout.
The SkillTreeEdge model represents the relationship between different skill nodes.
It includes:
- Edge ID
- Source node ID
- Destination node ID
- Arrows property to indicate directionality
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
The Info data model holds metadata about a skill node.
It includes:
- The difficulty level of the skill node
- A description of the skill node
- A list of potential side effects related to the skill node
The Ground data model stores evaluation information for each skill node.
It includes:
- The answer to be evaluated
- A list of terms that should be contained in the answer
- A list of terms that should not be contained in the answer
- A list of associated files
- A map for additional evaluation criteria