check method

void check()
inherited

Throws a StateError if the message has required fields without a value.

This library does not check in any of the methods that required fields in have values. Use this method if you need to check that required fields have values.

Implementation

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