I have this issue with one property on my model that I cannot rename, nor set an attribute on (backwards compatibility with other clients).
The property is called context but the generated code by dart-ref is using TypeContext context = _ctx; in each generated class. Thereby context is giving issues because it cannot be used.
Is there any other way to have this TypeContext context = _ctx have a less common name?
Ok; note that the property generated is now Context (capital C).
What are the rules for replacing keywords in the dart generator? Maybe you can add an option that you can append something instead, like context_value where _value is the suffix?
It’s simply capitalizes the first char it as done in other generators, not making it any more complicated than that. The goal should be to avoid using them in your DTOs.