clear method

void clear()

Implementation

void clear() {
  fields ??= <T>[];
  fields!.clear();
}