toJson method
Implementation
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = {};
data['userId'] = userId;
data['name'] = null;
data['email'] = null;
if (email != null) {
data['email'] = email!.toJson();
}
if (name != null) {
data['name'] = name!.toJson();
}
if (addresses != null) {
data['addresses'] = addresses!.map((v) => v.toJson()).toList();
}
if (phones != null) {
data['phones'] = phones!.map((v) => v.toJson()).toList();
}
return data;
}