clear method Null safety

void clear()

Implementation

void clear() {
  _ensureWritable('clear');
  _fields.clear();
}