NodeViewModelState.fromArray constructor

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

Build a NodeViewModelState as an array. An array is a JSON node containing an array of objects, each element inside the array is represented by another NodeViewModelState. Thus it can be values or classes. Its value is always a List<NodeViewModelState> containing the children information.

Arrays always return true when calling isArray and isRoot.


factory NodeViewModelState.fromArray({
  required int treeDepth,
  required String key,
  required NodeViewModelState? parent,
}) =>
      isArray: true,
      key: key,
      treeDepth: treeDepth,
      parent: parent,