StoryContent.fromJson constructor
StoryContent.fromJson(
- Map json
Implementation
StoryContent.fromJson(Map<dynamic, dynamic> json) {
title = json['title'] ?? '';
if (json['link'] != null) {
link = StoryLink.fromJson(json['link']);
}
if (json['typography'] != null) {
typography = StoryTypography.fromJson(json['typography']);
}
if (json['animation'] != null) {
animation = StoryAnimation.fromJson(json['animation']);
}
if (json['spacing'] != null) {
spacing = StorySpacing.fromJson(json['spacing']);
}
if (json['paddingContent'] != null) {
padding = EdgeInsets.only(
top: toDouble(json['paddingContent']['top']) ?? 0.0,
bottom: toDouble(json['paddingContent']['bottom']) ?? 0.0,
left: toDouble(json['paddingContent']['left']) ?? 0.0,
right: toDouble(json['paddingContent']['right']) ?? 0.0,
);
}
}