ConditionalLayout<T extends ContentItem>.fromJson constructor

ConditionalLayout<T extends ContentItem>.fromJson(
  1. Map<String, dynamic> json
)

Implementation

factory ConditionalLayout.fromJson(Map<String, dynamic> json) {
  final type = vyuh.content.provider.schemaType(json);

  final layout = vyuh.content.fromJson<LayoutConfiguration>(json) ??
      UnknownConditionalLayout(missingSchemaType: type);

  return layout as ConditionalLayout<T>;
}