NodeViewModelState.fromClass constructor

NodeViewModelState.fromClass({
  1. required int treeDepth,
  2. required String key,
  3. required NodeViewModelState? parent,
})

Build a NodeViewModelState as a class. A class is a JSON node containing a whole class, a class can have multiple children properties, classes or arrays. Its value is always a Map<String, NodeViewModelState> containing the children information.

Classes always return true when calling isClass and isRoot.

Implementation

factory NodeViewModelState.fromClass({
  required int treeDepth,
  required String key,
  required NodeViewModelState? parent,
}) =>
    NodeViewModelState._(
      isClass: true,
      key: key,
      treeDepth: treeDepth,
      parent: parent,
    );