ProfileDTO.fromJson constructor
ProfileDTO.fromJson(
- Map<String, dynamic> json
)
Implementation
ProfileDTO.fromJson(Map<String, dynamic> json) : super.fromJson(json) {
email = json['email'];
passwordChangedAt = json['passwordChangedAt'];
isGuest = json['isGuest'];
isTest = json['isTest'];
type = json['type'];
detail = json['detail'] != null ? Detail.fromJson(json['detail']) : null;
if (json['addresses'] != null) {
addresses = <AddressDTO>[];
json['addresses'].forEach((v) {
addresses!.add(AddressDTO.fromJson(v));
});
}
if (json['roles'] != null) {
roles = <RoleDTO>[];
json['roles'].forEach((v) {
roles!.add(RoleDTO.fromJson(v));
});
}
if (json['stores'] != null) {
stores = <StoreDTO>[];
json['stores'].forEach((v) {
stores!.add(StoreDTO.fromJson(v));
});
}
}