This should be documented or auto renamed
I would propose that replacement_rules should affect Enum names too
Class 'O' can't define static member 'index' and have instance member 'O.index' with the same name.
Try renaming the member to a name that doesn't conflict.dart(conflicting_static_and_instance)
@JsonEnum()
enum O {
@JsonValue('-index')
index('-index'),
@JsonValue('-name')
name('-name'),
/// Default value for all unparsed values, allows backward compatibility when adding new values on the backend.
$unknown(null);
const O(this.json);
factory O.fromJson(String json) => values.firstWhere(
(e) => e.json == json,
orElse: () => $unknown,
);
final String? json;
}
This should be documented or auto renamed I would propose that
replacement_rules
should affect Enum names too