import 'package:isar/isar.dart'; import 'package:json_annotation/json_annotation.dart'; part 'rank.g.dart'; @collection @JsonSerializable() class Ranking { @JsonValue(0) late Id? id = Isar.autoIncrement; @JsonKey(name: "ranking") late List ranks; Ranking(); factory Ranking.fromJson(Map json) => _$RankingFromJson(json); Map toJson() => _$RankingToJson(this); } @embedded @JsonSerializable() class Rank { late int id; late String zip; String? area; late List vehicles; Rank(); factory Rank.fromJson(Map json) => _$RankFromJson(json); Map toJson() => _$RankToJson(this); } @embedded @JsonSerializable() class Vehicle { late int id; late int type; late int? cnt; @JsonKey(name: 'self', defaultValue: false) late bool? self; Vehicle(); factory Vehicle.fromJson(Map json) => _$VehicleFromJson(json); Map toJson() => _$VehicleToJson(this); }