recalculateStyle method

void recalculateStyle()

Implementation

void recalculateStyle() {
  // TODO: current only support class selector in stylesheet
  if (renderBoxModel != null && classList.isNotEmpty) {
    // Diff style.
    CSSStyleDeclaration newStyle = CSSStyleDeclaration();
    _applyStyle(newStyle);
    Map<String, String?> diffs = style.diff(newStyle);
    if (diffs.isNotEmpty) {
      // Update render style.
      diffs.forEach((String propertyName, String? value) {
        style.setProperty(propertyName, value);
      });
      style.flushPendingProperties();
    }
  }
}