toJson method
Implementation
Map<String, dynamic> toJson() {
return {
'id': id,
'name': name,
'type': type,
if (data != null) 'data': data,
if (createdAt != null) 'createdAt': createdAt?.toIso8601String(),
if (updatedAt != null) 'updatedAt': updatedAt?.toIso8601String(),
};
}