setStyle method

  1. @mustCallSuper
void setStyle(
  1. String key,
  2. dynamic value
)
inherited

Implementation

@mustCallSuper
void setStyle(String key, dynamic value) {
  CSSDisplay originalDisplay = CSSDisplayMixin.getDisplay(style[DISPLAY] ?? defaultDisplay);
  style.setProperty(key, value, viewportSize, renderBoxModel?.renderStyle);

  // When renderer and style listener is not created when original display is none,
  // thus it needs to create renderer when style changed.
  if (originalDisplay == CSSDisplay.none && key == DISPLAY && value != NONE) {
    RenderBox? after;
    Element parent = this.parent as Element;
    if (parent.scrollingContentLayoutBox != null) {
      after = parent.scrollingContentLayoutBox!.lastChild;
    } else {
      after = (parent.renderBoxModel as RenderLayoutBox).lastChild;
    }
    attachTo(parent, after: after);
  }
}