21 lines
578 B
Dart
21 lines
578 B
Dart
import 'package:json_annotation/json_annotation.dart';
|
|
|
|
part 'car_add.g.dart';
|
|
|
|
@JsonSerializable(fieldRename: FieldRename.snake)
|
|
class CarAddDTO {
|
|
CarAddDTO(
|
|
{required this.teamId,
|
|
required this.plate});
|
|
|
|
final int teamId;
|
|
final String plate;
|
|
|
|
factory CarAddDTO.fromJson(Map<String, dynamic> json) => _$CarAddDTOFromJson(json);
|
|
factory CarAddDTO.make(int teamID, String plate) {
|
|
Map<String, dynamic> data = {"team_id": teamID, "plate": plate};
|
|
return CarAddDTO.fromJson(data);
|
|
}
|
|
Map<dynamic, dynamic> toJson() => _$CarAddDTOToJson(this);
|
|
}
|