Initial draft
This commit is contained in:
15
lib/dto/customer.dart
Normal file
15
lib/dto/customer.dart
Normal file
@ -0,0 +1,15 @@
|
||||
import 'address.dart';
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
part 'customer.g.dart';
|
||||
|
||||
@JsonSerializable(fieldRename: FieldRename.snake)
|
||||
class CustomerDTO {
|
||||
CustomerDTO({required this.name, required this.address});
|
||||
|
||||
String name;
|
||||
AddressDTO address;
|
||||
|
||||
factory CustomerDTO.fromJson(Map<String, dynamic> json) => _$CustomerDTOFromJson(json);
|
||||
Map<dynamic, dynamic> toJson() => _$CustomerDTOToJson(this);
|
||||
}
|
||||
Reference in New Issue
Block a user