check method Null safety

void check()

Implementation

void check() {
  if (!isInitialized()) {
    var invalidFields = <String>[];
    _fieldSet._appendInvalidFields(invalidFields, '');
    var missingFields = (invalidFields..sort()).join(', ');
    throw StateError('Message missing required fields: $missingFields');
  }
}