FileGenerator class

Generates the Dart output files for one .proto input file.

Outputs include .pb.dart, pbenum.dart, and .pbjson.dart.

Inheritance

Constructors

FileGenerator(FileDescriptorProto descriptor, GenerationOptions options)

Properties

binaryDescriptorName String
no setterinherited
classname String
no setteroverride
clientApiGenerators List<ClientApiGenerator>
final
descriptor → FileDescriptorProto
final
dottedName String
The fully qualified name with a leading '.'.
no setterinherited
enumCount int
Returns the number of enum types generated in the .pbenum.dart file.
no setter
enumGenerators List<EnumGenerator>
final
extensionGenerators List<ExtensionGenerator>
final
fieldPath List<int>
The field path contains the field IDs and indices (for repeated fields) that lead to the proto member corresponding to a piece of generated code. Repeated fields in the descriptor are further identified by the index of the message in question. For more information see https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/descriptor.proto#L728
no setteroverride
fileGen FileGenerator
The generator of the .pb.dart file defining this entity.
no setteroverride
fileImportPrefix String
no setterinherited
fullName String
no setteroverride
grpcGenerators List<GrpcServiceGenerator>
final
hashCode int
The hash code for this object.
no setterinherited
messageGenerators List<MessageGenerator>
final
options → GenerationOptions
final
package String
no setteroverride
parent ProtobufContainer?
no setteroverride
protoFileUri Uri
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
serviceGenerators List<ServiceGenerator>
final
syntax ProtoSyntax
final
toplevelParent ProtobufContainer?
The top-level parent of this entity, or itself if it is a top-level entity.
no setterinherited
usedExtensionNames Set<String>
final
usedTopLevelNames Set<String>
Used to avoid collisions after names have been mangled to match the Dart style.
final
usedTopLevelServiceNames Set<String>
Used to avoid collisions in the service file after names have been mangled to match the dart style.
final

Methods

findMixinImports() List<String>
Returns a sorted list of imports needed to support all mixins.
generateEnumFile([OutputConfiguration config = const DefaultOutputConfiguration()]) IndentingWriter
Returns the contents of the .pbenum.dart file for this .proto file.
generateFiles(OutputConfiguration config) List<CodeGeneratorResponse_File>
Generates all the Dart files for this .proto file.
generateGrpcFile([OutputConfiguration config = const DefaultOutputConfiguration()]) String
Returns the contents of the .pbgrpc.dart file for this .proto file.
generateJsonFile([OutputConfiguration config = const DefaultOutputConfiguration()]) String
Returns the contents of the .pbjson.dart file for this .proto file.
generateMainFile([OutputConfiguration config = const DefaultOutputConfiguration()]) IndentingWriter
Returns the contents of the .pb.dart file for this .proto file.
generateServerFile([OutputConfiguration config = const DefaultOutputConfiguration()]) String
Returns the contents of the .pbserver.dart file for this .proto file.
makeWriter() IndentingWriter
Creates an IndentingWriter with metadata generation enabled or disabled.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
resolve(GenerationContext ctx) → void
Creates the fields in each message. Resolves field types and extension targets using the supplied context.
toString() String
A string representation of this object.
inherited
writeBinaryDescriptor(IndentingWriter out, String identifierName, String name, GeneratedMessage descriptor) → void
writeMainHeader(IndentingWriter out, [OutputConfiguration config = const DefaultOutputConfiguration()]) → void
Writes the header and imports for the .pb.dart file.

Operators

operator ==(Object other) bool
The equality operator.
inherited