Element constructor

Element(
  1. BindingContext? context, {
  2. Map<String, dynamic>? defaultStyle,
  3. bool isReplacedElement = false,
  4. bool isDefaultRepaintBoundary = false,
})

Implementation

Element(
  BindingContext? context,
  {
    Map<String, dynamic>? defaultStyle,
    bool isReplacedElement = false,
    bool isDefaultRepaintBoundary = false
  })
  : _defaultStyle = defaultStyle ?? const {},
    _isReplacedElement = isReplacedElement,
    _isDefaultRepaintBoundary = isDefaultRepaintBoundary,
    super(NodeType.ELEMENT_NODE, context) {

  // Init style and add change listener.
  style = CSSStyleDeclaration.computedStyle(this, _defaultStyle, _onStyleChanged);

  // Init render style.
  renderStyle = CSSRenderStyle(target: this);
}