NewsDto.fromJson constructor
Implementation
factory NewsDto.fromJson(Map<String, dynamic> json) {
return NewsDto(
id: json["id"] as String,
title: json["title"] as String?,
text: json["text"] as String?,
imageResource: json["imageResource"] as String?,
activatedAt: json["activatedAt"] == null
? null
: DateTime.parse(json["activatedAt"] as String),
stores: (json["stores"] as List<dynamic>?)
?.map((e) => NewsStoreDto.fromJson(e as Map<String, dynamic>))
.toList(),
);
}