TreeNode.fromJson constructor

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

Implementation

factory TreeNode.fromJson(Map<String, dynamic> json) {
  return TreeNode(
    checked: json['checked'] ?? false,
    show: json['show'] ?? false,
    id: json['id'] ?? 0,
    pid: json['pid'] ?? 0,
    commonID: json['commonID'] ?? 0,
    title: json['title'] ?? '',
    children: (json['children'] as List<dynamic>)
        .map((childJson) => TreeNode.fromJson(childJson))
        .toList(),
  );
}