Use `@JsonValue` annotation for Enum value when value is specified
myConsciousness opened this issue · comments
1. What could be improved
Like:
{
"enums": {
"product_type": [
{
"name": "sweet",
"value": 0
}
]
}
}
import 'package:json_annotation/json_annotation.dart';
enum ProductType {
@JsonValue(0)
sweet(0);
final int value;
const ProductType(this.value);
}