Story.fromJson constructor

Story.fromJson(
  1. Map json
)

Implementation

Story.fromJson(Map<dynamic, dynamic> json) {
  // ignore: avoid_as
  layout = json['layout'] ?? '' as int?;
  urlImage = json['urlImage'] ?? '';
  contents = [];
  if (json['contents'] != null && json['contents'].isNotEmpty) {
    for (final item in json['contents']) {
      contents!.add(StoryContent.fromJson(item));
    }
  }
}