Tag.fromJson constructor

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

Implementation

factory Tag.fromJson(Map<String, dynamic> json) {
  return Tag(
    id: json['id'] ?? '',
    name: json['name'] ?? '',
    createdAt: json['createdAt'] != null ? DateTime.parse(json['createdAt']) : null,
    updatedAt: json['updatedAt'] != null ? DateTime.parse(json['updatedAt']) : null,
  );
}