ConsentInfo.fromJson constructor

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

Implementation

factory ConsentInfo.fromJson(Map<String, dynamic> json) {
  final String? acceptedAtString = json['acceptedAt'] as String?;
  final DateTime? acceptedAt = acceptedAtString != null
      ? DateTime.parse(acceptedAtString).toUtc()
      : null;

  return ConsentInfo(
    id: json['id'] as String,
    type:  json['type'] as String,
    title: json['title'] as String,
    content: json['content'] as String,
    acceptedAt: acceptedAt,
  );
}