addField method

void addField(
  1. Reference type,
  2. ParameterElement field
)

Implementation

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

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