addLayer method

void addLayer(
  1. Layer layer
)

Implementation

void addLayer(Layer layer) {
  if (layers[currentIndex] != null) {
    layers[currentIndex]?.add(layer);
  } else {
    layers.addAll({
      currentIndex: [layer]
    });
  }
}