clear method Null safety

void clear()

Clears the collection.

Implementation

void clear() {
  if (_field != null && _field!._isLoadedField) {
    final _PdfArray list = _getItems().._clear();
    _field!._dictionary.setProperty(_DictionaryProperties.opt, list);
  } else {
    _items._clear();
  }
  _list.clear();
}