clear method Null safety

void clear()

Clears layers from the PdfLayerCollection.

Implementation

void clear() {
  for (int i = 0; i < _list.length; i++) {
    final PdfLayer layer = this[i];
    _removeLayer(layer, true);
  }
  _list.clear();
}