import 'package:json_annotation/json_annotation.dart'; part 'component.g.dart'; @JsonSerializable(fieldRename: FieldRename.snake) class ComponentDTO { ComponentDTO({ required this.articleNr, required this.name, required this.quantity, required this.pos, }); String articleNr; String name; String quantity; String pos; factory ComponentDTO.fromJson(Map json) => _$ComponentDTOFromJson(json); Map toJson() => _$ComponentDTOToJson(this); }