fromJson static method

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

Implementation

static LayoutNode fromJson(Map<String, dynamic> json) {
  if (json['type'] == 'leaf') {
    return LeafNode.fromJson(json);
  } else if (json['type'] == 'split') {
    return SplitNode.fromJson(json);
  }
  throw Exception('Unknown node type');
}