Contact.fromJson constructor

Contact.fromJson(
  1. Map<String, dynamic> json
)

Implementation

factory Contact.fromJson(Map<String, dynamic> json) {
  return Contact(
    id: json['id'] ?? "",
    creatorId: json['creatorId'] ?? "",
    organizationId: json['organizationId'] ?? " ",
    name: json['name'] ?? "",
    phone: json['phone'] ?? "",
    createdAt: DateTime.tryParse(json['createdAt']) ?? DateTime.now(),
    updatedAt: DateTime.tryParse(json['updatedAt']) ?? DateTime.now(),
  );
}