json_serializable.dart
json_serializable.dart copied to clipboard
Support annotations on ctor params when there is no associated field
See https://github.com/dart-lang/json_serializable/issues/285#issuecomment-415609028
@JsonSerializable(createToJson: false)
class LogisticsItem {
final bool logisticsChecked;
final bool logisticsOK;
LogisticsItem(@JsonKey(name: 'LogistikTeileInOrdnung') String processed)
: logisticsChecked = processed != null && processed != 'null',
logisticsOK = processed == 'true';
}