updateAttributes method

void updateAttributes(
  1. Attributes attributes
)

Implementation

void updateAttributes(Attributes attributes) {
  final oldAttributes = this.attributes;

  _attributes = composeAttributes(this.attributes, attributes) ?? {};

  // Notifies the new attributes
  // if attributes contains 'subtype', should notify parent to rebuild node
  // else, just notify current node.
  bool shouldNotifyParent =
      this.attributes['subtype'] != oldAttributes['subtype'];
  shouldNotifyParent ? parent?.notifyListeners() : notifyListeners();
}