Map<String, dynamic> toJson() { final result = <String, dynamic>{}; for (final attr in attributes) { result.addAll(attr.toJson()); } return result; }