Map<String, Object?> toJson() => { 'primitives': [for (final primitive in primitives) primitive.toJson()], };