addDependent method Null safety

bool addDependent(
  1. Component dependent,
  2. {Component? via}

Mark dependent as a component which must update after this. Provide via as the Component registering the dependency when it is not dependent itself. At edit time this allows the editor to rebuild both dependent and via when dependent has its dependencies cleared.


bool addDependent(Component dependent, {Component? via}) {
  assert(artboard == dependent.artboard,
      'Components must be in the same artboard.');

  if (!_dependents.add(dependent)) {
    return false;

  return true;