EnumDeclarationImpl constructor

EnumDeclarationImpl({
  1. required CommentImpl? comment,
  2. required List<AnnotationImpl>? metadata,
  3. required Token enumKeyword,
  4. required Token name,
  5. required TypeParameterListImpl? typeParameters,
  6. required WithClauseImpl? withClause,
  7. required ImplementsClauseImpl? implementsClause,
  8. required Token leftBracket,
  9. required List<EnumConstantDeclarationImpl> constants,
  10. required Token? semicolon,
  11. required List<ClassMemberImpl> members,
  12. required Token rightBracket,
})

Initialize a newly created enumeration declaration. Either or both of the comment and metadata can be null if the declaration does not have the corresponding attribute. The list of constants must contain at least one value.

Implementation

EnumDeclarationImpl({
  required super.comment,
  required super.metadata,
  required this.enumKeyword,
  required super.name,
  required TypeParameterListImpl? typeParameters,
  required WithClauseImpl? withClause,
  required ImplementsClauseImpl? implementsClause,
  required this.leftBracket,
  required List<EnumConstantDeclarationImpl> constants,
  required this.semicolon,
  required List<ClassMemberImpl> members,
  required this.rightBracket,
})  : _typeParameters = typeParameters,
      _withClause = withClause,
      _implementsClause = implementsClause {
  _becomeParentOf(_typeParameters);
  _becomeParentOf(_withClause);
  _becomeParentOf(_implementsClause);
  _constants._initialize(this, constants);
  _members._initialize(this, members);
}