toJsonNodeGetters method

List<String> toJsonNodeGetters(
  1. String key
)

Generate getters.

{@category generator}

Implementation

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

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

  return output;
}