UIComponentAsync constructor
UIComponentAsync(
- Object? parent,
- RenderPropertiesProvider? _renderPropertiesProvider,
- RenderAsync? _renderAsync,
- dynamic loadingContent,
- dynamic errorContent, {
- Duration? refreshInterval,
- bool cacheRenderAsync = true,
- dynamic componentClass,
- dynamic componentStyle,
- dynamic classes,
- dynamic classes2,
- dynamic style,
- dynamic style2,
- dynamic id,
- UIComponentGenerator<
UIComponent> ? generator, - 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();
}
}