42 lines
710 B
Dart
42 lines
710 B
Dart
import 'package:isar/isar.dart';
|
|
import 'package:json_annotation/json_annotation.dart';
|
|
|
|
part 'rank.g.dart';
|
|
|
|
@collection
|
|
@JsonSerializable()
|
|
class Rank {
|
|
late Id id;
|
|
|
|
late String zip;
|
|
|
|
late String area;
|
|
|
|
late int time;
|
|
|
|
late List<Vehicle> vehicles;
|
|
|
|
Rank();
|
|
|
|
factory Rank.fromJson(Map<String, dynamic> json) => _$RankFromJson(json);
|
|
|
|
Map<String, dynamic> 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<String, dynamic> json) => _$VehicleFromJson(json);
|
|
|
|
Map<String, dynamic> toJson() => _$VehicleToJson(this);
|
|
}
|