addField method

void addField(
  1. Type type,
  2. TypeVariantParameterNode field
)

Implementation

void addField(Type type, TypeVariantParameterNode field) {
  _constructorParameters.add(
    Parameter((builder) {
      builder.name = field.name.lexeme;
      builder.named = true;
      builder.required = true;
      builder.toThis = true;
    }),
  );

  _fields.add(
    Field((builder) {
      builder.modifier = FieldModifier.final$;
      builder.name = field.name.lexeme;
      builder.type = _buildTypeReference(type);
    }),
  );
}