toJsonNodeSetters method

List<String> toJsonNodeSetters(
  1. String key
)

Generate setters.

{@category generator}

Implementation

List<String> toJsonNodeSetters(String key) {
  final output = <String>[];

  var index = 0;
  while (index < values.length) {
    output.add("""
        case $className.${values[index]}:
          return const JsonString(key: "$key", data: "${valuesJSON[index]}");
        """);
    index += 1;
  }

  return output;
}