Show pageOld revisionsBacklinksBack to top This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. # json_serializable {{tag>dart json serializable}} ### build.yaml <code> targets: $default: builders: json_serializable: options: # Options configure how source code is generated for every # `@JsonSerializable`-annotated class in the package. # # The default value for each is listed. any_map: true explicit_to_json: true </code> - https://pub.dev/packages/json_serializable#build-configuration field name <code dart> import 'package:json_annotation/json_annotation.dart'; part 'wine.g.dart'; @JsonSerializable() class Wine { String id; @JsonKey(name: 'name_en') String nameEn; @JsonKey(name: 'name_ko') String nameKo; List<String> images; List<Map<String, String>> sell; Wine({this.id, this.nameEn, this.nameKo, this.images, this.sell}); factory Wine.fromJson(Map<String, dynamic> json) => _$WineFromJson(json); Map<String, dynamic> toJson() => _$WineToJson(this); } </code> open/json-serializable.txt Last modified: 2024/10/05 06:15by 127.0.0.1