toJson method

Map<String, dynamic> toJson()

Implementation

Map<String, dynamic> toJson() {
  final Map<String, dynamic> data = {};
  data['userId'] = userId;
  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;
}