renderAsync method

Future renderAsync(
  1. MapProperties properties
)

Implementation

Future<dynamic> renderAsync(MapProperties properties) async {
  if (_controllers == null) {
    var controllers = await renderControllers(properties);
    _controllers = _resolveControllers(controllers);
    await listenControllers(_controllers!);
  }

  await setupControllers(properties, _controllers);

  var validSetup = isValidControllersSetup(properties, _controllers);

  if (!validSetup) {
    return renderOnlyControllers(properties, _controllers);
  }

  var resultLoadingContent =
      this.resultLoadingContent ?? UIComponent.copyRenderable(loadingContent);
  var resultErrorContent =
      this.resultErrorContent ?? UIComponent.copyRenderable(errorContent);

  if (!UIComponentAsync.isValidComponentAsync(
      _componentAsyncResult, properties)) {
    _componentAsyncResult = UIComponentAsync(
        content,
        getControllersProperties,
        (props) => renderResult(props as MapProperties),
        resultLoadingContent,
        resultErrorContent,
        id: '$id/_componentAsyncResult');
  }

  return renderControllersAndResult(
      properties, _controllers, _componentAsyncResult);
}