toJson method
Implementation
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['id'] = id;
map['userId'] = userId;
map['roleKey'] = roleKey;
map['parentId'] = parentId;
map['weight'] = weight;
map['name'] = name;
map['isDept'] = isDept;
if (children != null) {
map['children'] = children?.map((v) => v.toJson()).toList();
}
return map;
}