How to ensure that custom fields appear only for one category of products?

Hello,
I am creating custom fields via code but I want them to be visible only for one category of products. How do I do this?

I would only show them if they are filled. And then, don’t fill them if not needed.

Apologies. I meant that custom fields should not be visible in administration if the category is not the one.

Within the standard, it is not possible.

You have to change the shopware administration templates (guess it would be VUE) to only show the customs fields in only one category.