layerById method

StyleMenuLayer? layerById(
  1. String id
)

Returns the layer with the given id, or null if it does not exist.

Implementation

StyleMenuLayer? layerById(String id) {
  for (final layer in layers) {
    if (layer.id == id) return layer;
  }
  return null;
}