import 'package:isar/isar.dart'; import 'package:json_annotation/json_annotation.dart'; part 'ranking.g.dart'; @collection @JsonSerializable() class Ranking { @JsonKey(name: 'id', defaultValue: 0) late Id id = 0; 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; late String area; late String time; 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; @JsonKey(name: 'self', defaultValue: false) late bool? self; Vehicle(); factory Vehicle.fromJson(Map json) => _$VehicleFromJson(json); Map toJson() => _$VehicleToJson(this); }