UIComponent class abstract

Base class to create Bones_UI components.

Inheritance
Implementers
Available extensions

Constructors

UIComponent(Object? parent, {dynamic componentClass, dynamic componentStyle, dynamic classes, dynamic classes2, dynamic style, dynamic style2, UIComponentClearParent? clearParent, bool inline = true, bool construct = true, bool renderOnConstruction = false, bool preserveRender = false, dynamic id, UIComponentGenerator<UIComponent>? generator})

Properties

clearParent → UIComponentClearParent?
final
componentInternals → UIComponentInternals
no setter
constructing → bool?
no setter
content → UIElement?
no setter
dataSource → DataSource?
no setter
dataSourceCall ↔ DataSourceCall?
getter/setter pair
dataSourceCallString → String
no setter
globalID → int
final
hasDataSource → bool
no setter
hashCode → int
The hash code for this object.
no setterinherited
id ↔ dynamic
getter/setter pair
isInDOM → bool
no setter
isLoadingUIAsyncContent → bool
no setter
isRefreshFromExternalCall → bool
no setter
isRendered → bool
no setter
isRenderedWithError → bool
Returns true if current/last render had errors.
no setter
isRendering → bool
no setter
isShowing → bool
no setter
localeChangedFromLastRender → bool
no setter
onChange ↔ EventStream
getter/setter pair
onRender → EventStream<UIComponent>
final
parent → UIElement?
no setter
parentUIComponent → UIComponent?
The parent UIComponent.
no setter
preserveRender ↔ bool
If true will preserve last render in next calls to render.
getter/setter pair
preserveRenderCount → int
no setter
refreshOnNavigate ↔ bool
getter/setter pair
renderCount → int
no setter
renderedElements → List?
no setter
renderedElementsAsync → bool
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
subUIComponents → List<UIComponent>
Returns a List of sub UIComponent.
no setter
subUIComponentsDeeply → Iterable<UIComponent>
Returns a List of sub UIComponent deeply in the tree.
no setter
uiRoot → UIRoot?
Returns the UIRoot that is parent of this UIComponent instance, or null if it's not in an UIRoot components tree.
no setter
uiRootComponent → UIRootComponent?
Returns the UIRootComponent that is parent of this UIComponent instance, or null if it's not in an UIRoot components tree.
no setter

Methods

action(String action) → void
addTo(UIElement parent, {UIComponent? parentUIComponent}) → void
appendAttribute(String? name, dynamic value) → bool
appendAttributes(Iterable<DOMAttribute> attributes) → bool
appendClasses(Object? classes1, [Object? classes2]) → void
appendStyle(Object? style1, [Object? style2, Object? style3]) → void
appendToContent(List<UINode> nodes) → bool
applyData(dynamic data) → bool
callRender([bool clear = false]) → void
callRenderAndWait({Duration timeout = const Duration(seconds: 3)}) → Future<bool>
callRenderAsync() → void
clear({bool force = false, bool removeFromParent = false}) → void
Clears the component, removing the last rendered content.
clearAttribute(String? name) → bool
clearContent() → bool
clearPreservedRender() → void
Clears previous rendered elements. Only relevant if preserveRender is true.
click() → void
Calls: content.click
clone() → UIComponent?
configure() → void
Called by constructor, to configure this component.
configureClasses(Object? classes1, [Object? classes2, Object? componentClasses]) → void
configureID() → void
configureStyle(Object? style1, [Object? style2, Object? componentStyle]) → void
connectDataSource() → void
createContentElement(bool inline) → UIElement
delete() → void
deniedAccessRoute() → String?
deviceSizeChangedFromLastRender({double tolerance = 0.10, bool onlyWidth = false, bool onlyHeight = false}) → bool
ensureRendered([bool force = false]) → void
findChildDeep(FilterElement filter) → List<UIElement>
findChildrenDeep(String fieldName, {bool resolveUIComponents = true}) → MapEntry<String, Object>?
findInContentChildDeep(FilterElement filter) → UIElement?
findUIComponentByChild(UIElement? child) → UIComponent?
findUIComponentByContent(UIElement? content) → UIComponent?
findUIComponentByID(String id) → UIComponent?
fireEvent(String type, dynamic event, [List? params]) → void
inherited
focusField(String? fieldName) → bool
forEachEmptyFieldComponent(ForEachComponent f) → int
forEachEmptyFieldElement(ForEachElement f) → int
forEachFieldComponent(ForEachComponent f) → int
forEachFieldElement(ForEachElement f) → int
getAllRenderedElements(FilterRendered filter, [bool deep = false]) → List?
getAttribute(String? name) → dynamic
getComponentFieldName(Object obj) → String?
getContentChildren({FilterElement? filter, bool deep = true}) → List<UIElement>
getElementFieldName(UIElement element, {bool resolveUIComponents = true}) → String?
getEmptyFields() → List<String>
getField(String? fieldName, [String? def]) → String?
getFieldAs<T>(String? fieldName, [T? def]) → T?
getFieldComponent(String? fieldName, {bool resolveUIComponents = true}) → Object?
getFieldElement<E extends UIElement>(String? fieldName) → E?
getFieldElementByValue(String? fieldName, String value, {bool resolveUIComponents = true}) → UIElement?
getFieldElements(String? fieldName) → List<UIElement>
getFieldExtended<V>(String? fieldName, [V? def]) → V?
getFields({List<String>? fields, List<String>? ignoreFields, bool resolveUIComponents = true}) → Map<String, String?>
getFieldsComponents() → List<Object>
getFieldsComponentsMap({List<String>? fields, List<String>? ignoreFields}) → Map<String, Object>
getFieldsElements() → List<UIElement>
getFieldsElementsMap({List<String>? fields, List<String>? ignoreFields, bool resolveUIComponents = true}) → Map<String, UIElement>
getFieldsExtended({List<String>? fields, List<String>? ignoreFields}) → Map<String, Object?>
getFieldsGroupByPrefix<K, V>(String groupPrefix, {Map<String, String?>? fields, String keyDelimiter = '_', String keyPart(String key)?, K keyAs(String key)?, V? valueAs(String key)?, bool filter(K key, V? value)?}) → Map<K, V?>
getFieldsGroupCheckedKeys<K>(String groupPrefix, {Map<String, String?>? fields, String keyDelimiter = '_', String keyPart(String key)?, K keyAs(String key)?}) → List<K>
getFieldsGroupChecks<K>(String groupPrefix, {Map<String, String?>? fields, String keyDelimiter = '_', String keyPart(String key)?, K keyAs(String key)?, bool filter(K key, bool? value)?}) → Map<K, bool>
getFieldsGroupEntriesByPrefix<K, V>(String groupPrefix, {Map<String, String?>? fields, String keyDelimiter = '_', String keyPart(String key)?, K keyAs(String key)?, V? valueAs(String key)?, bool filter(K key, V? value)?}) → List<MapEntry<K, V?>>
getFieldsGroupKeysByPrefix<K>(String groupPrefix, {Map<String, String?>? fields, String keyDelimiter = '_', String keyPart(String key)?, K keyAs(String key)?, bool filter(K key, Object? value)?}) → List<K>
getFieldsGroupListByPrefix<K, V>(String groupPrefix, {Map<String, String?>? fields, String keyDelimiter = '_', String keyPart(String key)?, K keyAs(String key)?, V? valueAs(String key)?, bool filter(K key, V? value)?}) → Map<K, List<V>>
getFieldsGroupValuesByPrefix<V>(String groupPrefix, {Map<String, String?>? fields, String keyDelimiter = '_', String keyPart(String key)?, V? valueAs(String key)?, bool filter(Object key, V? value)?}) → List<V>
getFieldsNames() → List<String>
getPreviousRenderedFieldValue(String? fieldName) → dynamic
getRenderedElement(FilterRendered filter, [bool? deep]) → dynamic
getRenderedElementById(dynamic id, [bool deep = false]) → dynamic
getRenderedElementValueById(dynamic id, [bool deep = false]) → dynamic
getRenderedUIComponentById<T extends UIComponent>(dynamic id, [bool? deep]) → T?
getRenderedUIComponentByType<T>([bool? deep]) → List<T>
getRenderedUIComponents([bool? deep]) → Iterable<UIComponent>
getRenderedUIComponentsByIds<T extends UIComponent>(List ids, [bool? deep]) → List<UIComponent>
hasEmptyField() → bool
hide() → void
Hide component.
insertTo(int index, UIElement parent, {UIComponent? parentUIComponent}) → void
isAccessible() → bool
isEmptyField(String? fieldName) → bool
markRenderedWithError() → void
Marks current/last render with error.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onChildRendered(UIComponent child) → void
onPreConstruct() → void
Called in the beginning of constructor.
parseChildElementValue(UIElement? childElement, {UIComponent? childUiComponent, bool allowTextAsValue = true, bool resolveUIComponents = true}) → String?
posAsyncRender() → void
posRender() → void
Called after render.
preRender() → void
Called before render.
preRenderClear() → void
querySelector<E extends UIElement>(String? selectors) → E?
Alias to content.querySelector.
querySelectorAll<T extends UIElement>(String? selectors) → List<T>
Alias to content.querySelectorAll.
refresh({bool forceRender = false}) → void
Refreshes the component, calling render.
refreshDataSource() → void
refreshIfLocaleChanged() → void
refreshInternal() → void
registerEventListener(String type, UIEventListener listener) → void
inherited
registerInUIRoot() → void
Called by constructor to register this component in the UIRoot tree.
render() → dynamic
Renders the elements of this component.
renderError(dynamic error) → dynamic
Called when render returns a Future value, to render the content when Future has an error.
renderLoading() → dynamic
Called when render returns a Future value, to render the content while loading Future.
renderTestUI({int ms = 100}) → Future<int>

Available on UIComponent, provided by the TestUIComponentExtension extension

requestRefresh({Duration? delay}) → void
Requests a refresh using Future.microtask or Future.delayed.
resolveTextIntl(String text) → String
Resolves text {{intl:key}} messages.
select<E extends UIElement>(String? selectors) → E?

Available on UIComponent?, provided by the TestUIComponentNullableExtension extension

selectAll<E extends Element>(String? selectors) → List<E>

Available on UIComponent?, provided by the TestUIComponentNullableExtension extension

selectElement<E extends UIElement>(String? selectors) → E?
Alias to content.querySelector.
selectElements<T extends UIElement>(String? selectors) → List<T>
Alias to content.querySelectorAll.
selectElementsValues<T extends UIElement>(String? selectors) → Map<String, String?>
Alias to content.querySelectorAll.
selectExpected<E extends UIElement>(String? selectors) → E

Available on UIComponent?, provided by the TestUIComponentNullableExtension extension

setAttribute(String? name, dynamic value) → bool
setAttributes(Iterable<DOMAttribute> attributes) → bool
setContentNodes(List<UINode> nodes) → bool
setData(dynamic data) → bool
setField(String fieldName, dynamic value) → void
setID(Object? id) → void
setParent(UIElement parent, {UIComponent? parentUIComponent}) → UIElement?
Sets the parent UIElement.
show() → void
Show component.
simplify({bool trim = true, bool collapseSapces = true, bool lowerCase = true, String nullValue = ''}) → String

Available on UIComponent?, provided by the TestUIComponentNullableExtension extension

toContentElements(dynamic rendered, {bool append = false, bool parseAttributes = true}) → List
toRenderableList(Object? list, [DOMContext<UINode>? domContext]) → List?
toString() → String
A string representation of this object.
inherited
updateRenderedFieldElementValue(UIElement fieldElem) → void
updateRenderedFieldValue(String fieldName) → void
waiteRender({Duration timeout = const Duration(seconds: 3)}) → Future<bool>

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Properties

domContext → DOMContext<UINode>
The DOMContext of the domGenerator.
no setter
domGenerator → UIDOMGenerator
The UIDOMGenerator used by Bones_UI.
final
isAnyComponentRendering → bool
no setter
renderingUIComponent → UIComponent?
Returns the current synchronous rendering UIComponent in the rendering stack.
no setter

Static Methods

copyRenderable(dynamic element, [dynamic def]) → dynamic
getContentUIComponent(UIElement content) → UIComponent?
isRenderable(dynamic element) → bool
parentRenderingUIComponent(UIComponent uiComponent) → UIComponent?
Returns the parent rendering UIComponent for the parameter uiComponent.
parseAttributeValueAsString(dynamic value, [String? delimiter, Pattern? delimiterPattern]) → String
parseAttributeValueAsStringList(dynamic value, [Pattern? delimiter]) → List<String>?
parseClasses(Object? classes1, [Object? classes2]) → List<String>
parseStyle(dynamic style1) → List<String>
registerGenerator(UIComponentGenerator<UIComponent> generator) → bool
Register a generator for a type of UIComponent.
resolveParentUIComponent({UINode? parent, UINode? element, UIComponent? parentUIComponent, UIComponent? elementUIComponent, bool recursive = false}) → void