generate method

String generate()

generates the fields for the subject

Implementation

String generate() {
  final genName = '_\$${subject.name}Fields';

  final fields = subject.fields.map((field) {
    return "final ${field.cleanName} = '${field.key}';";
  });

  return '''
class $genName {
const $genName();

${fields.join('\n')}
}
''';
}