toDeclaration method

String toDeclaration(
  1. String className
)

Implementation

String toDeclaration(String className) {
  var declaration = '';

  if (isEnum) {
    declaration += '${getEnum(className).toImport()}\n';
  } else if (overrideEnabled) {
    declaration += '@override ';
  }

  declaration += 'final $type$isNullableString $name${stringifyAssignment(assignment)};'.trim();

  return ModelTemplates.indented(declaration);
}