createViewModel method

void createViewModel()

Implementation

void createViewModel() {
  if (_deleteIds.isNotEmpty) {
    for (final deleteId in _deleteIds) {
      _controllerManager.deleteChild(
        _viewModel,
        _viewModel?.childFromId(deleteId),
      );
    }
    _deleteIds.clear();
    _notifyManageChildren = true;
  }

  if (isDelete && isRoot && !_isRootHasDelete) {
    _isRootHasDelete = true;
    _controllerManager.deleteRoot(_root.id, _root);
  }

  var parent = _parent;
  if (shouldCreateView && !isRoot && parent != null) {
    _propToUpdate = null;
    parent.addChildToPendingList(this);
    return _controllerManager.createViewModel(this, props);
  }

  return;
}