TypeRegistry constructor

TypeRegistry(
  1. Iterable<GeneratedMessage> types
)

Constructs a new TypeRegistry recognizing the given types of messages.

You can use an empty message of the given type to represent the type. Eg:

TypeRegistry([Foo(), Bar()]);

Implementation

TypeRegistry(Iterable<GeneratedMessage> types)
    : _mapping = Map.fromEntries(types.map((message) =>
          MapEntry(message.info_.qualifiedMessageName, message.info_)));