Assign.fromJson constructor

Assign.fromJson(
  1. Map<String, dynamic> json,
  2. String id
)

Implementation

factory Assign.fromJson(Map<String, dynamic> json, String id) {
  final Timestamp? createdAt = json['createdAt'];
  final Timestamp? updatedAt = json['updatedAt'];
  return Assign(
    id: id,
    uid: json['uid'],
    taskId: json['taskId'],
    status: json['status'],
    createdAt: createdAt == null ? DateTime.now() : createdAt.toDate(),
    updatedAt: updatedAt == null ? DateTime.now() : updatedAt.toDate(),
  );
}