Component class abstract
Describes the configuration for an Element.
Components are the central class hierarchy in the jaspr framework and have the same structure and purpose as components do in Flutter. A component is an immutable description of part of a user interface. Components can be inflated into elements, which manage the underlying DOM.
Components themselves have no mutable state (all their fields must be final). If you wish to associate mutable state with a component, consider using a StatefulComponent, which creates a State object (via StatefulComponent.createState) whenever it is inflated into an element and incorporated into the tree.
A given component can be included in the tree zero or more times. In particular a given component can be placed in the tree multiple times. Each time a component is placed in the tree, it is inflated into an Element, which means a component that is incorporated into the tree multiple times will be inflated multiple times.
The key property controls how one component replaces another component in the tree. If the runtimeType and key properties of the two components are operator==, respectively, then the new component replaces the old component by updating the underlying element (i.e., by calling Element.update with the new component). Otherwise, the old element is removed from the tree, the new component is inflated into an element, and the new element is inserted into the tree.
See also:
- StatefulComponent and State, for components that can build differently several times over their lifetime.
- InheritedComponent, for components that introduce ambient state that can be read by descendant components.
- StatelessComponent, for components that always build the same way given a particular configuration and ambient state.
- Implementers
- Annotations
Properties
Methods
-
createElement(
) → Element - Inflates this configuration to a concrete instance.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited