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