buildViewModelNodes function

  1. @visibleForTesting
Map<String, NodeViewModelState> buildViewModelNodes(
  1. dynamic object
)

Builds NodeViewModelState nodes based on a decoded json object.

The return Map<String, NodeViewModelState> has the same structure as the decoded object, except that every class, array and property is now a NodeViewModelState.

Implementation

@visibleForTesting
Map<String, NodeViewModelState> buildViewModelNodes(dynamic object) {
  if (object is Map<String, dynamic>) {
    return _buildClassNodes(object: object);
  }
  return _buildClassNodes(object: <String, dynamic>{'data': object});
}