removeAt method Null safety

void removeAt(
  1. int index,
  2. [bool isRemoveGraphicalContent = false]
)

Removes layer by its index from collections and may also remove graphical content if isRemoveGraphicalContent is true.

Implementation

void removeAt(int index, [bool isRemoveGraphicalContent = false]) {
  if (index < 0 || index > _list.length - 1) {
    ArgumentError.value(
        '$index Value can not be less 0 and greater List.Count - 1');
  }
  final PdfLayer layer = this[index];
  _list.removeAt(index);
  _removeLayer(layer, isRemoveGraphicalContent);
}