Map<String, dynamic> toJson() { final serializer = this.serializer; return { if (serializer != null) 'Serializer': serializer, }; }