Map<String, dynamic> toJson() { final json = <String, dynamic>{}; json[r'id'] = id; if (name != null) { json[r'name'] = name; } return json; }