StoryConfig.fromJson constructor
StoryConfig.fromJson(
- Map json
Implementation
StoryConfig.fromJson(Map<dynamic, dynamic> json) {
name = json['name'] ?? 'Stories';
active = json['active'] ?? false;
countColumn = json['countColumn'] ?? 4;
isHorizontal = json['isHorizontal'] ?? true;
radius = toDouble(json['radius'] ?? 10.0);
data = [];
if (json['data']?.isNotEmpty ?? false) {
for (final item in json['data']) {
final story = Story.fromJson(item);
data!.add(story);
}
}
}