UIComponentAsync constructor

UIComponentAsync(
  1. Object? parent,
  2. RenderPropertiesProvider? _renderPropertiesProvider,
  3. RenderAsync? _renderAsync,
  4. dynamic loadingContent,
  5. dynamic errorContent, {
  6. Duration? refreshInterval,
  7. bool cacheRenderAsync = true,
  8. dynamic componentClass,
  9. dynamic componentStyle,
  10. dynamic classes,
  11. dynamic classes2,
  12. dynamic style,
  13. dynamic style2,
  14. dynamic id,
  15. UIComponentGenerator<UIComponent>? generator,
  16. bool renderOnConstruction = false,
})

Constructs a UIComponentAsync.

Note: if an attempt to render happens with the same properties of previously rendered content it will be ignored.

_renderPropertiesProvider Provider of the properties of rendered content. _renderAsync Function that renders the component. loadingContent Content to show while loading. errorContent Content to show on error. refreshInterval Refresh interval Duration.

Implementation

UIComponentAsync(super.parent, this._renderPropertiesProvider,
    this._renderAsync, this.loadingContent, this.errorContent,
    {this.refreshInterval,
    this.cacheRenderAsync = true,
    super.componentClass,
    super.componentStyle,
    super.classes,
    super.classes2,
    super.style,
    super.style2,
    super.id,
    super.generator,
    bool renderOnConstruction = false})
    : super(renderOnConstruction: false) {
  _renderPropertiesProvider ??= renderPropertiesProvider;
  _renderAsync ??= renderAsync;

  if (renderOnConstruction) {
    callRender();
  }
}