createEmbeddedView method

EmbeddedViewRef createEmbeddedView()

Instantiates an instance of the provided template.

Implementation

EmbeddedViewRef createEmbeddedView() {
  // The unsafe cast is necessary because a view container's parent may be any
  // kind of view, but this method is only ever called when the parent view is
  // a `RenderView`.
  final parentView = unsafeCast<RenderView>(_viewContainer.parentView);
  final view = _viewFactory(parentView, _viewContainer.index);
  view.create();
  return view;
}