Map<String, Object?> toJson() => { 'name': name, if (isModal) 'isModal': true, if (depth > 1) 'depth': depth, };