addComponent method Null safety

void addComponent(
  1. Component component
)

Adds a component to the artboard. Good place for the artboard to check for components it'll later need to do stuff with (like draw them or sort them when the draw order changes).

Implementation

void addComponent(Component component) {
  if (!_components.add(component)) {
    return;
  }
}