Initial draft
This commit is contained in:
16
lib/dto/driver.dart
Normal file
16
lib/dto/driver.dart
Normal file
@ -0,0 +1,16 @@
|
||||
import 'car.dart';
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
part 'driver.g.dart';
|
||||
|
||||
@JsonSerializable(fieldRename: FieldRename.snake)
|
||||
class DriverDTO {
|
||||
DriverDTO({required this.id, required this.name, required this.salutation, required this.cars});
|
||||
String id;
|
||||
String name;
|
||||
String salutation;
|
||||
List<CarDTO> cars;
|
||||
|
||||
factory DriverDTO.fromJson(Map<String, dynamic> json) => _$DriverDTOFromJson(json);
|
||||
Map<dynamic, dynamic> toJson() => _$DriverDTOToJson(this);
|
||||
}
|
||||
Reference in New Issue
Block a user