add method

void add(
  1. Emitter layer, {
  2. bool owned = true,
})

Add layer to the editor. The editor subscribes to its emissions so any layer change repaints / re-emits. Set owned to false when the host retains the layer across tool sessions.

Implementation

void add(Emitter layer, {bool owned = true}) {
  layer.subscribe(notifyListeners).disposeBy(this);
  layers.add(layer);
  if (owned) _ownedLayers.add(layer);
  notifyListeners();
}