VSNodeManager constructor
VSNodeManager({
- required List nodeBuilders,
- String? serializedNodes,
- void onNodesUpdate(
- Map<
String, VSNodeData> oldData, - Map<
String, VSNodeData> newData
- Map<
- dynamic onBuilderMissing(
- Map nodeJSON
- List<
VSNodeDataBuilder> ? additionalNodes,
Holds all relevant node data
Handles interactions with the data
Creates an instance of VSNodeSerializationManager to handle serializations
Implementation
VSNodeManager({
required List<dynamic> nodeBuilders,
String? serializedNodes,
this.onNodesUpdate,
///This function gets called when a node failed to deserialize due to a missing builder
///
///The nodeJSON in question is given as a parameter
Function(Map nodeJSON)? onBuilderMissing,
///These nodes will not be part of [contextNodeBuilders]
///
///They will only be used for deserialization
List<VSNodeDataBuilder>? additionalNodes,
}) {
serializationManager = VSNodeSerializationManager(
nodeBuilders: nodeBuilders,
onBuilderMissing: onBuilderMissing,
additionalNodes: additionalNodes,
);
if (serializedNodes != null) {
_nodes = serializationManager.deserializeNodes(serializedNodes);
}
}