ConstructorDeclarationImpl constructor
- required CommentImpl? comment,
- required List<
AnnotationImpl> ? metadata, - required Token? externalKeyword,
- required Token? constKeyword,
- required Token? factoryKeyword,
- required IdentifierImpl returnType,
- required Token? period,
- required Token? name,
- required FormalParameterListImpl parameters,
- required Token? separator,
- required List<
ConstructorInitializerImpl> ? initializers, - required ConstructorNameImpl? redirectedConstructor,
- required FunctionBodyImpl body,
Initialize a newly created constructor declaration. The externalKeyword
can be null
if the constructor is not external. Either or both of the
comment
and metadata
can be null
if the constructor does not have
the corresponding attribute. The constKeyword can be null
if the
constructor cannot be used to create a constant. The factoryKeyword can
be null
if the constructor is not a factory. The period and name can
both be null
if the constructor is not a named constructor. The
separator can be null
if the constructor does not have any
initializers and does not redirect to a different constructor. The list of
initializers
can be null
if the constructor does not have any
initializers. The redirectedConstructor
can be null
if the constructor
does not redirect to a different constructor. The body
can be null
if
the constructor does not have a body.
Implementation
ConstructorDeclarationImpl({
required super.comment,
required super.metadata,
required this.externalKeyword,
required this.constKeyword,
required this.factoryKeyword,
required IdentifierImpl returnType,
required this.period,
required this.name,
required FormalParameterListImpl parameters,
required this.separator,
required List<ConstructorInitializerImpl>? initializers,
required ConstructorNameImpl? redirectedConstructor,
required FunctionBodyImpl body,
}) : _returnType = returnType,
_parameters = parameters,
_redirectedConstructor = redirectedConstructor,
_body = body {
_becomeParentOf(_returnType);
_becomeParentOf(_parameters);
_initializers._initialize(this, initializers);
_becomeParentOf(_redirectedConstructor);
_becomeParentOf(_body);
}