toJson method

Map<String, dynamic> toJson()

Implementation

Map<String, dynamic> toJson() {
  return {
    'id': id,
    'title': title,
    'code': code,
    'isCheck': isCheck,
    'hierarchy': hierarchy,
    'parent': parent?.title,
    'children': children.map((child) => child.toJson()).toList(),
  };
}