DynamicContent.fromJson constructor

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

Implementation

factory DynamicContent.fromJson(Map<String, dynamic> json) {
  final content = Map.fromEntries(
      json.entries.where((e) => !topLevelKeys.contains(e.key)));
  final transformed = Map.fromEntries(
      json.entries.where((e) => topLevelKeys.contains(e.key)));
  transformed['content'] = content;
  return _$DynamicContentFromJson(transformed);
}